Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-15-2009, 03:48 PM
mcyates mcyates is offline
 
Join Date: Jan 2003
Location: Middlesbrough, Cleveland
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 -->";
Thank In advance for any help.

--------------- 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
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:08 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08192 seconds
  • Memory Usage 2,403KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete