Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
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: 05-24-2001 Last Update: Never Installs: 1
 
No support by the author.

a. open vb2/global.php

find:

PHP Code:
// ###################### Start init ####################### 
Immediately ABOVE it put any PHP counter, i using this:

PHP Code:
// ipcounter hack by CX
// config
// create these two files count.txt and ip.txt, chmod them to 777
$count_file "count.txt";
$ip_file "ip.txt";
$userip getenv('REMOTE_ADDR');  // in some fixed IP server, change this line to $userip = getenv('HTTP_X_FORWARDED_FOR');

$count_temp=file($count_file);
$ip_temp=file($ip_file);

$detail=explode("|",$count_temp[0]);
$count_t=getdate(time());
$count_day=$count_t['mday'];

if (
$detail[0]==$count_day) {
    
$detail[1]++;
    
$detail[2]++;

    
$count=count($ip_temp);
    
$check=1;
    for (
$i=0$i<$count$i++) {
        
$ip_list=str_replace("\r","",str_replace("\n","",$ip_temp[$i]));
        if (
$ip_list==$userip$check=0;
    }
    if (
$check==1) {
        
$detail[3]++;
        
$detail[4]++;
        
$fp=fopen($ip_file,"a");
        
flock($fp,3);
        
fputs($fp,$userip."\n");
        
fclose($fp);
    }
}
else {
    
$detail[0]=$count_day;
    
$detail[1]=1;
    
$detail[3]=1;
    
$detail[2]++;
    
$detail[4]++;
    
$fp=fopen($ip_file,"w");
    
flock($fp,3);
    
fputs($fp,$userip."\n");
    
fclose($fp);
}

$new=implode("|",$detail);
$fp=fopen($count_file,"w");
flock($fp,3);
fputs($fp,$new);
fclose($fp);

// end ipcounter hack 
b. edit the template footer

find in last:

PHP Code:
</smallfont>
</
p
Immediately ABOVE it put:

PHP Code:
<br><br>
page views:&nbsp;&nbsp;today $detail[1],&nbsp;&nbsp;total $detail[2].&nbsp;&nbsp;variant IP visitors:&nbsp;&nbsp;today $detail[3],&nbsp;&nbsp;total $detail[4]. 
Done!

Show Your Support

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

Comments
  #22  
Old 05-30-2001, 03:16 PM
h4p3 h4p3 is offline
 
Join Date: Oct 2001
Location: Vienna
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope, both.

I tested it on my local Server (Gateway) and on my dedicated Server for my website -> same effect.
Reply With Quote
  #23  
Old 05-30-2001, 03:45 PM
bbqfan
Guest
 
Posts: n/a
Default

my GOD... i m very very sorry for my mistakes...

the right codes have been put in the first post of this thread...

this time every thing would be ok...
Reply With Quote
  #24  
Old 05-30-2001, 04:13 PM
Santa
Guest
 
Posts: n/a
Default

Yeahhh now it works
Reply With Quote
  #25  
Old 05-30-2001, 04:20 PM
bbqfan
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Santa
Yeahhh now it works
thank you! i can set my heart at rest now...
Reply With Quote
  #26  
Old 05-30-2001, 04:54 PM
Santa
Guest
 
Posts: n/a
Default

no mate. make more of this hacks
Reply With Quote
  #27  
Old 05-31-2001, 07:16 PM
bbqfan
Guest
 
Posts: n/a
Default

sorry again!

another bug: these 2 variables $t and $day are collided with vB...

so it will bring on some unpredictable results...

the right codes have been put in the first post of this thread... i think so
Reply With Quote
  #28  
Old 06-02-2001, 01:25 PM
BradC
Guest
 
Posts: n/a
Default

Great... it works just fine now.. but

Where else can we put the counter code so that it does not count everything... like when you click on a forum.. and read a post.. or go to another page that is including the global.php file.. it counts as a daily visit.. heh
Reply With Quote
  #29  
Old 06-02-2001, 07:22 PM
ThomasP
Guest
 
Posts: n/a
Default

Hi there,

works perfect,
thanks!
-Tom
Reply With Quote
  #30  
Old 06-02-2001, 11:37 PM
bbqfan
Guest
 
Posts: n/a
Default

Quote:
Originally posted by BradC
Great... it works just fine now.. but

Where else can we put the counter code so that it does not count everything... like when you click on a forum.. and read a post.. or go to another page that is including the global.php file.. it counts as a daily visit.. heh
mmmh, i think it is easy too...

maybe you can put the display code like this:
PHP Code:
this page views:&nbsp;&nbsp;today $detail[1],&nbsp;&nbsp;total $detail[2].&nbsp;&nbsp;variant IP visitors:&nbsp;&nbsp;today $detail[3],&nbsp;&nbsp;total $detail[4]. 
in any Templates you want, instead of the Templates FOOTER, or you can just display one or more of $detail[1]~~[4].

but, you have to create some new count.txt and ip.txt.

Quote:
ThomasP:

Hi there,

works perfect,
thanks!
-Tom
you are welcome
Reply With Quote
  #31  
Old 08-02-2001, 08:22 PM
ThomasP
Guest
 
Posts: n/a
Default

Sorry to bring this up again, but it works perfect in 2.0.3 and I reeeaaally love it
cu,
-Tom
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 01:11 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.04707 seconds
  • Memory Usage 2,315KB
  • Queries Executed 25 (?)
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_php
  • (3)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_onlinestatus
  • (11)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
  • postbit_imicons
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete