Example #1
0
$lnk = '<a href=online.php' . ($sort ? "?sort=1&" : '?') . 'time';
print "\n\t\t{$header}{$smallfont}\n\t\tShow online users during the last:\n\t\t{$lnk}=60>minute</a> |\n\t\t{$lnk}=300>5 minutes</a> |\n\t\t{$lnk}=900>15 minutes</a> |\n\t\t{$lnk}=3600>hour</a> |\n\t\t{$lnk}=86400>day</a>\n\t";
if ($isadmin) {
    print '<br>Admin cruft: <a href=online.php' . ($sort ? '?sort=1&' : '?') . "time={$time}>Sort by " . ($sort == 'IP' ? 'date' : 'IP') . "</a>";
}
// Logged in users
$posters = $sql->query("SELECT id,posts,name,sex,powerlevel,aka,lastactivity,lastip,lastposttime,lasturl,birthday FROM users WHERE lastactivity>" . (ctime() - $time) . ' ORDER BY ' . ($sort == 'IP' && $isadmin ? 'lastip' : 'lastactivity DESC'));
print "<br>\n\t{$fonttag} Online users during the last " . timeunits2($time) . ":\n\t{$tblstart}\n\t\t{$tccellh} width=20>&nbsp</td>\n\t\t{$tccellh} width=200>Username</td>\n\t\t{$tccellh} width=120> Last activity</td>\n\t\t{$tccellh} width=180> Last post</td>\n\t\t{$tccellh} width=*>URL</td>\n\t";
if ($isadmin) {
    print "{$tccellh} width=120>IP address</td>";
}
print "{$tccellh} width=60> Posts</tr>";
for ($i = 1; $user = $sql->fetch($posters); $i++) {
    $userlink = getuserlink($user);
    if (!$user['posts']) {
        $user['lastposttime'] = getblankdate();
    } else {
        $user['lastposttime'] = date($dateformat, $user['lastposttime'] + $tzoff);
    }
    $user['lasturl'] = str_replace('<', '&lt;', $user['lasturl']);
    $user['lasturl'] = str_replace('>', '&gt;', $user['lasturl']);
    $user['lasturl'] = str_replace('%20', ' ', $user['lasturl']);
    $user['lasturl'] = str_replace('shoph', 'shop', $user['lasturl']);
    $user['lasturl'] = preg_replace('/[\\?\\&]debugsql(|=[0-9]+)/i', '', $user['lasturl']);
    // let's not give idiots any ideas
    $lasturltd = "{$tccell2l}><a rel=\"nofollow\" href=\"" . urlformat($user['lasturl']) . "\">{$user['lasturl']}";
    if (substr($user['lasturl'], -11) == '(IP banned)') {
        $lasturltd = "{$tccell2l}><a rel=\"nofollow\" href=\"" . substr($user['lasturl'], 0, -12) . "\">" . substr($user[lasturl], 0, -12) . "</a> (IP banned)";
    } elseif (substr($user['lasturl'], -11) == '(Tor proxy)') {
        $lasturltd = "{$tccell2l}><a rel=\"nofollow\" href=\"" . substr($user['lasturl'], 0, -12) . "\">" . substr($user[lasturl], 0, -12) . "</a> (Tor proxy)";
    }
Example #2
0
            if ($mod['forum'] != $forum['id']) {
                continue;
            }
            $namecolor = getnamecolor($mod['sex'], $mod['powerlevel']);
            $modlist .= ($m++ ? ', ' : '') . "<a href=profile.php?id={$mod['id']}><font {$namecolor}>{$mod['name']}</font></a>";
            unset($mods[$modplace]);
        }
        if ($m) {
            $modlist = "{$smallfont}(moderated by: {$modlist})</font>";
        }
        $namecolor = getnamecolor($forum['sex'], $forum['powerlevel']);
        if ($forum['numposts']) {
            $forumlastpost = "<nobr>" . date($dateformat, $forum['lastpostdate'] + $tzoff);
            $by = "{$smallfont}<br>by <a href=profile.php?id={$forum['uid']}><font {$namecolor}>{$forum['name']}</font></a>" . ($forum['lastpostid'] ? " <a href='thread.php?pid=" . $forum['lastpostid'] . "#" . $forum['lastpostid'] . "'>" . $statusicons['getlast'] . "</a>" : "") . "</nobr></font>";
        } else {
            $forumlastpost = getblankdate();
            $by = '';
        }
        if ($forum['lastpostdate'] > $category['lastpostdate']) {
            $category['lastpostdate'] = $forum['lastpostdate'];
            $category['l'] = $forumlastpost . $by;
        }
        if ($forum['hidden']) {
            $hidden = " <small><i>(hidden)</i></small>";
        } else {
            $hidden = "";
        }
        $forumlist .= "\r\n\t\t<tr>\r\n\t\t\t{$tccell1}><small><a href=admin-editforums.php?id={$forum['id']}{$prevtext}>Edit</a> / <a href=admin-editforums.php?delete={$forum['id']}{$prevtext}>Delete</a></small></td>\r\n\t\t\t{$tccell2l}><a href=forum.php?id={$forum['id']}>{$forum['title']}</a>{$hidden}<br>\r\n\t\t\t{$smallfont}{$forum['description']}<br>{$modlist}</td>\r\n\t\t\t{$tccell1}>{$forum['numthreads']}</td>\r\n\t\t\t{$tccell1}>{$forum['numposts']}</td>\r\n\t\t\t{$tccell2}><span class='lastpost'>{$forumlastpost}</span>{$by}{$forumlastuser}\r\n\t\t</tr>\r\n\t\t";
    }
}
print "<center><b>Preview forums with powerlevel:</b> " . previewbox() . "</center>\n";