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 102207 times)

0 Members and 1 Guest are viewing this topic.

dellwo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Tag cloud from keywords
« Reply #80 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.
Logged

sandulacki

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Tag cloud from keywords
« Reply #81 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?
Logged

dellwo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Tag cloud from keywords
« Reply #82 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;";
    }
« Last Edit: December 03, 2007, 08:43:38 am by GauGau »
Logged

sandulacki

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Tag cloud from keywords
« Reply #83 on: December 03, 2007, 10:13:09 am »

Thanks a lot.
Logged

DaBe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 110
Re: Tag cloud from keywords
« Reply #84 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.. =(
Logged

dellwo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Tag cloud from keywords
« Reply #85 on: December 10, 2007, 09:20:26 pm »

See reply #67 or #16.  ::)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Tag cloud from keywords
« Reply #86 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. ::)
Logged

DaBe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 110
Re: Tag cloud from keywords
« Reply #87 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;";

    }


Logged

dellwo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Tag cloud from keywords
« Reply #88 on: January 02, 2008, 01:16:20 am »

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

radium35

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Tag cloud from keywords
« Reply #89 on: January 15, 2008, 05:25:44 am »

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

dellwo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Tag cloud from keywords
« Reply #90 on: January 15, 2008, 05:46:51 am »

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

mentalist3d

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 51
  • http://concepts.org.uk
    • Concept Art
Re: Tag cloud from keywords
« Reply #91 on: February 19, 2008, 04:23:39 pm »

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

BIG Thanks - James
Logged

dills84

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 43
Re: Tag cloud from keywords
« Reply #92 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!
Logged

dellwo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Tag cloud from keywords
« Reply #93 on: May 21, 2008, 08:32:13 pm »

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

streetart

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Tag cloud from keywords
« Reply #94 on: September 23, 2008, 06:43:36 pm »

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

thx..
Logged

Nibbler

  • Guest
Re: Tag cloud from keywords
« Reply #95 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>";

Logged

streetart

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Tag cloud from keywords
« Reply #96 on: September 23, 2008, 06:56:45 pm »

thx for the fast answer!
Logged

stardust

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 44
Re: Tag cloud from keywords
« Reply #97 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
Logged

eK3eKyToPa

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: Tag cloud from keywords
« Reply #98 on: August 01, 2009, 01:43:08 pm »

I wonder how to get displayed only 10 random keywords
Logged

eK3eKyToPa

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: Tag cloud from keywords
« Reply #99 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;
Logged
Pages: 1 2 3 4 [5] 6   Go Up
 

Page created in 0.029 seconds with 19 queries.