Author Topic: [MOD] Flash Tag Cloud ?  (Read 21271 times)

0 Members and 1 Guest are viewing this topic.

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
[MOD] Flash Tag Cloud ?
« on: June 04, 2009, 11:34:17 AM »
Anyone knows where it has gone, as I can't seem to find the topic :/

Only some Arabic, but seems like it is missing some files or something
« Last Edit: June 04, 2009, 12:18:43 PM by mawenzi »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Flash Tag Cloud?
« Reply #1 on: June 04, 2009, 11:47:09 AM »
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: Flash Tag Cloud?
« Reply #2 on: June 04, 2009, 11:51:42 AM »
Ohh okay.

I got it to work anyway :)

Would it be okay to post the mod so other people could benefit from it?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Flash Tag Cloud?
« Reply #3 on: June 04, 2009, 11:55:21 AM »
... I think it would be very good ...
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: Flash Tag Cloud?
« Reply #4 on: June 04, 2009, 12:10:50 PM »
This mod was originally posted by KW.
The text/code is from the Arabic topic, but couldn't find the files needed for this mod there.

Backup everything before editing any files.

Also remember to add the .js and .swf to your template directory from the attached zip file.


Open lang/[your_language_folder]/main.php
Find:
Code: [Select]
?>Add Before:
Code: [Select]
//-----------------------------------------------------
//- Mod: Flash-Tag-Clouds by KW -------------------
//-----------------------------------------------------
$lang['flash_keyword_clouds'] = "Tag Cloud";

Open includes/page_header.php
Find:
Code: [Select]
"url_search" => $site_sess->url(ROOT_PATH."search.php"),Add After:
Code: [Select]
//--- Start Mod: Flash-Tag-Clouds by KW ---------------
  "flash_keyword_clouds" => get_flash_keyword_clouds(),
//--- End Mod: Flash-Tag-Clouds by KW -----------------

Open includes/functions.php
Find:
Code: [Select]
?>Add Before:
Code: [Select]
/*---------------------- Start MOD Flash-Tag-Clouds by KW --------------------*/
function get_flash_keyword_clouds() {
global $site_db, $lang, $site_sess, $mode;

/*-----------------------------------------------------------------------------*/
/*--- Start Setting / Einstellungen -------------------------------------------*/
$flash_tag_clouds_width  = "100%";       // Width from the Flash                / Breite der Flashanzeige
$flash_tag_clouds_height = "100";        // height from the Flash               / Höhe der Flashanzeige
$flash_tag_clouds_textcolor = "004C75";  // color from the flashtext            / Farbe des Flashtextes (e.g. 000000 or ffffff ...)
$flash_tag_clouds_textspeed = "200";     // speed from the flying text          / Geschwindigkeite de fliegenden Textes  (e.g. 150 or 200 ...)
$flash_tag_clouds_textlimit = "20";      // Limit- How many searchwords         / Limit- Wie viele Suchworte
$flash_tag_clouds_size_max = "60";       // Max. textsize                       / Max. Textgröße
$flash_tag_clouds_size_min = "20";       // Min. textsize                       / Min. Textgröße
$flash_tag_clouds_transparent = "true";  // Flash transparently: true or false  / Flash transparent: true oder false
$flash_tag_clouds_flashcolor = "ffffff"; // => if false: Bgcolor                / => falls false: Hintergrundfarbe  (e.g. ffffff or 000000 ...)
/*--- End Setting / Einstellungen ---------------------------------------------*/
/*-----------------------------------------------------------------------------*/

        $flash_tag_clouds_text = "var so = new SWFObject(\"".TEMPLATE_PATH."/flash_tag_clouds.swf\", \"tagcloud\", \"".$flash_tag_clouds_width."\", \"".$flash_tag_clouds_height."\", \"7\", \"#".$flash_tag_clouds_flashcolor."\"); \n";
        if ($flash_tag_clouds_transparent == 'true') {
        $flash_tag_clouds_text .= "so.addParam(\"wmode\", \"transparent\"); \n";
        }
        $flash_tag_clouds_text .= "so.addVariable(\"tcolor\", \"0x".$flash_tag_clouds_textcolor."\");\n";
        $flash_tag_clouds_text .= "so.addVariable(\"mode\", \"tags\"); \n";
        $flash_tag_clouds_text .= "so.addVariable(\"distr\", \"true\"); \n";
        $flash_tag_clouds_text .= "so.addVariable(\"tspeed\", \"".$flash_tag_clouds_textspeed."\"); \n";
        $flash_tag_clouds_text .= "so.addVariable(\"tagcloud\", \"<tags>";
$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 $flash_tag_clouds_textlimit";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$tags[$row['word_text']] = $row['quantity'];
}
        $max_qty = max(array_values($tags));
        $min_qty = min(array_values($tags));

        $spread = $max_qty - $min_qty;
        if ($spread == 0) {
        $spread = 1;
        }
        $step = ($flash_tag_clouds_size_max - $flash_tag_clouds_size_min) / ($spread);
        foreach ($tags as $key => $value) {
        $size = round($flash_tag_clouds_size_min + (($value - $min_qty) * $step));
        // clean keys for flashtext:
        $key2 = $key;
        $key2 = str_replace('"',' ',$key2);
        $key2 = str_replace('&',' ',$key2);
        $key2 = str_replace('%',' ',$key2);
        $key2 = str_replace('>',' ',$key2);
        $key2 = str_replace('<',' ',$key2);
        $key2 = str_replace('+',' ',$key2);
        //
        $flash_tag_clouds_text .= "<a href='".$site_sess->url(ROOT_PATH."search.php?search_keywords=".$key.((!empty($mode)) ? "&amp;mode=".$mode : ""))."' style='".$size."'>".$key2." [".$value."]</a>";
        }
