LCN2007
10-16-2009, 02:39 PM
Im trying to modify some code, im hoping someone can help me.
I have this chunk of code that is set to populate a friends list with all (offline/online) members that are on your vbulletin friends list, but i would like to have it set to populate only online friends from can anyone help.
function getFriendsList($userid,$time) {
$sql = ("select ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." lastactivity, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." avatar, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link, friends_status.message, friends_status.status from ".TABLE_PREFIX."userlist join ".TABLE_PREFIX."user on ".TABLE_PREFIX."userlist.relationid = ".TABLE_PREFIX."user.userid left join friends_status on ".TABLE_PREFIX.DB_USERTABLE.".userid = friends_status.userid where ".TABLE_PREFIX."userlist.friend = 'yes' and ".TABLE_PREFIX."userlist.userid = '".mysql_real_escape_string($userid)."' order by username asc");
return $sql;
}
I have this chunk of code that is set to populate a friends list with all (offline/online) members that are on your vbulletin friends list, but i would like to have it set to populate only online friends from can anyone help.
function getFriendsList($userid,$time) {
$sql = ("select ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." lastactivity, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." avatar, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link, friends_status.message, friends_status.status from ".TABLE_PREFIX."userlist join ".TABLE_PREFIX."user on ".TABLE_PREFIX."userlist.relationid = ".TABLE_PREFIX."user.userid left join friends_status on ".TABLE_PREFIX.DB_USERTABLE.".userid = friends_status.userid where ".TABLE_PREFIX."userlist.friend = 'yes' and ".TABLE_PREFIX."userlist.userid = '".mysql_real_escape_string($userid)."' order by username asc");
return $sql;
}