Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 10-25-2000 Last Update: Never Installs: 0
 
No support by the author.

Right I have added the templates and created a file called: online.php

But when accessing it dosen't display any users!

http://vboard.co.uk/board/online.php?action=onlineusers

Here is whole of Online.php:

<?PHP
require( "global.php" );
// ############################### start online users form ###############################
// #####
// ##### Online Users Modification
// #####
// ##### Matt Rogish
// ##### 7/5/00
// #####
// ##### Updated 8/29/00

if( $action == "onlineusers" ) {

$loggedins = $DB_site->query_first( "SELECT COUNT(sessionid) AS sessions FROM session" );
$totalonline = $loggedins[ sessions ];

$loggedins = $DB_site->query_first( "SELECT COUNT(sessionid) AS sessions FROM session WHERE userid = 0" );
$numberguest = $loggedins[ sessions ];

$loggedins = $DB_site->query_first( "SELECT COUNT(sessionid) AS sessions FROM session WHERE userid <> 0" );
$numberregistered = $loggedins[ sessions ];

$numVisible = 0;
$onlineNow = $DB_site->query( "SELECT s.userid, u.username, s.location FROM session s LEFT JOIN user u ON u.userid = s.userid WHERE s.userid <> 0 AND u.invisible = 0 ORDER BY u.username ASC" );


if( $online = $DB_site->fetch_array( $onlineNow ) ) {

$numVisible++;
$userid = $online[ userid ];
$username = $online[ username ];
$location = $online[ location ];

// Save our hyperlink
$locationLink = $location;

// Give us the .php file and path
$phpFile = strtok( $location, "?" );

// Give us the extra threadid=47565&pagenumber=2
$queryString = strtok( "?" );

if( empty( $queryString ) ) {

if( strpos( $location, "chat" ) ) {

$location = "$bbtitle Chat";

} else {

$location = "$bbtitle Main";

} // end if

} else {

// Give us the query (threadID, forumID, etc.)
$query = strtok( $queryString, "=" );

if( strcasecmp( $query, "action" ) == 0 ) {
// Then we are either newreply or getinfo, etc.
$query = strtok( "&" );

// Preserve the "newreply" or "editpost"
$mainQuery = $query;

// Get the "other" thing
$query = strtok( "=" );

} // end if

// Give us the number (potentially followed by other things)
$oldID = strtok( "=" );

// Clear out the ID
$id = "";

if( eregi( "[0-9]+", $oldID, $cleanIDArray ) ) {
for( $i = 0; $i <= count( $cleanIDArray ); $i++ ) {
$id .= $cleanIDArray[ $i ];
} // end for
} else {
// Nothing, so probably the main page
$location = "$bbtitle Main";
} // end if

if( empty( $id ) ) {
$id = 0;
} // end if

if( strcasecmp( $query, "threadid" ) == 0 ){

$threadTitle = $DB_site->query_first( "SELECT title, forumid FROM thread WHERE threadid=$id" );
$location = $threadTitle[ title ];
$forumid = $threadTitle[ forumid ];

$forumid = verifyid( "forum", $forumid );

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );
if( $getperms[ canview ] == 0 ) {
$location = "Moderators Only Thread";
$locationLink = "/board/";
} // end if

} else if( strcasecmp( $query, "forumid" ) == 0 and strcasecmp( $mainQuery, "newthread" ) != 0 ) {

$forumTitle = $DB_site->query_first( "SELECT title FROM forum WHERE forumid=$id" );
$location = $forumTitle[ title ];

} else if( strcasecmp( $query, "postid" ) == 0 and strcasecmp( $mainQuery, "editpost" ) != 0 ){
$getthreadid = $DB_site->query_first( "SELECT threadid FROM post WHERE postid=$id" );
$threadid = $getthreadid[ threadid ];

if( !empty( $threadid ) ) {

$threadTitle = $DB_site->query_first( "SELECT title, forumid FROM thread WHERE threadid=$threadid" );
$location = $threadTitle[ title ];
$forumid = $threadTitle[ forumid ];

$forumid = verifyid( "forum", $forumid );

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );
if( $getperms[ canview ] == 0 ) {
$location = "Moderators Only Thread";
$locationLink = "/board/";
} // end if

} else {

$location = "Unknown location!";

} // end if

} else if( strcasecmp( $mainQuery, "getinfo" ) == 0 ) {

$userResult = $DB_site->query_first( "SELECT username FROM user WHERE userid=$id" );
$userName = $userResult[ username ];

$location = "Get User Information For: $userName";

} else if( strcasecmp( $mainQuery, "newthread" ) == 0 ) {

$forumTitle = $DB_site->query_first( "SELECT title FROM forum WHERE forumid=$id" );
$forum = $forumTitle[ title ];

$location = "Creating new thread in $forum";

} else if( strpos( $phpFile, "private.php" ) ) {

$location = "Private Messaging";

} else if( strpos( $phpFile, "search.php" ) ) {

$location = "Searching";

} else if( strpos( $phpFile, "memberlist.php" ) ) {

$location = "Member Listing";

} else if( strcasecmp( $mainQuery, "editpost" ) == 0 ) {

$getthread = $DB_site->query_first( "SELECT threadid FROM post WHERE postid=$id" );
$threadid = $getthread[ threadid ];

if( !empty( $threadid ) ) {

$threadTitle = $DB_site->query_first( "SELECT title, forumid FROM thread WHERE threadid=$threadid" );
$thread = $threadTitle[ title ];
$forumid = $threadTitle[ forumid ];

$forumid = verifyid( "forum", $forumid );

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );
if( $getperms[ canview ] == 0 ) {
$thread = "Moderators Only Thread";
$locationLink = "/board/";
} // end if

} else {

$location = "Unknown location!";

} // end if

$location = "Editing post in $thread";

} else if( strcasecmp( $mainQuery, "onlineusers" ) == 0 ) {

$location = "Online Users Listing";

} else {

$location = "Unknown location!";

} // end if
} // end if

eval("\$whoisonlinebits .= \"" . gettemplate("whoisonlinebit") . "\";");

while( $online = $DB_site->fetch_array( $onlineNow ) ) {

$numVisible++;
$userid = $online[ userid ];
$username = $online[ username ];
$location = $online[ location ];

// Save our hyperlink
$locationLink = $location;

// Give us the .php file and path
$phpFile = strtok( $location, "?" );

// Give us the extra threadid=47565&pagenumber=2
$queryString = strtok( "?" );

if( empty( $queryString ) ) {

if( strpos( $location, "chat" ) ) {

$location = "$bbtitle Chat";

} else {

$location = "$bbtitle Main";

} // end if

} else {

// Give us the query (threadID, forumID, etc.)
$query = strtok( $queryString, "=" );

if( strcasecmp( $query, "action" ) == 0 ) {
// Then we are either newreply or getinfo, etc.
$query = strtok( "&" );

// Preserve the "newreply" or "editpost"
$mainQuery = $query;

// Get the "other" thing
$query = strtok( "=" );

} // end if

// Give us the number (potentially followed by other things)
$oldID = strtok( "=" );

// Clear out the ID
$id = "";

if( eregi( "[0-9]+", $oldID, $cleanIDArray ) ) {
for( $i = 0; $i <= count( $cleanIDArray ); $i++ ) {
$id .= $cleanIDArray[ $i ];
} // end for
} else {
// Nothing, so probably the main page
$location = "$bbtitle Main";
} // end if

if( empty( $id ) ) {
$id = 0;
} // end if

if( strcasecmp( $query, "threadid" ) == 0 ){

$threadTitle = $DB_site->query_first( "SELECT title, forumid FROM thread WHERE threadid=$id" );
$location = $threadTitle[ title ];
$forumid = $threadTitle[ forumid ];

$forumid = verifyid( "forum", $forumid );

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );
if( $getperms[ canview ] == 0 ) {
$location = "Moderators Only Thread";
$locationLink = "/board/";
} // end if

} else if( strcasecmp( $query, "forumid" ) == 0 and strcasecmp( $mainQuery, "newthread" ) != 0 ) {

$forumTitle = $DB_site->query_first( "SELECT title FROM forum WHERE forumid=$id" );
$location = $forumTitle[ title ];

} else if( strcasecmp( $query, "postid" ) == 0 and strcasecmp( $mainQuery, "editpost" ) != 0 ) {

$getthreadid = $DB_site->query_first( "SELECT threadid FROM post WHERE postid=$id" );
$threadid = $getthreadid[ threadid ];

if( !empty( $threadid ) ) {

$threadTitle = $DB_site->query_first( "SELECT title, forumid FROM thread WHERE threadid=$threadid" );
$location = $threadTitle[ title ];
$forumid = $threadTitle[ forumid ];

$forumid = verifyid( "forum", $forumid );

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );
if( $getperms[ canview ] == 0 ) {
$location = "Moderators Only Thread";
$locationLink = "/board/";
} // end if

} else {

$location = "Unknown location!";

} // end if

} else if( strcasecmp( $mainQuery, "getinfo" ) == 0 ) {

$userResult = $DB_site->query_first( "SELECT username FROM user WHERE userid=$id" );
$userName = $userResult[ username ];

$location = "Getting user information for $userName";

} else if( strcasecmp( $mainQuery, "newthread" ) == 0 ) {

$forumTitle = $DB_site->query_first( "SELECT title FROM forum WHERE forumid=$id" );
$forum = $forumTitle[ title ];

$location = "Creating new thread in $forum";

} else if( strpos( $phpFile, "private.php" ) ) {

$location = "Private Messaging";

} else if( strpos( $phpFile, "search.php" ) ) {

$location = "Searching";

} else if( strpos( $phpFile, "memberlist.php" ) ) {

$location = "Member Listing";

} else if( strcasecmp( $mainQuery, "editpost" ) == 0 ) {

$getthread = $DB_site->query_first( "SELECT threadid FROM post WHERE postid=$id" );
$threadid = $getthread[ threadid ];

if( !empty( $threadid ) ) {

$threadTitle = $DB_site->query_first( "SELECT title, forumid FROM thread WHERE threadid=$threadid" );
$thread = $threadTitle[ title ];
$forumid = $threadTitle[ forumid ];

$forumid = verifyid( "forum", $forumid );

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );
if( $getperms[ canview ] == 0 ) {
$thread = "Moderators Only Thread";
$locationLink = "/board/";
} // end if

} else {

$location = "Unknown location!";

} // end if

