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)
-   -   page - hit counter in mysql (https://vborg.vbsupport.ru/showthread.php?t=26527)

eva2000 08-26-2001 10:00 PM

Who would ever think me releasing something :D

Being a newbie at php/mysql programming i had help from tutorials all over the place and from freakysid from SPF forums :)

1. MySQL based counter

You need:
1. phpmyadmin - http://sourceforge.net/projects/phpmyadmin/ -phpmyadmin install and use guide to add a table named mycounter to your existing vB database.

you need to select you vb database name listed in the left of phpmyadmin and run the following queries once in phpmyadmin
Code:

CREATE TABLE mycounter (count INT(11) UNSIGNED NOT NULL);
INSERT INTO mycounter SET count = 0;

i.e. if my vb database is named usertest you should enter like this the screen cap below or here.

2. need to edit your phpinclude template and add the following in:
PHP Code:

$result mysql_query("SELECT count FROM mycounter");
$mycounter mysql_result($result0) + 1;
$result mysql_query("UPDATE mycounter SET count = count + 1"); 

save changes

3. then place $mycounter in your footer template

Ruth 08-28-2001 04:08 AM

looks nice,

is there a demo?

and how does it work? based on logins? or specified ip adress?

eva2000 08-28-2001 04:10 AM

based a raw pageview hits... you can see it working on my vB at the bottom of each page http://animeboards.com/

i'm still a newbie with php but working on it :D

merk 08-28-2001 04:24 AM

A sugestion eva2k...

Im after a counter script myself, which yours is great for, but i need one to also record the HTTP_REFFERER, and useragent, and i dont really want to us webtrends :/

I could try to add these features for you if you want me to? ;)

eva2000 08-28-2001 04:37 AM

Quote:

Originally posted by merk
A sugestion eva2k...

Im after a counter script myself, which yours is great for, but i need one to also record the HTTP_REFFERER, and useragent, and i dont really want to us webtrends :/

I could try to add these features for you if you want me to? ;)

sure why not.. i'm planning to do this too but i have to learn how to do it first (it's only been 48 hrs since i started learning php :o )

merk 08-28-2001 04:51 AM

Ive done php for some time, but never have gotten around do doing anything of any importance :/

FWC 08-28-2001 05:33 AM

Quote:

Who would ever think me releasing something
That's a nice hack. I installed it.

_ 08-28-2001 03:25 PM

lol eva

the counter on AB is just like a stopwatch almost, it goes up like 2 every second (3 if you include me =)

Bane 08-28-2001 03:34 PM

Quote:

Originally posted by merk
A sugestion eva2k...

Im after a counter script myself, which yours is great for, but i need one to also record the HTTP_REFFERER, and useragent, and i dont really want to us webtrends :/

I could try to add these features for you if you want me to? ;)

In case anyone is interested, I am putting together something like this. You can view an example of the output at:

http://www.talkloud.net/forums/vbstats.php

As far as the referrer check

http://www.talkloud.net/forums/vbsta...ction=incoming

dxb 08-28-2001 04:59 PM

hi there eva

you did it at last :)

thanks for the counter

and Bane the stats look really great ....yes I'm intersted in and I will be waiting for if

but could you make it so that you can add it to a VB page and a non VB page if it's possible :)


All times are GMT. The time now is 03:08 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.01044 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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