Advertisement:

Author Topic: Mod authors... Where to begin, you ask?  (Read 28745 times)

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Mod authors... Where to begin, you ask?
« on: July 27, 2007, 10:56:54 PM »
Recently, I've had a lot of people ask me how to code larger mods for SMF. What do I mean by "larger mods"? Well, the way that I see it, there's two types of SMF mods: Small mods, and large mods. Small mods just modify a small section of SMF (say, add a new setting, change how something operates, etc.). On the other hand, large mods are the type of mods that add their own button to the menu bar, have their own Source file, stuff like that. Of course, you've also got massive mods (like SMFShop, SMF Arcade and TinyPortal) which are quite heavy (and have their own modding community... These mods are the hardest to manage and easiest to break :P).

Anyways, most of the time, I point beginner modders to my SMFBlog mod. I intentionally kept the code as simple as possible, so other people can use it as an example. My mod demonstrates the following mod fundamentals:
  • Adding your own action (index.php?action=whatever).
  • Handling subactions (index.php?action=whatever;sa=something.
  • Adding another tab to the Features and Options section of the admin panel.
  • Using SMF templates and subtemplates.
  • Using the "postbox" (the box that people type posts in, with all the BBC buttons) in your own templates.
  • Rewriting URLs to pretty URLs via QueryString.php (in combination with mod_rewrite).
  • Adding an item to the menu in the default theme.
  • Using SMF's template layer system.
  • Adding something to the "linktree".
  • Using SSI functions in mods.

So, if you're stuck, take a look at the Blog.php and Blog.template.php files (as well as the install.xml file), see how they work, and feel free to use any bit of them in your own mods.

Hope this helps all you new mod developers :D. I know that when I first started writing SMF mods way back in 2004, there was very little documentation, and so I needed to guess quite a lot of things (and the code ended up very ugly :P). Now, things have changed quite a bit. There's still a distinct lack of documentation relating to mod development, but we're hoping to fix this. In the mean time, the best way to learn about modding SMF is by taking a look at existing mods, and the SMF source itself :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: Mod authors... Where to begin, you ask?
« Reply #1 on: July 27, 2007, 11:29:36 PM »
I can appreciate the amount of effort that goes into coding large mods.  I'm currently half way through re-writing my ad revenue sharing mod.

I have found using the examples in other modifications and indeed even core smf, as a good way to learn how to write good code aswelll as making good smf mods.
And even though I need to refer less and less to others, I will no doubt take a look at blog mod as I'm keen to learn new bits like SSI and making prettyurls.

Offline marcinikj

  • Semi-Newbie
  • *
  • Posts: 29
Re: Mod authors... Where to begin, you ask?
« Reply #2 on: May 09, 2008, 11:11:35 AM »
A big thank you to the mod author.  Looking through the php for this mod has explained more about using template, layers, actions and subactions than anywhere else I have seen.

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Mod authors... Where to begin, you ask?
« Reply #3 on: May 10, 2008, 01:19:15 AM »
Thanks for the help, Daniel. It's nice to see somebody putting forth a resource for mod authors, especially one like this. I never realized how comprehensive the SMFBlog mod actually was, that it covered all those bases. I will certainly have increased motivation to examine its code and how it performs some of these actions.

Thanks!
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: Mod authors... Where to begin, you ask?
« Reply #4 on: May 12, 2008, 03:41:38 AM »
Thanks Daniel. Can you or the other experienced mod authors give some key points about adding a specific panel to a mod, not using the ModSettings?
Former SMF Core Developer | My Mods | SimplePortal

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Mod authors... Where to begin, you ask?
« Reply #5 on: May 12, 2008, 08:05:50 AM »
I think his Shop mod is a good example of that.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: Mod authors... Where to begin, you ask?
« Reply #6 on: May 12, 2008, 08:09:41 AM »
Not an example I ask for. Just some key points.
Former SMF Core Developer | My Mods | SimplePortal

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: Mod authors... Where to begin, you ask?
« Reply #7 on: May 12, 2008, 08:19:25 AM »
What panel are you asking about?

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: Mod authors... Where to begin, you ask?
« Reply #8 on: May 12, 2008, 08:36:23 AM »
A panel like SMF Shop, SMF Gallery, SMF Arcade has.
Former SMF Core Developer | My Mods | SimplePortal

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: Mod authors... Where to begin, you ask?
« Reply #9 on: May 12, 2008, 08:38:05 AM »
You mean admin panel?
Why don't you look at the code? Thats the best place to start it.

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: Mod authors... Where to begin, you ask?
« Reply #10 on: August 01, 2008, 08:52:00 AM »
I can't find any reasonable place to ask my question, and haven't been able to find the answer after days of reading posts...

Just how the heck do you submit a mod once you've written it and tested it?

Offline Aaron

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,711
  • Gender: Male
    • Aaronweb.net
Re: Mod authors... Where to begin, you ask?
« Reply #11 on: August 01, 2008, 08:53:22 AM »
Go to the mod site and click 'Submit New Mod', which is located at the bottom of the page.

Offline Nathaniel

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,117
  • Gender: Male
    • Verbtest.com
Re: Mod authors... Where to begin, you ask?
« Reply #12 on: August 01, 2008, 09:00:07 AM »
@Deprecated,
If you have any coding related questions or issues, including mods and asking for help in developing or testing a mod then I suggest that you ask in the Coding Discussion Board. I am more than happy to help if you have any issues, as are many other more experienced modders.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: Mod authors... Where to begin, you ask?
« Reply #13 on: August 01, 2008, 09:18:50 AM »
Aaron, thanks for the info, and yeppers that's the page I needed. In fact the most difficult part of developing my mod was finding the secret page where you submit it. ;)

Really, is that page linked anywhere? I sure can't find any link "which is located at the bottom of the page." Unless I'm blind...

LHVWB, thanks for the tip, been there, done that, got the help! My mod, and it's a pretty small one, is ready to go. Just wondering, it's pretty small and not much to test, and it's about as tested out as I can do by myself. My current version level is 0.5 and I wonder if I should bump that to 1.0 to submit it, or leave it as is?

And okay my mod is really small and I understand it may not get accepted for that reason, which is okay with me. I developed it for myself and I like it just fine, and in the spirit of open source I'm offering it to those who may be interested. That's the most I can do.

But... I will appreciate if somebody would at least give me some feedback, whether upon the format of my package (guidelines etc.), or upon the concept and whether it's a useful function, or even by possibly installing it on a test forum and letting me know if it works okay for you. I have had zero feedback and one download. So if anybody would take a look at any part of my mod before I submit I'll appreciate it. Otherwise I'm done with it, and I'm moving on to developing a bigger mod that I'm almost certain will be well received and will get approved when it's done.

Here's the first mod:

Add IP2Location to Track IP (ver 0.5) -- Requesting critique on my mod package

I'll hold off submitting my mod to the modsite for a while in case I get any feedback, but I'm done with it unless somebody finds issues. Please post in the linked topic above if there is any feedback. Thanks!

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: Mod authors... Where to begin, you ask?
« Reply #14 on: August 01, 2008, 09:22:22 AM »
Its not a hidden page. Its the MAIN mod page.

Click customize, clicks Mods. which brings you to
http://custom.simplemachines.org/mods/

The link is there.
Mod Developers (in bold). Then has a link to submit a new mod, An example package, and documentation/info link

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: Mod authors... Where to begin, you ask?
« Reply #15 on: August 01, 2008, 09:34:45 AM »
I told ya, I'm blind! ;) :D

Actually, simplemachines.org is such a huge site, and I've read so, so, so, so many pages and topics and documentation the last few days that I'm almost going blind from so much reading.

It's difficult to not get enthused and involved in such an interesting project. I just started my own SMF based forum less than two weeks ago and the software is GREAT!!! :D

I've never had a forum where I could actually modify the code!
« Last Edit: August 01, 2008, 09:38:57 AM by Deprecated »

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: Mod authors... Where to begin, you ask?
« Reply #16 on: August 01, 2008, 11:20:41 AM »
Deprecated; you can try setting up a local and coding your mods there.

Also add this code in to your Settings.php file and you will be using the debug mode:

Code: [Select]
$db_show_debug = true;
What I like most in SMF is, even we regular people can understand what is coded. In other forum softwares, usually, only Developers understand what they code.
Former SMF Core Developer | My Mods | SimplePortal

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: Mod authors... Where to begin, you ask?
« Reply #17 on: August 01, 2008, 11:33:24 AM »
We regular people? Maybe you are. I'm a bit irregular at times. ;)

Thanks for the suggestion regarding db_show_debug. As far as local server, I had considered that and maybe I might, but I've got a test forum set up on a different URL and different server than my production forum and it's very useful, and for sure will help me keep from goofing and blowing my users offline.

I'm already starting to learn my way around SMF and I've only been looking at the code about a week or less. I'm a professional developer and I'm used to projects about this size, although of course not one person projects. I'd hate to have to write this much code all by myself! :)

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 29,930
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Mod authors... Where to begin, you ask?
« Reply #18 on: August 01, 2008, 09:07:20 PM »
If you have suggestions for us to improve the layout of our site or any page, please feel free to suggest them in site comments :)
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: Mod authors... Where to begin, you ask?
« Reply #19 on: August 01, 2008, 10:29:59 PM »
Sleeeeeepy!!! I tole you, I'm blind!  ;)

I'll do better than that. I'm already writing mod packages, and maybe I'll come help you guys write SMF code when I get more familiar with the software base. :)