<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="kirky_moderatorcheckpoint" active="1">
	<title>Moderator Checkpoint System</title>
	<description />
	<version>1.1.4</version>
	<url><![CDATA[http://www.vbulletin.org/forum/misc.php?do=producthelp&pid=kirky_moderatorcheckpoint]]></url>
	<versioncheckurl><![CDATA[http://www.vbulletin.org/forum/misc.php?do=productcheck&pid=kirky_moderatorcheckpoint]]></versioncheckurl>
	<dependencies>
	</dependencies>
	<codes>
		<code version="1.00">
			<installcode><![CDATA[$db->hide_errors();

// Alter Post Table
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "post ADD ischecked TINYINT( 1 ) NOT NULL DEFAULT '0'");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "post ADD checkedby INT( 1 ) UNSIGNED NOT NULL DEFAULT '0'");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "post ADD checkedbyu VARCHAR( 100 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "post ADD checkedtime INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");

// Alter Moderator Table
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator ADD cancheck TINYINT( 1 ) NOT NULL DEFAULT '0'");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator ADD cancheck_whole TINYINT( 1 ) NOT NULL DEFAULT '0'");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator ADD canuncheck TINYINT( 1 ) NOT NULL DEFAULT '0'");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator ADD canuncheck_others TINYINT( 1 ) NOT NULL DEFAULT '0'");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator ADD canuncheck_whole TINYINT( 1 ) NOT NULL DEFAULT '0'");

// Alter Thread Table
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "thread ADD checkcount INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");

$db->show_errors();]]></installcode>
			<uninstallcode><![CDATA[$db->hide_errors();

// Drop Post Columns
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "post DROP ischecked");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "post DROP checkedby");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "post DROP checkedbyu");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "post DROP checkedtime");

// Drop Moderator Columns
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator DROP cancheck");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator DROP cancheck_whole");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator DROP canuncheck");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator DROP canuncheck_others");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "moderator DROP canuncheck_whole");

// Drop Thread Columns
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "thread DROP checkcount");

$db->show_errors();]]></uninstallcode>
		</code>
	</codes>
	<templates>
		<template name="mcs_headinclude" templatetype="template" date="1210470197" username="admin" version="1.0.9"><![CDATA[<script type="text/javascript">
<!--

    function mcsRequestData(Location,Handler){
    IE = (window.ActiveXObject)? true : false

        if(IE){
        Request = new ActiveXObject("Microsoft.XMLHTTP")
        } else {
        Request = new XMLHttpRequest()
        }

        if(Request){
        Request.onreadystatechange = function(){mcsCollectData(Handler)}
        Request.open("GET", Location + '&nocache=' + Math.random(0,9999), true)
        Request.send('')
        }
    }

    function mcsCollectData(Handler){
        if(Request.readyState == 4){
            if(Request.status == 200){
            eval(Handler + '(Request)')
            }
        }
    }

    function parseActiveData(Request){
    Data = Request.responseXML.documentElement
    ActiveStatus = Data.getElementsByTagName('activemode')[0].firstChild.data
        if(ActiveStatus == 0){
            document.getElementById('data3').innerHTML = '$vbphrase[mcs_disabled]'
        }else{
            document.getElementById('data3').innerHTML = '$vbphrase[mcs_enabled]'
        }
    }

-->
</script>]]></template>
	</templates>
	<plugins>
		<plugin active="1" executionorder="5">
			<title>Update Post Counters</title>
			<hookname>admin_maintenance</hookname>
			<phpcode><![CDATA[if ($_REQUEST['do'] == 'updatecheckedpost')
{	
	$posts = $vbulletin->db->query_read_slave("
		SELECT postid, threadid
		FROM " . TABLE_PREFIX . "post
		WHERE visible <> 1 AND postid >= " . $vbulletin->GPC['startat'] . "
		ORDER BY postid
		LIMIT " . $vbulletin->GPC['perpage']
	);
	
	$finishat = $vbulletin->GPC['startat'];	
	if (empty($vbulletin->GPC['perpage']))
	{
		$vbulletin->GPC['perpage'] = 50;
	}
	
	echo '<p>Processing Checkcount Counters</p>';	
	while ($post = $vbulletin->db->fetch_array($posts))
	{
		$postman =& datamanager_init('Post', $vbulletin, ERRTYPE_SILENT, 'threadpost');
		$postman->set_existing($post);
		$postman->set('ischecked', 0);
		$postman->set('checkedby', '');
		$postman->set('checkedbyu', '');
		$postman->set('checkedtime', '');
		$postman->save();
		unset($postman);
		
		echo "Processing post: " . $post['postid'] . "<br />\n";
		vbflush();
		
		$finishat = ($post['postid'] > $finishat ? $post['postid'] : $finishat);
	}
	$finishat++;
	
	if ($checkmore = $vbulletin->db->query_first("SELECT postid FROM " . TABLE_PREFIX . "post WHERE visible <> 1 AND postid >= $finishat LIMIT 1"))
	{
		print_cp_redirect("misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=updatecheckedpost&startat=$finishat&pp=" . $vbulletin->GPC['perpage']);
		echo "<p><a href=\"misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=updatecheckedpost&amp;startat=$finishat&amp;pp=" . $vbulletin->GPC['perpage'] . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
	}
	else
	{
		define('CP_REDIRECT', 'misc.php');
		print_stop_message('updated_checkcount_success');
	}	
}

if ($_REQUEST['do'] == 'chooser')
{
	print_form_header('misc', 'updatecheckedpost');
	print_table_header('Update MCS Post Counters', 2, 0);
	print_input_row('Number of posts to process per cycle', 'perpage', 50);
	print_submit_row('Update MCS Post Counters');
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Update Thread Counters</title>
			<hookname>admin_maintenance</hookname>
			<phpcode><![CDATA[if ($_REQUEST['do'] == 'updatecheckcount')
{	
	$threads = $vbulletin->db->query_read_slave("
		SELECT threadid
		FROM " . TABLE_PREFIX . "thread
		WHERE threadid >= " . $vbulletin->GPC['startat'] . "
		ORDER BY threadid
		LIMIT " . $vbulletin->GPC['perpage']
	);
	
	$finishat = $vbulletin->GPC['startat'];	
	if (empty($vbulletin->GPC['perpage']))
	{
		$vbulletin->GPC['perpage'] = 50;
	}
	
	echo '<p>Processing Checkcount Counters</p>';	
	while ($thread = $vbulletin->db->fetch_array($threads))
	{
		$checktotal = $vbulletin->db->query_first("
			SELECT COUNT(postid) AS checkTotal
			FROM " . TABLE_PREFIX . "post
			WHERE ischecked = 1 AND threadid = " . $thread['threadid']
		);
		
		$checkCount = intval($checktotal['checkTotal']);
		$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
		$threadman->set_existing($thread);
		$threadman->set('checkcount', $checkCount);
		$threadman->save();
		unset($threadman);
		
		echo "Processing thread: " . $thread['threadid'] . "<br />\n";
		vbflush();
		
		$finishat = ($thread['threadid'] > $finishat ? $thread['threadid'] : $finishat);
	}	
	$finishat++;
	
	if ($checkmore = $vbulletin->db->query_first("SELECT threadid FROM " . TABLE_PREFIX . "thread WHERE threadid >= $finishat LIMIT 1"))
	{
		print_cp_redirect("misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=updatecheckcount&startat=$finishat&pp=" . $vbulletin->GPC['perpage']);
		echo "<p><a href=\"misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=updatecheckcount&amp;startat=$finishat&amp;pp=" . $vbulletin->GPC['perpage'] . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
	}
	else
	{
		define('CP_REDIRECT', 'misc.php');
		print_stop_message('updated_checkcount_success');
	}	
}

if ($_REQUEST['do'] == 'chooser')
{
	print_form_header('misc', 'updatecheckcount');
	print_table_header("Update MCS Thread Counters", 2, 0);
	print_input_row("
		Number of threads to process per cycle<br />
		<dfn>You must run the MCS Post Counter update first!</dfn>
		", 'perpage', 50
	);
	print_submit_row("Update MCS Thread Counters");
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Add Moderator Option</title>
			<hookname>admin_moderator_form</hookname>
			<phpcode><![CDATA[$mcwhere = iif($_REQUEST['do'] == 'editglobal',
	'WHERE userid =' . $vbulletin->GPC['userid'],
	'WHERE moderatorid =' . $vbulletin->GPC['moderatorid']
);
$cancheck = $vbulletin->db->query_first("
	SELECT cancheck, canuncheck, cancheck_whole, canuncheck_whole, canuncheck_others
	FROM " . TABLE_PREFIX . "moderator 
	$mcwhere
");

print_description_row($vbphrase['mcs_permissions'], false, 2, 'thead');
print_yes_no_row($vbphrase['can_check_posts'], 'cancheck', $cancheck['cancheck']);
print_yes_no_row($vbphrase['can_check_thread'], 'cancheck_whole', $cancheck['cancheck_whole']);
print_yes_no_row($vbphrase['can_uncheck_posts'], 'canuncheck', $cancheck['canuncheck']);
print_yes_no_row($vbphrase['can_uncheck_others'], 'canuncheck_others', $cancheck['canuncheck_others']);
print_yes_no_row($vbphrase['can_uncheck_thread'], 'canuncheck_whole', $cancheck['canuncheck_whole']);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Add Moderator Option Set Field</title>
			<hookname>admin_moderator_save</hookname>
			<phpcode><![CDATA[$vbulletin->input->clean_array_gpc('p', array(
	'cancheck'      		=> TYPE_BOOL,
	'canuncheck'   			=> TYPE_BOOL,
	'cancheck_whole'    	=> TYPE_BOOL,
	'canuncheck_whole'      => TYPE_BOOL,
	'canuncheck_others'     => TYPE_BOOL
));
$moddata->set('cancheck', $vbulletin->GPC['cancheck']);
$moddata->set('canuncheck', $vbulletin->GPC['canuncheck']);
$moddata->set('cancheck_whole', $vbulletin->GPC['cancheck_whole']);
$moddata->set('canuncheck_whole', $vbulletin->GPC['canuncheck_whole']);
$moddata->set('canuncheck_others', $vbulletin->GPC['canuncheck_others']);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Cache Templates</title>
			<hookname>cache_templates</hookname>
			<phpcode><![CDATA[$globaltemplates[] = 'mcs_headinclude';]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Decrement Checkcount for Deleted Posts (AJAX)</title>
			<hookname>editpost_delete_complete</hookname>
			<phpcode><![CDATA[if ($postinfo['ischecked'] == 1)
{
	unmoderate_post($postinfo['postid'], $postinfo, $threadinfo, true);
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Uncheck Posts Edited by Unauthorized Persons</title>
			<hookname>editpost_update_complete</hookname>
			<phpcode><![CDATA[if (!cancheck() AND $postinfo['ischecked'] == 1)
{
	unmoderate_post($postinfo['postid'], $postinfo, $threadinfo, true);
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Set Modlog Actions</title>
			<hookname>fetch_modlogactions</hookname>
			<phpcode><![CDATA[$modlogactions[555] = 'mcs_moderated_thread';
$modlogactions[556] = 'mcs_unmoderated_thread';
$modlogactions[557] = 'moderated_post';
$modlogactions[558] = 'unmoderated_post';]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Set Modlog Types</title>
			<hookname>fetch_modlogtypes</hookname>
			<phpcode><![CDATA[$modlogtypes['mcs_moderated_thread'] = 555;
$modlogtypes['mcs_unmoderated_thread'] = 556;
$modlogtypes['moderated_post'] = 557;
$modlogtypes['unmoderated_post'] = 558;]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Query for Counters</title>
			<hookname>forumdisplay_query</hookname>
			<phpcode><![CDATA[if (cancheck() AND $inmodmode){
	$hook_query_fields .= ", thread.checkcount";
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Sort Unchecked Count</title>
			<hookname>forumdisplay_sort</hookname>
			<phpcode><![CDATA[if (cancheck() AND $inmodmode){
	switch ($sortfield)
	{
		case 'checkcount':
			$sqlsortfield = "thread.visible ASC, ((thread.replycount + 1) - thread.checkcount)";
			$handled = true;
			break;
	}
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Retrieve First Unchecked Post (Forumdisplay)</title>
			<hookname>forumdisplay_start</hookname>
			<phpcode><![CDATA[$mcsid = $vbulletin->input->clean_gpc('r', 'tid', TYPE_UINT);
if ($_REQUEST['view'] == "mcspost" AND !empty($mcsid) AND $inmodmode AND cancheck())
{
	$pid = $db->query_first("
		SELECT postid AS postid
		FROM " . TABLE_PREFIX . "post
		WHERE threadid = $mcsid AND ischecked = 0 AND visible = 1
		ORDER BY dateline ASC
	");
	exec_header_redirect("showthread.php?" . $vbulletin->session->vars['sessionurl'] . "p=" . $pid['postid'] . "#post" . $pid['postid']);
}

$show['cancheckforum'] = iif(cancheck() AND can_moderate($foruminfo['forumid']), true, false);

if ($show['candothreads'] AND $inmodmode)
{
	$template_hook['inlinemod_thread_bottom'] .= "
		<option value=\"markthread\">$vbphrase[mark_thread_moderated]</option>
		<option value=\"unmarkthread\">$vbphrase[unmark_thread_moderated]</option>
	";
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Setup Mod Mode Cookie</title>
			<hookname>global_complete</hookname>
			<phpcode><![CDATA[$inmodmode = $vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'modmode', 'TYPE_BOOL');

if ($_REQUEST['do'] == 'modmode' AND cancheck())
{
	if ($inmodmode)
	{
		vbsetcookie('modmode', 0, false);
		vbsetcookie('activechecking', 0, false);
	}
	else
	{
		vbsetcookie('modmode', 1, false);
	}
	eval(print_standard_redirect('Moderation Mode has been ' . iif($inmodmode, "Disabled", "Enabled"), false));
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Init Cookies and AJAX</title>
			<hookname>global_start</hookname>
			<phpcode><![CDATA[$inmodmode = $vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'modmode', 'TYPE_BOOL');
$canactivecheck = $vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'activechecking', 'TYPE_BOOL');

if ($_REQUEST['do'] == 'acajax' AND cancheck())
{
	if ($canactivecheck)
	{
		vbsetcookie('activechecking', 0, false);
		$activemode['mark'] = 0;
	}
	else
	{
		vbsetcookie('activechecking', 1, false);
		$activemode['mark'] = 1;
	}

	header('Content-Type: text/xml');
	echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
		<data>
		<activemode>$activemode[mark]</activemode>
		</data>
	";
	exit;
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="1">
			<title>Setup Important Functions and Permissions</title>
			<hookname>global_start</hookname>
			<phpcode><![CDATA[function _rebuild_thread_counters($postinfo = NULL, $threadinfo = NULL)
{
	global $vbulletin;
	
	if (($postinfo['threadid'] OR $threadinfo['threadid']) && isset($threadinfo))
	{
		$threadid = ($postinfo['threadid']) ? intval($postinfo['threadid']) : intval($threadinfo['threadid']);
		$checktotal = $vbulletin->db->query_first("
	        SELECT COUNT(postid) AS checkTotal
			FROM " . TABLE_PREFIX . "post
			WHERE ischecked = 1 AND threadid = " . $threadid
	    );
	    
		$checkCount = intval($checktotal['checkTotal']);
	
		$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
		$threadman->set_existing($threadinfo);
		$threadman->set('checkcount', $checkCount);
		$threadman->save();
	}
}

function moderate_thread($threadid, $threadinfo = NULL)
{
	global $vbulletin, $vbphrase;	
	if (!$threadinfo AND !$threadinfo = fetch_threadinfo($threadid))
	{
		return;
	}

	if ($threadinfo['checkcount'] == $threadinfo['postcount'])
	{	// thread is already checked
		return;
	}
	
	if (!is_int($threadid))
	{
		return;
	}

	// log action
	fetch_phrase_group('threadmanage');
	require_once(DIR . '/includes/functions_log_error.php');
	log_moderator_action($threadinfo, 'mcs_moderated_thread', $vbphrase['mcs_moderated_thread']);
	
	$posts = $vbulletin->db->query_read_slave("
	SELECT post.postid, post.threadid, post.visible, post.title, post.userid, post.ischecked, post.checkedby, post.checkedbyu, post.checkedtime,
		thread.forumid, thread.title AS thread_title, thread.postuserid, thread.visible AS thread_visible,
		thread.firstpostid, thread.checkcount
	FROM " . TABLE_PREFIX . "post AS post
	LEFT JOIN " . TABLE_PREFIX . "thread AS thread USING (threadid)
	WHERE ischecked = 0 AND post.visible = 1 AND post.threadid = $threadid
	");
	
	while ($post = $vbulletin->db->fetch_array($posts))
	{
		$forumperms = fetch_permissions($post['forumid']);
		if 	(
			!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])
			OR
			(!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $post['postuserid'] != $vbulletin->userinfo['userid'])
			)
		{
			continue;
		}
		
		$postarray["$post[postid]"] = $post;
		$threadlist["$post[threadid]"] = true;
		$forumlist["$post[forumid]"] = true;
	}
	
	$postman =& datamanager_init('Post', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$mcscounter = 0;	
	foreach ($postarray AS $postid => $post)
	{
		$postman->set_existing($post);
		$postman->set('ischecked', 1);
		$postman->set('checkedby', $vbulletin->userinfo['userid']);
		$postman->set('checkedbyu', $vbulletin->userinfo['username']);
		$postman->set('checkedtime', TIMENOW);
		$postman->save();
		$mcscounter++;
	}
	unset($postman);
	
	_rebuild_thread_counters('', $threadinfo);
	
	return;
}

function unmoderate_thread($threadid, $threadinfo = NULL)
{
	global $vbulletin, $vbphrase;
	if (!$threadinfo AND !$threadinfo = fetch_threadinfo($threadid))
	{
		return;
	}

	if ($threadinfo['checkcount'] == 0)
	{	// thread is already unchecked
		return;
	}
	
	if (!is_int($threadid))
	{
		return;
	}

	// log action
	fetch_phrase_group('threadmanage');
	require_once(DIR . '/includes/functions_log_error.php');
	log_moderator_action($threadinfo, 'mcs_unmoderated_thread', $vbphrase['mcs_unmoderated_thread']);
	
	$posts = $vbulletin->db->query_read_slave("
	SELECT post.postid, post.threadid, post.visible, post.title, post.userid, post.ischecked, post.checkedby, post.checkedbyu, post.checkedtime,
		thread.forumid, thread.title AS thread_title, thread.postuserid, thread.visible AS thread_visible,
		thread.firstpostid, thread.checkcount
	FROM " . TABLE_PREFIX . "post AS post
	LEFT JOIN " . TABLE_PREFIX . "thread AS thread USING (threadid)
	WHERE ischecked = 1 AND post.visible = 1 AND post.threadid = $threadid
	");
	
	while ($post = $vbulletin->db->fetch_array($posts))
	{
		$forumperms = fetch_permissions($post['forumid']);
		if 	(
			!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])
			OR
			(!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $post['postuserid'] != $vbulletin->userinfo['userid'])
			)
		{
			continue;
		}


		
		if (!cancheck('uncheckothers') AND $post['checkedby'] != $vbulletin->userinfo['userid'])
		{
			continue;
		}
		
		$postarray["$post[postid]"] = $post;
		$threadlist["$post[threadid]"] = true;
		$forumlist["$post[forumid]"] = true;
	}
	
	$postman =& datamanager_init('Post', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$mcscounter = 0;	
	foreach ($postarray AS $postid => $post)
	{
		$postman->set_existing($post);
		$postman->set('ischecked', 0);
		$postman->set('checkedby', '');
		$postman->set('checkedbyu', '');
		$postman->set('checkedtime', '');
		$postman->save();
		$mcscounter++;
	}
	unset($postman);	
	
	_rebuild_thread_counters('', $threadinfo);

	return;
}

function moderate_post($postid, $postinfo = NULL, $threadinfo = NULL)
{
	global $vbulletin, $vbphrase;	
	if (!$postinfo AND !$postinfo = fetch_postinfo($postid))
	{
		return;
	}
	
	if (!$threadinfo AND !$threadinfo = fetch_threadinfo($threadid))
	{
		return;
	}	

	// Post has already been checked
	if ($postinfo['ischecked'])
	{
		return;
	}
	
	// Post is deleted/hidden and cannot be checked/unchecked
	if ($postinfo['visible'] != 1)
	{
		return;
	}	

	$postman =& datamanager_init('Post', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$postman->set_existing($postinfo);
	$postman->set('ischecked', 1);
	$postman->set('checkedby', $vbulletin->userinfo['userid']);
	$postman->set('checkedbyu', $vbulletin->userinfo['username']);
	$postman->set('checkedtime', TIMENOW);
	$postman->save();
	unset($postman);

	/*$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$threadman->set_existing($threadinfo);
	$threadman->set('checkcount', 'checkcount + 1', false);
	$threadman->save();
	unset($threadman);*/
	
	_rebuild_thread_counters($postinfo, $threadinfo);

	fetch_phrase_group('threadmanage');
	$postinfo['forumid'] = $threadinfo['forumid'];

	require_once(DIR . '/includes/functions_log_error.php');
	log_moderator_action($postinfo, 'moderated_post', $vbphrase['moderated_post']);
}

function unmoderate_post($postid, $postinfo = NULL, $threadinfo = NULL, $bypass = false)
{
	global $vbulletin, $vbphrase;	
	if (!$postinfo AND !$postinfo = fetch_postinfo($postid))
	{
		return;
	}

	if (!$threadinfo AND !$threadinfo = fetch_threadinfo($postinfo['threadid']))
	{
		return;
	}

	// Post is not checked
	if (!$postinfo['ischecked'])
	{
		return;
	}

	// Post is deleted/hidden and cannot be checked/unchecked
	if ($postinfo['visible'] != 1 AND !$bypass)
	{
		return;
	}	
	
	// Post was checked by another moderator and checking user cannot unmark posts marked by others
	if (!$bypass AND (!cancheck('uncheckothers') AND $postinfo['checkedby'] != $vbulletin->userinfo['userid']))
	{
		return;
	}

	$postman =& datamanager_init('Post', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$postman->set_existing($postinfo);
	$postman->set('ischecked', 0);
	$postman->set('checkedby', '');
	$postman->set('checkedbyu', '');
	$postman->set('checkedtime', '');
	$postman->save();
	unset($postman);
	
	/*$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$threadman->set_existing($threadinfo);
	if($threadinfo['checkcount'] > 0 OR $bypass)
	{
		$threadman->set('checkcount', 'checkcount - 1', false);
	}
	$threadman->save();
	unset($threadman);*/
	
	_rebuild_thread_counters($postinfo, $threadinfo);	

	fetch_phrase_group('threadmanage');
	$postinfo['forumid'] = $threadinfo['forumid'];
	
	require_once(DIR . '/includes/functions_log_error.php');
	log_moderator_action($postinfo, 'unmoderated_post', $vbphrase['unmoderated_post']);
}

function cancheck($type = '')
{
	global $vbulletin, $cancheck;	
	if (can_moderate() AND !isset($cancheck))
	{
		$cancheck = $vbulletin->db->query_first("
			SELECT cancheck, canuncheck, cancheck_whole AS cancheckthread, canuncheck_whole AS canuncheckthread, canuncheck_others AS canuncheckothers
			FROM " . TABLE_PREFIX . "moderator 
			WHERE userid = " . $vbulletin->userinfo['userid'] . "
		");
	}
	
	switch ($type)
	{
		case "check":
			return $cancheck['cancheck'] ? true : false;
			break;		
		case "uncheck":
			return $cancheck['canuncheck'] ? true : false;
			break;		
		case "checkthread":
			return $cancheck['cancheckthread'] ? true : false;
			break;		
		case "uncheckthread":
			return $cancheck['canuncheckthread'] ? true : false;
			break;		
		case "uncheckothers":
			return $cancheck['canuncheckothers'] ? true : false;
			break;		
		default:
			return $cancheck['cancheck'] OR $cancheck['canuncheck'] ? true : false;		
			break;
	}
}

$show['candothreads'] = iif(cancheck('checkthread') OR cancheck('uncheckthread'), true, false);
$show['cancheck'] = iif(cancheck(), true, false);
$show['ischeck'] = iif(cancheck('check'), true, false);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Switch Action</title>
			<hookname>inlinemod_action_switch</hookname>
			<phpcode><![CDATA[switch ($_POST['do'])
{
	case 'markmoderated':
	case 'markunmoderated':
		if (empty($vbulletin->GPC['plist']))
		{
			eval(standard_error(fetch_error('no_applicable_posts_selected')));
		}

		$postids = implode(',', $vbulletin->GPC['plist']);	
		$handled_do = true;
		break;
	case 'markthread':
	case 'unmarkthread':
		if (empty($vbulletin->GPC['tlist']))
		{
			eval(standard_error(fetch_error('you_did_not_select_any_valid_threads')));
		}
		
		$threadids = implode(',', $vbulletin->GPC['tlist']);
		$handled_do = true;
		break;
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Decrement Checkcount for Deleted Posts (Inlinemod)</title>
			<hookname>inlinemod_dodeleteposts</hookname>
			<phpcode><![CDATA[$foobar = $db->query_read_slave("
	SELECT ischecked, postid
	FROM " . TABLE_PREFIX . "post
	WHERE postid IN(" . $vbulletin->GPC['postids'] . ")
");

while ($barbaz = $db->fetch_array($foobar))
{
	if ($barbaz['ischecked'] == 1)
	{
		$pinfo = fetch_postinfo($barbaz['postid']);
		unmoderate_post($barbaz['postid'], $pinfo, $threadinfo, true);
		unset($pinfo);
	}
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Carry Over Checkcount to Merged Threads</title>
			<hookname>inlinemod_domergethread</hookname>
			<phpcode><![CDATA[$vbulletin->input->clean_gpc('p', 'tcheckcount', TYPE_UINT);
if ($vbulletin->GPC['tcheckcount'] > 0)
{
	$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
	$threadman->set_existing($destthread);
	$threadman->set('checkcount', $vbulletin->GPC['tcheckcount']);
	$threadman->save();
	unset($threadman);
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Update Check Count per Moved Posts</title>
			<hookname>inlinemod_domoveposts</hookname>
			<phpcode><![CDATA[_rebuild_thread_counters('', $threadinfo);
_rebuild_thread_counters('', $destthreadinfo);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Carry Over Checkcount to Merged Threads (Prep)</title>
			<hookname>inlinemod_mergethread</hookname>
			<phpcode><![CDATA[$totalcheck = $db->query_first("
	SELECT SUM(checkcount) AS total
	FROM " . TABLE_PREFIX . "thread
	WHERE threadid IN($threadids)
");
$tcheckcount = intval($totalcheck['total']);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Mark posts as Moderated</title>
			<hookname>inlinemod_start</hookname>
			<phpcode><![CDATA[//##########################################################################################
//######### Mark Post as Checked ###########################################################
//##########################################################################################
if ($_POST['do'] == 'markmoderated')
{
	if (!cancheck('check') OR !can_moderate($post['forumid'])){
		eval(standard_error(fetch_error('nopermission_loggedout')));
	}
	
	$posts = $db->query_read_slave("
	SELECT post.postid, post.threadid, post.visible, post.title, post.userid, post.ischecked, post.checkedby, post.checkedtime,
		thread.forumid, thread.title AS thread_title, thread.postuserid, thread.visible AS thread_visible,
		thread.firstpostid, thread.checkcount
	FROM " . TABLE_PREFIX . "post AS post
	LEFT JOIN " . TABLE_PREFIX . "thread AS thread USING (threadid)
	WHERE postid IN ($postids) AND post.ischecked = 0
	");

	$firstpost = array();
	while ($post = $db->fetch_array($posts))
	{
		$forumperms = fetch_permissions($post['forumid']);
		if 	(
			!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])
			OR
			(!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $post['postuserid'] != $vbulletin->userinfo['userid'])
			)
		{
			continue;
		}

		$postarray["$post[postid]"] = $post;
		$threadlist["$post[threadid]"] = true;
		$forumlist["$post[forumid]"] = true;
		$postarray["$post[postid]"]['skippostcount'] = true;
	}

	if (empty($postarray))
	{
		eval(standard_error(fetch_error('no_applicable_posts_selected')));
	}

	foreach ($postarray AS $postid => $post)
	{
		$foruminfo = fetch_foruminfo($post['forumid']);
		$tinfo = array(
			'threadid'    => $post['threadid'],
			'forumid'     => $post['forumid'],
			'visible'     => $post['thread_visible'],
			'firstpostid' => $post['firstpostid'],
			'checkcount'  => $post['checkcount']
		);
		moderate_post($postid, $post, $tinfo);		
	}

	// empty cookie
	setcookie('vbulletin_inlinepost', '', TIMENOW - 3600, '/');

	$vbulletin->url = $vbulletin->url . "&amp;nocheck=true"; 
	eval(print_standard_redirect('redirect_inline_moderatedposts', true, true));
}


//##########################################################################################
//######### Mark Post as Unchecked #########################################################
//##########################################################################################
if ($_POST['do'] == 'markunmoderated')
{
	if (!cancheck('uncheck') OR !can_moderate($post['forumid'])){
		eval(standard_error(fetch_error('nopermission_loggedout')));
	}
		
	$posts = $db->query_read_slave("
	SELECT post.postid, post.threadid, post.visible, post.title, post.userid, post.ischecked, post.checkedby, post.checkedtime,
		thread.forumid, thread.title AS thread_title, thread.postuserid, thread.visible AS thread_visible,
		thread.firstpostid, thread.checkcount
	FROM " . TABLE_PREFIX . "post AS post
	LEFT JOIN " . TABLE_PREFIX . "thread AS thread USING (threadid)
	WHERE postid IN ($postids) AND post.ischecked = 1
	");

	$firstpost = array();
	while ($post = $db->fetch_array($posts))
	{
		$forumperms = fetch_permissions($post['forumid']);
		if 	(
			!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])
			OR
			(!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $post['postuserid'] != $vbulletin->userinfo['userid'])
			)
		{
			continue;
		}

		$postarray["$post[postid]"] = $post;
		$threadlist["$post[threadid]"] = true;
		$forumlist["$post[forumid]"] = true;
		$postarray["$post[postid]"]['skippostcount'] = true;
	}

	if (empty($postarray))
	{
		eval(standard_error(fetch_error('no_applicable_posts_selected')));
	}

	foreach ($postarray AS $postid => $post)
	{
		$foruminfo = fetch_foruminfo($post['forumid']);
		$tinfo = array(
			'threadid'    => $post['threadid'],
			'forumid'     => $post['forumid'],
			'visible'     => $post['thread_visible'],
			'firstpostid' => $post['firstpostid'],
			'checkcount'  => $post['checkcount']
		);
		unmoderate_post($postid, $post, $tinfo);		
	}

	// empty cookie
	setcookie('vbulletin_inlinepost', '', TIMENOW - 3600, '/');

	$vbulletin->url = $vbulletin->url . "&amp;nocheck=true"; 
	eval(print_standard_redirect('redirect_inline_unmoderatedposts', true, true));
}


//##########################################################################################
//######### Mark Thread as Checked #########################################################
//##########################################################################################
if ($_POST['do'] == 'markthread')
{
	if (!cancheck('checkthread') OR !cancheck('check')){
		eval(standard_error(fetch_error('nopermission_loggedout')));
	}
	$threadarray = array();

	// Validate threads
	$threads = $db->query_read_slave("
		SELECT threadid, visible, forumid, title, postuserid, checkcount, replycount
		FROM " . TABLE_PREFIX . "thread
		WHERE threadid IN($threadids)
	");
	
	while ($thread = $db->fetch_array($threads))
	{
		$forumperms = fetch_permissions($thread['forumid']);
		if 	(
			!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])
			OR
			(!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $thread['postuserid'] != $vbulletin->userinfo['userid'])
			)
		{
			continue;
		}
		
		if (!can_moderate($thread['forumid'])){
			continue;
		}

		$threadarray["$thread[threadid]"] = $thread;
		$forumlist["$thread[forumid]"] = true;
		$foruminfo = fetch_foruminfo($thread['forumid']);
	}

	if (empty($threadarray))
	{
			eval(standard_error(fetch_error('you_did_not_select_any_valid_threads')));
	}
	
	foreach ($threadarray AS $threadid => $thread)
	{
		$tinfo = array(
			'forumid'  	 => $thread['forumid'],
			'threadid' 	 => $threadid,
			'checkcount' => $thread['checkcount'],
			'postcount'	 => ($thread['replycount'] + 1)
		);
		moderate_thread($threadid, $tinfo);
	}
	
	// empty cookie
	setcookie('vbulletin_inlinethread', '', TIMENOW - 3600, '/');

	eval(print_standard_redirect('The selected threads have been marked as checked.', false));
}


//##########################################################################################
//######### Mark Thread as Unchecked #######################################################
//##########################################################################################
if ($_POST['do'] == 'unmarkthread')
{
	if (!cancheck('uncheckthread') OR !cancheck('uncheck')){
		eval(standard_error(fetch_error('nopermission_loggedout')));
	}	
	$threadarray = array();

	// Validate threads
	$threads = $db->query_read_slave("
		SELECT threadid, visible, forumid, title, postuserid, checkcount, replycount
		FROM " . TABLE_PREFIX . "thread
		WHERE threadid IN($threadids)
	");
	
	while ($thread = $db->fetch_array($threads))
	{
		$forumperms = fetch_permissions($thread['forumid']);
		if 	(
			!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview'])
			OR
			(!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $thread['postuserid'] != $vbulletin->userinfo['userid'])
			)
		{
			continue;
		}
		
		if (!can_moderate($thread['forumid'])){
			continue;
		}
		
		$threadarray["$thread[threadid]"] = $thread;
		$forumlist["$thread[forumid]"] = true;
		$foruminfo = fetch_foruminfo($thread['forumid']);
	}

	if (empty($threadarray))
	{
			eval(standard_error(fetch_error('you_did_not_select_any_valid_threads')));
	}
	
	foreach ($threadarray AS $threadid => $thread)
	{
		$tinfo = array(
			'forumid'  	 => $thread['forumid'],
			'threadid' 	 => $threadid,
			'checkcount' => $thread['checkcount'],
			'postcount'	 => ($thread['replycount'] + 1)
		);
		unmoderate_thread($threadid, $tinfo);
	}
	
	// empty cookie
	setcookie('vbulletin_inlinethread', '', TIMENOW - 3600, '/');

	eval(print_standard_redirect('The selected threads have been marked as unchecked.', false));
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Uncheck Posts being Unapproved</title>
			<hookname>inlinemod_unapproveposts</hookname>
			<phpcode><![CDATA[foreach ($postarray AS $postid => $post)
{
	$ttinfoo = array(
		'threadid'    => $post['threadid'],
		'forumid'     => $post['forumid'],
		'visible'     => $post['thread_visible'],
		'firstpostid' => $post['firstpostid'],
		'checkcount'  => $post['checkcount']
	);	
	unmoderate_post($postid, $pinfo, $ttinfoo, true);
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Set Cookie Default on Login</title>
			<hookname>login_verify_success</hookname>
			<phpcode><![CDATA[if (is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['mcs_login_uids'])))
{
	$cancheck = $vbulletin->db->query_first("
		SELECT cancheck
		FROM " . TABLE_PREFIX . "moderator 
		WHERE userid = " . $vbulletin->userinfo['userid'] . "
	");
	if ($cancheck['cancheck'])
	{
		vbsetcookie('modmode', 1, false);
	}
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Add Moderator Option Validfields</title>
			<hookname>moderatordata_start</hookname>
			<phpcode><![CDATA[$this->validfields['cancheck'] = array(TYPE_BOOL, REQ_NO);
$this->validfields['canuncheck'] = array(TYPE_BOOL, REQ_NO);
$this->validfields['cancheck_whole'] = array(TYPE_BOOL, REQ_NO);
$this->validfields['canuncheck_whole'] = array(TYPE_BOOL, REQ_NO);
$this->validfields['canuncheck_others'] = array(TYPE_BOOL, REQ_NO);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Add JS to Headinclude Template</title>
			<hookname>parse_templates</hookname>
			<phpcode><![CDATA[$vbulletin->templatecache['headinclude'] .= $vbulletin->templatecache['mcs_headinclude'];]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Setup Date, Time, and Post Coloring</title>
			<hookname>postbit_display_complete</hookname>
			<phpcode><![CDATA[if (THIS_SCRIPT == 'showthread')
{
	global $post, $vbulletin, $inmodmode, $threadinfo;
	
	$show['cancheckforum'] = iif(cancheck() AND can_moderate($threadinfo['forumid']), true, false);
	$show['canbechecked'] = iif($inmodmode AND $post['visible'] == 1, true, false);
	$show['mcsrecent'] = iif(
		(TIMENOW <= $post['checkedtime'] + $vbulletin->options['mcs_recent_threshold']) AND 
		($post['checkedby'] == $vbulletin->userinfo['userid']), true, false
	);

	$mcpdate = vbdate($vbulletin->options['dateformat'], $post['checkedtime']);
	$mcptime = vbdate($vbulletin->options['timeformat'], $post['checkedtime']);
	$mcpmember = $vbulletin->options['bburl'] . "/member.php?" . $vbulletin->session->vars['sessionurl'] . "u=" . $post['checkedby'];	
	$mcscolor = iif($show['mcsrecent'], $vbulletin->options['mcs_post_color'], $vbulletin->options['mc_bgcolor']);	
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Setup Active Checking</title>
			<hookname>postbit_display_start</hookname>
			<phpcode><![CDATA[if (THIS_SCRIPT == 'showthread')
{
	global $vbulletin, $inmodmode, $canactivecheck, $postmarked, $threadinfo;
	
	$postid = $post['postid'];

	if (
		$inmodmode AND $canactivecheck AND empty($_REQUEST['nocheck']) 
		AND !$post['ischecked'] AND $post['visible'] == 1 AND cancheck('check') AND can_moderate($threadinfo['forumid'])
	)
	{
		require_once(DIR . '/includes/functions_databuild.php');
		moderate_post($postid, $post, $thread);
		$postmarked = true;
	}

	$mcpcolor['showthread'] = iif(
		(($vbulletin->options['mc_choice_showthread'] == 0 AND $post['ischecked']) OR 
		($vbulletin->options['mc_choice_showthread'] == 1 AND !$post['ischecked'])) AND
		$inmodmode AND cancheck() AND $post['visible'] == 1 AND can_moderate($threadinfo['forumid']), true, false
	);
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Add to Validfields (Post)</title>
			<hookname>postdata_start</hookname>
			<phpcode><![CDATA[$this->validfields['ischecked'] = array(TYPE_BOOL, REQ_NO);
$this->validfields['checkedby'] = array(TYPE_UINT, REQ_NO);
$this->validfields['checkedbyu'] = array(TYPE_STR, REQ_NO);
$this->validfields['checkedtime'] = array(TYPE_UNIXTIME, REQ_NO);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Setup Active Page Checking (Refresh)</title>
			<hookname>showthread_complete</hookname>
			<phpcode><![CDATA[if ($show['cancheck'])
{
	global $postmarked;	
	if ($inmodmode AND $canactivecheck AND $postmarked)
	{
		exec_header_redirect(
			"showthread.php?" . $vbulletin->session->vars['sessionurl'] . "t=$threadid&amp;page=" . $vbulletin->GPC['pagenumber']
		);
	}

	if ($inmodmode)
	{
	    $template_hook['inlinemod_post_bottom'] = "
			<option value=\"markmoderated\">" . $vbphrase['mark_checked'] . "</option>
			<option value=\"markunmoderated\">" . $vbphrase['mark_unchecked'] . "</option>
		";
	}
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Setup Unchecked Count and Threadbit Coloring</title>
			<hookname>threadbit_display</hookname>
			<phpcode><![CDATA[$mcsreplycount = intval(str_replace(',', '', $thread['replycount']));
/* Moderated/Unapproved/Hidden Posts no longer Counted (v1.1.0)
$mcshiddencount = intval(str_replace(',', '', $thread['hiddencount']));
## Soft-Deleted Posts no longer Counted (v1.1.0)
$mcsdeletedcount = intval(str_replace(',', '', $thread['deletedcount']));
*/
$checkedcount = $thread['checkcount'];

$thread['checkcount'] = $thread['open'] != 10 ? ($mcsreplycount + 1) - $thread['checkcount'] : "-";

$mcpcolor['forumdisplay'] = iif(
	(($vbulletin->options['mc_choice_forumdisplay'] == 0 AND $thread['checkcount'] == 0) OR 
	($vbulletin->options['mc_choice_forumdisplay'] == 1 AND $thread['checkcount'] > 0)) AND 
	$inmodmode AND cancheck() AND can_moderate($foruminfo['forumid']), true, false
);

$show['mcs_colspan'] = iif($inmodmode AND cancheck() AND can_moderate($foruminfo['forumid']), true, false);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Add to Validfields (Thread)</title>
			<hookname>threaddata_start</hookname>
			<phpcode><![CDATA[$this->validfields['checkcount'] = array(TYPE_UINT, REQ_NO);]]></phpcode>
		</plugin>
		<plugin active="0" executionorder="5">
			<title>Carry Over Checkcount to Merged Threads (Thread Tools)</title>
			<hookname>threadmanage_merge_start</hookname>
			<phpcode><![CDATA[if ($mergethreadinfo['checkcount'] > 0)
{
	$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost');
	$threadman->set_existing($threadinfo);
	$threadman->set('checkcount', $threadinfo['checkcount'] + $mergethreadinfo['checkcount']);
	$threadman->save();
	unset($threadman);
}]]></phpcode>
		</plugin>
	</plugins>
	<phrases>
		<phrasetype name="Permissions" fieldname="cppermission">
			<phrase name="can_check_posts" date="1205120784" username="admin" version="1.00"><![CDATA[Can Check Posts]]></phrase>
			<phrase name="can_check_thread" date="1205279357" username="admin" version="1.00"><![CDATA[Can Check Threads (All Posts)
<dfn><span style="color:red;">Users with permission to Check Threads <span style="font-weight:bold;text-decoration:underline;">must</span> also have permission to Check Posts</span></dfn>]]></phrase>
			<phrase name="can_uncheck_others" date="1205454245" username="admin" version="1.00"><![CDATA[Can Uncheck Posts Checked by Other Moderators]]></phrase>
			<phrase name="can_uncheck_posts" date="1205121233" username="admin" version="1.00"><![CDATA[Can Uncheck Posts]]></phrase>
			<phrase name="can_uncheck_thread" date="1205279323" username="admin" version="1.00"><![CDATA[Can Uncheck Threads (All Posts)
<dfn><span style="color:red;">Users with permission to Uncheck Threads <span style="font-weight:bold;text-decoration:underline;">must</span> also have permission to Uncheck Posts</span></dfn>]]></phrase>
			<phrase name="mcs_permissions" date="1205534851" username="admin" version="1.02"><![CDATA[Moderator Checkpoint Permissions]]></phrase>
		</phrasetype>
		<phrasetype name="Error Messages" fieldname="error">
			<phrase name="updated_checkcount_success" date="1205880966" username="admin" version="1.04"><![CDATA[Updated Checkcount Thread Counters Successfully]]></phrase>
		</phrasetype>
		<phrasetype name="Front-End Redirect Messages" fieldname="frontredirect">
			<phrase name="inline_moderatedposts" date="1203045547" username="admin" version="1.00"><![CDATA[The selected posts have been marked as Checked.]]></phrase>
			<phrase name="inline_unmoderatedposts" date="1203045598" username="admin" version="1.00"><![CDATA[The selected posts have been marked as Unchecked.]]></phrase>
		</phrasetype>
		<phrasetype name="GLOBAL" fieldname="global">
			<phrase name="active_checking" date="1205119165" username="admin" version="1.00"><![CDATA[Active Checking]]></phrase>
			<phrase name="marked_by_on_at" date="1205185438" username="admin" version="1.00"><![CDATA[Post marked as "Checked" by <a href="{1}" style="font-weight:bold">{4}</a> on <strong>{2}</strong> at <strong>{3}</strong>]]></phrase>
			<phrase name="mcs_disabled" date="1205119373" username="admin" version="1.00"><![CDATA[Disabled]]></phrase>
			<phrase name="mcs_enabled" date="1205119296" username="admin" version="1.00"><![CDATA[Enabled]]></phrase>
			<phrase name="mcs_post_not_checked" date="1205527832" username="admin" version="1.01"><![CDATA[This post has not been checked!]]></phrase>
			<phrase name="moderation_mode" date="1205118911" username="admin" version="1.00"><![CDATA[Moderation Mode]]></phrase>
			<phrase name="unchecked" date="1205118802" username="admin" version="1.00"><![CDATA[Unchecked]]></phrase>
		</phrasetype>
		<phrasetype name="Inline Moderation" fieldname="inlinemod">
			<phrase name="mark_checked" date="1205118688" username="admin" version="1.00"><![CDATA[Mark as Checked]]></phrase>
			<phrase name="mark_thread_moderated" date="1205249183" username="admin" version="1.00"><![CDATA[Mark Threads as Checked]]></phrase>
			<phrase name="mark_unchecked" date="1205118726" username="admin" version="1.00"><![CDATA[Mark as Unchecked]]></phrase>
			<phrase name="unmark_thread_moderated" date="1205249189" username="admin" version="1.00"><![CDATA[Mark Threads as Unchecked]]></phrase>
		</phrasetype>
		<phrasetype name="Thread Management" fieldname="threadmanage">
			<phrase name="mcs_moderated_thread" date="1205261841" username="admin" version="1.00"><![CDATA[Thread (All Posts) Marked as Checked]]></phrase>
			<phrase name="mcs_unmoderated_thread" date="1205265772" username="admin" version="1.00"><![CDATA[Thread (All Posts) Marked as Unchecked]]></phrase>
			<phrase name="moderated_post" date="1203045692" username="admin" version="1.00"><![CDATA[Post marked as "Checked"]]></phrase>
			<phrase name="unmoderated_post" date="1203046110" username="admin" version="1.00"><![CDATA[Post marked as "Unchecked"]]></phrase>
		</phrasetype>
		<phrasetype name="vBulletin Settings" fieldname="vbsettings">
			<phrase name="setting_mc_bgcolor_desc" date="1204859558" username="admin" version="1.00"><![CDATA[Specify the Background Color with which you would like to mark posts on Showthread.]]></phrase>
			<phrase name="setting_mc_bgcolor_fd_desc" date="1205181905" username="admin" version="1.00"><![CDATA[Specify the Background Color with which you would like to mark threads on Forumdisplay.]]></phrase>
			<phrase name="setting_mc_bgcolor_fd_title" date="1205181905" username="admin" version="1.00"><![CDATA[Forumdisplay Markup Color]]></phrase>
			<phrase name="setting_mc_bgcolor_title" date="1204859558" username="admin" version="1.00"><![CDATA[Showthread Markup Color]]></phrase>
			<phrase name="setting_mc_choice_forumdisplay_desc" date="1204858890" username="admin" version="1.00"><![CDATA[How would you like threads to be marked?]]></phrase>
			<phrase name="setting_mc_choice_forumdisplay_title" date="1204858890" username="admin" version="1.00"><![CDATA[Forumdisplay Markup Configuration]]></phrase>
			<phrase name="setting_mc_choice_showthread_desc" date="1204859012" username="admin" version="1.00"><![CDATA[How would you like posts to be marked?]]></phrase>
			<phrase name="setting_mc_choice_showthread_title" date="1204859012" username="admin" version="1.00"><![CDATA[Showthread Markup Configuration]]></phrase>
			<phrase name="setting_mcs_login_uids_desc" date="1220115587" username="admin" version="1.1.3"><![CDATA[Enter a comma-separated list of Usergroup IDs whose Users (with the appropriate permissions) should be automatically placed in Moderation Mode.]]></phrase>
			<phrase name="setting_mcs_login_uids_title" date="1220115587" username="admin" version="1.1.3"><![CDATA[Default Moderation Mode]]></phrase>
			<phrase name="setting_mcs_post_color_desc" date="1205365932" username="admin" version="1.00"><![CDATA[Specify the Background Color with which you would like to mark posts recently checked by each Moderator.]]></phrase>
			<phrase name="setting_mcs_post_color_title" date="1205365932" username="admin" version="1.00"><![CDATA[Recently Checked Markup Color]]></phrase>
			<phrase name="setting_mcs_recent_text_desc" date="1205366250" username="admin" version="1.00"><![CDATA[Specify the message you would like displayed with posts recently checked by each Moderator. (Leave blank for no message)]]></phrase>
			<phrase name="setting_mcs_recent_text_title" date="1205366250" username="admin" version="1.00"><![CDATA[Recently Checked Message]]></phrase>
			<phrase name="setting_mcs_recent_threshold_desc" date="1205366360" username="admin" version="1.00"><![CDATA[Specify the amount of time (in seconds) to consider a post marked as "checked" to be "recent".
<br />Recently Checked posts will be marked according to the specifications you choose in the following options.]]></phrase>
			<phrase name="setting_mcs_recent_threshold_title" date="1205366360" username="admin" version="1.00"><![CDATA[Recently Checked Threshold]]></phrase>
			<phrase name="settinggroup_ky_modcheckpoint" date="1204047387" username="admin" version="1.00"><![CDATA[Moderator Checkpoint Configuration]]></phrase>
		</phrasetype>
	</phrases>
	<options>
		<settinggroup name="ky_modcheckpoint" displayorder="9999">
			<setting varname="mcs_login_uids" displayorder="1">
				<datatype>free</datatype>
			</setting>
			<setting varname="mc_choice_forumdisplay" displayorder="5">
				<datatype>boolean</datatype>
				<optioncode>select:piped
0|Color Checked Threads
1|Color Unchecked Threads</optioncode>
			</setting>
			<setting varname="mc_bgcolor_fd" displayorder="10">
				<datatype>free</datatype>
			</setting>
			<setting varname="mc_choice_showthread" displayorder="15">
				<datatype>boolean</datatype>
				<optioncode>select:piped
0|Color Checked Posts
1|Color Unchecked Posts</optioncode>
			</setting>
			<setting varname="mc_bgcolor" displayorder="25">
				<datatype>free</datatype>
			</setting>
			<setting varname="mcs_recent_threshold" displayorder="30">
				<datatype>number</datatype>
			</setting>
			<setting varname="mcs_post_color" displayorder="35">
				<datatype>free</datatype>
			</setting>
			<setting varname="mcs_recent_text" displayorder="45">
				<datatype>free</datatype>
			</setting>
		</settinggroup>
	</options>
	<helptopics>
	</helptopics>
	<cronentries>
	</cronentries>
	<faqentries>
	</faqentries>
</product>
