ElkArte Community

Project Support => General ElkArte discussions => Topic started by: vbgamer45 on January 29, 2017, 09:22:33 pm

Title: Guide for Addon Development for ElkArte
Post by: vbgamer45 on January 29, 2017, 09:22:33 pm
Guide for Addon Development for ElkArte mainly if you are coming from SMF?

In the creation of some of my addons I noticed a couple things that have changed. And thinking it would be helpful to a list/start guide on the conversion process.
Title: Re: Guide for Addon Development for ElkArte
Post by: ahrasis on January 30, 2017, 06:01:18 am
I think there is no specific guide for the time being but they are basically the same with most important aspects of it have been discussed and posted here and there in this forum.

All addon package will need one package-info.xml file. Hooks to EA (http://www.elkarte.net/community/index.php?topic=2192.0) can be put directly inside that file or otherwise use a separate file. Manual modification, though not encouraged, when necessary can still be used.

For the
directory (http://www.elkarte.net/community/index.php?topic=1406.0), the main ones are redefined like BOARDDIR and SOURCEDIR instead of the ones previously used like $boarddir and $sourcedir. Specially for source files, they are divided to admin, controller, subs, etc instead of lumping everything together in one source directory.

And for
database (http://www.elkarte.net/community/index.php?topic=2165.0), we use $db = database(); $dbtbl = db_table(); instead of using $smcFunc.

I can't think of everything else for the time being, mainly because I myself am not so good with any of them. I only manage to do few simple addons migration or creation when I really focus and put my mind unto it but, most of the time, I tend to get confused or forget and start researching about them all over again whenever I have time to look back into them.

I really like to see more and more smf mods and themes authors coming and thus wish them all with very good luck!
Title: Re: Guide for Addon Development for ElkArte
Post by: emanuele on January 30, 2017, 07:10:50 am
You mean something like
Quoteinstead of $smcFunc['db_query'] use:
$db = database();
$db->query('', 'query');
and things like that?

Time, time, time... xD
Title: Re: Guide for Addon Development for ElkArte
Post by: vbgamer45 on January 30, 2017, 07:29:35 am
Yeah if not I was going to write something up.
Title: Re: Guide for Addon Development for ElkArte
Post by: emanuele on January 30, 2017, 08:15:36 am
If you want to, feel free!!
That's actually the spirit. ;)