PageRenderTime 30ms CodeModel.GetById 10ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/documentation/documentation.html

https://github.com/danielrusciuga/phpld-simple-tagcloud
HTML | 153 lines | 132 code | 21 blank | 0 comment | 0 complexity | 179e391423b8bb397589c76928a6cb7e MD5 | raw file
  1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Simple TagCloud for PHP Link Directory</title><link rel="stylesheet" href="style/style.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /><meta name="description" content="&#10;            Add a Tag Cloud to your link directory and join the new web2.0 style.&#10;         " /><meta name="keywords" content="tag, cloud, php, web2, web2.0, phpld, PHP Link Directory, memory, Frozenminds, Constantin, Bejenaru" /><link rel="start" href="documentation.html" title="Simple TagCloud for PHP Link Directory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Simple TagCloud for PHP Link Directory</th></tr></table><hr /></div><div class="article" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="documentation"></a>Simple TagCloud for PHP Link Directory</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Constantin</span> <span class="othername">Boby</span> <span class="surname">Bejenaru</span></h3><div class="affiliation"><div class="address"><p><br />
  4               <span class="otheraddr"><a href="http://www.frozenminds.com/" target="_top">Frozenminds.com</a></span><br />
  5               <code class="email">&lt;<a href="mailto:constantin_bejenaru@frozenminds.com">constantin_bejenaru@frozenminds.com</a>&gt;</code><br />
  6            </p></div></div></div></div><div><p class="releaseinfo">1.3 (Bugfix Release)</p></div><div><p class="releaseinfo">This release is a quick bug fix release. Encoding and non-integer weights where addressed, normalization was currently left-out as it produced unexpected output.</p></div><div><p class="copyright">Copyright © 2006, 2007, 2008, 2009 Constantin Bejenaru</p></div><div><div class="legalnotice"><a id="id4773137"></a><p>
  7            <a href="http://www.gnu.org/copyleft/gpl.html" target="_top">http://www.gnu.org/copyleft/gpl.html</a>
  8         </p><p>
  9            This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 10         </p><p>
 11            This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 12         </p><p>
 13            You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 14         </p></div></div><div><div class="abstract"><p class="title"><b>Abstract</b></p><p>
 15            Add a <a href="http://en.wikipedia.org/wiki/Tag_cloud" target="_top">Tag Cloud</a> to your link directory and join the new web2.0 style.
 16         </p></div></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="documentation.html#s1-introduction">Introduction</a></span></dt><dt><span class="section"><a href="documentation.html#s2-installation">Installation</a></span></dt><dd><dl><dt><span class="section"><a href="documentation.html#s2-1-copy-files">Add files</a></span></dt><dt><span class="section"><a href="documentation.html#s2-2-edit-files">Edit your files</a></span></dt><dt><span class="section"><a href="documentation.html#s2-3-clean-temp">Clean compiled template files</a></span></dt></dl></dd><dt><span class="section"><a href="documentation.html#s3-customization">Customization</a></span></dt><dd><dl><dt><span class="section"><a href="documentation.html#s3-1-customize-css">Customize style</a></span></dt></dl></dd><dt><span class="section"><a href="documentation.html#s4-project-info">General Project Information</a></span></dt><dt><span class="section"><a href="documentation.html#s5-screenshot">Screenshot</a></span></dt><dt><span class="section"><a href="documentation.html#s6-license">License</a></span></dt><dd><dl><dt><span class="section"><a href="documentation.html#s6-license-gpl">GNU General Public License</a></span></dt></dl></dd><dt><span class="section"><a href="documentation.html#s7-powered">Powered by</a></span></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="s1-introduction"></a>Introduction</h2></div></div></div><p>
 17         A <a href="http://en.wikipedia.org/wiki/Tag_cloud" target="_top">Tag Cloud</a> is a list of tags that are linked to an overview or to the search (like in this case). It gives a visitor a quick overview of what the site or current browsing page is about. Words (=tags) are counted and weighted - the more they occur in the content, the bigger the link is displayed.
 18      </p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="s2-installation"></a>Installation</h2></div></div></div><p>
 19         This installation of this module is very easy and does not require many coding skills. One file needs to be added to the current <span class="application">PHP Link Directory</span> installation and some code needs to be added to one of the core PHP files and to a template file.
 20      </p><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="s2-1-copy-files"></a>Add files</h3></div></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="s2-1-1-copy-php"></a>Copy PHP file</h4></div></div></div><p>
 21               Copy the <span class="acronym">PHP</span> file <code class="filename">tagclouds.php</code> to the root folder of your <span class="application">PHP Link Directory</span> installation.
 22            </p></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="s2-2-edit-files"></a>Edit your files</h3></div></div></div><p>
 23            Some files need to be edited in order to have this module available.
 24         </p><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="s2-2-1-edit-init-php"></a>Edit <code class="filename">index.php</code></h4></div></div></div><p>
 25               Edit your <code class="filename">index.php</code> file and search for following code (at the end):
 26            </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note: Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="./stylesheet-images/note.png" /></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>This can be a little different from version to version.</p></td></tr></table></div><pre class="screen">
 27               <code class="computeroutput">
 28//Rewrite Paging links
 29if (ENABLE_REWRITE == 1)
 30   $tpl-&gt;load_filter ('output', 'RewritePageLinks');
 31
 32//Clean whitespace
 33$tpl-&gt;load_filter ('output', 'trimwhitespace');
 34
 35//Compress output for faster loading
 36if (COMPRESS_OUTPUT == 1)
 37   $tpl-&gt;load_filter ('output', 'CompressOutput');
 38
 39//Make output
 40echo $tpl-&gt;fetch ('main.tpl', $id);
 41               </code>
 42            </pre><p>
 43               Right before the above code-block, insert the following:
 44            </p><pre class="screen">
 45               <strong class="userinput"><code>
 46//Include tagclouds file
 47require_once 'tagclouds.php';
 48
 49//Initialize tagclouds class
 50$tagcloud = new phpld_tagclouds ();
 51
 52//Add array with categories
 53$tagcloud-&gt;add_categories ($categs);
 54
 55//Add array with links
 56$tagcloud-&gt;add_links ($links);
 57
 58//Add array with articles [experimental]
 59//$tagcloud-&gt;add_articles ($articles);
 60
 61//Define minimum occurrences of a word to be displayed
 62$tagcloud-&gt;mincount (0);
 63
 64//Define maximum number of allowed tags (most important selected, the rest is removed)
 65//zero or NULL means infinite
 66$tagcloud-&gt;maxWordsCount (25);
 67
 68//Define minimum length of word to be displayed
 69$tagcloud-&gt;minwordlength (2);
 70
 71//Define maximum length of a word to be displayed
 72$tagcloud-&gt;maxwordlength (30);
 73
 74//Define minimum font size of a tag to be displayed (in procent)
 75$tagcloud-&gt;minfontsize (100);
 76
 77//Define maximum font size of a tag to be displayed (in procent)
 78$tagcloud-&gt;maxfontsize (300);
 79
 80//Define maximum nuber for element class (CSS styling)
 81$tagcloud-&gt;styleclass (5);
 82
 83//Exclude numeric words
 84$tagcloud-&gt;filter_numeric (TRUE);
 85
 86//Normalize tag cloud
 87$tagcloud-&gt;normalize (FALSE);
 88
 89//Sort tags (alphabetical, count, random)
 90$tagcloud-&gt;sortmethod ('alphabetical');
 91
 92//Define Change search URL variable (for phpLD 3.0.4+ = "search", all the rest = "q")
 93$tagcloud-&gt;setsearchvariable ('search');
 94
 95//Define a title to be displayed above the tagclouds
 96$tagcloud-&gt;title ('&lt;h3&gt;Tag Clouds&lt;/h3&gt;');
 97
 98//Define words to not be displayed (string with words sepparated by comma or space, or an array with one word per key)
 99$tagcloud-&gt;exclude ('as,at,for,from,he,she,it,be,by,to,and,if,it,is,in,or,of,off,about,the,teh,then');
