blueman378 Posted November 22, 2008 Share Posted November 22, 2008 Hi guys, im building a forum (pointless i know, but thats a different story) anyway i was wondering can someone explain to me how the mod system works on eg SMF, or Phpbb3? Cheers Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/ Share on other sites More sharing options...
.josh Posted November 22, 2008 Share Posted November 22, 2008 mod as in moderator or mod as in modifications/addons? Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-696163 Share on other sites More sharing options...
revraz Posted November 22, 2008 Share Posted November 22, 2008 I am going to assume Mod as in add-ons, and for PHPBB it's pretty simple, you just run a script. They also have a Mod that lets you install Mods and keeps track of them. Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-696256 Share on other sites More sharing options...
blueman378 Posted November 23, 2008 Author Share Posted November 23, 2008 yeah addon style mod, sorry for the confusion. anyway how does eg a mod to install a javascript clock work, are there eg sections and its defined in the mod script which section to install into, or a new link in the menu sort of thing? Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-696714 Share on other sites More sharing options...
redarrow Posted November 23, 2008 Share Posted November 23, 2008 That a plug-in <?php $rec['clock']="show";//databse result....... if($rec['clock']=="show"){ echo "<h1> Current time! <br> ".date("h:i:s" , time())." </h1>"; } ?> Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-696722 Share on other sites More sharing options...
redarrow Posted November 23, 2008 Share Posted November 23, 2008 play with this your get the idear ok..... <?php $rec['clock']="off";//databse result....... $rec['date']="on";//databse result....... if($rec['clock']=="on"){ echo "<h1> Current time! <br> ".date("h:i:s" , time())." </h1>"; } if($rec['date']=="off"){ echo "<h1> Current date! <br> ".date("d-m-y" , time())." </h1>"; } ?> all you do is use a new table column as 'off' or 'on' anythink you want on just update the database via a button or link insert on or off example above but your be using a database................. i think using a page for the design off your mod and using a include would be better, becouse you might want to add more modications to the mod.......... Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-696723 Share on other sites More sharing options...
blueman378 Posted November 23, 2008 Author Share Posted November 23, 2008 cheers. But how would the mod designer tell where to put the addon? im presuming that the forum admin doesnt have to go through the source code of the forum and tell it where to put it? Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-696729 Share on other sites More sharing options...
redarrow Posted November 23, 2008 Share Posted November 23, 2008 It all set in the template off the design off the website, with plug-in's in mind , if there on or off. Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-696764 Share on other sites More sharing options...
.josh Posted November 23, 2008 Share Posted November 23, 2008 Usually the software will have a folder called addons or whatever and you would put your addon script in there and the forum software will check what's in there. The forum software will also provide an interface for addons to use: a list of publicly available properties and methods. The people who make addons would be expected to include certain "tags" in their code, so that the forum software can properly install it. It looks into the addon folder, identifies an addon by a specific "config" filename that's in a specific format, opens the file, reads lines of code that specify what is supposed to be added where (like for instance, if you were wanting to add a new option on the "Home Help Search ..." tab). Then your addon script would use the available properties and methods (variables and functions) for doing whatever you want it to do. How many and what colors there are to color with is dependent on what the forum software people thought to include in the box. Or another way to put it: the forum software hands you xyz ingredients and you can mix and match them any way you like, and maybe you'll come up with some new dish they haven't included. But you're limited to whatever ingredients they give you. Those are the easiest mods to do. You use what's provided, do it in their format, put it in the folder, and the forum software will take care of the rest. Then there's the type of mods that involve changing that interface. Let's say for instance, you want to make a mod as described above, but you're lacking a certain ingredient to bake that cake. Maybe it's one number from a certain query that the forum devs didn't think to include in their interface for you. So you hack the interface scripts to pull that data from the database and list it among the available ingredients and otherwise go about your business. What exactly is involved in doing that, varies from software to software, obviously. A really good forum software might give you an interface for even that, or at least instructions on what to add and where. Then there's the type of mods that are more like straight hacks, where you go in and alter, add, remove things that can't easily be put into an interface. Maybe you're fixing some bug with sessions. Maybe you're adding an entire system that the dev team somehow managed to forget, like a PM system. Ideally, forum devs want to keep mod making at that first level. Realistically, it's usually at the 2nd level. They try the hardest to keep it from the 3rd level, because that's the sort of stuff that can give you a bad rep or have your script stolen. Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-696980 Share on other sites More sharing options...
PFMaBiSmAd Posted November 23, 2008 Share Posted November 23, 2008 Both SMF and Phpbb3 (and a lot of other existing forum scripts) are open source. Why not just download one or more and examine how it does what you are asking to find the answers to your existing and future as yet unasked questions on how they implement any specific feature. Link to comment https://forums.phpfreaks.com/topic/133771-forum-mod-system/#findComment-697004 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.