• [MOD] Keyword Tag Cloud (on custom page) 4 0 5 1
Currently:  

Author Topic: [MOD] Keyword Tag Cloud (on custom page)  (Read 55169 times)

0 Members and 1 Guest are viewing this topic.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
[MOD] Keyword Tag Cloud (on custom page)
« on: October 23, 2007, 11:58:19 PM »
     - Vorwort :
    • FAQ : Was ist eine Keyword Tag Cloud im Web2.0 Style ... ?
      Die Suchwort Wolke ist eine grafische Darstellung der Suchwörter, die auf der Website verwendet werden. Suchwörter mit höherer Anzahl werden mit einer größeren Schrift gezeigt. Auf einem Blick bist du in der Lage zu sehen, wo und was die wichtigsten Schlüsselwörter sind.
    • Mit dieser Modifikation wird eine große Suchwort Wolke auf einer gesonderten Seite erzeugt.
    • Diese Art von MOD wurde im Forum von cruxy hier angefragt.
    • Ca. 95% des Codes geht auf den [MOD] Tag cloud (keyword & cat cloud in web2.0 style) von ch€ri{Bi}² zurück !
    • Dieser MOD läßt sich gut als Erweiterung zu ch€ri{Bi}²'s [MOD] Tag cloud einsetzten, wobei er absolut unabhängig von diesem MOD läuft und so auch unabhängig bzw. auch parallel von diesem auf deiner 4images-Site eingesetzt werden kann.
     - Preface :
    • FAQ : What is a Keyword Tag Cloud in web2.0 style ... ?
      The Keyword Cloud is a visual representation of keywords used on the website. Keywords having higher density are showed in a larger fonts. At a glance you will able to see what and where the most important keywords are.
    • This modification generated a big keyword cloud on a custom page.
    • This kind of MOD was here in the forum by cruxy requested.
    • Ca. 95% of the code is from [MOD] Tag cloud (keyword & cat cloud in web2.0 style) by ch€ri{Bi}² !
    • You can use this mod as a extension of ch€ri{Bi}²'s [MOD] Tag cloud .
    • But this mod works also without and also with ch€ri{Bi}²'s mod on your 4images site.

    - Demo zum MOD :
    • Gibt es auf meiner Seite zu sehen : hier !
    - MOD-Demo :
    • You can see it on my site : here !

    / - Version :
    • 23.10.2007 -  Version 1.0 - Veröffentlichung

    - Dateien die zu ändern sind :
    - Files to be changed :
    • includes/page_header.php
    • lang/<your_lang>/main.php
    - und je nach Linkeinbindung in deine Templates
    - and for links in you templates e.g.
    • templates/<your_template>/user_logininfo.html
    • templates/<your_template>/user_loginform.html

    - Neue Dateien :
    - New files :
    • keyword_cloud.php
    • templates/<your_template>/keyword_cloud.html

    - Installation :
    WICHTIG: Mache vor der Installation von den zu ändernden Dateien ein Backup.  Nur zur eigenen Sicherheit und nicht dass keiner das Selbstverständliche nochmals erwähnt hätte ... .
    - Installation :
    IMPORTANT: Make a backup of your original files ... .


    - 1. Schritt
    lege im Root-Verzeichnis die neue Datei keyword_cloud.php mit dem folgenden Inhalt an :
    - 1. Step
    in the root directory make a new file keyword_cloud.php with following content :
    [/list]
    Code: [Select]
    <?php 
    /************************************************************************** 
     *                                                                        * 
     *    4images - A Web Based Image Gallery Management System               * 
     *    ----------------------------------------------------------------    * 
     *                                                                        * 
     *             File: keyword_cloud.php                                    *
     *            Autor: mawenzi ... thanks to ch€ri{Bi}² ...                 *
     *        Copyright: (C) 2002 Jan Sorgalla                                *
     *            Email: jan@4homepages.de                                    * 
     *              Web: http://www.4homepages.de                             * 
     *    Scriptversion: 1.7.x                                                *
     *************************************************************************/

    $main_template 'keyword_cloud';

    define('GET_CACHES'1); 
    define('ROOT_PATH''./'); 
    define('GET_USER_ONLINE'1); 
    include(
    ROOT_PATH.'global.php'); 
    require(
    ROOT_PATH.'includes/sessions.php'); 

    if (isset(
    $HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
        
    $template = (isset($HTTP_POST_VARS['template'])) ? basename(stripslashes($HTTP_POST_VARS['template'])) : basename(stripslashes($HTTP_GET_VARS['template']));
      if (!
    file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
        
    $template "";
      }
      else {
        
    $main_template $template;
      }
    }
    else {
      
    $template "";
    }
    include(
    ROOT_PATH.'includes/page_header.php');

    //--- Language Tags -----------------------------------
    $keyword_cloud_descr_eng "<b>FAQ :</b> Keyword Cloud ?<br>The Keyword Cloud is a visual representation of keywords used on my website. Keywords having higher density are showed in a larger fonts. At a glance you will able to see what and where my most important keywords are.";
    $keyword_cloud_descr_deu "<b>FAQ :</b> Suchwort Wolke ?<br>Die Suchwort Wolke ist eine grafische Darstellung der Suchwörter, die auf meiner Website verwendet werden. Suchwörter mit höherer Anzahl werden mit einer größeren Schrift gezeigt. Auf einem Blick bist du in der Lage zu sehen, wo und was meine wichtigsten Schlüsselwörter sind.";
    $lang_keyword_cloud "Suchwort Wolke - Keyword Cloud";

    //--- Clickstream -------------------------------------
    $clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator']."".$lang_keyword_cloud."</span>";

    //--- Keyword Cloud -----------------------------------
    function get_keyword_cloud() {
    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 200"
    ;

      
    $result $site_db->query($sql);
      while (
    $row $site_db->fetch_array($result)) {
        
    $tags[$row['word_text']] = $row['quantity'];
      }
            
    $max_size 500// max font size in %
            
    $min_size 100// min font size in %

            
    $max_qty max(array_values($tags));
            
    $min_qty min(array_values($tags));

            
    $spread $max_qty $min_qty;
            if (
    $spread == 0) {
                
    $spread 1;
            }

            
    $step = ($max_size $min_size) / ($spread);

            foreach (
    $tags as $key => $value) {
                    
    $size round($min_size + (($value $min_qty) * $step));
                    
    $output .= ' <b><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(0255).', '.mt_rand(0255).', '.mt_rand(0255).');font-family:Verdana, Arial, Helvetica, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.$key.'">'.$key.'</b> ['.$value.']</a>  ';
            }
      return 
    $output;
    }
    //--- Ende Keyword Cloud ------------------------------


    //--- Print Out ---------------------------------------
    $site_template->register_vars(array(
      
    "clickstream" => $clickstream,
      
    "keyword_cloud_descr_eng" => $keyword_cloud_descr_eng,
      
    "keyword_cloud_descr_deu" => $keyword_cloud_descr_deu,
      
    "lang_keyword_cloud" => $lang_keyword_cloud,
      
    "show_keyword_cloud" => get_keyword_cloud(),

    )); 
    $site_template->print_template($site_template->parse_template($main_template)); 
    include(
    ROOT_PATH.'includes/page_footer.php'); 
    ?>



    - 2. Schritt
    lege im Template-Verzeichnis die neue Datei an :
    /templates/<dein_Template>/keyword_cloud.html
    wobei du eine Kopie deiner :
    /templates/<dein_Template>/error.html
    verwenden solltest, indem du die Datei entsprechend umbenennst und dann den folgenden Code (Beispiel Standard-Template) :
    - 2. Step
    make a new file in the template directory :
    /templates/<your_template>/keyword_cloud.html
    you should make a copy of your :
    /templates/<your_template>/error.html
    with the new name and replace the following content (example standard-template) :
    Code: [Select]
    <b class="title">{lang_error}</b>
    <hr size="1" />
    <p>{error_msg}</p>

    - durch diesen neuen Code ersetzt (so ist schon mal das umgebene Design deines Templates gewahrt ... !) :
    - by this new code ( design of your template is saved ... !)
    Code: [Select]
    <b class="title">{lang_keyword_cloud}</b>
    <hr size="1" />
    {keyword_cloud_descr_deu}<hr size="1" />{keyword_cloud_descr_eng}
    <br><br>
    <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr><td class="head1">
        <table width="100%" border="0" cellspacing="0" cellpadding="3">
        <tr><td class="head1" height="20" valign="middle" align="left" >{lang_keyword_cloud}</td></tr>
        </td></tr></table>
        </td></tr>
        <tr><td class="head1">
        <table width="100%" border="0" cellspacing="0" cellpadding="20">
        <tr><td align="center" valign="middle" bgcolor="#ffffff">
            {show_keyword_cloud}
        </td></tr></table>
    </td></tr></table>

    - Die weitere Template-Gestaltung ist natürlich deine Sache .
    In der keyword_cloud.html können die folgenden Tags verwendet werden :
    - Of course is template designing your part.
    The following tags are available to use in keyword_cloud.html :
    {clickstream}
    {keyword_cloud_descr_eng}
    {keyword_cloud_descr_deu}
    {lang_keyword_cloud}
    {show_keyword_cloud}


    - Wobei die Bedeutung der Tags selbsterklärend sein dürfte ... .
    - You recognize the meaning of the tags alone ... .


    - 3. Schritt
    Öffne die Datei includes/page_header.php und finde :
    - 3. Step
    Open the file includes/page_header.php and find :
    Code: [Select]
    "url_home" => $site_sess->url(ROOT_PATH."index.php"),
    - und füge unmittelbar dahinter die folgende Codezeile ein.
    - and insert after the following code.
    Code: [Select]
    "url_keyword_cloud" => $site_sess->url(ROOT_PATH."keyword_cloud.php"),
    "lang_200_keyword_cloud" => $lang['200_keyword_cloud'],


    - 4. Schritt
    Öffne die Datei /lang/deutsch/main.php und finde am Ende :
    - 4. Step
    Open the file /lang/<your_lang>/main.php and find at the end :
    Code: [Select]
    ?>

    - und füge unmittelbar davor den folgenden Code ein:
    Code: [Select]
    //-----------------------------------------------------
    //--- [MOD] Keyword Cloud -------------
    //-----------------------------------------------------
    $lang['200_keyword_cloud'] = "200 Keyword Cloud";
    $lang['tagged_with'] = "image(s) with tag: ";


    - and insert above the following code :
    Code: [Select]
    //-----------------------------------------------------
    //--- [MOD] Keyword Cloud -------------
    //-----------------------------------------------------
    $lang['200_keyword_cloud'] = "200 Keyword Cloud";
    $lang['tagged_with'] = "image(s) with tag: ";


    - 5. Schritt
    Jetzt kannst du an jeder Stelle in deinen Templates den folgenden Tag als Link zu deiner Keyword Cloud Seite verwenden. Z.B. in deinem Menü (user_logininfo.html , user_loginform.html) .
    - 5. Step
    Now you can use on every place in your templates the following tag as link to your keyword cloud site e.g. in your menue (user_logininfo.html , user_loginform.html) .
    Code: [Select]
    &raquo;<a href="{url_keyword_cloud}">{lang_200_keyword_cloud}</a>


    - 6. Schritt - Einstellungmöglichkeiten
    Die folgenden Einstellungen lassen sich zur Anpassung an deine Website in der keyword_cloud.php vornehmen:
    • Suchwörter pro Wolke : Standard = 200 ; Änderung unter - LIMIT 200";
    • Max. Buchstabengröße in der Wolke : Standard = 500% ; Änderung unter - $max_size = 500;
    • Min. Buchstabengröße in der Wolke : Standard = 100% ; Änderung unter - $min_size = 100;
    • Farbe der Suchwörter in der Wolke : Standard = rgb(xxx,xxx,xxx) ; Änderung unter - '.mt_rand(0, 255).', '.mt_rand(0, 255).', '.mt_rand(0, 255).'

    - 6. Step - Settings
    The following settings can be made for the adjustment of your website in keyword_cloud.php :
    • keywords in the cloud : standard = 200 ; change through - LIMIT 200";
    • max. font size in the cloud : standard = 500% ; change through - $max_size = 500;
    • min. font size in the cloud : standard = 100% ; change through - $min_size = 100;
    • color of keywords in the cloud : standard = rgb(xxx,xxx,xxx) ; change through - '.mt_rand(0, 255).', '.mt_rand(0, 255).', '.mt_rand(0, 255).'


    thanks to ch€ri{Bi}² ...  8)
    mawenzi
    « Last Edit: October 12, 2009, 05:18:43 PM by mawenzi »
    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) ...

    rinaldos

    • Guest
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #1 on: October 26, 2007, 05:24:18 PM »
    Hi Mawenzi,
    ich habe den MOD eingebaut, und er funktioniert soweit ganz gut, nur lässt er sich starten wenn ich http://rinaldos.homeip.net/keyword_cloud.php angebe.
    Quote
    <a href="{url_200_keyword_cloud}">{200_keyword_cloud}</a>

    Das scheint bei mir irgendwie nicht zu funktionieren.

    Gruß
    Ingo

    Offline mawenzi

    • Moderator
    • 4images Guru
    • *****
    • Posts: 4.500
      • View Profile
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #2 on: October 26, 2007, 06:18:12 PM »
    Hallo Ingo,

    ... danke für dein Statement ...
    ... ich dachte dieser Thread geht schon ganz unter, nachdem es einige mit diesem MOD zunächst so dringend und eilig hatten ...
    ... also der Link für das Menü muss richtig sein ...
    Code: [Select]
    <a href="{url_200_keyword_cloud}">{lang_200_keyword_cloud}</a>
    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) ...

    rinaldos

    • Guest
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #3 on: October 26, 2007, 06:30:32 PM »
    Habe gerade nochmal die Zeile in meine user_loginform.html eingebaut. Aber der Link verweist auf meine Startseite und nicht auf die php datei.... Habe auch gerade nochmal alle Zeilen gecheckt.
    Ich nutze die Version 1.7.4 mit PHP5.

    Gruß
    Ingo

    rinaldos

    • Guest
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #4 on: October 26, 2007, 06:35:58 PM »
    Ähm,
    ich weiss nicht was ich nun gemacht habe. Habe nur ein paar Leerzeichen in die page_header eingefügt und nun klappt es auch.....

    Also der MOD funktioniert bei mir nun einwandfrei.......... Danke für die schnelle Reaktion :-)
    Gruß
    Ingo

    Offline Loda

    • Sr. Member
    • ****
    • Posts: 353
      • View Profile
      • Fotosucht Schweiz
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #5 on: October 26, 2007, 07:18:44 PM »
    hi,
    funktioniert wunderbar! danke Detlev!!

    Offline glitzer

    • Full Member
    • ***
    • Posts: 204
      • View Profile
      • over 7000 E-Cards
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #6 on: October 28, 2007, 09:12:19 AM »
    Hallo Detlef!

    ich hoffe du kannst mir helfen!
    Es geht um meinen Mod Web Style 2.0, also um die kleine Tag Cloud. Ich hab zwar auch im anderen Beitrag gefragt, aber dort hat mir niemand richtig geantwortet.
    Ich hab die Tag Cloud nun in meiner linken Navi eingebaut, aber die Tabelle ist zu breit und ich bekomme sie nicht schmäler! Auch wenn ich die Tags in eine eigene Tabelle mit festgesetzten Pixels reingebe. Ich habe auch die Schriftgröße kleiner gemacht um es dann kleiner zu bekommen, aber statt dessen sind dann nochmehr wörter nebeneinander.

    Ich frage dich, weil du auf deiner Seite die kleine Tag Cloude auch viel schmäler hast. Kannst du mir bitte helfen?
    Ich brauch eine Breite von ca. 130px. Vielen Dank, Glitzer


    Offline kai

    • Administrator
    • Addicted member
    • *****
    • Posts: 1.421
      • View Profile
      • 4images - Image Gallery Management System
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #7 on: October 28, 2007, 07:46:53 PM »
    Thanks to mawenzi! Good work! :)
    Your first three "must do" before you ask a question:
    1. Forum rules
    2. FAQ
    3. Search

    Offline mawenzi

    • Moderator
    • 4images Guru
    • *****
    • Posts: 4.500
      • View Profile
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #8 on: October 29, 2007, 11:34:01 AM »
    @ Kai
    ... danke für dein Statement ...

    @ glitzer
    ... mmm ... was mir zuerst auffällt ist deine Tabellenüberschrift "Schlüsselwörter/Suchwörter:" ...
    ... die ist in deiner jetzigen Schriftgröße (und als ein Wortzug) mit Sicherheit länger als 130px ...
    ... und sprengt somit die vorgegebene Tabellenbreite von 130px ...
    ... Lösung ...
    ... kleinere Schriftgröße oder kürzere Überschrift oder Freizeichen in der Überschrift ...
    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 glitzer

    • Full Member
    • ***
    • Posts: 204
      • View Profile
      • over 7000 E-Cards
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #9 on: October 29, 2007, 11:44:03 AM »
    Hi
    wie dumm von mir..das war ja eigentlich mehr als logisch das es an der überschrift liegen muß!
    Jetzt gehts einwandfrei! :)
    Vielen Dank!!

    SnaFy

    • Guest
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #10 on: April 11, 2008, 04:41:03 AM »
    the errors comes, when 0 images (start-up) in the 4images gallery...

    thanks  :mrgreen:
    « Last Edit: April 11, 2008, 04:52:15 AM by SnaFy »

    Offline beach-baer

    • Newbie
    • *
    • Posts: 20
      • View Profile
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #11 on: April 12, 2008, 09:44:49 PM »
    Moin Moin Mawenzi!

    Ich haben Deinen/ch€ri{Bi}² Mod nun ebenfalls auf meiner HP eingebunden. Ist eine Klasse Idee von euch. :thumbup: Vielen Dank!

    Ich habe den Programmcode bei mir in die search.php integriert. Die Keyword-Wolke erscheint immer nur dann, wenn der Suchen Bottom ohne Keyword genutzt wird. Also quasi in der 'Erweiterten Suche'. Ich hoffe Ihr habt nix dagegen?!

    Viele Grüße aus Hamburg

    Kay

    Offline KamelN

    • Newbie
    • *
    • Posts: 23
      • View Profile
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #12 on: April 12, 2008, 11:55:07 PM »
       
    Hallo Jungs

    Wie kann ich den Inhalt der integrierten Tag auf meine Seiten home


    Offline mawenzi

    • Moderator
    • 4images Guru
    • *****
    • Posts: 4.500
      • View Profile
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #13 on: April 14, 2008, 10:01:20 AM »
    Ich hoffe Ihr habt nix dagegen?!

    ... warum sollten wir ... ?
    ... nur mit deinem Versteck in der search.php ist die Tag Cloud nicht leicht zu finden ... ;)
    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 mawenzi

    • Moderator
    • 4images Guru
    • *****
    • Posts: 4.500
      • View Profile
    Re: [MOD] Keyword Tag Cloud (on custom page)
    « Reply #14 on: April 15, 2008, 06:45:29 PM »
    the errors comes, when 0 images (start-up) in the 4images gallery...

    ... with no image your website isn't a gallery ... so please upload at least one image and no error comes ... ;)

    Wie kann ich den Inhalt der integrierten Tag auf meine Seiten home

    ... dann verwendest du am Besten ch€ri{Bi}² 's MOD ... http://www.4homepages.de/forum/index.php?topic=16812.0 ...
    ... oder du includest die keyword_cloud.php in die index.php ...
    ... und verwendest den html-Code in deiner home.html ...
    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) ...