Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Includes in custom pageheader()  (Read 2997 times)

0 Members and 1 Guest are viewing this topic.

Michi

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Includes in custom pageheader()
« on: March 09, 2005, 02:36:41 pm »

Hey.

This is what my pageheader-function looks like now:

Code: [Select]
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.

Code: [Select]
$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...?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Includes in custom pageheader()
« Reply #1 on: March 09, 2005, 06:06:59 pm »

You have 1.2 installed but you posted in the 1.3 sub board? ???
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.