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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-07-2001, 05:09 PM
Robouk
Guest
 
Posts: n/a
Default

How can i edit this so that the names are linked to the uers profile?
Thanks alot for any help



PHP Code:
<?
//...........Who's Online v0.0.2...........\\
//......by Kevin (kevin@tubescan.com)......\\

// For vBulletin version 2, beta 3
// (c) 2001 Jelsoft Enterprises, Ltd.

// vbulletin.com thread: [url]http://www.vbulletin.com/forum/showthread.php?threadid=12010[/url]

///////////// CHANGE LOG /////////////
//
// New in version 0.0.2
// -- Option to display either usernames or just a number of registered members online
//
// New in version 0.0.1
// -- Released! :)
//
/////////// END CHANGE LOG ///////////

//////// CONFIG EXPLANATION //////////
//
// There are only two config options in this script.
// First is whether or not you want usernames displayed for registered members who are on the board. If you opt to not display
// usernames, it will simply display the number of members. Guests are unaffected by this. If you want usernames displayed, set
// $usernames to "on" in the CONFIG section below. If you want a simple number, set it to "off".
// The second is the path to config.php (in the /admin directory of your forums). It MUST NOT include a leading *or* trailing slash.
// So, for example: Your config.php is in
// /home/mysite/public_html/board/admin/
// and you are putting this file into
// /home/mysite/public_html/directory/
// So your path is
// /home/mysite/public_html/board/admin
// Make sure you set this correctly. You can refer to the General Options in your Admin Control Panel if you need a refresher on
// your path.
//
////// END CONFIG EXPLANATION ////////

/////////////// CONFIG ///////////////
//
$usernames = "on"; // if you would like it to display the names of registered members who are on, leave this set to "on".
                   // if you want just a number of members, change it to "off".
$path = "/home/httpd/html/tutorialforums.com/admin"; // set the path to your admin directory. see above for info about this.
//
///////////// END CONFIG /////////////

require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);

$cookievalue = mysql_query("SELECT value FROM setting WHERE varname = 'cookietimeout'") or die("oops1");
$cookietimeout = mysql_result($cookievalue, 0, 0);
$datecut = time()-$cookietimeout;

$invisibleregmember = "0";

if ($usernames == "on") {
    $regmembers = mysql_query("SELECT DISTINCT username,invisible FROM user,session WHERE session.userid=user.userid AND session.lastactivity>$datecut AND invisible='0' ORDER BY username ASC") or die("oops2");
    while($regmember = mysql_fetch_array($regmembers)):
        ++$regmembercomma;
        if ($regmember[invisible] == 0) {
            $regmemberson .= $regmember[username];
        } else {
            ++$regmembercomma;
        }
        if ($regmembercomma < mysql_num_rows($regmembers)):
            $regmemberson .= ", ";
        endif;
    endwhile;
} else {
    $regmembers = mysql_query("SELECT DISTINCT COUNT(userid) AS membersonline FROM session WHERE userid>0 AND session.lastactivity>$datecut") or die("oops2");
    while($members = mysql_fetch_array($regmembers)) {
        $regmemberson = number_format($members[membersonline]);
    }
}

$guests = mysql_query("SELECT COUNT(userid) AS guestsonline FROM session WHERE userid=0 AND session.lastactivity>$datecut") or die("oops3");
while($guest = mysql_fetch_array($guests)):
    $guestson = number_format($guest[guestsonline]);
endwhile;

echo("Members Currently on tutorialforums.com : $regmemberson. and $guestson Guests.");
?>
Reply With Quote
  #2  
Old 09-07-2001, 05:22 PM
Jakeman's Avatar
Jakeman Jakeman is offline
 
Join Date: Nov 2001
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the whois online feature that is built into the latest version of vbulletin already has that functionality.
Reply With Quote
  #3  