100
101//Assign tagclouds to Smarty template variable "tagclouds"
102$tpl-&gt;assign ('tagclouds', $tagcloud-&gt;get_tagclouds ());
103                  </code></strong>
104            </pre><p>
105               You can play with the above settings to fit your needs.
106            </p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="s2-2-2-edit-footer-tpl"></a>Edit <code class="filename">footer.tpl</code></h4></div></div></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note: Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="./stylesheet-images/note.png" /></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>You can also add this to whatever other template file.</p></td></tr></table></div><p>
107               Edit <code class="filename">footer.tpl</code> file located in your current template folder (<code class="filename">/templates/YourTemplate/</code> for phpLD 3.0.5+ and <code class="filename">/templates/</code> for all previous versions) and add following code to desired place:
108            </p><pre class="screen">
109               <strong class="userinput"><code>
110{* Display TagClouds *}
111{$tagclouds}
112               </code></strong>
113            </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="s2-3-clean-temp"></a>Clean compiled template files</h3></div></div></div><p>
114            Finally the last step, remove all files located in your <code class="filename">/temp/templates/</code>.
115         </p></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="s3-customization"></a>Customization</h2></div></div></div><p>
116         The <span class="application">Tag Clouds</span> output can be fully customized by adding CSS properties.
117      </p><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="s3-1-customize-css"></a>Customize style</h3></div></div></div><p>
118            You can easily change properties for fonts, margins, colors or anything else, by adding <span class="acronym">CSS</span> properties.
119         </p><p>
120            The <span class="application">Tag Clouds</span> box is a DIV with class name <span><strong class="command">tagclouds</strong></span>. Style all the rest of the child tags using the parent <span><strong class="command">tagclouds</strong></span> class.
121         </p><p>
122            A simple example is:
123         </p><pre class="screen">
124               <strong class="userinput"><code>
125.tagclouds { margin: 0 auto; padding: 20px; width: 70%; border: 1px dotted #9EC2F3; }
126.tagclouds h3 { font-size: 150%; }
127.tagclouds .cloud-word { /* add you general rules for ALL tags */ }
128               </code></strong>
129            </pre><p>
130            You can also add custom colors and text styling for different tags if you have defined a number for CSS classes:
131         </p><pre class="screen">
132               <strong class="userinput"><code>
133.cloud-style-1 { color: #0000ff; /*blue*/ }
134.cloud-style-2 { color: #000; /*black*/ }
135.cloud-style-3 { color: #e98800;/*orange*/ }
136.cloud-style-4 { color: #0fb400;/*green*/ }
137.cloud-style-5 { color: #ff0000;/*red*/ }
138               </code></strong>
139            </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="s4-project-info"></a>General Project Information</h2></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Title</em></span>: <span class="application">Tag Clouds for PHP Link Directory</span></p></li><li><p><span class="emphasis"><em>Homepage</em></span>: <a href="http://www.frozenminds.com/phpld-tagclouds.html" target="_top">http://www.frozenminds.com/phpld-tagclouds.html</a></p></li><li><p><span class="emphasis"><em>Demo</em></span>: not available at this time.</p></li></ul></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="s5-screenshot"></a>Screenshot</h2></div></div></div><div class="figure"><a id="screenshot"></a><p class="title"><b>Figure 1. Screenshot</b></p><div class="mediaobject"><img src="images/screenshot.png" alt="Screenshot" /></div></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="s6-license"></a>License</h2></div></div></div><p>
140         This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License.
141      </p><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="s6-license-gpl"></a>GNU General Public License</h3></div></div></div><p><span class="trademark">Copyright</span>© 2006-2009 Constantin Bejenaru (http://www.frozenminds.com)</p><p>
142            <a href="http://www.gnu.org/copyleft/gpl.html" target="_top">http://www.gnu.org/copyleft/gpl.html</a>
143         </p><p>
144            This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
145         </p><p>
146            This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
147         </p><p>
148            You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
149         </p></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="s7-powered"></a>Powered by</h2></div></div></div><p>
150         Module, support: <a href="http://www.frozenminds.com/" target="_top">Frozenminds.com</a>
151      </p><p>
152         Documentation: <a href="http://www.docbook.org" target="_top">DocBook</a>
153      </p></div></div><div class="navfooter"><hr /></div></body></html>