• [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 228458 times)

0 Members and 1 Guest are viewing this topic.

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #15 on: March 13, 2007, 08:31:23 PM »
great mod ^^thanks a lot
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #16 on: March 13, 2007, 08:35:40 PM »
excellent and simple to add!

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #17 on: March 14, 2007, 02:11:27 AM »
But turkish
Code: [Select]
ü, Ü, ö, Ö, i, İ letter,
wrong display: ue
example: ueniversitesi  to üniversitesi
example: koy to köy
hi
your problem is not related to this mod...
but try his code to replace accentuated or special characters in some text :
Code: [Select]
function clean_text($text)
    {
     $clean_text= strtr($text,
   "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ",
   "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn");

     return $clean_text;
    }
you can add some new character...
ch€ri{Bi}²


Offline Bugfixed

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • Lavinya
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #18 on: March 14, 2007, 04:11:37 PM »
hmmm thanks ch€ri{Bi}²
<?php echo 'Hello, World!'; ?>

Offline as12qw

  • Pre-Newbie
  • Posts: 1
    • View Profile
Big problem in implementing this mod !!
« Reply #19 on: April 05, 2007, 07:49:16 AM »
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

Offline waleed

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Big problem in implementing this mod !!
« Reply #20 on: April 05, 2007, 12:53:56 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

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #21 on: April 16, 2007, 04:52:51 PM »
for all the errors, check this part of the code in functions.php after the first sql query:
Code: [Select]
while ($row = $site_db->fetch_array($result)) {
    $tags[$row['word_text']] = $row['quantity'];
  }

 :?:  can you say it returns an array? 

afer the last code, insert this (for debug):
Quote
print_r($tags);
it will show you if $tags is an array or not...

 :arrow: because all the code is based on the query result... so if there is no result or if the query fails... it will show noting...
ch€ri{Bi}²


Offline jrey

  • Full Member
  • ***
  • Posts: 165
    • View Profile
    • http://www.jrey.net
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #22 on: April 24, 2007, 12:17:58 AM »
Is possible to change the mod for show any basic info of the image instead of the keywords ?. I wanna show in the cloud the image name, author, description....

Offline SN1P3R

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #23 on: April 26, 2007, 10:35:37 AM »
But turkish
Code: [Select]
ü, Ü, ö, Ö, i, İ letter,
wrong display: ue
example: ueniversitesi  to üniversitesi
example: koy to köy
hi
your problem is not related to this mod...
but try his code to replace accentuated or special characters in some text :
Code: [Select]
function clean_text($text)
    {
     $clean_text= strtr($text,
   "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ",
   "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn");

     return $clean_text;
    }
you can add some new character...

where i must add this code ?

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #24 on: April 26, 2007, 12:13:29 PM »
place the code in functions.php
and after this, you can apply it on any text (let's say $some_text is your text with special characters)  by using :
Code: [Select]
$some_text = clean_text($some_text);
ch€ri{Bi}²


Offline lemccoy

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • DrunkIsland
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #25 on: May 01, 2007, 03:12:54 AM »
this is a great mod and fairly simple too!

Offline SoftDux

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • SoftDux - The Leaders in Software & Networking
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #26 on: May 05, 2007, 03:56:36 PM »
Can this mod be used to automatically categorise images?

Let's say I have a category called "cars", and the user is uploading the photo, and he chooses "cars" from say a dropdown, or something, can it automatically be put in the correct category?
Visit these Website:  SA WebHosting Talk || SoftDux

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [MOD] Tag cloud (or category cloud in web2.0)
« Reply #27 on: May 31, 2007, 11:59:52 AM »
hi,

this is a little modification : it shows a cloud of your categories (random categories by hits).

in the original mod , in STEP2, replace the code in functions.php by this one :

Code: [Select]
//---[ [MOD] Tag Cloud]
function get_tag_clouds() {

  global $site_db, $site_sess, $lang;
 
  $output = "";
 
  $max_to_show = 10 // max items to display
 
  $max_size = 300; // max font size in %
  $min_size = 70; // min font size in %
 
  $max_qty = 0;
  $min_qty = 0;
 
  $sql = "SELECT cat_id, cat_name, cat_hits
          FROM ".CATEGORIES_TABLE."
          ORDER BY RAND()";
  $result = $site_db->query($sql);
 
  while ($row = $site_db->fetch_array($result)) {
    $tags_hits[$row['cat_id']] = $row['cat_hits'];
$tags[$row['cat_id']] = $row['cat_name'];
  }
 
  $max_qty = max(array_values($tags_hits));
  $min_qty = min(array_values($tags_hits));
 
  // 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);
  $i = 0;
  foreach ($tags as $key => $value) {
  if ((check_permission("auth_viewcat", $key)) && $i < $max_to_show)  {
                // 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 + (($tags_hits[$key] - $min_qty) * $step));
        $css_color =  'rgb('.mt_rand(64,128).', '.mt_rand(64,128).', '.mt_rand(0,255).')';
                $output .= '&nbsp;<a href="'.$site_sess->url(ROOT_PATH."categories.php?cat_id=".$key).'" style="font-size:'.$size.'%;color:'.$css_color.';font-family:Arial, sans-serif;" title="'.$lang['category'].' '.$value.' / Hits: '.$tags_hits[$key].' ">'.$value.'</a>&nbsp;';

$i++;
}
  }

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

that's all folks !  :wink:

 :idea: and now... for all those who asked (or will ask) how to show this  and how to show that :

take the sql part of the code:
Quote

$sql = "SELECT cat_id, cat_name, cat_hits
          FROM ".CATEGORIES_TABLE."
          ORDER BY RAND()";
  $result = $site_db->query($sql);
 
  while ($row = $site_db->fetch_array($result)) {
    $tags_hits[$row['cat_id']] = $row['cat_hits'];
   $tags[$row['cat_id']] = $row['cat_name'];
  }


and change the part in red to display the id/name/hits you want  and don't forget to change the link   :wink:
ch€ri{Bi}²


Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [MOD] Tag cloud (or keyword cloud in web2.0)
« Reply #28 on: June 12, 2007, 12:18:51 AM »
place the code in functions.php
and after this, you can apply it on any text (let's say $some_text is your text with special characters)  by using :
Code: [Select]
$some_text = clean_text($some_text);
what does that mean - apply? How can I parse all those previously entered keywords?
In Russian it also spoils several characters, changing it to "ue"  :?


Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [MOD] Tag cloud ( keyword & cat cloud in web2.0 style)
« Reply #29 on: June 12, 2007, 01:10:00 PM »
I think that the problem is inside this mod, because in details page all those keyword are displayed properly, without those "ue"  :(

And the links in detais page look like:
/search.htm?search_keywords=%D5%E0%F0%FC%EA%EE%E2
and not:
/search.htm?search_keywords=Харueков
like in output of your MOD.
 :|

Is it possible to parse it likewise the details page do? With corerect symbols etc  :?: