Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Moving the Categorys into a menu  (Read 9190 times)

0 Members and 1 Guest are viewing this topic.

Ted

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Moving the Categorys into a menu
« 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
Logged

Ted

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Moving the Categorys into a menu
« Reply #1 on: November 04, 2003, 03:59:20 pm »

btw heres the addy if it helps http://www.northerndescent.wired-hub.net/pics/
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Moving the Categorys into a menu
« Reply #2 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
Logged

Ted

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Moving the Categorys into a menu
« Reply #3 on: November 04, 2003, 09:49:31 pm »

i get the following error when i add that code:

Quote

Parse 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]
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Moving the Categorys into a menu
« Reply #4 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
Logged

Ted

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Moving the Categorys into a menu
« Reply #5 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
Logged

moorey

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 404
Moving the Categorys into a menu
« Reply #6 on: November 05, 2003, 10:00:29 am »

Try:
Code: [Select]
if(empty($custom_header)){
require("http://www.path.to/include.file");
$custom_header = ob_get_contents();
ob_clean();
}
Logged

Ted

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
:)
« Reply #7 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:


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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Moving the Categorys into a menu
« Reply #8 on: November 05, 2003, 11:21:38 pm »

use the absolute path or the uri for
Code: [Select]
require('custom.php');

GauGau
Logged

Ted

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Moving the Categorys into a menu
« Reply #9 on: November 06, 2003, 01:40:21 pm »

still no luck  :oops:
Logged

Ted

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Moving the Categorys into a menu
« Reply #10 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Moving the Categorys into a menu
« Reply #11 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
Logged

Ted

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Moving the Categorys into a menu
« Reply #12 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:
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 14 queries.