The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Where do I put this HOOK location so it works
I'm using this Side Bar modification and that is where I want the data to be shown. I used to have Ultimate Side Columns and it worked on there but i've forgotten what hook location to use.
This is my code I'm using which shows only the current staff members who are actively on my forum. But I don't know where the hook should be called from. Code:
// @@@@@@@ Lets See who is on @@@@@@@ $datecut = TIMENOW - $vbulletin->options['cookietimeout']; $ForumUsers = $db->query_read(" SELECT user.username, session.userid, user.usergroupid FROM " . TABLE_PREFIX . "session AS session LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid) WHERE user.usergroupid IN ($group) and session.lastactivity > $datecut ORDER BY user.username ASC "); $StaffOnline = "<!-- Staff Online --> <div>"; if ( $db->num_rows( $ForumUsers ) ) { $AddedStaff = array(); while ( $LoopUser = $db->fetch_array( $ForumUsers ) ) // Loop through current users { if ( !in_array( $LoopUser['userid'], $AddedStaff ) ) { // Get Username with HTML markup $LoopUser['musername'] = fetch_musername( $LoopUser ); $StaffOnline .= "<div><a href='member.php?u=".$LoopUser['userid']."'>".$LoopUser['musername']."</a></div>"; $AddedStaff[] = $LoopUser['userid']; } // End if in_array() } // End While } // End if we have rows // Check to see if there was staff and if not show message if config to do so. if ( count( $AddedStaff ) == 0 OR !isset( $AddedStaff ) ) { if ( $ShowNoStaffNotice ) { $StaffOnline .= "<div>No Staff Currently Browsing the Forums.</div>"; } } $StaffOnline .= "</div> <!-- End Staff Online -->"; --------------- Added [DATE]1232041991[/DATE] at [TIME]1232041991[/TIME] --------------- I get this error when: Product is: Right Side Column Hook Location is: global_start Obviously that is wrong lol Code:
Database error in vBulletin 3.8.0: Invalid SQL: SELECT user.username, session.userid, user.usergroupid FROM session AS session LEFT JOIN user AS user ON(user.userid = session.userid) WHERE user.usergroupid IN () and session.lastactivity > 1232041543 ORDER BY user.username ASC; MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and session.lastactivity > 1232041543 ORDER BY user.username ASC' at line 4 Error Number : 1064 Request Date : Thursday, January 15th 2009 @ 05:50:43 PM Error Date : Thursday, January 15th 2009 @ 05:50:43 PM Script : http://www.myfootballforum.com/index.php Referrer : http://www.myfootballforum.com/index.php IP Address : 86.22.39.14 Username : boro_boy Classname : vB_Database MySQL Version : 5.0.27 |
#2
|
||||
|
||||
Quote:
PHP Code:
|
#3
|
|||
|
|||
Problem seems to be with your SQL queries and not where your plugin is located.
As Lynne pointed out you call $group but it doesn't seem to be defined anyways, I doubt it was stored globally, but I'm not sure. |
#4
|
|||
|
|||
Quote:
Quote:
It worked when i put it on the Ultimate Site Columns, but doesn' work now. Hmm, i'm a begineerin with the ocde stuff, don't know anything lol. I might just have to remove it all. The only think is its usefull if the staff who are online are shown, but i guess they can be shown and are show in the whos online bit. |
#5
|
|||
|
|||
Where did you get it from than
Ask the maker of the code to ask why he did what. |
#6
|
||||
|
||||
This is just a WOL except showing staff only (well meant to, anyway). As you have said, the WOL could possibly be "moulded" to do what you want.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|