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 the forum (Today or last 24 hours). (https://vborg.vbsupport.ru/showthread.php?t=82769)

Paul M 08-25-2005 04:58 PM

Quote:

Originally Posted by Xplorer4x4
The term used for method 2 where it does not reset is called "dynamic" I believe.

As far as the other part, meh forget it, not important.

Now I have problem however. I want to make this dynamic(method 2/Does not reset) so i edited his variable out of the plug in:
PHP Code:

 //$cutoff = TIMENOW - 86400 ;  // ## Uncomment this line if you want a rolling 24 hours display ## // 

And it still reset at midnight. Suggestions?

When you say you edited it out, what do you mean exactly ? All you should do to it is uncomment it, i.e. remove the two slashes at the start, not the whole line.

Paul M 08-25-2005 05:00 PM

Quote:

Originally Posted by evesve
No suggestions?

Nope - there is no easy way to sort it like that.

Xplorer4x4 08-25-2005 05:04 PM

Quote:

Originally Posted by Paul M
When you say you edited it out, what do you mean exactly ? All you should do to it is uncomment it, i.e. remove the two slashes at the start, not the whole line.

Ohhhhhhhh no wonder it didn't work. :o

Thanks Paul. Goes to UNCOMMENT. :-p

-X

Xplorer4x4 08-26-2005 04:30 AM

Ok I uncomented the line like you said. I removed the 2 slahses at the begining of the line. It STILL reset.

Any more ideas?

-X

Paul M 08-26-2005 07:04 AM

Post the first 10 lines of the hack [from your index.php] so I can see what you have actually done.

JoyB 08-29-2005 08:07 AM

Hi Paul,

This hack was very easy and quick to install and works a treat! Thank you :)

Xplorer4x4 08-29-2005 09:09 AM

Quote:

Originally Posted by Paul M
Post the first 10 lines of the hack [from your index.php] so I can see what you have actually done.

I am confused as to exactly what you want? If you mean the first 10 lines of the hack istelf:
PHP Code:

// ############### Paul M - Who has visited today v3.31 #################
$tnow date('YmdHis',TIMENOW $vbulletin->options['hourdiff']); 
$cutoff TIMENOW - (substr($tnow,8,2)*3600 substr($tnow,10,2)*60 substr($tnow,12,2)); 
$cutoff TIMENOW 86400 // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers $vbulletin->db->query_read("
SELECT userid, lastactivity, options, username, user.usergroupid, displaygroupid, 
groupa.opentag as opentaga, groupa.closetag as closetaga, groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " 
TABLE_PREFIX "user as user
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupa ON(user.usergroupid = groupa.usergroupid) 


Paul M 08-29-2005 10:08 AM

Quote:

Originally Posted by Xplorer4x4
I am confused as to exactly what you want? If you mean the first 10 lines of the hack istelf:
PHP Code:

// ############### Paul M - Who has visited today v3.31 #################
$tnow date('YmdHis',TIMENOW $vbulletin->options['hourdiff']); 
$cutoff TIMENOW - (substr($tnow,8,2)*3600 substr($tnow,10,2)*60 substr($tnow,12,2)); 
$cutoff TIMENOW 86400 // ## Uncomment this line if you want a rolling 24 hours display ## // 


Yep, that's what I wanted to see. There is nothing wrong with it, and there is no way that can reset at midnight. It will display a rolling 24 hours.

Xplorer4x4 08-29-2005 06:19 PM

Quote:

Originally Posted by Paul M
Yep, that's what I wanted to see. There is nothing wrong with it, and there is no way that can reset at midnight. It will display a rolling 24 hours.

I wish that was the case. :( As I said it is resetting at midnight.I tried your method for 2 nights and it didn;t work so i had tried doing some edits. I have this code here installed, so let me give it a shot again tonight. It is possible I made a mistake the last time, but I really don't see how.

Paul M 08-29-2005 06:41 PM

Are you sure you haven't put the code in twice or something (or installed the plugin more than once) ?

The last line in what you posted is "$cutoff = TIMENOW - 86400" which quite simply is the current time - 86400 seconds (24 hours). There is simply no way it can do anything else.

BamaStangGuy 08-30-2005 08:05 AM

I seem to be having a problem...

If I am logged in as an admin I see 6 people have visited today...

If I log out and view it as a guest... just 3 people have visited today...

What is going on here?

I have reuploaded the xmp file and recopied the template code and it still does it. Regular members also see 3 people, while I see 6

JoyB 08-30-2005 08:11 AM

Perhaps the other three members are in invisible mode which would explain why you can't see them if you've viewing as a guest? :)

Xplorer4x4 08-30-2005 10:40 AM

Quote:

Originally Posted by Paul M
Are you sure you haven't put the code in twice or something (or installed the plugin more than once) ?

The last line in what you posted is "$cutoff = TIMENOW - 86400" which quite simply is the current time - 86400 seconds (24 hours). There is simply no way it can do anything else.

