Error when creating new header Error when creating new header
 

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

Main Menu

Error when creating new header

Started by gw32, January 09, 2005, 11:45:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gw32

I used your suggestion for creating a new custom header.

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

  if(empty($custom_header)){
     include('../header.php'); *My change
     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(),
     '{CUSTOM_HEADER}' => $custom_header,
  );

  echo template_eval($template_header, $template_vars);
}

And now I get this error, everything looks correct to me.

Parse error: parse error, unexpected '(', expecting ',' or ';' in /home2/bmixride/public_html/cpg132/themes/eyeball/theme.php on line 839

I highlighted the error line.

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

  if(empty($custom_header)){
     include('../header.php');
     static $custom_header = ob_get_contents(); *Line 839
     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(),
     '{CUSTOM_HEADER}' => $custom_header,
  );

  echo template_eval($template_header, $template_vars);
}

What is missing?

Thanks