MyBB Community Forums

Full Version: Plugin adding whole new functionality, new page or hook into misc.php?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Right so I have finished the back-end of my tipping competition and am now moving onto the front-end.

The back-end is a new module under admin.

Now the new tipping competition page is going to have the following features

- List of available comps
- Leaderboard
- Enter-tips
- Sign-up
- edit tips

and a few others. Normally in the past when I have written this sort of stuff I just add a new page, as this is more or less a new functionality.

However I figure I could write the plugin file, hook into something like misc_start and then use that to display the above as needed using whatever flags.

Benefits of that are that there is less new clutter being added to peoples sites.

Down side, is that everything gets fed through misc.php. I personally prefer to have my URL's something like mysite.com/tipping-competition.php

or better still mysite.com/tipping-comps/NRL-tipping-comp/ladder (i.e. the competition name

That way it keeps my content well described etc.

Just wondering what the school of thought on this is?

Dan
I would just add a new file personally. If you're adding multiple pages, it's worth it. If you're only adding 1, hook into misc.
Cool I figured that was going to be the best way to do this. I just thought I would make it as simple as possible. I don't really like having misc.php?tipping-comp=8 etc

I might pop them inside a folder to make this better too
You could use .htaccess to change the url to appear as you wanted?
Yeah that is an option and will work fot me but it wont work for those who dont use htaccess. Thats always the hard part. I think using misc is ultimately better as it preserves functionality and makes things easier for upgrades and maintenence. I think I will toy with a mixture of both