forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: freynolds on October 04, 2006, 01:17:47 am

Title: Stats
Post by: freynolds on October 04, 2006, 01:17:47 am
Im looking for a mod or plugin or whatever that could make me a stat list of what did the last ip/user did in the gallery.
Something like the stats that yabb has incorported in the admin section.

thx
Title: Re: Stats
Post by: Joachim Müller on October 04, 2006, 09:32:39 am
Coppermine doesn't record user actions in such a detailed manner, so all coppermine pages would have to be modified to add some code that records what the user currently does (additional queries). Then you'll have to come up with the code to display those stats. Not a trivial thing. You'll have to code this if you need it (or hire someone to code it for you).
Title: Re: Stats
Post by: freynolds on October 05, 2006, 12:13:16 am
what im looking for is the following. I have in the sql database a table "cpg149_hit_stats" this table captures data from each hit and afterwards you can see this bellow each picture.

it has this structure:
  sid  pid  ip  search_phrase  sdate  referer  browser  os 
and an example of the contents.
  1 5 190.50.142.###  1159314848 %2Fcoppermine%2Findex.php... Unknown Windows XP

There isn't any plugin or what so ever that can show in a stilish way this to the admin?

Or if there isn't, have you got any idea how could I write a script to make this work?
Title: Re: Stats
Post by: Sami on October 05, 2006, 12:25:57 am
It doesn't need plugin , you can see that info for each file on dispalyimage.php under file info block display: there is a detail link
Title: Re: Stats
Post by: freynolds on October 05, 2006, 01:16:48 am
It seams like I have explained incorrectly what im looking for.

Im looking for something as a list of the last 100 pageloads.
Or what the last 10 visitors did.
Or something like this, not just who saw a picture.

Is this possible?
Title: Re: Stats
Post by: Joachim Müller on October 05, 2006, 06:04:59 am
It is possible if you code it.
Title: Re: Stats
Post by: freynolds on October 05, 2006, 09:04:14 pm
Ok, then I will try... I know how to program in c++ but I have no idea how to code php/mysql, any advice?

Nevermind, I just make a google search, and its practicaly the same as c ansi.

Thanks... When developing a plugin or whatever u call it, in what forum I have to talk?
Title: Re: Stats
Post by: Joachim Müller on October 05, 2006, 11:04:41 pm
Post your mod / hack / plugin on the support board - a moderator will move it if applicable.
Title: Re: Stats
Post by: digimic on October 06, 2006, 01:37:15 am
is there a mod for this?
in order to see which photo each user saw ? to trace the user connections
Title: Re: Stats
Post by: freynolds on October 06, 2006, 02:18:10 am
Ok, i started with the php thing, and its not dificult, I've managed to make a php that opens mysql and extracts the hit data and puts it into an array. What im missing is how is the hit time stored, the numbers are like the following: 1159314848 or 1159357142... I don't know if they are the amount of seconds transcured or what so ever.

Got any idea?

What I'm trying to do at the time is a plugin or something (because I have no idea how the plugin has to work).
This so I can see what ip did what in the last n days.
Title: Re: Stats
Post by: Joachim Müller on October 06, 2006, 08:13:56 am
is there a mod for this?
in order to see which photo each user saw ? to trace the user connections
If you would have read the thread that you're replying to you would have figured out that there is no mod yet. ::)

I've managed to make a php that opens mysql and extracts the hit data and puts it into an array.
You should use the Coppermine functions to run the queries - the mysql connection should already be established when your mod is running from within Coppermine.

What im missing is how is the hit time stored, the numbers are like the following: 1159314848 or 1159357142... I don't know if they are the amount of seconds transcured or what so ever.
Times are being stored using timestamps in the Unix time format, see http://www.php.net/manual/en/function.time.php
Title: Re: Stats
Post by: freynolds on October 06, 2006, 06:24:24 pm
Ok, to use the mysql functions in coppermine I use this function cpg_db_query()? And afterwards I use normal mysql functions like mysql_fetch_array()?

And how do I make a mod that runs inside coppermine... I have no clue and I can't find anything relevant in the forum...

I also want to add a link in the admin user like random_select does where I can put the statistics.
Title: Re: Stats
Post by: freynolds on October 07, 2006, 03:39:43 am
Also in the table hit_stats the referer part has all the urls like the following:

%2Fcoppermine%2Fdisplayimage.php%3Falbum%3D9%26pos%3D11

insted of

/coppermine/displayimage.php?album=9&pos=11

This is a problem with my system, or this happens in every CPM?

thx
Title: Re: Stats
Post by: Nibbler on October 07, 2006, 01:19:17 pm
http://php.net/urldecode
Title: Re: Stats
Post by: freynolds on October 07, 2006, 02:20:44 pm
about urldecode() shouldnt stats_details have a urldecode? since it print the chunk as it was a text string and the url afterwards it looks like the following:

