<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://wiki.peacocktech.com/skins/common/feed.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>WikiStats - Revision history</title>
		<link>http://wiki.peacocktech.com/index.php?title=WikiStats&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.7.1</generator>
		<lastBuildDate>Sun, 17 May 2026 23:08:41 GMT</lastBuildDate>
		<item>
			<title>Trevorp: /* index.php */</title>
			<link>http://wiki.peacocktech.com/index.php?title=WikiStats&amp;diff=4071&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;index.php&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 22:03, 11 July 2006&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 54:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 54:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;body&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;body&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&amp;lt;a href=&amp;quot;http://wiki.peacocktech.com/wiki/WikiStats&amp;quot;&amp;gt;Script Details&amp;lt;/a&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;?php&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;?php&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;  $logfile=fopen('log.txt', 'r');&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;  $logfile=fopen('log.txt', 'r');&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 63:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 64:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;    $data=split(&amp;quot;\t&amp;quot;, trim($data));&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;    $data=split(&amp;quot;\t&amp;quot;, trim($data));&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;    $data2=array('date' =&amp;gt; str_replace(' ', '&amp;amp;nbsp;', $data[0]));&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;    $data2=array('date' =&amp;gt; str_replace(' ', '&amp;amp;nbsp;', $data[0]));&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;    if(key_exists('daily', $_GET) AND (strpos($data2['date'], '24:00:')===FALSE))&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;    if(key_exists('daily', $_GET) AND (strpos($data2['date'], '24&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;:00:')===FALSE) AND (strpos($data2['date'], '00&lt;/span&gt;:00:')===FALSE))&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;      continue;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;      continue;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;    if(strpos($data[1], 'ERR:')!==FALSE)&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;    if(strpos($data[1], 'ERR:')!==FALSE)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 155:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 156:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;===.htaccess===&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;===.htaccess===&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/td&gt;&lt;/tr&gt;

			&lt;/table&gt;
		</description>
			<pubDate>Tue, 11 Jul 2006 22:03:45 GMT</pubDate>			<dc:creator>Trevorp</dc:creator>			<comments>http://wiki.peacocktech.com/wiki/Talk:WikiStats</comments>		</item>
		<item>
			<title>Trevorp at 13:02, 11 July 2006</title>
			<link>http://wiki.peacocktech.com/index.php?title=WikiStats&amp;diff=4070&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 13:02, 11 July 2006&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 170:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 170:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/Files&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/Files&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;==Related Info==&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;*http://meta.wikimedia.org/wiki/Wikistats the scripts used for wikimedias stats. operates on database dumps.&lt;/td&gt;&lt;/tr&gt;

			&lt;/table&gt;
		</description>
			<pubDate>Tue, 11 Jul 2006 13:02:06 GMT</pubDate>			<dc:creator>Trevorp</dc:creator>			<comments>http://wiki.peacocktech.com/wiki/Talk:WikiStats</comments>		</item>
		<item>
			<title>137.166.127.86: /* Procedure */</title>
			<link>http://wiki.peacocktech.com/index.php?title=WikiStats&amp;diff=4069&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Procedure&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 11:33, 11 July 2006&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 20:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 20:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;===Procedure===&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;===Procedure===&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;Copy files index.php update.php and .htaccess to a directory under htdocs on your apache server.&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;Copy files index.php update.php and .htaccess to a directory under htdocs on your apache server.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;Set up a cron job to run update.php at a pre-defined interval. Ensure the command is run in the same as update.php. An example of a bash script to do this is:&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;Set up a cron job to run update.php at a pre-defined interval. Ensure the command is run in the same as update.php. An example of a bash script to do this is:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; cd $(dirname $0)&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; cd $(dirname $0)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; php update.php&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt; php update.php&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;For daily stats to work, the script must be run at 00:00 (midnight), with in the first minute of the day, from 00:00:00 to 00:00:59.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Source Code==&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Source Code==&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;===update.php===&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;===update.php===&lt;/td&gt;&lt;/tr&gt;

			&lt;/table&gt;
		</description>
			<pubDate>Tue, 11 Jul 2006 11:33:27 GMT</pubDate>			<dc:creator>137.166.127.86</dc:creator>			<comments>http://wiki.peacocktech.com/wiki/Talk:WikiStats</comments>		</item>
		<item>
			<title>137.166.127.86: /* Usage */</title>
			<link>http://wiki.peacocktech.com/index.php?title=WikiStats&amp;diff=4068&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 11:32, 11 July 2006&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 9:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 9:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Usage==&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Usage==&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;To use these scripts, ensure they are installed correctly, and point your browser at the path at which the scripts are installed. eg&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;To use these scripts, ensure they are installed correctly, and point your browser at the path at which the scripts are installed. eg&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; http://mywiki.com/stats/&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; &lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;&amp;lt;nowiki&amp;gt;&lt;/span&gt;http://mywiki.com/stats/&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;&amp;lt;/nowiki&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;You can also view daily stats by viewing&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;You can also view daily stats by viewing&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt; http://mywiki.com/stats/?daily=1&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt; &lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;&amp;lt;nowiki&amp;gt;&lt;/span&gt;http://mywiki.com/stats/?daily=1&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;&amp;lt;/nowiki&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Installation==&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Installation==&lt;/td&gt;&lt;/tr&gt;

			&lt;/table&gt;
		</description>
			<pubDate>Tue, 11 Jul 2006 11:32:14 GMT</pubDate>			<dc:creator>137.166.127.86</dc:creator>			<comments>http://wiki.peacocktech.com/wiki/Talk:WikiStats</comments>		</item>
		<item>
			<title>137.166.127.86: /* Usage */</title>
			<link>http://wiki.peacocktech.com/index.php?title=WikiStats&amp;diff=4067&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage&lt;/span&gt;&lt;/p&gt;

			&lt;table border='0' width='98%' cellpadding='0' cellspacing='4' style=&quot;background-color: white;&quot;&gt;
			&lt;tr&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' width='50%' align='center' style=&quot;background-color: white;&quot;&gt;Revision as of 11:31, 11 July 2006&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 8:&lt;/strong&gt;&lt;/td&gt;
&lt;td colspan=&quot;2&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Line 8:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;*generates useful stats based on recorded historical data&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;*generates useful stats based on recorded historical data&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Usage==&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Usage==&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; font-size: smaller;&quot;&gt;To use these scripts, ensure they are installed correctly, and point your browser at the path at which the scripts are installed.&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;To use these scripts, ensure they are installed correctly, and point your browser at the path at which the scripts are installed. &lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;eg&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt; http://mywiki.com/stats/&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;You can also view daily stats by viewing&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt; http://mywiki.com/stats/?daily=1&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; font-size: smaller;&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Installation==&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;==Installation==&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;These scripts run on a standard apache/php server.&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; font-size: smaller;&quot;&gt;These scripts run on a standard apache/php server.&lt;/td&gt;&lt;/tr&gt;

			&lt;/table&gt;
		</description>
			<pubDate>Tue, 11 Jul 2006 11:31:10 GMT</pubDate>			<dc:creator>137.166.127.86</dc:creator>			<comments>http://wiki.peacocktech.com/wiki/Talk:WikiStats</comments>		</item>
		<item>
			<title>137.166.127.86 at 11:28, 11 July 2006</title>
			<link>http://wiki.peacocktech.com/index.php?title=WikiStats&amp;diff=4066&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;WikiStats is some php code designed to keep stats on a Mediawiki site.&lt;br /&gt;
&lt;br /&gt;
Currently it is a dirty hack to gather information from lyricwiki.org, but hopefully it will develop into a suite to generate detailed stats from a MediaWiki database.&lt;br /&gt;
==Details==&lt;br /&gt;
*Date 11 July 2006&lt;br /&gt;
===Features===&lt;br /&gt;
*Gathers and records data at a pre-defined interval&lt;br /&gt;
*generates useful stats based on recorded historical data&lt;br /&gt;
==Usage==&lt;br /&gt;
To use these scripts, ensure they are installed correctly, and point your browser at the path at which the scripts are installed.&lt;br /&gt;
==Installation==&lt;br /&gt;
These scripts run on a standard apache/php server.&lt;br /&gt;
===Requirements===&lt;br /&gt;
*Apache server running PHP&lt;br /&gt;
*Cron daemon&lt;br /&gt;
===Procedure===&lt;br /&gt;
Copy files index.php update.php and .htaccess to a directory under htdocs on your apache server.&lt;br /&gt;
Set up a cron job to run update.php at a pre-defined interval. Ensure the command is run in the same as update.php. An example of a bash script to do this is:&lt;br /&gt;
 cd $(dirname $0)&lt;br /&gt;
 php update.php&lt;br /&gt;
==Source Code==&lt;br /&gt;
===update.php===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $statline=&amp;quot;&amp;quot;;&lt;br /&gt;
  function freaderror($errorno, $errmsg, $filename, $linenum, $vars)&lt;br /&gt;
  {&lt;br /&gt;
    global $statline;&lt;br /&gt;
    $statline='ERR:'.$errmsg;&lt;br /&gt;
  }&lt;br /&gt;
  set_error_handler('freaderror');&lt;br /&gt;
  $statspage=fopen('http://lyricwiki.org/Special:Statistics?action=raw', 'r');&lt;br /&gt;
  if($statspage!=false)&lt;br /&gt;
  $statline=fread($statspage, 1024);&lt;br /&gt;
  restore_error_handler();&lt;br /&gt;
  $logfile=fopen('log.txt', 'a');&lt;br /&gt;
  #date_default_timezone_set('UTC');&lt;br /&gt;
  fwrite($logfile, date('Y-m-d H:i:s').&amp;quot;\t&amp;quot;.addslashes($statline));&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===index.php===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;LyricWiki.org Stats&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;meta http-equiv=&amp;quot;Refresh&amp;quot; content=&amp;quot;900;URL=&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $logfile=fopen('log.txt', 'r');&lt;br /&gt;
  $logfile=trim(fread($logfile,  filesize('log.txt')));&lt;br /&gt;
  $logfilelines=split(&amp;quot;\n&amp;quot;, $logfile);&lt;br /&gt;
  $logfile=array();&lt;br /&gt;
  foreach($logfilelines as $id=&amp;gt;$data)&lt;br /&gt;
  {&lt;br /&gt;
    $data=split(&amp;quot;\t&amp;quot;, trim($data));&lt;br /&gt;
    $data2=array('date' =&amp;gt; str_replace(' ', '&amp;amp;nbsp;', $data[0]));&lt;br /&gt;
    if(key_exists('daily', $_GET) AND (strpos($data2['date'], '24:00:')===FALSE))&lt;br /&gt;
      continue;&lt;br /&gt;
    if(strpos($data[1], 'ERR:')!==FALSE)&lt;br /&gt;
    {&lt;br /&gt;
      $data2['error']=$data[1];&lt;br /&gt;
      $logfile[$id]=$data2;&lt;br /&gt;
      continue;&lt;br /&gt;
    }&lt;br /&gt;
    $data=split(';', $data[1]);&lt;br /&gt;
    foreach($data as $key=&amp;gt;$data)&lt;br /&gt;
    {&lt;br /&gt;
      $data=split('=', $data);&lt;br /&gt;
      $data2[$data[0]]=$data[1];&lt;br /&gt;
    }&lt;br /&gt;
    $logfile[$id]=$data2;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  $diff=array('total'=&amp;gt;0, 'good'=&amp;gt;0, 'views'=&amp;gt;0, 'edits'=&amp;gt;0, 'users'=&amp;gt;0, 'admins'=&amp;gt;0, 'images'=&amp;gt;0);&lt;br /&gt;
  foreach($logfile as $id=&amp;gt;$data)&lt;br /&gt;
  {&lt;br /&gt;
    if(key_exists('error', $data))&lt;br /&gt;
      continue;&lt;br /&gt;
    $logfile[$id]['PercentAdmins']=number_format($data['admins']/$data['users']*100, 2).'%';&lt;br /&gt;
    $logfile[$id]['EditsPerView']=number_format($data['edits']/$data['views'], 4);&lt;br /&gt;
    $logfile[$id]['EditsPerPage']=number_format($data['edits']/$data['total'], 4);&lt;br /&gt;
    foreach($diff as $diffid=&amp;gt;$diffval)&lt;br /&gt;
    {&lt;br /&gt;
      $logfile[$id]['diff'.$diffid]=$data[$diffid]-$diffval;&lt;br /&gt;
      $diff[$diffid]=$logfile[$id][$diffid];&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  #var_dump($logfile);&lt;br /&gt;
&lt;br /&gt;
  $fields=array(&lt;br /&gt;
    'date',&lt;br /&gt;
    'total',&lt;br /&gt;
    'difftotal',&lt;br /&gt;
    'good',&lt;br /&gt;
    'diffgood',&lt;br /&gt;
    'views',&lt;br /&gt;
    'diffviews',&lt;br /&gt;
    'edits',&lt;br /&gt;
    'diffedits',&lt;br /&gt;
    'users',&lt;br /&gt;
    'diffusers',&lt;br /&gt;
    'admins',&lt;br /&gt;
    'diffadmins',&lt;br /&gt;
    'images',&lt;br /&gt;
    'diffimages',&lt;br /&gt;
    'PercentAdmins',&lt;br /&gt;
    'EditsPerView',&lt;br /&gt;
    'EditsPerPage'&lt;br /&gt;
  );&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;table border=1 style=&amp;quot;font-size:12px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  function header_row()&lt;br /&gt;
  {&lt;br /&gt;
    global $fields;&lt;br /&gt;
    echo '&amp;lt;tr&amp;gt;';&lt;br /&gt;
    foreach($fields as $field)&lt;br /&gt;
    {&lt;br /&gt;
      echo '&amp;lt;td&amp;gt;'.$field.'&amp;lt;/td&amp;gt;';&lt;br /&gt;
    }&lt;br /&gt;
    echo &amp;quot;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  $rowno=0;&lt;br /&gt;
  foreach($logfile as $data)&lt;br /&gt;
  {&lt;br /&gt;
    if(($rowno++ % 24)==0)&lt;br /&gt;
      header_row();&lt;br /&gt;
    echo &amp;quot;&amp;lt;tr&amp;gt;&amp;quot;;&lt;br /&gt;
    foreach($fields as $field)&lt;br /&gt;
    {&lt;br /&gt;
      if(key_exists('error', $data))&lt;br /&gt;
      {&lt;br /&gt;
        if($field=='total')&lt;br /&gt;
          echo '&amp;lt;td colspan='.(count($fields)-1).'&amp;gt;'.$data['error'].'&amp;lt;/td&amp;gt;';&lt;br /&gt;
        if($field=='date')&lt;br /&gt;
          echo '&amp;lt;td&amp;gt;'.$data[$field].'&amp;lt;/td&amp;gt;';&lt;br /&gt;
      }&lt;br /&gt;
      else&lt;br /&gt;
        echo '&amp;lt;td&amp;gt;'.$data[$field].'&amp;lt;/td&amp;gt;';&lt;br /&gt;
    }&lt;br /&gt;
    echo &amp;quot;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===.htaccess===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;Files .htaccess&amp;gt;&lt;br /&gt;
  order deny,allow&lt;br /&gt;
  deny from all&lt;br /&gt;
&amp;lt;/Files&amp;gt;&lt;br /&gt;
&amp;lt;Files update.php&amp;gt;&lt;br /&gt;
  order deny,allow&lt;br /&gt;
  deny from all&lt;br /&gt;
&amp;lt;/Files&amp;gt;&lt;br /&gt;
&amp;lt;Files log.txt&amp;gt;&lt;br /&gt;
  order deny,allow&lt;br /&gt;
  deny from all&lt;br /&gt;
&amp;lt;/Files&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</description>
			<pubDate>Tue, 11 Jul 2006 11:28:21 GMT</pubDate>			<dc:creator>137.166.127.86</dc:creator>			<comments>http://wiki.peacocktech.com/wiki/Talk:WikiStats</comments>		</item>
	</channel>
</rss>