MyBB Community Forums

Full Version: Add {boardname} to mod tools "thread" options.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Looking to have someone add the option for {boardname} to Mod Tool options on Thread tools.

{boardname} would indicate the board the thread originated in and not where its being moved to.

[attachment=45546]

I'd love to see this as a free plugin for others to use posted on the extend site. If anyone is interested in this but does not work for free please PM me, I'm willing to pay you to create this and then upload it to the extend site. Smile

Example
Thread "Lorem Ipsum" is located inside the "Communications" board. This thread has not been responded to in X amount of time so moderators use a tool to archive the thread.

Upon archiving the thread subject would be renamed to "Communications - Lorem Ipsum" and would now exist inside Archives board BUT the subject now states which board the thread originated in.



There was some confusion in the way I typed this so updated to reflect better description.

Quote:Original Post:
Looking to have someone add the option for {forumname} to Mod Tool options on Thread tools.

{forumname} would indicate the forum it originated in and not where its being moved to.

[attachment=45546]

I'd love to see this as a free plugin for others to use posted on the extend site. If anyone is interested in this but does not work for free please PM me, I'm willing to pay you to create this and then upload it to the extend site. Smile
if you need custom plugin I am at your service.
If I pay you for your time would you be willing to make it public for users to use for free?
Hello Taylor. I'm not a pro but I want to improve it. It looks like it will be fun. If I don't succeed, I'll report it below.
That should be pretty easy to do just you have to see where do you want to use that replacements, in the file: class_custommoderation.php that is inside of your inc directory you should find the parts to add.

You will find something like these:

Old Code Wrote:$find = array('{username}', '{author}', '{subject}');
$replace = array($mybb->user['username'], $thread['username'], $thread['subject']);
Just replace with:

New Replacement Wrote:$find = array('{username}', '{author}', '{subject}','{forumname}');
$replace = array($mybb->user['username'], $thread['username'], $thread['subject'], $mybb->settings['bbname']);

There are 4 calls in there so you have to add all replacements where you need and even in your lang file if you prefer:

I suppose that may work fine and it is pretty easy to do, so feel free to test it and let me know.

I will add the lines and codes you must add for the last mybb version (1.8.31):

Line 213 Wrote:$find = array('{username}', '{author}', '{subject}','{forumname}');
$replace = array($mybb->user['username'], $author['username'], $thread['subject'], $mybb->settings['bbname']);

Line 251 Wrote:$find = array('{username}', '{author}', '{subject}','{forumname}');
$replace = array($mybb->user['username'], $author['username'], $new_thread_subject, $mybb->settings['bbname']);

Line 457 Wrote:$find = array('{username}', '{author}', '{subject}', '{forumname}');
$replace = array($mybb->user['username'], $thread['username'], $thread['subject'], $mybb->settings['bbname']);

Line 563 Wrote:$find = array('{username}', '{author}', '{subject}','{forumname}');
$replace = array($mybb->user['username'], $thread['username'], $thread['subject'], $mybb->settings['bbname']);
if you want only add forum name of every thread to first of thread you can run this query

UPDATE `mybb_threads` t SET subject = Concat((SELECT name FROM mybb_forums WHERE fid = t.fid),' - ',subject )WHERE 1 
if you can not run query upload below file to root of forum and run one time from browser.
Core file edits aren't the best way to do it...and I guess it should be the name of the single forum where the thread is in.
(2022-11-12, 08:50 PM)SvePu Wrote: [ -> ]Core file edits aren't the best way to do it...and I guess it should be the name of the single forum where the thread is in.

even some one create this , no need core change , can add this as submenu in Admin CP!!!
(2022-11-12, 08:36 PM)Whiteneo Wrote: [ -> ]
Line 213 Wrote:$find = array('{username}', '{author}', '{subject}','{forumname}');
$replace = array($mybb->user['username'], $author['username'], $thread['subject'], $mybb->settings['bbname']);

Line 251 Wrote:$find = array('{username}', '{author}', '{subject}','{forumname}');
$replace = array($mybb->user['username'], $author['username'], $new_thread_subject, $mybb->settings['bbname']);

Line 457 Wrote:$find = array('{username}', '{author}', '{subject}', '{forumname}');
$replace = array($mybb->user['username'], $thread['username'], $thread['subject'], $mybb->settings['bbname']);

Line 563 Wrote:$find = array('{username}', '{author}', '{subject}','{forumname}');
$replace = array($mybb->user['username'], $thread['username'], $thread['subject'], $mybb->settings['bbname']);

Hi, sorry for the confusion. Forum Name is meant to be the name of the board not the website (which is $mybb->settings['bbname']), so I think I miscommunicated. Probably better as {boardname}.

Example
Thread "Lorem Ipsum" is located inside the "Communications" board. This thread has not been responded to in X amount of time so moderators use a tool to archive the thread.

Upon archiving the thread subject would be renamed to "Communications - Lorem Ipsum" and would now exist inside Archives board BUT the subject now states which board the thread originated in.
If I understood your meaning correctly , you need plugin with one setting that you select specific forums then when thread moved to that forums plugin automatically change thread name to , "destination forum + ' - ' + subject".
also we can add other settings to user be able change format of name Like :
{forum} - {subject}
{forum} {subject}
{forum}/{subject}
and any format user want can save to that setting.
Pages: 1 2