return $flash_tag_clouds_text;
}
/*----------------------- End MOD Flash-Tag-Clouds by KW ---------------------*/

Open templates/[your_template_folder]/home.html

Add this where you want to show the Flash Tag Cloud:
Code: [Select]
                 <!--  Start Mod: Flash-Tag-Clouds by KW  -->
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head2" valign="top">{lang_flash_keyword_clouds}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="row1">
                      <script type="text/javascript" src="{template_url}/swfobject.js"></script>
                      <div id="flashcontent_menue" style="border: 0px solid #000000;">Install flash.</div>
                      <script type="text/javascript">
                      {flash_keyword_clouds}</tags>");
                      so.write("flashcontent_menue");
                     </script>
                     <br />
                    </td>
                   </tr>
                   </table>
                  <!--  End Mod: Flash-Tag-Clouds by KW  -->
And for details.html, search.html, etc. :
Code: [Select]
                 <!--  Start Mod: Flash-Tag-Clouds by KW  -->
                  <table width="100%" border="0" cellspacing="1" cellpadding="0" class="head1">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_flash_keyword_clouds}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="row1">
                      <script type="text/javascript" src="{template_url}/swfobject.js"></script>
                      <div id="flashcontent_page" style="border: 0px solid #000000;">Install flash.</div>
                      <script type="text/javascript">
                      {flash_keyword_clouds}</tags>");
                      so.write("flashcontent_page");
                     </script>
                    </td>
                   </tr>
                   </table>
                   <br />
                  <!--  End Mod: Flash-Tag-Clouds by KW  -->


Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Flash Tag Cloud?
« Reply #5 on: June 04, 2009, 12:15:37 PM »
... thanks BartAfterDark ...
... moved to Mods & Plugins (Releases & Support) ...
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Re: [MOD] Flash Tag Cloud?
« Reply #6 on: June 04, 2009, 12:18:53 PM »
Cool!
Have you animore Mods of KurtW?
Beste Grüße
Benny

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: [MOD] Flash Tag Cloud ?
« Reply #7 on: June 04, 2009, 12:28:44 PM »
Not that I know of.

Do you need anything special?

Offline Benny Change

  • Addicted member
  • ******
  • Posts: 1.788
  • #WWG1WGA
    • View Profile
    • Qlobal-Change
Re: [MOD] Flash Tag Cloud ?
« Reply #8 on: June 04, 2009, 01:04:30 PM »
Yes im Need:

MOD´s by KW :(:
or Like:

- Mod Flash MP3 Player
- MOD PMv3
- MOD Pin Images
Beste Grüße
Benny

Rembrandt

  • Guest
Re: [MOD] Flash Tag Cloud ?
« Reply #9 on: June 05, 2009, 01:20:34 PM »
Hi!
...- Mod Flash MP3 Player
schick mir mal deine e-mail add.

mfg Andi

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Flash Tag Cloud ?
« Reply #10 on: March 05, 2010, 08:28:21 AM »
Hey -

Thanks for the MOD. Added it to the home.html page but doesn't add much.

Added it to the search.html page and wow, really works well. Press one keyword and you have it all sorted.

Noted one issue with this MOD:

adding this,
Quote
$lang['flash_keyword_clouds'] = "Tag Cloud";
to the main.php language file did not help with the title words display in the bar above the tag cloud for either the home.html or the search.html.

My solution: added the language term
Quote
"lang_flash_keyword_clouds" => $lang['flash_keyword_clouds'],
below this language term in the search.php file:
Quote
"lang_keywords_only" => $lang['keywords_only'],

Yes, then the title appeared perfectly but ....  that fix works on the yourwebsite.com/search.php page but when you click on a keyword, and the url changes to include the search parameter indicated, the title description from $lang['flash_keyworld_clouds'] disappears again .... arrggghhh!

One question if anyone feels so inclined to help:

1. How do I spread out the tag cloud? It is concentrated in a small area of the table. I would like it to be spread out much wider.  I tried modifying the settings in the code we pasted in the includes/functions.php file but it had no effect.

Thanks,

Brian
« Last Edit: March 05, 2010, 08:42:04 AM by surferboy »

Offline CodeMan

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • ArabGlobe.com
Re: [MOD] Flash Tag Cloud ?
« Reply #11 on: April 16, 2013, 09:25:56 PM »
Hello,


Does anyone know how to apply colors to the tags in the flash cloud?
Would be very nice if it's possible.


Thanks!
« Last Edit: April 20, 2013, 01:05:25 AM by CodeMan »

Offline bma2004

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] Flash Tag Cloud ?
« Reply #12 on: September 02, 2013, 02:20:59 PM »
Flash does not understand the Cyrillic letters. You can ask the fla source file?

Offline wallward

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: [MOD] Flash Tag Cloud ?
« Reply #13 on: January 14, 2014, 04:11:22 PM »