Defining phpbb variables for use in template.html Defining phpbb variables for use in template.html
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Defining phpbb variables for use in template.html

Started by cynikalsam, January 02, 2005, 07:49:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cynikalsam

Where would i define phpbb variables to use in links in template.html? I have the integration working fine, so i tried including the phpbb files where i defined the variables.

For example, i had {U_VIEW_PROFILE} defined in the phpbb file includes/page_header.php. So i tried to include that in my template.html by adding include($phpbb_root_path . 'includes/page_header.php'); but it doesnt work..

Any ideas?

Joachim Müller

the theme system just doesn't work that way...

Joachim

cynikalsam

Hmm.. ok then, i'll look for another solution.. Is there a way to create my own variables and if so, which file would i define them in?

Joachim Müller


cynikalsam

Im trying to follow the instructions in the doc's, but im doing something wrong. Im getting the error "Parse error: parse error, unexpected '(', expecting ',' or ';' in /home/cynikals/public_html/gallery/themes/logged/theme.php on line 799"

I get this error no matter what i do to the code. To give you an idea what im doing wrong, here's the last code i tried;

function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

   if(empty($custom_header)){
      include('http://www.mysite.com/forum/includes/page_header.php');
      static $custom_header = ob_get_contents();
      ob_clean();
   }

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,
        '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{MAIN_MENU}' => theme_main_menu(),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{U_VIEW_PROFILE}' => $custom_header,
        );


Where "{U_VIEW_PROFILE}" is what i have in my template.html, and what im trying to get to work. This variable is defined in the /forum/includes/page_header.php file. I've searched, read the docs, and tried over and over. Any help would be appreciated.

Joachim Müller

how is the function "pageheader" suppossed to "know" a var that is being introduced somewhere else if you don't make it global in that function? Obviously you have not followed the instructions posted on the other threads; I went through the process of custom headers for two users in the past few days (in two different threads) - you should be able to re-use the code I posted there. If it doesn't mean anything for you, maybe having a custom header is not meant for you. You should use the path for an include, not the url btw.

Joachim