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
  #12  
Old 05-26-2001, 07:18 PM
Degen
Guest
 
Posts: n/a
Default

BBQFan,

I made the changes, but am still getting the same errors.
Reply With Quote
  #13  
Old 05-26-2001, 08:17 PM
h4p3 h4p3 is offline
 
Join Date: Oct 2001
Location: Vienna
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have to create two files, called count.txt and ip.txt and chmod them to 777.
Reply With Quote
  #14  
Old 05-27-2001, 06:41 PM
h4p3 h4p3 is offline
 
Join Date: Oct 2001
Location: Vienna
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hm, i think there is something wrong.

It always displays this: (it is installed since two days)

vb test received page views: today = 1, total = 22. variant IP visitors: today = 1, total = 22.

today = 1 ? What does this mean? I know that there were more than one person on my test board, it should display today = 2 or so.

Suggestions on this?
Reply With Quote
  #15  
Old 05-29-2001, 07:56 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by h4p3
Hm, i think there is something wrong.

It always displays this: (it is installed since two days)

vb test received page views: today = 1, total = 22. variant IP visitors: today = 1, total = 22.

today = 1 ? What does this mean? I know that there were more than one person on my test board, it should display today = 2 or so.

Suggestions on this?
same problem here
Reply With Quote
  #16  
Old 05-29-2001, 08:15 AM
Santa
Guest
 
Posts: n/a
Default

same prob here too

Santa
Reply With Quote
  #17  
Old 05-29-2001, 01:27 PM
BradC
Guest
 
Posts: n/a
Default

yah I am having the same problem.... but I am going to use another counter and just intergrate it tonight

or tweak this one to work...
Reply With Quote
  #18  
Old 05-30-2001, 02:37 AM
bbqfan
Guest
 
Posts: n/a
Default

Quote:
Originally posted by h4p3
Hm, i think there is something wrong.

It always displays this: (it is installed since two days)

vb test received page views: today = 1, total = 22. variant IP visitors: today = 1, total = 22.

today = 1 ? What does this mean? I know that there were more than one person on my test board, it should display today = 2 or so.

Suggestions on this?
Hi guys!

would you plx tell me where your test boards are? maybe i can find out any mistakes in this mini hack...

but it works ok for me...

http://vbgatetest.51.net/vgate/vb
Reply With Quote
  #19  
Old 05-30-2001, 02:55 AM
bbqfan
Guest
 
Posts: n/a
Default

i have found some servers set this:

$ENV{REMOTE_ADDR} = 127.0.0.1

so every day the number of variant IP visitors is very ONE... we may try to change the counter code:

PHP Code:
$cxip_userip getenv('REMOTE_ADDR'); 
to this new line:

PHP Code:
$cxip_userip getenv('HTTP_X_FORWARDED_FOR'); 
if you test vB on your local PC(like me), the visitors' IP always be 127.0.0.1. of course "variant IP visitors: today = 1,"...
Reply With Quote
  #20  
Old 05-30-2001, 06:31 AM
Santa
Guest
 
Posts: n/a
Default

still wont work.

I get today=1
total=1809

Santa
Reply With Quote
  #21  
Old 05-30-2001, 02:47 PM
bbqfan
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Santa
still wont work.

I get today=1
total=1809


Santa
which "today"? views or IP?
i think this hack code just simple or i should double check 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 01:24 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.04320 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
  • (6)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
  • (3)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
  • (3)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