I downloaded the php counter from: http://www.phpjunkyard.com/php-text-hit-counter.php
Follow the very simple instuctions to install.
My html block code is:
<SCRIPT LANGUAGE="Javascript" SRC="http://www.pixelmorgue.com/counter/counter.php?page=index"><!--
//--></SCRIPT>
Once I registered 1 hit I went to the /logs folder on my ftp and changed the number to the current hits of the website (I added the ones from the stats page).
It only counts the "index.php" (if you add page=index.php that is) not any of the other hits for example "index.php?action=forum" won't be counted.
I also enabled the referal stuff.
in counter.php I edited the following lines:
// Enable referer validation? 1 = YES, 0 = NO
$check_referer = 1;
// Domains that are allowed to access this script
$referers = array ("localhost","pixelmorgue.com");
Thanks
Excellent find. Using it now for total page views.
I've also added their link manager. Works perfectly. Only one problem is that you have to add the style.css in manually to the public part. By default its is only for the Admin area. Simply add
<link rel="STYLESHEET" type="text/css" href="style.css">
To the Header under the Title Tags, and alter it to suit you theme.
dosent work for me? i uploaded the counter to the smf directory http://cknetworx.com/~/whiplash/smf/counter.php
and put in this script
<SCRIPT LANGUAGE="Javascript" SRC="http://www./cknetworx.com/~/whiplash/smf/counter.php?page=index"><!--
//--></SCRIPT>
and set the box to javascript/html
any ideas on what i did wrong?
It needs to be in its own directory with permissions set to 777 as it writes its log files to there. Install it in a directory called counter, and use the code from the first post, it will work then.
Put the directory in your site root: yourdomain.com/counter
nope still dosent work , created its own directory and set the permissions to 755 ( it would only go to that )
this is the url of it http://cknetworx.com/~/whiplash/counter/counter.php
You'll need to get it to 777. If it wont go to 777 via FTP, you could try through cPanel, or your online file manager (if you have one).
lol
for some reason i cant get it past 755.............
You could ask you host about it. Some hosts are funny about 777. Even if the just set this one and your SMF directory to 777, and leave the rest. You do have SMF/TP dont you?
yea i do.............i'll ask my host about that
Command it 777
got it to 777 and it still dosent work
You're doing something wrong then. What script are you using to call it to the block, and what is the URL of the counter?
you have a /logs folder also?
Read over the install text to make sure you didn't miss any steps
this is the url of the counter http://whiplash.xtremefh.com/counter/counter.php this is the script of the block
<SCRIPT LANGUAGE="Javascript" SRC="http://www.whiplash.xtremefh.com/counter/counter.php?page=index"><!--
//--></SCRIPT>
and i have it set to a javascript/html block
Try removing ?page=index See if that works, then we'll see if we can do something from there.
nope dosent work..........................
I've compared you script with mine, and they match, so its not the script that is wrong. Next check to make is that all your permissions are right. These all need to be set at 777
/counter/
/counter/counter.php
/counter/logs/
/counter/logs/.log.txt
Make sure they are all at 777. The .log file is where the count is stored. Download it and see what it says. Make sure when you put it back it still is called .log.txt and not log.txt
i'd say i've found the problem.......i didnt have a logs folder
just one more Q : how do i edit it now to show the total amount of hits that i get from my cpanel stats?
Take the total hits, and edit the .log file to show that amount.
Do you have to upload a .log.txt page into the logs folder or does it create one it`s self?
It creates it. If you want to, you can download it via FTP, edit it, and re-upload it.
will do as soon as i get a new forum up
i sorted out the counter......it works now but i just wanted to know how to edit the figure its displaying thanks
I got it,
on my server directories need to be set 755, files set 644, works like this... thanks, pretty cool script.
is there a way to extract the data from the Forum General Statistics page which indicates Total Page views?
I mean, without the use of third party sites, just the plain data from the SMF stats and then display that in a block?
just like what the coders here did to the birthdays in SSI and events and so on, maybe they could get the Total Page views data also and put it in a block which increments together with the General Stats.
Should be possible with an ssi block and the correct calles in it.
How to use ssi you can read here
http://docs.simplemachines.org/index.php?topic=400
it says there that the code is:
trackStats(array('hits' => '+')); trackStats();
but it does not show anything :(
totally new to installing this type of thing so any and all help is much appreciated. :). I have downloaded the counter that is in the original post, but I am not totally sure what to do next. Could someone please provide me with a step by step walkthru for dummies? hehhe. I am familiar with TP as far as adding blocks to my portal page, however I have never used one where you also have to upload something to the server.
Thanks in advance :)
installed easy. works perfect. thanks!
I can not get this one to work for me, I made the directory, made it 777 and put in my URL in the script and I still have no luck. and ideas?
Did you follow the instructions given in the log script README ?