Dragonfly CMS v9 ⇒ Modules & Blocks :: Archives ⇒ Develop a new module for data visualization (swim) :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

Archived ⇒ Develop a new module for data visualization (swim)


Hi guys,
i'm in a swimming team and we are usign dragonfly for the next version of our site.

We got a custom db table (not one from Dragonfly pkg) that contains all our swim data: times, dates, places, etc.

I'd like to create a new module (but in the future i think even a block will be needed) to show those infos.

I'm not a php developer and i'm not so smart to understand fastly what to do to create that module.

Can someone help me do that? Even docs and links where to find info is ok.

Is there anyother swimmer outhere that wants to partecipate to this project?

Thanks in advance

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.x


well over on DF Bounty they are working on an exercise module .. you could probably use that some how.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Windows XP/Apache 2.0.52/MySQL 4.0.21/PHP 5.0.2/DragonflyCMS 9.0.6.0/ Mozilla Firefox1.7x IE6 Opera 8.0


it is very easy to take things out of a db and show it.

to make a module you need to do something along these lines:

if(!defined('CPG_NUKE')) exit(); global $prefix,$db,$userinfo; $pagetitle='Swim stuff '._BC_DELIM.' Stats'; require_once('header.php'); echo 'Hello '.$userinfo['username'].'<hr />'; $res=$db->sql_query('SELECT * FROM '.$prefix.'_module_table WHERE 1'); while($out=$db->sql_fetchrow($res)) { echo 'something: '.$out['column_name'].'<br />'; echo 'stuff: '.$out['stuffs_column_name'].'<br />'; echo 'something else: '.$out['other_column_name'].'<hr />'; } require_once('footer.php');

That is very simplistic, and if the table is not df then no need to use the $prefix variable.

That is the general lines of it.

to make a block take out the $pagetitle, require_once('header.php');, and require_once('footer.php');, and relace all echo with $content.=

that's about it. have fun.

EDIT: well u get the general idea...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux (Kernel: 2.4.21-27.0.2.ELsmp)/1.3.33 (Unix)/4.0.24-standard/4.3.11/9.0.5.0

Last edited by mc__ on Wed Nov 16, 2005 5:50 am; edited 1 time in total


echo 'Hello '.$userinfo['username'].'<hr />;
to
echo 'Hello '.$userinfo['username'].'<hr />';

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


beforelast wrote
well over on DF Bounty they are working on an exercise module .. you could probably use that some how.


ehm, I dind't find that exercise module: may you point me to that (if you know it).

Thanks

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.x


Hmmm... this may be strange because the module is technically designed for clans playing games, but you could always try Mteam from markroper.uk.

Here's the link:

www.markroper.co.uk/in...amp;did=17

You could also just enter the info into one of the calendars for download I suppose, although that may be a little time intensive....

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


great, thanks! I'll study it

But seems strange only to me that there is almosto NO documentation about DragonFly? I found nothing useful in the main site, I don't know if it's in a different place.

I mean: if someone with very poor experience in php development (like me) wants to start learn and develop some modules/blocks how should he do?

Thanks & Regards

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.x


I've start compile a webpage to collect tips during my exploration of modules/blocks development.

If you'd like to correct/include something just drop me an email.

Maybe a day we will be able to put it into the Doc wiki.

Thanks and regards.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
9.x

All times are UTC