Dragonfly CMS v9 ⇒ Modules & Blocks :: Archives ⇒ Stats signature for DragonlfyCMS :: Archived (page 3) ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

Archived ⇒ Stats signature for DragonlfyCMS


I think this was the old 9.0.6.1 code but cannot be sure as it was so long ago.
<?php if (isset($_GET['viewsource'])) { highlight_file(__FILE__); exit; } define('XMLFEED', 1); include('includes/cmsinit.inc'); $CLASS['member'] =& new cpg_member(); $userinfo =& $CLASS['member']->members[$CLASS['member']->user_id]; if (is_user()) { $slogan = $userinfo['username']." you have $userinfo[user_new_privmsg] new & $userinfo[user_unread_privmsg] unread PM's"; } $result = $db->sql_query("SELECT COUNT(*) FROM ".$prefix."_users", true); list($users) = $db->sql_fetchrow($result); $db->sql_freeresult($result); $users--; $result = $db->sql_query("SELECT title FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 1", true); list($news) = $db->sql_fetchrow($result); $db->sql_freeresult($result); if (strlen($news) > 34) $news = substr($news,0,31).'...'; $result = $db->sql_query("SELECT COUNT(*) FROM ".$prefix."_session WHERE guest = 0", true); list($memonl) = $db->sql_fetchrow($result); $db->sql_freeresult($result); $result = $db->sql_query("SELECT COUNT(*) FROM ".$prefix."_session WHERE guest = 1", true); list($anonl) = $db->sql_fetchrow($result); $db->sql_freeresult($result); $image = "signature.png"; $im = imagecreatefrompng($image); if (date("s") < 30) $tc = ImageColorAllocate($im, 102, 0, 0); else $tc = ImageColorAllocate($im, 102, 0, 0); ImageString($im, 3, 48, 1, date("H:i:s"), $tc); ImageString($im, 4, 181, 2, "Live statistics of $sitename", $tc); ImageString($im, 3, 181, 18, "Latest news: $news", $tc); ImageString($im, 3, 181, 32, "Tot Members: $users", $tc); ImageString($im, 3, 181, 45, "Now online : $memonl members and $anonl guests", $tc); ImageString($im, 3, 181, 60, "$slogan", $tc); header('Pragma: public'); header('Pragma: no-cache'); header("Content-Type: image/png"); Imagepng($im,'',100); ImageDestroy($im);

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


@TouchDown - after some testing, there does appear to be an issue with the signature.

It simply doesn't work in PHP5, specifically 5.2, but is fine in 4.4.4, and I'm fairly certain that it was fine with 5.1.4.

It doesn't even work on this site Laughing

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


I know its not work in that site. its probably need include to security file.

Firefox is my Favorite Browser

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS


nothing to do with including the security file - it doesn't work on this site either.
(in 9.1.x, missing the security file gives an error, but there are no errors)

dragonflycms.org/stats...viewsource
dragonflycms.org/statsig.php
dragonflycms.org/signature.png

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Phoenix wrote
nothing to do with including the security file - it doesn't work on this site either.
(in 9.1.x, missing the security file gives an error, but there are no errors)

dragonflycms.org/stats...viewsource
dragonflycms.org/statsig.php
dragonflycms.org/signature.png


<b>Fatal error</b>: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in <b>/home/cpgn/public_html/statsig.php</b> on line <b>56</b><br />
😁

Firefox is my Favorite Browser

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS


bug in Zend, the zlib library needs to be upgraded and GD needs to be recompiled Twisted Evil

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


xfsunoles wrote
<b>Fatal error</b>: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in <b>/home/cpgn/public_html/statsig.php</b> on line <b>56</b><br />
😁
Well GFY xfsunoles - I can't get an error displayed on this site or mine, let alone the full path you show.

Change
imagepng($im,'',100);

To
imagepng($im,'',9);

statsig will then work in PHP5 - the compression argument should be 0 to 9.
(dragonflycms.org copy fixed)

For that matter, you might even get a smaller image if you use,
imagepng($im,'',9,PNG_ALL_FILTER);

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


can anyone tell me how I can get the script to also save the image as a png, for forums that will not accept .php in image tags.....

Please enter your server specs in your user profile! 😢


Doesnt matter, done it through htaccess now.....

Please enter your server specs in your user profile! 😢


It still doesn't work here Evil or Very Mad

Regards,
Fabke - www.airshows.be

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux srv122 2.6.18-6/5.0.32-Debian/5.2.7/Dragonfly 9.0.6.1


When I try this at my site, i get this error:Fatal error: Call to undefined function: imagettftext() in /usr/local/psa/home/vhosts/krypinn.net/subdomains/bf2stat/httpdocs/statsig.php on line 46

Is this a standard PHP function or a module? My server runs PHP 4.4.2



Espen

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
FreeBSD 4.10/1.3.37/5.0.27/5.2.4/9.2.1


Your answer lies in this very topic Smile

dragonflycms.org/Forum...tml#120285

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


The problem is gone after the image signature.png was added to the root..


Espen

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
FreeBSD 4.10/1.3.37/5.0.27/5.2.4/9.2.1

All times are UTC