Includes in custom pageheader() Includes in custom pageheader()
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Includes in custom pageheader()

Started by Michi, March 09, 2005, 02:36:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Michi

Hey.

This is what my pageheader-function looks like now:

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

  // this is the place where the custom header file gets included

     ob_start();
     include('/home/docs/php/templates/layout.php');
     beginBody();
     $beginBody = ob_get_contents();
     ob_end_clean();

     ob_start();
     beginPage();
     $beginPage = ob_get_contents();
     ob_end_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(),
       '{BEGIN_PAGE}' => $beginPage,
       '{BEGIN_BODY}' => $beginBody,
       );

   echo template_eval($template_header, $template_vars);
}


The layout.php -file I'm including checks what style template file the page is supposed to use. The template file consists of functions, eg beginBody(), that consist of the template HTML-stuff I'm trying to wrap the Coppermine galleries with.

Problem is that when I try to print out certain stuff, for example the username, the $username variable that is declared in the beginning of the template file, isn't available in the beginBody-function.


$userid = $_REQUEST['bbuserid']; //THIS IS SET IN A COOKIE


It works fine in vBulletin, so I've figured it has something to do with CPG... I have CPG 1.2.0 installed. Does Coppermine somehow "separate" the functions from the original file and therefore loses the variables along the way...?

Tranz

You have 1.2 installed but you posted in the 1.3 sub board? ???