coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: antisa33 on April 10, 2005, 08:07:28 PM

Title: Dynamic meta ?
Post by: antisa33 on April 10, 2005, 08:07:28 PM
Hello, I have seen in theme.php the line
function pageheader($section, $meta = '<meta name="keywords" content="test">')
I would like to put <meta name="keywords" content="$my_gal_title"> but it's incorect  and my_gal_title is a function, how to put the result of my_gal_title in the $meta keywords ?
In meta name="description" i would like to put the album name, i tried with {GAL_NAME} in content= but it don't want, the syntax is incorect.
What syntax to put ?
Thank you for your help !
Isa
Title: Re: Dynamic meta ?
Post by: antisa33 on January 01, 2006, 04:17:15 PM
 ???
Title: Re: Dynamic meta ?
Post by: antisa33 on January 01, 2006, 06:37:43 PM
How can i wrote

function pageheader($section, $meta = '<meta name="Description" content="$description"><meta name="keywords" content="colorier">')
{

how to add $description ?

Thank you !!
Isa
Title: Re: Dynamic meta ?
Post by: antisa33 on March 07, 2006, 12:21:17 AM
 :-\
Title: Re: Dynamic meta ?
Post by: Abbas Ali on March 07, 2006, 01:30:19 PM
If you want that meta keywords should always be your gallery title then....

Edit themes/yourtheme/theme.php

Add


$meta = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">";


just after


function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;


I didn't understand the second part of your question...


Abbas

P.S: Finally someone replied to you after almost a year :).
Title: Re: Dynamic meta ?
Post by: antisa33 on March 09, 2006, 11:34:05 PM
Thank you for your reply !!
I have dynamic meta but, i cant have this in dynamic when i go on the thumbnails view :
<meta name="Description" content="
How can i have <meta name="Description" content="$title of abum"
when i go on the thumbnails view of an album (here thumbnails.php?album=5 for example)  ?
Thanks a lot !!!!
:)
Title: Re: Dynamic meta ?
Post by: antisa33 on March 11, 2006, 03:23:13 PM
Thank for the line, i understand it is good.

$meta = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">";

Now in description meta : can i have the current album_title ? I try

<meta name=\"Description\" content=\"".$CURRENT_ALBUM_DATA['title']."

but in thumbnails.php it dont know $CURRENT_ALBUM_DATA['title']

Why cant i use this tag ?

Thank you
Title: Re: Dynamic meta ?
Post by: Abbas Ali on March 11, 2006, 06:05:35 PM
Hmmm.... remove the above mentioned mod (i.e. undo the changes mentioned above) and then do the following changes.

Edit thumbnails.php

Replace


pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);


with


$meta = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">\n<meta name=\"description\" content=\"".(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album])."\">";
pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album], $meta);


then edit displayimage.php

Replace


    if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".$CURRENT_PIC_DATA['keywords']."\">"; }


with


    if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".$CURRENT_PIC_DATA['keywords']."\">\n<meta name=\"description\" content=\"".(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album])."\">"; } else {
      $meta_keywords = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">\n<meta name=\"description\" content=\"".(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album])."\">";
    }


By doing above modifications meta keywords and meta description will be shown on thumbnails page and intermediate pic page as you wanted.


Abbas