<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — Most users online mod]]></title>
		<link>https://punbb.informer.com/forums/topic/7357/most-users-online-mod/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/7357/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Most users online mod.]]></description>
		<lastBuildDate>Mon, 02 May 2005 17:57:06 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Most users online mod]]></title>
			<link>https://punbb.informer.com/forums/post/42242/#p42242</link>
			<description><![CDATA[<p>Never mind, it started working for some reason. I think I had the table wrong.</p>]]></description>
			<author><![CDATA[null@example.com (almost_there)]]></author>
			<pubDate>Mon, 02 May 2005 17:57:06 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/42242/#p42242</guid>
		</item>
		<item>
			<title><![CDATA[Most users online mod]]></title>
			<link>https://punbb.informer.com/forums/post/42239/#p42239</link>
			<description><![CDATA[<p>Trying to use an old mod found here <a href="http://punbb.org/forums/viewtopic.php?id=3439">http://punbb.org/forums/viewtopic.php?id=3439</a></p><p>The problem I&#039;m having is that it doesn&#039;t write any values to the database and is only displaying the current number of users online in the place where it should display the most users ever online.</p><p>The code to add the value to the database is<br /></p><div class="codebox"><pre><code>// Most users-mod START
    // Set up the query and get the data
    $result = $db-&gt;query(&#039;SELECT * FROM &#039;.$db-&gt;prefix.&#039;most_users&#039;) or error(&#039;Unable to fetch most users online data&#039;, __FILE__, __LINE__, 

$db-&gt;error());

    $max_users_online = $db-&gt;fetch_assoc($result);
    // Add users and guests ´to $currently_online.
    // If you don&#039;t want to include guests, remove &#039; + $num_guests&#039; below..
    $currently_online = $num_users + $num_guests;
    // If the amount of currently online users are more or equal to what was previously recorded..
    if ($currently_online&gt;=$max_users_online[&#039;most_online&#039;]) 
    {
        // Set the time
        $max_users_online[&#039;when_was_it&#039;] = time();
        // Set the amount of online users
        $max_users_online[&#039;most_online&#039;] = $currently_online;
        // Store it in the table
        $db-&gt;query(&#039;UPDATE &#039;.$db-&gt;prefix.&#039;most_users SET most_online=&#039;.$currently_online.&#039;, when_was_it=&#039;.$max_users_online[&#039;when_was_it&#039;]) or error(&#039;Unable to update most users online data&#039;, __FILE__, __LINE__, $db-&gt;error());
    }
    // Most users-mod END</code></pre></div><p>And the code to display it on the index page is</p><div class="codebox"><pre><code>// MostUsers-mod START
    // Display what is currently stored in the table (using punBB date format).
    echo &quot;\t\t\t\t\t\t&quot;.&#039;&lt;br&gt;&#039;.$lang_index[&#039;Most users&#039;].&#039;&lt;strong&gt;&#039;.$max_users_online[&#039;most_online&#039;].&#039;&lt;/strong&gt; (&#039;.format_time($max_users_online[&#039;when_was_it&#039;]).&#039;).&#039;.&quot;\n&quot;;
    // MostUsers-mod END</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (almost_there)]]></author>
			<pubDate>Mon, 02 May 2005 16:58:19 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/42239/#p42239</guid>
		</item>
	</channel>
</rss>
