<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Who was online add in Common.php</title>
		<link>https://www.cotonti.com</link>
		<description>Последние сообщения в теме</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Wed, 15 Apr 2026 19:36:41 -0000</pubDate>

		<item>
			<title>rayblo</title>
			<description><![CDATA[Will think about it!]]></description>
			<pubDate>сб, 27 июн 2009 05:59:29 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=2552&d=0#post13502]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[Why not make it a plugin? It's not for every site and it adds a bit of extra load, so it would be best as a plugin.]]></description>
			<pubDate>сб, 27 июн 2009 05:04:07 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=2552&d=0#post13499]]></link>
		</item>
		<item>
			<title>rayblo</title>
			<description><![CDATA[Why is this not added in common.php below;<br />
<br />
<pre class="code">/* ======== Who's online (part 1) and shield protection ======== */
if (!$cfg&#091;'disablewhosonline'&#093; || $cfg&#091;'shieldenabled'&#093;)
{
	if ($usr&#091;'id'&#093;&gt;0)
	{
		$sql = sed_sql_query(&quot;SELECT * FROM $db_online WHERE online_userid=&quot;.$usr&#091;'id'&#093;);

		if ($row = sed_sql_fetcharray($sql))
		{
			$online_count = 1;
			if ($cfg&#091;'shieldenabled'&#093;)
			{
				$shield_limit = $row&#091;'online_shield'&#093;;
				$shield_action = $row&#091;'online_action'&#093;;
				$shield_hammer = sed_shield_hammer($row&#091;'online_hammer'&#093;,$shield_action,$row&#091;'online_lastseen'&#093;);
			}
			sed_sql_query(&quot;UPDATE $db_online SET online_lastseen='&quot;.$sys&#091;'now'&#093;.&quot;', online_location='&quot;.sed_sql_prep($location).&quot;', online_subloc='&quot;.sed_sql_prep($sys&#091;'sublocation'&#093;).&quot;', online_hammer=&quot;.(int)$shield_hammer.&quot; WHERE online_userid=&quot;.$usr&#091;'id'&#093;);
		}
		else
		{
			sed_sql_query(&quot;INSERT INTO $db_online (online_ip, online_name, online_lastseen, online_location, online_subloc, online_userid, online_shield, online_hammer) VALUES ('&quot;.$usr&#091;'ip'&#093;.&quot;', '&quot;.sed_sql_prep($usr&#091;'name'&#093;).&quot;', &quot;.(int)$sys&#091;'now'&#093;.&quot;, '&quot;.sed_sql_prep($location).&quot;',  '&quot;.sed_sql_prep($sys&#091;'sublocation'&#093;).&quot;', &quot;.(int)$usr&#091;'id'&#093;.&quot;, 0, 0)&quot;);
		}
	}
	else
	{
		$sql = sed_sql_query(&quot;SELECT * FROM $db_online WHERE online_ip='&quot;.$usr&#091;'ip'&#093;.&quot;'&quot;);
		$online_count = sed_sql_numrows($sql);

		if ($online_count&gt;0)
		{
			if ($cfg&#091;'shieldenabled'&#093;)
			{
				if ($row = sed_sql_fetcharray($sql))
				{
					$shield_limit = $row&#091;'online_shield'&#093;;
					$shield_action = $row&#091;'online_action'&#093;;
					$shield_hammer = sed_shield_hammer($row&#091;'online_hammer'&#093;,$shield_action,$row&#091;'online_lastseen'&#093;);
				}
			}
			sed_sql_query(&quot;UPDATE $db_online SET online_lastseen='&quot;.$sys&#091;'now'&#093;.&quot;', online_location='&quot;.$location.&quot;', online_subloc='&quot;.sed_sql_prep($sys&#091;'sublocation'&#093;).&quot;', online_hammer=&quot;.(int)$shield_hammer.&quot; WHERE online_ip='&quot;.$usr&#091;'ip'&#093;.&quot;'&quot;);
		}
		else
		{
			sed_sql_query(&quot;INSERT INTO $db_online (online_ip, online_name, online_lastseen, online_location, online_subloc, online_userid, online_shield, online_hammer) VALUES ('&quot;.$usr&#091;'ip'&#093;.&quot;', 'v', &quot;.(int)$sys&#091;'now'&#093;.&quot;, '&quot;.$location.&quot;', '&quot;.sed_sql_prep($sys&#091;'sublocation'&#093;).&quot;', -1, 0, 0)&quot;);
		}
	}

	$sql = sed_sql_query(&quot;DELETE FROM $db_online WHERE online_lastseen&lt;$online_timedout&quot;);
	$sql = sed_sql_query(&quot;SELECT COUNT(*) FROM $db_online WHERE online_name='v'&quot;);
	$sys&#091;'whosonline_vis_count'&#093; = sed_sql_result($sql, 0, 'COUNT(*)');
	$sql = sed_sql_query(&quot;SELECT DISTINCT o.online_name, o.online_userid FROM $db_online o WHERE o.online_name != 'v' ORDER BY online_name ASC&quot;);
	$sys&#091;'whosonline_reg_count'&#093; = sed_sql_numrows($sql);
	$sys&#091;'whosonline_all_count'&#093; = $sys&#091;'whosonline_reg_count'&#093; + $sys&#091;'whosonline_vis_count'&#093;;

	$ii=0;
	while ($row = sed_sql_fetcharray($sql))
	{
		$out&#091;'whosonline_reg_list'&#093; .= ($ii&gt;0) ? ', ' : '';
		$out&#091;'whosonline_reg_list'&#093; .= sed_build_user($row&#091;'online_userid'&#093;, sed_cc($row&#091;'online_name'&#093;));
		$sed_usersonline&#091;&#093; = $row&#091;'online_userid'&#093;;
		$ii++;
	}
}</pre>
<br />
This is what i used in Seditio to show people that have visited the website the last 24 hours.<br />
<br />
<pre class="code">/* ======== Who was online ======== */
$timeback = $sys&#091;'now_offset'&#093; - 86400;

$sql = sed_sql_query(&quot;SELECT * FROM $db_users WHERE user_lastlog&gt;$timeback ORDER BY user_maingrp DESC&quot;);

$ii=0;

while ($row = sed_sql_fetcharray($sql))
                {
        $out&#091;'whowassonline_reg_list'&#093; .= ($ii&gt;0) ? ', ' : '';
        $out&#091;'whowassonline_reg_list'&#093; .= ($row&#091;'user_id'&#093;&gt;1) ? '&lt;strong&gt;' : '' ;
        $out&#091;'whowassonline_reg_list'&#093; .= sed_build_user($row&#091;'user_id'&#093;, sed_cc(stripslashes($row&#091;'user_name'&#093;)));
        $out&#091;'whowassonline_reg_list'&#093; .= ($row&#091;'user_id'&#093;&gt;1) ? '&lt;/strong&gt;' : '' ;
        $ii++;
        }</pre>
<br />
<br />
To use this add this into your file where needed;<br />
<br />
<pre class="code">{PHP.out.whosonline_reg_list}</pre>
<br />
The team players willing to add this ?[/]]]></description>
			<pubDate>вс, 05 апр 2009 19:33:26 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ru/forums?m=posts&q=2552&d=0#post11085]]></link>
		</item>
	</channel>
</rss>