MyBB Hacks

Full Version: Modifying 'New Thread' attributes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

This looks like an interesting site. I came here via an XThreads plugin recommendation.

I am looking to make a custom sub-forum which behaves differently to a normal one. The threads in this forum will be more than mere threads, and will have additional functionality.

My question is: how can I modify the 'New Thread' button and 'Thread Subject' aspects? E.g. in the hypothetical 'Cheese' subforum, there would be a 'New Cheese' button, and then the user would specify the 'Cheese Name' instead of the 'Thread Subject'?

Can I make these modifications by writing a plugin? Or is this beyond the capabilities of plugins? If so, how does one modify MyBB to do this without crippling the ability to receive updates?

Many Thanks!
These are template edits Smile

Go to the forum settings and create a prefix  cheese_  

Then you can use any templates from the postbit, showthread, forumdisplay forumbits, new thread, new reply, edit post and create a new template with the prefix cheese_

Example: cheese_forumdisplay_threadlist - and then that template will be used as forumdisplay_threadlist in the forum(s) with the prefix cheese.
Oh OK thanks I'll try that
OK so I've added a new template according to this XThreads prefix feature, and it works.

However: to do this I need to add a new entry to a .lang.php file (e.g. "$l['post_cheese'] = "New Cheese";). This feels like I'm modifying the forum software though, won't this be broken if I ever update MyBB? If so, how should I be doing this?
You can create a lang file for just that set of forums. Look at how the YouTube gallery example is set up.

Yea, you are modifying the software in that if you ever update MyBB to MyBB 2.0 then XThreads wont work. No plugins made for the 1.x series  will.
You can use the Language File Prefix option instead, if all you wish to change is the text.  You'll need to make copies of newthread.lang.php etc, modifying the text inside this copy.
It's nicer than modifying existing language files, since an upgrade won't trash your modifications, and since XThreads loads the default file before your modified version, even if new text is added in an upgrade, you won't need to update your modification.

If you wish to use custom templates, you could always just remove the {$lang->...} variable and enter the text directly.  The downside of using custom templates is that you may need to update them if you upgrade MyBB.
Reference URL's