Modifying 'New Thread' attributes
hansolo Offline
Junior Member
**
Posts: 22
Joined: Sep 2015
Post: #1
Modifying 'New Thread' attributes
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!
09-14-2015 11:11 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #2
RE: Modifying 'New Thread' attributes
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.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 09-16-2015 09:44 PM by leefish.)
09-16-2015 12:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
hansolo Offline
Junior Member
**
Posts: 22
Joined: Sep 2015
Post: #3
RE: Modifying 'New Thread' attributes
Oh OK thanks I'll try that
09-16-2015 01:23 PM
Find all posts by this user Quote this message in a reply
hansolo Offline
Junior Member
**
Posts: 22
Joined: Sep 2015
Post: #4
RE: Modifying 'New Thread' attributes
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?
09-16-2015 05:48 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #5
RE: Modifying 'New Thread' attributes
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.


[Image: leelink.gif]
MYBB1.6 & XThreads
09-16-2015 06:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Modifying 'New Thread' attributes
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.

My Blog
09-17-2015 10:29 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: