Please take a look at NP_Online if you search for this function.
This plugin shows member names when they are online. It requires NP_Online to work properly.
| General Plugin info | |
|---|---|
| Author: | Rodrigo Moraes |
| Current Version: | 1.0 |
| Download: | - |
| Code: | code |
| Demo: | - |
| Forum Thread: | forum thread |
Here's the code:
<?php class NP_MembersOnline extends NucleusPlugin { /* Plugin data to be shown on the plugin list */ function getName() { return 'Members Online'; } function getAuthor() { return 'Rodrigo Moraes'; } function getURL() { return 'http://www.tipos.com.br/'; } function getVersion() { return '1.0'; } function supportsFeature($SqlTablePrefix) { return 1; } function getDescription() { return 'Show member names when they are online.'; } function doSkinVar($skinType) { global $manager, $blog, $CONF, $REMOTE_ADDR; $conta = 1; $query = "SELECT DISTINCT member FROM nucleus_plugin_online WHERE member !='0' and id='0'"; $res = mysql_query($query); echo "<strong>members online:</strong> "; while($row = mysql_fetch_object($res)) { $memberid = $row->member; $query2 = "SELECT mname FROM nucleus_member WHERE mnumber = $memberid"; $res2 = mysql_query($query2); $row = mysql_fetch_object($res2); $membername = $row->mname; // primeiro membro mostrado if ($conta == 1){ echo $membername; $conta++; } // membros seguintes ganham uma v�rgula para separar... else { echo ", ".$membername;} } } } ?>
Go to this forum thread for more info about this plugin.