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)

ezop 09-29-2001 12:10 PM

nice work, works a treat..:)

eva2000 10-31-2001 01:16 PM

nearly forgot about this :o

For the record it's still working on my forums :)

Quote:

Pageviews since Aug 27, 2001 - 10:00 am (AEST): 2668665

MrLister 10-31-2001 01:34 PM

hehe that's quite a few... i guess it works great.

maverick1236 11-03-2001 11:58 PM

NICELY DONE!!!

Works Perfect!!

Thank You!!

eva2000 11-04-2001 12:00 AM

thanks.. i had help from freakysid too so not all my work :)

SWFans.net 11-21-2001 02:30 PM

I was curious if there was any way to use the figures generated by this hack to come up with page views for the last 24 hours?

Chrysalis 12-30-2001 11:30 PM

the hack worked but it wouldnt accept the following command

CREATE TABLE mycounter (count INT(11) UNSIGNED NOT NULL);

so i used CREATE TABLE mycounter (count INT(11)); instead and the hack works a treat.

Bedhead 12-31-2001 12:00 AM

Great job!

PhotoGenie 02-02-2002 04:56 PM

Great hack.. Only thing I see that should be changed is the placement of it in your page. Someone posted above that they thought avatars might be registering as visits and that his visits were going up 5 times more than they should be. What happens is you put the counter in your footer and then your really just registering clicks and not how many visits to the home page. Your footer shows everywhere so every time a page is loading it is counted as a visit. If you put it in your forumhome template It will only register your main page.

Example:

Welcome to our newest member, <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid"><b>$newusername </b></a><br>
There has been <b>$mycounter</b> visits to this page since July 16th, 2001
</smallfont></td>
<td align="right"><smallfont>
The time now is $timenow.<br>


Thanks for the hack I'm using it now. :)

PhotoGenie 02-03-2002 04:40 PM

Still counting clicks after making changes above. I went back and tried a few other things and got it fixed where it is only counting visits to the main page. Here's the changes below.

I removed :

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

from my phpinclude template.

Open index.php:

find around line 69

$birthdaybits="";

just above it insert

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

and that will fix it to where it only counts the index page.

You can now insert:

$mycounter

Wherever you want your count to appear.


All times are GMT. The time now is 04:57 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.00993 seconds
  • Memory Usage 1,729KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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