2004-12-17, 05:49 PM
hi,
my board is in dutch and I like the users viewing this thread mod. It works fine, the only problem is that I can't translate the text.
Copy of the code:
ps: I like this php code , can I use it on my board too?
my board is in dutch and I like the users viewing this thread mod. It works fine, the only problem is that I can't translate the text.
Copy of the code:
// Start - Users viewing this thread
if($settings['viewingthisthread'] != "off")
{
$timecut = time() - $settings['wolcutoff'];
$comma = "";
$guestcount = 0;
$membercount = 0;
//$query = $db->query("SELECT DISTINCT o.ip, o.uid, o.time, u.username, u.usergroup, u.invisible, g.namestyle FROM ".TABLE_PREFIX."online o LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=o.uid) LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup) WHERE o.time>'$timecut' AND location LIKE '%showthread.php%tid=$tid%' ORDER BY u.username");
$query = $db->query("SELECT DISTINCT o.ip, o.uid, o.time, u.username, u.usergroup `u.invisible`, g.namestyle FROM ".TABLE_PREFIX."online o LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=o.uid) LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup) WHERE o.time>'$timecut' AND location LIKE '%showthread.php?tid=$tid%' ORDER BY u.username");
while($user = $db->fetch_array($query))
{
if($user['uid'] == 0)
{
$guestcount++;
}
else
{
if($doneusers[$user['uid']] < $user['time'] || !$doneusers)
{
$doneusers[$user['uid']] = $user['time'];
$membercount++;
if($user['invisible'] != "yes" || $mybbuser['canviewwolinvis'])
{
if($user['invisible'] == "yes")
{
$invisiblemark = "*";
}
else
{
$invisiblemark = "";
}
$user['username'] = formatname($user['username'], $user['namestyle']);
eval("\\$usersviewing .= \\"".$templates->get("showthread_usersviewing_user")."\\";");
$comma = ", ";
}
}
}
}
if($guestcount) {
eval("\\$guestsviewing .= \\"".$templates->get("showthread_usersviewing_guest")."\\";");
}
if($guestcount && $usersviewing) {
$viewingsep = ", and";
}
eval("\\$usersviewing = \\"".$templates->get("showthread_usersviewing")."\\";");
unset($comma);
}
// END - Users viewing this thread
ps: I like this php code , can I use it on my board too?