Add a menue on the left Add a menue on the left
 

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

Add a menue on the left

Started by Netrus, May 09, 2005, 12:59:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Netrus

Hi everyone.
Well, I hope this is the right forum for my question. Maybe you can help me.
I tried to Add a menue on the left side of the gallery. You can see it there: http://gallery.elvado.de/themes/water_drop/template.html! As you can see (gallery.elvado.de), it doesn't works. I copied that part of the FAQ:
function pageheader($section, $meta = '')
{
   global $CONFIG, $THEME_DIR;
   global $template_header, $lang_charset, $lang_text_dir;

   if(empty($custom_header)){
      include('left-menue.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(),
      '{CUSTOM_HEADER}' => $custom_header,
   );

   echo template_eval($template_header, $template_vars);
}

The file left-menue.php is in the main folder (gallery.elvado.de/)

And now it says:
QuoteParse error: parse error, unexpected '(', expecting ',' or ';' in /www/htdocs/netrus/themes/water_drop/theme.php on line 834
Line 834 is
Quotestatic $custom_header = ob_get_contents();

Do you know what's my mistake? Or what I have to change?

((My Por

Nibbler

Split it onto 2 lines:


static $custom_header;
$custom_header = ob_get_contents();

Netrus

Ok, now there's no error, but it doesn't replace  {CUSTOM_HEADER}  ??? (menue-left.php should echo "test")

Nibbler

What you added is not a custom header, but a custom footer. You need to make the changes to the pagefooter function instead of the pageheader function.

// Function for writing a pagefooter
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $ALBUM_SET, $CONFIG, $time_start, $query_stats;
    global $template_footer;

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

   if(empty($custom_header)){
      include('left-menue.php');
      static $custom_header;
  $custom_header = ob_get_contents(); 
      ob_clean();
   }

   $template_vars = array(
      '{CUSTOM_HEADER}' => $custom_header,
   );

   echo template_eval($template_footer, $template_vars);
}

Netrus

#4
Ok, Thanks.
But now there is a new Problem, the menue ("test") is on the place a footer normaly should be, and not in the table i created in template.html! There do i have to change that?

Thanks for helping me!

//Edit:
Arg, the Sourcecode looks very strange. Seems like I have to repair a lot. Always hard to modify a system, you havn't understand completely ;)

//Edit2:
A, know i see. For some reasons, the beginning of the footer (untill {CUSTOM_HEADER}) is in the top of the page ... not as complicated as i thought :)

Nibbler

I don't know why that happened. If you can re-arrange the tables so that the custom header/footer comes before the {GALLERY} tag in the html code in template.html then you can have it as a custom header and it should be ok.

Netrus

Wow, thanks a lot. It was a bit of work, but i could learn something, and it's a good feeling to solve a problem  ;)

heartburn00

I need help with this too, but I'm not good at this stuff, so can someone please tell me exactly how to do it?