http://mysite/copermine/http%3A%2F%mysite%2Fcoppermine%2Fdisplayimage.php%3Falbum%3Dlastcom%26cat%3D0%26pos%3D1

and let me say if i press on the link it does not work  :o

ok.

in regards to this:
Ok, to use the mysql functions in coppermine I use this function cpg_db_query()? And afterwards I use normal mysql functions like mysql_fetch_array()?

And how do I make a mod that runs inside coppermine... I have no clue and I can't find anything relevant in the forum...

I also want to add a link in the admin user like random_select does where I can put the statistics.
anyone has any data I could use?

I have achieved a php that prints the ip visitor list for the past n days (you can modify the amout of data to take in acount).
And if you click on the ip it will print the referer pages for that period.

Now what is left for me is transport it into CMG...
Title: Re: Stats
Post by: freynolds on October 09, 2006, 08:48:34 pm
any answers?

ok, this is what i've done so far (if anyone care to use a plugin like this):

a php script that lets you see the ips that entered the gallery, with a count of hits that each ip did.

with an output like this: (the amount of days of the tracking can be changed)

Showing form:08-10-06 02:18:24 pm To: 09-10-06 02:18:25 pm
190.50.165.xxx(3)
201.235.145.xxx(2)
190.50.172.xxx(52)
...

each ip has a link to another php script that has an output like the following:

Showing form:08-10-06 02:22:46 pm To: 09-10-06 02:22:46 pm
Date - Time                  Album # Photo# Filepath                         Referer URL
Mon 09-10 01:52:58 pm  2           15       pinamar/14.jpg                 Referer
Mon 09-10 01:52:47 pm  1           5         chacra/2.jpg                   Referer
Mon 09-10 01:51:30 pm  13          963     viaje_eg/DSC05462.JPG     Referer

Where the album # has a link to the album thumbs page, the photo # has a link to that photo, and the referer url has a link to that.
 
Also Im going to add a posibility to view the thumbs of each picture to make the traking easier.

And maybe a last 100 pageloads or something like that.

I'm trying to make a plugin with all this things, so any help on plugin coading and stuff will be apreciated.
Title: Re: Stats
Post by: bobby131313 on October 10, 2006, 07:43:41 am
Quote
Im looking for something as a list of the last 100 pageloads.
Or what the last 10 visitors did.
Or something like this, not just who saw a picture.

Is this possible?

Why not just sign up at statcounter.com , they give you extremely detailed stats for your last 100 pageloads for free. (referrers, ips, visitor through site tracking, entry and exit pages, search terms, and oh so much more) Just plop the code in your html template and you're done.  ;D

Title: Re: Stats
Post by: freynolds on October 11, 2006, 02:41:15 pm
thx for the nonsense comment..
Title: Re: Stats
Post by: bobby131313 on October 13, 2006, 10:07:35 pm
Quote
thx for the nonsense comment..

Hmmmm.... I hope you're not talking to me. It would give you exactly everything you've asked for and you would have been done 10 minutes after reading my post.

Title: Re: Stats
Post by: Joachim Müller on October 14, 2006, 10:50:37 am
@bobby131313: freynolds doesn't seem to be interessted in a third party counter script, probably because third party tools can't accomplish the same thing an on-site counter can do. I understand that you're trying to be helpful, but it's his thread, so please respect his wish not to discuss a third-party counter script here.
Title: Re: Stats
Post by: Paver on October 17, 2006, 08:13:47 am
@freynolds: If you want to post what code you have so far on this thread (as an attachment, renaming .php to .php.txt or using a zip/rar/tgz), I'd be willing to look at it and help with a plugin version.  Or you can private message me if for some reason you don't want it public yet.
Title: Re: Stats
Post by: freynolds on October 18, 2006, 05:15:40 am
Thanks Paver, inside the attachment I added the two php scripts I coded to make the stats.

At the time I'm using mysql_connect function to conect and show the info. I know that I need to replace this with just cpg_db_query. But I've done this so that I could at least test what I'm doing.

Things as tables and pictures also need to be reformed so it can be fited into coppermine.

But probably I can do that stuff on my own, my problem is making the plugin setup and that sort of thing which I've no clue at all how to do, and that I don't want to mess up my whole gallery trying.

Thanks
Title: Re: Stats
Post by: freynolds on October 31, 2006, 03:50:26 am
since nobody cares about this... lock it down...

if anyone interested... pm me.
Title: Re: Stats
Post by: Paver on November 01, 2006, 06:23:08 am
A plugin version of the contributed code is available here: Summary of Hit Statistics (http://forum.coppermine-gallery.net/index.php?topic=38011.0).

@freynolds: If this plugin does basically what you want, please say so and we can close this support thread (by marking it "solved").  Further discussion can continue on the plugin thread.
Title: Re: Stats
Post by: freynolds on November 02, 2006, 12:15:01 am
The plugin works exactly as I wanted to!
Thx!