Welcome, Guest. Please Login or Register.
September 30, 2024, 03:38:57 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Hit counter « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: Hit counter  (Read 1281 times)
ChumChum
Noobie
*
Posts: 2


Cogito ergo sum

WWW
Hit counter
« on: January 12, 2002, 10:55:58 PM »
Reply with quote

I haven't checked this board in about a week so it may have come up but is there a development for a hit counter embedded in the page? I use the board as my main page and I will prolly just add one some how bbut I was jsut wondering.
Logged
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:Hit counter
« Reply #1 on: January 13, 2002, 09:54:15 AM »
Reply with quote

Is not difficult to do, but why? you can just use a stat service added in template....
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Greg Robson
Training to be like Joseph
YaBB SE Developer
YaBB God
*****
Posts: 1459


Hello!

ICQ - 81390136 WWW
Using a third party service
« Reply #2 on: January 15, 2002, 06:18:17 PM »
Reply with quote

I'd rather not use a third party for the counter, not with YaBB SE being so fast and all. ;D
Logged

You can't have everything... where would you put it? -- Steve Wright
irbrian
Sr. Member
****
Posts: 489


I create. Therefore I am.

brian@inverse-reality.com WWW
Re:Hit counter
« Reply #3 on: January 16, 2002, 02:04:34 AM »
Reply with quote

Here's how I'd do it (bear in mind I'm no PHP whiz). I'd make a function somewhere called "counterShow" and one called "counterIncrement" or something, and just execute the counterIncrement function when the board index is loaded (or when the user logs in, or whatever). Then at the precise location you want the counter to show up, just execute counterShow.

The Show function of course, reads the value stored in a variable like $counterHits, while the Increment function increments the variable. Very, very simple stuff in PHP. Of course, you also have to store that somewhere... probably in your database.

Just a thought for those who understand PHP/MySQL a little: It'd be a good idea to figure out a way to use an existing MySQL query to read and write the data to the table, if at all possible, rather than creating a new one; my understanding is, anytime you run a new query it uses up server resources and can slow down your board, whereas "piggybacking" or accessing the results of an existing query simply uses the information already stored in memory and does use more system resources. :)

This is something simple I could easily do if I had the time or motivation to do it.
Logged

Imparting great wisdom daily to those who will mistake my words as such.
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:Hit counter
« Reply #4 on: January 16, 2002, 12:23:35 PM »
Reply with quote

Make a file called teller.php in your YaBBSE directory :

Quote<?php
$user = file("teller.log");
$user = $user[0];
$user++;
$file = fopen("teller.log", "r+");
fwrite($file, $user);
fclose($file);
echo $user;
?>

And also an empty file (or with just 0 in it) called teller.log (chmod 666)

Than call this in your YaBBSE template with :

Quote[ Total hits since 15-01-2002 is : <? include ("teller.php"); ?>]

You can see it in action on my board.........
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Greg Robson
Training to be like Joseph
YaBB SE Developer
YaBB God
*****
Posts: 1459


Hello!

ICQ - 81390136 WWW
Re:Hit counter
« Reply #5 on: January 16, 2002, 12:29:31 PM »
Reply with quote

Could you make a mod of it?
Logged

You can't have everything... where would you put it? -- Steve Wright
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:Hit counter
« Reply #6 on: January 16, 2002, 12:36:20 PM »
Reply with quote

Very nice :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:Hit counter
« Reply #7 on: January 16, 2002, 12:51:58 PM »
Reply with quote

Sure  ;)

It is not all that much is it  ;)

I will try to make it a mod  ;D
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:Hit counter
« Reply #8 on: January 16, 2002, 12:56:39 PM »
Reply with quote

You can add a template tag such <yabb_counter> :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Greg Robson
Training to be like Joseph
YaBB SE Developer
YaBB God
*****
Posts: 1459


Hello!

ICQ - 81390136 WWW
Excellent
« Reply #9 on: January 16, 2002, 12:57:55 PM »
Reply with quote

Sounds great!
Logged

You can't have everything... where would you put it? -- Steve Wright
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:Hit counter
« Reply #10 on: January 16, 2002, 01:00:47 PM »
Reply with quote

Quote from: Godai on January 16, 2002, 12:56:39 PMYou can add a template tag such <yabb_counter> :)

Eeehmmmm.....how can I do that ?

I'm not familiar with writing mod's, so maybe you can put this tiny yabbon in a tiny package  ;D ?!
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:Hit counter
« Reply #11 on: January 16, 2002, 01:01:47 PM »
Reply with quote

Ok, i'm adding it to my task list ;)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:Hit counter
« Reply #12 on: January 16, 2002, 01:03:54 PM »
Reply with quote

Guess it would take you about 5 minutes or so ?

I'd like to have an own "mod"  ;D LOL !

This is one of the easiest "mods" I've ever seen, isn't it  ;)
Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Godai
Mod God :P
Sr. Member
****
Posts: 473


YaBB SE!!!!

ICQ - 70621553godai78@hotmail.com WWW
Re:Hit counter
« Reply #13 on: January 16, 2002, 01:12:29 PM »
Reply with quote

I need time, because i'm at work and don't know when i can do it :)
Logged

Emanuele 'Godai' Sparvoli
YaBB Italian Team
100% YaBB Lover
Webby
Beta Tester
YaBB God
*****
Posts: 829


Some mistakes are too funny to make only once.

ICQ - 9814812webby@salesplaza.nl WWW
Re:Hit counter
« Reply #14 on: January 16, 2002, 01:13:32 PM »
Reply with quote

I'm at work too, so I understand  :)

Logged

Webby of salesplaza.nl
The YaBBSE buttongenerator : Click HERE !
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Hit counter « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.060 seconds with 20 queries.