Znalazłam skrypt do tagów na
www.frozenminds.comCzy coś podobnego ktoś mógłby udostepnić?
Mam inny szablon strony bez main.tpl i footer.tpl
Moja StronaKod
Edit index.php
Edit your index.php file and search for following code line (at the end):
//Make output
echo $tpl->fetch('main.tpl', $id);
//Include tagclouds file
require_once 'tagclouds.php';
//Initialize tagclouds class
$tagcloud = new phpld_tagclouds();
//Add array with categories
$tagcloud->add_categories($categs);
//Add array with links
$tagcloud->add_links($links);
//Define minimum occurrences of a word to be displayed
$tagcloud->mincount(0);
//Define maximum number of allowed tags (most important selected, the rest is removed)
//zero or NULL means infinite
$tagcloud->maxWordsCount(25);
//Define minimum length of word to be displayed
$tagcloud->minwordlength(2);
//Define maximum length of a word to be displayed
$tagcloud->maxwordlength(30);
//Define minimum font size of a tag to be displayed (in procent)
$tagcloud->minfontsize(100);
//Define maximum nuber for element class (CSS styling)
$tagcloud->styleclass(5);
//Sort tags (alphabetical, count, random)
$tagcloud->sortmethod('alphabetical');
//Define Change search URL variable (for phpLD 3.0.4+ = "search", all the rest = "q")
$tagcloud->setsearchvariable('search');
//Define a title to be displayed above the tagclouds
$tagcloud->title('<h3>Tag Clouds</h3>');
//Define words to not be displayed (string with words sepparated by comma or space, or an array with one word per key)
$tagcloud->exclude('to,and,if,it,or,about,the,then');
//Assign tagclouds to Smarty template variable "tagclouds"
$tpl->assign('tagclouds', $tagcloud->get_tagclouds());
Edit footer.tpl
Note
You can also add this to whatever other template file.
Edit footer.tpl file located in your current template folder (/templates/YourTemplate/ for phpLD 3.0.5+ and /templates/ for all previous versions) and add following code to desired place:
{* Display TagClouds *}
{$tagclouds}
Clean compiled template files
Finally the last step, remove all files located in your /temp/templates/.
Customization
The Tag Clouds output can be fully customized by adding CSS properties.
Customize style
You can easily change properties for fonts, margins, colors or anything else, by adding CSS properties.
The Tag Clouds box is a DIV with class name tagclouds. Style all the rest of the child tags using the parent tagclouds class.
A simple example is:
.tagclouds { margin:0 auto; padding:20px; width:70%; border:1px dotted #9EC2F3; }
.tagclouds h3 { font-size:150%; }
.tagclouds .cloud-word { /* add you general rules for ALL tags */ }
You can also add custom colors and text styling for different tags if you have defined a number for CSS classes:
.cloud-style-1 { color:#0000ff; /*blue*/ }
.cloud-style-2 { color:#000; /*black*/ }
.cloud-style-3 { color:#e98800;/*orange*/ }
.cloud-style-4 { color:#0fb400;/*green*/ }
.cloud-style-5 { color:#ff0000;/*red*/ }
Proszę o pomoc