Hit Counter module v 0.3

paulney

Joined: 2005-08-25
Posts: 27
Posted: Wed, 2005-09-14 17:01

Hi!

I wrote a simple module for displaying hit counters on your gallery. Basically, it's a block which you can add to your album page or photo page, like ImageBlock for example. You have to have a hit counter from some tracking website though :) It's not a hit counter in itself.

Update: v0.3 is released. Automatic quote escaping has been fixed.

Module is available here: http://www.pneyman.com/downloads
Example of how it looks: http://www.pneyman.com/gallery
(blue rectangle with digits is the hitcounter block. Actual view will depend on your hitcounter)

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Thu, 2005-09-15 05:59

"I may not be a smart man Jeni, but I know what code is..."

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Thu, 2005-09-15 06:24

Uhm. Sorry? Didn't get that reference.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-09-15 16:39

ah, missed this post...

in what way goes it beyond the G2 built-in view counter?
i guess you'll have more statistics with this counter, right?

can you register on codex.gallery2.org and add your module to the http://codex.gallery2.org/index.php/Gallery2:UserContributions#Modules table? thanks!

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Thu, 2005-09-15 16:54

Valiant, this is a container for the web-site counters, not for view counting. It's not even a counter in itself - just a placeholder for one, if you want to place a site counter on your gallery pages as well. For example, the counter from SpyLog.com provides detailed statistics on entry/exit pages, ip's and hosts people came from, etc.

With Gallery 1, I used to add php code to display it into the gallery pages itself, but now with the modular structure, you can just add another block.

You can see how it looks with SpyLog counter on any page in http://www.pneyman.com/gallery - the blue rectangle is the counter.

Thanks.

 
NBrady

Joined: 2005-10-07
Posts: 77
Posted: Sat, 2005-10-08 21:36
Quote:
Warning: fopen(modules/hitcounter/counter_source/counter.inc): failed to open stream: Permission denied in /home/nbhq27f/public_html/gallery/modules/hitcounter/HitCounterSiteAdmin.inc on line 49

Warning: fwrite(): supplied argument is not a valid stream resource in /home/nbhq27f/public_html/gallery/modules/hitcounter/HitCounterSiteAdmin.inc on line 51

Warning: fclose(): supplied argument is not a valid stream resource in /home/nbhq27f/public_html/gallery/modules/hitcounter/HitCounterSiteAdmin.inc on line 52

Warning: Cannot modify header information - headers already sent by (output started at /home/nbhq27f/public_html/gallery/modules/hitcounter/HitCounterSiteAdmin.inc:49) in /home/nbhq27f/public_html/gallery/modules/core/classes/GalleryPhpVm.class on line 124

Thats the errror I get when I try to add anything into the input field. The module activated fine though.

Any help would be greatly appreciated.

My gallery : http://www.nbhq.net/gallery

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Sat, 2005-10-08 22:04

Sorry, the input field just doesn't work yet (although it's not disabled)
I was planning to release the next version where you just copy-paste your web-counter code in the window, but got sidetracked.

There are instructions in INSTALL how to enable your webcounter:

Install comes in easy steps:

1. Copy hitcounter/ directory into your gallery/modules/ directory
2. Create a counter_code.inc file with the source of your hit counter.
3. Log into your gallery as Administrator
4. In 'modules' section gallery will show a new not yet installed module
'hitcounter'
5. Install and activate module
6. There's no configuration yet
7. Change your albums to add a new 'hitcounter' block
8. Enjoy

Please let me know if these didn't work for you.

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Fri, 2005-10-14 07:36

Update: v0.2 is released. You can now configure your web-counter using Gallery GUI on SiteAdmin page.

Module is available for download at:
http://www.pneyman.com/downloads

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Sat, 2005-10-15 15:12

@paulney:

