Welcome, Guest. Please login or register.
Did you miss your activation email? October 07, 2008, 07:24:32 PM
Did you miss your activation email? October 07, 2008, 07:24:32 PM
SMF Team Blog
Mod authors... Where to begin, you ask?
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
).
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:
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
. 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
). 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 
).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
. 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
). 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 
Loading...
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.
Thanks!
Why don't you look at the code? Thats the best place to start it.
Just how the heck do you submit a mod once you've written it and tested it?
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.
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!
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
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!!!
I've never had a forum where I could actually modify the code!
Also add this code in to your Settings.php file and you will be using the debug mode:
$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.
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!
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.
If you think of a good idea that might help it become more predominate in peoples searches, I wouldn't mind hearing it. Its users ideas that keep the project rolling