The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
![]()
I think that method will query the database for each user on the page.
Try this ; Create a plugin using the "online_query" hook - with this in it ; Code:
$hook_query_fields .= ' , userfield.* '; |
#12
|
|||
|
|||
![]() Quote:
Paul - can't get yours to work, but this is not helped by me not understanding your method exactly! One thing is I can't enter the single quotes you use (around field6). And it seems to only affect the WOL page, which just returns a database error. Any advances? |
#13
|
||||
|
||||
![]()
Please note that do not use ' (single quote) in templates.
|
#14
|
|||
|
|||
![]()
Indeed not.
I suspect the solution is to add a bit to the query in index.php, but I'm not having much luck so far. |
#15
|
|||
|
|||
![]() Quote:
In your template you should then use $userinfo[field6] |
#16
|
|||
|
|||
![]() Quote:
Furthermore, the WOL page (online.php, which we are not trying to modify) shows: Code:
Database error in vBulletin 3.6.8: Invalid SQL: SELECT user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.host, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo, user.skype, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid , userfield.* FROM session AS session LEFT JOIN user AS user USING (userid) WHERE session.lastactivity > 1191867322 ORDER BY user.username asc; MySQL Error : Unknown table 'userfield' Error Number : 1051 Date : Monday, October 8th 2007 @ 07:30:22 PM Script : http://localhost/forum/online.php Referrer : http://localhost/forum/index.php IP Address : 127.0.0.1 Username : Pottsy Classname : vB_Database I now have this working, but it would be great if an SQL person could check my code for me. In index.php, there is the query in "logged in users" that pulls the stuff up for WGO. I have added the stuff in red: Code:
$forumusers = $db->query_read_slave(" SELECT user.username, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid, session.userid, session.inforum, session.lastactivity, userfield.field6, userfield.userid, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid FROM " . TABLE_PREFIX . "session AS session LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid) LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(user.userid = userfield.userid) WHERE session.lastactivity > $datecut I have also added the line in red just below: Code:
'invisible' =>& $vbulletin->userinfo['invisible'], 'field6' =>& $vbulletin->userinfo['field6'], And I can now use $loggedin[field6] in forumhome_loggedinuser. I know this is poor because it modifies php, but in the absence of a hook in that query I can't see another way. |
#17
|
|||
|
|||
![]()
Request a hook location at vb.com
![]() |
#18
|
|||
|
|||
![]()
As I see it, it would require three...
|
#19
|
|||
|
|||
![]()
request 3 then.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|