TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 30, 2024, 12:52:07 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,112
  • Total Topics: 21,213
  • Online today: 67
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 55
  • Total: 55

Counter block

Started by evillair, March 01, 2006, 04:38:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

evillair

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

gerrymo

Excellent find. Using it now for total page views.

gerrymo

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.

alan s

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?

gerrymo

#4
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

alan s

nope still dosent work , created its own directory and set the permissions to 755 ( it would only go to that )


gerrymo

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).


alan s

for some reason i cant get it past 755.............