forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Searching => Topic started by: Aditya Mooley on December 20, 2005, 07:55:12 am

Title: Tag cloud from keywords
Post by: Aditya Mooley 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 (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]
Title: Re: Tag cloud from keywords
Post by: ratajczak on December 21, 2005, 02:31:23 pm
I am missing the attachment....

Have a nice day,

Oliver
Title: Re: Tag cloud from keywords
Post by: ratajczak 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
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley 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
Title: Re: Tag cloud from keywords
Post by: ratajczak 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
Title: Re: Tag cloud from keywords
Post by: sigepjedi 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?
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley 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.
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley 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
Title: Re: Tag cloud from keywords
Post by: sigepjedi 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?
Title: Re: Tag cloud from keywords
Post by: tmselim 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)
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley 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.
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley 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
Title: Re: Tag cloud from keywords
Post by: tifster 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.
Title: Re: Tag cloud from keywords
Post by: smcasey 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
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on May 05, 2006, 08:30:18 am
URL please.
Title: Re: Tag cloud from keywords
Post by: smcasey on May 06, 2006, 08:35:21 am
Here is my development site: http://www.travelscraps.com/cpg/search.php

Thanks for the help.  :)
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley 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
Title: Re: Tag cloud from keywords
Post by: smcasey 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.  :)
Title: Re: Tag cloud from keywords
Post by: coopersita 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?
Title: Re: Tag cloud from keywords
Post by: Fotomaf on July 11, 2006, 02:12:37 pm
Thank you
Is very usefull

regards from Spain
Title: Re: Tag cloud from keywords
Post by: wfs on August 03, 2006, 04:39:33 am
Hi,

It's a great piece of code.  Thank you so much !

Just wondering - how do you change the fonts to Arial and a larger size ?

pse advise.

thank you.
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on August 03, 2006, 06:54:55 am
I am not changing fonts anywhere. Just the size of the keywords are changed according to their weight.
Here's the code in search.inc.php which does this

Code: [Select]
if ($em > 24) {
      $span = 'font-size: 24px; font-weight: bold;';
} else {
      $span = "font-size: {$em}px;";
}
Title: Re: Tag cloud from keywords
Post by: wfs on August 03, 2006, 08:38:09 am
Thanks - I forgot the size of the words are weighted.

Anyway, it's a great piece of very useful code.

thank you again !!   :) :)
Title: Re: Tag cloud from keywords
Post by: wfs on August 08, 2006, 12:59:13 pm
Hi,
I seem to have this problem - when I click on a keyword, the page comes up but it says there are no images to display.

can this be?

pse advice.

thanks.
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on August 08, 2006, 01:11:40 pm
Link to your site please.
Title: Re: Tag cloud from keywords
Post by: wfs on August 08, 2006, 02:11:50 pm
here's the link:

http://www.photograffs.com/nkeywordlink.php

thanks.
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on August 08, 2006, 02:27:55 pm
I searched for few keywords like holland, orchestra and niagara_falls. They returned 11, 1 and 1 results respectively.
Title: Re: Tag cloud from keywords
Post by: wfs on August 08, 2006, 03:45:04 pm
hi,

can you try cameron_highlands, toa_payoh and hong_kong.

turns up blanks - no images.

Title: Re: Tag cloud from keywords
Post by: wfs on August 08, 2006, 03:49:24 pm
Hi again,

my sincere apologies.

it works - after I deleted the temporary files.

so sorry.

Title: Re: Tag cloud from keywords
Post by: beingjenn on October 11, 2006, 06:37:41 am
Is there a way to put the tag cloud in the sidebar?
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on October 12, 2006, 07:22:24 am
No. Someone will have to modify the script to work for sidebar.
Title: Re: Tag cloud from keywords
Post by: darktea on October 31, 2006, 11:09:35 pm
I've been looking into improving my keyword search so your mod is great, thank you.  I believe I have followed your instructions fully (download file, rename and upload) and it is working in some ways, but I don't think it is quite the expected results, because I have some words repeated several times e.g. Bite over 60 times and then it starts the alphabet again and works fine.

http://www.darktea.co.uk/search.php

I know the keywords were listed fine before this trying this mod, because I was checking them this morning.

