If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
PNG Counter 1.0  XML
Forum Index » Support Forum
Author Message
couchmouse
Newbie
[Avatar]

Joined: 23/11/2006 00:00:06
Messages: 2
Offline

Server was running PHP4 and the counter was working, no problems.

Host upgraded server to PHP5 and the counter stopped working. Now only get the "error.png" showing.

What setting in PHP5 should I look for that might have caused this?

Thanks.
[WWW]
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

Got a link ?

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
couchmouse
Newbie
[Avatar]

Joined: 23/11/2006 00:00:06
Messages: 2
Offline

http://www.wselectric.net/

http://www.wselectric.net/phpinfo.php
[WWW]
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

Unfortunately it shows the error.png image for a number of errors. Could be the database is not set up correct or the information is incorrect. COuld be th epath to the fonts is incorrect.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
cartman-2000
Beginner
[Avatar]

Joined: 21/06/2003 06:42:30
Messages: 5
Offline

I have a problem using png counter on php5 too, I don't get an error image, but the script ignores the page and digit settings in the img url. I have it set up to use db.

http://cartman-2000.net/counter/demo.php?digit=binky

webmaster of sc.cartman2000.net
[Email] [WWW]
cartman-2000
Beginner
[Avatar]

Joined: 21/06/2003 06:42:30
Messages: 5
Offline

I've managed to fix it myself, only had to change one line of code. It didn't work before because of php5 not allowing register globals.


find in counter.php (last line of code in the file):

$counter->create_png($page,$digit);

Change to:

$counter->create_png($_GET['page'],$_GET['digit']);

webmaster of sc.cartman2000.net
[Email] [WWW]
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

Hmm if it's still set to use globals then it's older than I thought. I might download it when I get home and have a look. If what you say is true, and I have no reason to doubt you, then I'll email Chi Kien Uong and let him know it needs updating. Or you can email him. His address is in the menu on the left.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
cartman-2000
Beginner
[Avatar]

Joined: 21/06/2003 06:42:30
Messages: 5
Offline

Yeah, this is an old script, take a look at the copyright year in the counter.php file, the script is around 7 years old if that is correct.


the demo file will have to be updated as well.


this line.
$digit = (!isset($HTTP_GET_VARS['digit'])) ? "scoreboard" : $HTTP_GET_VARS['digit'];

Needs to be changed to:
$digit = (!isset($_GET['digit'])) ? "scoreboard" : $_GET['digit'];

Looks like they got rid of $HTTP_GET_VARS in php5

To my previous post, there's a another why of fixing it, probably the better way.

This way you don't need to change the "$counter->create_png($page,$digit);" line. all you need to change is this:

$page = (!isset($HTTP_GET_VARS['page'])) ? "count" : $HTTP_GET_VARS['page'];
$digit = (!isset($HTTP_GET_VARS['digit'])) ? "scoreboard" : $HTTP_GET_VARS['digit'];

to:

$page = (!isset($_GET['page'])) ? "count" : $_GET['page'];
$digit = (!isset($_GET['digit'])) ? "scoreboard" : $_GET['digit'];


I've also found a small bug in the counter script, after playing around with it some more. the bug doesn't break anything, but with the bug the initial hit to the counter that has a new page id will come back displaying 2 page views. Changing the two lines of $this->counter = 1; to $this->counter = 0; fixed this small bug.

I've sent him an email about this.

webmaster of sc.cartman2000.net
[Email] [WWW]
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4291
Location: Bristol, UK
Offline

To be honest support for the http_blah_vars style global was optional in PHP 4.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Siggy
Newbie

Joined: 30/07/2018 00:34:55
Messages: 1
Offline

Thank you for the fix.

The only thing not working is the ip block so the counter does not increment every page load.

Can someone suggest a fix
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum