コード例 #1
0
ファイル: topics.php プロジェクト: arneau/defender-app
# Require files
require_once '../vendor/autoload.php';
require_once '../generated-conf/config.php';
require_once '../app/functions/functions.php';
# Add topic (if applicable)
if (isset($_GET['add_topic'])) {
    addTopic($_GET['topic_parent_id'], $_GET['topic_name']);
}
# Add topic adoptee (if applicable)
if (isset($_GET['add_topic_adoptee'])) {
    addTopicAdoptee($_GET['topic_parent_id'], $_GET['topic_adoptee_id']);
}
# Move topic (if applicable)
if (isset($_GET['move_topic'])) {
    moveTopic($_GET['topic_id'], $_GET['topic_parent_id']);
}
# Rename topic (if applicable)
if (isset($_GET['rename_topic'])) {
    renameTopic($_GET['topic_id'], $_GET['topic_name']);
}
# Delete topic (if applicable)
if (isset($_GET['delete_topic'])) {
    deleteTopic($_GET['topic_id']);
}
# Get topics select options
$topics_select_options = getTopicsSelectOptions($_GET['topic_parent_id']);
echo <<<s
<html>
<head></head>
<body>
コード例 #2
0
    message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']);
}
$trashForumId = findForumId(OConstants::TRASH_FORUM_NAME);
if (is_null($trashForumId)) {
    message_die(GENERAL_MESSAGE, "Cannot find forum ID for the Trash forum.");
} else {
    if ($topic_id == '') {
        message_die(GENERAL_MESSAGE, "No topic ID set.");
    } else {
        if ($forum_id == '') {
            message_die(GENERAL_MESSAGE, "No forum ID set.");
        }
    }
}
lockTopic($topic_id, $forum_id);
moveTopic($topic_id, $forum_id, $trashForumId);
header("Location: viewtopic.{$phpEx}?t={$topic_id}");
/****************************************************/
/**
 * Find a forum ID.
 *
 * @param name  The name of the forum to find the ID for.
 */
function findForumId($name)
{
    global $db;
    $sql = "SELECT forum_id,forum_name FROM " . FORUMS_TABLE . "\n\t\t\tWHERE forum_name = '" . addslashes($name) . "'";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not select from forums table', '', __LINE__, __FILE__, $sql);
    }
    $forum_info = $db->sql_fetchrow($result);