I really couldn;t tell you exactly where the problem lied, all I knwo is that I deleted the plug in. I reinstalled it. I uncomented the // variables and it apears to be working just fine now.

And to the post baove, when you are logged in as an admin, check to see if the names that are disapearing have an * next to them.

Paul M 08-30-2005 03:12 PM

Quote:

Originally Posted by BrentWilson
I seem to be having a problem...

If I am logged in as an admin I see 6 people have visited today...

If I log out and view it as a guest... just 3 people have visited today...

What is going on here?

I have reuploaded the xmp file and recopied the template code and it still does it. Regular members also see 3 people, while I see 6

Are you referriing to actual people listed (in which case see the posts above) or the actual count shown (in which case you have different timezone settings to the others).

BamaStangGuy 08-30-2005 04:19 PM

Ok it was timezones :)

Sorry its a new board and I was the first user. I guess I was the only one stuck on GMT and then I changed it to GMT -6 after that but didnt catch my own profile

haha oops

Anette 08-31-2005 02:12 PM

Quote:

Originally Posted by hellsatan
Installed and working fine :)

Jupp work just fine!

sajjid 09-01-2005 08:17 PM

it is very nice hack i have installed but one thing i think would look better is where it says total users visted today the bottom maybe it would be better suited if changed to total members visited today, because if you think lot more guests visit therefore that cannot be totol users.
if its ok with you paul i have edited the forumhome template.

Paul M 09-01-2005 08:45 PM

You can edit the text to what you like. :)

ryuuchida 09-02-2005 11:41 AM

Thanks very much for this hack. Couldn't get easier than this to install. :)

GoNz00 09-04-2005 01:27 PM

installed and working great thanks.

1 question..

is there anything i can change in the code to make the box collapsed as default ?

thanks :)

Andreas 09-04-2005 04:47 PM

Code optimization (?) suggest:

forumhome_complete
PHP Code:

// ############### Paul M - Who has visited today v3.31 #################
$vbulletin->templatecache['forumhome_loggedinuser'] = str_replace('href=''title=\"$wrdate\" href='$vbulletin->templatecache['forumhome_loggedinuser']);
$tnow date('YmdHis',TIMENOW $vbulletin->options['hourdiff']); 
$cutoff TIMENOW - (substr($tnow,8,2)*3600 substr($tnow,10,2)*60 substr($tnow,12,2)); 
//$cutoff = TIMENOW - 86400 ;  // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers $vbulletin->db->query_read("
    SELECT userid, usergroupid, membergroupids, lastactivity, options, username FROM " 
TABLE_PREFIX "user
    WHERE lastactivity > 
$cutoff ORDER BY username
"
); 

$totaltoday 0;
while (
$loggedin $vbulletin->db->fetch_array($todaysusers))
{
    
$totaltoday++;

    if (
fetch_online_status($loggedin))
    {
        
$loggedin['musername'] = fetch_musername($loggedin);
        
$wrdate vbdate($vbulletin->options['timeformat'], $loggedin['lastactivity']);
        eval(
'$whotoday .= ", ' fetch_template('forumhome_loggedinuser') . '";');
    }
}
unset(
$loggedin);
$whotoday substr($whotoday2); 
$db->free_result($todayusers);
// ############# End of Who has visited today ############### 


BamaStangGuy 09-04-2005 05:19 PM

Why change from start to complete?

When I use that code it still shows the number of people that vistsed today correctly, but it only lists me by username and no one else.

Ex. Total Users Visited Today: 121

and I am the only one listed, no one else.

Andreas 09-04-2005 05:21 PM

PHP Code:

$vbulletin->templatecache['forumhome_loggedinuser'] = str_replace('href=''title=\"$wrdate\" href='$vbulletin->templatecache['forumhome_loggedinuser']); 

That's the Reason.

BamaStangGuy 09-04-2005 05:22 PM

Quote:

Originally Posted by KirbyDE
PHP Code:

$vbulletin->templatecache['forumhome_loggedinuser'] = str_replace('href=''title=\"$wrdate\" href='$vbulletin->templatecache['forumhome_loggedinuser']); 

That's the Reason.

Edited my post with feedback on the change

evesve 09-04-2005 06:00 PM

Quote:

Originally Posted by evesve
Is there a code so I can get the visitor in order:
Administrators(6), Moderators(7), Special members(9) and than the others?

I?ll try again....

I change the code in the plugin to:
Code:

FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE lastactivity > " .$cutoff. " ORDER BY usergroupid, username
");

now I see the users order by usergroups.
There must be an easy way to set the usergroups in order 6,7,9,2,1
??????????????

Paul M 09-04-2005 09:08 PM

Quote:

Originally Posted by KirbyDE
Code optimization (?) suggest:

forumhome_complete

What you have to remember is that my hacks are written for Cable Forum and released here afterwards simply to share them - they run the way they do mostly for specific reasons - and this runs on forumhome_start for a reason. :)

I guess it also depends on what you mean by 'optimization' - using those functions may reduce the code in the hack slightly, but the functions themselves have a lot of code in them, much of which is not necessary to this hack. It is also generic code I use elsewhere, and would require me to load things like functions_bigthree.php.