Old 09-07-2001, 05:40 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace
PHP Code:
        if ($regmember[invisible] == 0) {
            
$regmemberson .= $regmember[username]; 
with
PHP Code:
        if ($regmember[invisible] == 0) {
            
$regmemberson .= "<a href=\"path/to/forums/member.php?action=getinfo&username=$regmember[username]\">$regmember[username]</a>"
I think that should work.
(don't forget to fix the url)

jake, this is an external script to display the online users on a non-vb page.
Reply With Quote
  #4  
Old 09-07-2001, 05:57 PM
Robouk
Guest
 
Posts: n/a
Default

Yes but his is the hack allowing you to put it onto a NON vbulletin page...... you misunderstood me
Reply With Quote
  #5  
Old 09-07-2001, 05:58 PM
Robouk
Guest
 
Posts: n/a
Default

thanks firefly, ill gie it a try
Reply With Quote
  #6  
Old 09-07-2001, 06:09 PM
Robouk
Guest
 
Posts: n/a
Default

No luck, it appeared to have no difference, here is a link:
http://www.tutorialforums.com/robouk.php

Thanks
Reply With Quote
  #7  
Old 09-07-2001, 06:13 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Umm, it works for me.
I sent you the path to the file (on my local computer).

This is my file:
PHP Code:
<?
//...........Who's Online v0.0.2...........\
//......by Kevin (kevin@tubescan.com)......\

// For vBulletin version 2, beta 3
// (c) 2001 Jelsoft Enterprises, Ltd.

// vbulletin.com thread: <a href="http://www.vbulletin.com/forum/showthread.php?threadid=12010" target="_blank">[url]http://www.vbulletin.com/forum/show...?threadid=12010[/url]</a>

///////////// CHANGE LOG /////////////
//
// New in version 0.0.2
// -- Option to display either usernames or just a number of registered members online
//
// New in version 0.0.1
// -- Released! <img src="images/smilies/smile.gif" border="0" alt="">
//
/////////// END CHANGE LOG ///////////

//////// CONFIG EXPLANATION //////////
//
// There are only two config options in this script.
// First is whether or not you want usernames displayed for registered members who are on the board. If you opt to not display
// usernames, it will simply display the number of members. Guests are unaffected by this. If you want usernames displayed, set
// $usernames to "on" in the CONFIG section below. If you want a simple number, set it to "off".
// The second is the path to config.php (in the /admin directory of your forums). It MUST NOT include a leading *or* trailing slash.
// So, for example: Your config.php is in
// /home/mysite/public_html/board/admin/
// and you are putting this file into
// /home/mysite/public_html/directory/
// So your path is
// /home/mysite/public_html/board/admin
// Make sure you set this correctly. You can refer to the General Options in your Admin Control Panel if you need a refresher on
// your path.
//
////// END CONFIG EXPLANATION ////////

/////////////// CONFIG ///////////////
//
$usernames = "on"; // if you would like it to display the names of registered members who are on, leave this set to "on".
                   // if you want just a number of members, change it to "off".
$path = "admin"; // set the path to your admin directory. see above for info about this.
//
///////////// END CONFIG /////////////

require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);

$cookievalue = mysql_query("SELECT value FROM setting WHERE varname = 'cookietimeout'") or die("oops1");
$cookietimeout = mysql_result($cookievalue, 0, 0);
$datecut = time()-$cookietimeout;

$invisibleregmember = "0";

if ($usernames == "on") {
    $regmembers = mysql_query("SELECT DISTINCT username,invisible FROM user,session WHERE session.userid=user.userid AND session.lastactivity>$datecut AND invisible='0' ORDER BY username ASC") or die("oops2");
    while($regmember = mysql_fetch_array($regmembers)):
        ++$regmembercomma;
        if ($regmember[invisible] == 0) {
            $regmemberson .= "<a href=\"path/to/forums/member.php?action=getinfo&username=$regmember[username]\">$regmember[username]</a>";
        } else {
            ++$regmembercomma;
        }
        if ($regmembercomma < mysql_num_rows($regmembers)):
            $regmemberson .= ", ";
        endif;
    endwhile;
} else {
    $regmembers = mysql_query("SELECT DISTINCT COUNT(userid) AS membersonline FROM session WHERE userid>0 AND session.lastactivity>$datecut") or die("oops2");
    while($members = mysql_fetch_array($regmembers)) {
        $regmemberson = number_format($members[membersonline]);
    }
}

$guests = mysql_query("SELECT COUNT(userid) AS guestsonline FROM session WHERE userid=0 AND session.lastactivity>$datecut") or die("oops3");
while($guest = mysql_fetch_array($guests)):
    $guestson = number_format($guest[guestsonline]);
endwhile;

echo("Members Currently on tutorialforums.com : $regmemberson. and $guestson Guests.");
?>
Reply With Quote
  #8  
Old 09-07-2001, 06:16 PM
Robouk
Guest
 
Posts: n/a
Default

Thank you very much, works great.
tubedogg, you should update your hack
Reply With Quote
  #9  
Old 09-07-2001, 06:17 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem.
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 02:38 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.05828 seconds
  • Memory Usage 2,266KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (4)postbit_onlinestatus
  • (9)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_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
  • 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
  • postbit_imicons
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete