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: meta, keywords  (Read 3189 times)

0 Members and 1 Guest are viewing this topic.

infamousnomie

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
    • http://marketdot.com
meta, keywords
« on: April 16, 2004, 07:58:59 am »

i saw in the theme file that it says in the header {meta} or similar to that i wonder does how to put key words there or does coppermine does itself?? i add the images in using batch add so i dont put any description or keywords do i have to put the keywords for the website manually??
Logged
Hot Wallpapers 3D-Celebrites-Animals-& More
                  http://marketdot.com

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
meta, keywords
« Reply #1 on: April 16, 2004, 08:37:49 am »

next time, please post only one question per thread!
Keywords in meta-tags will be in cpg1.3.0 (which is still beta). To add them for cpg1.2.x, edit displayimage.php and find
Code: [Select]
$comments = html_comments($CURRENT_PIC_DATA['pid']);and add after it
Code: [Select]
if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".$CURRENT_PIC_DATA['keywords']."\">"; }
Find
Code: [Select]
pageheader($album_name . '/' . $picture_title, '', false);and replace with
Code: [Select]
pageheader($album_name . '/' . $picture_title, $meta_keywords, false);
Haven't tested, but this should be it...
You can add/modify keywords using the "Edit pics" button next to each album when in admin mode.

GauGau
Logged

arne

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
    • Australia for backpackers (english version will follow soon!)
Re: meta, keywords
« Reply #2 on: July 12, 2004, 08:57:17 pm »

Hi this works fine for the displayed picture, but not for what I was looking for...

I want all keywords displayed on the index.php as well.
Is that possible by any chance?

http://ww1.australien.shellmaster.de/galerie/index.php

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: meta, keywords
« Reply #3 on: July 12, 2004, 10:05:27 pm »

There was a hack/mod posted to do what you want, but it was many months ago, and I have no idea who by.
A search of the mods board should find it eventually.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: meta, keywords
« Reply #4 on: July 12, 2004, 11:17:14 pm »

OK, done it as you want, keywords on front page.

You do this by adding the following code to your anycontent.php, and then adding anycontent to the 'contents of main page' in config;

Code: [Select]
// Select all keywords
starttable("100%", "Keywords used in this gallery", 1);

$result = mysql_query("select keywords from {$CONFIG['TABLE_PICTURES']}");
if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap']);

// Find unique keywords
$keywords_array = array();

while (list($keywords) = mysql_fetch_row($result)) {
        $array = explode(" ",$keywords);

        foreach($array as $word)
        {
        if (!in_array($word,$keywords_array)) $keywords_array[] = $word;
       }
}

sort($keywords_array);
$count = count($keywords_array);

// Result to table
echo "<tr><td>" ;
for ($i = 0; $i < $count; $i++) {
  echo "<a href=\"thumbnails.php?album=search&search=$keywords_array[$i]\">$keywords_array[$i]</a> " ;

}
echo "</td></tr>" ;
endtable();

I have attached an example anycontent.php to this post.

Note;  credit for this code to fotofreek, who submitted this as a mod to the search page, on this thread, http://forum.coppermine-gallery.net/index.php?topic=4768.0
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 18 queries.