MyBB Community Forums

Full Version: Problems with ACP forum editing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everybody,
I just worked on a plugin to provide more info for certain forums, I wanted to embedd a new textarea in the ACP -> Forums & Posts -> Forum Management -> Edit Forum Settings page.

I wasn't succesful, the hooks there aren't useful at all.
I'll now do it with a core edit but I hate core edits.

So I'll post my tries to get it to work here, they aren't working properly and I see no way to get them to work but maybe you do:

//Run plugin hooks for admin backend
//$plugins->add_hook("admin_forum_management_edit", "addseconddescbox");
//$plugins->add_hook("admin_forum_management_edit_commit", "addseconddesctodb");


function addseconddescbox()
{
	global $mybb, $db;

	if($mybb->settings['additionaldescen']){

	$form = new Form("index.php?module=forum/management&action=editmod", "post");
	$form_container = new FormContainer($lang->new_forum_settings);
	$form_container->output_row(Beschreibung, "", $form->generate_text_area('description2', $forum_data['description2'], array('id' => 'description2')), 'description2');
	$form_container->end();

		}
	}

function addseconddesctodb()
{
	global $mybb, $db, $fid;

	if($mybb->settings['additionaldescen']){

		$addesc = $db->escape_string($mybb->input['rulestitle']);
		$db->query("INSERT INTO ".TABLE_PREFIX."forums (seconddesc) VALUES ($addesc) WHERE fid = '$fid'");

		}
	}

This will add a textarea in the header (looks ugly) if you do edit a forum and if you do submit the form it will show an error with the moderators but not update anything...

Maybe somebody has an idea how to solve this - if not I'll suggest more hooks inside these files.

Kind regards
Lennart Sauter