Home Private Messages Search
CPG Dragonfly™ CMS stopsoftwarepatents.eu petition banner
Toggle Content
 
Forums ⇒ DragonflyCMS ⇒ Add-Ons & Blocks :: Archives ⇒ Stats signature for DragonlfyCMS :: Archived


Stats signature for DragonlfyCMS :: Archived
Need help creating a block or add-on, or you have created or modified a block/add-on that works in Dragonfly CMS and it meets the CPG Security Requirements? Do you have feedback about a specific add-on? Here is the place to post. Read the announcements here first!.
Go to page 1, 2, 3  Next
Post new topic    Revive this topic    Printer Friendly Page     Forum Index ⇒  Add-Ons & Blocks

Topic Archived View previous topic :: View next topic  
Author Message
TouchDown
Newbie
Newbie

Offline Offline
Joined: Jun 10, 2006
Posts: 36
Location: Barcelona (Spain)
PostPosted: Sat Jul 08, 2006 10:19 pm
Post subject: Stats signature for DragonlfyCMS

Hello!

I'm trying to port the module "NukeSigs" from phpnuke to CPGNuke.

I've read the "Developers Manual - Porting Aplications To CPGDragonfly". At the point 4, it says: "This basically means that at no point are you allowed to point a URL at the modules directory to run an application.

For example, the URL: localhost/modules/MyApp/print.php?id=12 is not allowed. The CPG Dragonfly CMS™ Security Module does not and will not allow for it. It's a security thing and you're just going to need to deal with it as best you can."

The module that I try to port is a signature image that displays Members & Guests Online, Current Members, Today's Members and Total Hits. This module come with 4 designs to choose from.

The module works, but don't show the sample images that are image.png, image.png?id=1, image.png?id=2.....

And if I put this code to my signature at the profile, it don't show nothing.

This module would be a great module.

Please, can someone help me to port this module?

Thank you in advance!


TouchDown's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD/Apache 2.0.59/MySQL 5.0.33/PHP 5.2.3/CPGNuke 9.1.2.1
Back to top
View user's profile Visit poster's website
jzky
Supporter
Supporter

Offline Offline
Joined: Jun 25, 2004
Posts: 220
Location: Norway - Harstad
PostPosted: Sun Jul 09, 2006 12:07 am
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

something like this : dragonflycms.org/Forum...rt=45.html

_________________
www.jzky.net a Dragonfly site. cms.jzky.net < test site. - Pardon my bad englsih WinkMy home town

jzky's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux / Apache / PHP Version 5.2.0 /MySQL Version 4.1.21-standard / CMS Version 9.1.1
Back to top
View user's profile Visit poster's website
TouchDown
Newbie
Newbie

Offline Offline
Joined: Jun 10, 2006
Posts: 36
Location: Barcelona (Spain)
PostPosted: Sun Jul 09, 2006 1:53 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

yes, something like this, but I can't find all the archives that the signature need to run.

I searched this forum, but the major links that are posted to the forum that you gave me the link don't work.


TouchDown's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD/Apache 2.0.59/MySQL 5.0.33/PHP 5.2.3/CPGNuke 9.1.2.1
Back to top
View user's profile Visit poster's website
djdevon3
Gold Supporter
Gold Supporter

Offline Offline
Joined: Aug 05, 2004
Posts: 4363

PostPosted: Mon Jul 10, 2006 12:56 am
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

No need to port that. Something like that already exists for Dragonfly and is easily modified to display whatever information you want from your database. You just have to know how to connect to the info. Follow this link and if you have a question ask it there.
dragonflycms.org/Forum...art=0.html

I helped to create the MyStatus Module for dynamic signatures here to show developer status but it could easily be modified to show whatever you want and be administrated via admin interface. For what you want I think it would be easier for you to start with that and tweak it for your uses then port over the nuke module.


djdevon3's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33/4.4/4.3.11


Last edited by djdevon3 on Mon Jul 10, 2006 8:10 pm; edited 1 time in total
Back to top
View user's profile Visit poster's website Photo Gallery
TouchDown
Newbie
Newbie

Offline Offline
Joined: Jun 10, 2006
Posts: 36
Location: Barcelona (Spain)
PostPosted: Mon Jul 10, 2006 4:56 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

Thanks djdevon3! I've tryied a lot but now I recieve this message "Fatal error: require_once() [function.require]: Failed opening required 'C:/Servidor/wamp/www/includes/classes/security.php' (include_path='.;C:\php5\pear') in C:\Servidor\wamp\www\StatSig2.php on line 8". I've searched and I don't have the file called security.php

PHP:
<?php
if (isset($_GET['viewsource'])) {
highlight_file(__FILE__);
exit;
}
define('XMLFEED', 1);
include(
'includes/cmsinit.inc');
require_once(
BASEDIR.'includes/classes/security.php');
require_once(
BASEDIR.'includes/classes/cpg_member.php');
$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 ".$user_prefix."_users", true);
list(
$users) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$users--;
/*
$sql = "SELECT uname FROM ".$prefix."_userinfo_admin";
$result = $db->sql_query($sql, true);
$admins = $db->sql_numrows($result);
while ($row = $db->sql_fetchrow($result)) $admins .= ", $row[0]";
*/
$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, 255, 231, 115);
else
$tc = ImageColorAllocate($im, 148, 255, 57);
//ImageString($im, 1, 50, 6, date('H:i:s'), $tc);
imagettftext($im, 8, 0, 50, 13, $tc, 'includes/fonts/transistor.ttf', date('H : i : s'));
imagettftext($im, 7, 0, 105, 12, $tc, 'includes/fonts/dodger.ttf', "Live statistics of Dragonfly CMS");
//ImageString($im, 3, 105, 2, "Live statistics of $sitename", $tc);
ImageString($im, 2, 105, 14, "Latest news: $news", $tc);
ImageString($im, 2, 105, 24, "Tot Members: $users", $tc);
ImageString($im, 2, 105, 34, "Now online : $memonl members and $anonl guests", $tc);
ImageString($im, 1, 105, 48, "$slogan", $tc);
header('Pragma: public');
header('Pragma: no-cache');
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy($im);
?>

Thanks in advance!


TouchDown's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD/Apache 2.0.59/MySQL 5.0.33/PHP 5.2.3/CPGNuke 9.1.2.1
Back to top
View user's profile Visit poster's website
djdevon3
Gold Supporter
Gold Supporter

Offline Offline
Joined: Aug 05, 2004
Posts: 4363

PostPosted: Mon Jul 10, 2006 8:12 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

whoops i guess my copy and paste of the 2nd url didn't work and didn't notice it. it was the same link as the first. there i've fixed it. check out the link to the mystatus module again.

if you want the working code for statsig i guess i could zip that up and offer it as a download on my site as well.


djdevon3's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/1.3.33/4.4/4.3.11
Back to top
View user's profile Visit poster's website Photo Gallery
TouchDown
Newbie
Newbie

Offline Offline
Joined: Jun 10, 2006
Posts: 36
Location: Barcelona (Spain)
PostPosted: Mon Jul 10, 2006 9:59 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

djdevon3 wrote:
if you want the working code for statsig i guess i could zip that up and offer it as a download on my site as well.

Please put the zip of statsig to download.

And sorry but I can't get to DF_MyStatus work, I copy the code that say in the admin section of the module "[im g]http://penyatd.no-ip.info/MyStatus.php[/i mg]" and don't show nothing.

What's wrong? Praying
I'm completely stupid Doh

This in phpnuke is easiest, but in CPG Dragonfly I have to learn more, and more.

Thank you in advance!


TouchDown's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD/Apache 2.0.59/MySQL 5.0.33/PHP 5.2.3/CPGNuke 9.1.2.1


Last edited by TouchDown on Tue Jul 11, 2006 11:49 am; edited 1 time in total
Back to top
View user's profile Visit poster's website
bigern75
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Aug 18, 2004
Posts: 2102
Location: River Valley - FS AR
PostPosted: Mon Jul 10, 2006 10:42 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

When you call for it, you have to use image tags.
Code::
 [img] http://dfaddons.com/statsig.php [/img]

I also have this one

Code::
 [img] http://www.coddepot.com/StatSig3.php [/img] 

_________________
iPad 1

bigern75's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.6/5.0.86/5.2.8/9.3.2
Back to top
View user's profile Visit poster's website
bigern75
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Aug 18, 2004
Posts: 2102
Location: River Valley - FS AR
PostPosted: Mon Jul 10, 2006 10:48 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

Take this code and make it a php file. ex. statsig.php then make an image big enough to fit the info and call it signature.png (or whatever u want, just change it in this code) Put both files into your root dir (public_html) and call the php file inside image tags.


EDIT: I had cvs code in there. Here is 9.0.6.1 code-


Code::
<?php
if (isset($_GET['viewsource'])) {
    highlight_file(__FILE__);
    exit;
}
define('XMLFEED', 1);
include('includes/cmsinit.inc');
//require_once(BASEDIR.'includes/classes/security.php');
require_once(BASEDIR.'includes/classes/cpg_member.php');
$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 ".$user_prefix."_users", true);
list($users) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$users--;
/*
$sql = "SELECT uname FROM ".$prefix."_userinfo_admin";
$result = $db->sql_query($sql, true);
$admins = $db->sql_numrows($result);
while ($row = $db->sql_fetchrow($result)) $admins .= ", $row[0]";
*/
$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, 255, 231, 115);
else
    $tc = ImageColorAllocate($im, 148, 255, 57);
