On Wed, 09 Jan 2008 01:46:24 +0100 Davide Michel 'ZioBudda' Morelli michel@ziobudda.net wrote:
Hi all and sorry for this stupid question (any RTFM is wellcome).
I want to create a page (say foo.php) inside a bar/ directory that when call display me (via browser) some info stored in a variable ($foo). So I have $foo, I have my themes, I have my bar/foo.php url, but how can I do an all in one ?
This is my simple code for bar/foo.php:
<? require_once '../includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); $page = "io sono la pagina"; echo theme('page',$page); ?>
And the php-error is :
PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required './includes/cache.inc' (include_path='/opt/www/newzb/:.:..') in /opt/www/newzb/includes/bootstrap.inc on line 895
If I move foo.php from bar/ to / and changhe ../includes in ./includes all works.
I bet because paths in bootstrap.inc are relative. Wouldn't it be better to write a custom template for that page? You can redefine the *whole* page. You just have to write a custom page.tpl.php. It is described at page 115 in Pro Drupal Developement.
There are some modules that let you change the first page too etc...
I wouldn't work against the CMS and its api.