• [MOD] Tag cloud ( keyword & cat cloud in web2.0 style) 5 0 5 1
Currently:  

Poll

What do you think of this mod?

Excellent
Good
Fair
Poor
Bad

Author Topic: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)  (Read 228453 times)

0 Members and 1 Guest are viewing this topic.

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #120 on: March 06, 2009, 01:11:12 PM »
Can someone please tell me clearly how to make sure this keyword cloud pulls keywords from all images in all categories, and where exactly I can set the limit ..... in plain exact terms with an example?


Right now it seems the keyword return is very limited and I would like to increase the number. Thanks....
As long as I can finish my site before I die.

Offline whosthis.ee

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Big problem in implementing this mod !!
« Reply #121 on: April 23, 2009, 08:59:25 PM »
After editing the functions.php, page_header.php and langfiles, I get this error on the top of my 4images homepage . Any suggestions ??

Warning: array_values() [function.array-values]: The argument should be an array in /home/tsahu/public_html/netbaazigar/showoff/includes/functions.php on line 1744

Warning: Wrong parameter count for max() in /home/tsahu/public_html/netbaazigar/showoff/includes/functions.php on line 1744

Warning: array_values() [function.array-values]: The argument should be an array in /home/tsahu/public_html/netbaazigar/showoff/includes/functions.php on line 1745

Warning: Wrong parameter count for min() in /home/tsahu/public_html/netbaazigar/showoff/includes/functions.php on line 1745

Warning: Invalid argument supplied for foreach() in /home/tsahu/public_html/netbaazigar/showoff/includes/functions.php on line 1757


same here

Warning: array_values() [function.array-values]: The argument should be an array in E:\wamp\www\4images\includes\functions.php on line 1753

Warning: Wrong parameter count for max() in E:\wamp\www\4images\includes\functions.php on line 1753

Warning: array_values() [function.array-values]: The argument should be an array in E:\wamp\www\4images\includes\functions.php on line 1754

Warning: Wrong parameter count for min() in E:\wamp\www\4images\includes\functions.php on line 1754

Warning: Invalid argument supplied for foreach() in E:\wamp\www\4images\includes\functions.php on line 1766

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #122 on: April 29, 2009, 10:42:03 AM »
Just a short modification if you want to show popular tags from last week / months or year:

Modify STEP2 from:
Code: [Select]
//---[ [MOD] Tag Cloud]
function get_tag_clouds() {
global $site_db, $lang, $site_sess, $mode;
$output = "";
   
  $sql = "SELECT i.word_id, i.word_text, COUNT(c.word_id) AS quantity
  FROM ".WORDLIST_TABLE." i
LEFT JOIN ".WORDMATCH_TABLE." c ON i.word_id = c.word_id
WHERE keys_match > 0
  GROUP BY i.word_text
  ORDER BY  RAND()
LIMIT 20";

  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    $tags[$row['word_text']] = $row['quantity'];
  }
 
  //uncommentnext line to sort the tag array in reverse order (+ => -)
   //arsort($tags);   
        $max_size = 250; // max font size in %
        $min_size = 50; // min font size in %
       
        // largest and smallest array values
        $max_qty = max(array_values($tags));
        $min_qty = min(array_values($tags));
       
        // find the range of values
        $spread = $max_qty - $min_qty;
        if ($spread == 0) { // we don't want to divide by zero
                $spread = 1;
        }
       
        // set the font-size increment
        $step = ($max_size - $min_size) / ($spread);
       
        // loop through the tag array
        foreach ($tags as $key => $value) {
                // calculate font-size
                // find the $value in excess of $min_qty
                // multiply by the font-size increment ($size)
                // and add the $min_size set above
                $size = round($min_size + (($value - $min_qty) * $step));
       
                $output .= '<a href="'.$site_sess->url(ROOT_PATH."search.php?search_keywords=".$key.((!empty($mode)) ? "&amp;mode=".$mode : "")).'" style="font-size:'.$size.'%;color:rgb('.mt_rand(0, 255).', '.mt_rand(0, 255).', '.mt_rand(0, 255).');font-family:Verdana, Arial, Helvetica, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.$key.'">'.$key.'</a> ';
        }

 
  return $output;
}
//---[/[MOD] Tag Cloud]

To:
Code: [Select]
//---[ [MOD] Tag Cloud]
function get_tag_clouds() {
global $site_db, $lang, $site_sess, $mode;
$output = "";
   
$sql = "SELECT w.word_id, w.word_text, c.image_id, i.image_date, COUNT( c.word_id ) AS quantity
FROM ".WORDLIST_TABLE." w
LEFT JOIN ".WORDMATCH_TABLE." c ON w.word_id = c.word_id
LEFT JOIN ".IMAGES_TABLE." i ON c.image_id = i.image_id
WHERE keys_match >0
AND i.image_date >= ".(time() - 60 * 60 * 24 * 7)." // 7 means 7 days, if you want to show popular tags from last months replace 7 with 30, for last year 365
GROUP BY w.word_text
ORDER BY quantity DESC
LIMIT 20";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    $tags[$row['word_text']] = $row['quantity'];
  }
 
  //uncommentnext line to sort the tag array in reverse order (+ => -)
   //arsort($tags);   
        $max_size = 250; // max font size in %
        $min_size = 80; // min font size in %
       
        // largest and smallest array values
        $max_qty = max(array_values($tags));
        $min_qty = min(array_values($tags));
       
        // find the range of values
        $spread = $max_qty - $min_qty;
        if ($spread == 0) { // we don't want to divide by zero
                $spread = 1;
        }
       
        // set the font-size increment
        $step = ($max_size - $min_size) / ($spread);
       
        // loop through the tag array
        foreach ($tags as $key => $value) {
                // calculate font-size
                // find the $value in excess of $min_qty
                // multiply by the font-size increment ($size)
                // and add the $min_size set above
                $size = round($min_size + (($value - $min_qty) * $step));
       
                $output .= '<a href="'.$site_sess->url(NUKE_PATH."search&search_keywords=".$key.((!empty($mode)) ? "&amp;mode=".$mode : "")).'" style="font-size:'.$size.'%;color:rgb('.mt_rand(0, 255).', '.mt_rand(0, 255).', '.mt_rand(0, 255).');font-family:Verdana, Arial, Helvetica, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.$key.'">'.$key.'</a> ';
        }

 
  return $output;
}
//---[/[MOD] Tag Cloud]

Note:      AND i.image_date >= ".(time() - 60 * 60 * 24 * 7)." // 7 means 7 days, if you want to show popular tags from last months replace 7 with 30, for last year 365

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #123 on: April 29, 2009, 01:56:02 PM »
hi Lucifix,

thank you for that.. but a little correction.. those are not popular tags.... ;)

this are the tags from pictures, as in your example, which are added last 7 days.
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #124 on: April 29, 2009, 02:13:00 PM »
Hey Nicky!

Why not popular tags? :) Let say that in summer many users will tag their pictures with tags like: summer, beach, sea, sunny etc. This modification will show you tags within last week - and for me those are popular tags :)  :roll:

And of course you can interpreted this modification otherwise ;)

Offline jeanpier

  • Pre-Newbie
  • Posts: 2
    • View Profile
    • http://www.grottes-et-karsts-de-chine.org
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #125 on: April 30, 2009, 01:38:24 PM »
Hi

Thank you for this great mod
but
as some other post (arabic, cyrillic) he don't work with utf8 data... for me is with french and chinese
after long time to try to understand :
this mod use the words of word_text from wordlist
this words are created by the function add_searchwords() and all this belonging functions as prepare_searchwords()

for example :
the word entrée (in utf8 in image_keywords from images ) :  displayed with iso encoding must be entrée
after transformation by add_searchwords()
the word entrée is corrupt (bad utf8 in word_text from wordlist) : displayed with iso encoding is entrã©e with utf8 entr�e

