Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Defining phpbb variables for use in template.html  (Read 3515 times)

0 Members and 1 Guest are viewing this topic.

cynikalsam

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Defining phpbb variables for use in template.html
« 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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Defining phpbb variables for use in template.html
« Reply #1 on: January 02, 2005, 11:40:14 pm »

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

Joachim
Logged

cynikalsam

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Defining phpbb variables for use in template.html
« Reply #2 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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Defining phpbb variables for use in template.html
« Reply #3 on: January 03, 2005, 12:09:14 am »

search for "custom header"...

Joachim
Logged

cynikalsam

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Defining phpbb variables for use in template.html
« Reply #4 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Defining phpbb variables for use in template.html
« Reply #5 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
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.