I wanted to modify your module to use it as an menu.
But there are serveral problems :(

What I want to add:

»Menu <br />
<a href="http://www.rebel2k.net" target="_blank">visit my site</a><br />

but after saving it changes the code automaticly to:

»Menu<br />
<a href=\"http://www.rebel2k.net\" target=\"_blank\">visit my site</a><br />

and now the html link in the block is broken :(
http://www.wallpapergallery.org/%5C%22http://www.rebel2k.net%5C%22

can i make it so that this autoparsing is deactiveted?

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Sat, 2005-10-15 15:48

As an immediate workaround you can omit the quotes. Really, you don't need them there in your case. Your html would look like:

<a href=http://www.rebel2k.net target=_blank>visit my site</a><br>

This quote escaping is done automatically, because php will fail on printing out the quoted values otherwise, but I'll think of what I can do, and get back to you :)

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Sat, 2005-10-15 16:43

yes this works till i hav eto use some quotes^^

would be great if you can fix it!

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Sun, 2005-10-16 15:20

I have tried to modify the code so that no parsing is done, but ... I am to stupid I think! :(

 
kyle1745

Joined: 2002-09-06
Posts: 68
Posted: Mon, 2005-11-21 23:38

I like the module but I would like to see a option to add it to the bottom middle or with the gallery and theme links in the bottom left.

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Tue, 2005-12-06 09:04

@ paulney:

have you time to fix your module to allow quotes?
that would be really great!!

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Fri, 2005-12-09 16:31

Uh, I'll try to fix it this weekend :)

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Mon, 2005-12-19 13:39

this would be great paulney!
I am looking forward to test it :)

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Tue, 2006-01-03 09:42

pauley, did you fixed it now?

 
mbmark

Joined: 2005-11-03
Posts: 6
Posted: Mon, 2006-01-09 17:31

something new ?

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Mon, 2006-01-09 18:19

Yes, this is fixed now.
I will put up a new version on the website in 30 min.

Sorry, it took me a while to get to this - too much stuff going on.
Anyways, check back in half hour, I should have everything packaged and ready.

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Mon, 2006-01-09 18:30

Ok. Version 0.3 is available for download :)
http://www.pneyman.com/downloads

Thank you!

 
ph33red

Joined: 2006-02-25
Posts: 4
Posted: Wed, 2006-03-01 16:30

will your module work with gallery 2.1 by chance? If not, do you plan on posting one that will?

 
NBrady

Joined: 2005-10-07
Posts: 77
Posted: Wed, 2006-04-05 00:56
ph33red wrote:
will your module work with gallery 2.1 by chance? If not, do you plan on posting one that will?

Agreed

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Wed, 2006-04-05 03:51

I don't see any reason why it shouldn't. It uses the very basic functionality of G2, and doesn't depend on any funky features.
Sorry about the delayed response - for some reason, I didn't get a notification about ph33red's posting.

(I haven't isntalled 2.1 yet, but I'll do it over this weekend)

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Wed, 2006-04-05 16:56

after applying simply the changes required for the new API and adjusting module.inc it runs perfect with Gallery 2.1
(Cool my old Web-traffic counter is back :))

Gallery version = 2.1 core 1.1.0
PHP version = 5.1.1 apache2handler
Webserver = Apache/2.2.0 (Win32) DAV/2 PHP/5.1.2 mod_ssl/2.2.0 OpenSSL/0.9.8a
Database = mysql 5.0.18-nt-log,
Theme=PGtheme,
Gallery-URL=http://lf-photodesign.de

 
paulney

Joined: 2005-08-25
Posts: 27
Posted: Fri, 2006-04-07 18:40

I've just upgraded my gallery to 2.1, and I see that hitcounter needs to be modified :)
LFrank already did it, so I'll update the hitcounter and post an announcement.
Thanks.

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Fri, 2006-04-07 18:58

it was sufficient to run the convert.pl script in the hitcounter module directory and to adjust the module.inc.
In case you don't have the script, I attach it
CU & Thanks
Lutz

Gallery version = 2.2-cvs core 1.1.1
PHP version = 5.1.1 apache2handler
Webserver = Apache/2.2.0 (Win32) DAV/2 PHP/5.1.2 mod_ssl/2.2.0 OpenSSL/0.9.8a
Database = mysql 5.0.18-nt-log,
Theme=PGtheme,
Gallery-URL=http://lf-photodesign.de

 
GusDoeMatik

Joined: 2006-04-11
Posts: 25
Posted: Fri, 2006-05-12 05:27

Have you updated yet and if so where do I find it?

 
GusDoeMatik

Joined: 2006-04-11
Posts: 25
Posted: Thu, 2006-05-25 17:45

When trying to install I get this error

Quote:
Fatal error: Undefined class name 'gallerystatus' in /home/httpd/vhosts/MyClubFlix.com/httpdocs/ImageGallery/modules/hitcounter/module.inc on line 68

 
mbrown84

Joined: 2006-01-14
Posts: 1
Posted: Wed, 2006-09-20 11:00

same error too

 
nathanvda

Joined: 2006-07-23
Posts: 1
Posted: Thu, 2007-01-11 02:30

In the module.inc file you need to replace the GalleryStatus::succes() occurrences with null and then it will work !

Note: you still need to run the convert.pl script as stated above !

Which works like a dream, thanks for that !

Hope this helps, kind regards,

Nathan

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-06-25 01:40

Updated the module to work with G2.2.5
Created codex page: http://codex.gallery2.org/Gallery2:Modules:hitcounter

Users: Please update the documentation on the codex so I have time to support others. ( do your part :-) )

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
alexxfender

Joined: 2009-05-05
Posts: 12
Posted: Thu, 2009-05-07 18:02

I install it.. everything went well and when i paste the counter code/script and hit Save ... it just take me to blank (main.php) page .. where do i go wrong?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2009-05-07 19:58

got an example of the code you are pasting?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
alexxfender

Joined: 2009-05-05
Posts: 12
Posted: Wed, 2009-05-20 18:48

Its for shoutbox..

Quote:
<iframe src="http://server2.shout-box.com/show?id=8257" name="shout-box.com" width="180" height="340" style="border:#000 1px solid;" marginwidth="0" marginheight="0"></iframe>

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2009-05-20 19:32

Does not work with G2.3
Any volunteers to fix?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team