coppermine-gallery.com/forum

Support => Older/other versions => cpg1.1.X Support (standalone) => Topic started by: Ted on November 04, 2003, 03:56:10 PM

Title: Moving the Categorys into a menu
Post by: Ted on November 04, 2003, 03:56:10 PM
basicly i want to create a menu with the Categorys as apposed to the standard layout.

i would like it so in the template i can simpliy add something like {CATS} and then configure theme.php to produce the required code.

but how do i change themes.php, i.e how do i create my own inclusions into the template.html ?

i hope this makes sense to some one  :D


cheers

Ted
Title: Moving the Categorys into a menu
Post by: Ted on November 04, 2003, 03:59:20 PM
btw heres the addy if it helps http://www.northerndescent.wired-hub.net/pics/
Title: Moving the Categorys into a menu
Post by: Joachim Müller on November 04, 2003, 07:00:31 PM
no, won't work that way (at least not that easily). I suggest you take a look at the faq, look for http://coppermine.sourceforge.net/faq.php?q=customHeader#customHeader

GauGau
Title: Moving the Categorys into a menu
Post by: Ted on November 04, 2003, 09:49:31 PM
i get the following error when i add that code:

QuoteParse error: parse error, expecting `','' or `';'' in /home/northern/public_html/pics/themes/pug205/theme.php on line 656

Fatal error: Call to undefined function: pageheader() in /home/northern/public_html/pics/index.php on line 439


if(empty($custom_header)){
      include('custom.php');
      static $custom_header = ob_get_contents(); error some where here
      ob_clean();
   }


can anyone help ?

cheers  :) [/quote]
Title: Moving the Categorys into a menu
Post by: Joachim Müller on November 05, 2003, 12:04:00 AM
a parse error should be easy to track, it usually means you've ommited a semicolon, bracket or quote (it's in fact the most common php error). Please double-check your code.

GauGau
Title: Moving the Categorys into a menu
Post by: Ted on November 05, 2003, 09:45:36 AM
yeah i hav highlighted the parse error above (bold)

but as i don't know php i don't know whats missing etc.

cheers

Ted
Title: Moving the Categorys into a menu
Post by: moorey on November 05, 2003, 10:00:29 AM
Try:if(empty($custom_header)){
require("http://www.path.to/include.file");
$custom_header = ob_get_contents();
ob_clean();
}
Title: :)
Post by: Ted on November 05, 2003, 07:07:01 PM
:)

yep thats fixed the errors

but it still doesn't include the custom file.


i have checked the path to the file and its perfect.

heres the complete code:


Quotefunction pageheader($section, $meta = '')
{
        global $CONFIG, $THEME_DIR;
        global $template_header, $lang_charset, $lang_text_dir;
       
        if(empty($custom_header)){
      require('custom.php');
      $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);
}


not sure if i'v missed anything

cheers

t.
Title: Moving the Categorys into a menu
Post by: Joachim Müller on November 05, 2003, 11:21:38 PM
use the absolute path or the uri for require('custom.php');

GauGau
Title: Moving the Categorys into a menu
Post by: Ted on November 06, 2003, 01:40:21 PM
still no luck  :oops:
Title: Moving the Categorys into a menu
Post by: Ted on November 06, 2003, 02:14:03 PM
thanks for all your help so far


i'm not sure what i am trying to do is 100% necessary either

if you look at my dev project :

http://www.northerndescent.wired-hub.net/pics/

you see
Quote> Team Riders
.......................................
> Race Images
.......................................

basicly i want to move that to

Quote> SEGSG
.......................................
> SEGSEG
.......................................
> SGSEG
.......................................

i know i could use CSS to position it there but i would rather position it there in the table.

So is there anyway i can just get the cats to display here?

could i some how put the cats in the things used in the template,

i.e
{GAL_NAME}
{GAL_DESCRIPTION}
{GALLERY}

so i could then create my own {cats go here} thing ?


hope this makes sense  :?


cheers


Ted
Title: Moving the Categorys into a menu
Post by: Joachim Müller on November 06, 2003, 07:05:38 PM
you could, if you know enough php.
If I were you, I'd go for the custom header, or even better: just enter the menu statically (in template.html) - I don't think you'll change your menu/navigation structure that often...

GauGau
Title: Moving the Categorys into a menu
Post by: Ted on November 06, 2003, 09:27:44 PM
yeah it think you right with the static idea  8)

just would have been great to be able to have a dynamic layout

thanks for the help anyway  :D

expect a few more question like this one to come   :wink: