MyBB Community Forums

Full Version: "Post New Thread" changer per node
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically, I want a plugin developed that does the following, for myBB 1.8.x.

It adds an additional option to each forum/subforum, and will replace the default. By default it should be Post new thread. It should override the forumdisplay.lang.php option (if its possible)

Basically, I want to change "Post New Thread", to "Ask a question", or "Post a resource", but it needs to be in select sections. There can be different ones in different sections.

Example:

News and Announcements: "Post New Thread"
Resource submissions: "Submit a resource"
Questions section: "Ask a question"

Thanks, let me know if you can make this for me.
I can think of a way to do this using language files which would save the need to have a full plugin developed with a new field in the ACP. Try this (completely untested):

Put this in a file called newthreadtext.php in ./inc/plugins

<?php

if(!defined('IN_MYBB'))
{
	die('This file cannot be accessed directly.');
}

$plugins->add_hook('forumdisplay_start', 'newthreadtext');

function newthreadtext_info()
{
	return array(
		'name'			=> 'New Thread Text',
		'description'	=> 'Change the text on the new thread button per forum',
		'website'		=> 'https://matt.rogow.ski/',
		'author'		=> 'Matt Rogowski',
		'authorsite'	=> 'https://matt.rogow.ski/',
		'version'		=> '0.1',
		'compatibility'	=> '18*',
		'codename'		=> 'newthreadtext'
	);
}

function newthreadtext()
{
	global $mybb, $lang;

	$lang->load('forumdisplay_'.$mybb->input['fid'], false, true);
}

Activate the plugin in the ACP.

Then, for each forum you want to use this on, create a new language file in ./inc/languages/english, called forumdisplay_X.lang.php, where X is the ID of the forum. So, for this plugin requests forum we're in now, you'd call it forumdisplay_65.lang.php

Then, inside each file, add this:

<?php

$l['post_thread'] = "Post Thread";

Then change the text to whatever you want it to be.

This will overwrite the default text if you have a file for that form, but use the default text if you don't.

It is kinda hacky but it should work.
Matt I am looking for something similar but I need it to just put this on each postbit with a small box to put the answers in like this:

Genre: posters answer
ISBN / ASIN: 1111111
Original Source: gutenberg

I have many forums for it to appear in on new thread, all the ebook categories I have template conditions and Xthreads installed.
(2016-09-21, 12:42 PM)Matt Wrote: [ -> ]I can think of a way to do this using language files which would save the need to have a full plugin developed with a new field in the ACP. Try this (completely untested):

Put this in a file called newthreadtext.php in ./inc/plugins

<?php

if(!defined('IN_MYBB'))
{
	die('This file cannot be accessed directly.');
}

$plugins->add_hook('forumdisplay_start', 'newthreadtext');

function newthreadtext_info()
{
	return array(
		'name'			=> 'New Thread Text',
		'description'	=> 'Change the text on the new thread button per forum',
		'website'		=> 'https://matt.rogow.ski/',
		'author'		=> 'Matt Rogowski',
		'authorsite'	=> 'https://matt.rogow.ski/',
		'version'		=> '0.1',
		'compatibility'	=> '18*',
		'codename'		=> 'newthreadtext'
	);
}

function newthreadtext()
{
	global $mybb, $lang;

	$lang->load('forumdisplay_'.$mybb->input['fid'], false, true);
}

Activate the plugin in the ACP.

Then, for each forum you want to use this on, create a new language file in ./inc/languages/english, called forumdisplay_X.lang.php, where X is the ID of the forum. So, for this plugin requests forum we're in now, you'd call it forumdisplay_65.lang.php

Then, inside each file, add this:

<?php

$l['post_thread'] = "Post Thread";

Then change the text to whatever you want it to be.

This will overwrite the default text if you have a file for that form, but use the default text if you don't.

It is kinda hacky but it should work.

I'll test it, Thanks!

EDIT: Works like a charm. Thanks so much my man.
No worries Smile