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: Custom {TOKEN}s?  (Read 3441 times)

0 Members and 1 Guest are viewing this topic.

Jeremy Rasmussen

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Custom {TOKEN}s?
« on: August 18, 2007, 09:45:29 pm »

I've been trying to figure out how to make a custom {TOKEN}, I've found plenty of posts to add buttons to the menus but I don't want to add buttons.  Can someone point me in the right direction or post an example of the code I should add to template.php?

Thanks!
« Last Edit: August 28, 2007, 12:05:44 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Custom {TOKEN}s?
« Reply #1 on: August 18, 2007, 10:10:47 pm »

Depends where you add the tokens. There is no such file as template.php.
Logged

Jeremy Rasmussen

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Custom {TOKEN}s?
« Reply #2 on: August 18, 2007, 10:48:35 pm »

My mistake, theme.php.

I imagine that I just want to add above {GALLERY}, I have see someone comment that you have to code differently when you add "south" of the {GALLERY}.  Lets just stick with above for now.
Logged

Nibbler

  • Guest
Re: Custom {TOKEN}s?
« Reply #3 on: August 18, 2007, 10:55:33 pm »

To do that, copy the pageheader function from the sample theme to your theme.php and add in a new '{TOKEN}' => 'replacement' pair.
Logged

Elwood J. Blues

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Eymard.net
Re: Custom {TOKEN}s?
« Reply #4 on: August 23, 2007, 08:41:12 am »

Hello Jeremy !

I give a solution in French Support section...
[add by PYAP] http://forum.coppermine-gallery.net/index.php?topic=46175.msg220638#msg220638 [/add]
 


theme.php
Code: [Select]
function example()
{

$retour = "";
           $retour .=  "Hello world !";
           return $retour;


}


// Function for writing a pageheader
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

        $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
        header("Content-Type: text/html; charset=$charset");
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
'{EXAMPLE}' => example(),
        );

    echo template_eval($template_header, $template_vars);
}

I think that help you...

Sorry for my English...
« Last Edit: August 23, 2007, 11:32:41 am by PYAP »
Logged
Avant de poser une question passez par ici . 90% des réponses s'y trouvent !

Jeremy Rasmussen

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Custom {TOKEN}s?
« Reply #5 on: August 28, 2007, 02:05:14 am »

Great, Thanks for the help!  ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.