Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: seo title for gallery  (Read 8307 times)

0 Members and 1 Guest are viewing this topic.

profusion

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
seo title for gallery
« on: February 06, 2007, 12:02:59 am »

Hello
i want, if i go to album as ( paris hilton ) the my title album show only paris hilton
but now, if i go to paris hilton album, my title address show : my gallery name - paris hilton
do you know how can i do it please ?
thank you
« Last Edit: February 09, 2007, 07:43:30 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: seo title for gallery
« Reply #1 on: February 06, 2007, 08:06:14 am »

The page title is being defined in themes/yourtheme/theme.php - find in that file
Code: [Select]
function pageheaderIf this line of code exists, edit as suggested below. If it doesn't exist, copy
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);
}
from themes/sample/theme.php into a new line before
Code: [Select]
?>of the file themes/yourtheme/theme.php

In above mentioned function definition, find
Code: [Select]
'{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),and replace with
Code: [Select]
'{TITLE}' => strip_tags(bb_decode($section)),.
Save the file, upload it to your webserver and you're done.

Moving to theme sub board.
Logged

profusion

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: seo title for gallery
« Reply #2 on: February 06, 2007, 09:21:48 am »

Hello, GauGau
i can"t find
Quote
function pageheader
in theme.php i look for in thie themes classic & fruity but i can't find that
i am new
can you more & easy guide me please
thank you
Logged

Nibbler

  • Guest
Re: seo title for gallery
« Reply #3 on: February 06, 2007, 03:21:01 pm »

Copy it from the sample theme.php
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: seo title for gallery
« Reply #4 on: February 07, 2007, 07:23:11 am »

...as I suggested:
If this line of code exists, edit as suggested below. If it doesn't exist, copy [...] from themes/sample/theme.php
I even posted the full code, so you don't even have to copy it from themes/sample/theme.php, but you can copy it directly from my posting.

can you more & easy guide me please
Instructions don't get easier than what I said - if those instructions are too complicated for you, I suggest hiring someone to apply the changes for you.
Logged

jtothek3030

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Re: seo title for gallery
« Reply #5 on: February 08, 2007, 04:22:48 pm »

Hi, i used the above modifications and it works well, but my only problem is that now the title on my home page is displayed as "Home", which follows from the code change.  But, i would like to modify this to include Gallery Name before home, "Gallery Name - Home"
Do you know where i could modify this.
Cheers,
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: seo title for gallery
« Reply #6 on: February 08, 2007, 07:25:37 pm »

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();

    if (strip_tags(bb_decode($section)) == 'Home') {
        $title = $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section));
    } else {
        $title =  strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name'];
    }

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $title,
        '{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);
}
Logged

jtothek3030

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Re: seo title for gallery
« Reply #7 on: February 08, 2007, 09:40:04 pm »

hey thanks, the only modification i made was to the if else statement, which now displays what i want; <title>Gallery title</title> on home page and <title>Album title</title> for page source on other pages, cheers

if (strip_tags(bb_decode($section)) == 'Home') {
        $title = $CONFIG['gallery_name'];
    } else {
        $title =  strip_tags(bb_decode($section));
    }
Logged

yakamoz01

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
  • www.unluler.info
    • Gizemli ünlüler
Re: seo title for gallery
« Reply #8 on: February 12, 2007, 03:26:14 pm »

thanks i will try it
Logged

afg89

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
    • Free PSP Wallpapers
Re: seo title for gallery
« Reply #9 on: August 23, 2007, 08:16:40 pm »

Example " mysite.com - Games/Prime "   How to replace / by -    anyone ?
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.