forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: cynikalsam on January 02, 2005, 07:49:16 pm

Title: Defining phpbb variables for use in template.html
Post by: cynikalsam on January 02, 2005, 07:49:16 pm
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
Code: [Select]
include($phpbb_root_path . 'includes/page_header.php'); but it doesnt work..

Any ideas?
Title: Re: Defining phpbb variables for use in template.html
Post by: Joachim Müller on January 02, 2005, 11:40:14 pm
the theme system just doesn't work that way...

Joachim
Title: Re: Defining phpbb variables for use in template.html
Post by: cynikalsam on January 03, 2005, 12:04:51 am
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?
Title: Re: Defining phpbb variables for use in template.html
Post by: Joachim Müller on January 03, 2005, 12:09:14 am
search for "custom header"...

Joachim
Title: Re: Defining phpbb variables for use in template.html
Post by: cynikalsam on January 06, 2005, 11:30:13 am
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;

Code: [Select]
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.
Title: Re: Defining phpbb variables for use in template.html
Post by: Joachim Müller on January 07, 2005, 11:19:44 am
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