$location = "Editing post in $thread";

} else if( strcasecmp( $mainQuery, "onlineusers" ) == 0 ) {

$location = "Online Users Listing";

} else {

$location = "Unknown location!";

} // end if
} // end if

eval( "\$whoisonlinebits .= \"" . gettemplate( "whoisonlinebit" ) . "\";" );

} // end while
eval( "echo dovars(\"" . gettemplate( "whoisonline" ) . "\");" );
} // end if
} // end if
// #####
// ##### Online Users Modification
// #####
// ##### Matt Rogish
// ##### 7/5/00
// #####
// ##### Updated 8/29/00
// ############################### end online users form ###############################


Whats the problem?

Thanks

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-25-2000, 08:47 PM
Guest
 
Posts: n/a
Default

It is crappy code! I'm not certain what is wrong -- you installed the templates and they have the correct names, right? Because it looks like it's not evaulating the bits correctly. Either that or everyone who is online has their user prefs set to invisible.

In any rate I've been slowly working on OnlineUsers 2.0 but I'm only halfway done. It should be better. Faster. More reliable. We have the technology!
Reply With Quote
  #3  
Old 10-25-2000, 08:53 PM
Guest
 
Posts: n/a
Default

Hurry up and get it done as I have been contemplating doing it!
Reply With Quote
  #4  
Old 10-25-2000, 09:02 PM
Guest
 
Posts: n/a
Default

the one I used works fine
http://www.clubbers.ws/vb/index.php
just click the Who's Online link

do you want me to post the file?
Reply With Quote
  #5  
Old 10-25-2000, 09:29 PM
Guest
 
Posts: n/a
Default

It would be nice if we could make a modular system that would store the "String to display" in the session table so all future addons would automatically show up on the whos online, what are they doing page.
Reply With Quote
  #6  
Old 10-25-2000, 10:18 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by ukliam
the one I used works fine
http://www.clubbers.ws/vb/index.php
just click the Who's Online link

do you want me to post the file?
yeah that would help!
Reply With Quote
  #7  
Old 10-25-2000, 10:19 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by mrogish
It is crappy code! I'm not certain what is wrong -- you installed the templates and they have the correct names, right? Because it looks like it's not evaulating the bits correctly. Either that or everyone who is online has their user prefs set to invisible.

In any rate I've been slowly working on OnlineUsers 2.0 but I'm only halfway done. It should be better. Faster. More reliable. We have the technology!
No users are invisble!

I made two templates filled them in with the code as: whoisonline and whoisonlinebit
Reply With Quote
  #8  
Old 10-25-2000, 10:28 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by ukliam
the one I used works fine
http://www.clubbers.ws/vb/index.php
just click the Who's Online link

do you want me to post the file?
???????? Doesn't work.
Reply With Quote
  #9  
Old 10-25-2000, 10:31 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Shane
Quote:
Originally posted by ukliam
the one I used works fine
http://www.clubbers.ws/vb/index.php
just click the Who's Online link

do you want me to post the file?
???????? Doesn't work.

same here!
Reply With Quote
  #10  
Old 10-25-2000, 11:23 PM
Guest
 
Posts: n/a
Default

Works for me, what problem are you getting?
perhaps it is a problem with guests viewing it
Reply With Quote
Reply


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 11:46 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04362 seconds
  • Memory Usage 2,294KB
  • Queries Executed 23 (?)
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
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_wrapper
  • (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_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • 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
  • 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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete