The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Trying to change some friends list code.
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. HTML Code:
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; } |
#2
|
||||
|
||||
And what are you getting as a result of that code? You didn't tell us what was wrong.
Also, I have watch Sir Adrian write queries many times before and one thing I have learned from watching him is that seeing what is wrong with your query is sooooo much easier if you write it out using multiple lines: PHP Code:
I'm not a query person, so I'm not gonna tear it apart to see what is wrong (especially since you never said what was wrong with it), but I did see that youare calling the avatar field from the user table and there is no avatar field in the user table. |
#3
|
|||
|
|||
Nothing is wrong per say i did state what i was looking for help with though.
the code i posted above queries the vb friends list and populates it on a list, this includes on and off line users. If if the user is online a little button or light turns on satting that they are online. I would like to modify the code to show only online users that are on my friends list. Sorry i cannot post a picture of the problem because there is not one, im just looking for help to change the code i have. --------------- Added [DATE]1255787424[/DATE] at [TIME]1255787424[/TIME] --------------- Does anyone know how to make this query? |
#4
|
|||
|
|||
No one?
Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|