$plugins->add_hook('admin_formcontainer_output_row', 'bbsync_admin_formcontainer_output_row');
$plugins->add_hook('admin_forum_management_edit_commit', 'bbsync_admin_forum_management_edit_commit');
function bbsync_admin_forum_management_edit_commit()
{
global $mybb, $db;
if (array_key_exists('bbsync_newsgroup', $mybb->input) and ($mybb->input['fid'] != '')) {
$sql_array = array("bbsync_newsgroup" => $mybb->input['bbsync_newsgroup']);
$db->update_query("forums", $sql_array, "fid=".$mybb->input['fid'], 1);
}
}
function bbsync_admin_formcontainer_output_row($pluginargs)
{
global $mybb, $db;
if (($mybb->input['module'] == 'forum/management') and ($mybb->input['action'] == 'edit')
and ($pluginargs['label_for'] == 'description') and ($mybb->input['fid'] != '')) {
$query = $db->simple_select("forums", "bbsync_newsgroup", "fid=".$mybb->input['fid'], array('limit' => 1));
$forum = $db->fetch_array($query);
$newsgroup = $forum['bbsync_newsgroup'];
$pluginargs['content'] .=
'</tr><td class="first"><label for="bbsync_newsgroup">Newsgroup</label>
<div class="form_row">
<input type="text" name="bbsync_newsgroup" value="'.$forum['bbsync_newsgroup'].'" class="text_input" id="bbsync_newsgroup" />
</div></td></tr>';
}
}