bezugnehmend auf die Diskussion http://forum.contenido.org/viewtopic.php?t=17273
habe ich ein wenig gebastelt. Ich bin dabei für eine Seite ein Tagcloud zu bauen und möchte hierbei jedoch nicht auf die Metatags zugreifen, sondern direkt auf den Inhalt. Aus diesem Grund greife ich auf die con_keywords zu und gewichte die Einträge in der Spalte Auto. Ganz richtig ist das nicht, da ich lediglich die länge des Feldes bewerte, nicht, ob ein Wort mehrfach (&123=9) in einem Artikel vorkommt.
das Problem welches ich nun noch habe, dass ich ja alle Keywords darstelle, also auch die von gesperrten / nicht online gesetzten Seiten.... Das kann cih wahrscheinlich aus dem spalte auto rauslesen, jedoch bin ich dazu zu dämlich.
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - Output
*
* Modulname : TagCloud
* Copyright : Soeren Helms
* Created : 20080628
************************************************/
$dbConnect = new DB_Contenido;
$query = "SELECT keyword, auto, length(auto) as size FROM ".$cfg['sql']['sqlprefix']."_keywords order by keyword";
$dbConnect->query($query);
echo "<div id=\"tags_cloud\">";
while ($dbConnect->next_record()) {
$size = $dbConnect->f("size")."\n";
$auto = $dbConnect->f("auto")."\n";
$keyword = $dbConnect->f("keyword")."\n";
if ($size > 30) $size = 30;
$kurl = urlencode("$keyword");
echo "<a href=\"front_content.php?idcatart=307&suchtext=$kurl\" class=\"tag{$size}\">$keyword</a> \n";
}
echo "</div>";
?>
Code: Alles auswählen
/* Start Tags Cloud CSS */
#tags_cloud {
padding:1px; text-align:left;
}
#tags_cloud a {
text-decoration:none;padding:0px;
}
a.tag1{
font-size:12px;
}
a.tag2, a.tag3 {
font-size:13px;
font-weight:200;
}
a.tag4 ,a.tag5, a.tag6 {
font-size:16px;
font-weight:300;
}
a.tag7, .tag8, a.tag9 {
font-size:20px;
font-weight:300;
}
a.tag10, a.tag11, a.tag12 {
font-size:24px;
font-weight:300;
}
a.tag13, a.tag14, a.tag15 {
font-size:28px;
font-weight:400;
}
a.tag16, a.tag17, a.tag18 {
font-size:30px;
font-weight:400;
}
a.tag19, a.tag20, a.tag21 {
font-size:32px;
font-weight:500;
}
a.tag22, a.tag23, a.tag24 {
font-size:34px;
font-weight:500;
}
a.tag25, a.tag26, a.tag27 {
font-size:36px;
font-weight:900;
}
a.tag28, a.tag29, a.tag30 {
font-size:38px;
font-weight:900;
}
/* End Tag Cloud CSS */
ToDo
---------
--> Nur aktive Keywords sollen engezeigt werden (HELP!!!!!)
--> Suchformular aus Backendkonfiguration heraus
--> Banned Word Liste aus dem Backend heraus
--> ...