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: Change Homepage title  (Read 3873 times)

0 Members and 1 Guest are viewing this topic.

garyafarmer

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Change Homepage title
« on: October 24, 2006, 11:59:58 am »

I am trying to remove "Home -" from the home page title (index.php) and replace with custom text. If I change it in the english.php file it also changes the word "Home" in the Breadcrumbs.

Can this be done and if so how?

If I can't remove "Home -" is there a way to add additional text infront of it without it affecting the Breadcrumbs? This text would need to only display on the index.php file.

Thank you in advance
« Last Edit: October 24, 2006, 09:35:15 pm by Sami »
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: Change Homepage title
« Reply #1 on: October 24, 2006, 03:29:45 pm »

Here's what I was able to come up with. Copy the function pageheader from the themes=>sample=>theme.php and paste into your theme.php file before the ?>.

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

    echo template_eval($template_header, $template_vars);
}

Before this line:
Code: [Select]
    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
add
Code: [Select]
    if ((defined('INDEX_PHP')) && (empty($_GET['cat'])) && (empty($_GET['album']))) {
    $new_title = "add new title here";
    } else {
$new_title = $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)); 
}

Change this line:
Code: [Select]
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
to this
Code: [Select]
        '{TITLE}' => $new_title,
You will need to change add new title here to suit your needs.
Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

garyafarmer

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Change Homepage title
« Reply #2 on: October 24, 2006, 09:19:21 pm »

Worked perfectly - Thank you
Logged

juliub

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Change Homepage title
« Reply #3 on: May 26, 2007, 01:03:58 pm »

Gizmo,

the mod works fine, but when I open the intermediate page picture with the static link, it gives me the same title of the home page, instead of the picture title.

JuliuB
Logged

juliub

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Change Homepage title
« Reply #4 on: May 29, 2007, 06:05:00 pm »

I solved. In the code above, I changed

THIS:
Code: [Select]
  if ((defined('INDEX_PHP')) && (empty($_GET['cat'])) && (empty($_GET['album']))) {

with THIS:
Code: [Select]
  if ((defined('INDEX_PHP')) && (empty($_GET['pos'])) && (empty($_GET['cat'])) && (empty($_GET['album']))) {

Now the static file has the rigth title.

It works now, I hope I didn't anything wrong.  ???
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.