2006-12-02 04:36:16 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2009-11-17 13:48:46 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2009-11-18 01:06:08 +00:00
|
|
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
2009-11-17 13:48:46 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
2010-03-10 01:23:57 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2009-11-17 13:48:46 +00:00
|
|
|
*/
|
|
|
|
|
2009-11-19 09:46:14 +00:00
|
|
|
if (!defined('e107_INIT')) { exit(); }
|
|
|
|
include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_admin.php');
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
function forum_thread_moderate($p)
|
|
|
|
{
|
2008-12-09 21:46:14 +00:00
|
|
|
$e107 = e107::getInstance();
|
|
|
|
foreach ($p as $key => $val)
|
|
|
|
{
|
2006-12-02 04:36:16 +00:00
|
|
|
if (preg_match("#(.*?)_(\d+)_x#", $key, $matches))
|
|
|
|
{
|
|
|
|
$act = $matches[1];
|
2008-12-09 21:46:14 +00:00
|
|
|
$id = (int)$matches[2];
|
|
|
|
|
|
|
|
switch ($act)
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2008-12-09 21:46:14 +00:00
|
|
|
case 'lock':
|
2008-12-18 18:32:54 +00:00
|
|
|
$e107->sql->db_Update('forum_thread', 'thread_active=0 WHERE thread_id='.$id);
|
|
|
|
return FORLAN_CLOSE;
|
|
|
|
break;
|
2008-12-09 21:46:14 +00:00
|
|
|
|
|
|
|
case 'unlock':
|
2008-12-18 18:32:54 +00:00
|
|
|
$e107->sql->db_Update('forum_thread', 'thread_active=1 WHERE thread_id='.$id);
|
|
|
|
return FORLAN_OPEN;
|
|
|
|
break;
|
2008-12-09 21:46:14 +00:00
|
|
|
|
|
|
|
case 'stick':
|
2008-12-18 18:32:54 +00:00
|
|
|
$e107->sql->db_Update('forum_thread', 'thread_sticky=1 WHERE thread_id='.$id);
|
|
|
|
return FORLAN_STICK;
|
|
|
|
break;
|
2008-12-09 21:46:14 +00:00
|
|
|
|
|
|
|
case 'unstick':
|
2008-12-18 18:32:54 +00:00
|
|
|
$e107->sql->db_Update('forum_thread', 'thread_sticky=0 WHERE thread_id='.$id);
|
|
|
|
return FORLAN_UNSTICK;
|
|
|
|
break;
|
2008-12-09 21:46:14 +00:00
|
|
|
|
|
|
|
case 'deleteThread':
|
2008-12-18 18:32:54 +00:00
|
|
|
return forumDeleteThread($id);
|
|
|
|
break;
|
2008-12-09 21:46:14 +00:00
|
|
|
|
2008-12-11 16:02:05 +00:00
|
|
|
case 'deletePost':
|
2008-12-18 18:32:54 +00:00
|
|
|
return forumDeletePost($id);
|
|
|
|
break;
|
2008-12-11 16:02:05 +00:00
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-12-09 21:46:14 +00:00
|
|
|
|
|
|
|
function forumDeleteThread($threadId)
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
2008-12-09 21:46:14 +00:00
|
|
|
require_once (e_PLUGIN.'forum/forum_class.php');
|
2010-03-10 01:23:57 +00:00
|
|
|
$f = new e107forum;
|
2008-12-18 18:32:54 +00:00
|
|
|
$ret = $f->threadDelete($threadId);
|
|
|
|
return FORLAN_6.' and '.$ret.' '.FORLAN_7.'.';
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
2008-12-09 21:46:14 +00:00
|
|
|
|
2008-12-11 16:02:05 +00:00
|
|
|
function forumDeletePost($postId)
|
|
|
|
{
|
|
|
|
require_once (e_PLUGIN.'forum/forum_class.php');
|
2010-03-10 01:23:57 +00:00
|
|
|
$f = new e107forum;
|
2008-12-18 18:32:54 +00:00
|
|
|
$ret = $f->postDelete($postId);
|
|
|
|
return FORLAN_6.' and '.$ret.' '.FORLAN_7.'.';
|
2008-12-11 16:02:05 +00:00
|
|
|
}
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
?>
|