That means the add_searchwords() and all this belonging function as prepare_searchwords() don'work properly with utf8.

So i have find some solution to fixe it. (for example strtoupper($key) but this correct only few characters...)
But until now not enought to work in any situation especially with th search engine...have to find a global methode...
I continue to work by disable some function and make some analysis.

If somebody have more idees ??
Many thanks

Jean Pierre
« Last Edit: April 30, 2009, 01:53:50 PM by Nicky »

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #126 on: May 02, 2009, 04:39:58 AM »
I have a problem when using this mod together with the search by color mod...  On the 200 word keyword page I am seing the color codes show up as key words in the cloud....

Since I can no longer find the search by color mod thread I am unsure what to do... Any help would be appreciated...

I just remembered if you ad this
Code: [Select]
AND c.colorsearch_colors_match = 0
to this
Code: [Select]
WHERE keys_match > 0
it fixes the problem in the flash keyword mod....

And it fixes the error with this page too... !
« Last Edit: May 02, 2009, 05:50:17 AM by AntiNSA2 »
As long as I can finish my site before I die.

Offline lceman

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #127 on: May 10, 2009, 10:50:49 PM »
Ich dachte bisher ich sei für mein Alter ziemlich versiert was Webseiten angeht... Aber bei 4images hört es anscheinend auf  :(


Ich bekomme nicht mal so einen einfachen Mod wie diesen hier zum Laufen!


Oder liegt es an der neuen Version 1.7.6?? Wenn ja - woher bekomme ich die alten Versionen?



Grüße, Stefan


edit: kann mir vielleicht jemand die veränderten dateien hochladen? Am Besten das komplette "4images" mit allen Mods installiert - kaputt machen geht leichter als zu installieren  :oops:

Offline Farina

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #128 on: May 30, 2009, 08:43:03 AM »
This is my first try on 4images MOD ..view it http://jdmmod.com

Offline praveen

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #129 on: June 07, 2009, 10:02:06 AM »
Thank you for this nice mod.

is there a way, i could leave out some categories and not show them in the tag cloud?

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #130 on: June 14, 2009, 06:57:17 PM »
For seo do this find

Code: [Select]
  $output .= '<a href="'.
replace  with

Code: [Select]
  $output .= '<a rel="nofollow" href="'.
As long as I can finish my site before I die.

Offline eddyman1us

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #131 on: July 03, 2009, 03:39:12 AM »
can anybody confirm if its working with v1.7.7 I applied the code and also debug it
Code: [Select]
$max_to_show = 10 ;// max items to display but after adding the 2 tags {lang_keyword} and {show_tag_clouds} .

The field is blank and nothing is displayed , any suggestions ...

Offline hitrax

  • Pre-Newbie
  • Posts: 7
    • View Profile
    • www.tigermotte.de
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #132 on: July 25, 2009, 12:02:17 PM »
Hallo zusammen

Ich setzte diesen klasse Mod auf meiner Webseite ein und bin eigentlich auch sehr zufrieden damit.
Ich habe allerdings ein kleines Problem. Ein teil meiner Keywords sind in folgender Syntax geschrieben
[Orchis_militaris]. In der Detailpage werden die Keywords auch korrekt angezeigt.
In der Tag Cloud steht dann nur noch orchismilitaris.
Kann man das ändern das die Keywords in der Tag Cloud identisch angezeigt werden ?
Falls das hier schon irgendwo beantwortet worden sein sollte, bitte ich um Entschuldigung, mein English ist miserabel.

Helge

Offline whosthis.ee

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #133 on: August 02, 2009, 10:36:46 PM »
im using 1.7.6

the same is working fine

tks

Offline dp

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #134 on: September 23, 2009, 05:40:08 PM »
I'm using this MOD with v 1. 7. 7 on mobile server.  It works perfect!

Many thanks for the great work!

Dirk