Log in

View Full Version : Show all hits on Forumhome


PcFreak
05-14-2004, 10:00 PM
First,

I am Geman. My English is not very well and this is my first little hack.

If there a other kind of this hack, sorry.

What's it do?
This hack shows the sum of all hits in the Forum Statistics.

Files to edit.

index.php
Template: FORUMHOME
Add one new Phrase

PcFreak

Chris|vB
05-15-2004, 03:59 AM
great hack :)

Gio Takahashi
05-15-2004, 09:29 AM
Just a question what you mean by HIt you mean Thread View count? I'm just a little confused.

hitmanuk2k
05-15-2004, 09:46 AM
is it possible to insert comma's in the number?

2,134,114 instead of 2134114

PcFreak
05-15-2004, 11:02 AM
Just a question what you mean by HIt you mean Thread View count? I'm just a little confused.

That is what I mean.
One "View" is one "Hit". (In Geman we call it Hit)

@hitmanuk2k
Sorry, i?m shure that is possible. But I don?t know how.

PcFreak

assassingod
05-15-2004, 11:06 AM
Use this code to get commas in high numbers:

$totalhits = number_format($totalhits['hits']);

insanctus
05-15-2004, 11:27 AM
That is what I mean.
One "View" is one "Hit". (In Geman we call it Hit)

@hitmanuk2k
Sorry, i?m shure that is possible. But I don?t know how.

PcFreak
Then mine must be off :( 297930 I know been more then that lmao.

Boofo
05-15-2004, 12:07 PM
Use this code to get commas in high numbers:

$totalhits = number_format($totalhits['hits']);

For vB3, that should be:

$totalhits = vb_number_format($totalhits['hits']);

;)

BoNfiRe
05-15-2004, 12:35 PM
clicks install thx for the hack, and thx for the mod Boofo

Synicide
05-15-2004, 08:25 PM
this is awesome! thanks!

Ted S
05-15-2004, 10:37 PM
Just a question what you mean by HIt you mean Thread View count? I'm just a little confused.

Looking at the code the actual value isn't page views or server hits but rather thread views so requests to search pages, arcade pages, tell a friend, profiles, etc... won't impact this data.

jons5150
05-16-2004, 03:58 AM
I used the Vb3 "comma code", but no commas? Any help Boofo???

Thanks...

Boofo
05-16-2004, 07:14 AM
You need to add that code right under this line:

$totalhits = intval($totalhits['hits']);

Synicide
05-16-2004, 01:01 PM
You need to add that code right under this line:

$totalhits = intval($totalhits['hits']);
Actually Boofo, it didn't work for me unless I replaced your line with that line. Because I'm guessing those functions try to clash with each other to display the talley. Just my observation.

jons5150
05-16-2004, 01:43 PM
Didn't work for me either boofo...made it worse. I think I'll just stick with no commas...

Thanks for trying....

Boofo
05-16-2004, 04:07 PM
I've been all wrong on this guys. Dohh!!! Here is the code you need for the commas. ;)

$totalhits = vb_number_format($totalhits);

jons5150
05-16-2004, 04:49 PM
As a replacement or an addition???

Boofo
05-16-2004, 10:23 PM
As a replacement or an addition???
As an addition right below the other piece of code.

Synicide
05-17-2004, 12:06 PM
As an addition right below the other piece of code.
I replaced it and it worked fine for me too. o_O

ChuanSE
06-09-2004, 01:06 AM
Doesn't seem to work for me :/

Kalipo
06-14-2004, 10:33 PM
Thanks Boofo :) and addon makerer thingy guy (Y)

Installed :)

xscape2me
07-22-2004, 03:56 PM
I'm getting an sql error.

Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT COUNT(*) ,
SUM(views) AS hits
FROM 600rr_ thread
mysql error: Table database.600rr_' doesn't exist

mysql error number: 1146

Date: Thursday 22nd of July 2004 12:52:54 PM
Script: http://www.miami600rr.com/forums/?

royals
07-24-2004, 06:12 AM
I've been all wrong on this guys. Dohh!!! Here is the code you need for the commas. ;)

$totalhits = vb_number_format($totalhits);


I get this on my page:

Total Hits: 250726 = vb_number_format(250726);



Otherwise this works like a charm - thanks!

royals
07-24-2004, 06:16 AM
Nevermind!! I was adding in the template, not my index.php

Thanks Boofo - works!

royals
07-24-2004, 06:24 AM
Qusetion - is this hits or visits? Daily? I have that many hits a day so I'm curious.

Thanks! (jeez I'm about to flood this thread)

Hotte@gun
08-10-2004, 07:07 PM
I'm getting an sql error.

Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT COUNT(*) ,
SUM(views) AS hits
FROM 600rr_ thread
mysql error: Table database.600rr_' doesn't exist

mysql error number: 1146

Date: Thursday 22nd of July 2004 12:52:54 PM
Script: http://www.miami600rr.com/forums/?

There is an whitespace which schouldnt be there use the following code

// ### Anzeige aller Hits START ###
$totalhits = $DB_site->query_first("
SELECT COUNT(*) ,
SUM(views) AS hits
FROM " . TABLE_PREFIX . "thread
");

$totalhits = vb_number_format($totalhits['hits']);
// ### Anzeige aller Hits ENDE ###


This includes Numberformating an the wrong set space after FROM " . TABLE_PREFIX . "

italks
09-10-2004, 11:48 AM
how the phrase is added.

_______________
Add a new phrase
_______________

totalhits = Totalhits

italks
09-10-2004, 11:50 AM
lolz i got it done....i almost forgotten it before.thanks for the hack its great.

fiber1
09-11-2004, 10:45 AM
Anyone know how to fix this to work in 3.0.3?

Hotte@gun
09-11-2004, 01:49 PM
Anyone know how to fix this to work in 3.0.3?
ehm... fix what ?

fiber1
09-12-2004, 01:49 AM
ehm... fix what ?

I am not geting any hits showing up for this, and yes there are people hitting the board/threads/etc. Everything shows up except for the hit count.

txbigguy
09-14-2004, 05:19 PM
I am getting the same thing.

Kyoshiro
01-06-2005, 03:01 AM
well, i got the hit counts to show up, but apparently, it won't update. it just stays frozen as 58,199 hits. i tried refreshing my page, but nope, still 58,199 -_-

Erwin
01-06-2005, 03:56 AM
From reading this thread and without looking at the code, I surmise that this totals up all the threadviews, not site hits.

As such, if you've set threadviews in your Admin CP to NOT update in real-time to conserve server load, this number will not update until your threadviews update.

This is just a guess anyway. :)

Jolten
01-06-2005, 04:58 AM
From looking at the query it is indeed thread views not site hits, as Erwin posted.

passionboss
01-06-2005, 10:50 PM
So is there any way to have the hits based on site hits since midnight on a daily basis???

No that would make this hake awsum :)

PcFreak
01-06-2005, 11:52 PM
So is there any way to have the hits based on site hits since midnight on a daily basis???

Good idea, but i think it?s not possible without changed the database.
This kind of mod needs special counter (more querys) and a new field in the thread tabel.
May a crownjob to deleted the old entries.
That would be my solution.

PcFreak

zendiz
01-16-2005, 10:54 PM
I have 3.05 and it does give a db error. cannot find vb3_ jabbedabi
Allthough it seems a great hack I pass, I got my index page down 3 times, which is not good

EscortCossie
01-30-2005, 01:26 PM
how the phrase is added.

_______________
Add a new phrase
_______________


totalhits = Totalhits
I don't get this... how is the phrase added?

Sorry for my noob question.. :rolleyes:

EDIT: I found it.. sorry guys :o

jamesyfx
02-01-2005, 11:13 PM
Worked great for me, although the number seems a little high.. nearly 2,000,000.

Polo
03-02-2005, 12:22 AM
Is there any way we can make this code count real hits or views... an not just thread views... anyone?

Polo
03-15-2005, 01:36 PM
anyone :ermm:

loftyasianz
07-30-2005, 04:44 PM
Is there any way we can make this code count real hits or views... an not just thread views... anyone?
*bump*

Snake
12-20-2005, 08:52 AM
Works fine on 3.5.2. :)

Falcon Capt
09-06-2006, 11:26 PM
Anybody up for adjusting this code so it works for 3.6.0???

Falcon Capt
09-07-2006, 12:03 AM
Anybody up for adjusting this code so it works for 3.6.0???Disregard, I adjusted the code and got it working for 3.6.0