PDA

View Full Version : Tooltips for the 'users online' area of forum home


BenSkiddle
01-10-2006, 05:08 PM
Hi
I have worked out a way of getting tooltips with photos working for each member in the 'users currently online' section but could do with a hand putting this into a plugin if possible?


I've used the online.php file to test it out, and I've worked out the following:

The query fetching online members needs to change. For example mine is now (line 185):

$allusers = $db->query_read("
SELECT user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.host, user.profilepicrevision, FLOOR((YEAR(NOW()) - YEAR(birthday_search) - (DAYOFYEAR(birthday_search) - DAYOFYEAR(NOW())) / 365)) as age, postcodes.posttown, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "session AS session
". iif($vbulletin->options['WOLguests'], " LEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid) ", ", " . TABLE_PREFIX . "user AS user") ."
LEFT JOIN vb3_userfield ON user.userid=vb3_userfield.userid
LEFT JOIN postcodes ON TRIM(UCASE(substring(REPLACE(field10,' ',''),1,length(REPLACE(field10,' ',''))-3 ))) = postcodes.postcode
WHERE session.lastactivity > $datecut
". iif(!$vbulletin->options['WOLguests'], " AND session.userid = user.userid", "") ."
ORDER BY $sqlsort $sortorder
");



As you can see this pulls back a lot more info about the user so we can show this on their tooltip.

Then in the 'whosonlinebit' template I add the following to the user's name link:

onMouseOver="sktt('$userinfo[musername]','$userinfo[userid]','$userinfo[profilepicrevision]','$userinfo[age]','$userinfo[posttown]','true','false')" onMouseOut='htm()'


Now ideally I'd like to:

*Not alter the online.php file if possible and just use plugins
*Call a function to return the onMouseover string, something like: $usertooltipstr = getUserTT($user) (this returns the onMouseover attributes)
*Make it work with the 'whos online' in the main forum homepage

any help would be appreciated. I'm a competent coder but not too sure about the new Plugin system!!!