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: Add a menue on the left  (Read 6548 times)

0 Members and 1 Guest are viewing this topic.

Netrus

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Add a menue on the left
« on: May 09, 2005, 12:59:10 am »

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:
Code: [Select]
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:
Quote
Parse error: parse error, unexpected '(', expecting ',' or ';' in /www/htdocs/netrus/themes/water_drop/theme.php on line 834
Line 834 is
Quote
      static $custom_header = ob_get_contents();

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

((My Por
« Last Edit: May 09, 2005, 05:08:56 am by TranzNDance »
Logged

Nibbler

  • Guest
Re: Add a menue on the left
« Reply #1 on: May 09, 2005, 01:06:40 am »

Split it onto 2 lines:

Code: [Select]
static $custom_header;
$custom_header = ob_get_contents();
Logged

Netrus

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Add a menue on the left
« Reply #2 on: May 09, 2005, 01:20:54 am »

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

Nibbler

  • Guest
Re: Add a menue on the left
« Reply #3 on: May 09, 2005, 01:23:43 am »

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.

Code: [Select]
// 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);
}
Logged

Netrus

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Add a menue on the left
« Reply #4 on: May 09, 2005, 01:32:51 am »

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 :)
« Last Edit: May 09, 2005, 01:41:20 am by Netrus »
Logged

Nibbler

  • Guest
Re: Add a menue on the left
« Reply #5 on: May 09, 2005, 01:43:57 am »

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.
Logged

Netrus

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Add a menue on the left
« Reply #6 on: May 09, 2005, 01:53:17 am »

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  ;)
Logged

heartburn00

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Add a menue on the left
« Reply #7 on: June 12, 2005, 11:58:55 am »

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?
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 20 queries.