vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [release vB2.0]couter in vB page (https://vborg.vbsupport.ru/showthread.php?t=18096)

Robert Basil 08-16-2001 01:07 AM

I just put the hack in my forums and also placed it throughout my website. Works great, thanks!

eva2000 08-16-2001 06:03 PM

just tried this hack and it was doing fine for a few minutes and then reset itself again to zero?

Harry 08-16-2001 07:32 PM

I get exact the same error at different times.... now 879 hits and a few minutes later it starts over at 0

Dakota 08-17-2001 08:18 AM

Its working fine for me, I just installed it. It may reset, but you never know. :p

Pie'oh'pah 08-18-2001 07:13 AM

Well, just installed it, too :D

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

-Alex

AJR 08-18-2001 10:45 AM

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

AJR 08-18-2001 10:53 AM

Strange...the picture didn't attach in the above post. Here it is:

Robert Basil 08-19-2001 09:04 PM

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.

eva2000 08-19-2001 09:07 PM

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 :(

Dakota 08-21-2001 04:22 AM

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.


All times are GMT. The time now is 06:46 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.02267 seconds
  • Memory Usage 1,764KB
  • 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
  • (8)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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