Page 1 of 1
Adding Past Hits to PHPCount
Posted: Thu Apr 06, 2006 3:44 pm
by quixote
Script URL: http://www.phpjunkyard.com/php-text-hit-counter.php
Version of script: 1.0
Version of PHP: php4
Hosting company: ixwebhosting.com
Have you searched THIS FORUM for your problem: yes and I couldn't seem to find anyone with the same problem.
If so, what terms did you try: "adding previous hits counter". I also looked at everything I could find to do with PHP text hit counters.
Write your message below:
I installed PHPCount, and it is working just fine. However, I was wondering if there is a way to alter the counter.php file so that I can add on the number of previous hits I had before I installed the counter. I've tried changing a few things but they don't seem to work.
Any help would be greatly appreciated.
Posted: Thu Apr 06, 2006 6:20 pm
by Klemen
Download the log file in ASCII mode to your PC, open in Notepad, change number value, save and upload back to the server in ASCII mode.
Regards
Posted: Thu Apr 06, 2006 8:44 pm
by quixote
Do you mean the .log file inside the logs folder?
I'm not sure how to use ASCII. I'm on a Mac and my FTP client doesn't seem to have that option. I just deleted the file and replaced it with a blank text file of the same name, with my number of hits on it. But I think this may have caused a problem because now the counter doesn't show up.
You can see the counter on
http://www.quixoticvibes.com/blog.php on the sidebar where it says 'visitors'.
The .log file is inside the /counter/logs folder.
Posted: Thu Apr 06, 2006 9:07 pm
by Klemen
Yes, the .log file should be edited. Try:
1. chmod the log file you uploaded to 666 (rw-rw-rw-)
or
2. delete the file you uploaded and it should start working again.
FTP/CHMOD tutorial:
http://www.phpjunkyard.com/ftp-chmod-tutorial.php
Posted: Thu Apr 06, 2006 11:47 pm
by quixote
Thanks a lot!
Posted: Fri Aug 18, 2006 5:59 pm
by Crestone Creations
Dear Klemen,
Thank you for your excellent web site and tutorials.
I have attempted to follow your instructions for the person in this post, as I have the same issue, but I do not think I am getting the file formatted correctly.
http://scretac.org/counter/logs/index.h ... tIwant.log
is the path to an example file I am trying to put (the true file, generated by your script is
http://scretac.org/counter/logs/index.html.log)
Perhaps I should edit with a text editor at the shell level?
It seems like a lot of work, I'd rather just put using Dreamweaver or Fetch, my Mac-based FTP programs.
I fear that somehow I am putting a bad file format.
thanks
Posted: Sat Aug 19, 2006 9:09 am
by Klemen
Hi,
Are you actually RENAMING the file? The log file must stay the same, you should only edit the number in the file itself. Any text editor should do and no shell - level is required.
Posted: Sat Aug 19, 2006 3:54 pm
by Crestone Creations
Thank you for your reply. If you read my post I indicate that I put that file (renamed) on the server just to show you. I understand that the log file name must relate precicely to its target file. I put the example because it is the one I modified. So you could look at it. In case it looked different through some lens (software, method) of yours. Were I to put that file and have it named correctly, replacing the file automatically generated by the script, then the script would not work.
I think that the issue may be permissions. When the .log file is created by apache it is owned by apache and thus somehow problems occur when I attempt to put this new file. So I think that the permissions need to be changed, and you have said this.
I also wanted to confirm the macintosh FTP method - since they do not just offer ASCII ....
Thanks
Posted: Sat Aug 19, 2006 5:20 pm
by Klemen
Well
http://scretac.org/counter/logs/index.h ... tIwant.log
doesn't exist so I can't really look at it can I
Have you tried to CHMOD your edited file to 666 (rw-rw-rw-)?
The ASCII setting should be set in your FTP client and doesn't really matter if you use Mac/PC/Whatever
An example how to use it (and CHMOD) is here:
http://www.phpjunkyard.com/ftp-chmod-tutorial.php