<?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>Cape Town news &#187; Lester Chan</title>
	<atom:link href="http://capetownnews.co.za/category/wordpress/plugin-wordpress-2/authors/lester-chan/feed/" rel="self" type="application/rss+xml" />
	<link>http://capetownnews.co.za</link>
	<description></description>
	<lastBuildDate>Sat, 26 Mar 2011 19:43:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>wp-useronline hack</title>
		<link>http://capetownnews.co.za/2007/10/22/wordpress-wp-useronline-hack/</link>
		<comments>http://capetownnews.co.za/2007/10/22/wordpress-wp-useronline-hack/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 17:11:01 +0000</pubDate>
		<dc:creator>Richard Catto</dc:creator>
				<category><![CDATA[Lester Chan]]></category>
		<category><![CDATA[get_currentuserinfo]]></category>
		<category><![CDATA[ip2nation plugin]]></category>
		<category><![CDATA[wp-useronline bug fix]]></category>
		<category><![CDATA[wp_get_current_user]]></category>

		<guid isPermaLink="false">http://capetownnews.co.za/2007/10/22/wordpress-wp-useronline-hack/</guid>
		<description><![CDATA[I use the wp-useronline plugin by Lester Chan to show who&#8217;s cruising my site at any given time. I make this information available to guests and registered users alike, because I think people like knowing that they&#8217;re not alone on here. It&#8217;s nice to be able to reach out and touch others, so to speak. [...]]]></description>
			<content:encoded><![CDATA[<iframe class="me-likey" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fcapetownnews.co.za%2F2007%2F10%2F22%2Fwordpress-wp-useronline-hack%2F&amp;layout=standard&amp;show_faces=true&amp;width=200&amp;height=30&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:200px; height:30px"></iframe><p>I use the <a href="http://lesterchan.net/portfolio/programming.php" target="_blank">wp-useronline plugin by Lester Chan</a> to show who&#8217;s cruising my site at any given time. I make this information available to guests and registered users alike, because I think people like knowing that they&#8217;re not alone on here. It&#8217;s nice to be able to reach out and touch others, so to speak. <img src='http://capetownnews.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For administrators, the plugin is also supposed to show the IP addresses of those on the site. However it never did that for me and I dismissed it with a shrug. Then I did the new site for <a href="http://insidecandy.co.za/" target="_blank">Candy</a> and discovered that I could see the IP addresses of browsers there. Wtf? Why was she so damn special and me not? I was mildly miffed. So I set out to discover the reason.</p>
<p>And I did find the problem too! <img src='http://capetownnews.co.za/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<p>In Lester&#8217;s useronline.php file, there is a check_ip() function. On line two of that function is this statement:</p>
<blockquote><p>$user_level = intval($current_user-&gt;wp_user_level);</p></blockquote>
<p>Please edit this statement to read:</p>
<blockquote><p>$user_level = intval($current_user-&gt;user_level);</p></blockquote>
<p>Then IP addresses will display. wp_user_level is actually the name of the database field, PROVIDED, you have not chosen a custom prefix, which I had done for this site. user_level is the correct name of the variable which tells Lester&#8217;s plugin whether or not the logged in user is an administrator or not.</p>
<p>That&#8217;s it. Make this fix and your IP address not showing problem is fixed.</p>
<p>If you would like to display country flags next to each user, then install the <a href="http://planetozh.com/blog/2004/08/ip-to-nation-plugin/" target="_blank">ip2nation plugin</a>. You also need to manually install two mySQL database tables, and populate them with Ip data for the countries. This can be done with phpMyAdmin. Here is the <a href="http://www.ip2nation.com/" target="_blank">ip2nation sql script</a> that does that all for you.</p>
<iframe class="me-likey" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fcapetownnews.co.za%2F2007%2F10%2F22%2Fwordpress-wp-useronline-hack%2F&amp;layout=standard&amp;show_faces=true&amp;width=200&amp;height=30&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:200px; height:30px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://capetownnews.co.za/2007/10/22/wordpress-wp-useronline-hack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

