Skip to content

Commit 9adbe23

Browse files
committed
内容管理列表排序按“排序数字升序,自增id降序”
1 parent d8e20a4 commit 9adbe23

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

phpcms/modules/content/content.php

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct() {
2828
if(!$priv_datas) showmessage(L('permission_to_operate'),'blank');
2929
}
3030
}
31-
31+
3232
public function init() {
3333
$show_header = $show_dialog = $show_pc_hash = '';
3434
if(isset($_GET['catid']) && $_GET['catid'] && $this->categorys[$_GET['catid']]['siteid']==$this->siteid) {
@@ -66,7 +66,7 @@ public function init() {
6666
if(isset($_GET['reject'])) $status = 0;
6767
$where = 'catid='.$catid.' AND status='.$status;
6868
//搜索
69-
69+
7070
if(isset($_GET['start_time']) && $_GET['start_time']) {
7171
$start_time = strtotime($_GET['start_time']);
7272
$where .= " AND `inputtime` > '$start_time'";
@@ -92,8 +92,8 @@ public function init() {
9292
$posids = $_GET['posids']==1 ? intval($_GET['posids']) : 0;
9393
$where .= " AND `posids` = '$posids'";
9494
}
95-
96-
$datas = $this->db->listinfo($where,'id desc',$_GET['page']);
95+
96+
$datas = $this->db->listinfo($where,'listorder asc,id desc',$_GET['page']);
9797
$pages = $this->db->pages;
9898
$pc_hash = $_SESSION['pc_hash'];
9999
for($i=1;$i<=$workflow_steps;$i++) {
@@ -147,7 +147,7 @@ public function add() {
147147
$this->page_db = pc_base::load_model('page_model');
148148
$style_font_weight = $_POST['style_font_weight'] ? 'font-weight:'.strip_tags($_POST['style_font_weight']) : '';
149149
$_POST['info']['style'] = strip_tags($_POST['style_color']).';'.$style_font_weight;
150-
150+
151151
if($_POST['edit']) {
152152
$this->page_db->update($_POST['info'],array('catid'=>$catid));
153153
} else {
@@ -164,7 +164,7 @@ public function add() {
164164

165165
if(isset($_GET['catid']) && $_GET['catid']) {
166166
$catid = $_GET['catid'] = intval($_GET['catid']);
167-
167+
168168
param::set_cookie('catid', $catid);
169169
$category = $this->categorys[$catid];
170170
if($category['type']==0) {
@@ -190,9 +190,9 @@ public function add() {
190190
} else {
191191
//单网页
192192
$this->page_db = pc_base::load_model('page_model');
193-
193+
194194
$r = $this->page_db->get_one(array('catid'=>$catid));
195-
195+
196196
if($r) {
197197
extract($r);
198198
$style_arr = explode(';',$style);
@@ -207,7 +207,7 @@ public function add() {
207207
header("Cache-control: private");
208208
}
209209
}
210-
210+
211211
public function edit() {
212212
//设置cookie 在附件添加处调用
213213
param::set_cookie('module', 'content');
@@ -230,9 +230,9 @@ public function edit() {
230230
$id = intval($_GET['id']);
231231
if(!isset($_GET['catid']) || !$_GET['catid']) showmessage(L('missing_part_parameters'));
232232
$catid = $_GET['catid'] = intval($_GET['catid']);
233-
233+
234234
$this->model = getcache('model', 'commons');
235-
235+
236236
param::set_cookie('catid', $catid);
237237
$category = $this->categorys[$catid];
238238
$modelid = $category['modelid'];
@@ -262,12 +262,12 @@ public function delete() {
262262
$modelid = $this->categorys[$catid]['modelid'];
263263
$sethtml = $this->categorys[$catid]['sethtml'];
264264
$siteid = $this->categorys[$catid]['siteid'];
265-
265+
266266
$html_root = pc_base::load_config('system','html_root');
267267
if($sethtml) $html_root = '';
268-
268+
269269
$setting = string2array($this->categorys[$catid]['setting']);
270-
$content_ishtml = $setting['content_ishtml'];
270+
$content_ishtml = $setting['content_ishtml'];
271271
$this->db->set_model($modelid);
272272
$this->hits_db = pc_base::load_model('hits_model');
273273
$this->queue = pc_base::load_model('queue_model');
@@ -286,7 +286,7 @@ public function delete() {
286286
$search_model = getcache('search_model_'.$this->siteid,'search');
287287
$typeid = $search_model[$modelid]['typeid'];
288288
$this->url = pc_base::load_app_class('url', 'content');
289-
289+
290290
foreach($_POST['ids'] as $id) {
291291
$r = $this->db->get_one(array('id'=>$id));
292292
if($content_ishtml && !$r['islink']) {
@@ -325,13 +325,13 @@ public function delete() {
325325
$this->position_data_db->delete(array('id'=>$id,'catid'=>$catid,'module'=>'content'));
326326
//删除全站搜索中数据
327327
$this->search_db->delete_search($typeid,$id);
328-
328+
329329
//删除相关的评论,删除前应该判断是否还存在此模块
330330
if(module_exists('comment')){
331331
$commentid = id_encode('content_'.$catid, $id, $siteid);
332332
$this->comment->del($commentid, $siteid, $id, $catid);
333333
}
334-
334+
335335
}
336336
//更新栏目统计
337337
$this->db->cache_items();
@@ -346,7 +346,7 @@ public function delete() {
346346
public function pass() {
347347
$admin_username = param::get_cookie('admin_username');
348348
$catid = intval($_GET['catid']);
349-
349+
350350
if(!$catid) showmessage(L('missing_part_parameters'));
351351
$category = $this->categorys[$catid];
352352
$setting = string2array($category['setting']);
@@ -374,14 +374,14 @@ public function pass() {
374374
} else {
375375
//工作流审核级别
376376
$workflow_steps = $workflows['steps'];
377-
377+
378378
if($workflow_steps>$steps) {
379379
$status = $steps+1;
380380
} else {
381381
$status = 99;
382382
}
383383
}
384-
384+
385385
$modelid = $this->categorys[$catid]['modelid'];
386386
$this->db->set_model($modelid);
387387
$this->db->search_db = pc_base::load_model('search_model');
@@ -467,7 +467,7 @@ public function public_categorys() {
467467
$ajax_show = intval($cfg['category_ajax']);
468468
$from = isset($_GET['from']) && in_array($_GET['from'],array('block')) ? $_GET['from'] : 'content';
469469
$tree = pc_base::load_sys_class('tree');
470-
if($from=='content' && $_SESSION['roleid'] != 1) {
470+
if($from=='content' && $_SESSION['roleid'] != 1) {
471471
$this->priv_db = pc_base::load_model('category_priv_model');
472472
$priv_result = $this->priv_db->select(array('action'=>'init','roleid'=>$_SESSION['roleid'],'siteid'=>$this->siteid,'is_admin'=>1));
473473
$priv_catids = array();
@@ -567,7 +567,7 @@ public function update_param() {
567567
}
568568
}
569569
}
570-
570+
571571
/**
572572
* 图片裁切
573573
*/
@@ -593,7 +593,7 @@ public function public_relationlist() {
593593
showmessage(L('please_select_modelid'));
594594
} else {
595595
$page = intval($_GET['page']);
596-
596+
597597
$modelid = intval($_GET['modelid']);
598598
$this->db->set_model($modelid);
599599
$where = '';
@@ -602,7 +602,7 @@ public function public_relationlist() {
602602
$where .= "catid='$catid'";
603603
}
604604
$where .= $where ? ' AND status=99' : 'status=99';
605-
605+
606606
if(isset($_GET['keywords'])) {
607607
$keywords = trim($_GET['keywords']);
608608
$field = $_GET['field'];
@@ -647,16 +647,16 @@ public function public_getjson_ids() {
647647
public function public_preview() {
648648
$catid = intval($_GET['catid']);
649649
$id = intval($_GET['id']);
650-
650+
651651
if(!$catid || !$id) showmessage(L('missing_part_parameters'),'blank');
652652
$page = intval($_GET['page']);
653653
$page = max($page,1);
654654
$CATEGORYS = getcache('category_content_'.$this->get_siteid(),'commons');
655-
655+
656656
if(!isset($CATEGORYS[$catid]) || $CATEGORYS[$catid]['type']!=0) showmessage(L('missing_part_parameters'),'blank');
657657
define('HTML', true);
658658
$CAT = $CATEGORYS[$catid];
659-
659+
660660
$siteid = $CAT['siteid'];
661661
$MODEL = getcache('model','commons');
662662
$modelid = $CAT['modelid'];
@@ -671,7 +671,7 @@ public function public_preview() {
671671
//再次重新赋值,以数据库为准
672672
$catid = $CATEGORYS[$r['catid']]['catid'];
673673
$modelid = $CATEGORYS[$catid]['modelid'];
674-
674+
675675
require_once CACHE_MODEL_PATH.'content_output.class.php';
676676
$content_output = new content_output($modelid,$catid,$CATEGORYS);
677677
$data = $content_output->get($rs);
@@ -681,7 +681,7 @@ public function public_preview() {
681681
$allow_visitor = 1;
682682
//SEO
683683
$SEO = seo($siteid, $catid, $title, $description);
684-
684+
685685
define('STYLE',$CAT['setting']['template_list']);
686686
if(isset($rs['paginationtype'])) {
687687
$paginationtype = $rs['paginationtype'];
@@ -722,7 +722,7 @@ public function public_preview() {
722722
}
723723
//当不存在 [/page]时,则使用下面分页
724724
$pages = content_pages($pagenumber,$page, $pageurls);
725-
//判断[page]出现的位置是否在第一位
725+
//判断[page]出现的位置是否在第一位
726726
if($CONTENT_POS<7) {
727727
$content = $contents[$page];
728728
} else {
@@ -774,7 +774,7 @@ function set_time() {
774774
*/
775775
public function public_checkall() {
776776
$page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
777-
777+
778778
$show_header = '';
779779
$workflows = getcache('workflow_'.$this->siteid,'commons');
780780
$datas = array();
@@ -825,11 +825,11 @@ public function public_checkall() {
825825
}
826826
}
827827
$this->content_check_db = pc_base::load_model('content_check_model');
828-
$datas = $this->content_check_db->listinfo($sql,'inputtime DESC',$page);
828+
$datas = $this->content_check_db->listinfo($sql,'inputtime DESC',$page);
829829
$pages = $this->content_check_db->pages;
830830
include $this->admin_tpl('content_checkall');
831831
}
832-
832+
833833
/**
834834
* 批量移动文章
835835
*/
@@ -894,7 +894,7 @@ public function remove() {
894894
include $this->admin_tpl('content_remove');
895895
}
896896
}
897-
897+
898898
/**
899899
* 同时发布到其他栏目
900900
*/
@@ -903,7 +903,7 @@ public function add_othors() {
903903
$sitelist = getcache('sitelist','commons');
904904
$siteid = $_GET['siteid'];
905905
include $this->admin_tpl('add_othors');
906-
906+
907907
}
908908
/**
909909
* 同时发布到其他栏目 异步加载栏目
@@ -925,7 +925,7 @@ public function public_getsite_categorys() {
925925
}
926926
if(empty($priv_catids)) return '';
927927
}
928-
928+
929929
foreach($this->categorys as $r) {
930930
if($r['siteid']!=$siteid || $r['type']!=0) continue;
931931
if($_SESSION['roleid'] != 1 && !in_array($r['catid'],$priv_catids)) {
@@ -947,10 +947,10 @@ public function public_getsite_categorys() {
947947
$categorys = $tree->get_tree(0, $str);
948948
echo $categorys;
949949
}
950-
950+
951951
public function public_sub_categorys() {
952952
$cfg = getcache('common','commons');
953-
$ajax_show = intval(abs($cfg['category_ajax']));
953+
$ajax_show = intval(abs($cfg['category_ajax']));
954954
$catid = intval($_POST['root']);
955955
$modelid = intval($_POST['modelid']);
956956
$this->categorys = getcache('category_content_'.$this->siteid,'commons');
@@ -993,7 +993,7 @@ public function public_sub_categorys() {
993993
break;
994994
}
995995
$data = $tree->creat_sub_json($catid,$strs);
996-
}
996+
}
997997
echo $data;
998998
}
999999
}

0 commit comments

Comments
 (0)