View Full Version : Mark Buddy on Who's Online? Page
TWTCommish
03-25-2002, 10:00 PM
Tiny hack: this sticks a little arrow in front of the username of anyone on the Who's Online? page who's on your buddy list. It's been workin' fine for me, so I expect it'll work for you, too. Enjoy. :)
TWTCommish
03-26-2002, 02:05 PM
Simple screenshot.
Admin
03-26-2002, 02:08 PM
Chris, instead of doing this:
if ($bbuserinfo[userid]) {
$buddies = $DB_site->query_first("SELECT buddylist FROM user WHERE userid = $bbuserinfo[userid]");
}
Then using $buddies['buddylist'], you can just use $bbuserinfo['buddylist']. :) It will empty for guests automatically.
Nice hack!
TWTCommish
03-26-2002, 02:11 PM
My bad; thanks for the tip. I should've known that would've been available. D'oh! :D
Lionel
03-26-2002, 03:51 PM
yes, nice hack!
Floris
03-26-2002, 04:11 PM
nice
nafae
03-26-2002, 06:55 PM
nice, works well
Lesane
03-26-2002, 07:23 PM
Very nice
Xanthine
03-26-2002, 07:48 PM
Nice little addition, thanks.
hidjra
03-28-2002, 10:12 AM
Nice job,
I used an image instead of an arrow
in the instructions change
$userinfo[username] = "? $userinfo[username]";
to
$userinfo[username] = "<img border=0 src=/forums/images/buddy_online.gif width=16 height=16 ALT=Buddy style=\"float: left\"> $userinfo[username]";
TWTCommish
03-28-2002, 12:13 PM
I knew someone would use an image. Very cool. :)
GK_ng
04-20-2002, 03:42 PM
thanks man, very nice hack !
Nevertheless I had the following Problem with this hack:
when adding Userid '11' to my Buddylist, it showed me (Userid '1') as my buddy as well. (might be because of the PHP-Version 4.06) :(
After Changing the whole thing to
$buddy_list = " ".$bbuserinfo[buddylist]." ";
$singlebuddy= " ".$userinfo[userid]." ";
if (stristr($buddy_list, $singlebuddy)) {
$userinfo[username] = "? $userinfo[username]";
}
it worked for me and showed only the users as buddy, that actually ARE my buddies.
PS: why is this php-code-box so huge in preview ? there's at least one line too much at the bottom, but i don't seem to be able get rid of it :(
Chris M
04-20-2002, 05:11 PM
Very Good hack...
I especially like the Image...
Satan
TWTCommish
04-20-2002, 07:11 PM
GK: hmmm, I'm not sure. It might have something to do with the PHP version, but I really don't know. I'm very glad you got it working, though. :)
inetd
04-20-2002, 08:34 PM
Good hack and picture! But when I use a picture it slightly moves down to the right. That is allocates not directly near a left edge, and hardly more to the right. How it to correct?
TWTCommish
04-20-2002, 08:40 PM
Originally posted by inetd
Good hack and picture! But when I use a picture it slightly moves down to the right. That is allocates not directly near a left edge, and hardly more to the right. How it to correct?
Can you post a screenshot? I'm having trouble understanding the problem...
inetd
04-20-2002, 09:42 PM
Screenshot.
And I Have other trouble. All user see image near Administrator nickname. How to correct this?
Chris M
04-20-2002, 09:51 PM
@TWT - I noticed today, that one of the people I didnt add to my Buddy List, had a Buddy Icon on Whos Online?
Any explanations?
Satan
inetd
04-20-2002, 09:54 PM
hellsatan, u admin in your board?
GK_ng
04-21-2002, 07:14 AM
Originally posted by inetd
All user see image near Administrator nickname. How to correct this? probably not all users, but those who have a buddy with a "1" in their userid (like 1234 or 5551).
try using the fix i posted instead.
Originally posted by hellsatan
@TWT - I noticed today, that one of the people I didnt add to my Buddy List, had a Buddy Icon on Whos Online?
Any explanations?Try using the fix I posted, it worked for me ;)
Originally posted by hellsatan
GK: hmmm, I'm not sure. It might have something to do with the PHP version, but I really don't know.@TWT: I now think it might have been the strpos - in your code, strpos returns TRUE/the position in some cases, which actually aren't buddies at all.
Examples are Userids 1 2 3 4 5 6 7 8 9 - all these are your buddies, once you add a user with a userid like 123456789 or 987654321 (just an example).
this is why i used stristri/strpos for "[space]1[space]" instead - this checks for the userid with a space in front and after the userid ... Of course, you have to add a space in front of and after the original buddylist, or else it wouldn't find the first and last buddy ....
hope this helps :smoke:
Chris M
04-21-2002, 11:31 AM
@inetd - Yes I am...Does that have an effect on it?
Satan
inetd
04-21-2002, 11:37 AM
satan, use fix in post #12 (https://vborg.vbsupport.ru/showthread.php?postid=242668#post242668). :)
Chris M
04-23-2002, 06:08 PM
Thanks inetd...
:tup:
We really need that smilie here...
I'll attach it...
@FireFly - This would be a good smilie to add...
:tup:
Satan
Xanthine
04-23-2002, 06:13 PM
You could just use https://vborg.vbsupport.ru/external/2011/01/19.gif
Chris M
04-23-2002, 06:26 PM
No...
:tup: is better!:)
Satan
inetd
04-24-2002, 08:57 PM
When i not logged to board, i see near other Guest gif from buddy... How fix?
TWTCommish
04-24-2002, 09:04 PM
I'm sorry, can you re-phrase that? I don't understand.
GK_ng
04-24-2002, 09:05 PM
Originally posted by inetd
When i not logged to board, i see near other Guest gif from buddy... How fix? instead of the code I use in post12, you could put another check into the if-clause, checking for an empty userid ...
$buddy_list = " ".$bbuserinfo[buddylist]." ";
$singlebuddy= " ".$userinfo[userid]." ";
if (stristr($buddy_list, $singlebuddy) and trim($singlebuddy!="")) {
$userinfo[username] = "? $userinfo[username]";
}
copy and paste over the old code, tell me if it works !
thx
inetd
04-24-2002, 09:15 PM
GK_ng, i paste this code nearly. but bug not fixed...
GK_ng
04-24-2002, 09:23 PM
Originally posted by inetd
GK_ng, i paste this code nearly. but bug not fixed... nearly ?
nearby oder almost ? what do you mean with nearly ?
anyway, if it doesn't work, place the check before the actual buddylist-check ... should look somewhat like this: if ($bbuserinfo[userid]!='0') {
$buddy_list = " ".$bbuserinfo[buddylist]." ";
$singlebuddy= " ".$userinfo[userid]." ";
if (stristr($buddy_list, $singlebuddy)) {
$userinfo[username] = "? $userinfo[username]";
}
}around the whole thing (you can take the one from post 12 again), since guest's don't even have a buddylist - so why should you check for it ...
inetd
04-25-2002, 06:03 PM
GK_ng, code from #30 good work! Thank you!
Dynamic One
11-05-2002, 10:10 AM
Thanks for this nice hack. Will use it right away :D.
Boofo
12-10-2002, 08:16 PM
Is this hack supposed to show me as my own buddy with a buddy icon when I am viewing the online.php? And, yes, I am the admin. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.