So, while I thank you for your suggestion - I don't intend to make any changes atm - but I will look at it to see if any of your changes/ideas would suit me in the future, especially when I convert my hacks from plugins to products (at which point I will phrase them as well) - in fact you are the second person to use a trick which I indend to look at to avoid the template edit. :up:

@BrentWilson - while you are free to use the above suggestion - I will not support it, as it's not my code - sorry.

Paul M 09-04-2005 09:09 PM

Quote:

Originally Posted by evesve
There must be an easy way to set the usergroups in order 6,7,9,2,1

Feel free to suggest one. :)

BamaStangGuy 09-04-2005 09:21 PM

Quote:

Originally Posted by Paul M
What you have to remember is that my hacks are written for Cable Forum and released here afterwards simply to share them - they run the way they do mostly for specific reasons - and this runs on forumhome_start for a reason. :)

I guess it also depends on what you mean by 'optimization' - using those functions may reduce the code in the hack slightly, but the functions themselves have a lot of code in them, much of which is not necessary to this hack. It is also generic code I use elsewhere, and would require me to load things like functions_bigthree.php.

So, while I thank you for your suggestion - I don't intend to make any changes atm - but I will look at it to see if any of your changes/ideas would suit me in the future, especially when I convert my hacks from plugins to products (at which point I will phrase them as well) - in fact you are the second person to use a trick which I indend to look at to avoid the template edit. :up:

@BrentWilson - while you are free to use the above suggestion - I will not support it, as it's not my code - sorry.

I realize that I was giving feedback to Kirby on his code.

I am still using yours.

Paul M 09-04-2005 10:09 PM

Quote:

Originally Posted by BrentWilson
I realize that I was giving feedback to Kirby on his code.

I am still using yours.

Ah okay, my misunderstanding, sorry. :)

BamaStangGuy 09-05-2005 12:51 AM

Quote:

Originally Posted by Paul M
Ah okay, my misunderstanding, sorry. :)

Not a problem man :)

okc 09-05-2005 03:00 AM

Great hack - could you tell me how to remove the link to the users so that there name only appears, but does not give a link to that member?

Andreas 09-05-2005 03:40 AM

Quote:

Originally Posted by Paul M
I guess it also depends on what you mean by 'optimization' - using those functions may reduce the code in the hack slightly, but the functions themselves have a lot of code in them

That's the reason why I marked it with a '?' :)
The way I did it is close to how vBulletin itself does it, and I assume that way is optimized for Performance, although it might have more Code.
But on the other Hand, the Query gets a Bit lighter as it does not invlove joins.
Although there is less code to eval().
But as said, I am not sure if this has an impact on Performance - it was just a thought :)

okc 09-05-2005 03:44 AM

Kirby - do you happen to know the answer to my question above regarding providing only usernames & no links to the users who have visited? thx

Andreas 09-05-2005 03:52 AM

That's easy - just edit the Plugin Code so it does not create Links.

okc 09-05-2005 03:57 AM

I know it's here in the index.php, but how exactly do I change it - thx for your help:

$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>, ";

BamaStangGuy 09-05-2005 05:04 AM

Why are you looking in idex.php to modify a plugin?

Open your Plugin Manager and remopve the hyperlink code around the name

evesve 09-05-2005 02:30 PM

Quote:

Originally Posted by evesve
There must be an easy way to set the usergroups in order 6,7,9,2,1

Quote:

Originally Posted by Paul M
Feel free to suggest one. :)

Maybe,
from my old asp-world :nervous: :
Code:

if usergroupid= 6 then
list_order= 1
elseif usergroupid=7 then
list_order=2
end if
=======
......order by list_order , username

or one more field in vb3_usergroups ("list_order")where I can put my usergroups in MY order and use that table in sql :nervous:

php is not the best part of me but I will learn!

What would you do without our crazy suggestions? :alien:

okc 09-05-2005 03:28 PM

Quote:

Originally Posted by BrentWilson
Why are you looking in idex.php to modify a plugin?

Open your Plugin Manager and remopve the hyperlink code around the name

I don't have a plug-in manager - I have 3.07 vB - unless I'm missing something. I'm almost positive modifying the index.php will do it. Any help in this regard?

Paul M 09-05-2005 06:43 PM

Quote:

Originally Posted by KirbyDE
But as said, I am not sure if this has an impact on Performance - it was just a thought :)

Indeed, which is why I thanked you for the suggestion. :)

Paul M 09-05-2005 06:45 PM

Quote:

Originally Posted by okc
I don't have a plug-in manager - I have 3.07 vB - unless I'm missing something. I'm almost positive modifying the index.php will do it. Any help in this regard?

You are in the wrong topic - this is the vb 3.5.0 plugin version, you want this ;

https://vborg.vbsupport.ru/showthrea...threadid=71533


All times are GMT. The time now is 08:06 AM.

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.01657 seconds
  • Memory Usage 1,878KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (22)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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