コード例 #1
0
ファイル: forum.a_main.php プロジェクト: askovorodka/sqc
     break;
 case $action == 'edit_post':
     $id = $_GET['post_id'];
     $post = $db->get_single("SELECT text,id,author,parent,\n\t\t\t\t\t\t\t\t\t\t\t\t\t(SELECT title FROM fw_forum_threads WHERE id=p.parent) AS title,\n\t\t\t\t\t\t\t\t\t\t\t\t\t(SELECT id FROM fw_forum_threads WHERE id=p.parent) AS thread_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t(SELECT parent FROM fw_forum_threads WHERE id=p.parent) AS thread_parent\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM fw_forum_posts p WHERE p.id='{$id}'");
     if ($_SESSION['fw_user']['id'] != $post['author']) {
         Common::check_priv("{$priv}");
     } else {
         $smarty->assign("no_move", true);
     }
     if ($_GET['is_thread'] == 'yes') {
         $smarty->assign("is_thread", 'yes');
         $forums_list = Common::get_nodes_list($forums_list);
         unset($forums_list[0]);
         $smarty->assign("forums_list", $forums_list);
     }
     $post['text'] = add_forum_tags($post['text']);
     $post = String::unformat_array($post);
     $smarty->assign("post", $post);
     $template = 'forum.a_edit_post.html';
     $template_mode = 'single';
     break;
 case $action == 'create_new_thread':
     $id = $_GET['post_id'];
     $smarty->assign("forums_list", Common::get_nodes_list($forums_list));
     $smarty->assign("post_id", $id);
     $template = 'forum.a_create_thread.html';
     $template_mode = 'single';
     break;
 case $action == 'move_post' && isset($_GET['forum_id']):
     $id = $_GET['post_id'];
     $forum_id = $_GET['forum_id'];
コード例 #2
0
ファイル: forum.f_main.php プロジェクト: askovorodka/sqc
 unset($url[0]);
 if (preg_match("/^page_([0-9]+)\$/", $url[$n])) {
     $page = str_replace("page_", "", $url[$n]);
     $thread_id = str_replace("thread_", "", $url[$n - 1]);
     unset($url[$n]);
     unset($url[$n - 1]);
     unset($current_url_pages[count($current_url_pages) - 1]);
 } else {
     $page = 1;
     $thread_id = str_replace("thread_", "", $url[$n]);
     unset($url[$n]);
 }
 if (isset($_POST['quote'])) {
     $quote = $_POST['quote'];
     $quote = $db->get_single("SELECT text,author,(SELECT name FROM fw_users WHERE id=author LIMIT 1) AS author_name FROM fw_forum_posts WHERE id='{$quote}'");
     $quote['text'] = add_forum_tags($quote['text']);
     if ($quote['author_name'] != '') {
         $author = $quote['author_name'];
     } else {
         $author = $quote['author'];
     }
     $smarty_tmp['text'] = "[QUOTE][B]" . $author . ":[/B]\n" . $quote['text'] . "[/QUOTE]";
     $smarty->assign("tmp", $smarty_tmp);
 }
 if (isset($_SESSION['fw_user'])) {
     $check_mail = ", (SELECT mail FROM fw_send_forum_answers WHERE thread_id=t.id AND mail='" . $_SESSION['fw_user']['mail'] . "') AS check_mail";
 } else {
     $check_mail = "";
 }
 $thread = $db->get_single("SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t(SELECT id FROM fw_forum_posts WHERE parent=t.id ORDER BY publish_date LIMIT 1) AS thread_post\n\t\t\t\t\t\t\t\t\t\t\t{$check_mail}\n\t\t\t\t\t\t\t\t\t\t FROM fw_forum_threads t WHERE t.id='{$thread_id}' AND status>='{$status}' LIMIT 1");
 $thread = String::unformat_array($thread, 'front');