Ejemplo n.º 1
0
             $forumstickthreads[$_G['gp_id']]['forums'] = $_G['gp_forumsticktargets'];
             DB::query("UPDATE " . DB::table('forum_thread') . " SET displayorder='4' WHERE tid='{$forumstick_tid}'");
         }
         $forumstickthreads = addslashes(serialize($forumstickthreads));
         DB::query("REPLACE INTO " . DB::table('common_setting') . "(skey, svalue) VALUES('forumstickthreads', '{$forumstickthreads}')");
         updatecache(array('forumstick', 'setting'));
         cpmsg('threads_forumstick_' . $do . '_succeed', "action=threads&operation=forumstick", 'succeed');
     }
 } elseif ($operation == 'postposition') {
     shownav('topic', 'threads_postposition');
     if (!$do) {
         if (submitcheck('delpositionsubmit')) {
             delete_position($_G['gp_delete']);
             cpmsg('delete_position_succeed', 'action=threads&operation=postposition', 'succeed');
         } elseif (submitcheck('delandaddsubmit')) {
             delete_position($_G['gp_delete']);
             cpmsg('delete_position_gotu_add', 'action=threads&operation=postposition&do=add&addpositionsubmit=yes&formhash=' . FORMHASH . '&tids=' . urlencode(implode(',', $_G['gp_delete'])), 'succeed');
         } else {
             showsubmenu('threads_postposition', array(array('admin', 'threads&operation=postposition', !$do), array('add', 'threads&operation=postposition&do=add', $do == 'add')));
             showtips('threads_postposition_tips');
             loadcache('forums');
             showformheader('threads&operation=postposition');
             showtableheader('admin', 'fixpadding');
             showsubtitle(array('', 'ID', 'subject', 'forum', 'replies', 'dateline'));
             $limit_start = 20 * ($page - 1);
             if ($count = DB::result_first("SELECT COUNT(DISTINCT(tid)) FROM " . DB::table('forum_postposition') . "")) {
                 $multipage = multi($count, 20, $page, ADMINSCRIPT . "?action=threads&operation=postposition");
                 $query = DB::query("SELECT DISTINCT(tid) FROM " . DB::table('forum_postposition') . " LIMIT {$limit_start}, 20");
                 $tids = 0;
                 while ($row = DB::fetch($query)) {
                     $tids .= ", {$row['tid']}";
Ejemplo n.º 2
0
             $forumstickthreads[$id]['forums'] = $forumsticktargets;
             $db->query("UPDATE {$tablepre}threads SET displayorder='4' WHERE tid='{$forumstick_tid}'");
         }
         $forumstickthreads = serialize($forumstickthreads);
         $db->query("REPLACE INTO {$tablepre}settings(variable, value) VALUES('forumstickthreads', '{$forumstickthreads}')");
         updatecache('forumstick');
         cpmsg("threads_forumstick_{$do}_succeed", "{$BASESCRIPT}?action=threads&operation=forumstick", 'succeed');
     }
 } elseif ($operation == 'postposition') {
     shownav('topic', 'threads_postposition');
     if (!$do) {
         if (submitcheck('delpositionsubmit')) {
             delete_position($delete);
             cpmsg('delete_position_succeed', $BASESCRIPT . '?action=threads&operation=postposition');
         } elseif (submitcheck('delandaddsubmit')) {
             delete_position($delete);
             cpmsg('delete_position_gotu_add', $BASESCRIPT . '?action=threads&operation=postposition&do=add&addpositionsubmit=yes&formhash=' . FORMHASH . '&tids=' . urlencode(implode(',', $delete)));
         } else {
             showsubmenu('threads_postposition', array(array('admin', 'threads&operation=postposition', !$do), array('add', 'threads&operation=postposition&do=add', $do == 'add')));
             showtips('threads_postposition_tips');
             @(include DISCUZ_ROOT . '/forumdata/cache/cache_forums.php');
             showformheader('threads&operation=postposition');
             showtableheader('admin', 'fixpadding');
             showsubtitle(array('', 'ID', 'subject', 'forum', 'replies', 'dateline'));
             $limit_start = 20 * ($page - 1);
             if ($count = $db->result_first("SELECT COUNT(DISTINCT(tid)) FROM {$tablepre}postposition")) {
                 $multipage = multi($count, 20, $page, "{$BASESCRIPT}?action=threads&operation=postposition");
                 $query = $db->query("SELECT DISTINCT(tid) FROM {$tablepre}postposition LIMIT {$limit_start}, 20");
                 $tids = 0;
                 while ($row = $db->fetch_array($query)) {
                     $tids .= ", {$row['tid']}";