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: Where is $section variable set  (Read 5156 times)

0 Members and 1 Guest are viewing this topic.

kingspice

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Where is $section variable set
« on: August 29, 2012, 05:30:33 pm »

Hi,
I was wondering in which file is the $section variable set. Its called in several functions e.g.
in theme.php
'{TITLE}' => theme_page_title($section),

Thanks
Gareth
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Where is $section variable set
« Reply #1 on: August 29, 2012, 09:32:37 pm »

Please explain what you're trying to accomplish. That variable isn't always the same thing and is usually set while calling the pageheader() function.
« Last Edit: August 29, 2012, 10:27:26 pm by Jeff Bailey »
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

kingspice

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Where is $section variable set
« Reply #2 on: August 31, 2012, 04:10:15 pm »

I'm trying to echo the same value, that gets set to the title of the page, via theme_page_title, (without the gallery_name), in a seperate included file.

function theme_page_title($section)
{
    global $CONFIG;
    $return = strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name'];
    return $return;
}
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Where is $section variable set
« Reply #3 on: August 31, 2012, 11:41:13 pm »

Please post a link.
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616

Like I said that value changes, which one would you like to include on the other page?
If you include coppermine code on your included page you can add
Code: [Select]
pageheader('whatever you want for the title');
to and it will display it as the title for you.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

kingspice

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Where is $section variable set
« Reply #4 on: September 01, 2012, 12:44:22 am »

Gallery is http://www.parishiltonzone.com/pictures (few raunchy pics)
I haven't implemented anything yet so doesn't really help with my question.

I basically want to set my own custom description meta tag on the page with the value in it:
strip_tags(bb_decode($section))
that is set in the function I listed above
theme_page_title($section)

Hope this makes it clearer
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Where is $section variable set
« Reply #5 on: September 01, 2012, 02:34:03 am »

I understand what you want but you're not understanding me.

No one can tell you what the value is becuase it changes on every page.

That function doesn't set the value of $section it is set when the function is called.
You'll have to give me specfics about what you want as the title not just that it is the same as that variable.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

kingspice

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Where is $section variable set
« Reply #6 on: September 02, 2012, 01:35:44 am »

I want the name of the coppermine page, that is essentially output in the title, before the name of the coppermine gallery.

For example:
If coppermine root page - "Home"
If album page - The album name
If category page - The category name/path
If picture page - The album name + picture name
If search page - "Search"

Sorry for not giving you a clearer answer sooner - hope that answers you :)
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Where is $section variable set
« Reply #7 on: September 02, 2012, 02:59:27 am »

Ok that is clearer, so you want the dynamic title and not some static text.

How are you displaying your separate file? in anycontent? custom header/footer? Is it a separate page entirely?
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

kingspice

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Where is $section variable set
« Reply #8 on: September 02, 2012, 04:19:05 pm »

Yep exactly - the dynamic title.

I am displaying the seperate php file using {CUSTOM_HEADER}
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: Where is $section variable set
« Reply #9 on: September 02, 2012, 06:51:20 pm »

Something like this should work.

add to your custom theme.php
Code: [Select]
/******************************************************************************
** Section <<<pageheader>>> - START
******************************************************************************/
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir, $custom_title;

    $custom_title = $section;

    $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}' => theme_page_title($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,
        '{JAVASCRIPT}' => theme_javascript_head(),
        '{MESSAGE_BLOCK}' => theme_display_message_block(),
    );
   
    $template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars);
    echo template_eval($template_header, $template_vars);

    // Show various admin messages
    adminmessages();
}
/******************************************************************************
** Section <<<pageheader>>> - END
******************************************************************************/

In your include file add
Code: [Select]
global $custom_title;
echo $custom_title;
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

kingspice

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Where is $section variable set
« Reply #10 on: September 02, 2012, 07:20:36 pm »

Perfect - thanks for the help!
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.