Ejemplo n.º 1
0
                 $smarty->assign('post', $post);
                 $smarty->assign('path', $template_dir . '/post_edit.tpl');
                 break;
             }
         }
     }
 case 'thread_move':
     if ($mode == 'thread_move') {
         if ($isallowed) {
             $breadcrumbs->addElement($lang->get('thread_move'), makeURL($mod, array('boardid' => $boardid, 'threadid' => $threadid, 'mode' => 'thread_move')));
             $smarty->assign('path', $template_dir . "/thread_move.tpl");
             if (isset($_POST['move'])) {
                 threadMove($threadid, $_POST['boardid']);
                 $notify->add($lang->get('board'), $lang->get('thread_move_done'));
             } else {
                 $bl = boardList();
                 if (count($bl) > 0) {
                     foreach ($bl as $b) {
                         $boards[$b['boardid']] = $b['board'];
                     }
                 }
                 $smarty->assign('bl', $boards);
                 break;
             }
         } else {
             $notify->add($lang->get('board'), $lang->get('not_allowed'));
         }
     }
 case 'thread_remove':
     if ($mode == 'thread_remove') {
         if ($isallowed) {
Ejemplo n.º 2
0
    $sql1 .= ",(CASE WHEN ISNULL(U1.`id`) THEN Q.`email` WHEN U1.`displayname`='' THEN U1.`email` ELSE U1.`displayname` END) AS `sender`";
    $sql1 .= ",(CASE WHEN ISNULL(U2.`id`) THEN Q.`commentator` WHEN U2.`displayname`='' THEN U2.`email` ELSE U2.`displayname` END) AS `commentator`";
    $sql = " {$sql1} FROM `" . DB_BOARD_Q . "` AS Q";
    $sql .= " LEFT JOIN `" . DB_USER . "` AS U1 ON U1.`id`=Q.`member_id`";
    $sql .= " LEFT JOIN `" . DB_USER . "` AS U2 ON U2.`id`=Q.`commentator_id`";
    $sql .= " WHERE Q.`pin`='1' AND {$where}";
    $sql .= " ORDER BY Q.`id` DESC";
    boardList($sql, $pins);
    // แสดงรายการแบบแบ่งหน้า
    $sql = "{$sql1} FROM `" . DB_BOARD_Q . "` AS Q";
    $sql .= " LEFT JOIN `" . DB_USER . "` AS U1 ON U1.`id`=Q.`member_id`";
    $sql .= " LEFT JOIN `" . DB_USER . "` AS U2 ON U2.`id`=Q.`commentator_id`";
    $sql .= " WHERE {$where} AND Q.`pin`='0'";
    $sql .= " ORDER BY `d` DESC";
    $sql .= " LIMIT {$start},{$index['list_per_page']}";
    boardList($sql, $list);
    if (sizeof($list) > 0) {
        // แบ่งหน้า
        $url = '<a href="' . gcms::getURL($index['module'], '', $cat, 0, 'page=%d') . '">%d</a>';
        $splitpage = gcms::pagination($totalpage, $page, $url);
    } else {
        $splitpage = '';
    }
    // รวมข้อมูล pin และ กระทู้ปกติ
    $list = array_merge($pins, $list);
    // canonical
    $canonical = gcms::getURL($index['module'], '', $cat, 0, "page={$page}");
}
function boardList($sql, &$list)
{
    global $db, $cache, $patt, $listitem, $config, $cat, $valid_date, $index, $page;