vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Members who have visited today (with last 24 hours option). (https://vborg.vbsupport.ru/showthread.php?t=71533)

cclaerhout 01-03-2005 11:38 PM

Quote:

Originally Posted by funkmeister
Doh, yes indeed - that was it :)

Thanks.

Do i have to change the value "$cutoff = $now - 86400 " if my forum's default time is GMT+1 ? Because at midnight, the number of users who have visited the forum doesn't init.

Great hacks anyway thanks :-)

Paul M 01-03-2005 11:47 PM

Quote:

Originally Posted by cclaerhout
Do i have to change the value "$cutoff = $now - 86400 " if my forum's default time is GMT+1 ? Because at midnight, the number of users who have visited the forum doesn't init.

Great hacks anyway thanks :-)

That piece of code will give a rolling count for the previous 24 hours and is commented out (unless you have removed the "//"). It is only there as a backup because the vbdate function was not working on some systems - allthough some people are using it by default because this is what they want to do.

cclaerhout 01-04-2005 06:57 AM

Quote:

Originally Posted by Paul M
That piece of code will give a rolling count for the previous 24 hours and is commented out (unless you have removed the "//"). It is only there as a backup because the vbdate function was not working on some systems - allthough some people are using it by default because this is what they want to do.

Thanks for this explanation. I'm using Vb 3.04 and i was forced to remove the // before the code ; Otherwise all users were listed. So, if i well understand, now this hacks is "Who connected last 24 hours" :)

Paul M 01-04-2005 09:42 AM

Quote:

Originally Posted by cclaerhout
So, if i well understand, now this hacks is "Who connected last 24 hours" :)

Yep, that is how yours will be working.

Kylie 01-04-2005 10:45 AM

Thanks Paul works well, I've used some other versions but this is the easiest to see. I like the time "alt"

colcas 01-08-2005 02:37 AM

hi Paul great mod,

I have had it running perfect up to last night - I did the 3.0.5 upgrade and it doesn't show who's been on line today, just a blank box no entries

I'm new to v-bulletin - do you have any ideas what might need to be changed to get it working again

thanks in advance

Paul M 01-08-2005 10:23 AM

Quote:

Originally Posted by colcas
hi Paul great mod,

I have had it running perfect up to last night - I did the 3.0.5 upgrade and it doesn't show who's been on line today, just a blank box no entries

I'm new to v-bulletin - do you have any ideas what might need to be changed to get it working again

thanks in advance

Have you re-done the files changes after you upgraded ?

btw - you are not showing as having installed this - please click install.

colcas 01-08-2005 10:14 PM

Sorry Paul - I must have forgot to click 'Install'

I checked the new 'index.php' file and it didn't seem to have the

line
// ### LOGGED IN USERS #########################################

This is where I got stuck - it had that line in my 3.0.3 version index.php but doesn't seem to have it in the new 3.0.5 version

the code for the forum home template is in and shows the box for the users who visited today

but as I don't know where to mod the index.php file as it doesn't have the 'LOGGED IN USERS line

hope this clarifies it a bit

Cheers

Paul M 01-09-2005 12:00 AM

Quote:

Originally Posted by colcas
Sorry Paul - I must have forgot to click 'Install'

I checked the new 'index.php' file and it didn't seem to have the

line
// ### LOGGED IN USERS #########################################

This is where I got stuck - it had that line in my 3.0.3 version index.php but doesn't seem to have it in the new 3.0.5 version

Well my index.php (3.0.5) has it, at line 274. :) - Just do a text search for "LOGGED IN".

Mosaicvb 01-09-2005 05:49 AM

I just installed this mod with vb 3.0.5 and it works great. I made some changes and I am posting what I did if you want to have an option that does not require altering the index.php.

1 : create a php file called whos.online.today.php with the following and upload to the root of the forum. :

PHP Code:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

$now TIMENOW ;
require_once(
'./includes/functions_misc.php');
$cutoff vbmktime(000vbdate('m'$nowfalsefalse), vbdate('d'$nowfalsefalse), vbdate('Y'$nowfalsefalse));
//$cutoff = $now - 86400 ;  // Uncomment this line if you don't have vB 3.0.3 and all users are showing.
$todaysusers $DB_site->query("SELECT userid, lastactivity, options, username, opentag, closetag
FROM " 
TABLE_PREFIX "user as user
LEFT JOIN " 
TABLE_PREFIX "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastactivity > " 
.$cutoff" ORDER BY username" ); 

$totaltoday 0;
while (
$today $DB_site->fetch_array($todaysusers))
{
    
$today[visible] = ;
    
$totaltoday += 1;
    if (
$today[options] & $_USEROPTIONS[invisible]) 
    {
        
$today[visible] = ;
        if ((
$permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
        {
            
$today[visible] = ;
        }
    }
    if (
$today[visible]) 
    {
           
$wrdate vbdate($vboptions['timeformat'], $today['lastactivity']);
        
$whotoday .= "<a href='member.php?u=$today[userid]' title='$wrdate' >";
        if (
$today[visible] == 2
        {
            
$whotoday .= $today['opentag'].$today[username].$today['closetag']."</a>*, ";
        }
        else 
        {
            
$whotoday .= $today['opentag'].$today[username].$today['closetag']."</a>, ";
        }
    }
}
if (
$whotoday)
{
    
$whotoday substr($whotoday0strlen($whotoday)-2);
}

?>


2: Go to the style manager. Open the style you want to edit.
In the common template section goto the phpinclude_start box and enter :

Code:

ob_start();
include('whos.online.today.php');
ob_end_clean();


3: Follow your instructions for replacing the code in the Forumhome template.

Done.

Works like a charm for me. Thanks for your work. I hope I don't offend you by posting what I did.

I would like to know since I dont play in vB a lot whether anything I did would open a security hole.


All times are GMT. The time now is 02:59 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.01424 seconds
  • Memory Usage 1,772KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete