<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Amigos</title>
	<atom:link href="http://www.phpamigos.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpamigos.com</link>
	<description>Tools and applications based in PHP code.</description>
	<lastBuildDate>Sat, 01 May 2010 20:27:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>how to install piwik on simple machine forums</title>
		<link>http://www.phpamigos.com/how-to-install-piwik-on-simple-machine-forums/</link>
		<comments>http://www.phpamigos.com/how-to-install-piwik-on-simple-machine-forums/#comments</comments>
		<pubDate>Sat, 01 May 2010 02:40:26 +0000</pubDate>
		<dc:creator>cb711</dc:creator>
				<category><![CDATA[Forum Tools]]></category>

		<guid isPermaLink="false">http://www.phpamigos.com/?p=1</guid>
		<description><![CDATA[How to install Piwik on Simple Machine Forums
 

A while back I was having some problems installing Piwik on Simple Machine Forums (SMF), but I found a cool way how to add the code in any SMF installation.
For those who are unfamiliar with Piwik, here&#8217;s a small description:

Piwik is a downloadable, open source (GPL licensed) web [...]]]></description>
			<content:encoded><![CDATA[<h1>How to install Piwik on Simple Machine Forums</h1>
<p> </p>
<p><img class="aligncenter" title="Piwik" src="http://phpamigos.com/images/piwik.jpg" alt="" /></p>
<p>A while back I was having some problems installing <a href="http://piwik.org/">Piwik</a> on <a href="http://www.simplemachines.org/">Simple Machine Forums</a> (<a href="http://www.simplemachines.org/">SMF</a>), but I found a cool way how to add the code in any SMF installation.</p>
<p>For those who are unfamiliar with Piwik, here&#8217;s a small description:</p>
<blockquote>
<div><strong>Piwik is a downloadable, open source (GPL licensed) web analytics software program. It provides you with detailed reports on your website visitors: the search engines and keywords they used, the language they speak, your popular pages… and so much more.</strong></div>
<div><strong> </strong></div>
<div><strong> </strong></div>
<div><strong> </strong></div>
<div><strong> </strong></div>
<p><strong> </p>
<p></strong></p></blockquote>
<p>I hope this small tutorial will be very useful to you on <strong>installing Piwik</strong> on <strong>Simple Machine Forums (SMF)</strong>.</p>
<p>Just follow this steps:</p>
<ul>
<li>Create an HTML file, called e.g. <strong>piwik.html</strong></li>
<li>Go to your Piwik installation,<strong> get the code</strong> and <strong>copy it into your newly created HTML file</strong> (the code is similar to what you see below, but <strong>please</strong> do generate your own, the code below might be <strong>outdated</strong>)
<pre class="javascript"> 
&lt;a href=<span style="color: #3366cc;">"http://piwik.org"</span> title=<span style="color: #3366cc;">"Web analytics"</span> onclick=<span style="color: #3366cc;">"window.open(this.href);return(false);"</span>&gt;

&lt;script type=<span style="color: #3366cc;">"text/javascript"</span>&gt;

<span style="color: #003366; font-weight: bold;">var</span> pkBaseURL = <span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span><span style="color: #3366cc;">"https:"</span> == document.<span style="color: #006600;">location</span>.<span style="color: #006600;">protocol</span><span style="color: #66cc66;">)</span> ? <span style="color: #3366cc;">"https://SUBDOMAIN.DOMAIN.com/"</span> : <span style="color: #3366cc;">"http://SUBDOMAIN.DOMAIN.com/"</span><span style="color: #66cc66;">)</span>;

document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #66cc66;">(</span>unescape<span style="color: #66cc66;">(</span><span style="color: #3366cc;">"%3Cscript src='"</span> + pkBaseURL + <span style="color: #3366cc;">"piwik.js' type='text/javascript'%3E%3C/script%3E"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

&lt;/script&gt;

&lt;script type=<span style="color: #3366cc;">"text/javascript"</span>&gt;

&lt;!--

piwik_action_name = <span style="color: #3366cc;">''</span>;

piwik_idsite = <span style="color: #cc0000;">1</span>;

piwik_url = pkBaseURL + <span style="color: #3366cc;">"piwik.php"</span>;

piwik_log<span style="color: #66cc66;">(</span>piwik_action_name, piwik_idsite, piwik_url<span style="color: #66cc66;">)</span>;

<span style="color: #009900; font-style: italic;">//--&gt;</span>

&lt;/script&gt;&lt;object&gt;

&lt;noscript&gt;

Web analytics &lt;img src=<span style="color: #3366cc;">"http://SUBDOMAIN.DOMAIN.com/piwik.php"</span> style=<span style="color: #3366cc;">"border:0"</span> alt=<span style="color: #3366cc;">"piwik"</span>/&gt;

&lt;<span style="color: #0066ff;">/noscript&gt;&lt;/object&gt;&lt;/</span>a&gt;
 </pre>
</li>
<li>Upload this into <strong>Sources</strong>, you can find this folder in the root of your installation. If you installed your website in a folder called &#8220;forum&#8221;, this folder will be at <strong>forum/Sources</strong>.</li>
<li>Now go into the theme folder that you are using, and open the file <strong>index.template.php</strong>. If you installed your website in a folder called &#8220;forum&#8221;, the exact location of this file would then be <strong>forum/Themes/</strong>your-theme<strong>/index.template.php</strong>.</li>
<li>Search for:</li>
<pre class="php"> 
<a href="http://waybackmachine.org/20090430073912/http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">'

&lt;/body&gt;

&lt;/html&gt;'</span>;</pre>
<p>Replace with:</p>
<pre class="php"><span style="color: #808080; font-style: italic;">// Add in Piwik</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #ff0000;">'piwik.html'</span>;

<a href="http://waybackmachine.org/20090430073912/http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">'

&lt;/body&gt;

&lt;/html&gt;'</span>;</pre>
<li>Close and upload!</li>
</ul>
<p>If you look into the source of your webpage (any webpage) of your website, you will be seeing your <strong>Piwik analytics code</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpamigos.com/how-to-install-piwik-on-simple-machine-forums/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

