<?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>Superior Motive - web design &#38; development, Joomla &#38; Drupal CMSes</title>
	<atom:link href="http://www.superiormotive.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.superiormotive.com</link>
	<description>web design &#38; development blog by Plethora Design</description>
	<lastBuildDate>Sun, 18 Jul 2010 05:01:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Easy tab highlighting with included PHP menu</title>
		<link>http://www.superiormotive.com/2010/07/11/easy-tab-highlighting-with-included-php-menu/</link>
		<comments>http://www.superiormotive.com/2010/07/11/easy-tab-highlighting-with-included-php-menu/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 00:48:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sundry]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/?p=230</guid>
		<description><![CDATA[I recently reworked a simple PHP site that uses standalone PHP files containing only HTML. We needed to redesign the navigation bar, which was simple a series of clickable images. These files were not generated by a Dreamweaver template or anything like that, meaning that we would have had to manually change each file every [...]]]></description>
			<content:encoded><![CDATA[<p>I recently reworked a simple PHP site that uses standalone PHP files containing only HTML. We needed to redesign the navigation bar, which was simple a series of clickable images. These files were not generated by a Dreamweaver template or anything like that, meaning that we would have had to manually change each file every time there was a change to the menu. That seemed very annoying to me, so I created a file called navbar.php and included it into all the pages, using the standard PHP include;</p>
<p><span style="color: #0000ff;">&lt;?php include(&#8216;navbar.php&#8217;);?&gt;</span></p>
<p>The tabs are highlighted for the current page, so if you are on &#8220;About Us&#8221;, the About Us tab should be highlighted. To accomplish this, I wrote a simple function;</p>
<div id="_mcePaste"><span style="color: #0000ff;">&lt;?php</span></div>
<div id="_mcePaste"><span style="color: #0000ff;">function isactive($filename){</span></div>
<div id="_mcePaste"><span style="color: #0000ff;">$urlfilename = basename($_SERVER['SCRIPT_FILENAME']);</span></div>
<div id="_mcePaste"><span style="color: #0000ff;">if($filename == $urlfilename){</span></div>
<div id="_mcePaste"><span style="color: #0000ff;">echo &#8220;-hover&#8221;;</span></div>
<div id="_mcePaste"><span style="color: #0000ff;">}</span></div>
<div id="_mcePaste"><span style="color: #0000ff;">}</span></div>
<div id="_mcePaste"><span style="color: #0000ff;">?&gt;</span></div>
<p>A sample navigation tab would then look like this;</p>
<p><span style="color: #0000ff;">&lt;a href=&#8221;consulting.php&#8221;&gt;&lt;img src=&#8221;images/navbar-consulting&lt;?php isactive(&#8216;consulting.php&#8217;);?&gt;.gif&#8221; name=&#8221;consulting&#8221; width=&#8221;104&#8243; height=&#8221;35&#8243; border=&#8221;0&#8243; id=&#8221;consulting&#8221; onmouseover=&#8221;MM_swapImage(&#8216;consulting&#8217;,&#8221;,&#8217;images/navbar-consulting-hover.gif&#8217;,1)&#8221; onmouseout=&#8221;MM_swapImgRestore()&#8221; /&gt;&lt;/a&gt;</span></p>
<p>That simply uses the function to tell it which file name to match to the current page&#8217;s file name:</p>
<p><span style="color: #0000ff;">isactive(&#8216;consulting.php&#8217;);</span></p>
<p>The end result is that on consulting.php, the HTML output for that tab would look like this:</p>
<p><span style="color: #0000ff;">&lt;a href=&#8221;consulting.php&#8221;&gt;&lt;img src=&#8221;images/navbar-consulting-hover.gif&#8221; name=&#8221;consulting&#8221; width=&#8221;104&#8243; height=&#8221;35&#8243; border=&#8221;0&#8243; id=&#8221;consulting&#8221; onmouseover=&#8221;MM_swapImage(&#8216;consulting&#8217;,&#8221;,&#8217;images/navbar-consulting-hover.gif&#8217;,1)&#8221; onmouseout=&#8221;MM_swapImgRestore()&#8221; /&gt;&lt;/a&gt;</span></p>
<p><span style="color: #0000ff;"><span style="color: #000000;">.. and that is done automatically using a single included file.</span></span></p>
<p><span style="color: #0000ff;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/07/11/easy-tab-highlighting-with-included-php-menu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>please vote for EXIHT in Afric&#8230;</title>
		<link>http://www.superiormotive.com/2010/07/06/please-vote-for-exiht-in-afric/</link>
		<comments>http://www.superiormotive.com/2010/07/06/please-vote-for-exiht-in-afric/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 14:56:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sundry]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/2010/07/06/please-vote-for-exiht-in-afric/</guid>
		<description><![CDATA[please vote for EXIHT in Africa.. an anti human trafficking nonprofit. Your vote will help with their funding: http://bit.ly/d3p5Ip]]></description>
			<content:encoded><![CDATA[<p>please vote for EXIHT in Africa.. an anti human trafficking nonprofit. Your vote will help with their funding: <a href="http://bit.ly/d3p5Ip" rel="nofollow">http://bit.ly/d3p5Ip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/07/06/please-vote-for-exiht-in-afric/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Email Links vs. web-based e-mail clients</title>
		<link>http://www.superiormotive.com/2010/06/30/email-links-vs-web-based-e-mail-clients/</link>
		<comments>http://www.superiormotive.com/2010/06/30/email-links-vs-web-based-e-mail-clients/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 13:39:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[clients]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/?p=208</guid>
		<description><![CDATA[Take a look at http://www.lunarpages.com/sales-questions/. Their &#8220;Send us your question&#8221; button is nice &#8230; but they really ought to list the email address on the page too. Clicking it will launch your default e-mail program, even if you don&#8217;t use one. For many people that means it will try to open Windows Mail, Outlook, or [...]]]></description>
			<content:encoded><![CDATA[<p>Take a look at <a href="http://www.lunarpages.com/sales-questions/" target="_blank">http://www.lunarpages.com/sales-questions/</a>. Their &#8220;Send us your question&#8221; button is nice &#8230; but they really ought to list the email address on the page too. Clicking it will launch your default e-mail program, even if you don&#8217;t use one. For many people that means it will try to open Windows Mail, Outlook, or Thunderbird, even if they only use Gmail or Hotmail.</p>
<p>Not everyone uses Outlook, Thunderbird, etc (e-mail clients), and assuming that can cost you potential leads and business.</p>
<p>Someone who uses only web-based e-mail will want to be able to quickly copy and paste the e-mail address. Now, you can of course right-click and copy the link address, but then you still have to remove the &#8220;mailto:&#8221; part. Why put your visitors through so much unnecessary trouble if you really want them to contact you?</p>
<p>There are some valid concerns about attracting spam, but those can be mostly overcome using JavaScript cloaking. I think it would be preferable to receive some spam AND more e-mails from your site visitors, than it would be to receive less spam and fewer e-mails from your site visitors, but maybe it&#8217;s just me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/06/30/email-links-vs-web-based-e-mail-clients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using MySQL to insert missing text depending on field length</title>
		<link>http://www.superiormotive.com/2010/06/28/using-mysql-to-insert-missing-text-depending-on-field-length/</link>
		<comments>http://www.superiormotive.com/2010/06/28/using-mysql-to-insert-missing-text-depending-on-field-length/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 21:08:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sundry]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/?p=220</guid>
		<description><![CDATA[Suppose you have a MySQL database table containing US 5-digit zip codes, except some of them are just three or four digits long because they had leading zeros, and those sometimes get dropped. Here&#8217;s how to add them back in; For 3-digit zip codes: UPDATE zipcodes SET zip = CONCAT(&#8217;00&#8242;, zip) WHERE LENGTH(zip) = 3 [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you have a MySQL database table containing US 5-digit zip codes, except some of them are just three or four digits long because they had leading zeros, and those sometimes get dropped. Here&#8217;s how to add them back in;</p>
<p>For 3-digit zip codes:</p>
<p><span style="color: #0000ff;">UPDATE zipcodes SET zip = CONCAT(&#8217;00&#8242;, zip) WHERE LENGTH(zip) = 3</span></p>
<p><span style="color: #000000;">This will turn &#8217;123&#8242; into &#8217;00123&#8242;.</span></p>
<p>For 4-digit zip codes:</p>
<p><span style="color: #0000ff;">UPDATE zipcodes SET zip = CONCAT(&#8217;0&#8242;, zip) WHERE LENGTH(zip) = 4</span></p>
<p><span style="color: #000000;">This will turn &#8217;1234&#8242; into &#8217;01234&#8242;.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/06/28/using-mysql-to-insert-missing-text-depending-on-field-length/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressions of Joomla 1.6 Beta 3</title>
		<link>http://www.superiormotive.com/2010/06/25/impressions-of-joomla-1-6-beta-3/</link>
		<comments>http://www.superiormotive.com/2010/06/25/impressions-of-joomla-1-6-beta-3/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 03:46:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Sundry]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development / Programming]]></category>
		<category><![CDATA[1.6]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla beta]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/?p=209</guid>
		<description><![CDATA[Well, Joomla came out with another 1.6 beta, and it has certainly come a long way. I remember testing a 1.6 beta two years ago. Here are some highlights; Access Level Control (ACL) It now features a robust ACL system, though some of the inheritance rules will take some getting used to. This is often [...]]]></description>
			<content:encoded><![CDATA[<p>Well, Joomla came out with another 1.6 beta, and it has certainly come a long way. I remember testing a 1.6 beta two years ago. Here are some highlights;</p>
<p><strong>Access Level Control (ACL)</strong></p>
<p>It now features a robust ACL system, though some of the inheritance rules will take some getting used to. This is often cited as a feature Drupal has and Joomla lacks, but soon enough that will be a moot point. From my understanding there will be just one more beta in about two weeks, and then it should be time for 1.6!</p>
<p><strong>Nested categories</strong></p>
<p>Joomla always suffered from a rigid approach to categorization, with Sections and Categories. A section could contain categories, but there could be no sub-categories. This long-running annoyance has finally been been vanquished with Joomla 1.6. It uses only categories (no more sections!), and they can be nested as deeply as you want. I&#8217;m sure at some point someone will nest a category 666 levels down, and run into a terrible bug there &#8230; but in theory it should be fine, because a category would simply be assigned to a parent category .. the number of sub-levels should have no bearing on it.</p>
<p>Drupal has of course supported nested categories for a long time, where they are called Taxonomy. I think Drupal&#8217;s Taxonomy is still more advanced than Joomla 1.6&#8242;s category system, but for many, perhaps most users, just having nested categories is en0ugh. Those who want to do more advance PHP magic will naturally be more inclined towards Drupal anyway, and to words like Taxonomy.</p>
<p>The elimination of Joomla&#8217;s sections does mean that template code that relies on section IDs will have to be changed to be 1.6-compatible. It will have to check for category IDs instead. It also opens up an interesting possibility of (for example) using a database query to select only those categories that are nested within the current category. That could come in handy in displaying category &#8216;blogs&#8217; or headlines in a more automated fashion than creating menu links. And speaking of menu links;</p>
<p><strong>Menu Management</strong></p>
<p>Joomla&#8217;s menu management has gotten very slick;</p>
<ul>
<li>Changing the menu type is now faster.</li>
<li>Much more control over the menu items: meta data, page titles, robot rules, page class styling,  menu link title &amp; CSS attributes.</li>
<li>Module assignment from a menu item. You can still assign modules to menu items, but now you can also do this from the menu item itself, rather than having to edit the module separately.</li>
<li>Batch processing multiple menu items</li>
<li>Language filtering; show your menu item only for certain languages, or for all of them. Would be nice if you could select several languages and hide it on others, but that may be coming.</li>
<li>Set template style</li>
</ul>
<p><strong>Redirect manager</strong></p>
<p>Joomla 1.6 has a new component for managing URL redirects. Presumably this writes to the .htaccess file and created a 301 redirect.</p>
<p><strong>Banner Manager</strong></p>
<p>This is not too different from the 1.5 version, but features &#8220;Tracks&#8221;, which tracks clicks and impressions in date-filterable and CSV-exportable fashion. Finally we will be able to do some more robust reporting.</p>
<p>I am however baffled that banner clients still have no way to log in and view their banner&#8217;s statistics. I think most clients would want that, and offering that ability will help site owners gain more advertisers.</p>
<p>I wrote a Joomla 1.5 hack that got around this by using the &#8220;alias&#8221; field of the banner client to hold a username. That allows us to associate a banner client with a username, and then we can use that to display banner statistics to a given Joomla user (and only that user). Looks like I will have to port that hack to 1.6. Sigh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/06/25/impressions-of-joomla-1-6-beta-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>loving @freshbooks for my invo&#8230;</title>
		<link>http://www.superiormotive.com/2010/06/24/loving-freshbooks-for-my-invo/</link>
		<comments>http://www.superiormotive.com/2010/06/24/loving-freshbooks-for-my-invo/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 17:32:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sundry]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/2010/06/24/loving-freshbooks-for-my-invo/</guid>
		<description><![CDATA[loving @freshbooks for my invoicing. http://bit.ly/aGjNTp]]></description>
			<content:encoded><![CDATA[<p>loving @<a href="http://twitter.com/freshbooks" class="aktt_username">freshbooks</a> for my invoicing. <a href="http://bit.ly/aGjNTp" rel="nofollow">http://bit.ly/aGjNTp</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/06/24/loving-freshbooks-for-my-invo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Client login for Joomla 1.5 banner component</title>
		<link>http://www.superiormotive.com/2010/06/22/client-login-for-joomla-1-5-banner-component/</link>
		<comments>http://www.superiormotive.com/2010/06/22/client-login-for-joomla-1-5-banner-component/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 03:51:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development / Programming]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/?p=214</guid>
		<description><![CDATA[For the longest time I have been frustrated that the standard banner component doesn&#8217;t let banner clients login and view theirbanner statistics. I had been using OpenX but it is a resource hog and is really overkill when all I want is to be able to show a client how many clicks they&#8217;ve had so far. I don&#8217;t want them [...]]]></description>
			<content:encoded><![CDATA[<p>For the longest time I have been frustrated that the standard banner component doesn&#8217;t let banner clients login and view theirbanner statistics. I had been using OpenX but it is a resource hog and is really overkill when all I want is to be able to show a client how many clicks they&#8217;ve had so far. I don&#8217;t want them to just take my word for it.</p>
<p>Well, after trying out various solutions besides OpenX, I thought to myself 2 hours ago, &#8220;why can&#8217;t I just use Contact field in thebanner client area and enter a Joomla username, and then write a custom model for com_banners to display the statistics if the current Joomla user is the same as the one listed as the contact for a client?&#8221;</p>
<p>So that&#8217;s what I did. It is actually two queries. #1 checks the current username and selects all clients with that username (should be just one .. I limited it to one in the query), and selects the correct cid (client id). #2 selects all active banners for a given cid and spits them out, showing the banner, clicks, impressions, and CTR. I also added in some custom HTML to display a PayPal button &#8230; ideally this should be done in a View, not a Model, but the Banners component doesn&#8217;t seem to follow the MVC structure 100% so I didn&#8217;t either.</p>
<p>I did have to modify a few other files. Here are my modifications &#8211; this is on Joomla 1.5.18 but should work for any 1.5 release.</p>
<p>It&#8217;s as easy as 1-2-3;</p>
<h1><span style="color: #339966;">1.</span></h1>
<p><strong>/components/com_banners/controller.php:</strong></p>
<p>Add this after the end of function click():</p>
<div><span style="color: #0000ff;">function bannerstats(){</p>
<p>$model = &amp;$this-&gt;getModel( &#8216;Bannerstats&#8217; );</p>
<p>$model-&gt;bannerstats();</p>
<p>}</span></div>
<h1><span style="color: #339966;">2.</span></h1>
<p><strong>/components/com_banners/bannerstats.php</strong><br />
This is a new file &#8211; containing this code:</p>
<div><span style="color: #0000ff;">&lt;?php</p>
<p>// Create the controller</p>
<p>$controller = new BannersController( array(&#8216;default_task&#8217; =&gt; &#8216;bannerstats&#8217;) );</span><span style="color: #0000ff;"><br />
</span></p>
<p><span style="color: #0000ff;"> // Perform the Request task</p>
<p>$controller-&gt;execute(JRequest::getVar(&#8216;task&#8217;, null, &#8216;bannerstats&#8217;, &#8216;cmd&#8217;));</span></p>
<p><span style="color: #0000ff;"> // Redirect if set by the controller</p>
<p>$controller-&gt;redirect();</span></p>
</div>
<h1><span style="color: #339966;">3.</span></h1>
<p><strong>/components/com_banners/models/bannerstats.php</strong></p>
<p>This is a new file containing this code:</p>
<div>
<p><span style="color: #0000ff;">&lt;?php</span></p>
<p><span style="color: #0000ff;"> // Check to ensure this file is included in Joomla!</p>
<p>defined(&#8216;_JEXEC&#8217;) or die( &#8216;Restricted access&#8217; );</p>
<p>$document = &amp;JFactory::getDocument();</p>
<p>jimport( &#8216;joomla.application.component.model&#8217; );</p>
<p>jimport( &#8216;joomla.application.component.helper&#8217; );</span></p>
<p><span style="color: #0000ff;"> /**</p>
<p>* @package      Joomla</p>
<p>* @subpackage   Banners</p>
<p>*/</p>
<p>class BannersModelBannerstats extends JModel</p>
<p>{</p>
<p>function bannerstats(){</p>
<p>$banneruser = &amp; JFactory::getUser();</p>
<p>$dbgetclient = &amp;$this-&gt;getDBO();</p>
<p>echo &#8220;&lt;h2&gt;&#8221;.$banneruser-&gt;name.&#8221;&#8216;s Ads&lt;/h2&gt;&#8221;;</p>
<p>echo &#8220;&lt;p&gt;Already a customer? If your ad is about to reach the paid for number of clicks, you can make another payment using this button:&lt;/p&gt;&#8221;;</p>
<p>echo &#8216;&lt;form action=&#8221;https://www.paypal.com/cgi-bin/webscr&#8221; method=&#8221;post&#8221; target=&#8221;_blank&#8221;&gt;</p>
<p>&lt;input name=&#8221;cmd&#8221; value=&#8221;_xclick&#8221; type=&#8221;hidden&#8221;&gt;</p>
<p>&lt;input name=&#8221;lc&#8221; value=&#8221;US&#8221; type=&#8221;hidden&#8221;&gt;</p>
<p>&lt;input name=&#8221;business&#8221; value=&#8221;youremail@yourdomain.com&#8221; type=&#8221;hidden&#8221;&gt;</p>
<p>&lt;input name=&#8221;pal&#8221; value=&#8221;4UXZK24C297M6&#8243;&gt;</p>
<p>&lt;input name=&#8221;item_name&#8221; value=&#8221;The name for this transaction&#8221; type=&#8221;hidden&#8221;&gt;</p>
<p>&lt;input src=&#8221;/images/x-click-but01.gif&#8221; name=&#8221;submit&#8221; alt=&#8221;Make payments with PayPal &#8211; it\&#8217;s fast, free and secure!&#8221; border=&#8221;0&#8243; type=&#8221;image&#8221; width=&#8221;62&#8243; height=&#8221;31&#8243;&gt;</p>
<p>&lt;br&gt;</p>
<p>&#8216;;</p>
<p>$dbgetclient = &amp;$this-&gt;getDBO();</p>
<p>echo &#8220;&lt;h2&gt;Active ads for: &#8220;.$banneruser-&gt;username.&#8221;: &lt;/h2&gt;&#8221;;</p>
<p>$getclient = &#8220;SELECT cid FROM #__bannerclient WHERE contact=&#8217;&#8221;.$banneruser-&gt;username.&#8221;&#8216; LIMIT 1&#8243;;</p>
<p>$dbgetclient-&gt;setQuery( $getclient );</p>
<p>$getclientresult = $dbgetclient-&gt;loadObjectList();</span></p>
<p><span style="color: #0000ff;"> for($i = 0; $i &lt; count($getclientresult); $i++) {</p>
<p>$cid = $getclientresult[$i]-&gt;cid;</p>
<p>//echo &#8220;cid: &#8220;.$cid.&#8221;&lt;br /&gt;&#8221;;</p>
<p>}</span></p>
<p><span style="color: #0000ff;"><br />
$dbgetbanner = &amp;$this-&gt;getDBO();</p>
<p>$getbanner = &#8220;SELECT * FROM #__banner WHERE cid=&#8221;.$cid.&#8221;";</p>
<p>$dbgetbanner-&gt;setQuery( $getbanner );</p>
<p>$getbannerresult = $dbgetbanner-&gt;loadObjectList();</span></p>
<p><span style="color: #0000ff;"> for($i = 0; $i &lt; count($getbannerresult); $i++) {</p>
<p>echo &#8220;&lt;img src=&#8217;&#8221;.JURI::root().&#8221;images/banners/&#8221;.$getbannerresult[$i]-&gt;imageurl.&#8221;&#8216; border=&#8217;0&#8242;&gt;&lt;br /&gt;&#8221;;</p>
<p>echo &#8216;URL: &#8216;.$getbannerresult[$i]-&gt;clickurl.&#8217;&lt;br /&gt;&#8217;;</p>
<p>echo &#8216;Clicks: &#8216;.$getbannerresult[$i]-&gt;clicks.&#8217;&lt;br /&gt;&#8217;;</p>
<p>echo &#8216;Views: &#8216;.$getbannerresult[$i]-&gt;impmade.&#8217;&lt;br /&gt;&#8217;;</p>
<p>echo &#8216;CTR (clickthrough rate): &#8216;.number_format((100*($getbannerresult[$i]-&gt;clicks)/($getbannerresult[$i]-&gt;impmade)),2).&#8217; %&lt;hr /&gt;&#8217;;</p>
<p>}</span></p>
<p><span style="color: #0000ff;"> }</p>
<p>}</p>
<p>?&gt;</span></p>
</div>
<p>You can then create a link in the User Menu pointing to index.php?option=com_banners&amp;amp;task=bannerstats.</p>
<p>It will detect the current logged-in user&#8217;s username, check the &#8220;contact&#8221; field of the banner clients, and select the active banners for that client. Needless to say, the contact field should contain that person&#8217;s username and nothing else, or it will not work.</p>
<p>In the future maybe there can be a special field allowing us to choose a username or enter one, instead of using the Contact field which is not really meant for that. I had considered making this a separate component, but it is really something I would like to see become part of the regular com_banners component.</p>
<p>Feedback is welcome &#8211; as far as I can tell this is secure and works, but others may have a better idea about that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/06/22/client-login-for-joomla-1-5-banner-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freshbooks and time management</title>
		<link>http://www.superiormotive.com/2010/06/16/freshbooks-and-time-management/</link>
		<comments>http://www.superiormotive.com/2010/06/16/freshbooks-and-time-management/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 02:59:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sundry]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[accounting]]></category>
		<category><![CDATA[billing]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[freelancing]]></category>
		<category><![CDATA[FreshBooks]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[time tracking]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/?p=203</guid>
		<description><![CDATA[FreshBooks is a great tool for managing and monitoring time spent on projects. That helps make you more efficient and profitable. We have been using it for nearly two months, and it has worked wonders for us in terms of time tracking and invoicing. We highly recommend it. It&#8217;s a wonderful invoicing tool, offering smooth [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.freshbooks.com/?ref=4728b601223219-1" target="_blank">FreshBooks</a> is a great tool for managing and monitoring time spent on projects. That helps make you more efficient and profitable. We have been using it for nearly two months, and it has worked wonders for us in terms of time tracking and invoicing. We highly recommend it.</p>
<p>It&#8217;s a wonderful invoicing tool, offering smooth integration with Basecamp, online payment for your customers, and even snail mail for those times you need to mail an invoice the old-fashioned way. Using <a href="https://ems.authorize.net/oap/home.aspx?SalesRepID=98&amp;ResellerID=16819" target="_blank">Authorize.net</a> you can also set up recurring payments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/06/16/freshbooks-and-time-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring Joomla for file changes</title>
		<link>http://www.superiormotive.com/2010/06/16/monitoring-joomla-for-file-changes/</link>
		<comments>http://www.superiormotive.com/2010/06/16/monitoring-joomla-for-file-changes/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 01:48:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sundry]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/2010/06/16/monitoring-joomla-for-file-changes/</guid>
		<description><![CDATA[It is often desirable to monitor a site for file changes, so that you can be alerted to unwanted file changes. Those could indicate hacker activity. There is server-side software that can do this for sites, but since our focus is Joomla, we wanted to take a moment to recommend the Eyesite component: http://extensions.lesarbresdesign.info/eyesite. To [...]]]></description>
			<content:encoded><![CDATA[<p>It is often desirable to monitor a site for file changes, so that you can be alerted to unwanted file changes. Those could indicate hacker activity. There is server-side software that can do this for sites, but since our focus is Joomla, we wanted to take a moment to recommend the Eyesite component: <a href="http://extensions.lesarbresdesign.info/eyesite" target="_blank">http://extensions.lesarbresdesign.info/eyesite</a>. To get the most out of this, you will need to set up a cron job so that it will email you whenever there are outstanding file changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/06/16/monitoring-joomla-for-file-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Joomla section ID for article or category</title>
		<link>http://www.superiormotive.com/2010/06/01/find-joomla-section-id-for-article-or-category/</link>
		<comments>http://www.superiormotive.com/2010/06/01/find-joomla-section-id-for-article-or-category/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 15:54:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sundry]]></category>

		<guid isPermaLink="false">http://www.superiormotive.com/?p=198</guid>
		<description><![CDATA[Sometimes when coding a Joomla template it may be handy to know the section ID of the article or category the user is viewing. Here is some PHP code you could insert in your template to achieve this (for Joomla 1.5); $db =&#38; JFactory::getDBO(); if(JRequest::getVar(&#8216;view&#8217;)==&#8217;article&#8217;){ $query = &#8220;SELECT sectionid FROM #__content WHERE id=&#8217;&#8221;.JRequest::getVar(&#8216;id&#8217;).&#8221;&#8216;&#8221;; $db-&#62;setQuery($query); $sectionid [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when coding a Joomla template it may be handy to know the section ID of the article or category the user is viewing.</p>
<p>Here is some PHP code you could insert in your template to achieve this (for Joomla 1.5);</p>
<div id="_mcePaste"><span style="color: #888888;">$db =&amp; JFactory::getDBO();</span></div>
<div id="_mcePaste"><span style="color: #888888;">if(JRequest::getVar(&#8216;view&#8217;)==&#8217;article&#8217;){</span></div>
<div id="_mcePaste"><span style="color: #888888;">$query = &#8220;SELECT sectionid FROM #__content WHERE id=&#8217;&#8221;.JRequest::getVar(&#8216;id&#8217;).&#8221;&#8216;&#8221;;</span></div>
<div id="_mcePaste"><span style="color: #888888;">$db-&gt;setQuery($query);</span></div>
<div id="_mcePaste"><span style="color: #888888;">$sectionid = $db-&gt;loadResult();</span></div>
<div id="_mcePaste"><span style="color: #888888;">}</span></div>
<div id="_mcePaste"><span style="color: #888888;">if(JRequest::getVar(&#8216;view&#8217;)==&#8217;category&#8217;){</span></div>
<div id="_mcePaste"><span style="color: #888888;">$query = &#8220;SELECT sectionid FROM #__content WHERE catid=&#8217;&#8221;.JRequest::getVar(&#8216;id&#8217;).&#8221;&#8216;&#8221;;</span></div>
<div id="_mcePaste"><span style="color: #888888;">$db-&gt;setQuery($query);</span></div>
<div id="_mcePaste"><span style="color: #888888;">$sectionid = $db-&gt;loadResult();</span></div>
<div id="_mcePaste"><span style="color: #888888;">}</span></div>
<p><span style="color: #888888;"><span style="color: #000000;">Using this, you could for example control which graphics or CSS file are loaded depending on the section of the article/category. </span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.superiormotive.com/2010/06/01/find-joomla-section-id-for-article-or-category/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
