By derridaDD on
Hi
i have a front-page.tpl file that load external php files according to a click on some links.
it works great but one this: it is a multi language site. if i print $language->language on the front page it does change when i switch language. but on the loaded page it is always give me the same language.
so i need to pass the language variable to the external loaded page.
at the top of the external loaded page i have this:
//set the working directory to your drupal root
chdir('/');
//require the bootstrap include
require_once '/includes/bootstrap.inc';
//load drupal
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
i thought that will give me access to the language variable cause with it i do query the database.
any idea?
Comments
a step foreward?
hi
i separate the front-page.tpl and the external loaded files since they load galleries. and so when the site load it load fast and only when the user press the button for a gallery it will load. and it does work but it is a multilanguage site.
i have tried the global $language and it works inside the tpl files but not in the loaded files.
i tried a different approach and moved one step but now i have another issue:
since the current language is reflected in the url i explode the url and get the language: this seem to work but when i ask for the hebrew images it works and when i switch to english it does not load EVEN though in phpmyadmin the query works fine.
this is the code:
in the code you can see that i print the $thelang variable and that does change from 'he' to 'en'.
any idea?