'post_edit_reason'		=> $row['post_edit_reason'],
				'topic_replies_real'	=> $row['topic_replies_real'],
				'poster_id'				=> $row['poster_id'],
				'post_id'				=> &$row['post_id'],
				'topic_id'				=> &$row['topic_id'],
				'topic_poster'			=> $row['topic_poster'],
				'topic_first_post_id'	=> $row['topic_first_post_id'],
				'topic_last_post_id'	=> $row['topic_last_post_id'],
				'post_approved'			=> ($auth->acl_get('f_noapprove', MODS_FORUM_ID) || $auth->acl_get('m_approve', MODS_FORUM_ID)) ? 1 : 0,
			);
			$poll = false;
			
			submit_post('edit', $row['mod_hu_title'], $row['topic_first_poster_name'], POST_NORMAL, $poll, $data);
		
			// Send out moderator notification
			send_mod_notification($row);
		}
	}
	// Disapprove the MOD and send notification to the submitter that there is an error with his MOD he should fix ASAP
	catch(ModException $e)
	{
		// Disapprove topic
		$sql = 'SELECT p.post_time, p.post_text, p.bbcode_bitfield  FROM ' . POSTS_TABLE . ' p WHERE p.post_id = ' . $row['topic_first_post_id'];
		$result = $db->sql_query($sql);
		$post = $db->sql_fetchrow($result);
		
		$data = array(
			'forum_id'			=> MODS_FORUM_ID,
			'topic_title'		=> $row['mod_hu_title'],
			'icon_id'			=> 0,
			'enable_bbcode'		=> 1,
Example #2
0
		// Give success message
		if ($auth->acl_get('f_noapprove', MODS_FORUM_ID) || $auth->acl_get('m_approve', MODS_FORUM_ID))
		{
			$redirect_url = append_sid("{$phpbb_root_path}mods.{$phpEx}", "mode=mod&id={$mod_data['mod_id']}");
			$message = sprintf($user->lang[($mode == 'add' ? 'MOD_ADDED' : 'MOD_UPDATED')], '<a href="' . $redirect_url . '">', '</a>');
			meta_refresh(5, $redirect_url);
		}
		// If the article is waiting for approval do not redirect the user but tell him this
		// And also send out a notification for the appropriate moderators
		else
		{
			$redirect_url = append_sid("{$phpbb_root_path}mods.{$phpEx}");
			$message = sprintf($user->lang[($mode == 'add' ? 'MOD_ADDED_MOD' : 'MOD_UPDATED_MOD')], '<a href="' . $redirect_url . '">', '</a>');
		
			// Send out moderator notification
			send_mod_notification($mod_data);
		}
		
		trigger_error($message);
	}
	
	$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);			
	
	/**
	* Display the form 
	*/
	add_form_key('add_mod');
	
	$template->assign_vars(array(
		// Assign "input" variables
		'MOD_TITLE'			=> $mod_data['mod_hu_title'],