Any help would be wonderful,  thanks.
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on November 01, 2006, 06:05:25 am
Looks very odd. I hope you have a backup of original script. Please rename the modified script and revert to the original script. I will look into this problem ASAP. If possible PM me the FTP details of your site so that I can debug the script.
Title: Re: Tag cloud from keywords
Post by: darktea on November 02, 2006, 10:32:52 am
I have a backup of the site so I can replace the file, but haven't got round to it yet.  I will PM you with the details, thank you for the offer.
Title: Re: Tag cloud from keywords
Post by: locomotion1 on January 30, 2007, 01:39:16 am
hey ia dded the php file to my coppermine, replaced the old file and everything but it doesnt seem to be making any clod tag = /

any suggestions?
thanks!
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on January 30, 2007, 05:47:54 am
Give the link to your site.
Title: Re: Tag cloud from keywords
Post by: locomotion1 on January 31, 2007, 12:00:38 am
http://www.paramorefans.com/photos/

thanks for taking ur time!
Title: Re: Tag cloud from keywords
Post by: locomotion1 on January 31, 2007, 12:01:45 am
sorry for double posting....

this could help SEO right?
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on January 31, 2007, 06:11:59 am
I can't even see the normal list of keywords on your search page. Was it working previously? Have you enabled the " Enable clickable keywords in search" option from config?
Title: Re: Tag cloud from keywords
Post by: locomotion1 on February 01, 2007, 01:10:46 am
yes the keyword funtion is enabled
and I just installed it so i cant say it worked before
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on February 01, 2007, 06:17:22 am
First check the standard keyword list using the original search.inc.php file. If you can see keyword list on search page then we can go ahead and debug the modifications for tag cloud.
Title: Re: Tag cloud from keywords
Post by: locomotion1 on February 03, 2007, 05:35:17 pm
how do i do that = /
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on February 05, 2007, 06:58:55 am
Restore the original search.inc.php and then go to search page and check whether the keywords are shown below the search form. If not then there is some other problem.

I hope you have already assigned keywords to photos.
Title: Re: Tag cloud from keywords
Post by: locomotion1 on March 16, 2007, 05:23:32 pm
sorry for not following this
i replaced the orifinal file but i still dont have any keywords in the search menu
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on March 17, 2007, 06:36:20 am
There's an option in config to enable clickable keyword search. See to it that you have done this.
Title: Re: Tag cloud from keywords
Post by: lesman01 on April 10, 2007, 05:26:22 am
I can't seem to get this to work. I did manage to get 1 word to get larger, but I still have many duplicates, and some words where I know there are multiple instances are not showing larger.

One theory is that the words that are displayed are the result of searching description and title, and not just keyword. This may or may not have anything to do with it. I still have a lot of tagging to do once I know this works. I've tried to edit or delete duplicates but cannot.

My original keyword.inc works fine. Any help would be appreciated.

http://www.elesman.com/photos/

Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on April 10, 2007, 06:55:48 am
I will check these files with my local setup and let you know if any modifications are needed to it.
Title: Re: Tag cloud from keywords
Post by: lesman01 on April 10, 2007, 04:26:24 pm
thanks very much. I have made some progress and think my problem is with the keywords that I have previously entered. I can edit them and it seems to fix most of them.

Additional question: what are the rules for the word sizes and styles: ie: 10 results=12px;25 results=13px; 50 results=20px bold; etc....and where are they defined?

I plan on creating a mod so i can add this tag cloud to my index page. will let you know...might be over my head...no pun intended...
Title: Re: Tag cloud from keywords
Post by: lesman01 on April 11, 2007, 05:36:55 am
I was able to cobble together a hack that adds the keyword cloud to the index.

Simple add this few lines of code to the anycontent.php file just before the
Code: [Select]
endtable();
Code: [Select]
if ($CONFIG['clickable_keyword_search'] != 0) {
    include('include/keyword.inc.php');
}

need to make some html tweeks but it seems to work fine.

Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on April 11, 2007, 06:58:51 am
The font size is decided by following line

Code: [Select]
$em = ($keyword_count[$keywords_array[$i]] < 6) ? 12 : (12 + (int)(($keyword_count[$keywords_array[$i]] - 5) / 5)) * 2;

The max font size is limited to 24, so if the value of $em exceeds this value, it is changed to 24 in the line following.
Title: Re: Tag cloud from keywords
Post by: DaBe on April 20, 2007, 10:19:37 pm
Hello I new here..

I have also the problem with duplicate words!

I want display the word larger, when it has more results, and not mutiple..

What I make false?

please help..

and sry for my english =)

thx
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on April 21, 2007, 06:55:52 am
Those who had this problem of duplicates edited their keywords and everything worked fine thereafter.
Title: Re: Tag cloud from keywords
Post by: jayanthsharma on May 09, 2007, 10:49:47 am
SUPERB!! thanks aditya
Title: Re: Tag cloud from keywords
Post by: paquets on May 14, 2007, 12:10:04 am
Where can we find the search file for the tag clouds?
Thanks in advance!
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on May 14, 2007, 07:05:54 am
Didn't you read the first post?
Title: Re: Tag cloud from keywords
Post by: will on May 19, 2007, 03:58:55 pm
Is there a way of show popular search results in a cloud, like the keyword cloud

Thanks ;D
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on May 21, 2007, 06:56:31 am
Nopes. Coppermine doesn't save user search terms anywhere. So there is no way to show them as a cloud.
Title: Re: Tag cloud from keywords
Post by: andyleery on June 13, 2007, 12:06:47 am
Hi, I have also treid to install you hack but it didnt make a change.
http://www.bollybilder.de/search.php

Also its not so cool when some words are displayed twice or more. Hope you can help me, thx.
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on June 13, 2007, 08:22:00 am
Those who had this problem of duplicates edited their keywords and everything worked fine thereafter.
Title: Re: Tag cloud from keywords
Post by: andyleery on June 13, 2007, 10:57:02 am
Ok but why are my links looking als the same? There are no clowds, they look just the same.
Title: Re: Tag cloud from keywords
Post by: tinorebel on June 13, 2007, 12:31:18 pm
Hy everyone! ;D

I was wondering if there is a way to display only keywords that have for example 5 photos referring.

My problem is I have hundred of keywords and displaying all slows down quite a bit the page.

Would it be possible to limit clickable keywords only to the ones that refeer to -for example - 5 photos??? ???

Thanks to anyone who can give me a clue .... :-\
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on June 14, 2007, 06:57:59 am
Ok but why are my links looking als the same? There are no clowds, they look just the same.
IMO, there is some problem of spaces which causes this. If if edit your keywords properly it should work. This is what others who have used this have reported. I personally never had this problem on my setup.
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on June 14, 2007, 07:06:48 am
Quote
Would it be possible to limit clickable keywords only to the ones that refeer to -for example - 5 photos???

Download the attached file from first post of this thread.
Find:
Code: [Select]
if ($keywords_array[$i]) {     // Eliminates Null Keywords

and replace it with
Code: [Select]
if ($keywords_array[$i] && $keyword_count[$keywords_array[$i]] >= 5) {     // Eliminates Null Keywords

Haven't tried out but should work.
Title: Re: Tag cloud from keywords
Post by: tinorebel on June 14, 2007, 01:22:08 pm
Thanks a lot Aditya! ;D
looks like is a good solution!

I¡ll try it this afternoon and let you know if works properlly.

p.s. I have a problem when i try to keyword manage:
database responds:
Quote
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1311027 bytes) in /mounted-storage/home31b/sub001/sc204/www/website/gal/keywordmgr.php on line 83

Can someone help me ? ???
what happened? yesterday it was working fine...
shurely I have many keywords but alsaw a lot of free space on server, I dont understand.

www.tripodart.net (http://www.tripodart.net) this is the site. :-\

any suggestion is welcome.
Title: Re: Tag cloud from keywords
Post by: tinorebel on June 14, 2007, 02:21:11 pm
Hy! ;D
I just tryed the modification limiting to 5 referring photos for keyword, as suggested by Aditya and worked fine.

I tryed to use a bigger lower limit to reduce number of keywords to only the ones referring to 10 photos- worked fine but....
resulted all keywords same (big) size.

Supose I have to change the first line:
Code: [Select]
    $em = ($keyword_count[$keywords_array[$i]] < 6) ? 12 : (12 + (int)(($keyword_count[$keywords_array[$i]] - 5) / 5)) * 2;

    if ($em > 24) {

      $span = 'font-size: 24px; font-weight: bold;';

    } else {

      $span = "font-size: {$em}px;";

But have no idea of which numbers should I change. Can someone give me a little help?

Still unable to reach keyword manager.

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 262927 bytes) in /mounted-storage/home31b/sub001/sc204/www/website/gal/keywordmgr.php on line 83

Maby the problem is in the database?

Thanks a lot! ;)


Title: Re: Tag cloud from keywords
Post by: olti on June 25, 2007, 01:55:14 pm
Is there anyway to show the tags on anycontent.php ?
Title: Re: Tag cloud from keywords
Post by: dellwo on June 26, 2007, 12:14:36 am
Ok...I fixed the duplicates using Solution #1 in Reply #16.
But I cannot get different sizes. I tried editing and finally just deleted all keywords and just
added one keyword to each picture. Still no change in size.

I see several posts where you mention an "original" search.inc.php.
Were we supposed to change something in that file. I can't find where you say to do that.

Help!
Thanks, Joe
Link --> http://www.dellwo.com/copper/search.php
Title: Re: Tag cloud from keywords
Post by: dellwo on July 03, 2007, 06:55:57 am
Alright...I fixed it!  I had to undo the duplicates fix from Repy #16 and do the reverse.

I Changed:
        if (!in_array(strtolower($word),$keywords_array)) {
          $keywords_array[] = $word;
To:
        if (!in_array($word,$keywords_array)) {
          $keywords_array[] = $word;

Also, the original script only did the Cloud tags in 2 sizes.
I played with the equation to get more increments.

I hope this helps others.
Thanks, Joe
Title: Re: Tag cloud from keywords
Post by: naufragus on August 10, 2007, 12:32:38 pm
hi there,

great mod! everything works all fine! I thought about including the tag cloud into my sidebar (like the link in post66 shows http://www.dellwo.com/copper/search.php), but as I see they did not really include the keyword.inc.php but rather found a way around it. It seems as you cant include the keyword.inc.php into the template.html anyway. I am not at all a pro and would be very glad to get some help with implementing my tag cloud into the cpg sidebar of the template.html if possible!

thank you very much guys

Pascal
Title: Re: Tag cloud from keywords
Post by: alanpalan on October 10, 2007, 03:33:07 pm
great mod. just one think - how can I display the tags on main page of my coppermine gallery? thanks for answer!
Title: Re: Tag cloud from keywords
Post by: dellwo on October 10, 2007, 05:27:26 pm
See post #48 (http://forum.coppermine-gallery.net/index.php?topic=25311.msg204135#msg204135) above.

Joe [Gallery] (http://www.dellwo.com/copper/index.php)

great mod. just one think - how can I display the tags on main page of my coppermine gallery? thanks for answer!
Title: Re: Tag cloud from keywords
Post by: alanpalan on October 11, 2007, 12:49:15 am
Thanks but it doesnt work.
Nothing displays. I looked in that file anycontent.php where is written this: "this file file gets included in the index.php if you set the option in admin can be used to display any content from any program".
Where can I set this option in admin? I dont see it anywhere :(
Title: Re: Tag cloud from keywords
Post by: dellwo on October 11, 2007, 01:30:01 am
Add "anycontent/" to "The content of the main page" in your config.
Title: Re: Tag cloud from keywords
Post by: alanpalan on October 11, 2007, 02:42:29 am
Great. It works. Thanks. And last question - what if i want to move it to some more visible place (for example somewhere on the top, right under the categories? :)
Title: Re: Tag cloud from keywords
Post by: dellwo on October 11, 2007, 02:47:59 am
It goes wherever you place it in the config.
So put it after "catlist".
--Joe

Great. It works. Thanks. And last question - what if i want to move it to some more visible place (for example somewhere on the top, right under the categories? :)
Title: Re: Tag cloud from keywords
Post by: Joachim Müller on October 11, 2007, 08:42:59 am
@alanpalan: your questions are not related to this mod, but general coppermine questions. Read up the documentation that comes with it. If you then still have questions, ask them in a thread of your own on the support board.
Title: Re: Tag cloud from keywords
Post by: DaBe on November 26, 2007, 09:05:49 pm
hello

I use coppermine 1.4.14 . and I want use the tag cloud mod here.

how I must make this?

which files I must download? Can everyone upload the actualy files now, pls?

I thx you!


(sry for my english)
Title: Re: Tag cloud from keywords
Post by: Aditya Mooley on November 27, 2007, 05:42:49 am
A file is attached to the first post in this topic. Just FYI, this mod is not yet tested with 1.4.14
Title: Re: Tag cloud from keywords
Post by: DaBe on November 30, 2007, 08:15:23 pm
yes but i want display keywords larger when they has more searchresult.

but my coppermine display two searchresult like one searchresult

=(

can me everyone help?


(Sry engslish)
Title: Re: Tag cloud from keywords
Post by: DaBe on November 30, 2007, 08:18:03 pm
and how can I display the cloud in anycontent?


include keywords.inc or what?
Title: Re: Tag cloud from keywords
Post by: dellwo on December 01, 2007, 03:17:11 am
Everything you're asking has already been explained in this topic.
You should at least read the posts before asking questions.
Title: Re: Tag cloud from keywords
Post by: sandulacki on December 02, 2007, 01:27:06 pm
Also, the original script only did the Cloud tags in 2 sizes.
I played with the equation to get more increments.

Can you, please, put this piece of code here?
Title: Re: Tag cloud from keywords
Post by: dellwo on December 02, 2007, 05:42:42 pm
Take a look at this section of keyword.inc.php.
This is how I modified it. You'll need to play with the equation according to your search results.
Later, Joe

Code: [Select]
  // Sort selected keywords
  sort($keywords_array);
  $count = count($keywords_array);
  // Result to table
  echo '<tr><td class="tableb">' ;
  for ($i = 0; $i < $count; $i++) {
    if ($keywords_array[$i] && $keyword_count[$keywords_array[$i]] >= 3) {     // Eliminates Null Keywords
    $em = ($keyword_count[$keywords_array[$i]] < 6) ? 12 : (12 + (int)(2*$keyword_count[$keywords_array[$i]] / 5));
    if ($em > 24) {
      $span = 'font-size: 24px; font-weight: bold;';
    } else {
      $span = "font-size: {$em}px;";
    }
Title: Re: Tag cloud from keywords
Post by: sandulacki on December 03, 2007, 10:13:09 am
Thanks a lot.
Title: Re: Tag cloud from keywords
Post by: DaBe on December 05, 2007, 07:58:45 pm
Those who had this problem of duplicates edited their keywords and everything worked fine thereafter.
hello

I have a problem..

I have edit my Keywords..but they are always duplicates words.. =(
Title: Re: Tag cloud from keywords
Post by: dellwo on December 10, 2007, 09:20:26 pm
See reply #67 or #16.  ::)
Title: Re: Tag cloud from keywords
Post by: Joachim Müller on December 11, 2007, 08:34:34 am
@dellwo: thanks for pointing that out.

@DaBe: it's advisable to read the thread first before replying to it. ::)
Title: Re: Tag cloud from keywords
Post by: DaBe on January 02, 2008, 12:59:18 am
hello

Now the tag cloud workd!

I have three different keyword sizes. Is there possible make more than three sizes?

Code: [Select]


  // Sort selected keywords

  sort($keywords_array);

  $count = count($keywords_array);

  // Result to table

  echo '<tr><td class="tableb">' ;

  for ($i = 0; $i < $count; $i++) {

    if ($keywords_array[$i]) {     // Eliminates Null Keywords

    $em = ($keyword_count[$keywords_array[$i]] < 6) ? 12 : (12 + (int)(($keyword_count[$keywords_array[$i]] - 5) / 5)) * 2;

    if ($em > 24) {

      $span = 'font-size: 24px; font-weight: bold;';

    } else {

      $span = "font-size: {$em}px;";

    }


Title: Re: Tag cloud from keywords
Post by: dellwo on January 02, 2008, 01:16:20 am
Come on! Please read Reply #86.  >:(
Also, a link to your site would be helpful.
Title: Re: Tag cloud from keywords
Post by: radium35 on January 15, 2008, 05:25:44 am
in my includes folder i don't even have a keyword.inc.php file
Title: Re: Tag cloud from keywords
Post by: dellwo on January 15, 2008, 05:46:51 am
It's the file in the first post, that you're supposed to download.
Title: Re: Tag cloud from keywords
Post by: mentalist3d on February 19, 2008, 04:23:39 pm
Thanks for the Tag Cloud Aditya, worked first time without any problems :-)

BIG Thanks - James
Title: Re: Tag cloud from keywords
Post by: dills84 on May 21, 2008, 07:58:04 pm
i installed this mod and it seemed to work fine.

BUT! i noticed that the sizes arent propotional to the amount of images i have keyworded. for instance, i have one keyword called "Shoes" and its big and bold but there are only 4 images within it. But then i have one called "canon_5D" with 5 pages of images and its small like the regular keyword font. It almost seems as though the sizing is random? or am i missing somthing?

Thanks in advance for any info!
Title: Re: Tag cloud from keywords
Post by: dellwo on May 21, 2008, 08:32:13 pm
Did you modify the font size equation in keyword.inc.php?
If so, please post it.
Title: Re: Tag cloud from keywords
Post by: streetart on September 23, 2008, 06:43:36 pm
hello is there possible to display the count of images in () like =  keyword (14)  ???

thx..
Title: Re: Tag cloud from keywords
Post by: Nibbler on September 23, 2008, 06:52:33 pm
Change

Code: [Select]
    echo "<a href=\"thumbnails.php?album=search&search=".$keywords_array[$i]."\"><span style='$span'>$keywords_array[$i]</span></a>";


to

Code: [Select]
    echo "<a href=\"thumbnails.php?album=search&search=".$keywords_array[$i]."\"><span style='$span'>$keywords_array[$i] ({$keyword_count[$keywords_array[$i]]})</span></a>";

Title: Re: Tag cloud from keywords
Post by: streetart on September 23, 2008, 06:56:45 pm
thx for the fast answer!
Title: Re: Tag cloud from keywords
Post by: stardust on January 18, 2009, 07:53:26 pm
Thanks for this mod, it was easy to put in.

I'm wondering how to change the limit for 3 font sizes in relation to how many images the keyword results in?

For example:
The smallest font would be keywords that in less than 100 images
Medium font size would be keywords that result in 100-1000 images
And  the biggest font size would be keywords that display over 1000 images

I think it goes with
Code: [Select]
    $em = ($keyword_count[$keywords_array[$i]] < 6) ? 12 : (12 + (int)(($keyword_count[$keywords_array[$i]] - 5) / 5)) * 2;but every time I edit any of these numbers, all my keywords become the same font size
Title: Re: Tag cloud from keywords
Post by: eK3eKyToPa on August 01, 2009, 01:43:08 pm
I wonder how to get displayed only 10 random keywords
Title: Re: Tag cloud from keywords
Post by: eK3eKyToPa on August 01, 2009, 01:59:07 pm
I wonder how to get displayed only 10 random keywords
OK, did it! code here:
change:
Code: [Select]
  sort($keywords_array);

  $count = count($keywords_array);
to:
Code: [Select]
  shuffle($keywords_array);
  $count = 10;
Title: Re: Tag cloud from keywords
Post by: Saif on November 19, 2009, 06:50:12 am
will this work with coppermine 1.4.25 ?
Title: Re: Tag cloud from keywords
Post by: Joachim Müller on November 19, 2009, 05:49:47 pm
This thread is tagged as being for cpg1.4.x. In my book, this includes cpg1.4.25 as well as cpg1.4.3819. So yes, this mod is designed to be used with any version of the cpg1.4.x series, and this includes cpg1.4.25.
We can't tell for sure, as it's simply beyond the scope of this board to test each available mod or hack with each new maintenance release. Why don't you try it for us: apply the mod and let us know if it worked for you or not. This would be a good way to give something back to the community. Taking into account your negative record on this forum it's about time for you to become a giver instead of being a taker constantly. Don't come up with lame excuses like "I'm not a coder" - you don't need to be a coder to apply this mod, test if it works and post feedback here in this thread. Nobody has been born as a coder - you live and learn.

Anyway, I can see what your issue is: this mod suggests to replace one of coppermine's files with a modified file that is based on an outdated version of coppermine, which can be a bad idea in terms of security and stability. The instructions of this mod never should have been put the way they are. I will try to make that up and post instructions that should work (see next posting).
Title: Re: Tag cloud from keywords
Post by: Joachim Müller on November 19, 2009, 05:51:17 pm
Here are the revised instructions to use this mod: do not replace the entire core file as the initial posting in this thread suggests. Instead, apply these steps:

Edit include/keyword.inc.php with a plain text editor

Find
Code: [Select]
  $keywords_array = array();and add after it (into a new line)
Code: [Select]
  $keyword_count = array();


Find
Code: [Select]
        if (!in_array($word = utf_strtolower($word),$keywords_array)) $keywords_array[] = $word;and replace with
Code: [Select]
        if (!in_array(strtolower($word),$keywords_array)) {
          $keywords_array[] = $word;
          $keyword_count[$word] = 1;
        } else {
          $keyword_count[$word]++;
        }
      


Find
Code: [Select]
    echo "<a href=\"thumbnails.php?album=search&amp;search=".$keywords_array[$i]."\">$keywords_array[$i]</a>";and replace with
Code: [Select]
    $em = ($keyword_count[$keywords_array[$i]] < 6) ? 12 : (12 + (int)(($keyword_count[$keywords_array[$i]] - 5) / 5)) * 2;
    if ($em > 24) {
      $span = 'font-size: 24px; font-weight: bold;';
    } else {
      $span = "font-size: {$em}px;";
    }
    echo "<a href=\"thumbnails.php?album=search&amp;search=".$keywords_array[$i]."\"><span style='$span'>$keywords_array[$i]</span></a>";
   


Find
Code: [Select]
      echo " | ";and replace with
Code: [Select]
      echo " ";
Title: Re: Tag cloud from keywords
Post by: Saif on November 20, 2009, 11:03:41 am
Thank you Joachim Müller for the help. I use dreamweaver as my editor. I edited the file as you said & attached herewith this post. But sadly i m unable to find the tag cloud on search page.I edited the keyword.inc.php in the include dir. & made a text copy & attached with my post.

http://www.orangewallpapers.com/search.php
Title: Re: Tag cloud from keywords
Post by: Saif on November 23, 2009, 06:12:32 am
Its working, thank you GuaGau for the help. Anyone can download the attachment file from this post, rename it to keyword.inc.php & overwrite incude/keyword.inc.php. Thank you for the mod. It will bring a tag cloud on search.php.

http://www.orangewallpapers.com/search.php
Title: Re: Tag cloud from keywords
Post by: Joachim Müller on November 23, 2009, 01:51:38 pm
Anyone can download the attachment file from this post, rename it to keyword.inc.php & overwrite incude/keyword.inc.php.
No, that's exactly what people should not do. Instead, they should to as I suggested above and apply the mod with the FIND/REPLACE instructions posted above. It was a silly idea in the first place to offer a pre-modded file. That idea was corrected. I understand that you're trying to help others, but it's a bad idea to continue with something that was a bad idea in the first place.
Title: Re: Tag cloud from keywords
Post by: brawsky on December 24, 2010, 12:24:06 pm
Thank you  ;) ;)
Title: Re: Tag cloud from keywords
Post by: brawsky on December 24, 2010, 12:26:01 pm
Thank you  ;) ;)
_________________________________________________

Abu Ja football Lani was used instead of dice. gclub (http://www.topstarclub.com/gclub.php) in South Africa. To create a high with gclub different these
Title: Re: Tag cloud from keywords
Post by: i-live09 on February 07, 2011, 07:51:52 am
http://www.3n2.net/sbobet.html
http://www.3n2.net
Title: Re: Tag cloud from keywords
Post by: ilikethat on February 11, 2011, 06:13:44 am
http://www.3n2.net/sbobet.html
http://www.3n2.net

aha... ;D
Title: Re: Tag cloud from keywords
Post by: Rain888 on February 23, 2011, 10:02:18 am
Just added a new member for the first time.
Title: Re: Tag cloud from keywords
Post by: ohooahaa on March 05, 2011, 04:51:33 am
Hello everyone I just came Register. Thanks for the great info.
__________________________________________________________________________________________________
คาสิโนออนไลน์ (http://casino-onlineslot.com/)-คาสิโน (http://casino-onlineslot.com/)-แทงบอล (http://www.3n2.net/stepsoccer.html)-แทงบอลออนไลน์ (http://casino-onlineslot.com/)-บาคาร่าออนไลน์ (http://casino-onlineslot.com/)