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
  #32  
Old 08-16-2001, 01:07 AM
Robert Basil's Avatar
Robert Basil Robert Basil is offline
 
Join Date: Oct 2001
Location: Chandler, Arizona
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just put the hack in my forums and also placed it throughout my website. Works great, thanks!
Reply With Quote
  #33  
Old 08-16-2001, 06:03 PM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just tried this hack and it was doing fine for a few minutes and then reset itself again to zero?
Reply With Quote
  #34  
Old 08-16-2001, 07:32 PM
Harry
Guest
 
Posts: n/a
Default

I get exact the same error at different times.... now 879 hits and a few minutes later it starts over at 0
Reply With Quote
  #35  
Old 08-17-2001, 08:18 AM
Dakota's Avatar
Dakota Dakota is offline
 
Join Date: Oct 2001
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its working fine for me, I just installed it. It may reset, but you never know.
Reply With Quote
  #36  
Old 08-18-2001, 07:13 AM
Pie'oh'pah
Guest
 
Posts: n/a
Default

Well, just installed it, too

nicely done mate. any chance of making this part of the database?

-Alex
Reply With Quote
  #37  
Old 08-18-2001, 10:45 AM
AJR's Avatar
AJR AJR is offline
 
Join Date: Jan 2002
Location: Sacramento, CA
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have installed bbqfan's hack and it works great!! I wanted to keep a running history
of my page views and unique IP's so I made the following hack and attached a
picture of what it looks like. There may be a better way to do this...but this is
as simple a hack as I could create!

NOTE: I could only figure out how to get this to work for daily stats. Weekly/Monthly
don't calculate correctly. If anyone knows what to add/change in the query
to get Weekly/Monthly to show correctly, please post the changes here!

Here's what you need to do:

First create a table called 'ip_views' in your vbulletin database, and add the
following fields: 'date' as INT(10), 'views' as INT(6), 'uip' as INT(6)

Note: You can run the following query in phpMyAdmin to create the table:

CREATE TABLE ip_views (
date int(10) NOT NULL,
views int(6) NOT NULL,
uip int(6) NOT NULL
)

================================================== ============

** In bbqfan's hack in global.php

Find:

PHP Code:
} else {
    
$detail[0]=$count_day
CHANGE it to:

PHP Code:
} else {
    
$DB_site->query("INSERT INTO ip_views (date,views,uip) VALUES ('$count_t',$detail[1],$detail[3])");
    
$detail[0]=$count_day
Done with global.php!


** Open admin/stats.php

Find:

PHP Code:
  echo "<option value=\"thread\">Threads</option>\n"
Below it add:

PHP Code:
  echo "<option value=\"views\">Page Views</option>\n";
  echo 
"<option value=\"uips\">Unique IP's</option>\n"

Find:

PHP Code:
  } elseif ($type == "user") {
    
$table "user";
    
$field "joindate";
  } 
CHANGE it to:

PHP Code:
  } elseif ($type == "user") {
    
$table "user";
    
$field "joindate";
  } elseif (
$type == "views") {
    
$table "ip_views";
    
$field "date";
    
$field2 "views";
  } elseif (
$type == "uips") {
    
$table "ip_views";
    
$field "date";
    
$field2 "uip";
  } 

Find:

PHP Code:
  $stats $DB_site->query("SELECT COUNT(*), DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' GROUP BY timeframe ORDER BY $field $sort"); 
CHANGE it to:

PHP Code:
  if (($type == "thread") || ($type == "post") || ($type == "user")) {
      
$stats $DB_site->query("SELECT COUNT(*), DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' GROUP BY timeframe ORDER BY $field $sort");
  } elseif ((
$type == "views") || ($type == "uips")) {
      
$stats $DB_site->query("SELECT $field2, DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' GROUP BY timeframe ORDER BY $field $sort");
  } 
Done with admin/stats.php!


This works on vBulletin 2.0.1...any other 2.x versions should work, but I
can't verify. Hopefully someone will know how to make the weekly and
monthly stats add up the views/ip's correctly for the week/month!

AJ
Reply With Quote
  #38  
Old 08-18-2001, 10:53 AM
AJR's Avatar
AJR AJR is offline
 
Join Date: Jan 2002
Location: Sacramento, CA
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Strange...the picture didn't attach in the above post. Here it is:
Reply With Quote
  #39  
Old 08-19-2001, 09:04 PM
Robert Basil's Avatar
Robert Basil Robert Basil is offline
 
Join Date: Oct 2001
Location: Chandler, Arizona
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack was working great for almost a full 24hrs and then it started resetting itself at random times back to zero (Both the visitor stats and the page view stats) So I removed it from my site.
Reply With Quote
  #40  
Old 08-19-2001, 09:07 PM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Sportbikeworld
This hack was working great for almost a full 24hrs and then it started resetting itself at random times back to zero (Both the visitor stats and the page view stats) So I removed it from my site.
yup join the club
Reply With Quote
  #41  
Old 08-21-2001, 04:22 AM
Dakota's Avatar
Dakota Dakota is offline
 
Join Date: Oct 2001
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After afew hours I was at about 1500 page views, then I checked back the next morning and it was at like 250. Reset is occuring with me too.
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 05:56 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.04624 seconds
  • Memory Usage 2,355KB
  • 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
  • (12)bbcode_php
  • (1)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
  • (8)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