Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 01-15-2001
Last Update: Never
Installs: 0
No support by the author.
This is a small (very small) Hack i made today. Its like ubb's UBonline.cgi hack. so small anyone could install it
Step 1
Open showthread.php/php3 and find
Code:
$userid=$post[userid];
if ($userid!=0) {
$userinfo=$post;
and UNDER it add
Code:
// User Online Icon Hack by Chris Boulton
$status = $DB_site->query_first("SELECT session.userid,user.username,user.receivepm FROM session, user WHERE session.userid=user.userid AND session.userid='".intval($userinfo[userid])."'");
if ($status) {
$usersstatus = "<img src=\"images/online.gif\" border=0 alt=\"$userinfo[username] is Online\">";
} else {
$usersstatus = "<img src=\"images/offline.gif\" border=0 alt=\"$userinfo[username] is Offline\">";
}
// User Online Icon Hack by Chris Boulton
Step 2
save and upload
Step 3
open your postbit template
and instert $usersstatus where you want to display if the threads poster is online or offline
Step 4
download or make 2 images (offline.gif and online.gif)
I use the ones that ubbdev.com use
Please be nice on me, this is the first hack i have made for vBulletin. If someone has already done it sorry.
BTW - does anyone want to help me with a Instant Message Hack, i am crap at php but i have done the templates etc etc.
If you have trouble with this hack reply or contact me
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
You have the join the post.userid with the session table to see if the user is online. That is why I have made it an optional feature as it will add query time to showthread.
====>Add below
// on line hack
if ($displayloggedin==1) {
$datecut=time()-$cookietimeout;
$numberguest=0;
$numberregistered=0;
if ($logged=$DB_site->query("SELECT userid FROM session")) {
while($thislogged=$DB_site->fetch_array($logged)) {
if ($thislogged[userid]==0) {
$numberguest++;
} else {
$numberregistered++;
}
}
}
$totalonline = $numberguest+$numberregistered;
$numbervisible=0;
$activeusers = "";
$loggedins=$DB_site->query("SELECT DISTINCT user.userid,username,session.location FROM user,session WHERE session.userid=user.userid AND session.userid<>0 AND invisible=0 ORDER BY username");
if ($loggedin=$DB_site->fetch_array($loggedins)) {
$numbervisible++;
$userid=$loggedin[userid];
$username=$loggedin[username];
$location=$loggedin[location];
eval("\$activeusers .= \"on line - ".gettemplate("loggedinuser")."\";");
1) This is already included as a feature in version 2.0 of vBulletin.
I know, who said it was for 2 it is for the version 1 series
Quote:
Originally posted by philliplewis
2) Private messaging is included as a hack now and as a standard feature in version 2.0
I know that to. instant messages is different. it allows you to click there status icon (Online or Offline) and a window pops up and you can send a message to them. When they visit the boards and have an unread instant message a popup box appears with the message. Read through this post for a demo
Quote:
Originally posted by philliplewis
But it does not show if they are online in the message board where the person made the message?