<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Not A n00b</title>
	<atom:link href="http://notan00b.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://notan00b.com</link>
	<description>Tutorials, Scripts, and Rants</description>
	<lastBuildDate>Tue, 16 Mar 2010 00:02:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Site is under construction!!! by Concrete Repair</title>
		<link>http://notan00b.com/2010/03/site-is-under-construction/comment-page-1/#comment-1834</link>
		<dc:creator>Concrete Repair</dc:creator>
		<pubDate>Tue, 16 Mar 2010 00:02:14 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?p=277#comment-1834</guid>
		<description>G&#039;day 

Is there something wrong with your blog or with my Mozzila? I keep clicking on the subscribe button and I get some strange code from the browser. The feed content shows many strange characters and it looks messy. Maybe it&#039;s from the new plugin I set up to get the subscription feeds into a custom way. Strange, never the less. 

Cheers!</description>
		<content:encoded><![CDATA[<p>G&#8217;day </p>
<p>Is there something wrong with your blog or with my Mozzila? I keep clicking on the subscribe button and I get some strange code from the browser. The feed content shows many strange characters and it looks messy. Maybe it&#8217;s from the new plugin I set up to get the subscription feeds into a custom way. Strange, never the less. </p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on WordPress Database Tutorial posted! by 944a025cf8</title>
		<link>http://notan00b.com/2009/08/wordpress-database-tutorial-posted/comment-page-1/#comment-1786</link>
		<dc:creator>944a025cf8</dc:creator>
		<pubDate>Tue, 09 Mar 2010 22:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?p=190#comment-1786</guid>
		<description>Hi! cool service!</description>
		<content:encoded><![CDATA[<p>Hi! cool service!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on WhosOnline Tutorial by pyr0t3chnician</title>
		<link>http://notan00b.com/tutorials/whosonline-tutorial/comment-page-1/#comment-1781</link>
		<dc:creator>pyr0t3chnician</dc:creator>
		<pubDate>Tue, 09 Mar 2010 01:40:41 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?page_id=220#comment-1781</guid>
		<description>Nice, I like it.  I don&#039;t use mysqli... yet.  I actually use a database class that works wonders.  I should probably learn mysqli as it will replace mysql come php 6 (or so I have heard).</description>
		<content:encoded><![CDATA[<p>Nice, I like it.  I don&#8217;t use mysqli&#8230; yet.  I actually use a database class that works wonders.  I should probably learn mysqli as it will replace mysql come php 6 (or so I have heard).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on WhosOnline Tutorial by Sam Bossen</title>
		<link>http://notan00b.com/tutorials/whosonline-tutorial/comment-page-1/#comment-1778</link>
		<dc:creator>Sam Bossen</dc:creator>
		<pubDate>Mon, 08 Mar 2010 20:19:21 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?page_id=220#comment-1778</guid>
		<description>I updated the code to use the mysqli extension instead of the older mysql connection.

&lt;code&gt;
_construct($host,$user,$password,$database);
        return;
    }
    /**
    * WhosOnline::_construct($host, $user, $password, $database [,$table] [,$autoupdate])
    * 
    * This creates the database connection and is created
    * by simply typing:
    * 
    * $whosonline = new WhosOnline(&#039;localhost&#039;,&#039;root&#039;,&#039;&#039;,&#039;epco&#039;);
    * 
    * By utilizing $table and $autocomplete, you do not need to WhosOnline::Update()
    * 
    * @param string $host MySQL Host (localhost)
    * @param string $user MySQL database user
    * @param string $password MySQL user password
    * @param string $database MySQL database
    * @param optional string $table MySQL table
    * @param optional bool $autoupdate
    * @return null Always null 
    */
    function _construct($host,$user,$password,$database,$table=&#039;&#039;,$autoupdate=false)
    {
        $this-&gt;mysqlhost=$host;
        $this-&gt;mysqluser=$user;
        $this-&gt;mysqlpass=$password;
        $this-&gt;mysqldatabase=$database;
        $this-&gt;Connect();
        if($table!=&#039;&#039; &amp;&amp; $autoupdate==true)
        {
            $this-&gt;TableSet($table);
            $this-&gt;Update();
        }
        return;
    }
    /**
    * WhosOnline::Connect()
    * 
    * Connects to a mysql database and stores the connection.  MySQL
    * variables must be set prior to connection, either through
    * WhosOnline::_construct() or by setting individual variables
    * 
    * @return null Always null
    */
    function Connect()
    {
    	/*
    	 *         

    	 */
    try {
            $this-&gt;dbh = new mysqli($this-&gt;mysqlhost, $this-&gt;mysqluser, $this-&gt;mysqlpass, $this-&gt;mysqldatabase);
            if (mysqli_connect_errno()) {
                //could not connect to db
                echo &quot;ERROR: Could not open connection to database&quot;;
                exit;
            }

        }catch( Exception $exception ){
            echo $exception-&gt;getMessage();
        }
        /*
        $this-&gt;dbh = @mysql_connect($this-&gt;mysqlhost,$this-&gt;mysqluser,$this-&gt;mysqlpass,true);
        //$this-&gt;dbh = new mysqli($this-&gt;mysqlhost,$this-&gt;mysqluser,$this-&gt;mysqlpass,$this-&gt;mysqldatabase);
        if (!$this-&gt;dbh) {
            $this-&gt;Error(&#039;Could not connect to the database.  Please check your connection settings.&#039;);
			$this-&gt;Error(&quot;Host: &quot;.$this-&gt;mysqlhost.&quot;, User: &quot;.$this-&gt;mysqluser.&quot;, Pass: &quot;.$this-&gt;mysqlpass);
		}
        if($this-&gt;quit)
            return;
        if(!@mysql_select_db($this-&gt;mysqldatabase,$this-&gt;dbh))
            $this-&gt;Error(&#039;Invalid database.  Possibly typo or user does not have privileges on that database&#039;);
            */
        return;
    }
    /**
    * WhosOnline::TableSet($table, $create=true)
    * 
    * Checks for the table.  If it doesn&#039;t exist it will create the
    * table if $create is true, otherwise it will return an error.
    * 
    * @param string $table MySQL table where data is stored
    * @param bool $create If true, a new table will be created, else echo MySQL error
    * @return null Always null
    */
    function TableSet($table, $create=true)
    {
        if($this-&gt;quit)
            return;
        $this-&gt;mysqltable=$table;
        $tables = array(); 
        $handle =$this-&gt;dbh; 
        $result = $handle-&gt;query(&quot;SHOW TABLES FROM &quot;.$this-&gt;mysqldatabase);
        
        //$query = @mysql_query(&quot;SHOW TABLES FROM &quot;.$this-&gt;mysqldatabase,$this-&gt;dbh); 
        while ($row = $result-&gt;fetch_array()) { 
            $tables[] = $row[0];
        }
        if(!in_array($table,$tables) &amp;&amp; $create==true)
            $this-&gt;CreateTable();   
        else if(!in_array($table,$tables))
            $this-&gt;Error(&#039;Table not found in database.&#039;);
        return;        
    }
    /**
    * WhosOnline::CreateTable()
    * 
    * Creates a MySQL table to store the data.
    * 
    * @return null Always null
    */
    function CreateTable()
    {
        $query=&quot;CREATE TABLE &quot;.$this-&gt;mysqltable.&quot; (sid varchar(100),time int(100), user varchar(100))&quot;;
        $handle =$this-&gt;dbh; 
        $result = $handle-&gt;query($query);
        
        if(!$result)
            $this-&gt;Error(&#039;Unable to create table.&#039;);
        return;    
    }
    /**
    * WhosOnline::Error($message,$mysql)
    * 
    * Displays an error message.  If $bail is set to true, it will close the class.
    * If $die is set to true, it will terminate the PHP display
    * 
    * @param string $message Error message to be echoed
    * @param string $message Error from mysql    
    * @return null Always null 
    */
    function Error($message,$mysql=&#039;&#039;)
    {
        if($this-&gt;die &amp;&amp; $this-&gt;mysqlerrors)
            die($mysql);
        else if($this-&gt;die)
            die($message);
        if($this-&gt;mysqlerrors)
            echo $mysql;
        else
            echo $message;
        if($this-&gt;bail)
            $this-&gt;quit=true;
        return;
    }
    /**
    * WhosOnline::DisplayMysqlErrors()
    * 
    * When called, it will turn on mysql error display
    * 
    * @return null Always null
    */
    function DisplayMysqlErrors()
    {
        $this-&gt;mysqlerrors=true;
        return;
    }
    /**
    * WhosOnline::_destruct()
    * 
    * Class destructor
    * 
    * @return bool Always true
    */
    function _destruct()
    {
        return true;
    }
    /**
    * WhosOnline::Update()
    * 
    * Update the users online
    * 
    * @return null Always null
    * 
    */
    function Update()
    {
        if($this-&gt;quit)
            return;
        $sid = session_id();
        $query=&quot;SELECT * FROM &quot;.$this-&gt;mysqltable.&quot; WHERE sid=&#039;$sid&#039;&quot;;
        $time=time();
        
        $handle =$this-&gt;dbh; 
        $result = $handle-&gt;query($query);
        //$rows= $result-&gt;fetch_array();
        $size = $result-&gt;num_rows;
        
        //$rows=mysql_num_rows(mysql_query($query,$this-&gt;dbh));
        if($size!=0)
            $query2=&quot;UPDATE &quot;.$this-&gt;mysqltable.&quot; SET time=&#039;$time&#039;, user=&#039;&quot;.$this-&gt;username.&quot;&#039; WHERE sid=&#039;$sid&#039;&quot;;
        else
            $query2=&quot;INSERT INTO &quot;.$this-&gt;mysqltable.&quot; (sid,time,user) VALUES (&#039;$sid&#039;,&#039;$time&#039;,&#039;&quot;.$this-&gt;username.&quot;&#039;)&quot;;
        $result2 = $handle-&gt;query($query2);
        if(!$result2)
            $this-&gt;Error(&#039;Error updating the user database.&#039;);
        $this-&gt;Delete();
        return;
    }
    /**
    * WhosOnline::Data($return = &#039;INT&#039;)
    * 
    * Returns the number of users considered &quot;Online&quot;.
    * If $return = &#039;ARRAY&#039;, an array of user names will be returned.
    * 
    * @return int $users The number of people online
    * @return array $online An array with the individual people online
    */
    function Data($return = &#039;INT&#039;)
    {
        if($this-&gt;quit)
            return;
        $now=time();
        $load=(int)$now-$this-&gt;idletime;
        $query = &quot;SELECT * FROM &quot;.$this-&gt;mysqltable;
        
        $handle =$this-&gt;dbh; 
        $result = $handle-&gt;query($query);
        
        //$result=mysql_query($query,$this-&gt;dbh);
        $users=0;
        $members=0;
        $guests=0;
        $online=array();
        while($row=$result-&gt;fetch_array())
        {
            if((int)$row[&#039;time&#039;]&gt;$load)
            {
                if($row[&#039;user&#039;]!=&#039;Guest&#039;)
                {
                    $online[]=$row[&#039;user&#039;];
                    $members++;
                }else
                    $guests++;
                $users++;
            }
        }
        $online[&#039;count&#039;]=$users;
        $online[&#039;members&#039;]=$members;
        $online[&#039;guests&#039;]=$guests;
        if($return==&quot;INT&quot;)
            return $users;
        else
            return $online;
    }
    /**
    * WhosOnline::DisplayImages
    * 
    * Like WhosOnline::Data(), displays the number of users online
    * but formatted a user defined pictures.
    * 
    * @return string $output A html string with the digits represented by images
    */
    function DisplayImages()
    {
        if(count($this-&gt;images)!=10)
            $this-&gt;Error(&#039;Only &#039;.count($this-&gt;images).&#039; images defined.&#039;);
        if($this-&gt;quit)
            return;
        $now=time();
        $load=(int)$now-$this-&gt;idletime;
        $query = &quot;SELECT * FROM &quot;.$this-&gt;mysqltable;
        $handle =$this-&gt;dbh; 
        $result = $handle-&gt;query($query);
        
        //$result=mysql_query($query,$this-&gt;dbh);
        $users=0;
        while($row=$result-&gt;fetch_array())
        {
            if((int)$row[&#039;time&#039;]&gt;$load)
                $users++;
        }
        $array=str_split($users);
        $output=&#039;&#039;;
        foreach($array as $digit)
        {
            $output.=&quot;images[$digit]}&#039;&gt;&quot;;    
        }
        return $output;
    }
    /**
    * WhosOnline::Delete()
    * 
    * Deletes users who have &quot;idled&quot; to long from the database
    * 
    * @return null Always null
    */
    function Delete()
    {
        $now=time();
        $load=(int)$now-$this-&gt;deletetime;
        $query = &quot;SELECT * FROM &quot;.$this-&gt;mysqltable;
        
        $handle =$this-&gt;dbh; 
        $result = $handle-&gt;query($query);
        
        //$result=mysql_query($query,$this-&gt;dbh);
        $count=0;
		$sid = array();
        while($row=$result-&gt;fetch_array())
        {
            if((int)$row[&#039;time&#039;]0)
        {
            $todelete=implode(&quot; OR &quot;,$sid);
            $del = &quot;DELETE FROM &quot;.$this-&gt;mysqltable.&quot; WHERE $todelete&quot;;
            $handle-&gt;query($del);
            //mysql_query(&quot;DELETE FROM &quot;.$this-&gt;mysqltable.&quot; WHERE $todelete&quot;);
        }
        return;
    }
    /**
    * WhosOnline::SetImage($int,$src)
    * 
    * Sets images to be displayed by counter if WhosOnline::ImageDisplay=true;
    * 
    * @param int $int The number
    * @param string $src Location of image
    * @return null Always null
    */
    function SetImage($int,$src)
    {
        if(is_int($int) &amp;&amp; $int=0)
        {
            $this-&gt;images[$int]=$src;
        }
        return;
    }
    /**
    * WhosOnline::UpdateUser($sessionvar, $type)
    * 
    * Updates WhosOnline::username to match the session variable that is provided.
    * $type indicates if the variable is in the session array or just another string.
    * 
    * @param string $sessionvar Location of username in $_SESSION array
    * @param string $type Either &quot;SESSION&quot; or &quot;STRING&quot;
    * @return null Always null
    */
    function UpdateUser($sessionvar, $type = &quot;SESSION&quot;)
    {
        if(!empty($sessionvar) &amp;&amp; array_key_exists($sessionvar,$_SESSION))
            $this-&gt;username=$_SESSION[$sessionvar];
        return;
    }
}
?&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I updated the code to use the mysqli extension instead of the older mysql connection.</p>
<p><code><br />
_construct($host,$user,$password,$database);<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::_construct($host, $user, $password, $database [,$table] [,$autoupdate])<br />
    *<br />
    * This creates the database connection and is created<br />
    * by simply typing:<br />
    *<br />
    * $whosonline = new WhosOnline('localhost','root','','epco');<br />
    *<br />
    * By utilizing $table and $autocomplete, you do not need to WhosOnline::Update()<br />
    *<br />
    * @param string $host MySQL Host (localhost)<br />
    * @param string $user MySQL database user<br />
    * @param string $password MySQL user password<br />
    * @param string $database MySQL database<br />
    * @param optional string $table MySQL table<br />
    * @param optional bool $autoupdate<br />
    * @return null Always null<br />
    */<br />
    function _construct($host,$user,$password,$database,$table='',$autoupdate=false)<br />
    {<br />
        $this-&gt;mysqlhost=$host;<br />
        $this-&gt;mysqluser=$user;<br />
        $this-&gt;mysqlpass=$password;<br />
        $this-&gt;mysqldatabase=$database;<br />
        $this-&gt;Connect();<br />
        if($table!='' &amp;&amp; $autoupdate==true)<br />
        {<br />
            $this-&gt;TableSet($table);<br />
            $this-&gt;Update();<br />
        }<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::Connect()<br />
    *<br />
    * Connects to a mysql database and stores the connection.  MySQL<br />
    * variables must be set prior to connection, either through<br />
    * WhosOnline::_construct() or by setting individual variables<br />
    *<br />
    * @return null Always null<br />
    */<br />
    function Connect()<br />
    {<br />
    	/*<br />
    	 *         </p>
<p>    	 */<br />
    try {<br />
            $this-&gt;dbh = new mysqli($this-&gt;mysqlhost, $this-&gt;mysqluser, $this-&gt;mysqlpass, $this-&gt;mysqldatabase);<br />
            if (mysqli_connect_errno()) {<br />
                //could not connect to db<br />
                echo "ERROR: Could not open connection to database";<br />
                exit;<br />
            }</p>
<p>        }catch( Exception $exception ){<br />
            echo $exception-&gt;getMessage();<br />
        }<br />
        /*<br />
        $this-&gt;dbh = @mysql_connect($this-&gt;mysqlhost,$this-&gt;mysqluser,$this-&gt;mysqlpass,true);<br />
        //$this-&gt;dbh = new mysqli($this-&gt;mysqlhost,$this-&gt;mysqluser,$this-&gt;mysqlpass,$this-&gt;mysqldatabase);<br />
        if (!$this-&gt;dbh) {<br />
            $this-&gt;Error('Could not connect to the database.  Please check your connection settings.');<br />
			$this-&gt;Error("Host: ".$this-&gt;mysqlhost.", User: ".$this-&gt;mysqluser.", Pass: ".$this-&gt;mysqlpass);<br />
		}<br />
        if($this-&gt;quit)<br />
            return;<br />
        if(!@mysql_select_db($this-&gt;mysqldatabase,$this-&gt;dbh))<br />
            $this-&gt;Error('Invalid database.  Possibly typo or user does not have privileges on that database');<br />
            */<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::TableSet($table, $create=true)<br />
    *<br />
    * Checks for the table.  If it doesn't exist it will create the<br />
    * table if $create is true, otherwise it will return an error.<br />
    *<br />
    * @param string $table MySQL table where data is stored<br />
    * @param bool $create If true, a new table will be created, else echo MySQL error<br />
    * @return null Always null<br />
    */<br />
    function TableSet($table, $create=true)<br />
    {<br />
        if($this-&gt;quit)<br />
            return;<br />
        $this-&gt;mysqltable=$table;<br />
        $tables = array();<br />
        $handle =$this-&gt;dbh;<br />
        $result = $handle-&gt;query("SHOW TABLES FROM ".$this-&gt;mysqldatabase);</p>
<p>        //$query = @mysql_query("SHOW TABLES FROM ".$this-&gt;mysqldatabase,$this-&gt;dbh);<br />
        while ($row = $result-&gt;fetch_array()) {<br />
            $tables[] = $row[0];<br />
        }<br />
        if(!in_array($table,$tables) &amp;&amp; $create==true)<br />
            $this-&gt;CreateTable();<br />
        else if(!in_array($table,$tables))<br />
            $this-&gt;Error('Table not found in database.');<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::CreateTable()<br />
    *<br />
    * Creates a MySQL table to store the data.<br />
    *<br />
    * @return null Always null<br />
    */<br />
    function CreateTable()<br />
    {<br />
        $query="CREATE TABLE ".$this-&gt;mysqltable." (sid varchar(100),time int(100), user varchar(100))";<br />
        $handle =$this-&gt;dbh;<br />
        $result = $handle-&gt;query($query);</p>
<p>        if(!$result)<br />
            $this-&gt;Error('Unable to create table.');<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::Error($message,$mysql)<br />
    *<br />
    * Displays an error message.  If $bail is set to true, it will close the class.<br />
    * If $die is set to true, it will terminate the PHP display<br />
    *<br />
    * @param string $message Error message to be echoed<br />
    * @param string $message Error from mysql<br />
    * @return null Always null<br />
    */<br />
    function Error($message,$mysql='')<br />
    {<br />
        if($this-&gt;die &amp;&amp; $this-&gt;mysqlerrors)<br />
            die($mysql);<br />
        else if($this-&gt;die)<br />
            die($message);<br />
        if($this-&gt;mysqlerrors)<br />
            echo $mysql;<br />
        else<br />
            echo $message;<br />
        if($this-&gt;bail)<br />
            $this-&gt;quit=true;<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::DisplayMysqlErrors()<br />
    *<br />
    * When called, it will turn on mysql error display<br />
    *<br />
    * @return null Always null<br />
    */<br />
    function DisplayMysqlErrors()<br />
    {<br />
        $this-&gt;mysqlerrors=true;<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::_destruct()<br />
    *<br />
    * Class destructor<br />
    *<br />
    * @return bool Always true<br />
    */<br />
    function _destruct()<br />
    {<br />
        return true;<br />
    }<br />
    /**<br />
    * WhosOnline::Update()<br />
    *<br />
    * Update the users online<br />
    *<br />
    * @return null Always null<br />
    *<br />
    */<br />
    function Update()<br />
    {<br />
        if($this-&gt;quit)<br />
            return;<br />
        $sid = session_id();<br />
        $query="SELECT * FROM ".$this-&gt;mysqltable." WHERE sid='$sid'";<br />
        $time=time();</p>
<p>        $handle =$this-&gt;dbh;<br />
        $result = $handle-&gt;query($query);<br />
        //$rows= $result-&gt;fetch_array();<br />
        $size = $result-&gt;num_rows;</p>
<p>        //$rows=mysql_num_rows(mysql_query($query,$this-&gt;dbh));<br />
        if($size!=0)<br />
            $query2="UPDATE ".$this-&gt;mysqltable." SET time='$time', user='".$this-&gt;username."' WHERE sid='$sid'";<br />
        else<br />
            $query2="INSERT INTO ".$this-&gt;mysqltable." (sid,time,user) VALUES ('$sid','$time','".$this-&gt;username."')";<br />
        $result2 = $handle-&gt;query($query2);<br />
        if(!$result2)<br />
            $this-&gt;Error('Error updating the user database.');<br />
        $this-&gt;Delete();<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::Data($return = 'INT')<br />
    *<br />
    * Returns the number of users considered "Online".<br />
    * If $return = 'ARRAY', an array of user names will be returned.<br />
    *<br />
    * @return int $users The number of people online<br />
    * @return array $online An array with the individual people online<br />
    */<br />
    function Data($return = 'INT')<br />
    {<br />
        if($this-&gt;quit)<br />
            return;<br />
        $now=time();<br />
        $load=(int)$now-$this-&gt;idletime;<br />
        $query = "SELECT * FROM ".$this-&gt;mysqltable;</p>
<p>        $handle =$this-&gt;dbh;<br />
        $result = $handle-&gt;query($query);</p>
<p>        //$result=mysql_query($query,$this-&gt;dbh);<br />
        $users=0;<br />
        $members=0;<br />
        $guests=0;<br />
        $online=array();<br />
        while($row=$result-&gt;fetch_array())<br />
        {<br />
            if((int)$row['time']&gt;$load)<br />
            {<br />
                if($row['user']!='Guest')<br />
                {<br />
                    $online[]=$row['user'];<br />
                    $members++;<br />
                }else<br />
                    $guests++;<br />
                $users++;<br />
            }<br />
        }<br />
        $online['count']=$users;<br />
        $online['members']=$members;<br />
        $online['guests']=$guests;<br />
        if($return=="INT")<br />
            return $users;<br />
        else<br />
            return $online;<br />
    }<br />
    /**<br />
    * WhosOnline::DisplayImages<br />
    *<br />
    * Like WhosOnline::Data(), displays the number of users online<br />
    * but formatted a user defined pictures.<br />
    *<br />
    * @return string $output A html string with the digits represented by images<br />
    */<br />
    function DisplayImages()<br />
    {<br />
        if(count($this-&gt;images)!=10)<br />
            $this-&gt;Error('Only '.count($this-&gt;images).' images defined.');<br />
        if($this-&gt;quit)<br />
            return;<br />
        $now=time();<br />
        $load=(int)$now-$this-&gt;idletime;<br />
        $query = "SELECT * FROM ".$this-&gt;mysqltable;<br />
        $handle =$this-&gt;dbh;<br />
        $result = $handle-&gt;query($query);</p>
<p>        //$result=mysql_query($query,$this-&gt;dbh);<br />
        $users=0;<br />
        while($row=$result-&gt;fetch_array())<br />
        {<br />
            if((int)$row['time']&gt;$load)<br />
                $users++;<br />
        }<br />
        $array=str_split($users);<br />
        $output='';<br />
        foreach($array as $digit)<br />
        {<br />
            $output.="images[$digit]}'&gt;";<br />
        }<br />
        return $output;<br />
    }<br />
    /**<br />
    * WhosOnline::Delete()<br />
    *<br />
    * Deletes users who have "idled" to long from the database<br />
    *<br />
    * @return null Always null<br />
    */<br />
    function Delete()<br />
    {<br />
        $now=time();<br />
        $load=(int)$now-$this-&gt;deletetime;<br />
        $query = "SELECT * FROM ".$this-&gt;mysqltable;</p>
<p>        $handle =$this-&gt;dbh;<br />
        $result = $handle-&gt;query($query);</p>
<p>        //$result=mysql_query($query,$this-&gt;dbh);<br />
        $count=0;<br />
		$sid = array();<br />
        while($row=$result-&gt;fetch_array())<br />
        {<br />
            if((int)$row['time']0)<br />
        {<br />
            $todelete=implode(" OR ",$sid);<br />
            $del = "DELETE FROM ".$this-&gt;mysqltable." WHERE $todelete";<br />
            $handle-&gt;query($del);<br />
            //mysql_query("DELETE FROM ".$this-&gt;mysqltable." WHERE $todelete");<br />
        }<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::SetImage($int,$src)<br />
    *<br />
    * Sets images to be displayed by counter if WhosOnline::ImageDisplay=true;<br />
    *<br />
    * @param int $int The number<br />
    * @param string $src Location of image<br />
    * @return null Always null<br />
    */<br />
    function SetImage($int,$src)<br />
    {<br />
        if(is_int($int) &amp;&amp; $int=0)<br />
        {<br />
            $this-&gt;images[$int]=$src;<br />
        }<br />
        return;<br />
    }<br />
    /**<br />
    * WhosOnline::UpdateUser($sessionvar, $type)<br />
    *<br />
    * Updates WhosOnline::username to match the session variable that is provided.<br />
    * $type indicates if the variable is in the session array or just another string.<br />
    *<br />
    * @param string $sessionvar Location of username in $_SESSION array<br />
    * @param string $type Either "SESSION" or "STRING"<br />
    * @return null Always null<br />
    */<br />
    function UpdateUser($sessionvar, $type = "SESSION")<br />
    {<br />
        if(!empty($sessionvar) &amp;&amp; array_key_exists($sessionvar,$_SESSION))<br />
            $this-&gt;username=$_SESSION[$sessionvar];<br />
        return;<br />
    }<br />
}<br />
?&gt;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Wordpress page views hack by Tsquare</title>
		<link>http://notan00b.com/2009/07/wordpress-page-views-hack/comment-page-1/#comment-1772</link>
		<dc:creator>Tsquare</dc:creator>
		<pubDate>Sat, 06 Mar 2010 00:40:35 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?p=177#comment-1772</guid>
		<description>Great Blog!......There&#039;s always something here to make me laugh...Keep doing what ya do :)</description>
		<content:encoded><![CDATA[<p>Great Blog!&#8230;&#8230;There&#8217;s always something here to make me laugh&#8230;Keep doing what ya do <img src='http://notan00b.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP Tutorial [Part 1] by Anoopl</title>
		<link>http://notan00b.com/tutorials/php-tutorial-part-1/comment-page-1/#comment-1754</link>
		<dc:creator>Anoopl</dc:creator>
		<pubDate>Wed, 03 Mar 2010 11:20:33 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?page_id=77#comment-1754</guid>
		<description>Hi,

Really nice tutorial....

I&#039;m just waiting for the next part.....

Thanks,
Anoop</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Really nice tutorial&#8230;.</p>
<p>I&#8217;m just waiting for the next part&#8230;..</p>
<p>Thanks,<br />
Anoop</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Wordpress page views hack by bolsas femininas</title>
		<link>http://notan00b.com/2009/07/wordpress-page-views-hack/comment-page-1/#comment-1732</link>
		<dc:creator>bolsas femininas</dc:creator>
		<pubDate>Sun, 28 Feb 2010 22:57:57 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?p=177#comment-1732</guid>
		<description>RSS is working, not sure what was the problem, thanks anyways!</description>
		<content:encoded><![CDATA[<p>RSS is working, not sure what was the problem, thanks anyways!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP Tutorial [Part 2] by Kellar</title>
		<link>http://notan00b.com/tutorials/php-tutorial-part-2/comment-page-1/#comment-1721</link>
		<dc:creator>Kellar</dc:creator>
		<pubDate>Thu, 25 Feb 2010 17:34:15 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?page_id=198#comment-1721</guid>
		<description>Thanks. It is really fun :)</description>
		<content:encoded><![CDATA[<p>Thanks. It is really fun <img src='http://notan00b.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Who&#8217;s Online Counter by pyr0t3chnician</title>
		<link>http://notan00b.com/code-bin/whos-online-counter/comment-page-1/#comment-1671</link>
		<dc:creator>pyr0t3chnician</dc:creator>
		<pubDate>Thu, 18 Feb 2010 20:55:06 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?page_id=147#comment-1671</guid>
		<description>Check out the tutorial and same codes:
Tutorial: http://notan00b.com/tutorials/whosonline-tutorial/
Sample: http://notan00b.com/code-bin/whos-online-counter/whos-online-counter-sample-page/

They go over how to use it.  It is going to require a little bit of configuration depending on what you want it to do.  These are just jumping off points.</description>
		<content:encoded><![CDATA[<p>Check out the tutorial and same codes:<br />
Tutorial: <a href="http://notan00b.com/tutorials/whosonline-tutorial/" rel="nofollow">http://notan00b.com/tutorials/whosonline-tutorial/</a><br />
Sample: <a href="http://notan00b.com/code-bin/whos-online-counter/whos-online-counter-sample-page/" rel="nofollow">http://notan00b.com/code-bin/whos-online-counter/whos-online-counter-sample-page/</a></p>
<p>They go over how to use it.  It is going to require a little bit of configuration depending on what you want it to do.  These are just jumping off points.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Who&#8217;s Online Counter by peter1968</title>
		<link>http://notan00b.com/code-bin/whos-online-counter/comment-page-1/#comment-1669</link>
		<dc:creator>peter1968</dc:creator>
		<pubDate>Thu, 18 Feb 2010 12:18:10 +0000</pubDate>
		<guid isPermaLink="false">http://notan00b.com/?page_id=147#comment-1669</guid>
		<description>Maybe I&#039;m stupid, any ways I&#039;m fairly new at this php. I&#039;ve now read and searched on your sit for the code to inplant in my header.tpl file where I want the whosonline box shown, can&#039;t seem to find it. Maybe I&#039;ve overlooked...</description>
		<content:encoded><![CDATA[<p>Maybe I&#8217;m stupid, any ways I&#8217;m fairly new at this php. I&#8217;ve now read and searched on your sit for the code to inplant in my header.tpl file where I want the whosonline box shown, can&#8217;t seem to find it. Maybe I&#8217;ve overlooked&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
