Revision history for InfoHandler


Revision [23052]

Last edited on 2016-05-20 07:38:44 by DarTar [Replaces old-style internal links with new pipe-split links.]
Additions:
Append ##[[http://wikka.jsnx.com/HomePage/info | /info]]## to the URL of the page or click on "Stats" in the page footer.
~-the **##[[FormatUserMethod | FormatUser()]]##** method, that must be added to ##wikka.php##, at the end of the user-related functions, right after ##""function UserWantsComments()""##;
~-the **##[[WikkaCountingRecords | getCount()]]##** method, that must be added to ##wikka.php## right after the ##""LoadAll()""## method.
The ##info## handler uses a bunch of [[ChartStyling | CSS classes]] for styling the percentage bars.
Deletions:
Append ##[[http://wikka.jsnx.com/HomePage/info /info]]## to the URL of the page or click on "Stats" in the page footer.
~-the **##[[FormatUserMethod FormatUser()]]##** method, that must be added to ##wikka.php##, at the end of the user-related functions, right after ##""function UserWantsComments()""##;
~-the **##[[WikkaCountingRecords getCount()]]##** method, that must be added to ##wikka.php## right after the ##""LoadAll()""## method.
The ##info## handler uses a bunch of [[ChartStyling CSS classes]] for styling the percentage bars.


Revision [18651]

Edited on 2008-01-28 00:12:18 by DarTar [Modified links pointing to docs server]

No Differences

Revision [11452]

Edited on 2005-10-16 16:19:26 by DarTar [back to the future]
Additions:
Append ##[[http://wikka.jsnx.com/HomePage/info /info]]## to the URL of the page or click on "Stats" in the page footer.
Deletions:
Append ##[[http://wikka.jsnx.com/HomePage/info /info]]## to the URL of the page.


Revision [11451]

Edited on 2005-10-16 16:18:26 by DarTar [back to the future]
Additions:
(2005-08-07)
Deletions:
(2007-08-07)


Revision [10829]

Edited on 2005-08-25 18:44:00 by DennyShimkoski [back to the future]
Additions:
~-PageStatsAction


Revision [10498]

Edited on 2005-08-07 10:19:28 by DarTar [uploading new version witg bugfix (0.3)]
Additions:
>><<**Table of Contents:**
~-""<a href="InfoHandler#hn_Usage">Usage</a>""
~-""<a href="InfoHandler#hn_Sample_output">Sample output</a>""
~-""<a href="InfoHandler#hn_Current_version">Current version</a>""
~-""<a href="InfoHandler#hn_Change_log">Change log</a>""
~-""<a href="InfoHandler#hn_The_code">The code</a>""
~-""<a href="InfoHandler#hn_Styling">Styling</a>""<<
::c::
=== Usage ===
==Sample output==
(2007-08-07)
Latest available version: ##**0.3**##
=== Change log ===
==0.3==
~- bugfix: preventing divide by zero errors;
**Dependencies:** The ##info## handler uses:
~-the **##[[FormatUserMethod FormatUser()]]##** method, that must be added to ##wikka.php##, at the end of the user-related functions, right after ##""function UserWantsComments()""##;
~-the **##[[WikkaCountingRecords getCount()]]##** method, that must be added to ##wikka.php## right after the ##""LoadAll()""## method.
* @name info
* @version 0.3
* @since Wikka 1.1.X.X
* @todo - bar styling in the CSS;
* - optimize queries and code;
if ($totalhn > 0)
{
$hnpercentage = round($hn / $totalhn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$hnwidth = round((PERCENTAGE_BAR_WIDTH * $hn / $totalhn), PERCENTAGE_DECIMALS_ROUND).'px';
} else
$hnpercentage = '0%';
$hnwidth = '0px';
if ($totalrv > 0)
{
$rvpercentage = round($rv / $totalrv * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$rvwidth = round((PERCENTAGE_BAR_WIDTH * $rv / $totalrv), PERCENTAGE_DECIMALS_ROUND).'px';
} else
$rvpercentage = '0%';
$rvwidth = '0px';
if ($totalcn > 0)
{
$cnpercentage = round($cn / $totalcn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$cnwidth = round((PERCENTAGE_BAR_WIDTH * $cn / $totalcn), PERCENTAGE_DECIMALS_ROUND).'px';
} else
$cnpercentage = '0%';
$cnwidth = '0px';
if ($totalbn > 0)
{
$bnpercentage = round($bn / $totalbn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$bnwidth = round((PERCENTAGE_BAR_WIDTH * $bn / $totalbn), PERCENTAGE_DECIMALS_ROUND).'px';
} else
$bnpercentage = '0%';
$bnwidth = '0px';
if ($totalrn > 0)
{
$rnpercentage = round($rn / $totalrn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$rnwidth = round((PERCENTAGE_BAR_WIDTH * $rn / $totalrn), PERCENTAGE_DECIMALS_ROUND).'px';
} else
$rnpercentage = '0%';
$rnwidth = '0px';
=== Styling ===
The ##info## handler uses a bunch of [[ChartStyling CSS classes]] for styling the percentage bars.
Deletions:
>>::c::
=== Usage: ===
==Sample output:==
(2007-08-05)
Latest available version: ##**0.2**##
* @name info
* @version 0.2
* @since Wikka 1.1.X.X
* @todo - bar styling in the CSS;
* - optimize queries and code;
$hnpercentage = round($hn / $totalhn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$hnwidth = round((PERCENTAGE_BAR_WIDTH * $hn / $totalhn), PERCENTAGE_DECIMALS_ROUND).'px';
$rvpercentage = round($rv / $totalrv * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$rvwidth = round((PERCENTAGE_BAR_WIDTH * $rv / $totalrv), PERCENTAGE_DECIMALS_ROUND).'px';
$cnpercentage = round($cn / $totalcn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$cnwidth = round((PERCENTAGE_BAR_WIDTH * $cn / $totalcn), PERCENTAGE_DECIMALS_ROUND).'px';
$bnpercentage = round($bn / $totalbn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$bnwidth = round((PERCENTAGE_BAR_WIDTH * $bn / $totalbn), PERCENTAGE_DECIMALS_ROUND).'px';
$rnpercentage = round($rn / $totalrn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$rnwidth = round((PERCENTAGE_BAR_WIDTH * $rn / $totalrn), PERCENTAGE_DECIMALS_ROUND).'px';
The handler uses a **##[[FormatUserMethod FormatUser()]]##** method, that must be added to ##wikka.php##, at the end of the user-related functions (right after ##""function UserWantsComments()""##):
The handler uses the **##[[WikkaCountingRecords getCount()]]##** method, that must be added to ##wikka.php## right after the LoadAll() method:


Revision [10460]

Edited on 2005-08-06 00:45:47 by NilsLindenberg [linkfix]
Additions:
The handler uses the **##[[WikkaCountingRecords getCount()]]##** method, that must be added to ##wikka.php## right after the LoadAll() method:
Deletions:
The handler uses the **##[[getCount()]]##** method, that must be added to ##wikka.php## right after the LoadAll() method:


Revision [10459]

Edited on 2005-08-06 00:25:18 by NilsLindenberg [added requirement]
Additions:
The handler uses the **##[[getCount()]]##** method, that must be added to ##wikka.php## right after the LoadAll() method:


Revision [10451]

Edited on 2005-08-05 09:39:07 by DarTar [posting slightly improved code (0.2)]
Additions:
Append ##[[http://wikka.jsnx.com/HomePage/info /info]]## to the URL of the page.
Deletions:
Append ##[[http://wikka.jsnx.com/WikkaInternationalization/info /info]]## to the URL of the page.


Revision [10450]

Edited on 2005-08-05 08:47:52 by DarTar [posting slightly improved code (0.2)]
Additions:
<h4 id="hn_Page_statistics_for_HomePage"> Page statistics for <a href="http://wikka.jsnx.com/HomePage">HomePage</a> </h4>
<!-- Header id generation took 0.000024 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000220 seconds --><h5 id="hn_Page_revisions_authorpage_totals:">Page revisions (<tt>author/page totals</tt>):</h5>
<th class="number">Edits</th>
<th class="number">%</th>
<td><a href="http://wikka.jsnx.com/JsnX">JsnX</a></td>
<td class="number">124/183</td>
<td class="number">67.76%</td>
<td><span title = "67.76%" class="c6" style="float:left; height: 1.4em; width: 203.28px"></span></td>
<td><a href="http://wikka.jsnx.com/DarTar">DarTar</a></td>
<td class="number">53/183</td>
<td class="number">28.96%</td>
<td><span title = "28.96%" class="c6" style="float:left; height: 1.4em; width: 86.89px"></span></td>
<td><a href="http://wikka.jsnx.com/JavaWoman">JavaWoman</a></td>
<td class="number">5/183</td>
<td class="number">2.73%</td>
<td><span title = "2.73%" class="c6" style="float:left; height: 1.4em; width: 8.2px"></span></td>
<td><tt>WakkaInstaller</tt></td>
<td class="number">1/183</td>
<td class="number">0.55%</td>
<td><span title = "0.55%" class="c6" style="float:left; height: 1.4em; width: 1.64px"></span></td>
<p> </p>
<!-- Header id generation took 0.000229 seconds --><h5 id="hn_Global_statistics_pagesite_totals:">Global statistics (<tt>page/site totals</tt>):</h5>
<th class="number">Count</th>
<th class="number">%</th>
<tr><td>Hits</td><td class="number"><a href="http://wikka.jsnx.com/HomePage/hits" title="Hits for HomePage (1)">1</a>/1</td><td class="number">100%</td><td><span title = "100%" class="c1" style="float:left; height: 1.4em; width: 300px"></span></td></tr>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/HomePage/revisions" title="Display revisions for HomePage (183)">183</a>/10193</td><td class="number">1.8%</td><td><span title = "1.8%" class="c2" style="float:left; height: 1.4em; width: 5.39px"></span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/HomePage?show_comments=1#comments" title="Display comments for HomePage (96)">96</a>/2051</td><td class="number">4.68%</td><td><span title = "4.68%" class="c3" style="float:left; height: 1.4em; width: 14.04px"></span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/HomePage/backlinks" title="Display pages linking to HomePage (50)">50</a>/5549</td><td class="number">0.9%</td><td><span title = "0.9%" class="c4" style="float:left; height: 1.4em; width: 2.7px"></span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/HomePage/referrers" title="Display external sites linking to HomePage (34294)">34294</a>/67978</td><td class="number">50.45%</td><td><span title = "50.45%" class="c5" style="float:left; height: 1.4em; width: 151.35px"></span></td></tr>
(2007-08-05)
Latest available version: ##**0.2**##
* @version 0.2
//Defaults as constants
define('PERCENTAGE_BAR_WIDTH', '300'); # max width of percentage bar in pixels
define('PERCENTAGE_BAR_STYLE', 'float:left; height: 1.4em; width: %s'); # style attribute for percentage bar (do not edit the width value)
define('PERCENTAGE_BAR_COLOR_AUTHORS', 'c6'); # class for setting percentage bar color
define('PERCENTAGE_BAR_COLOR_HITS', 'c1'); # class for setting percentage bar color
define('PERCENTAGE_BAR_COLOR_REVISIONS', 'c2'); # class for setting percentage bar color
define('PERCENTAGE_BAR_COLOR_COMMENTS', 'c3'); # class for setting percentage bar color
define('PERCENTAGE_BAR_COLOR_BACKLINKS', 'c4'); # class for setting percentage bar color
define('PERCENTAGE_BAR_COLOR_REFERRERS', 'c5'); # class for setting percentage bar color
define('HEADING_AUTHORS','Page revisions (##author/page totals##):');
define('HEADING_STATS','Global statistics (##page/site totals##):');
define('TABLE_AUTHORS_HEADING_PERCENTAGE_BAR','Percentage');
define('TABLE_AUTHORS_HEADING_PERCENTAGE','%');
define('TABLE_STATS_HEADING_PERCENTAGE_BAR','Percentage');
define('TABLE_STATS_HEADING_PERCENTAGE','%');
$output .= "<table summary=\"".TABLE_AUTHORS_SUMMARY."\">\n<thead>\n<tr>\n<th>".TABLE_AUTHORS_HEADING_USER."</th>\n<th class=\"number\">".TABLE_AUTHORS_HEADING_EDITS."</th>\n<th class=\"number\">".TABLE_AUTHORS_HEADING_PERCENTAGE."</th>\n<th>".TABLE_AUTHORS_HEADING_PERCENTAGE_BAR."</th>\n</tr>\n</thead>\n<tbody>\n";
$bar_width = round((PERCENTAGE_BAR_WIDTH * $author['edits'] / $totaledits),PERCENTAGE_DECIMALS_ROUND).'px';
$rounded_percentage = round($percentage,PERCENTAGE_DECIMALS_ROUND).'%';
$bar = '<span title = "'.$rounded_percentage.'" class="'.PERCENTAGE_BAR_COLOR_AUTHORS.'" style="'.sprintf(PERCENTAGE_BAR_STYLE, $bar_width).'"></span>';
$output .= "<tr>\n<td>".$this->FormatUser($author['user'], OPTION_LINK, OPTION_HOSTNAME_LENGTH)."</td>\n".
"<td class=\"number\">".$author['edits']."/".$totaledits."</td>\n".
"<td class=\"number\">".$rounded_percentage."</td>\n".
"<td>".$bar."</td>\n".
"</tr>\n";
$output .= "<p> </p>\n";
$hn = 1; #forthcoming
$totalhn = 1; #forthcoming
$hnpercentage = round($hn / $totalhn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$hnwidth = round((PERCENTAGE_BAR_WIDTH * $hn / $totalhn), PERCENTAGE_DECIMALS_ROUND).'px';
$hnbar = '<span title = "'.$hnpercentage.'" class="'.PERCENTAGE_BAR_COLOR_HITS.'" style="'.sprintf(PERCENTAGE_BAR_STYLE, $hnwidth).'"></span>';
$rvpercentage = round($rv / $totalrv * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$rvwidth = round((PERCENTAGE_BAR_WIDTH * $rv / $totalrv), PERCENTAGE_DECIMALS_ROUND).'px';
$rvbar = '<span title = "'.$rvpercentage.'" class="'.PERCENTAGE_BAR_COLOR_REVISIONS.'" style="'.sprintf(PERCENTAGE_BAR_STYLE, $rvwidth).'"></span>';
$cnpercentage = round($cn / $totalcn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$cnwidth = round((PERCENTAGE_BAR_WIDTH * $cn / $totalcn), PERCENTAGE_DECIMALS_ROUND).'px';
$cnbar = '<span title = "'.$cnpercentage.'" class="'.PERCENTAGE_BAR_COLOR_COMMENTS.'" style="'.sprintf(PERCENTAGE_BAR_STYLE, $cnwidth).'"></span>';
$bnpercentage = round($bn / $totalbn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$bnwidth = round((PERCENTAGE_BAR_WIDTH * $bn / $totalbn), PERCENTAGE_DECIMALS_ROUND).'px';
$bnbar = '<span title = "'.$bnpercentage.'" class="'.PERCENTAGE_BAR_COLOR_BACKLINKS.'" style="'.sprintf(PERCENTAGE_BAR_STYLE, $bnwidth).'"></span>';
$rnpercentage = round($rn / $totalrn * 100, PERCENTAGE_DECIMALS_ROUND).'%';
$rnwidth = round((PERCENTAGE_BAR_WIDTH * $rn / $totalrn), PERCENTAGE_DECIMALS_ROUND).'px';
$rnbar = '<span title = "'.$rnpercentage.'" class="'.PERCENTAGE_BAR_COLOR_REFERRERS.'" style="'.sprintf(PERCENTAGE_BAR_STYLE, $rnwidth).'"></span>';
$output .= "<table summary=\"".TABLE_STATS_SUMMARY."\">\n<thead>\n<tr>\n<th>".TABLE_STATS_HEADING_STATISTICS."</th>\n<th class=\"number\">".TABLE_STATS_HEADING_COUNT."</th>\n<th class=\"number\">".TABLE_STATS_HEADING_PERCENTAGE."</th>\n<th>".TABLE_STATS_HEADING_PERCENTAGE_BAR."</th>\n</tr>\n</thead>\n<tbody>\n".
'<tr><td>Hits</td><td class="number">'.$hitspage.'/'.$totalhn.'</td><td class="number">'.$hnpercentage.'</td><td>'.$hnbar.'</td></tr>'."\n".
'<tr><td>Revisions</td><td class="number">'.$revpage.'/'.$totalrv.'</td><td class="number">'.$rvpercentage.'</td><td>'.$rvbar.'</td></tr>'."\n".
'<tr><td>Comments</td><td class="number">'.$commentspage.'/'.$totalcn.'</td><td class="number">'.$cnpercentage.'</td><td>'.$cnbar.'</td></tr>'."\n".
'<tr><td>Backlinks</td><td class="number">'.$backlinkpage.'/'.$totalbn.'</td><td class="number">'.$bnpercentage.'</td><td>'.$bnbar.'</td></tr>'."\n".
'<tr><td>Referrers</td><td class="number">'.$refpage.'/'.$totalrn.'</td><td class="number">'.$rnpercentage.'</td><td>'.$rnbar.'</td></tr>'."\n".
Deletions:
<h4 id="hn_Page_statistics_for_WikkaInternationalization"> Page statistics for <a href="http://wikka.jsnx.com/WikkaInternationalization" title=" ">WikkaInternationalization</a> </h4>
<!-- Header id generation took 0.000022 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000190 seconds --><h5 id="hn_Revisions:">Revisions:</h5>
<th>Edits</th>
<td><a href="http://wikka.jsnx.com/JordaPolo" title=" ">JordaPolo</a></td>
<td class="number">4</td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 100px">25%</span></td>
<td><a href="http://wikka.jsnx.com/JsnX" title=" ">JsnX</a></td>
<td class="number">4</td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 100px">25%</span></td>
<td><a href="http://wikka.jsnx.com/AndreaRossato" title=" ">AndreaRossato</a></td>
<td class="number">2</td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 50px">12.5%</span></td>
<td><a href="http://wikka.jsnx.com/DarTar" title=" ">DarTar</a></td>
<td class="number">2</td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 50px">12.5%</span></td>
<td><a href="http://wikka.jsnx.com/DotMG" title=" ">DotMG</a></td>
<td class="number">1</td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 25px">6.25%</span></td>
<td><a href="http://wikka.jsnx.com/DreckFehler" title=" ">DreckFehler</a></td>
<td class="number">1</td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 25px">6.25%</span></td>
<td><a href="http://wikka.jsnx.com/GregorLindner" title=" ">GregorLindner</a></td>
<td class="number">1</td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 25px">6.25%</span></td>
<td><a href="http://wikka.jsnx.com/JavaWoman" title=" ">JavaWoman</a></td>
<td class="number">1</td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 25px">6.25%</span></td>
<!-- Header id generation took 0.000207 seconds --><h5 id="hn_Statistics:">Statistics:</h5>
<th>Count</th>
<th>Site totals</th>
<tr><td>Hits</td><td class="number">0</td><td class="number"> </td><td> </td></tr>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for WikkaInternationalization (16)">16</a></td><td class="number">10056</td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.63643595863166px">0.16%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for WikkaInternationalization (9)">9</a></td><td class="number">2042</td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 1.7629774730656px">0.44%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to WikkaInternationalization (5)">5</a></td><td class="number">5478</td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.36509675063892px">0.09%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to WikkaInternationalization (80)">80</a></td><td class="number">65707</td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.48701051638334px">0.12%</span></td></tr>
(2007-07-30)
Latest available version: ##**0.1**##
**Note:** the rendering of the percentage bar for small values may not be correct in IE since the bar's size is always adjusted to accomodate with the text width. A small tweak in the style or in the code might be needed for the style to be compatible with IE. Browsers with good CSS support display bars of any size correctly.
* @version 0.1
//Default constants
define('PERCENTAGE_BAR_WIDTH', '400'); # max width of percentage bar in pixels
//define('PERCENTAGE_BAR_STYLE', 'display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: %s'); # style attribute for percentage bar (do not edit the width value)
define('PERCENTAGE_BAR_STYLE', 'display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: %s'); # style attribute for percentage bar (do not edit the width value)
define('HEADING_AUTHORS','Revisions:');
define('HEADING_STATS','Statistics:');
define('TABLE_AUTHORS_HEADING_PERCENTAGE','Percentage');
define('TABLE_STATS_HEADING_SITE','Site totals');
define('TABLE_STATS_HEADING_PERCENTAGE','Percentage');
$output .= "<table summary=\"".TABLE_AUTHORS_SUMMARY."\">\n<thead>\n<tr>\n<th>".TABLE_AUTHORS_HEADING_USER."</th>\n<th>".TABLE_AUTHORS_HEADING_EDITS."</th>\n<th>".TABLE_AUTHORS_HEADING_PERCENTAGE."</th>\n</tr>\n</thead>\n<tbody>\n";
$width = (PERCENTAGE_BAR_WIDTH * $author['edits'] / $totaledits).'px';
$bar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $width).'">'.round($percentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
// use new FormatUser() method - added to wikka.php by DarTar 2005-07-30
$output .= "<tr>\n<td>".$this->FormatUser($author['user'], OPTION_LINK, OPTION_HOSTNAME_LENGTH)."</td>\n<td class=\"number\">".$author['edits']."</td>\n<td>".$bar."</td>\n</tr>\n";
$rvpercentage = $rv / $totalrv * 100;
$rvwidth = (PERCENTAGE_BAR_WIDTH * $rv / $totalrv).'px';
$rvbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $rvwidth).'">'.round($rvpercentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
$cnpercentage = $cn / $totalcn * 100;
$cnwidth = (PERCENTAGE_BAR_WIDTH * $cn / $totalcn).'px';
$cnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $cnwidth).'">'.round($cnpercentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
$bnpercentage = $bn / $totalbn * 100;
$bnwidth = (PERCENTAGE_BAR_WIDTH * $bn / $totalbn).'px';
$bnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $bnwidth).'">'.round($bnpercentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
$rnpercentage = $rn / $totalrn * 100;
$rnwidth = (PERCENTAGE_BAR_WIDTH * $rn / $totalrn).'px';
$rnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $rnwidth).'">'.round($rnpercentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
$output .= "<table summary=\"".TABLE_STATS_SUMMARY."\">\n<thead>\n<tr>\n<th>".TABLE_STATS_HEADING_STATISTICS."</th>\n<th>".TABLE_STATS_HEADING_COUNT."</th>\n<th>".TABLE_STATS_HEADING_SITE."</th>\n<th>".TABLE_STATS_HEADING_PERCENTAGE."</th>\n</tr>\n</thead>\n<tbody>\n".
'<tr><td>Hits</td><td class="number">'.$hitspage.'</td><td class="number"> </td><td> </td></tr>'."\n".
'<tr><td>Revisions</td><td class="number">'.$revpage.'</td><td class="number">'.$totalrv.'</td><td>'.$rvbar.'</td></tr>'."\n".
'<tr><td>Comments</td><td class="number">'.$commentspage.'</td><td class="number">'.$totalcn.'</td><td>'.$cnbar.'</td></tr>'."\n".
'<tr><td>Backlinks</td><td class="number">'.$backlinkpage.'</td><td class="number">'.$totalbn.'</td><td>'.$bnbar.'</td></tr>'."\n".
'<tr><td>Referrers</td><td class="number">'.$refpage.'</td><td class="number">'.$totalrn.'</td><td>'.$rnbar.'</td></tr>'."\n".


Revision [10364]

Edited on 2005-08-01 15:27:17 by DarTar [adding link to FormatUser()]
Additions:
The handler uses a **##[[FormatUserMethod FormatUser()]]##** method, that must be added to ##wikka.php##, at the end of the user-related functions (right after ##""function UserWantsComments()""##):
Deletions:
The handler uses a **##""FormatUser()""##** method, that must be added to ##wikka.php##, at the end of the user-related functions (right after ##""function UserWantsComments()""##):
%%(php;813)
function UserWantsComments() { if (!$user = $this->GetUser()) return FALSE; return ($user["show_comments"] == "Y"); }
// 2005-07-30 added by DarTar
/**
* Formatter for usernames.
*
* Renders usernames as links only when needed, avoiding the creation of dozens
* missing page links for users without userpage. Makes other options configurable
* (like truncating long hostnames or disabling link formatting).
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.1
*
* @param string $user required: name of user or hostname retrieved from the DB;
* @param string $link optional: enables/disables linking to userpage;
* @param string $maxhostlength optional: max length for hostname, hostnames longer
* than this will be truncated with an ellipsis;
* @param string $ellipsis optional: character to be use at the end of truncated hosts;
* @return string $formatted_user: formatted username.
*/
function FormatUser ($user, $link='1', $maxhostlength='10', $ellipsis='…')
if (strlen($user)>0)
// check if user is registered
if ($this->LoadUser($user))
// check if userpage exists and if linking is enabled
$formatted_user = ($this->ExistsPage($user) && ($link == 1))? $this->Link($user) : $user;
else
// truncate long host names
$user = (strlen($user) > $maxhostlength) ? '<span title="'.$user.'">'.substr($user, 0, $maxhostlength).$ellipsis.'</span>' : $user;
$formatted_user = '<tt>'.$user.'</tt>';
else
// page has empty user field
$formatted_user = 'anonymous';
return $formatted_user;


Revision [10313]

Edited on 2005-07-31 08:28:43 by DarTar [small code change]
Additions:
<!-- Header id generation took 0.000022 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000190 seconds --><h5 id="hn_Revisions:">Revisions:</h5>
<!-- Header id generation took 0.000207 seconds --><h5 id="hn_Statistics:">Statistics:</h5>
<th>Site totals</th>
<tr><td>Hits</td><td class="number">0</td><td class="number"> </td><td> </td></tr>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for WikkaInternationalization (16)">16</a></td><td class="number">10056</td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.63643595863166px">0.16%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for WikkaInternationalization (9)">9</a></td><td class="number">2042</td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 1.7629774730656px">0.44%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to WikkaInternationalization (5)">5</a></td><td class="number">5478</td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.36509675063892px">0.09%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to WikkaInternationalization (80)">80</a></td><td class="number">65707</td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.48701051638334px">0.12%</span></td></tr>
//define('PERCENTAGE_BAR_STYLE', 'display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: %s'); # style attribute for percentage bar (do not edit the width value)
define('PERCENTAGE_BAR_STYLE', 'display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: %s'); # style attribute for percentage bar (do not edit the width value)
define('TABLE_STATS_HEADING_SITE','Site totals');
$authors = $this->LoadAll('SELECT user, COUNT(*) AS edits FROM '.$this->config['table_prefix'].'pages WHERE `tag` = "'.$tag.'" GROUP BY user ORDER BY edits DESC, user ASC');
$output .= "<table summary=\"".TABLE_STATS_SUMMARY."\">\n<thead>\n<tr>\n<th>".TABLE_STATS_HEADING_STATISTICS."</th>\n<th>".TABLE_STATS_HEADING_COUNT."</th>\n<th>".TABLE_STATS_HEADING_SITE."</th>\n<th>".TABLE_STATS_HEADING_PERCENTAGE."</th>\n</tr>\n</thead>\n<tbody>\n".
'<tr><td>Hits</td><td class="number">'.$hitspage.'</td><td class="number"> </td><td> </td></tr>'."\n".
'<tr><td>Revisions</td><td class="number">'.$revpage.'</td><td class="number">'.$totalrv.'</td><td>'.$rvbar.'</td></tr>'."\n".
'<tr><td>Comments</td><td class="number">'.$commentspage.'</td><td class="number">'.$totalcn.'</td><td>'.$cnbar.'</td></tr>'."\n".
'<tr><td>Backlinks</td><td class="number">'.$backlinkpage.'</td><td class="number">'.$totalbn.'</td><td>'.$bnbar.'</td></tr>'."\n".
'<tr><td>Referrers</td><td class="number">'.$refpage.'</td><td class="number">'.$totalrn.'</td><td>'.$rnbar.'</td></tr>'."\n".
Deletions:
<!-- Header id generation took 0.000025 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000202 seconds --><h5 id="hn_Revisions:">Revisions:</h5>
<!-- Header id generation took 0.000203 seconds --><h5 id="hn_Statistics:">Statistics:</h5>
<tr><td>Hits</td><td class="number">0</td><td> </td></tr>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for WikkaInternationalization (16)">16</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.63776781265571px">0.16%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for WikkaInternationalization (9)">9</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 1.7629774730656px">0.44%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to WikkaInternationalization (5)">5</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.36603221083455px">0.09%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to WikkaInternationalization (79)">79</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.48139177063815px">0.12%</span></td></tr>
define('PERCENTAGE_BAR_STYLE', 'display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: %s'); # style attribute for percentage bar (do not edit the width value)
$authors = $this->LoadAll('SELECT user, COUNT(*) AS edits FROM '.$this->config['table_prefix'].'pages WHERE `tag` = "'.$tag.'" GROUP BY user ORDER BY edits DESC');
$output .= "<table summary=\"".TABLE_STATS_SUMMARY."\">\n<thead>\n<tr>\n<th>".TABLE_STATS_HEADING_STATISTICS."</th>\n<th>".TABLE_STATS_HEADING_COUNT."</th>\n<th>".TABLE_STATS_HEADING_PERCENTAGE."</th>\n</tr>\n</thead>\n<tbody>\n".
'<tr><td>Hits</td><td class="number">'.$hitspage.'</td><td> </td></tr>'."\n".
'<tr><td>Revisions</td><td class="number">'.$revpage.'</td><td>'.$rvbar.'</td></tr>'."\n".
'<tr><td>Comments</td><td class="number">'.$commentspage.'</td><td>'.$cnbar.'</td></tr>'."\n".
'<tr><td>Backlinks</td><td class="number">'.$backlinkpage.'</td><td>'.$bnbar.'</td></tr>'."\n".
'<tr><td>Referrers</td><td class="number">'.$refpage.'</td><td>'.$rnbar.'</td></tr>'."\n".


Revision [10292]

Edited on 2005-07-31 00:21:47 by DarTar [minor]
Additions:
This is the development page for the ##**info**## handler.
<!-- Header id generation took 0.000025 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000202 seconds --><h5 id="hn_Revisions:">Revisions:</h5>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 100px">25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 100px">25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 50px">12.5%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 50px">12.5%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 25px">6.25%</span></td>
<!-- Header id generation took 0.000203 seconds --><h5 id="hn_Statistics:">Statistics:</h5>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for WikkaInternationalization (16)">16</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.63776781265571px">0.16%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for WikkaInternationalization (9)">9</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 1.7629774730656px">0.44%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to WikkaInternationalization (5)">5</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.36603221083455px">0.09%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to WikkaInternationalization (79)">79</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border:1px outset #EFF; width: 0.48139177063815px">0.12%</span></td></tr>
**Note:** the rendering of the percentage bar for small values may not be correct in IE since the bar's size is always adjusted to accomodate with the text width. A small tweak in the style or in the code might be needed for the style to be compatible with IE. Browsers with good CSS support display bars of any size correctly.
Deletions:
This is the development page for the ##**info**## handler.::c::
<!-- Header id generation took 0.000023 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000208 seconds --><h5 id="hn_Revisions:">Revisions:</h5>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 100px">25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 100px">25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 50px">12.5%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 50px">12.5%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 25px">6.25%</span></td>
<!-- Header id generation took 0.000208 seconds --><h5 id="hn_Statistics:">Statistics:</h5>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for WikkaInternationalization (16)">16</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 0.63814936683618px">0.16%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for WikkaInternationalization (9)">9</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 1.7629774730656px">0.44%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to WikkaInternationalization (5)">5</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 0.36609921288669px">0.09%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to WikkaInternationalization (79)">79</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 0.48142110635445px">0.12%</span></td></tr>
**Note:** the rendering of the percentage bar for small values is not correct in IE since its width is always adjusted to accomodate the text width. A small change in the style or in the code might be needed for the style to be compatible with IE.


Revision [10291]

Edited on 2005-07-31 00:13:40 by DarTar [adding link]
Additions:
Append ##[[http://wikka.jsnx.com/WikkaInternationalization/info /info]]## to the URL of the page.
Deletions:
Append ##/info## to the URL of the page.


Revision [10290]

Edited on 2005-07-31 00:11:30 by DarTar [adding link]
Additions:
~-PageAdminAction


Revision [10289]

Edited on 2005-07-31 00:09:25 by DarTar [minor]
Additions:
Append ##/info## to the URL of the page.
Deletions:
Append ##/info## to any pagename in your browser.


Revision [10288]

Edited on 2005-07-31 00:05:37 by DarTar [small code change]
Additions:
**Note:** the rendering of the percentage bar for small values is not correct in IE since its width is always adjusted to accomodate the text width. A small change in the style or in the code might be needed for the style to be compatible with IE.


Revision [10287]

Edited on 2005-07-31 00:00:34 by DarTar [small code change]
Additions:
**Note:** The ##info## handler is installed on this server as a beta feature.
Deletions:
**Note:** The ##info## handler is installed on this server as a beta feature''.


Revision [10286]

Edited on 2005-07-30 23:59:28 by DarTar [small code change]
Additions:
<h4 id="hn_Page_statistics_for_WikkaInternationalization"> Page statistics for <a href="http://wikka.jsnx.com/WikkaInternationalization" title=" ">WikkaInternationalization</a> </h4>
<!-- Header id generation took 0.000023 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000208 seconds --><h5 id="hn_Revisions:">Revisions:</h5>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 100px">25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 100px">25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 50px">12.5%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 50px">12.5%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 25px">6.25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 25px">6.25%</span></td>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for WikkaInternationalization (16)">16</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 0.63814936683618px">0.16%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for WikkaInternationalization (9)">9</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 1.7629774730656px">0.44%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to WikkaInternationalization (5)">5</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 0.36609921288669px">0.09%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to WikkaInternationalization (79)">79</a></td><td><span style="display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: 0.48142110635445px">0.12%</span></td></tr>
define('PERCENTAGE_BAR_STYLE', 'display:block; font-size:.8em; background-color:#DEE; border-left:1px solid #EFF; border-top:1px solid #EFF; border-right:1px solid #CDD; border-bottom:1px solid #CDD; width: %s'); # style attribute for percentage bar (do not edit the width value)
define('PAGE_TITLE','Page statistics for %s');
define('HEADING_AUTHORS','Revisions:');
echo $this->Format('=== '.sprintf(PAGE_TITLE,'[['.$this->tag.']]').' ===');
Deletions:
<h3 id="hn_Information_about_page_WikkaInternationalization"> Information about page <a href="http://wikka.jsnx.com/WikkaInternationalization" title=" ">WikkaInternationalization</a> </h3>
<!-- Header id generation took 0.000024 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000197 seconds --><h5 id="hn_Authors:">Authors:</h5>
<td><span style="display:block; font-size:.8em; background-color:red; width: 100px">25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 100px">25%</span></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 50px">12.5%</span></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 50px">12.5%</span></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 25px">6.3%</span></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 25px">6.3%</span></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 25px">6.3%</span></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 25px">6.3%</span></td>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for WikkaInternationalization (16)">16</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.63853137783099px">0.2%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for WikkaInternationalization (9)">9</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 1.7629774730656px">0.4%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to WikkaInternationalization (5)">5</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.36609921288669px">0.1%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to WikkaInternationalization (79)">79</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.47477388142673px">0.1%</span></td></tr>
define('PERCENTAGE_BAR_STYLE', 'display:block; font-size:.8em; background-color:red; width: %s'); # style attribute for percentage bar
define('PAGE_TITLE','Information about page %s');
define('HEADING_AUTHORS','Authors:');
echo $this->Format('==== '.sprintf(PAGE_TITLE,'[['.$this->tag.']]').' ====');


Revision [10284]

Edited on 2005-07-30 19:27:37 by DarTar [new handler]
Additions:
//Default constants
define('PERCENTAGE_DECIMALS_ROUND', '2'); # decimals for rounding percentage values;
$bar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $width).'">'.round($percentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
$rvbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $rvwidth).'">'.round($rvpercentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
$commentspage = ($cn > 0) ? '<a href="'.$this->Href('',$tag, 'show_comments=1#comments').'" title="'.sprintf(TABLE_CELL_COMMENTS_TITLE, $tag, $cn).'">'.$cn.'</a>' : '0';
$cnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $cnwidth).'">'.round($cnpercentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
$bnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $bnwidth).'">'.round($bnpercentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
$rnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $rnwidth).'">'.round($rnpercentage,PERCENTAGE_DECIMALS_ROUND).'%</span>';
Deletions:
//Default values as constants
$bar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $width).'">'.round($percentage,1).'%</span>';
$rvbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $rvwidth).'">'.round($rvpercentage,1).'%</span>';
$commentspage = ($cn > 0) ? '<a href="'.$this->Href('',$tag, 'show_comments=1#comments').'" title="'.sprintf(TABLE_CELL_COMMENTS_TITLE, $page['tag'], $cn).'">'.$cn.'</a>' : '0';
$cnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $cnwidth).'">'.round($cnpercentage,1).'%</span>';
$bnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $bnwidth).'">'.round($bnpercentage,1).'%</span>';
$rnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $rnwidth).'">'.round($rnpercentage,1).'%</span>';


Revision [10283]

Edited on 2005-07-30 19:22:53 by DarTar [new handler]
Additions:
<h3 id="hn_Information_about_page_WikkaInternationalization"> Information about page <a href="http://wikka.jsnx.com/WikkaInternationalization" title=" ">WikkaInternationalization</a> </h3>
Deletions:
<h3 id="hn_Information_about_page_WikkaInternationalization"> Information about page <a href="http://wikka.jsnx.com/WikkaInternationalization" title="">WikkaInternationalization</a> </h3>


Revision [10281]

Edited on 2005-07-30 19:19:08 by DarTar [new handler]
Additions:
<h3 id="hn_Information_about_page_WikkaInternationalization"> Information about page <a href="http://wikka.jsnx.com/WikkaInternationalization" title="">WikkaInternationalization</a> </h3>
<!-- Header id generation took 0.000024 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000197 seconds --><h5 id="hn_Authors:">Authors:</h5>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for WikkaInternationalization (16)">16</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.63853137783099px">0.2%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for WikkaInternationalization (9)">9</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 1.7629774730656px">0.4%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to WikkaInternationalization (5)">5</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.36609921288669px">0.1%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to WikkaInternationalization (79)">79</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.47477388142673px">0.1%</span></td></tr>
$hitspage = ($hn > 0) ? '<a href="'.$this->Href('hits',$tag, '').'" title="'.sprintf(TABLE_CELL_HITS_TITLE, $tag, $hn).'">'.$hn.'</a>' : '0';
$revpage = ($rv > 0) ? '<a href="'.$this->Href('revisions',$tag, '').'" title="'.sprintf(TABLE_CELL_REVISIONS_TITLE, $tag, $rv).'">'.$rv.'</a>' : '0';
$commentspage = ($cn > 0) ? '<a href="'.$this->Href('',$tag, 'show_comments=1#comments').'" title="'.sprintf(TABLE_CELL_COMMENTS_TITLE, $page['tag'], $cn).'">'.$cn.'</a>' : '0';
$backlinkpage = ($bn > 0) ? '<a href="'.$this->Href('backlinks',$tag, '').'" title="'.sprintf(TABLE_CELL_BACKLINKS_TITLE, $tag, $bn).'">'.$bn.'</a>' : '0';
$refpage = ($rn > 0) ? '<a href="'.$this->Href('referrers',$tag, '').'" title="'.sprintf(TABLE_CELL_REFERRERS_TITLE, $tag, $rn).'">'.$rn.'</a>' : '0';
Deletions:
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for (16)">16</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.63853137783099px">0.2%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for (9)">9</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 1.7629774730656px">0.4%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to (5)">5</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.36609921288669px">0.1%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to (79)">79</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.47477388142673px">0.1%</span></td></tr>
$hitspage = ($hn > 0) ? '<a href="'.$this->Href('hits',$page['tag'], '').'" title="'.sprintf(TABLE_CELL_HITS_TITLE, $page['tag'], $hn).'">'.$hn.'</a>' : '0';
$revpage = ($rv > 0) ? '<a href="'.$this->Href('revisions',$page['tag'], '').'" title="'.sprintf(TABLE_CELL_REVISIONS_TITLE, $page['tag'], $rv).'">'.$rv.'</a>' : '0';
$commentspage = ($cn > 0) ? '<a href="'.$this->Href('',$page['tag'], 'show_comments=1#comments').'" title="'.sprintf(TABLE_CELL_COMMENTS_TITLE, $page['tag'], $cn).'">'.$cn.'</a>' : '0';
$backlinkpage = ($bn > 0) ? '<a href="'.$this->Href('backlinks',$page['tag'], '').'" title="'.sprintf(TABLE_CELL_BACKLINKS_TITLE, $page['tag'], $bn).'">'.$bn.'</a>' : '0';
$refpage = ($rn > 0) ? '<a href="'.$this->Href('referrers',$page['tag'], '').'" title="'.sprintf(TABLE_CELL_REFERRERS_TITLE, $page['tag'], $rn).'">'.$rn.'</a>' : '0';


Revision [10280]

Edited on 2005-07-30 19:14:26 by DarTar [new handler]
Additions:
<td><a href="http://wikka.jsnx.com/JsnX" title=" ">JsnX</a></td>
<td class="number">4</td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 100px">25%</span></td>
<td><a href="http://wikka.jsnx.com/JordaPolo" title=" ">JordaPolo</a></td>
<td class="number">4</td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 100px">25%</span></td>
<td><a href="http://wikka.jsnx.com/AndreaRossato" title=" ">AndreaRossato</a></td>
<td class="number">2</td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 50px">12.5%</span></td>
<td><a href="http://wikka.jsnx.com/DarTar" title=" ">DarTar</a></td>
<td class="number">2</td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 50px">12.5%</span></td>
<td><a href="http://wikka.jsnx.com/DreckFehler" title=" ">DreckFehler</a></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 25px">6.3%</span></td>
<td><a href="http://wikka.jsnx.com/GregorLindner" title=" ">GregorLindner</a></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 25px">6.3%</span></td>
<td><a href="http://wikka.jsnx.com/JavaWoman" title=" ">JavaWoman</a></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 25px">6.3%</span></td>
<td><a href="http://wikka.jsnx.com/DotMG" title=" ">DotMG</a></td>
<td><span style="display:block; font-size:.8em; background-color:red; width: 25px">6.3%</span></td>
<!-- Header id generation took 0.000208 seconds --><h5 id="hn_Statistics:">Statistics:</h5>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/revisions" title="Display revisions for (16)">16</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.63853137783099px">0.2%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization?show_comments=1#comments" title="Display comments for (9)">9</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 1.7629774730656px">0.4%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/backlinks" title="Display pages linking to (5)">5</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.36609921288669px">0.1%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/WikkaInternationalization/referrers" title="Display external sites linking to (79)">79</a></td><td><span style="display:block; font-size:.8em; background-color:red; width: 0.47477388142673px">0.1%</span></td></tr>
Deletions:
<!-- Header id generation took 0.000292 seconds --><h3 id="hn_Information_about_page_DarTar"> Information about page <a href="http://wikka.jsnx.com/DarTar" title="DarTar">DarTar</a> </h3>
<!-- Header id generation took 0.000022 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000201 seconds --><h5 id="hn_Authors:">Authors:</h5>
<td><a href="http://wikka.jsnx.com/DarTar" title="DarTar">DarTar</a></td>
<td class="number">46</td>
<td><span style="display:block; background-color:red; width:173.58490566038px">86.8%</span></td>
<td><tt><span title="ppp15-148-59-62.dialup.zonnet.nl">ppp15-148-59-62.dial…</span></tt></td>
<td class="number">5</td>
<td><span style="display:block; background-color:red; width:18.867924528302px">9.4%</span></td>
<td><a href="http://wikka.jsnx.com/DarTar2" title=" ">DarTar2</a></td>
<td><span style="display:block; background-color:red; width:3.7735849056604px">1.9%</span></td>
<td><tt>132.229.91.74</tt></td>
<td><span style="display:block; background-color:red; width:3.7735849056604px">1.9%</span></td>
<!-- Header id generation took 0.000197 seconds --><h5 id="hn_Statistics:">Statistics:</h5>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/DarTar/revisions" title="Display revisions for (53)">53</a></td><td><span style="display:block; background-color:red; width:1.0586237890742px">0.5%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/DarTar?show_comments=1#comments" title="Display comments for (8)">8</a></td><td><span style="display:block; background-color:red; width:0.78354554358472px">0.4%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/DarTar/backlinks" title="Display pages linking to (94)">94</a></td><td><span style="display:block; background-color:red; width:3.444485159399px">1.7%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/DarTar/referrers" title="Display external sites linking to (86)">86</a></td><td><span style="display:block; background-color:red; width:0.25856496444732px">0.1%</span></td></tr>


Revision [10279]

Edited on 2005-07-30 19:11:43 by DarTar [new handler]
Additions:
//Default values as constants
// -------------------------------------
// set default constant values
define('PERCENTAGE_BAR_WIDTH', '400'); # max width of percentage bar in pixels
define('PERCENTAGE_BAR_STYLE', 'display:block; font-size:.8em; background-color:red; width: %s'); # style attribute for percentage bar
define('OPTION_LINK', '1'); # enable linking to userpages
define('OPTION_HOSTNAME_LENGTH', '20'); # max. length for hostnames
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','Information about page %s');
define('HEADING_AUTHORS','Authors:');
define('HEADING_STATS','Statistics:');
define('ERROR_PAGE_NOT_EXISTING','Sorry, this page does not exist.');
define('ERROR_NO_ACCESS','Sorry, You don\'t have access to this page.');
define('TABLE_AUTHORS_SUMMARY','List of authors of the current page ordered by number of edits');
define('TABLE_AUTHORS_HEADING_USER','User');
define('TABLE_AUTHORS_HEADING_EDITS','Edits');
define('TABLE_AUTHORS_HEADING_PERCENTAGE','Percentage');
define('TABLE_CELL_HITS_TITLE','Hits for %s (%d)');
define('TABLE_CELL_REVISIONS_TITLE','Display revisions for %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments for %s (%d)');
define('TABLE_CELL_BACKLINKS_TITLE','Display pages linking to %s (%d)');
define('TABLE_CELL_REFERRERS_TITLE','Display external sites linking to %s (%d)');
define('TABLE_STATS_SUMMARY','Statistics for current page');
define('TABLE_STATS_HEADING_STATISTICS','Statistics');
define('TABLE_STATS_HEADING_COUNT','Count');
define('TABLE_STATS_HEADING_PERCENTAGE','Percentage');
$bar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $width).'">'.round($percentage,1).'%</span>';
$rvbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $rvwidth).'">'.round($rvpercentage,1).'%</span>';
$cnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $cnwidth).'">'.round($cnpercentage,1).'%</span>';
$bnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $bnwidth).'">'.round($bnpercentage,1).'%</span>';
$rnbar = '<span style="'.sprintf(PERCENTAGE_BAR_STYLE, $rnwidth).'">'.round($rnpercentage,1).'%</span>';
Deletions:
//Default constants
// -------------------------------------
// set default values as constants
define('PERCENTAGE_BAR_WIDTH', '200'); # width of percentage bar in pixels
define('OPTION_LINK', '1'); # enable linking to userpages
define('OPTION_HOSTNAME_LENGTH', '20'); # max. length for hostnames
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','Information about page %s');
define('HEADING_AUTHORS','Authors:');
define('HEADING_STATS','Statistics:');
define('ERROR_PAGE_NOT_EXISTING','Sorry, this page does not exist.');
define('ERROR_NO_ACCESS','Sorry, You don\'t have access to this page.');
define('TABLE_AUTHORS_SUMMARY','List of authors of the current page ordered by number of edits');
define('TABLE_AUTHORS_HEADING_USER','User');
define('TABLE_AUTHORS_HEADING_EDITS','Edits');
define('TABLE_AUTHORS_HEADING_PERCENTAGE','Percentage');
define('TABLE_CELL_HITS_TITLE','Hits for %s (%d)');
define('TABLE_CELL_REVISIONS_TITLE','Display revisions for %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments for %s (%d)');
define('TABLE_CELL_BACKLINKS_TITLE','Display pages linking to %s (%d)');
define('TABLE_CELL_REFERRERS_TITLE','Display external sites linking to %s (%d)');
define('TABLE_STATS_SUMMARY','Statistics for current page');
define('TABLE_STATS_HEADING_STATISTICS','Statistics');
define('TABLE_STATS_HEADING_COUNT','Count');
define('TABLE_STATS_HEADING_PERCENTAGE','Percentage');
$bar = '<span style="display:block; background-color:red; width:'.$width.'">'.round($percentage,1).'%</span>';
$rvbar = '<span style="display:block; background-color:red; width:'.$rvwidth.'">'.round($rvpercentage,1).'%</span>';
$cnbar = '<span style="display:block; background-color:red; width:'.$cnwidth.'">'.round($cnpercentage,1).'%</span>';
$bnbar = '<span style="display:block; background-color:red; width:'.$bnwidth.'">'.round($bnpercentage,1).'%</span>';
$rnbar = '<span style="display:block; background-color:red; width:'.$rnwidth.'">'.round($rnpercentage,1).'%</span>';


Revision [10276]

Edited on 2005-07-30 18:04:45 by DarTar [new handler]

No Differences

Revision [10275]

Edited on 2005-07-30 18:04:20 by DarTar [new handler]
Additions:
This is the development page for the ##**info**## handler.::c::
Deletions:
This is the development page for the info handler.::c::


Revision [10274]

Edited on 2005-07-30 18:03:26 by DarTar [new handler]
Additions:
Latest available version: ##**0.1**##
Deletions:
Latest avaliable version: ##**0.1**##


Revision [10273]

Edited on 2005-07-30 18:02:34 by DarTar [new handler]
Additions:
(2007-07-30)
Deletions:
''(2007-07-30)''


Revision [10272]

Edited on 2005-07-30 18:01:41 by DarTar [new handler]
Additions:
The ##info## handler displays information and statistics about the current page.
Deletions:
The ##/info## handler displays information and statistics about the current page.
---


Revision [10271]

Edited on 2005-07-30 18:00:38 by DarTar [new handler]
Additions:
=====Info Handler=====
>>**See also:**
~-UnderDevelopment
~-WikkaBetaFeatures
**Note:** The ##info## handler is installed on this server as a beta feature''.
>>::c::
This is the development page for the info handler.::c::
The ##/info## handler displays information and statistics about the current page.
=== Usage: ===
Append ##/info## to any pagename in your browser.
==Sample output:==
""
<!-- Header id generation took 0.000292 seconds --><h3 id="hn_Information_about_page_DarTar"> Information about page <a href="http://wikka.jsnx.com/DarTar" title="DarTar">DarTar</a> </h3>
<!-- Header id generation took 0.000022 seconds --> <br /> <br /> <br /> <!-- Header id generation took 0.000201 seconds --><h5 id="hn_Authors:">Authors:</h5>
<table summary="List of authors of the current page ordered by number of edits">
<thead>
<tr>
<th>User</th>
<th>Edits</th>
<th>Percentage</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="http://wikka.jsnx.com/DarTar" title="DarTar">DarTar</a></td>
<td class="number">46</td>
<td><span style="display:block; background-color:red; width:173.58490566038px">86.8%</span></td>
</tr>
<tr>
<td><tt><span title="ppp15-148-59-62.dialup.zonnet.nl">ppp15-148-59-62.dial…</span></tt></td>
<td class="number">5</td>
<td><span style="display:block; background-color:red; width:18.867924528302px">9.4%</span></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/DarTar2" title=" ">DarTar2</a></td>
<td class="number">1</td>
<td><span style="display:block; background-color:red; width:3.7735849056604px">1.9%</span></td>
</tr>
<tr>
<td><tt>132.229.91.74</tt></td>
<td class="number">1</td>
<td><span style="display:block; background-color:red; width:3.7735849056604px">1.9%</span></td>
</tr>
</tbody></table>
<!-- Header id generation took 0.000197 seconds --><h5 id="hn_Statistics:">Statistics:</h5>
<table summary="Statistics for current page">
<thead>
<tr>
<th>Statistics</th>
<th>Count</th>
<th>Percentage</th>
</tr>
</thead>
<tbody>
<tr><td>Hits</td><td class="number">0</td><td> </td></tr>
<tr><td>Revisions</td><td class="number"><a href="http://wikka.jsnx.com/DarTar/revisions" title="Display revisions for (53)">53</a></td><td><span style="display:block; background-color:red; width:1.0586237890742px">0.5%</span></td></tr>
<tr><td>Comments</td><td class="number"><a href="http://wikka.jsnx.com/DarTar?show_comments=1#comments" title="Display comments for (8)">8</a></td><td><span style="display:block; background-color:red; width:0.78354554358472px">0.4%</span></td></tr>
<tr><td>Backlinks</td><td class="number"><a href="http://wikka.jsnx.com/DarTar/backlinks" title="Display pages linking to (94)">94</a></td><td><span style="display:block; background-color:red; width:3.444485159399px">1.7%</span></td></tr>
<tr><td>Referrers</td><td class="number"><a href="http://wikka.jsnx.com/DarTar/referrers" title="Display external sites linking to (86)">86</a></td><td><span style="display:block; background-color:red; width:0.25856496444732px">0.1%</span></td></tr>
</tbody></table>
""
---
=== Current version ===
''(2007-07-30)''
Latest avaliable version: ##**0.1**##
=== The code ===
Copy the following code as: ##handlers/page/info.php##
%%(php;1)
<div class="page">
<?php
/**
* Displays information on the current page.
*
* Usage: append /info to the URL of the page.
*
* @package Handlers
* @name info
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli} - first draft.
* @version 0.1
* @since Wikka 1.1.X.X
*
* @todo - bar styling in the CSS;
* - optimize queries and code;
*/
//Default constants
// -------------------------------------
// set default values as constants
define('PERCENTAGE_BAR_WIDTH', '200'); # width of percentage bar in pixels
define('OPTION_LINK', '1'); # enable linking to userpages
define('OPTION_HOSTNAME_LENGTH', '20'); # max. length for hostnames

// -------------------------------------
// User-interface: strings

define('PAGE_TITLE','Information about page %s');
define('HEADING_AUTHORS','Authors:');
define('HEADING_STATS','Statistics:');
define('ERROR_PAGE_NOT_EXISTING','Sorry, this page does not exist.');
define('ERROR_NO_ACCESS','Sorry, You don\'t have access to this page.');
define('TABLE_AUTHORS_SUMMARY','List of authors of the current page ordered by number of edits');
define('TABLE_AUTHORS_HEADING_USER','User');
define('TABLE_AUTHORS_HEADING_EDITS','Edits');
define('TABLE_AUTHORS_HEADING_PERCENTAGE','Percentage');
define('TABLE_CELL_HITS_TITLE','Hits for %s (%d)');
define('TABLE_CELL_REVISIONS_TITLE','Display revisions for %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments for %s (%d)');
define('TABLE_CELL_BACKLINKS_TITLE','Display pages linking to %s (%d)');
define('TABLE_CELL_REFERRERS_TITLE','Display external sites linking to %s (%d)');
define('TABLE_STATS_SUMMARY','Statistics for current page');
define('TABLE_STATS_HEADING_STATISTICS','Statistics');
define('TABLE_STATS_HEADING_COUNT','Count');
define('TABLE_STATS_HEADING_PERCENTAGE','Percentage');

//initialize variables
$output = '';
$tag = '';
$box = '';
// print header
echo $this->Format('==== '.sprintf(PAGE_TITLE,'[['.$this->tag.']]').' ====');
// 1. check source page existence
if (!$this->page)
{
// source page does not exist!
$box = ERROR_PAGE_NOT_EXISTING;
}
else
{
$tag = $this->page['tag'];

// 2. page exists - now check user's read-access to the source page
if (!$this->HasAccess('read'))
{
// user can't read source page!
$box = ERROR_NO_ACCESS;
} else
{
// page exists and user has read-access to the source - proceed
// --- Authors ---

$authors = $this->LoadAll('SELECT user, COUNT(*) AS edits FROM '.$this->config['table_prefix'].'pages WHERE `tag` = "'.$tag.'" GROUP BY user ORDER BY edits DESC');
$totaledits = $this->getCount('pages', '`tag` = "'.$tag.'"');
$output .= $this->Format('=='.HEADING_AUTHORS.'==');
if ($authors)
{
$output .= "<table summary=\"".TABLE_AUTHORS_SUMMARY."\">\n<thead>\n<tr>\n<th>".TABLE_AUTHORS_HEADING_USER."</th>\n<th>".TABLE_AUTHORS_HEADING_EDITS."</th>\n<th>".TABLE_AUTHORS_HEADING_PERCENTAGE."</th>\n</tr>\n</thead>\n<tbody>\n";
foreach($authors as $author)
{
$percentage = $author['edits'] / $totaledits * 100;
$width = (PERCENTAGE_BAR_WIDTH * $author['edits'] / $totaledits).'px';
$bar = '<span style="display:block; background-color:red; width:'.$width.'">'.round($percentage,1).'%</span>';
// use new FormatUser() method - added to wikka.php by DarTar 2005-07-30
$output .= "<tr>\n<td>".$this->FormatUser($author['user'], OPTION_LINK, OPTION_HOSTNAME_LENGTH)."</td>\n<td class=\"number\">".$author['edits']."</td>\n<td>".$bar."</td>\n</tr>\n";
}
$output .= "</tbody></table>\n";
}
// --- Statistics ---

$whereTag = "`tag` = '".$tag."'";
$wherePageTag = "`page_tag` = '".$tag."'";
$whereToTag = "`to_tag` = '".$tag."'";
$rv = $this->getCount('pages',$whereTag);
$cn = $this->getCount('comments',$wherePageTag);
$bn = $this->getCount('links',$whereToTag);
$rn = $this->getCount('referrers',$wherePageTag);
$totalrv = $this->getCount('pages');
$totalcn = $this->getCount('comments');
$totalbn = $this->getCount('links');
$totalrn = $this->getCount('referrers');
// @@ note: the link generation below is redundant and should be optimized
// get page hits (forthcoming)
$hitspage = ($hn > 0) ? '<a href="'.$this->Href('hits',$page['tag'], '').'" title="'.sprintf(TABLE_CELL_HITS_TITLE, $page['tag'], $hn).'">'.$hn.'</a>' : '0';
// get page revisions and create revision link if needed
$revpage = ($rv > 0) ? '<a href="'.$this->Href('revisions',$page['tag'], '').'" title="'.sprintf(TABLE_CELL_REVISIONS_TITLE, $page['tag'], $rv).'">'.$rv.'</a>' : '0';
$rvpercentage = $rv / $totalrv * 100;
$rvwidth = (PERCENTAGE_BAR_WIDTH * $rv / $totalrv).'px';
$rvbar = '<span style="display:block; background-color:red; width:'.$rvwidth.'">'.round($rvpercentage,1).'%</span>';
// get page comments and create comments link if needed
$commentspage = ($cn > 0) ? '<a href="'.$this->Href('',$page['tag'], 'show_comments=1#comments').'" title="'.sprintf(TABLE_CELL_COMMENTS_TITLE, $page['tag'], $cn).'">'.$cn.'</a>' : '0';
$cnpercentage = $cn / $totalcn * 100;
$cnwidth = (PERCENTAGE_BAR_WIDTH * $cn / $totalcn).'px';
$cnbar = '<span style="display:block; background-color:red; width:'.$cnwidth.'">'.round($cnpercentage,1).'%</span>';
// get page backlinks and create backlinks link
$backlinkpage = ($bn > 0) ? '<a href="'.$this->Href('backlinks',$page['tag'], '').'" title="'.sprintf(TABLE_CELL_BACKLINKS_TITLE, $page['tag'], $bn).'">'.$bn.'</a>' : '0';
$bnpercentage = $bn / $totalbn * 100;
$bnwidth = (PERCENTAGE_BAR_WIDTH * $bn / $totalbn).'px';
$bnbar = '<span style="display:block; background-color:red; width:'.$bnwidth.'">'.round($bnpercentage,1).'%</span>';
// get page referrers and create referrer link
$refpage = ($rn > 0) ? '<a href="'.$this->Href('referrers',$page['tag'], '').'" title="'.sprintf(TABLE_CELL_REFERRERS_TITLE, $page['tag'], $rn).'">'.$rn.'</a>' : '0';
$rnpercentage = $rn / $totalrn * 100;
$rnwidth = (PERCENTAGE_BAR_WIDTH * $rn / $totalrn).'px';
$rnbar = '<span style="display:block; background-color:red; width:'.$rnwidth.'">'.round($rnpercentage,1).'%</span>';
$output .= $this->Format('=='.HEADING_STATS.'==');
$output .= "<table summary=\"".TABLE_STATS_SUMMARY."\">\n<thead>\n<tr>\n<th>".TABLE_STATS_HEADING_STATISTICS."</th>\n<th>".TABLE_STATS_HEADING_COUNT."</th>\n<th>".TABLE_STATS_HEADING_PERCENTAGE."</th>\n</tr>\n</thead>\n<tbody>\n".
'<tr><td>Hits</td><td class="number">'.$hitspage.'</td><td> </td></tr>'."\n".
'<tr><td>Revisions</td><td class="number">'.$revpage.'</td><td>'.$rvbar.'</td></tr>'."\n".
'<tr><td>Comments</td><td class="number">'.$commentspage.'</td><td>'.$cnbar.'</td></tr>'."\n".
'<tr><td>Backlinks</td><td class="number">'.$backlinkpage.'</td><td>'.$bnbar.'</td></tr>'."\n".
'<tr><td>Referrers</td><td class="number">'.$refpage.'</td><td>'.$rnbar.'</td></tr>'."\n".
'</tbody></table>'."\n";

// --- actions --- (forthcoming)
}
}
// display messages
if (isset($box)) echo $this->Format(' --- '.$box.' --- --- ');
// print form
if (isset($output)) print $output;
?>
</div>
%%
The handler uses a **##""FormatUser()""##** method, that must be added to ##wikka.php##, at the end of the user-related functions (right after ##""function UserWantsComments()""##):
%%(php;813)
function UserWantsComments() { if (!$user = $this->GetUser()) return FALSE; return ($user["show_comments"] == "Y"); }
// 2005-07-30 added by DarTar
/**
* Formatter for usernames.
*
* Renders usernames as links only when needed, avoiding the creation of dozens
* missing page links for users without userpage. Makes other options configurable
* (like truncating long hostnames or disabling link formatting).
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.1
*
* @param string $user required: name of user or hostname retrieved from the DB;
* @param string $link optional: enables/disables linking to userpage;
* @param string $maxhostlength optional: max length for hostname, hostnames longer
* than this will be truncated with an ellipsis;
* @param string $ellipsis optional: character to be use at the end of truncated hosts;
* @return string $formatted_user: formatted username.
*/
function FormatUser ($user, $link='1', $maxhostlength='10', $ellipsis='…')
{
if (strlen($user)>0)
{
// check if user is registered
if ($this->LoadUser($user))
{
// check if userpage exists and if linking is enabled
$formatted_user = ($this->ExistsPage($user) && ($link == 1))? $this->Link($user) : $user;
}
else
{
// truncate long host names
$user = (strlen($user) > $maxhostlength) ? '<span title="'.$user.'">'.substr($user, 0, $maxhostlength).$ellipsis.'</span>' : $user;
$formatted_user = '<tt>'.$user.'</tt>';
}
}
else
{
// page has empty user field
$formatted_user = 'anonymous';
}
return $formatted_user;
}
%%
Deletions:
=====xxxxx Handler=====
>>==See also:==
Documentation: xxxxxHandlerInfo.>>This is the development page for the xxxxx handler.::c::
//This page is a **template**. It belongs to CategoryTemplate (which contains more handy templates). To create a handler development page, [[http://wikka.jsnx.com/HandlerTemplate/clone clone this page]] to a page called **xxxxxHandler** (where xxxxx is the (capitalized) name of the handler), replace all occurrences of 'xxxxx' with the name of the handler and replace this paragraph with the actual content.//


Revision [10269]

The oldest known version of this page was created on 2005-07-30 17:36:28 by DarTar [new handler]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki