Track your visitors with PHPvisitor

All new Coranto Addons, updates and patches to addons, will be released here...also, get support for addons within!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Track your visitors with PHPvisitor

Postby SrNupsen » Sun Apr 22, 2007 5:18 pm

Hello good people,

I have been busy lately learning PHP, and my debut will be PHPvisitor. What it does is essentially keep track of how many times a page has been visited. It can be called from any page you want to log, simply by copying and pasting a simple line of PHP code into that page.

You can give each page its own ID using practically any characters you want (for avid Coranto users <Field: Subject> will immediately spring to mind, I hope!) and then create "Top n read stories" to place anywhere on your site.

The script itself is highly customizable and (I hope) well documented. It was created for my own use primarily, but I hope you'll find some use for it, too.

Now what I need from you is feedback, bug reports and any feature ideas you might have for the next version!


See demo, documentation and/or download PHPvisitor by clicking here.
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Alexv » Mon Apr 23, 2007 12:34 am

Looks good! Though I think the ClickCount addon does the same thing (limited to Coranto though).
aka on ctus: alexv, aerosoul, billgates
Alexv
 
Posts: 33
Joined: Wed Jan 10, 2007 4:47 pm

Postby SrNupsen » Mon Apr 23, 2007 7:25 am

Yup, but ClickCount has to load the entire viewnews.cgi every time a paged is clicked, doesn't it?

[EDIT: I used ClickCount a lot in the past, and though it is very flexible I couldn't quite adapt it to my own needs. Besides, for my PHP-driven pages it seemed like an easier bet to have a PHP script doing it.

Now what I'm primarily interested in learning is how to optimize my code. I've only made things work, but I'm sure there are a lot of unnecessary lines and calls in there. I'll try and sort it out for 2.0 :) ]
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby SrNupsen » Wed Apr 25, 2007 6:51 am

For those of you wondering about that, the easiest way to have PHPvisitor track your most read articles (by subject) is to insert the following in your style:

Code: Select all
<?php include ('http://www.yourdomain.com/phpvisitor.php?mode=log&page_id=
<Field: Subject>'); ?>


This should all be in one line. Silly forum software.
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby GabeT » Wed Apr 25, 2007 10:33 pm

I'm having trouble making it show the most popular items.

http://www.siccness.net/featuress.php i have it logging each item using the code you posted and <?php include ('http://www.siccness.net/default/phpvisitor.php?mode=log&page_id=<MaginotFile: maginot_features>'); ?> I my style. I took a look at the phpvisitor_stats.txt and it looks like its logging the pages. i just dont know why it wont show me most popular 10. i used the following code to include the most popular <?php include('http://www.mysite.com/phpvisitor.php'); ?> maybe im doing it wrong.
GabeT
 
Posts: 86
Joined: Thu Jan 11, 2007 12:35 am
Location: Albuquerque, NM

Postby SrNupsen » Thu Apr 26, 2007 9:50 am

Code: Select all
<?php include('http://www.mysite.com/phpvisitor.php'); ?>


You didn't actually use THAT code, did you? You did use

Code: Select all
<?php include ('http://www.siccness.net/default/phpvisitor.php') ?>


right?

:wink:
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby SrNupsen » Thu Apr 26, 2007 10:18 am

I had a look at this:

http://www.siccness.net/default/phpvisi ... e=mostread

and it seems you haven't fully configured PHPvisitor. Take a look at the different options inside config.inc, and you should be able to sort things out :)
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby GabeT » Thu Apr 26, 2007 1:43 pm

SrNupsen wrote:
Code: Select all
<?php include('http://www.mysite.com/phpvisitor.php'); ?>


You didn't actually use THAT code, did you? You did use

Code: Select all
<?php include ('http://www.siccness.net/default/phpvisitor.php') ?>


right?

:wink:


Right! LOL..

I went over my config.inc file and i dont see anything i've missed or have the wrong information.
GabeT
 
Posts: 86
Joined: Thu Jan 11, 2007 12:35 am
Location: Albuquerque, NM

Postby SrNupsen » Thu Apr 26, 2007 2:58 pm

I found the problem and fixed it in phpvisitor.php. Just download the new version and replace the file phpvisitor.php (everything else is unchanged). The download link is the same:

http://www.enkeldata.no/phpvisitor/download

Please tell me if this solves your problem.
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby GabeT » Fri Apr 27, 2007 2:41 pm

SrNupsen, thanks for the update. It did solve my problem once I have it working/looking the way I want I'll show you the final product. Good work on the script.
GabeT
 
Posts: 86
Joined: Thu Jan 11, 2007 12:35 am
Location: Albuquerque, NM

Postby SrNupsen » Fri Apr 27, 2007 3:54 pm

My pleasure. Please let me know if you find any missing features you would like to see in 2.0 or encounter any more trouble!
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby SrNupsen » Sun Mar 02, 2008 9:04 pm

Version 1.02 has been released. From the changelog:

- Improvement: Corrected some rather nasty typos in the readme.
- Bug: Removed leftover debug code producing unwanted output.
- Improvement: File locking supported to prevent data corruption when using flat-file .txt database.

Grab it here
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Addon Release and Support

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron