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: Dynamic meta ?  (Read 5005 times)

0 Members and 1 Guest are viewing this topic.

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Dynamic meta ?
« 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
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: Dynamic meta ?
« Reply #1 on: January 01, 2006, 04:17:15 pm »

 ???
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: Dynamic meta ?
« Reply #2 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
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: Dynamic meta ?
« Reply #3 on: March 07, 2006, 12:21:17 am »

 :-\
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Dynamic meta ?
« Reply #4 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

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

just after

Code: [Select]
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 :).
Logged
Chief Geek at Ranium Systems

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: Dynamic meta ?
« Reply #5 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 !!!!
 :)
« Last Edit: March 09, 2006, 11:47:14 pm by antisa33 »
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: Dynamic meta ?
« Reply #6 on: March 11, 2006, 03:23:13 pm »

Thank for the line, i understand it is good.

Code: [Select]
$meta = "<meta name=\"keywords\" content=\"".$CONFIG['gallery_name']."\">";
Now in description meta : can i have the current album_title ? I try

Code: [Select]
<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
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Dynamic meta ?
« Reply #7 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

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

with

Code: [Select]
$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

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

with

Code: [Select]
    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
Logged
Chief Geek at Ranium Systems
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 20 queries.