-
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. Schrittlege im Root-Verzeichnis die neue Datei
keyword_cloud.php mit dem folgenden Inhalt an :
-
1. Stepin the root directory make a new file
keyword_cloud.php with following content :
[/list]
<?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)) ? "&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.'</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. Schrittlege 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. Stepmake 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) :
<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 ... !)
<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. StepOpen the file
includes/page_header.php and find :
"url_home" => $site_sess->url(ROOT_PATH."index.php"),
- und füge unmittelbar dahinter die folgende Codezeile ein.
- and insert after the following code.
"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. StepOpen the file
/lang/<your_lang>/main.php and find at the end :
?>
- und füge unmittelbar davor den folgenden Code ein:
//-----------------------------------------------------
//--- [MOD] Keyword Cloud -------------
//-----------------------------------------------------
$lang['200_keyword_cloud'] = "200 Keyword Cloud";
$lang['tagged_with'] = "image(s) with tag: ";
- and insert above the following code :
//-----------------------------------------------------
//--- [MOD] Keyword Cloud -------------
//-----------------------------------------------------
$lang['200_keyword_cloud'] = "200 Keyword Cloud";
$lang['tagged_with'] = "image(s) with tag: ";
-
5. SchrittJetzt 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. StepNow 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) .
»<a href="{url_keyword_cloud}">{lang_200_keyword_cloud}</a>
-
6. Schritt - EinstellungmöglichkeitenDie 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 - SettingsThe 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}² ...
mawenzi