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] 2 3 4 5 6   Go Down

Author Topic: Tag cloud from keywords  (Read 97565 times)

0 Members and 1 Guest are viewing this topic.

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Tag cloud from keywords
« on: December 20, 2005, 07:55:12 am »

Here's a simple hack displaying keywords as tag cloud on search page.
Tag cloud is the weighted list of keywords.
See it in action here: http://nagpurbirds.org/search.php

Download the attached file rename it as keyword.inc.php and replace it with your include/keyword.inc.php (Don't forget to take a backup first). If there is already any mod applied on this file you will have to merge the changes in this file manually.

Aditya

[Edit Joachim 2009-11-19]
The instructions for this mod are no longer applicable. Please do not replace your file with the one in the attachment as Aditya originally posted. Instead, please read the instructions in http://forum.coppermine-gallery.net/index.php/topic,25311.msg310637.html#msg310637
[/Edit]
« Last Edit: November 19, 2009, 05:53:46 pm by Joachim Müller »
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

ratajczak

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Tag cloud from keywords
« Reply #1 on: December 21, 2005, 02:31:23 pm »

I am missing the attachment....

Have a nice day,

Oliver
Logged

ratajczak

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Tag cloud from keywords
« Reply #2 on: December 21, 2005, 02:42:35 pm »

Seems to fine fine... but.. my keywords are there several times... Please have a look at www.36zu9.de

Thanks in advacne,

Oliver
Logged

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: Tag cloud from keywords
« Reply #3 on: December 22, 2005, 06:20:58 am »

Was the keyword list working properly before adding this mod?
Attach your file here, so that I can check it for errors.

Aditya
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

ratajczak

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Tag cloud from keywords
« Reply #4 on: December 22, 2005, 09:52:05 am »

It seem to be that I have made erros while entering my keywords .. I wll try to fix it... thanks a lot in advance...

It didn't work also.. the keywords are more then ones in the list...

I will attach my the keyword.inc.php (changed to .txt) file I am using....

DO you have an idea?

Thanks a lot in advance,

Oliver
« Last Edit: December 22, 2005, 10:58:45 am by ratajczak »
Logged

sigepjedi

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111
Re: Tag cloud from keywords
« Reply #5 on: December 22, 2005, 08:11:12 pm »

How can you limit it to only returning... say keywords with atleast 10 searches or something like that?
Logged

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: Tag cloud from keywords
« Reply #6 on: December 23, 2005, 06:12:03 am »

How can you limit it to only returning... say keywords with atleast 10 searches or something like that?

It is not possible to limit it that way, since we are not keeping the data of what was searched by users in past.
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: Tag cloud from keywords
« Reply #7 on: December 23, 2005, 06:37:04 am »

It didn't work also.. the keywords are more then ones in the list...
I will attach my the keyword.inc.php (changed to .txt) file I am using....
DO you have an idea?

Your files looks ok to me and this file is working fine on my local setup and the URL I have specified in the first post, so the only problem can be the way in which the keywords are defined in your setup.

Put your original file and see whether the keywords are still duplicated. If so, then you need to correct the keywords.

Aditya
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

sigepjedi

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111
Re: Tag cloud from keywords
« Reply #8 on: February 27, 2006, 06:28:02 pm »

More specificly, I am asking how to limit the results but the count of the searches.

For instance, the searches are selected... Then you Sort the keywords by the count. Here I want to them limit the Displayed keywords to words with only x amount of counted searches.

Does this make sense?
Logged

tmselim

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Tag cloud from keywords
« Reply #9 on: March 14, 2006, 08:48:29 am »

I'm having an issue similar to what was mentioned above... when I run the code as-is, my keywords all appear as the same size and multiple occurances  of the same keyword appear mutliple time.  Since this wasn't happening in the past, I compared the code between the original file and this one and found that the code to create a unique array was different.  However, if I correct that problem, then the tag cloud still doesn't work since the resulting keywords_array only contains a unique list (so the weighing is the same).

Am I missing something?  Have you revised this code?

(I've attached my version)
Logged

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: Tag cloud from keywords
« Reply #10 on: March 14, 2006, 11:13:39 am »

Hmmm...

I have downloaded your file. Need to look at your as well as my file. Will upload the new file if some bug is found.
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: Tag cloud from keywords
« Reply #11 on: March 14, 2006, 11:33:51 am »

Fixed the bug in my file and updated the attachement in first post.

Please download and let me know whether it works.

Thanks
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

tifster

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Tag cloud from keywords
« Reply #12 on: March 25, 2006, 08:58:01 am »

I installed 1.4.4 so I could install this mod, but then while testing it, I had problems when I clicked on a keyword.  Sometimes, not all the time, I got a critical error while accessing the database.  I tracked this down to the search string not getting copied properly and therefore the query wasn't built right.  I'm not sure who this might effect:  everybody with 1.4.4, everybody with this mod, or maybe just people with my specific version of PHP (4.3.10-16).  Anyway, here's a patch:

Code: [Select]
*** thumbnails.php.old  Sat Mar 25 01:42:07 2006
--- thumbnails.php.new  Sat Mar 25 01:41:57 2006
***************
*** 92,97 ****
--- 92,98 ----
          $album = 'search';
  }
  if (isset($_GET['search'])) {
+     $USER['search'] = array();
      $USER['search']['search'] = $_GET['search'];
  }

BTW, I'm loving the new tagging (aka keywords) and the tag cloud.  Thanks guys.
Logged

smcasey

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Tag cloud from keywords
« Reply #13 on: May 05, 2006, 08:10:39 am »

I'm also getting double keyword on version 1.4.5 of coppermine.  I replaced the file with the orginal and the keywords look fine.  It looks like when I have 2 pictures in a album I get double keyword listings.

Thanks,
S
Logged

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: Tag cloud from keywords
« Reply #14 on: May 05, 2006, 08:30:18 am »

URL please.
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

smcasey

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Tag cloud from keywords
« Reply #15 on: May 06, 2006, 08:35:21 am »

Here is my development site: http://www.travelscraps.com/cpg/search.php

Thanks for the help.  :)
Logged

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: Tag cloud from keywords
« Reply #16 on: May 06, 2006, 12:38:46 pm »

Ok. Got the problem. Two solutions to solve this. See which one you want to use.

1. All the keywords will be displayed in small case on search.php (this won't effect the search though)

Find
Quote
$keywords_array[] = $word;

Replace with:
Quote
$keywords_array[] = strtolower($word);

2. The keywords will be displayed in the case as you have entered. BUT the drawback is, if you have 2 keywords with same name but different case they will be treated as separate keywords.

Find:
Quote
if (!in_array(strtolower($word),$keywords_array)) {

And Replace with:
Quote
if (!in_array($word,$keywords_array)) {

I will suggest 1st solution as it will give you better results.

Aditya
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

smcasey

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Tag cloud from keywords
« Reply #17 on: May 08, 2006, 08:11:47 am »

Aditya,
Thanks, that looks like it fixed it.  I have to upload some more photos to see the tag cloud work better.  :)
Logged

coopersita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
Re: Tag cloud from keywords
« Reply #18 on: May 23, 2006, 05:50:40 pm »

Is there a way to have the tag cloud in the main page instead of the search page?
Logged

Fotomaf

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 30
  • www.fotomaf.com gallery
    • Fotomaf Gallery
Re: Tag cloud from keywords
« Reply #19 on: July 11, 2006, 02:12:37 pm »

Thank you
Is very usefull

regards from Spain
Pages: [1] 2 3 4 5 6   Go Up
 

Page created in 0.026 seconds with 19 queries.