//ImageString($im, 1, 50, 6, date('H:i:s'), $tc);
imagettftext($im, 8, 0, 50, 13, $tc, 'includes/fonts/transistor.ttf', date('H : i : s'));
imagettftext($im, 7, 0, 105, 12, $tc, 'includes/fonts/dodger.ttf', "Live statistics of Dragonfly CMS");
//ImageString($im, 3, 105, 2, "Live statistics of $sitename", $tc);
ImageString($im, 2, 105, 14, "Latest news: $news", $tc);
ImageString($im, 2, 105, 24, "Tot Members: $users", $tc);
ImageString($im, 2, 105, 34, "Now online : $memonl members and $anonl guests", $tc);
ImageString($im, 1, 105, 48, "$slogan", $tc);
header('Pragma: public');
header('Pragma: no-cache');
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy($im);


_________________
iPad 1

bigern75's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.6/5.0.86/5.2.8/9.3.2
Back to top
View user's profile Visit poster's website
TouchDown
Newbie
Newbie

Offline Offline
Joined: Jun 10, 2006
Posts: 36
Location: Barcelona (Spain)
PostPosted: Tue Jul 11, 2006 3:57 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

Hello! I've tried a lot and I'm desperate.

The DF_MyStatus don't show the image, I've copied [img] http:// penyatd.no-ip.info/MyStatus.php [/img] and there is no image or text showed.

With StatSig, the same if I put one of your StatSig images, this are showed, but my statsig not. [img] http:// penyatd.no-ip.info/StatSig.php [/img]

You can view the code of the signatures here: penyatd.no-ip.info/ind...e&p=38

Also I've added this line of code at .htaccess of the root directory "RewriteRule ^StatSig\.png /StatSig.php [L]"

If I put dfaddons.com/statsig.php or www.coddepot.com/StatSig3.php in the navigator, I've get your signatures, but if I put
penyatd.no-ip.info/MyStatus.php I've get the code inside the php, or if I put penyatd.no-ip.info/StatSig.php I've get "http://MY_IP/StatSig.php".

I'd don't know what happens! Because I've passed the GFXChecker and it's Ok!

I don't have the file includes/classes/security.php, is correctly?

Thank you for the inconvenience!


TouchDown's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD/Apache 2.0.59/MySQL 5.0.33/PHP 5.2.3/CPGNuke 9.1.2.1
Back to top
View user's profile Visit poster's website
bigern75
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Aug 18, 2004
Posts: 2102
Location: River Valley - FS AR
PostPosted: Tue Jul 11, 2006 4:35 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

Try this...

_________________
iPad 1

bigern75's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.6/5.0.86/5.2.8/9.3.2
Back to top
View user's profile Visit poster's website
TouchDown
Newbie
Newbie

Offline Offline
Joined: Jun 10, 2006
Posts: 36
Location: Barcelona (Spain)
PostPosted: Tue Jul 11, 2006 4:56 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

Nothing... The same... Crying or Very sad

There will be a problem with the software to make the server or something else.

Thank you for the inconveniences!


TouchDown's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD/Apache 2.0.59/MySQL 5.0.33/PHP 5.2.3/CPGNuke 9.1.2.1
Back to top
View user's profile Visit poster's website
bigern75
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Aug 18, 2004
Posts: 2102
Location: River Valley - FS AR
PostPosted: Tue Jul 11, 2006 4:59 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

where are you putting these files? Make sure they are in the same dir as your index.php, and all of those main files. ex.public_html/statsig.php & public_html/signature.png

_________________
iPad 1

bigern75's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.6/5.0.86/5.2.8/9.3.2
Back to top
View user's profile Visit poster's website
TouchDown
Newbie
Newbie

Offline Offline
Joined: Jun 10, 2006
Posts: 36
Location: Barcelona (Spain)
PostPosted: Tue Jul 11, 2006 5:01 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

I put the files in the root dir. The signature.png and the statsig.php at the root dir where is the admin, blocks, modules, themes....


TouchDown's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
FreeBSD/Apache 2.0.59/MySQL 5.0.33/PHP 5.2.3/CPGNuke 9.1.2.1
Back to top
View user's profile Visit poster's website
bigern75
Platinum Supporter
Platinum Supporter

Offline Offline
Joined: Aug 18, 2004
Posts: 2102
Location: River Valley - FS AR
PostPosted: Tue Jul 11, 2006 5:08 pm
Post subject: Re: Port phpnuke module "NukeSigs" to CPGNuke

are you running this from a local server or something? Everytime I go to the site it gives me the IP instead of the domain.

_________________
iPad 1

bigern75's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.6/5.0.86/5.2.8/9.3.2
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic    Revive this topic    Printer Friendly Page    Forum Index ⇒  Add-Ons & Blocks
Page 1 of 3
All times are GMT
Go to page 1, 2, 3  Next

Archive Revive
Username:
This is an archived topic - your reply will not be appended here.
Instead, a new topic will be generated in the active forum.
The new topic will provide a reference link to this archived topic.
 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

read more...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy