Tag cloud from keywords - Page 5 Tag cloud from keywords - Page 5
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Tag cloud from keywords

Started by Aditya Mooley, December 20, 2005, 07:55:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dellwo

Everything you're asking has already been explained in this topic.
You should at least read the posts before asking questions.

sandulacki

Quote from: dellwo on July 03, 2007, 06:55:57 AM
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?

dellwo

#82
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

  // 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;";
    }

sandulacki


DaBe

Quote from: 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.
hello

I have a problem..

I have edit my Keywords..but they are always duplicates words.. =(

dellwo


Joachim Müller

@dellwo: thanks for pointing that out.

@DaBe: it's advisable to read the thread first before replying to it. ::)

DaBe

hello

Now the tag cloud workd!

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




  // 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;";

    }



dellwo

Come on! Please read Reply #86.  >:(
Also, a link to your site would be helpful.

radium35

in my includes folder i don't even have a keyword.inc.php file

dellwo

It's the file in the first post, that you're supposed to download.

mentalist3d

Thanks for the Tag Cloud Aditya, worked first time without any problems :-)

BIG Thanks - James

dills84

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!

dellwo

Did you modify the font size equation in keyword.inc.php?
If so, please post it.

streetart

hello is there possible to display the count of images in () like =  keyword (14)  ???

thx..

Nibbler

Change


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



to


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


streetart


stardust

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
    $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

eK3eKyToPa

I wonder how to get displayed only 10 random keywords

eK3eKyToPa

Quote from: eK3eKyToPa on August 01, 2009, 01:43:08 PM
I wonder how to get displayed only 10 random keywords
OK, did it! code here:
change:
  sort($keywords_array);

  $count = count($keywords_array);

to:
  shuffle($keywords_array);
  $count = 10;