diff --git a/module/article/admin/config.inc.php b/module/article/admin/config.inc.php
new file mode 100644
index 0000000..b12a469
--- /dev/null
+++ b/module/article/admin/config.inc.php
@@ -0,0 +1,26 @@
+
\ No newline at end of file
diff --git a/module/article/admin/html.inc.php b/module/article/admin/html.inc.php
new file mode 100644
index 0000000..cc21052
--- /dev/null
+++ b/module/article/admin/html.inc.php
@@ -0,0 +1,119 @@
+get_one("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid AND catid>$catids ORDER BY catid");
+ if($CAT) {
+ $bcatid = $catid = $CAT['catid'];
+ $total = max(ceil($CAT['item']/$MOD['pagesize']), 1);
+ $num = 50;
+ $bfid = $fid;
+ isset($fpage) or $fpage = 1;
+ if($fpage <= $total) {
+ $fid = $fpage;
+ tohtml('list', $module);
+ $fid = $bfid;
+ msg($MOD['name'].' ['.$CAT['catname'].'] 第'.$fpage.'页至第'.($fpage+$num-1).'页生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catids.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one.'&fpage='.($fpage+$num), 0);
+ }
+ $fid++;
+ msg($MOD['name'].' ['.$CAT['catname'].'] 生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catid.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one);
+ } else {
+ $all ? msg($MOD['name'].'列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg($MOD['name'].'列表生成成功', $this_forward);
+ }
+ } else {
+ $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}category WHERE moduleid=$moduleid");
+ $tid = $r['num'];
+ msg('', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids=0&fid=1&&tid='.$tid.'&all='.$all.'&one='.$one);
+ }
+ break;
+ case 'show':
+ $update = (isset($update) && $update) ? 1 : 0;
+ if(!$update && !$MOD['show_html']) {
+ if($one) dheader( '?file=html&action=back&mid='.$moduleid);
+ $all ? msg($MOD['name'].'生成成功', $this_forward) : dmsg($MOD['name'].'生成成功', $this_forward);
+ }
+ $catid = isset($catid) ? intval($catid) : '';
+ $sql = $catid ? " AND catid=$catid" : '';
+ if(!isset($fid)) {
+ $r = $db->get_one("SELECT min(itemid) AS fid FROM {$table} WHERE status>2 AND islink=0 {$sql}");
+ $fid = $r['fid'] ? $r['fid'] : 0;
+ }
+ isset($sid) or $sid = $fid;
+ if(!isset($tid)) {
+ $r = $db->get_one("SELECT max(itemid) AS tid FROM {$table} WHERE status>2 AND islink=0 {$sql}");
+ $tid = $r['tid'] ? $r['tid'] : 0;
+ }
+ if($update) {
+ require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php';
+ $do = new $module($moduleid);
+ }
+ isset($num) or $num = 100;
+ if($fid <= $tid) {
+ $result = $db->query("SELECT itemid FROM {$table} WHERE status>2 AND islink=0 AND itemid>=$fid {$sql} ORDER BY itemid LIMIT 0,$num");
+ if($db->affected_rows($result)) {
+ while($r = $db->fetch_array($result)) {
+ $itemid = $r['itemid'];
+ $update ? $do->update($itemid) : tohtml('show', $module);
+ }
+ $itemid += 1;
+ } else {
+ $itemid = $fid + $num;
+ }
+ } else {
+ if($update) {
+ $all ? msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=index&all=1&one='.$one) : dmsg('更新成功', $this_forward);
+ } else {
+ if($one) dheader( '?file=html&action=back&mid='.$moduleid);
+ $all ? msg($MOD['name'].'生成成功', $this_forward) : dmsg($MOD['name'].'生成成功', $this_forward);
+ }
+ }
+ msg('ID从'.$fid.'至'.($itemid-1).$MOD['name'].($update ? '更新' : '生成').'成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$itemid&tid=$tid&num=$num&update=$update&all=$all&one=$one", 0);
+ break;
+ case 'cate':
+ $catid or msg('请选择分类');
+ isset($num) or $num = 50;
+ isset($fid) or $fid = 1;
+ $total = max(ceil($CAT['item']/$MOD['pagesize']), 1);
+ if($fpage && $tpage) {
+ $fid = $fpage;
+ $num = $tpage - $fpage + 1;
+ tohtml('list', $module);
+ dmsg('生成成功', $this_forward);
+ }
+ if($fid <= $total) {
+ tohtml('list', $module);
+ msg('第'.$fid.'页至第'.($fid+$num-1).'页生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catid='.$catid.'&fid='.($fid+$num).'&num='.$num.'&fpage='.$fpage.'&tpage='.$tpage, 0);
+ } else {
+ dmsg('生成成功', $this_forward);
+ }
+ break;
+ case 'item':
+ $catid or msg('请选择分类');
+ msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=show&catid='.$catid.'&num='.$num);
+ break;
+ default:
+ $r = $db->get_one("SELECT min(itemid) AS fid,max(itemid) AS tid FROM {$table} WHERE status=3");
+ $fid = $r['fid'] ? $r['fid'] : 0;
+ $tid = $r['tid'] ? $r['tid'] : 0;
+ include tpl('html', $module);
+ break;
+}
+?>
\ No newline at end of file
diff --git a/module/article/admin/menu.inc.php b/module/article/admin/menu.inc.php
new file mode 100644
index 0000000..c50d2ab
--- /dev/null
+++ b/module/article/admin/menu.inc.php
@@ -0,0 +1,11 @@
+
\ No newline at end of file
diff --git a/module/article/admin/setting.inc.php b/module/article/admin/setting.inc.php
new file mode 100644
index 0000000..c0d7609
--- /dev/null
+++ b/module/article/admin/setting.inc.php
@@ -0,0 +1,50 @@
+$v) {
+ if(strpos($k, 'seo_') === false) continue;
+ seo_check($v) or msg('SEO信息包含非法字符');
+ }
+ update_setting($moduleid, $setting);
+ cache_module($moduleid);
+ if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) {
+ $_MOD = $MOD;
+ $MOD = $setting;
+ $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid");
+ while($r = $db->fetch_array($result)) {
+ update_category($r);
+ }
+ cache_category($moduleid);
+ $MOD = $_MOD;
+ }
+ if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) {
+ msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000');
+ }
+ dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab);
+} else {
+ $GROUP = cache_read('group.php');
+ $r = $db->get_one("SELECT MAX(itemid) AS maxid FROM {$table}");
+ $maxid = $r['maxid'];
+ extract(dhtmlspecialchars($MOD));
+ if($kw) {
+ $all = 1;
+ ob_start();
+ }
+ include tpl('setting', $module);
+ if($kw) {
+ $data = $content = ob_get_contents();
+ ob_clean();
+ $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data);
+ $data = preg_replace('//', '', $data, 1);
+ echo $data ? $data : $content;
+ }
+}
+?>
\ No newline at end of file
diff --git a/module/article/admin/template/index.tpl.php b/module/article/admin/template/index.tpl.php
new file mode 100644
index 0000000..9a36cc6
--- /dev/null
+++ b/module/article/admin/template/index.tpl.php
@@ -0,0 +1,151 @@
+
+
+
+'.$pages.'' : '';?>
+
+
+
\ No newline at end of file
diff --git a/module/article/article.class.php b/module/article/article.class.php
new file mode 100644
index 0000000..b8f0ab3
--- /dev/null
+++ b/module/article/article.class.php
@@ -0,0 +1,290 @@
+moduleid = $moduleid;
+ $this->table = $table;
+ $this->table_data = $table_data;
+ $this->split = $MOD['split'];
+ $this->fields = array('catid','areaid','level','title','style','fee','subtitle','introduce','thumb','tag','author','copyfrom','fromurl','voteid','status','hits','username','addtime','editor','edittime','ip','template','islink','linkurl','filepath','note');
+ }
+
+ function article($moduleid) {
+ $this->__construct($moduleid);
+ }
+
+ function pass($post) {
+ if(!is_array($post)) return false;
+ if(!$post['catid']) return $this->_(lang('message->pass_catid'));
+ if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title'));
+ if(isset($post['islink'])) {
+ if(!$post['linkurl']) return $this->_(lang('message->pass_linkurl'));
+ } else {
+ if(!$post['content']) return $this->_(lang('message->pass_content'));
+ }
+ if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max'));
+ return true;
+ }
+
+ function set($post) {
+ global $MOD, $_username, $_userid, $_cname;
+ is_url($post['thumb']) or $post['thumb'] = '';
+ $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : '';
+ $post['islink'] = isset($post['islink']) ? 1 : 0;
+ $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME;
+ if($post['addtime'] > DT_TIME && $post['status'] == 3) $post['status'] = 4;
+ $post['editor'] = $_cname ? $_cname : $_username;
+ $post['edittime'] = DT_TIME;
+ $post['fee'] = dround($post['fee']);
+ $post['content'] = stripslashes($post['content']);
+ $post['content'] = save_local($post['content']);
+ if($post['content'] && isset($post['clear_link']) && $post['clear_link']) $post['content'] = clear_link($post['content']);
+ if($post['content'] && isset($post['save_remotepic']) && $post['save_remotepic']) $post['content'] = save_remote($post['content']);
+ if($post['content'] && $post['thumb_no'] && !$post['thumb']) $post['thumb'] = save_thumb($post['content'], $post['thumb_no'], $MOD['thumb_width'], $MOD['thumb_height']);
+ if(strpos($post['content'], 'de-pagebreak') !== false) {
+ $post['content'] = str_replace('"de-pagebreak" /', '"de-pagebreak"/', $post['content']);
+ $post['content'] = str_replace(array('
', ''), $post['content']);
+ }
+ if($post['content'] && !$post['introduce'] && $post['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $post['introduce_length']));
+ if($this->itemid) {
+ $new = $post['content'];
+ if($post['thumb']) $new .= '

';
+ $r = $this->get_one();
+ $old = $r['content'];
+ if($r['thumb']) $old .= '

';
+ delete_diff($new, $old);
+ } else {
+ $post['ip'] = DT_IP;
+ }
+ $content = $post['content'];
+ unset($post['content']);
+ $post = dhtmlspecialchars($post);
+ $post['content'] = addslashes(dsafe($content));
+ return array_map("trim", $post);
+ }
+
+ function get_one() {
+ $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid");
+ if($r) {
+ $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
+ $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid");
+ $r['content'] = $t ? $t['content'] : '';
+ return $r;
+ } else {
+ return array();
+ }
+ }
+
+ function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '') {
+ global $MOD, $pages, $page, $pagesize, $offset, $items, $sum;
+ if($page > 1 && $sum) {
+ $items = $sum;
+ } else {
+ $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache);
+ $items = $r['num'];
+ }
+ $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize);
+ if($items < 1) return array();
+ $lists = $catids = $CATS = array();
+ $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache);
+ while($r = DB::fetch_array($result)) {
+ $r['adddate'] = timetodate($r['addtime'], 5);
+ $r['editdate'] = timetodate($r['edittime'], 5);
+ $r['alt'] = $r['title'];
+ $r['title'] = set_style($r['title'], $r['style']);
+ if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl'];
+ $catids[$r['catid']] = $r['catid'];
+ $lists[] = $r;
+ }
+ if($catids) {
+ $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")");
+ while($r = DB::fetch_array($result)) {
+ $CATS[$r['catid']] = $r;
+ }
+ if($CATS) {
+ foreach($lists as $k=>$v) {
+ $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : '';
+ $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : '';
+ }
+ }
+ }
+ return $lists;
+ }
+
+ function add($post) {
+ global $MOD;
+ $post = $this->set($post);
+ $sqlk = $sqlv = '';
+ foreach($post as $k=>$v) {
+ if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; }
+ }
+ $sqlk = substr($sqlk, 1);
+ $sqlv = substr($sqlv, 1);
+ DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)");
+ $this->itemid = DB::insert_id();
+ $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
+ DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')");
+ $this->update($this->itemid);
+ if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) {
+ credit_add($post['username'], $MOD['credit_add']);
+ credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid);
+ }
+ clear_upload($post['content'].$post['thumb'], $this->itemid);
+ return $this->itemid;
+ }
+
+ function edit($post) {
+ $this->delete($this->itemid, false);
+ $post = $this->set($post);
+ $sql = '';
+ foreach($post as $k=>$v) {
+ if(in_array($k, $this->fields)) $sql .= ",$k='$v'";
+ }
+ $sql = substr($sql, 1);
+ DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid");
+ $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
+ DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')");
+ $this->update($this->itemid);
+ clear_upload($post['content'].$post['thumb'], $this->itemid);
+ if($post['status'] > 2) {
+ history($this->moduleid, $this->itemid, 'del');
+ $this->tohtml($this->itemid, $post['catid']);
+ }
+ return true;
+ }
+
+ function tohtml($itemid = 0, $catid = 0) {
+ global $module, $MOD;
+ if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid");
+ }
+
+ function update($itemid) {
+ $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid");
+ $update = '';
+ $keyword = $item['title'].','.($item['tag'] ? str_replace(' ', ',', trim($item['tag'])).',' : '').strip_tags(cat_pos(get_cat($item['catid']), ','));
+ if($keyword != $item['keyword']) {
+ $keyword = str_replace("//", '', addslashes($keyword));
+ $update .= ",keyword='$keyword'";
+ }
+ $item['itemid'] = $itemid;
+ $linkurl = itemurl($item);
+ if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'";
+ if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid");
+ }
+
+ function recycle($itemid) {
+ if(is_array($itemid)) {
+ foreach($itemid as $v) { $this->recycle($v); }
+ } else {
+ DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid");
+ $this->delete($itemid, false);
+ return true;
+ }
+ }
+
+ function restore($itemid) {
+ global $module, $MOD;
+ if(is_array($itemid)) {
+ foreach($itemid as $v) { $this->restore($v); }
+ } else {
+ DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid");
+ if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid");
+ return true;
+ }
+ }
+
+ function delete($itemid, $all = true) {
+ global $MOD;
+ if(is_array($itemid)) {
+ foreach($itemid as $v) {
+ $this->delete($v, $all);
+ }
+ } else {
+ $this->itemid = $itemid;
+ $r = $this->get_one();
+ if($MOD['show_html'] && !$r['islink']) {
+ $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl'];
+ html_del($_file);
+ $i = 1;
+ while($i) {
+ $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($r, $i);
+ if(is_file($_file)) {
+ html_del($_file);
+ $i++;
+ } else {
+ break;
+ }
+ }
+ }
+ if($all) {
+ $userid = get_user($r['username']);
+ if($r['thumb']) delete_upload($r['thumb'], $userid);
+ if($r['content']) delete_local($r['content'], $userid);
+ DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid");
+ $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data);
+ DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid");
+ if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid");
+ if($r['username'] && $MOD['credit_del']) {
+ credit_add($r['username'], -$MOD['credit_del']);
+ credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid);
+ }
+ history($this->moduleid, $itemid, 'del');
+ }
+ }
+ }
+
+ function check($itemid) {
+ global $_username, $MOD;
+ if(is_array($itemid)) {
+ foreach($itemid as $v) { $this->check($v); }
+ } else {
+ $this->itemid = $itemid;
+ $item = $this->get_one();
+ if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) {
+ credit_add($item['username'], $MOD['credit_add']);
+ credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid);
+ }
+ DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid");
+ history($this->moduleid, $itemid, 'del');
+ $this->tohtml($itemid);
+ return true;
+ }
+ }
+
+ function reject($itemid) {
+ global $_username;
+ if(is_array($itemid)) {
+ foreach($itemid as $v) { $this->reject($v); }
+ } else {
+ DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid");
+ return true;
+ }
+ }
+
+ function clear($condition = 'status=0') {
+ $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition");
+ while($r = DB::fetch_array($result)) {
+ $this->delete($r['itemid']);
+ }
+ }
+
+ function level($itemid, $level) {
+ $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid;
+ DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)");
+ }
+
+ function _($e) {
+ $this->errmsg = $e;
+ return false;
+ }
+}
+?>
\ No newline at end of file
diff --git a/module/article/list.htm.php b/module/article/list.htm.php
new file mode 100644
index 0000000..68f5b8d
--- /dev/null
+++ b/module/article/list.htm.php
@@ -0,0 +1,92 @@
+count($table, $condition);
+ if($items != $CAT['item']) {
+ $CAT['item'] = $items;
+ $db->query("UPDATE {$DT_PRE}category SET item=$items WHERE catid=$catid");
+ }
+} else {
+ $items = $CAT['item'];
+}
+$pagesize = $MOD['pagesize'];
+$showpage = 1;
+$datetype = 3;
+$cols = 5;
+$template = $CAT['template'] ? $CAT['template'] : ($MOD['template_list'] ? $MOD['template_list'] : 'list');
+$total = max(ceil($items/$MOD['pagesize']), 1);
+if(isset($fid) && isset($num)) {
+ $page = $fid;
+ $topage = $fid + $num - 1;
+ $total = $topage < $total ? $topage : $total;
+}
+for(; $page <= $total; $page++) {
+ $offset = ($page-1)*$pagesize;
+ $pages = listpages($CAT, $items, $page, $pagesize);
+ $tags = array();
+ $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}");
+ while($r = $db->fetch_array($result)) {
+ $r['adddate'] = timetodate($r['addtime'], 5);
+ $r['editdate'] = timetodate($r['edittime'], 5);
+ if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb'];
+ $r['alt'] = $r['title'];
+ $r['title'] = set_style($r['title'], $r['style']);
+ if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl'];
+ $tags[] = $r;
+ }
+ $seo_file = 'list';
+ include DT_ROOT.'/include/seo.inc.php';
+ $destoon_task = "moduleid=$moduleid&html=list&catid=$catid&page=$page";
+ if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ?listurl($CAT, $page) : $CAT['linkurl']);
+ $filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, $page);
+ $_tags = $tags;
+ $DT_PC = $GLOBALS['DT_PC'] = 1;
+ ob_start();
+ include template($template, $module);
+ $data = ob_get_contents();
+ ob_clean();
+ if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']);
+ file_put($filename, $data);
+ if($page == 1) {
+ $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, 0);
+ if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']);
+ file_copy($filename, $indexname);
+ }
+ if($EXT['mobile_enable']) {
+ include DT_ROOT.'/include/mobile.htm.php';
+ $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile);
+ if($CAT['parentid']) $PCAT = get_cat($CAT['parentid']);
+ $pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].listurl($CAT, '{destoon_page}'));
+ $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime';
+ $tags = array();
+ foreach($_tags as $r) {
+ $r['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $r['linkurl']);
+ $tags[] = $r;
+ }
+ if($items) $js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid;
+ $head_title = $head_name = $CAT['catname'];
+ $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename);
+ ob_start();
+ include template($template, $module);
+ $data = ob_get_contents();
+ ob_clean();
+ file_put($filename, $data);
+ if($page == 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname));
+ }
+}
+return true;
+?>
\ No newline at end of file
diff --git a/module/article/search.inc.php b/module/article/search.inc.php
new file mode 100644
index 0000000..2c2483c
--- /dev/null
+++ b/module/article/search.inc.php
@@ -0,0 +1,153 @@
+ $DT['max_kw']) message(lang($L['word_limit'], array($DT['min_kw'], $DT['max_kw'])), $MOD['linkurl'].'search.php');
+ if($DT['search_limit'] && $page == 1) {
+ if(($DT_TIME - $DT['search_limit']) < get_cookie('last_search')) message(lang($L['time_limit'], array($DT['search_limit'])), $MOD['linkurl'].'search.php');
+ set_cookie('last_search', $DT_TIME);
+ }
+ }
+
+ $pptsql = '';
+ if($CP) {
+ require DT_ROOT.'/include/property.func.php';
+ $PPT = property_condition($catid);
+ foreach($PPT as $k=>$v) {
+ $PPT[$k]['select'] = '';
+ $oid = $v['oid'];
+ $tmp = 'ppt_'.$oid;
+ if(isset($$tmp)) {
+ $PPT[$k]['select'] = $tmp = strip_kw($$tmp);
+ if($tmp && in_array($tmp, $v['options'])) {
+ $tmp = 'O'.$oid.':'.$tmp.';';
+ $pptsql .= match_kw('pptword', $tmp);
+ }
+ }
+ }
+ }
+ $fds = $MOD['fields'];
+ $condition = '';
+ if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid";
+ if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid";
+ if($dfields[$fields] == 'content') {
+ if($keyword && $MOD['fulltext'] == 1) $condition .= match_kw($dfields[$fields], $keyword);
+ $condition = str_replace('AND ', 'AND i.', $condition);
+ $condition = str_replace('i.content', 'd.content', $condition);
+ $condition = "i.status=3 AND i.itemid=d.itemid".$condition;
+ if($keyword && $MOD['fulltext'] == 2) $condition .= " AND MATCH(`content`) AGAINST('$kw'".(preg_match("/[+-<>()~*]/", $kw) ? ' IN BOOLEAN MODE' : '').")";
+ $table = $table.' i,'.$table_data.' d';
+ $fds = 'i.'.str_replace(',', ',i.', $fds);
+ } else {
+ if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
+ if($pptsql) $condition .= $pptsql;//PPT
+ $condition = "status=3".$condition;
+ }
+ $pagesize = $MOD['pagesize'];
+ $offset = ($page-1)*$pagesize;
+ $items = $db->count($table, $condition, $DT['cache_search']);
+ $pages = pages($items, $page, $pagesize);
+ if($items) {
+ $order = $dorder[$order] ? " ORDER BY $dorder[$order]" : '';
+ $result = $db->query("SELECT {$fds} FROM {$table} WHERE {$condition}{$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']);
+ if($kw) {
+ $replacef = explode(' ', $kw);
+ $replacet = array_map('highlight', $replacef);
+ }
+ while($r = $db->fetch_array($result)) {
+ $r['adddate'] = timetodate($r['addtime'], 5);
+ $r['editdate'] = timetodate($r['edittime'], 5);
+ if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb'];
+ $r['alt'] = $r['title'];
+ $r['title'] = set_style($r['title'], $r['style']);
+ if($kw) $r['title'] = str_replace($replacef, $replacet, $r['title']);
+ if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl'];
+ $tags[] = $r;
+ }
+ $db->free_result($result);
+ }
+ }
+ if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid);
+ $showpage = 1;
+ $datetype = 5;
+ $target = '_blank';
+ $cols = 5;
+ $class = '';
+ if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL);
+} else {
+ if($kw) {
+ check_group($_groupid, $MOD['group_search']) or message($L['msg_no_search']);
+ } else if($catid) {
+ $CAT or message($L['msg_not_cate']);
+ if(!check_group($_groupid, $MOD['group_list']) || !check_group($_groupid, $CAT['group_list'])) message($L['msg_no_right']);
+ } else {
+ check_group($_groupid, $MOD['group_index']) or message($L['msg_no_right']);
+ }
+ $head_title = $MOD['name'].$DT['seo_delimiter'].$head_title;
+ if($kw) $head_title = $kw.$DT['seo_delimiter'].$head_title;
+ if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) {
+ $areaid = $cityid;
+ $ARE = get_area($areaid);
+ }
+ $elite = isset($elite) ? intval($elite) : 0;
+ (isset($orderby) && in_array($orderby, array('dlikes', 'dhits', 'dcomments'))) or $orderby = '';
+ $tags = array();
+ if($DT_QST) {
+ $condition = "status=3";
+ if($keyword) $condition .= match_kw('keyword', $keyword);
+ if($catid) $condition .= $CAT['child'] ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid";
+ if($areaid) $condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid";
+ if($elite) $condition .= " AND level>0";
+ $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE');
+ $items = $r['num'];
+ $pages = mobile_pages($items, $page, $pagesize);
+ if($items) {
+ $order = $MOD['order'];
+ if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC';
+ $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime';
+ $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']);
+ while($r = $db->fetch_array($result)) {
+ if($kw) $r['title'] = str_replace($kw, '
'.$kw.'', $r['title']);
+ if(!$r['islink']) $r['linkurl'] = $MOD['mobile'].$r['linkurl'];
+ $tags[] = $r;
+ }
+ $db->free_result($result);
+ $js_load = preg_replace("/(.*)([&?]page=[0-9]*)(.*)/i", "\\1\\3", rewrite($DT_URL, 1)).'&job=ajax';
+ }
+ if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid);
+ }
+ if($job == 'ajax') {
+ if($tags) include template('list-'.$module, 'tag');
+ exit;
+ }
+ $head_title = $MOD['name'].$L['search'];
+}
+$seo_file = 'search';
+include DT_ROOT.'/include/seo.inc.php';
+include template($MOD['template_search'] ? $MOD['template_search'] : 'search', $module);
+?>
\ No newline at end of file
diff --git a/module/article/show.htm.php b/module/article/show.htm.php
new file mode 100644
index 0000000..7ffa21c
--- /dev/null
+++ b/module/article/show.htm.php
@@ -0,0 +1,107 @@
+get_one("SELECT * FROM {$table} WHERE itemid=$itemid");
+if(!$item || $item['status'] < 3 || $item['islink'] > 0) return false;
+require_once DT_ROOT.'/include/content.class.php';
+$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0;
+extract($item);
+$CAT = get_cat($catid);
+$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data);
+$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid");
+$content = $_content = $t['content'];
+$CP = $MOD['cat_property'] && $CAT['property'];
+if($CP) {
+ require_once DT_ROOT.'/include/property.func.php';
+ $options = property_option($catid);
+ $values = property_value($moduleid, $itemid);
+}
+$adddate = timetodate($addtime, 3);
+$editdate = timetodate($edittime, 3);
+if($voteid) $voteid = explode(' ', $voteid);
+if($fromurl) $fromurl = fix_link($fromurl);
+$fileurl = $linkurl;
+$linkurl = $MOD['linkurl'].$linkurl;
+$titles = array();
+if($subtitle) {
+ $titles = explode("\n", $subtitle);
+ $titles = array_map('trim', $titles);
+}
+$keytags = $tag ? explode(' ', $tag) : array();
+$fee = DC::fee($item['fee'], $MOD['fee_view']);
+if($fee) {
+ $description = DC::description($content, $MOD['pre_view']);
+ $user_status = 4;
+} else {
+ $user_status = 3;
+}
+$pages = '';
+$total = 1;
+$subtitles = count($titles);
+if(strpos($content, 'pagebreak') !== false) {
+ $contents = DC::pagebreak($content);
+ if($contents) {
+ $total = count($contents);
+ if($total < $subtitles) $subtitles = $total;
+ }
+}
+$seo_file = 'show';
+include DT_ROOT.'/include/seo.inc.php';
+$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show'));
+if($EXT['mobile_enable']) {
+ include DT_ROOT.'/include/mobile.htm.php';
+ $head_title = $head_name = $CAT['catname'];
+ $foot = '';
+}
+for(; $page <= $total; $page++) {
+ $subtitle = isset($titles[$page-1]) ? $titles[$page-1] : '';
+ if($subtitle) $seo_title = $subtitle.$seo_delimiter.$seo_title;
+ $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid&page=$page";
+ if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ? itemurl($item, $page) : $item['linkurl']);
+ $filename = $total == 1 ? DT_ROOT.'/'.$MOD['moduledir'].'/'.$fileurl : DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, $page);
+ if($total > 1) {
+ $pages = pages($total, $page, 1, $MOD['linkurl'].itemurl($item, '{destoon_page}'));
+ if($pages) $pages = substr($pages, 0, strpos($pages, '
'));
+ $content = $contents[$page-1];
+ }
+ $_content = $content;
+ if($content) {
+ if($MOD['keylink']) $content = DC::keylink($content, $moduleid);
+ if($lazy) $content = DC::lazy($content);
+ $content = DC::format($content, 1);
+ }
+ $DT_PC = $GLOBALS['DT_PC'] = 1;
+ ob_start();
+ include template($template, $module);
+ $data = ob_get_contents();
+ ob_clean();
+ if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']);
+ file_put($filename, $data);
+ if($page == 1 && $total > 1) {
+ $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, 0);
+ if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']);
+ file_copy($filename, $indexname);
+ }
+ if($EXT['mobile_enable']) {
+ include DT_ROOT.'/include/mobile.htm.php';
+ $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile);
+ $head_title = $head_name = $CAT['catname'];
+ $js_item = 1;
+ $foot = '';
+ if($total > 1) $pages = mobile_pages($total, $page, 1, $MOD['mobile'].itemurl($item, '{destoon_page}'));
+ if($_content) {
+ $content = $_content;
+ if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0);
+ $content = DC::format($content, 0);
+ }
+ $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename);
+ ob_start();
+ include template($template, $module);
+ $data = ob_get_contents();
+ ob_clean();
+ file_put($filename, $data);
+ if($page == 1 && $total > 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname));
+ }
+}
+return true;
+?>
\ No newline at end of file
diff --git a/module/article/show.inc.php b/module/article/show.inc.php
new file mode 100644
index 0000000..2a01786
--- /dev/null
+++ b/module/article/show.inc.php
@@ -0,0 +1,120 @@
+get_one("SELECT * FROM {$table} WHERE itemid=$itemid");
+ if($item && $item['status'] == 3) {
+ if($item['islink']) dheader($item['linkurl']);
+ if($MOD['show_html'] && is_file(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl'])) d301($MOD['linkurl'].$item['linkurl']);
+ extract($item);
+ } else {
+ include load('404.inc');
+ }
+ $CAT = get_cat($catid);
+ if(!check_group($_groupid, $CAT['group_show'])) include load('403.inc');
+ $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data);
+ $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid");
+ $content = $t['content'];
+ $CP = $MOD['cat_property'] && $CAT['property'];
+ if($CP) {
+ require DT_ROOT.'/include/property.func.php';
+ $options = property_option($catid);
+ $values = property_value($moduleid, $itemid);
+ }
+ $adddate = timetodate($addtime, 3);
+ $editdate = timetodate($edittime, 3);
+ if($voteid) $voteid = explode(' ', $voteid);
+ if($fromurl) $fromurl = fix_link($fromurl);
+ $linkurl = $MOD['linkurl'].$linkurl;
+ $titles = array();
+ if($subtitle) {
+ $titles = explode("\n", $subtitle);
+ $titles = array_map('trim', $titles);
+ }
+ $subtitle = isset($titles[$page-1]) ? $titles[$page-1] : '';
+ $keytags = $tag ? explode(' ', $tag) : array();
+ $update = '';
+ $fee = DC::fee($item['fee'], $MOD['fee_view']);
+ if($fee) {
+ $user_status = 4;
+ $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid&page=$page";
+ $description = DC::description($content, $MOD['pre_view']);
+ } else {
+ $user_status = 3;
+ }
+ $pages = '';
+ $subtitles = count($titles);
+ $total = 1;
+ if(strpos($content, 'pagebreak') !== false) {
+ $contents = DC::pagebreak($content);
+ if($contents) {
+ $total = count($contents);
+ $pages = pages($total, $page, 1, $MOD['linkurl'].itemurl($item, '{destoon_page}'));
+ if($pages) $pages = substr($pages, 0, strpos($pages, ''));
+ $content = isset($contents[$page-1]) ? $contents[$page-1] : '';
+ if($total < $subtitles) $subtitles = $total;
+ }
+ }
+ if($page > $total) include load('404.inc');
+ if($content) {
+ $content = DC::format($content, $DT_PC);
+ if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC);
+ if($lazy) $content = DC::lazy($content);
+ }
+ if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ? itemurl($item, $page) : $item['linkurl']);
+} else {
+ $itemid or dheader($MOD['mobile']);
+ $item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid");
+ ($item && $item['status'] == 3) or message($L['msg_not_exist']);
+ extract($item);
+ $CAT = get_cat($catid);
+ if(!check_group($_groupid, $MOD['group_show']) || !check_group($_groupid, $CAT['group_show'])) message($L['msg_no_right']);
+ $description = '';
+ $user_status = 3;
+ $fee = DC::fee($item['fee'], $MOD['fee_view']);
+ include DT_ROOT.'/mobile/api/content.inc.php';
+ $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data);
+ $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid");
+ $content = $t['content'];
+ $titles = array();
+ if($subtitle) {
+ $titles = explode("\n", $subtitle);
+ $titles = array_map('trim', $titles);
+ }
+ $subtitle = isset($titles[$page-1]) ? $titles[$page-1] : '';
+ $keytags = $tag ? explode(' ', $tag) : array();
+ $pages = '';
+ $subtitles = count($titles);
+ $total = 1;
+ if(strpos($content, 'pagebreak') !== false) {
+ $contents = DC::pagebreak($content);
+ if($contents) {
+ $total = count($contents);
+ $pages = mobile_pages($total, $page, 1, $MOD['mobile'].itemurl($item, '{destoon_page}'));
+ $content = isset($contents[$page-1]) ? $contents[$page-1] : '';
+ if($total < $subtitles) $subtitles = $total;
+ }
+ }
+ if($content) {
+ if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC);
+ if($share_icon) $share_icon = DC::icon($thumb, $content);
+ if($user_status == 2) $description = DC::description($content, $MOD['pre_view']);
+ $content = DC::format($content, $DT_PC);
+ }
+ $editdate = timetodate($addtime, 5);
+ $update = '';
+ $head_title = $head_name = $CAT['catname'];
+ $js_item = 1;
+ $foot = '';
+}
+if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php';
+$seo_file = 'show';
+include DT_ROOT.'/include/seo.inc.php';
+if($subtitle) $seo_title = $subtitle.$seo_delimiter.$seo_title;
+$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show'));
+include template($template, $module);
+?>
\ No newline at end of file
diff --git a/module/brand/admin/index.inc.php b/module/brand/admin/index.inc.php
new file mode 100644
index 0000000..1ecb963
--- /dev/null
+++ b/module/brand/admin/index.inc.php
@@ -0,0 +1,217 @@
+ 9 ? " AND level>0" : " AND level=$level";
+ if($fromtime) $condition .= " AND `$datetype`>=$fromtime";
+ if($totime) $condition .= " AND `$datetype`<=$totime";
+ if($thumb) $condition .= " AND thumb<>''";
+ if($guest) $condition .= " AND username=''";
+ if($minvip) $condition .= " AND vip>=$minvip";
+ if($maxvip) $condition .= " AND vip<=$maxvip";
+ if($ip) $condition .= " AND ip='$ip'";
+ if($username) $condition .= " AND username='$username'";
+ if($itemid) $condition .= " AND itemid=$itemid";
+
+ $timetype = strpos($dorder[$order], 'add') !== false ? 'add' : '';
+}
+switch($action) {
+ case 'add':
+ if($submit) {
+ if($do->pass($post)) {
+ if($FD) fields_check($post_fields);
+ if($CP) property_check($post_ppt);
+ $do->add($post);
+ if($FD) fields_update($post_fields, $table, $do->itemid);
+ if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid);
+ if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid);
+ dmsg('添加成功', '?moduleid='.$moduleid.'&action='.$action.'&catid='.$post['catid']);
+ } else {
+ msg($do->errmsg);
+ }
+ } else {
+ foreach($do->fields as $v) {
+ isset($$v) or $$v = '';
+ }
+ $content = '';
+ $status = 3;
+ $addtime = timetodate($DT_TIME);
+ $totime = '';
+ $username = $_username;
+ $item = array();
+ $menuid = 0;
+ isset($url) or $url = '';
+ if($url) {
+ $tmp = fetch_url($url);
+ if($tmp) extract($tmp);
+ }
+ $history = 0;
+ include tpl('edit', $module);
+ }
+ break;
+ case 'edit':
+ $itemid or msg();
+ $do->itemid = $itemid;
+ if($submit) {
+ if($do->pass($post)) {
+ if($FD) fields_check($post_fields);
+ if($CP) property_check($post_ppt);
+ if($FD) fields_update($post_fields, $table, $do->itemid);
+ if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid);
+ $do->edit($post);
+ dmsg('修改成功', $forward);
+ } else {
+ msg($do->errmsg);
+ }
+ } else {
+ $item = $do->get_one();
+ extract($item);
+ $history = history($moduleid, $itemid);
+ $addtime = timetodate($addtime);
+ $totime = $totime ? timetodate($totime, 3) : '';
+ $menuon = array('4', '3', '2', '1');
+ $menuid = $menuon[$status];
+ include tpl($action, $module);
+ }
+ break;
+ case 'move':
+ if($submit) {
+ $fromids or msg('请填写来源ID');
+ if($tocatid) {
+ $db->query("UPDATE {$table} SET catid=$tocatid WHERE `{$fromtype}` IN ($fromids)");
+ dmsg('移动成功', $forward);
+ } else {
+ msg('请选择目标分类');
+ }
+ } else {
+ $itemid = $itemid ? implode(',', $itemid) : '';
+ $menuid = 5;
+ include tpl($action);
+ }
+ break;
+ case 'update':
+ is_array($itemid) or msg('请选择'.$MOD['name']);
+ foreach($itemid as $v) {
+ $do->update($v);
+ }
+ dmsg('更新成功', $forward);
+ break;
+ case 'tohtml':
+ is_array($itemid) or msg('请选择'.$MOD['name']);
+ foreach($itemid as $itemid) {
+ tohtml('show', $module);
+ }
+ dmsg('生成成功', $forward);
+ break;
+ case 'delete':
+ $itemid or msg('请选择'.$MOD['name']);
+ isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
+ dmsg('删除成功', $forward);
+ break;
+ case 'restore':
+ $itemid or msg('请选择'.$MOD['name']);
+ $do->restore($itemid);
+ dmsg('还原成功', $forward);
+ break;
+ case 'refresh':
+ $itemid or msg('请选择'.$MOD['name']);
+ $do->refresh($itemid);
+ dmsg('刷新成功', $forward);
+ break;
+ case 'clear':
+ $do->clear();
+ dmsg('清空成功', $forward);
+ break;
+ case 'level':
+ $itemid or msg('请选择'.$MOD['name']);
+ $level = intval($level);
+ $do->level($itemid, $level);
+ dmsg('级别设置成功', $forward);
+ break;
+ case 'recycle':
+ $lists = $do->get_list('status=0'.$condition, $dorder[$order]);
+ $menuid = 4;
+ include tpl('index', $module);
+ break;
+ case 'reject':
+ if($itemid && !$psize) {
+ $do->reject($itemid);
+ dmsg('拒绝成功', $forward);
+ } else {
+ $lists = $do->get_list('status=1'.$condition, $dorder[$order]);
+ $menuid = 3;
+ include tpl('index', $module);
+ }
+ break;
+ case 'check':
+ if($itemid && !$psize) {
+ $do->check($itemid);
+ dmsg('审核成功', $forward);
+ } else {
+ $lists = $do->get_list('status=2'.$condition, $dorder[$order]);
+ $menuid = 2;
+ include tpl('index', $module);
+ }
+ break;
+ default:
+ $lists = $do->get_list('status=3'.$condition, $dorder[$order]);
+ $menuid = 1;
+ include tpl('index', $module);
+ break;
+}
+?>
\ No newline at end of file
diff --git a/module/brand/admin/template/html.tpl.php b/module/brand/admin/template/html.tpl.php
new file mode 100644
index 0000000..339891c
--- /dev/null
+++ b/module/brand/admin/template/html.tpl.php
@@ -0,0 +1,59 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/module/brand/admin/template/index.tpl.php b/module/brand/admin/template/index.tpl.php
new file mode 100644
index 0000000..70abac6
--- /dev/null
+++ b/module/brand/admin/template/index.tpl.php
@@ -0,0 +1,160 @@
+
+
+
+'.$pages.' ' : '';?>
+