680 changed files with 34712 additions and 0 deletions
-
26module/article/admin/config.inc.php
-
119module/article/admin/html.inc.php
-
11module/article/admin/menu.inc.php
-
50module/article/admin/setting.inc.php
-
151module/article/admin/template/index.tpl.php
-
290module/article/article.class.php
-
92module/article/list.htm.php
-
153module/article/search.inc.php
-
107module/article/show.htm.php
-
120module/article/show.inc.php
-
217module/brand/admin/index.inc.php
-
59module/brand/admin/template/html.tpl.php
-
160module/brand/admin/template/index.tpl.php
-
5module/brand/admin/uninstall.inc.php
-
285module/brand/brand.class.php
-
92module/brand/list.htm.php
-
268module/brand/my.inc.php
-
63module/brand/show.htm.php
-
26module/buy/admin/config.inc.php
-
1module/buy/admin/index.html
-
10module/buy/admin/install.inc.php
-
9module/buy/admin/remkdir.inc.php
-
169module/buy/admin/template/index.tpl.php
-
320module/buy/buy.class.php
-
3module/buy/global.func.php
-
1module/buy/index.html
-
88module/buy/list.inc.php
-
267module/buy/my.inc.php
-
98module/buy/show.inc.php
-
53module/club/admin/config.inc.php
-
150module/club/admin/group.inc.php
-
184module/club/admin/html.inc.php
-
13module/club/admin/menu.inc.php
-
111module/club/admin/reply.inc.php
-
51module/club/admin/setting.inc.php
-
163module/club/admin/template/group_edit.tpl.php
-
61module/club/admin/template/html.tpl.php
-
33module/club/admin/template/move.tpl.php
-
172module/club/chat.inc.php
-
124module/club/fans.class.php
-
34module/club/goto.inc.php
-
271module/club/group.class.php
-
45module/club/index.inc.php
-
225module/club/my.inc.php
-
111module/club/show.htm.php
-
164module/company/admin/html.inc.php
-
16module/company/admin/menu.inc.php
-
49module/company/admin/setting.inc.php
-
1module/company/admin/template/index.html
-
134module/company/admin/template/index.tpl.php
-
35module/company/admin/template/move.tpl.php
-
390module/company/admin/template/setting.tpl.php
-
100module/company/admin/template/vip.tpl.php
-
63module/company/homepage.inc.php
-
58module/company/honor.inc.php
-
54module/company/index.htm.php
-
1module/company/index.html
-
300module/company/init.inc.php
-
144module/company/mall.inc.php
-
129module/company/search.inc.php
-
26module/down/admin/config.inc.php
-
9module/down/admin/remkdir.inc.php
-
50module/down/admin/setting.inc.php
-
153module/down/admin/template/index.tpl.php
-
7module/down/common.inc.php
-
25module/down/global.func.php
-
1module/down/index.html
-
27module/exhibit/admin/config.inc.php
-
10module/exhibit/admin/install.inc.php
-
50module/exhibit/admin/setting.inc.php
-
8module/exhibit/common.inc.php
-
285module/exhibit/exhibit.class.php
-
41module/exhibit/index.inc.php
-
71module/exhibit/show.htm.php
-
71module/exhibit/sign.inc.php
-
107module/extend/admin/comment.inc.php
-
161module/extend/admin/gift.inc.php
-
75module/extend/admin/guestbook.inc.php
-
17module/extend/admin/menu.inc.php
-
31module/extend/admin/setting.inc.php
-
93module/extend/admin/template/ad_list.tpl.php
-
25module/extend/admin/template/ad_runcode.tpl.php
-
50module/extend/admin/template/comment_ban.tpl.php
-
66module/extend/admin/template/comment_edit.tpl.php
-
74module/extend/admin/template/form.tpl.php
-
60module/extend/admin/template/form_question_copy.tpl.php
-
114module/extend/admin/template/gift_edit.tpl.php
-
65module/extend/admin/template/gift_order_show.tpl.php
-
65module/extend/admin/template/link_check.tpl.php
-
66module/extend/admin/template/poll.tpl.php
-
61module/extend/admin/template/vote.tpl.php
-
62module/extend/admin/template/webpage.tpl.php
-
93module/extend/admin/template/webpage_edit.tpl.php
-
24module/extend/attach.inc.php
-
183module/extend/comment.class.php
-
5module/extend/common.inc.php
-
44module/extend/feed.inc.php
-
169module/extend/form.inc.php
-
65module/extend/guestbook.inc.php
-
52module/extend/link.inc.php
@ -0,0 +1,26 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$MCFG = array(); |
||||
|
$MCFG['module'] = 'article'; |
||||
|
$MCFG['name'] = '文章'; |
||||
|
$MCFG['author'] = 'DESTOON'; |
||||
|
$MCFG['homepage'] = 'www.destoon.com'; |
||||
|
$MCFG['copy'] = true; |
||||
|
$MCFG['uninstall'] = true; |
||||
|
$MCFG['moduleid'] = 0; |
||||
|
|
||||
|
$RT = array(); |
||||
|
$RT['file']['index'] = '文章管理'; |
||||
|
$RT['file']['html'] = '更新网页'; |
||||
|
|
||||
|
$RT['action']['index']['add'] = '添加文章'; |
||||
|
$RT['action']['index']['edit'] = '修改文章'; |
||||
|
$RT['action']['index']['delete'] = '删除文章'; |
||||
|
$RT['action']['index']['check'] = '审核文章'; |
||||
|
$RT['action']['index']['reject'] = '未通过'; |
||||
|
$RT['action']['index']['recycle'] = '回收站'; |
||||
|
$RT['action']['index']['move'] = '文章移动'; |
||||
|
$RT['action']['index']['level'] = '信息级别'; |
||||
|
|
||||
|
$CT = true; |
||||
|
?>
|
||||
@ -0,0 +1,119 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$menus = array ( |
||||
|
array('更新数据', '?moduleid='.$moduleid.'&file='.$file), |
||||
|
array('模块首页', $MOD['linkurl'], ' target="_blank"'), |
||||
|
); |
||||
|
$all = (isset($all) && $all) ? 1 : 0; |
||||
|
$one = (isset($one) && $one) ? 1 : 0; |
||||
|
$this_forward = '?moduleid='.$moduleid.'&file='.$file; |
||||
|
switch($action) { |
||||
|
case 'all': |
||||
|
msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=show&update=1&all=1&one='.$one); |
||||
|
break; |
||||
|
case 'index': |
||||
|
tohtml('index', $module); |
||||
|
$all ? msg($MOD['name'].'首页生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=list&all=1&one='.$one) : dmsg($MOD['name'].'首页生成成功', $this_forward); |
||||
|
break; |
||||
|
case 'list': |
||||
|
if(!$MOD['list_html']) { |
||||
|
$all ? msg($MOD['name'].'列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg($MOD['name'].'列表生成成功', $this_forward); |
||||
|
} |
||||
|
if(isset($catids)) { |
||||
|
$CAT = $db->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; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,11 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$menu = array( |
||||
|
array("添加".$name, "?moduleid=$moduleid&action=add"), |
||||
|
array($name."列表", "?moduleid=$moduleid"), |
||||
|
array("审核".$name, "?moduleid=$moduleid&action=check"), |
||||
|
array("分类管理", "?file=category&mid=$moduleid"), |
||||
|
array("更新数据", "?moduleid=$moduleid&file=html"), |
||||
|
array("模块设置", "?moduleid=$moduleid&file=setting"), |
||||
|
); |
||||
|
?>
|
||||
@ -0,0 +1,50 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$tab = isset($tab) ? intval($tab) : 0; |
||||
|
$all = isset($all) ? intval($all) : 0; |
||||
|
if($submit) { |
||||
|
if($setting['split']) { |
||||
|
$setting['fulltext'] = 0; |
||||
|
cache_write($moduleid.'.part', $moduleid); |
||||
|
} else { |
||||
|
cache_delete($moduleid.'.part'); |
||||
|
} |
||||
|
foreach($setting as $k=>$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('\'(?!((<.*?)|(<a.*?)|(<strong.*?)))('.$kw.')(?!(([^<>]*?)>)|([^>]*?</a>)|([^>]*?</strong>))\'si', '<span class=highlight>'.$kw.'</span>', $data); |
||||
|
$data = preg_replace('/<span class=highlight>/', '<a name=high></a><span class=highlight>', $data, 1); |
||||
|
echo $data ? $data : $content; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,151 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<span data-hide-1200="1"><?php echo $level_select;?> </span>
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="text" name="username" value="<?php echo $username;?>" size="10" placeholder="会员名" title="会员名 双击显示会员资料" ondblclick="if(this.value){_user(this.value);}"/> |
||||
|
<input type="text" size="10" name="itemid" value="<?php echo $itemid;?>" placeholder="<?php echo $MOD['name'];?>ID" title="<?php echo $MOD['name'];?>ID"/> |
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<select name="datetype"> |
||||
|
<option value="edittime" <?php if($datetype == 'edittime') echo 'selected';?>>更新时间</option>
|
||||
|
<option value="addtime" <?php if($datetype == 'addtime') echo 'selected';?>>发布时间</option>
|
||||
|
</select> |
||||
|
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>
|
||||
|
<?php echo $_admin == 1 ? category_select('catid', '不限分类', $catid, $moduleid) : ajax_category_select('catid', '不限分类', $catid, $moduleid);?>
|
||||
|
<?php echo ajax_area_select('areaid', '不限地区', $areaid);?>
|
||||
|
<input type="checkbox" name="thumb" value="1"<?php echo $thumb ? ' checked' : '';?>/> 图片
|
||||
|
<input type="checkbox" name="link" value="1"<?php echo $link ? ' checked' : '';?>/> 外链
|
||||
|
<input type="checkbox" name="guest" value="1"<?php echo $guest ? ' checked' : '';?>/> 游客
|
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th>分类</th> |
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');"><img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="60"><a href="javascript:;" onclick="Dq('thumb',<?php echo $thumb ? 0 : 1;?>);">图片</a></th> |
||||
|
<th>标题</th> |
||||
|
<th>会员</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 9 ? 10 : 9;?>');">点赞 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 10 ? 'asc' : ($order == 9 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<?php if($order == 11 || $order == 12) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">反对 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 13 ? 14 : 13;?>');">收藏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 14 ? 'asc' : ($order == 13 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 15 ? 16 : 15;?>');">打赏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 16 ? 'asc' : ($order == 15 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<?php if($order == 17 || $order == 18) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 17 ? 18 : 17;?>');">赏金 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 18 ? 'asc' : ($order == 17 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 19 ? 20 : 19;?>');">分享 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 20 ? 'asc' : ($order == 19 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 21 ? 22 : 21;?>');">举报 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 22 ? 'asc' : ($order == 21 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 23 ? 24 : 23;?>');">评论 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 24 ? 'asc' : ($order == 23 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="50">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td><a href="<?php echo $v['caturl'];?>" target="_blank"><?php echo $v['catname'];?></a></td>
|
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td><a href="javascript:_preview('<?php echo $v['thumb'];?>');"><img src="<?php echo $v['thumb'] ? $v['thumb'] : DT_SKIN.'image/nopic60.gif';?>" width="60" class="thumb"/></a></td> |
||||
|
<td> |
||||
|
<div class="lt"> |
||||
|
<?php if($v['status'] == 3) {?>
|
||||
|
<a href="<?php echo $v['linkurl'];?>" target="_blank" class="t"><?php echo $v['title'];?></a>
|
||||
|
<?php } else { ?>
|
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>" class="t"><?php echo $v['title'];?></a>
|
||||
|
<?php } ?>
|
||||
|
<div> |
||||
|
更新:<span class="c_p" onclick="Dq('datetype','edittime');Dq('date',this.innerHTML);"><?php echo timetodate($v['edittime'], 6);?></span><br/>
|
||||
|
添加:<span class="c_p" onclick="Dq('datetype','addtime');Dq('date',this.innerHTML);"><?php echo timetodate($v['addtime'], 6);?></span>
|
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td title="编辑:<?php echo $v['editor'];?>"> |
||||
|
<?php if($v['username']) { ?>
|
||||
|
<a href="javascript:;" onclick="_user(this.innerHTML);"><?php echo $v['username'];?></a>
|
||||
|
<?php } else { ?>
|
||||
|
<a href="javascript:;" onclick="_ip(this.innerHTML);" title="游客"><?php echo $v['ip'];?></a>
|
||||
|
<?php } ?>
|
||||
|
</td> |
||||
|
<td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&catid=<?php echo $v['catid'];?>&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 浏览记录');"><?php echo $v['hits'];?></a></td>
|
||||
|
<td><a href="javascript:Dwidget('?file=like&action=like&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '点赞记录');"><?php echo $v['likes'];?></a></td>
|
||||
|
<?php if($order == 11 || $order == 12) { ?><td><a href="javascript:Dwidget('?file=like&action=hate&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '反对记录');"><?php echo $v['hates'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=favorite&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 收藏记录');"><?php echo $v['favorites'];?></a></td><?php } ?>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 打赏记录');"><?php echo $v['awards'];?></a></td>
|
||||
|
<?php if($order == 17 || $order == 18) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 打赏记录');"><?php echo $v['award'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['itemid'];?>&kw=share.php', '[<?php echo $v['alt'];?>] 分享记录');"><?php echo $v['shares'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><td><a href="javascript:Dwidget('?moduleid=3&file=guestbook&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '举报记录');"><?php echo $v['reports'];?></a></td><?php } ?>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=3&file=comment&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 评论列表');"><?php echo $v['comments'];?></a></td>
|
||||
|
<td> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<?php include tpl('notice_chip');?>
|
||||
|
<div class="btns"> |
||||
|
|
||||
|
<?php if($action == 'check') { ?>
|
||||
|
|
||||
|
<input type="submit" value="通过审核" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=check';"/> |
||||
|
<input type="submit" value="拒 绝" class="btn-r" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/> |
||||
|
<input type="submit" value="移动分类" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'expire') { ?>
|
||||
|
<input type="submit" value="刷新待发" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=expire&refresh=1';"/> |
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'reject') { ?>
|
||||
|
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'recycle') { ?>
|
||||
|
|
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="还 原" class="btn" onclick="if(confirm('确定要还原选中<?php echo $MOD['name'];?>吗?状态将被设置为已通过')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=restore'}else{return false;}"/> |
||||
|
<input type="submit" value="清 空" class="btn-r" onclick="if(confirm('确定要清空回收站吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=clear';}else{return false;}"/> |
||||
|
|
||||
|
<?php } else { ?>
|
||||
|
|
||||
|
<input type="submit" value="更新信息" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=update';"/> |
||||
|
<?php if($MOD['show_html']) { ?><input type="submit" value=" 生成网页 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=tohtml';"/> <?php } ?>
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="移动分类" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level\';this.form.submit();"');?>
|
||||
|
|
||||
|
<?php } ?>
|
||||
|
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<br/> |
||||
|
<script type="text/javascript"> |
||||
|
$(function(){ |
||||
|
Menuon(<?php echo $menuid;?>);
|
||||
|
$('.thumb').on('error', function(e) { |
||||
|
$(this).attr('src', '<?php echo DT_SKIN;?>image/nopic60.gif'); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,290 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
class article { |
||||
|
var $moduleid; |
||||
|
var $itemid; |
||||
|
var $table; |
||||
|
var $table_data; |
||||
|
var $split; |
||||
|
var $fields; |
||||
|
var $errmsg = errmsg; |
||||
|
|
||||
|
function __construct($moduleid) { |
||||
|
global $table, $table_data, $MOD; |
||||
|
$this->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('<hr class="de-pagebreak"/></p>', '<p><hr class="de-pagebreak"/>', '<hr class="de-pagebreak"/></div>', '<div><hr class="de-pagebreak"/>'), array('</p><hr class="de-pagebreak"/>', '<hr class="de-pagebreak"/><p>', '</div><hr class="de-pagebreak"/>', '<hr class="de-pagebreak"/><div>'), $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 .= '<img src="'.$post['thumb'].'"/>'; |
||||
|
$r = $this->get_one(); |
||||
|
$old = $r['content']; |
||||
|
if($r['thumb']) $old .= '<img src="'.$r['thumb'].'"/>'; |
||||
|
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; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,92 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if(!$MOD['list_html'] || !$catid) return false; |
||||
|
$CAT or $CAT = get_cat($catid); |
||||
|
if(!$CAT) return false; |
||||
|
unset($CAT['moduleid']); |
||||
|
extract($CAT); |
||||
|
$CP = $MOD['cat_property'] && $CAT['property']; |
||||
|
if($MOD['cat_property'] && $CAT['property']) { |
||||
|
require_once DT_ROOT.'/include/property.func.php'; |
||||
|
$PPT = property_condition($catid); |
||||
|
} |
||||
|
$maincat = get_maincat($child ? $catid : $parentid, $moduleid); |
||||
|
|
||||
|
$condition = 'status=3'; |
||||
|
$condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; |
||||
|
if($page == 1) { |
||||
|
$items = $db->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; |
||||
|
?>
|
||||
@ -0,0 +1,153 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
if($DT['rewrite'] && $DT['search_rewrite'] && $_SERVER["REQUEST_URI"] && $_SERVER['QUERY_STRING'] && $job != 'ajax') { |
||||
|
$_URL = rewrite($_SERVER["REQUEST_URI"]); |
||||
|
if($_URL != $_SERVER["REQUEST_URI"]) dheader($_URL); |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
if(!check_group($_groupid, $MOD['group_search'])) include load('403.inc'); |
||||
|
include load('search.lang'); |
||||
|
$CP = $MOD['cat_property'] && $catid && $CAT['property']; |
||||
|
if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) { |
||||
|
$areaid = $cityid; |
||||
|
$ARE = get_area($areaid); |
||||
|
} |
||||
|
$sfields = array($L['by_auto'], $L['by_title'], $L['by_content'], $L['by_introduce'], $L['by_author']); |
||||
|
$dfields = array('keyword', 'title', 'content', 'introduce', 'author'); |
||||
|
$sorder = array($L['order'], $L['order_auto'], $L['order_addtime'], $L['order_hits']); |
||||
|
$dorder = array($MOD['order'], '', 'addtime DESC', 'hits DESC'); |
||||
|
if(!$MOD['fulltext']) unset($sfields[2], $dfields[2]); |
||||
|
isset($fields) && isset($dfields[$fields]) or $fields = 0; |
||||
|
isset($order) && isset($dorder[$order]) or $order = 0; |
||||
|
$category_select = category_select('catid', $L['all_category'], $catid, $moduleid); |
||||
|
$area_select = $DT['city'] ? ajax_area_select('areaid', $L['all_area'], $areaid) : ''; |
||||
|
$order_select = dselect($sorder, 'order', '', $order); |
||||
|
$tags = array(); |
||||
|
if($DT_QST) { |
||||
|
if($kw) { |
||||
|
if(strlen($kw) < $DT['min_kw'] || strlen($kw) > $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, '<span class="f_red">'.$kw.'</span>', $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); |
||||
|
?>
|
||||
@ -0,0 +1,107 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if(!$MOD['show_html'] || !$itemid) return false; |
||||
|
$item = $db->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, '<cite>')); |
||||
|
$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; |
||||
|
?>
|
||||
@ -0,0 +1,120 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
require DT_ROOT.'/include/content.class.php'; |
||||
|
$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; |
||||
|
if($DT_PC) { |
||||
|
$itemid or dheader($MOD['linkurl']); |
||||
|
if(!check_group($_groupid, $MOD['group_show'])) include load('403.inc'); |
||||
|
$item = $db->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, '<cite>')); |
||||
|
$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); |
||||
|
?>
|
||||
@ -0,0 +1,217 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php'; |
||||
|
$do = new $module($moduleid); |
||||
|
$menus = array ( |
||||
|
array('添加'.$MOD['name'], '?moduleid='.$moduleid.'&action=add'), |
||||
|
array($MOD['name'].'列表', '?moduleid='.$moduleid), |
||||
|
array('审核'.$MOD['name'], '?moduleid='.$moduleid.'&action=check'), |
||||
|
array('未通过', '?moduleid='.$moduleid.'&action=reject'), |
||||
|
array('回收站', '?moduleid='.$moduleid.'&action=recycle'), |
||||
|
array('移动分类', '?moduleid='.$moduleid.'&action=move'), |
||||
|
); |
||||
|
|
||||
|
if(in_array($action, array('add', 'edit'))) { |
||||
|
$FD = cache_read('fields-'.substr($table, strlen($DT_PRE)).'.php'); |
||||
|
if($FD) require DT_ROOT.'/include/fields.func.php'; |
||||
|
isset($post_fields) or $post_fields = array(); |
||||
|
$CP = $MOD['cat_property']; |
||||
|
if($CP) require DT_ROOT.'/include/property.func.php'; |
||||
|
isset($post_ppt) or $post_ppt = array(); |
||||
|
} |
||||
|
|
||||
|
if($_catids || $_areaids) require DT_ROOT.'/admin/admin_check.inc.php'; |
||||
|
|
||||
|
if(in_array($action, array('', 'check', 'expire', 'reject', 'recycle'))) { |
||||
|
$sfields = array('模糊', '标题', '公司名', '联系人', '联系电话', '联系地址', '电子邮件', 'QQ', '微信', '会员名', '编辑', 'IP', '文件路径', '内容模板'); |
||||
|
$dfields = array('keyword', 'title', 'company', 'truename', 'telephone', 'address', 'email', 'qq', 'wx', 'username', 'editor', 'ip', 'filepath', 'template'); |
||||
|
isset($fields) && isset($dfields[$fields]) or $fields = 0; |
||||
|
$sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '更新时间降序', '更新时间升序', '推荐级别降序', '推荐级别升序', '浏览次数降序', '浏览次数升序', '点赞次数降序', '点赞次数升序', '反对次数降序', '反对次数升序', '收藏次数降序', '收藏次数升序', '打赏次数降序', '打赏次数升序', '打赏金额降序', '打赏金额升序', '分享次数降序', '分享次数升序', '举报次数降序', '举报次数升序', '评论数量降序', '评论数量升序', VIP.'级别降序', VIP.'级别升序', '到期时间降序', '到期时间升序', '留言数量降序', '留言数量升序', '信息ID降序', '信息ID升序'); |
||||
|
$dorder = array($MOD['order'], 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime DESC', 'level DESC', 'level ASC', 'hits DESC', 'hits ASC', 'likes DESC', 'likes ASC', 'hates DESC', 'hates ASC', 'favorites DESC', 'favorites ASC', 'awards DESC', 'awards ASC', 'award DESC', 'award ASC', 'shares DESC', 'shares ASC', 'reports DESC', 'reports ASC', 'comments DESC', 'comments ASC', 'vip DESC', 'vip ASC', 'totime ASC', 'totime ASC', 'messages DESC', 'messages ASC', 'itemid DESC', 'itemid ASC'); |
||||
|
isset($order) && isset($dorder[$order]) or $order = 0; |
||||
|
|
||||
|
isset($datetype) && in_array($datetype, array('edittime', 'addtime', 'totime')) or $datetype = 'edittime'; |
||||
|
(isset($fromdate) && is_time($fromdate)) or $fromdate = ''; |
||||
|
$fromtime = $fromdate ? datetotime($fromdate) : 0; |
||||
|
(isset($todate) && is_time($todate)) or $todate = ''; |
||||
|
$totime = $todate ? datetotime($todate) : 0; |
||||
|
$level = isset($level) ? intval($level) : 0; |
||||
|
$areaid = isset($areaid) ? intval($areaid) : 0; |
||||
|
$thumb = isset($thumb) ? intval($thumb) : 0; |
||||
|
$guest = isset($guest) ? intval($guest) : 0; |
||||
|
$minvip = isset($minvip) ? intval($minvip) : ''; |
||||
|
$minvip or $minvip = ''; |
||||
|
$maxvip = isset($maxvip) ? intval($maxvip) : ''; |
||||
|
$maxvip or $maxvip = ''; |
||||
|
$itemid or $itemid = ''; |
||||
|
(isset($ip) && is_ip($ip)) or $ip= ''; |
||||
|
(isset($username) && check_name($username)) or $username = ''; |
||||
|
|
||||
|
$fields_select = dselect($sfields, 'fields', '', $fields); |
||||
|
$level_select = level_select('level', '级别', $level, 'all'); |
||||
|
$order_select = dselect($sorder, 'order', '', $order); |
||||
|
|
||||
|
$condition = ''; |
||||
|
if($_childs) $condition .= " AND catid IN (".$_childs.")";//CATE
|
||||
|
if($_areaids) $condition .= " AND areaid IN (".$_areaids.")";//CITY
|
||||
|
if($keyword) $condition .= match_kw($dfields[$fields], $keyword); |
||||
|
if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; |
||||
|
if($areaid) $condition .= ($AREA[$areaid]['child']) ? " AND areaid IN (".$AREA[$areaid]['arrchildid'].")" : " AND areaid=$areaid"; |
||||
|
if($level) $condition .= $level > 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; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,59 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td height="30"> |
||||
|
<input type="submit" value="一键更新" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=all';" title="生成该模块所有网页"/> |
||||
|
<input type="submit" value="生成首页" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=index';" title="生成该模块首页"/> |
||||
|
<input type="submit" value="生成列表" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=list';" title="生成该模块所有分类"/> |
||||
|
<input type="submit" value="生成内容" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show';" title="生成该模块所有内容页"/> |
||||
|
<input type="submit" value="更新信息" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show&update=1';" title="更新该模块所有信息地址等项目"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th>起始ID</th> |
||||
|
<th>结束ID</th> |
||||
|
<th width="200">每轮生成数量</th> |
||||
|
<th width="200">操作</th> |
||||
|
</tr> |
||||
|
<tr align="center"> |
||||
|
<td><input type="text" size="6" name="fid" value="<?php echo $fid;?>"/></td> |
||||
|
<td><input type="text" size="6" name="tid" value="<?php echo $tid;?>"/></td> |
||||
|
<td><input type="text" size="5" name="num" value="100"/></td> |
||||
|
<td><input type="submit" value="生成内容" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show';"/> |
||||
|
<input type="submit" value="更新信息" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show&update=1';"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th>选择分类</th> |
||||
|
<th width="200">每轮生成数量</th> |
||||
|
<th width="200">操作</th> |
||||
|
</tr> |
||||
|
<tr align="center"> |
||||
|
<td> |
||||
|
<?php echo category_select('catid', '选择分类', 0, $moduleid);?>
|
||||
|
|
||||
|
第 <input type="text" size="3" name="fpage" value="1"/> 页 至 <input type="text" size="3" name="tpage" value=""/> 页 |
||||
|
</td> |
||||
|
<td><input type="text" size="5" name="num" value="100"/></td> |
||||
|
<td> |
||||
|
<input type="submit" value="生成列表" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=cate';"/> |
||||
|
<input type="submit" value="生成内容" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=item';"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<script type="text/javascript">Menuon(0);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,160 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<span data-hide-1200="1"><?php echo $level_select;?> </span>
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="text" name="username" value="<?php echo $username;?>" size="10" placeholder="会员名" title="会员名 双击显示会员资料" ondblclick="if(this.value){_user(this.value);}"/> |
||||
|
<input type="text" size="10" name="itemid" value="<?php echo $itemid;?>" placeholder="<?php echo $MOD['name'];?>ID" title="<?php echo $MOD['name'];?>ID"/> |
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<select name="datetype"> |
||||
|
<option value="edittime" <?php if($datetype == 'edittime') echo 'selected';?>>更新时间</option>
|
||||
|
<option value="addtime" <?php if($datetype == 'addtime') echo 'selected';?>>发布时间</option>
|
||||
|
</select> |
||||
|
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>
|
||||
|
<?php echo category_select('catid', '所属行业', $catid, $moduleid);?>
|
||||
|
<?php echo ajax_area_select('areaid', '所在地区', $areaid);?>
|
||||
|
<?php echo VIP;?>:<input type="text" size="2" name="minvip" value="<?php echo $minvip;?>"/> ~ <input type="text" size="2" name="maxvip" value="<?php echo $maxvip;?>"/>
|
||||
|
<input type="checkbox" name="guest" value="1"<?php echo $guest ? ' checked' : '';?>/>游客
|
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th>分类</th> |
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');"><img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="80">LOGO</th> |
||||
|
<th>标题</th> |
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 25 ? 26 : 25;?>');"><img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 26 ? 'asc' : ($order == 25 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th>会员</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 29 ? 30 : 29;?>');">留言 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 30 ? 'asc' : ($order == 29 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<?php if($order == 9 || $order == 10) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 9 ? 10 : 9;?>');">点赞 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 10 ? 'asc' : ($order == 9 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 11 || $order == 12) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">反对 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 13 ? 14 : 13;?>');">收藏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 14 ? 'asc' : ($order == 13 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 15 || $order == 16) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 15 ? 16 : 15;?>');">打赏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 16 ? 'asc' : ($order == 15 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 17 || $order == 18) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 17 ? 18 : 17;?>');">赏金 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 18 ? 'asc' : ($order == 17 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 19 ? 20 : 19;?>');">分享 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 20 ? 'asc' : ($order == 19 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 21 ? 22 : 21;?>');">举报 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 22 ? 'asc' : ($order == 21 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 23 ? 24 : 23;?>');">评论 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 24 ? 'asc' : ($order == 23 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="50">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td><a href="<?php echo $v['caturl'];?>" target="_blank"><?php echo $v['catname'];?></a></td>
|
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td><a href="javascript:_preview('<?php echo $v['thumb'];?>');"><img src="<?php echo $v['thumb'];?>" width="80" class="thumb"/></a></td> |
||||
|
<td> |
||||
|
<div class="lt"> |
||||
|
<?php if($v['status'] == 3) {?>
|
||||
|
<a href="<?php echo $v['linkurl'];?>" target="_blank" class="t"><?php echo $v['title'];?></a>
|
||||
|
<?php } else { ?>
|
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>" class="t"><?php echo $v['title'];?></a>
|
||||
|
<?php } ?>
|
||||
|
<div> |
||||
|
更新:<span class="c_p" onclick="Dq('datetype','edittime');Dq('date',this.innerHTML);"><?php echo timetodate($v['edittime'], 6);?></span><br/>
|
||||
|
添加:<span class="c_p" onclick="Dq('datetype','addtime');Dq('date',this.innerHTML);"><?php echo timetodate($v['addtime'], 6);?></span>
|
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td><?php if($v['vip']) {?><a href="javascript:;" onclick="Dq('minvip','<?php echo $v['vip'];?>',0);Dq('maxvip','<?php echo $v['vip'];?>');"><img src="<?php echo DT_SKIN;?>image/vip_<?php echo $v['vip'];?>.gif" title="<?php echo VIP;?>:<?php echo $v['vip'];?>"/></a><?php } ?></td>
|
||||
|
<td title="编辑:<?php echo $v['editor'];?>"> |
||||
|
<?php if($v['username']) { ?>
|
||||
|
<a href="javascript:;" onclick="_user(this.innerHTML);"><?php echo $v['username'];?></a>
|
||||
|
<?php } else { ?>
|
||||
|
<a href="javascript:;" onclick="_ip(this.innerHTML);" title="游客"><?php echo $v['ip'];?></a>
|
||||
|
<?php } ?>
|
||||
|
</td> |
||||
|
<td><a href="javascript:Dwidget('?moduleid=2&file=message&status=3&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 留言记录');"><?php echo $v['messages'];?></a></td>
|
||||
|
<td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&catid=<?php echo $v['catid'];?>&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 浏览记录');"><?php echo $v['hits'];?></a></td>
|
||||
|
<?php if($order == 9 || $order == 10) { ?><td><a href="javascript:Dwidget('?file=like&action=like&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '点赞记录');"><?php echo $v['likes'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 11 || $order == 12) { ?><td><a href="javascript:Dwidget('?file=like&action=hate&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '反对记录');"><?php echo $v['hates'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=favorite&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 收藏记录');"><?php echo $v['favorites'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 15 || $order == 16) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 打赏记录');"><?php echo $v['awards'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 17 || $order == 18) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 打赏记录');"><?php echo $v['award'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['itemid'];?>&kw=share.php', '[<?php echo $v['alt'];?>] 分享记录');"><?php echo $v['shares'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><td><a href="javascript:Dwidget('?moduleid=3&file=guestbook&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '举报记录');"><?php echo $v['reports'];?></a></td><?php } ?>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=3&file=comment&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 评论列表');"><?php echo $v['comments'];?></a></td>
|
||||
|
<td> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<?php include tpl('notice_chip');?>
|
||||
|
<div class="btns"> |
||||
|
|
||||
|
<?php if($action == 'check') { ?>
|
||||
|
|
||||
|
<input type="submit" value="通过审核" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=check';"/> |
||||
|
<input type="submit" value="拒 绝" class="btn-r" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/> |
||||
|
<input type="submit" value="移动分类" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'expire') { ?>
|
||||
|
|
||||
|
<span class="f_red f_r"> |
||||
|
批量延长过期时间 <input type="text" size="3" name="days" id="days" value="60"/> |
||||
|
天 <input type="submit" value=" 确 定 " class="btn" onclick="if(Dd('days').value==''){alert('请填写天数');return false;}if(confirm('确定要延长'+Dd('days').value+'天吗?')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=expire&refresh=1&extend=1'}else{return false;}"/> |
||||
|
</span> |
||||
|
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'reject') { ?>
|
||||
|
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中供应吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'recycle') { ?>
|
||||
|
|
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中供应吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="还 原" class="btn" onclick="if(confirm('确定要还原选中<?php echo $MOD['name'];?>吗?状态将被设置为已通过')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=restore'}else{return false;}"/> |
||||
|
<input type="submit" value="清 空" class="btn-r" onclick="if(confirm('确定要清空回收站吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=clear';}else{return false;}"/> |
||||
|
|
||||
|
<?php } else { ?>
|
||||
|
|
||||
|
<input type="submit" value="刷新信息" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=refresh';" title="刷新时间为最新"/> |
||||
|
<input type="submit" value=" 更新品牌 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=update';"/> |
||||
|
<?php if($MOD['show_html']) { ?><input type="submit" value=" 生成网页 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=tohtml';"/> <?php } ?>
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="移动分类" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level\';this.form.submit();"');?>
|
||||
|
|
||||
|
<?php } ?>
|
||||
|
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<br/> |
||||
|
<script type="text/javascript"> |
||||
|
$(function(){ |
||||
|
Menuon(<?php echo $menuid;?>);
|
||||
|
$('.thumb').on('error', function(e) { |
||||
|
$(this).attr('src', '<?php echo DT_SKIN;?>image/nopic60.gif'); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,5 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_".$moduleid."`"); |
||||
|
$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_data_".$moduleid."`"); |
||||
|
?>
|
||||
@ -0,0 +1,285 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
class brand { |
||||
|
var $moduleid; |
||||
|
var $itemid; |
||||
|
var $table; |
||||
|
var $table_data; |
||||
|
var $split; |
||||
|
var $fields; |
||||
|
var $errmsg = errmsg; |
||||
|
|
||||
|
function __construct($moduleid) { |
||||
|
global $table, $table_data, $MOD; |
||||
|
$this->moduleid = $moduleid; |
||||
|
$this->table = $table; |
||||
|
$this->table_data = $table_data; |
||||
|
$this->split = $MOD['split']; |
||||
|
$this->fields = array('catid','level','title','style','fee','introduce','areaid','thumb','homepage','status','hits','username','addtime','adddate','editor','edittime','editdate','ip','template', 'linkurl','filepath','note','company','truename','telephone','mobile','address','email','qq','wx','ali','skype'); |
||||
|
} |
||||
|
|
||||
|
function brand($moduleid) { |
||||
|
$this->__construct($moduleid); |
||||
|
} |
||||
|
|
||||
|
function pass($post) { |
||||
|
global $MOD; |
||||
|
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(!is_url($post['thumb'])) return $this->_(lang('message->pass_logo')); |
||||
|
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; |
||||
|
$post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; |
||||
|
$post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; |
||||
|
$post['adddate'] = timetodate($post['addtime'], 3); |
||||
|
$post['editor'] = $_cname ? $_cname : $_username; |
||||
|
$post['edittime'] = DT_TIME; |
||||
|
$post['editdate'] = timetodate($post['edittime'], 3); |
||||
|
$post['fee'] = dround($post['fee']); |
||||
|
$post['homepage'] = fix_link($post['homepage']); |
||||
|
$post['video'] = fix_link($post['video']); |
||||
|
$post['video_width'] = intval($post['video_width']); |
||||
|
$post['video_height'] = intval($post['video_height']); |
||||
|
$post['content'] = stripslashes($post['content']); |
||||
|
$post['content'] = save_local($post['content']); |
||||
|
if($MOD['clear_link']) $post['content'] = clear_link($post['content']); |
||||
|
if($MOD['save_remotepic']) $post['content'] = save_remote($post['content']); |
||||
|
if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); |
||||
|
if($this->itemid) { |
||||
|
$new = $post['content']; |
||||
|
if($post['thumb']) $new .= '<img src="'.$post['thumb'].'"/>'; |
||||
|
$r = $this->get_one(); |
||||
|
$old = $r['content']; |
||||
|
if($r['thumb']) $old .= '<img src="'.$r['thumb'].'"/>'; |
||||
|
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 = 'edittime 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['todate'] = timetodate($r['totime'], 3); |
||||
|
$r['alt'] = $r['title']; |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
$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['company'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')).strip_tags(area_pos($item['areaid'], ',')); |
||||
|
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'"; |
||||
|
$member = $item['username'] ? userinfo($item['username']) : array(); |
||||
|
if($member) $update .= update_user($member, $item); |
||||
|
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']) { |
||||
|
$_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; |
||||
|
html_del($_file); |
||||
|
} |
||||
|
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); |
||||
|
} |
||||
|
$editdate = timetodate(DT_TIME, 3); |
||||
|
DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME.",editdate='$editdate' 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 refresh($itemid) { |
||||
|
$editdate = timetodate(DT_TIME, 3); |
||||
|
$itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; |
||||
|
DB::query("UPDATE {$this->table} SET edittime='".DT_TIME."',editdate='$editdate' WHERE itemid IN ($itemids)"); |
||||
|
} |
||||
|
|
||||
|
function _($e) { |
||||
|
$this->errmsg = $e; |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,92 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if(!$MOD['list_html'] || !$catid) return false; |
||||
|
$CAT or $CAT = get_cat($catid); |
||||
|
if(!$CAT) return false; |
||||
|
unset($CAT['moduleid']); |
||||
|
extract($CAT); |
||||
|
$CP = $MOD['cat_property'] && $CAT['property']; |
||||
|
if($MOD['cat_property'] && $CAT['property']) { |
||||
|
require_once DT_ROOT.'/include/property.func.php'; |
||||
|
$PPT = property_condition($catid); |
||||
|
} |
||||
|
$maincat = get_maincat($child ? $catid : $parentid, $moduleid); |
||||
|
|
||||
|
$condition = 'status=3'; |
||||
|
$condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; |
||||
|
if($page == 1) { |
||||
|
$items = $db->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 = 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']); |
||||
|
$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']); |
||||
|
$r['date'] = timetodate($r[$time], 3); |
||||
|
$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; |
||||
|
?>
|
||||
@ -0,0 +1,268 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
$mod_limit = intval($MOD['limit_'.$_groupid]); |
||||
|
$mod_free_limit = intval($MOD['free_limit_'.$_groupid]); |
||||
|
if($mod_limit < 0) { |
||||
|
if($_userid) dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); |
||||
|
login(); |
||||
|
} |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
include load($module.'.lang'); |
||||
|
include load('my.lang'); |
||||
|
require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php'; |
||||
|
$do = new $module($moduleid); |
||||
|
if(in_array($action, array('add', 'edit'))) { |
||||
|
$FD = cache_read('fields-'.substr($table, strlen($DT_PRE)).'.php'); |
||||
|
if($FD) require DT_ROOT.'/include/fields.func.php'; |
||||
|
isset($post_fields) or $post_fields = array(); |
||||
|
$CP = $MOD['cat_property']; |
||||
|
if($CP) require DT_ROOT.'/include/property.func.php'; |
||||
|
isset($post_ppt) or $post_ppt = array(); |
||||
|
} |
||||
|
$sql = $_userid ? "username='$_username'" : "ip='$DT_IP'"; |
||||
|
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0; |
||||
|
if(in_array($action, array('', 'add'))) { |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND status>1"); |
||||
|
$limit_used = $r['num']; |
||||
|
$limit_free = $mod_limit > $limit_used ? $mod_limit - $limit_used : 0; |
||||
|
} |
||||
|
if(check_group($_groupid, $MOD['group_refresh'])) $MOD['credit_refresh'] = 0; |
||||
|
switch($action) { |
||||
|
case 'add': |
||||
|
if($mod_limit && $limit_used >= $mod_limit) dalert(lang($L['info_limit'], array($mod_limit, $limit_used)), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
if($MG['hour_limit']) { |
||||
|
$today = $DT_TIME - 3600; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); |
||||
|
if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
} |
||||
|
if($MG['day_limit']) { |
||||
|
$today = $DT_TODAY - 86400; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); |
||||
|
if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
} |
||||
|
|
||||
|
if($mod_free_limit >= 0) { |
||||
|
$fee_add = ($MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $mod_free_limit && $_userid) ? dround($MOD['fee_add']) : 0; |
||||
|
} else { |
||||
|
$fee_add = 0; |
||||
|
} |
||||
|
$fee_currency = $MOD['fee_currency']; |
||||
|
$fee_unit = $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; |
||||
|
$need_password = $fee_add && $fee_currency == 'money' && $fee_add > $DT['quick_pay']; |
||||
|
$need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; |
||||
|
$need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; |
||||
|
$could_color = check_group($_groupid, $MOD['group_color']) && $MOD['credit_color'] && $_userid; |
||||
|
|
||||
|
if($submit) { |
||||
|
if($fee_add && $fee_add > ($fee_currency == 'money' ? $_money : $_credit)) dalert($L['balance_lack']); |
||||
|
if($need_password && !is_payword($_username, $password)) dalert($L['error_payword']); |
||||
|
|
||||
|
if(!$_userid) { |
||||
|
if(strlen($post['company']) < 4) dalert($L['type_company']); |
||||
|
if($AREA) { |
||||
|
if(!isset($AREA[$post['areaid']])) dalert($L['type_area']); |
||||
|
} else { |
||||
|
if(!$post['areaid']) dalert($L['type_area']); |
||||
|
} |
||||
|
if(strlen($post['truename']) < 4) dalert($L['type_truename']); |
||||
|
if(strlen($post['mobile']) < 7) dalert($L['type_mobile']); |
||||
|
} |
||||
|
|
||||
|
if($MG['add_limit']) { |
||||
|
$last = $db->get_one("SELECT addtime FROM {$table} WHERE $sql ORDER BY itemid DESC"); |
||||
|
if($last && $DT_TIME - $last['addtime'] < $MG['add_limit']) dalert(lang($L['add_limit'], array($MG['add_limit']))); |
||||
|
} |
||||
|
$msg = captcha($captcha, $need_captcha, true); |
||||
|
if($msg) dalert($msg); |
||||
|
$msg = question($answer, $need_question, true); |
||||
|
if($msg) dalert($msg); |
||||
|
if($do->pass($post)) { |
||||
|
$CAT = get_cat($post['catid']); |
||||
|
if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); |
||||
|
$post['addtime'] = $post['level'] = $post['fee'] = 0; |
||||
|
$post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; |
||||
|
$need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; |
||||
|
$post['status'] = get_status(3, $need_check); |
||||
|
$post['hits'] = 0; |
||||
|
$post['username'] = $_username; |
||||
|
if($FD) fields_check($post_fields); |
||||
|
if($CP) property_check($post_ppt); |
||||
|
if($could_color && $color && $_credit > $MOD['credit_color']) { |
||||
|
$post['style'] = $color; |
||||
|
credit_add($_username, -$MOD['credit_color']); |
||||
|
credit_record($_username, -$MOD['credit_color'], 'system', $L['title_color'], '['.$MOD['name'].']'.$post['title']); |
||||
|
} |
||||
|
$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); |
||||
|
if($fee_add) { |
||||
|
if($fee_currency == 'money') { |
||||
|
money_add($_username, -$fee_add); |
||||
|
money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); |
||||
|
} else { |
||||
|
credit_add($_username, -$fee_add); |
||||
|
credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
$msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add']; |
||||
|
$js = ''; |
||||
|
if(isset($post['sync_sina']) && $post['sync_sina']) $js .= sync_weibo('sina', $moduleid, $do->itemid); |
||||
|
if($_userid) { |
||||
|
set_cookie('dmsg', $msg); |
||||
|
$forward = '?mid='.$mid.'&status='.$post['status']; |
||||
|
$msg = ''; |
||||
|
} else { |
||||
|
$forward = '?mid='.$mid.'&action=add'; |
||||
|
} |
||||
|
$js .= 'window.onload=function(){parent.window.location="'.$forward.'";}'; |
||||
|
dalert($msg, '', $js); |
||||
|
} else { |
||||
|
dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : '')); |
||||
|
} |
||||
|
} else { |
||||
|
if($itemid) { |
||||
|
$MG['copy'] && $_userid or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); |
||||
|
|
||||
|
$do->itemid = $itemid; |
||||
|
$item = $do->get_one(); |
||||
|
if(!$item || $item['username'] != $_username) message(); |
||||
|
extract($item); |
||||
|
$thumb = ''; |
||||
|
$totime = $totime > $DT_TIME ? timetodate($totime, 3) : ''; |
||||
|
} else { |
||||
|
$_catid = $catid; |
||||
|
foreach($do->fields as $v) { |
||||
|
$$v = ''; |
||||
|
} |
||||
|
$content = ''; |
||||
|
$catid = $_catid; |
||||
|
$totime = ''; |
||||
|
if($_userid) { |
||||
|
$user = $db->get_one("SELECT m.truename,m.qq,m.wx,c.areaid,c.mail,c.telephone,c.fax,c.address FROM {$DT_PRE}member m,{$DT_PRE}company c WHERE m.userid=c.userid AND m.userid='$_userid'"); |
||||
|
extract($user); |
||||
|
} |
||||
|
} |
||||
|
$item = array(); |
||||
|
} |
||||
|
break; |
||||
|
case 'edit': |
||||
|
$itemid or message(); |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $do->get_one(); |
||||
|
if(!$item || $item['username'] != $_username) message(); |
||||
|
|
||||
|
if($MG['edit_limit'] < 0) message($L['edit_refuse']); |
||||
|
if($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit']*86400) message(lang($L['edit_limit'], array($MG['edit_limit']))); |
||||
|
|
||||
|
if($submit) { |
||||
|
if($do->pass($post)) { |
||||
|
$CAT = get_cat($post['catid']); |
||||
|
if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); |
||||
|
$post['addtime'] = timetodate($item['addtime']); |
||||
|
$post['level'] = $item['level']; |
||||
|
$post['fee'] = $item['fee']; |
||||
|
$post['style'] = addslashes($item['style']); |
||||
|
$post['template'] = addslashes($item['template']); |
||||
|
$post['filepath'] = addslashes($item['filepath']); |
||||
|
$post['note'] = addslashes($item['note']); |
||||
|
$need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; |
||||
|
$post['status'] = get_status($item['status'], $need_check); |
||||
|
$post['hits'] = $item['hits']; |
||||
|
$post['username'] = $_username; |
||||
|
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); |
||||
|
if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); |
||||
|
set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); |
||||
|
dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); |
||||
|
} else { |
||||
|
dalert($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
extract($item); |
||||
|
$totime = $totime ? timetodate($totime, 3) : ''; |
||||
|
} |
||||
|
break; |
||||
|
case 'delete': |
||||
|
$MG['delete'] or message(); |
||||
|
$itemid or message(); |
||||
|
$itemids = is_array($itemid) ? $itemid : array($itemid); |
||||
|
foreach($itemids as $itemid) { |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $db->get_one("SELECT username FROM {$table} WHERE itemid=$itemid"); |
||||
|
if(!$item || $item['username'] != $_username) message(); |
||||
|
$do->recycle($itemid); |
||||
|
} |
||||
|
dmsg($L['success_delete'], $forward); |
||||
|
break; |
||||
|
case 'refresh': |
||||
|
$MG['refresh_limit'] > -1 or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); |
||||
|
$itemid or message($L['select_info']); |
||||
|
if($MOD['credit_refresh'] && $_credit < $MOD['credit_refresh']) message($L['credit_lack']); |
||||
|
$itemids = $itemid; |
||||
|
$s = $f = 0; |
||||
|
foreach($itemids as $itemid) { |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $db->get_one("SELECT username,edittime FROM {$table} WHERE itemid=$itemid"); |
||||
|
$could_refresh = $item && $item['username'] == $_username; |
||||
|
if($could_refresh && $MG['refresh_limit'] && $DT_TIME - $item['edittime'] < $MG['refresh_limit']) $could_refresh = false; |
||||
|
if($could_refresh && $MOD['credit_refresh'] && ($MOD['credit_refresh'] > $_credit || $_credit < 0)) $could_refresh = false; |
||||
|
if($could_refresh) { |
||||
|
$do->refresh($itemid); |
||||
|
$s++; |
||||
|
if($MOD['credit_refresh']) $_credit = $_credit - $MOD['credit_refresh']; |
||||
|
} else { |
||||
|
$f++; |
||||
|
} |
||||
|
} |
||||
|
if($MOD['credit_refresh'] && $s) { |
||||
|
$credit = $s*$MOD['credit_refresh']; |
||||
|
credit_add($_username, -$credit); |
||||
|
credit_record($_username, -$credit, 'system', lang($L['credit_record_refresh'], array($MOD['name'])), lang($L['refresh_total'], array($s))); |
||||
|
} |
||||
|
$msg = lang($L['refresh_success'], array($s)); |
||||
|
if($f) $msg = $msg.' '.lang($L['refresh_fail'], array($f)); |
||||
|
dmsg($msg, $forward); |
||||
|
break; |
||||
|
default: |
||||
|
$status = isset($status) ? intval($status) : 3; |
||||
|
in_array($status, array(1, 2, 3, 4)) or $status = 3; |
||||
|
$condition = "username='$_username'"; |
||||
|
$condition .= " AND status=$status"; |
||||
|
if($keyword) $condition .= match_kw('keyword', $keyword); |
||||
|
if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; |
||||
|
$timetype = strpos($MOD['order'], 'add') !== false ? 'add' : ''; |
||||
|
$lists = $do->get_list($condition, $MOD['order']); |
||||
|
break; |
||||
|
} |
||||
|
if($_userid) { |
||||
|
$nums = array(); |
||||
|
for($i = 1; $i < 5; $i++) { |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='$_username' AND status=$i"); |
||||
|
$nums[$i] = $r['num']; |
||||
|
} |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); |
||||
|
} else { |
||||
|
$foot = ''; |
||||
|
if($action == 'add' || $action == 'edit') { |
||||
|
//
|
||||
|
} else { |
||||
|
$time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; |
||||
|
foreach($lists as $k=>$v) { |
||||
|
$lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); |
||||
|
$lists[$k]['date'] = timetodate($v[$time], 5); |
||||
|
} |
||||
|
$pages = mobile_pages($items, $page, $pagesize); |
||||
|
$back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'my.php'); |
||||
|
} |
||||
|
} |
||||
|
$head_title = lang($L['module_manage'], array($MOD['name'])); |
||||
|
include template($MOD['template_my'] ? $MOD['template_my'] : 'my_'.$module, 'member'); |
||||
|
?>
|
||||
@ -0,0 +1,63 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if(!$MOD['show_html'] || !$itemid) return false; |
||||
|
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); |
||||
|
if(!$item || $item['status'] < 3) 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']; |
||||
|
if($content) { |
||||
|
if($MOD['keylink']) $content = DC::keylink($content, $moduleid); |
||||
|
if($lazy) $content = DC::lazy($content); |
||||
|
$content = DC::format($content, 1); |
||||
|
} |
||||
|
$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); |
||||
|
$fileurl = $linkurl; |
||||
|
$linkurl = $MOD['linkurl'].$linkurl; |
||||
|
$maincat = get_maincat(0, $moduleid); |
||||
|
$fee = DC::fee($item['fee'], $MOD['fee_view']); |
||||
|
$user_status = 4; |
||||
|
$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')); |
||||
|
$destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid"; |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); |
||||
|
$DT_PC = $GLOBALS['DT_PC'] = 1; |
||||
|
ob_start(); |
||||
|
include template($template, $module); |
||||
|
$data = ob_get_contents(); |
||||
|
ob_clean(); |
||||
|
$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.$fileurl; |
||||
|
if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); |
||||
|
file_put($filename, $data); |
||||
|
if($EXT['mobile_enable']) { |
||||
|
include DT_ROOT.'/include/mobile.htm.php'; |
||||
|
$head_pc = $linkurl; |
||||
|
$could_message = ($user_status == 3 && $username) ? 1 : 0; |
||||
|
$head_title = $head_name = $CAT['catname']; |
||||
|
$js_item = 1; |
||||
|
$foot = ''; |
||||
|
if($_content) { |
||||
|
$content = $_content; |
||||
|
if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); |
||||
|
$content = DC::format($content, 0); |
||||
|
} |
||||
|
ob_start(); |
||||
|
include template($template, $module); |
||||
|
$data = ob_get_contents(); |
||||
|
ob_clean(); |
||||
|
file_put(str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename), $data); |
||||
|
} |
||||
|
return true; |
||||
|
?>
|
||||
@ -0,0 +1,26 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$MCFG['module'] = 'buy'; |
||||
|
$MCFG['name'] = '求购'; |
||||
|
$MCFG['author'] = 'DESTOON'; |
||||
|
$MCFG['homepage'] = 'www.destoon.com'; |
||||
|
$MCFG['copy'] = true; |
||||
|
$MCFG['uninstall'] = true; |
||||
|
$MCFG['moduleid'] = 0; |
||||
|
|
||||
|
$RT = array(); |
||||
|
$RT['file']['index'] = '求购管理'; |
||||
|
$RT['file']['html'] = '更新网页'; |
||||
|
|
||||
|
$RT['action']['index']['add'] = '添加求购'; |
||||
|
$RT['action']['index']['edit'] = '修改求购'; |
||||
|
$RT['action']['index']['delete'] = '删除求购'; |
||||
|
$RT['action']['index']['check'] = '审核求购'; |
||||
|
$RT['action']['index']['expire'] = '过期求购'; |
||||
|
$RT['action']['index']['reject'] = '未通过'; |
||||
|
$RT['action']['index']['recycle'] = '回收站'; |
||||
|
$RT['action']['index']['move'] = '移动求购'; |
||||
|
$RT['action']['index']['level'] = '信息级别'; |
||||
|
|
||||
|
$CT = 1; |
||||
|
?>
|
||||
@ -0,0 +1 @@ |
|||||
|
<meta http-equiv="refresh" content="0;url=../"> |
||||
@ -0,0 +1,10 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$setting = include(DT_ROOT.'/file/setting/module-6.php'); |
||||
|
update_setting($moduleid, $setting); |
||||
|
$sql = file_get(DT_ROOT.'/file/setting/'.$module.'.sql'); |
||||
|
$sql = str_replace('_6', '_'.$moduleid, $sql); |
||||
|
$sql = str_replace('求购', $modulename, $sql); |
||||
|
sql_execute($sql); |
||||
|
include DT_ROOT.'/module/'.$module.'/admin/remkdir.inc.php'; |
||||
|
?>
|
||||
@ -0,0 +1,9 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
file_copy(DT_ROOT.'/api/ajax.php', DT_ROOT.'/'.$dir.'/ajax.php'); |
||||
|
install_file($moduleid, 'index', $dir, 1); |
||||
|
install_file($moduleid, 'list', $dir, 1); |
||||
|
install_file($moduleid, 'show', $dir, 1); |
||||
|
install_file($moduleid, 'search', $dir, 1); |
||||
|
install_file($moduleid, 'price', $dir, 1); |
||||
|
?>
|
||||
@ -0,0 +1,169 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<span data-hide-1200="1"><?php echo $type_select;?> </span>
|
||||
|
<span data-hide-1200="1"><?php echo $level_select;?> </span>
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="text" name="username" value="<?php echo $username;?>" size="10" placeholder="会员名" title="会员名 双击显示会员资料" ondblclick="if(this.value){_user(this.value);}"/> |
||||
|
<input type="text" size="10" name="itemid" value="<?php echo $itemid;?>" placeholder="<?php echo $MOD['name'];?>ID" title="<?php echo $MOD['name'];?>ID"/> |
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>');"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<select name="datetype"> |
||||
|
<option value="edittime" <?php if($datetype == 'edittime') echo 'selected';?>>更新时间</option>
|
||||
|
<option value="addtime" <?php if($datetype == 'addtime') echo 'selected';?>>发布时间</option>
|
||||
|
<option value="totime" <?php if($datetype == 'totime') echo 'selected';?>>到期时间</option>
|
||||
|
</select> |
||||
|
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>
|
||||
|
<?php echo category_select('catid', '所属行业', $catid, $moduleid);?>
|
||||
|
<?php echo ajax_area_select('areaid', '所在地区', $areaid);?>
|
||||
|
<?php echo VIP;?>:<input type="text" size="4" name="minvip" value="<?php echo $minvip;?>"/> ~ <input type="text" size="4" name="maxvip" value="<?php echo $maxvip;?>"/>
|
||||
|
<input type="checkbox" name="thumb" value="1"<?php echo $thumb ? ' checked' : '';?>/>图片
|
||||
|
<input type="checkbox" name="guest" value="1"<?php echo $guest ? ' checked' : '';?>/>游客
|
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th>行业</th> |
||||
|
<th>类型</th> |
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');"><img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="60"><a href="javascript:;" onclick="Dq('thumb',<?php echo $thumb ? 0 : 1;?>);">图片</a></th> |
||||
|
<th>标题</th> |
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 25 ? 26 : 25;?>');"><img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 26 ? 'asc' : ($order == 25 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th>会员</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 29 ? 30 : 29;?>');">报价 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 30 ? 'asc' : ($order == 29 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<?php if($order == 9 || $order == 10) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 9 ? 10 : 9;?>');">点赞 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 10 ? 'asc' : ($order == 9 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 11 || $order == 12) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">反对 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 13 ? 14 : 13;?>');">收藏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 14 ? 'asc' : ($order == 13 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 15 || $order == 16) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 15 ? 16 : 15;?>');">打赏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 16 ? 'asc' : ($order == 15 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 17 || $order == 18) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 17 ? 18 : 17;?>');">赏金 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 18 ? 'asc' : ($order == 17 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 19 ? 20 : 19;?>');">分享 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 20 ? 'asc' : ($order == 19 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 21 ? 22 : 21;?>');">举报 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 22 ? 'asc' : ($order == 21 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 23 ? 24 : 23;?>');">评论 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 24 ? 'asc' : ($order == 23 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="50">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td><a href="<?php echo $v['caturl'];?>" target="_blank"><?php echo $v['catname'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('typeid','<?php echo $v['typeid'];?>');"><?php echo $TYPE[$v['typeid']];?></a></td>
|
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td><a href="javascript:_preview('<?php echo $v['thumb'];?>');"><img src="<?php echo $v['thumb'] ? $v['thumb'] : DT_SKIN.'image/nopic60.gif';?>" width="60" class="thumb"/></a></td> |
||||
|
<td> |
||||
|
<div class="lt"> |
||||
|
<?php if($v['status'] == 3) {?>
|
||||
|
<a href="<?php echo $v['linkurl'];?>" target="_blank" class="t"><?php echo $v['title'];?></a>
|
||||
|
<?php } else { ?>
|
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>" class="t"><?php echo $v['title'];?></a>
|
||||
|
<?php } ?>
|
||||
|
<div> |
||||
|
更新:<span class="c_p" onclick="Dq('datetype','edittime');Dq('date',this.innerHTML);"><?php echo timetodate($v['edittime'], 6);?></span><br/>
|
||||
|
添加:<span class="c_p" onclick="Dq('datetype','addtime');Dq('date',this.innerHTML);"><?php echo timetodate($v['addtime'], 6);?></span>
|
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td><?php if($v['vip']) {?><a href="javascript:;" onclick="Dq('minvip','<?php echo $v['vip'];?>',0);Dq('maxvip','<?php echo $v['vip'];?>');"><img src="<?php echo DT_SKIN;?>image/vip_<?php echo $v['vip'];?>.gif" title="<?php echo VIP;?>:<?php echo $v['vip'];?>"/></a><?php } ?></td>
|
||||
|
<td title="编辑:<?php echo $v['editor'];?>"> |
||||
|
<?php if($v['username']) { ?>
|
||||
|
<a href="javascript:;" onclick="_user(this.innerHTML);"><?php echo $v['username'];?></a>
|
||||
|
<?php } else { ?>
|
||||
|
<a href="javascript:;" onclick="_ip(this.innerHTML);" title="游客"><?php echo $v['ip'];?></a>
|
||||
|
<?php } ?>
|
||||
|
</td> |
||||
|
<td><a href="javascript:Dwidget('?moduleid=2&file=message&status=3&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 报价记录');"><?php echo $v['messages'];?></a></td>
|
||||
|
<td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&catid=<?php echo $v['catid'];?>&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 浏览记录');"><?php echo $v['hits'];?></a></td>
|
||||
|
<?php if($order == 9 || $order == 10) { ?><td><a href="javascript:Dwidget('?file=like&action=like&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '点赞记录');"><?php echo $v['likes'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 11 || $order == 12) { ?><td><a href="javascript:Dwidget('?file=like&action=hate&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '反对记录');"><?php echo $v['hates'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=favorite&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 收藏记录');"><?php echo $v['favorites'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 15 || $order == 16) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 打赏记录');"><?php echo $v['awards'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 17 || $order == 18) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 打赏记录');"><?php echo $v['award'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['itemid'];?>&kw=share.php', '[<?php echo $v['alt'];?>] 分享记录');"><?php echo $v['shares'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><td><a href="javascript:Dwidget('?moduleid=3&file=guestbook&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '举报记录');"><?php echo $v['reports'];?></a></td><?php } ?>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=3&file=comment&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 评论列表');"><?php echo $v['comments'];?></a></td>
|
||||
|
<td> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<?php include tpl('notice_chip');?>
|
||||
|
<div class="btns"> |
||||
|
<?php if($action == 'check') { ?>
|
||||
|
|
||||
|
<input type="submit" value="通过审核" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=check';"/> |
||||
|
<input type="submit" value="拒 绝" class="btn-r" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/> |
||||
|
<input type="submit" value="移动分类" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'expire') { ?>
|
||||
|
|
||||
|
<span class="f_red f_r"> |
||||
|
批量延长过期时间 <input type="text" size="3" name="days" id="days" value="60"/> |
||||
|
天 <input type="submit" value=" 确 定 " class="btn" onclick="if(Dd('days').value==''){alert('请填写天数');return false;}if(confirm('确定要延长'+Dd('days').value+'天吗?')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=expire&refresh=1&extend=1'}else{return false;}"/> |
||||
|
</span> |
||||
|
|
||||
|
<input type="submit" value="刷新过期" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=expire&refresh=1';" name="submit"/> |
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'reject') { ?>
|
||||
|
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'recycle') { ?>
|
||||
|
|
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="还 原" class="btn" onclick="if(confirm('确定要还原选中<?php echo $MOD['name'];?>吗?状态将被设置为已通过')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=restore'}else{return false;}"/> |
||||
|
<input type="submit" value="清 空" class="btn-r" onclick="if(confirm('确定要清空回收站吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=clear';}else{return false;}"/> |
||||
|
|
||||
|
<?php } else { ?>
|
||||
|
<input type="submit" value="刷新信息" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=refresh';" title="刷新时间为最新"/> |
||||
|
<input type="submit" value="更新信息" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=update';"/> |
||||
|
<?php if($MOD['show_html']) { ?><input type="submit" value=" 生成网页 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=tohtml';"/> <?php } ?>
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="移动分类" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level\';this.form.submit();"');?>
|
||||
|
<select name="tid" onchange="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=type';this.form.submit();"> |
||||
|
<option value="">设置类型为</option> |
||||
|
<?php foreach($TYPE as $k=>$v) { ?>
|
||||
|
<option value="<?php echo $k;?>"><?php echo $v;?></option>
|
||||
|
<?php } ?>
|
||||
|
</select> |
||||
|
<?php } ?>
|
||||
|
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<br/> |
||||
|
<script type="text/javascript"> |
||||
|
$(function(){ |
||||
|
Menuon(<?php echo $menuid;?>);
|
||||
|
$('.thumb').on('error', function(e) { |
||||
|
$(this).attr('src', '<?php echo DT_SKIN;?>image/nopic60.gif'); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,320 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
class buy { |
||||
|
var $moduleid; |
||||
|
var $itemid; |
||||
|
var $table; |
||||
|
var $table_data; |
||||
|
var $split; |
||||
|
var $fields; |
||||
|
var $errmsg = errmsg; |
||||
|
|
||||
|
function __construct($moduleid) { |
||||
|
global $table, $table_data, $MOD; |
||||
|
$this->moduleid = $moduleid; |
||||
|
$this->table = $table; |
||||
|
$this->table_data = $table_data; |
||||
|
$this->split = $MOD['split']; |
||||
|
$this->fields = array('catid','areaid','typeid','level','title','style','fee','introduce','n1','n2','n3','v1','v2','v3','amount','price','pack','days','thumb','thumb1','thumb2','thumbs','video','tag','status','hits','username','totime','editor','addtime','adddate','edittime','editdate','ip','template','linkurl','filepath','note','company','truename','telephone','mobile','address','email','qq','wx','ali','skype'); |
||||
|
} |
||||
|
|
||||
|
function buy($moduleid) { |
||||
|
$this->__construct($moduleid); |
||||
|
} |
||||
|
|
||||
|
function pass($post) { |
||||
|
global $MOD; |
||||
|
if(!is_array($post)) return false; |
||||
|
if(!$post['catid']) return $this->_(lang('message->pass_cate')); |
||||
|
if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); |
||||
|
if($post['totime']) { |
||||
|
if(!is_time($post['totime'])) return $this->_(lang('message->pass_date')); |
||||
|
if(datetotime($post['totime']) < DT_TIME) return $this->_(lang('message->pass_todate')); |
||||
|
} |
||||
|
if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
function set($post) { |
||||
|
global $MOD, $TYPE, $_username, $_userid, $_cname; |
||||
|
$thumbs = array(); |
||||
|
foreach($post['thumbs'] as $v) { |
||||
|
if(is_url($v)) $thumbs[] = $v; |
||||
|
} |
||||
|
if($thumbs) { |
||||
|
$post['thumb'] = $thumbs[0]; |
||||
|
array_shift($thumbs); |
||||
|
$post['thumbs'] = implode('|', $thumbs); |
||||
|
} else { |
||||
|
$post['thumb'] = $post['thumbs'] = ''; |
||||
|
} |
||||
|
$post['thumb1'] = $post['thumb2'] = ''; |
||||
|
is_url($post['video']) or $post['video'] = ''; |
||||
|
$post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; |
||||
|
$post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; |
||||
|
$post['adddate'] = timetodate($post['addtime'], 3); |
||||
|
$post['editor'] = $_cname ? $_cname : $_username; |
||||
|
$post['edittime'] = DT_TIME; |
||||
|
$post['editdate'] = timetodate($post['edittime'], 3); |
||||
|
$post['totime'] = is_time($post['totime']) ? datetotime($post['totime']) : 0; |
||||
|
$post['fee'] = dround($post['fee']); |
||||
|
$post['content'] = stripslashes($post['content']); |
||||
|
$post['content'] = save_local($post['content']); |
||||
|
if($MOD['clear_link']) $post['content'] = clear_link($post['content']); |
||||
|
if($MOD['save_remotepic']) $post['content'] = save_remote($post['content']); |
||||
|
if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); |
||||
|
if($this->itemid) { |
||||
|
$new = $post['content']; |
||||
|
$new .= '<img src="'.$post['thumb'].'"/>'; |
||||
|
foreach($thumbs as $v) { |
||||
|
$new .= '<img src="'.$v.'"/>'; |
||||
|
} |
||||
|
$r = $this->get_one(); |
||||
|
$old = $r['content']; |
||||
|
$old .= '<img src="'.$r['thumb'].'"/>'; |
||||
|
foreach(explode('|', $r['thumbs']) as $v) { |
||||
|
$old .= '<img src="'.$v.'"/>'; |
||||
|
} |
||||
|
delete_diff($new, $old); |
||||
|
if($r['video'] != $post['video']) delete_upload($r['video'], match_userid($r['video'])); |
||||
|
} 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 = 'edittime 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['alt'] = $r['title']; |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
$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'].$post['thumbs'].$post['video'], $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'].$post['thumbs'].$post['video'], $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) { |
||||
|
global $TYPE; |
||||
|
$item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); |
||||
|
$update = ''; |
||||
|
$keyword = $item['title'].','.($item['tag'] ? $item['tag'].',' : '').$TYPE[$item['typeid']].','.strip_tags(cat_pos(get_cat($item['catid']), ',')); |
||||
|
if($keyword != $item['keyword']) { |
||||
|
$keyword = str_replace("//", '', addslashes($keyword)); |
||||
|
$update .= ",keyword='$keyword'"; |
||||
|
} |
||||
|
$video = url2video($item['video']); |
||||
|
if($video && $video != $item['video']) $update .= ",video='$video'"; |
||||
|
$item['itemid'] = $itemid; |
||||
|
$linkurl = itemurl($item); |
||||
|
if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; |
||||
|
$member = $item['username'] ? userinfo($item['username']) : array(); |
||||
|
if($member) $update .= update_user($member, $item); |
||||
|
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']) { |
||||
|
$_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; |
||||
|
html_del($_file); |
||||
|
} |
||||
|
if($all) { |
||||
|
$userid = get_user($r['username']); |
||||
|
if($r['video']) delete_upload($r['video'], $userid); |
||||
|
if($r['thumb']) delete_upload($r['thumb'], $userid); |
||||
|
if($r['thumbs']) { |
||||
|
foreach(explode('|', $r['thumbs']) as $v) { |
||||
|
if($v) delete_upload($v, $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); |
||||
|
} |
||||
|
$editdate = timetodate(DT_TIME, 3); |
||||
|
DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME.",editdate='$editdate' 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 expire($condition = '') { |
||||
|
DB::query("UPDATE {$this->table} SET status=4 WHERE status=3 AND totime>0 AND totime<".DT_TIME." $condition"); |
||||
|
} |
||||
|
|
||||
|
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 type($itemid, $typeid) { |
||||
|
$itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; |
||||
|
DB::query("UPDATE {$this->table} SET typeid=$typeid WHERE itemid IN ($itemids)"); |
||||
|
} |
||||
|
|
||||
|
function refresh($itemid) { |
||||
|
$editdate = timetodate(DT_TIME, 3); |
||||
|
$itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; |
||||
|
DB::query("UPDATE {$this->table} SET edittime='".DT_TIME."',editdate='$editdate' WHERE itemid IN ($itemids)"); |
||||
|
} |
||||
|
|
||||
|
function _($e) { |
||||
|
$this->errmsg = $e; |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,3 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
?>
|
||||
@ -0,0 +1 @@ |
|||||
|
<meta http-equiv="refresh" content="0;url=../"> |
||||
@ -0,0 +1,88 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
if($DT_PC) { |
||||
|
if(!$CAT || $CAT['moduleid'] != $moduleid) include load('404.inc'); |
||||
|
if($MOD['list_html']) { |
||||
|
$html_file = listurl($CAT, $page); |
||||
|
if(is_file(DT_ROOT.'/'.$MOD['moduledir'].'/'.$html_file)) d301($MOD['linkurl'].$html_file); |
||||
|
} |
||||
|
if(!check_group($_groupid, $MOD['group_list']) || !check_group($_groupid, $CAT['group_list'])) include load('403.inc'); |
||||
|
$CP = $MOD['cat_property'] && $CAT['property']; |
||||
|
if($MOD['cat_property'] && $CAT['property']) { |
||||
|
require DT_ROOT.'/include/property.func.php'; |
||||
|
$PPT = property_condition($catid); |
||||
|
} |
||||
|
unset($CAT['moduleid']); |
||||
|
extract($CAT); |
||||
|
$maincat = get_maincat($child ? $catid : $parentid, $moduleid); |
||||
|
$condition = 'status=3'; |
||||
|
$condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; |
||||
|
if($cityid) { |
||||
|
$areaid = $cityid; |
||||
|
$ARE = get_area($areaid); |
||||
|
$condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; |
||||
|
$items = $db->count($table, $condition, $CFG['db_expires']); |
||||
|
} else { |
||||
|
if($page == 1) { |
||||
|
$items = $db->count($table, $condition, $CFG['db_expires']); |
||||
|
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']; |
||||
|
$offset = ($page-1)*$pagesize; |
||||
|
$pages = listpages($CAT, $items, $page, $pagesize); |
||||
|
$tags = array(); |
||||
|
if($items) { |
||||
|
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}", ($CFG['db_expires'] && $page == 1) ? 'CACHE' : '', $CFG['db_expires']); |
||||
|
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']); |
||||
|
$r['linkurl'] = $MOD['linkurl'].$r['linkurl']; |
||||
|
$tags[] = $r; |
||||
|
} |
||||
|
$db->free_result($result); |
||||
|
} |
||||
|
$showpage = 1; |
||||
|
$datetype = 5; |
||||
|
if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].listurl($CAT, $page > 1 ? $page : 0); |
||||
|
} else { |
||||
|
if(!$CAT || $CAT['moduleid'] != $moduleid) message($L['msg_not_cate']); |
||||
|
if(!check_group($_groupid, $MOD['group_list']) || !check_group($_groupid, $CAT['group_list'])) message($L['msg_no_right']); |
||||
|
$condition = "status=3"; |
||||
|
$condition .= $CAT['child'] ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; |
||||
|
if($cityid) { |
||||
|
$areaid = $cityid; |
||||
|
$ARE = get_area($areaid); |
||||
|
$condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; |
||||
|
} |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); |
||||
|
$items = $r['num']; |
||||
|
$pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].listurl($CAT, '{destoon_page}')); |
||||
|
$tags = array(); |
||||
|
if($items) { |
||||
|
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}", ($CFG['db_expires'] && $page == 1) ? 'CACHE' : '', $CFG['db_expires']); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
$r['linkurl'] = $MOD['mobile'].$r['linkurl']; |
||||
|
$tags[] = $r; |
||||
|
} |
||||
|
$db->free_result($result); |
||||
|
$js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid; |
||||
|
} |
||||
|
if($CAT['parentid']) $PCAT = get_cat($CAT['parentid']); |
||||
|
$head_title = $head_name = $CAT['catname']; |
||||
|
} |
||||
|
$seo_file = 'list'; |
||||
|
include DT_ROOT.'/include/seo.inc.php'; |
||||
|
$template = $CAT['template'] ? $CAT['template'] : ($MOD['template_list'] ? $MOD['template_list'] : 'list'); |
||||
|
include template($template, $module); |
||||
|
?>
|
||||
@ -0,0 +1,267 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
$mod_limit = intval($MOD['limit_'.$_groupid]); |
||||
|
$mod_free_limit = intval($MOD['free_limit_'.$_groupid]); |
||||
|
if($mod_limit < 0) { |
||||
|
if($_userid) dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); |
||||
|
login(); |
||||
|
} |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
include load($module.'.lang'); |
||||
|
include load('my.lang'); |
||||
|
require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php'; |
||||
|
$do = new $module($moduleid); |
||||
|
if(in_array($action, array('add', 'edit'))) { |
||||
|
$FD = cache_read('fields-'.substr($table, strlen($DT_PRE)).'.php'); |
||||
|
if($FD) require DT_ROOT.'/include/fields.func.php'; |
||||
|
isset($post_fields) or $post_fields = array(); |
||||
|
$CP = $MOD['cat_property']; |
||||
|
if($CP) require DT_ROOT.'/include/property.func.php'; |
||||
|
isset($post_ppt) or $post_ppt = array(); |
||||
|
} |
||||
|
$sql = $_userid ? "username='$_username'" : "ip='$DT_IP'"; |
||||
|
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0; |
||||
|
if(in_array($action, array('', 'add'))) { |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND status>1"); |
||||
|
$limit_used = $r['num']; |
||||
|
$limit_free = $mod_limit > $limit_used ? $mod_limit - $limit_used : 0; |
||||
|
} |
||||
|
if(check_group($_groupid, $MOD['group_refresh'])) $MOD['credit_refresh'] = 0; |
||||
|
switch($action) { |
||||
|
case 'add': |
||||
|
if($mod_limit && $limit_used >= $mod_limit) dalert(lang($L['info_limit'], array($mod_limit, $limit_used)), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
if($MG['hour_limit']) { |
||||
|
$today = $DT_TIME - 3600; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); |
||||
|
if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
} |
||||
|
if($MG['day_limit']) { |
||||
|
$today = $DT_TODAY - 86400; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); |
||||
|
if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
} |
||||
|
|
||||
|
if($mod_free_limit >= 0) { |
||||
|
$fee_add = ($MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $mod_free_limit && $_userid) ? dround($MOD['fee_add']) : 0; |
||||
|
} else { |
||||
|
$fee_add = 0; |
||||
|
} |
||||
|
$fee_currency = $MOD['fee_currency']; |
||||
|
$fee_unit = $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; |
||||
|
$need_password = $fee_add && $fee_currency == 'money' && $fee_add > $DT['quick_pay']; |
||||
|
$need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; |
||||
|
$need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; |
||||
|
$could_color = check_group($_groupid, $MOD['group_color']) && $MOD['credit_color'] && $_userid; |
||||
|
|
||||
|
if($submit) { |
||||
|
if($fee_add && $fee_add > ($fee_currency == 'money' ? $_money : $_credit)) dalert($L['balance_lack']); |
||||
|
if($need_password && !is_payword($_username, $password)) dalert($L['error_payword']); |
||||
|
|
||||
|
if(!$_userid) { |
||||
|
if(strlen($post['company']) < 4) dalert($L['type_company']); |
||||
|
if($AREA) { |
||||
|
if(!isset($AREA[$post['areaid']])) dalert($L['type_area']); |
||||
|
} else { |
||||
|
if(!$post['areaid']) dalert($L['type_area']); |
||||
|
} |
||||
|
if(strlen($post['truename']) < 4) dalert($L['type_truename']); |
||||
|
if(strlen($post['mobile']) < 7) dalert($L['type_mobile']); |
||||
|
} |
||||
|
|
||||
|
if($MG['add_limit']) { |
||||
|
$last = $db->get_one("SELECT addtime FROM {$table} WHERE $sql ORDER BY itemid DESC"); |
||||
|
if($last && $DT_TIME - $last['addtime'] < $MG['add_limit']) dalert(lang($L['add_limit'], array($MG['add_limit']))); |
||||
|
} |
||||
|
$msg = captcha($captcha, $need_captcha, true); |
||||
|
if($msg) dalert($msg); |
||||
|
$msg = question($answer, $need_question, true); |
||||
|
if($msg) dalert($msg); |
||||
|
|
||||
|
if($do->pass($post)) { |
||||
|
$CAT = get_cat($post['catid']); |
||||
|
if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); |
||||
|
$post['addtime'] = $post['level'] = $post['fee'] = 0; |
||||
|
$post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; |
||||
|
$need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; |
||||
|
$post['status'] = get_status(3, $need_check); |
||||
|
$post['hits'] = 0; |
||||
|
$post['username'] = $_username; |
||||
|
if($FD) fields_check($post_fields); |
||||
|
if($CP) property_check($post_ppt); |
||||
|
if($could_color && $color && $_credit > $MOD['credit_color']) { |
||||
|
$post['style'] = $color; |
||||
|
credit_add($_username, -$MOD['credit_color']); |
||||
|
credit_record($_username, -$MOD['credit_color'], 'system', $L['title_color'], '['.$MOD['name'].']'.$post['title']); |
||||
|
} |
||||
|
$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); |
||||
|
if($fee_add) { |
||||
|
if($fee_currency == 'money') { |
||||
|
money_add($_username, -$fee_add); |
||||
|
money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); |
||||
|
} else { |
||||
|
credit_add($_username, -$fee_add); |
||||
|
credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
$msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add']; |
||||
|
$js = ''; |
||||
|
if(isset($post['sync_sina']) && $post['sync_sina']) $js .= sync_weibo('sina', $moduleid, $do->itemid); |
||||
|
if($_userid) { |
||||
|
set_cookie('dmsg', $msg); |
||||
|
$forward = '?mid='.$mid.'&status='.$post['status']; |
||||
|
$msg = ''; |
||||
|
} else { |
||||
|
$forward = '?mid='.$mid.'&action=add'; |
||||
|
} |
||||
|
$js .= 'window.onload=function(){parent.window.location="'.$forward.'";}'; |
||||
|
dalert($msg, '', $js); |
||||
|
} else { |
||||
|
dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : '')); |
||||
|
} |
||||
|
} else { |
||||
|
if($itemid) { |
||||
|
$MG['copy'] && $_userid or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $do->get_one(); |
||||
|
if(!$item || $item['username'] != $_username) message(); |
||||
|
extract($item); |
||||
|
$totime = $totime > $DT_TIME ? timetodate($totime, 6) : ''; |
||||
|
} else { |
||||
|
$_catid = $catid; |
||||
|
foreach($do->fields as $v) { |
||||
|
$$v = ''; |
||||
|
} |
||||
|
$content = ''; |
||||
|
$catid = $_catid; |
||||
|
$totime = ''; |
||||
|
$typeid = 0; |
||||
|
} |
||||
|
$item = $thumbs = array(); |
||||
|
} |
||||
|
break; |
||||
|
case 'edit': |
||||
|
$itemid or message(); |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $do->get_one(); |
||||
|
if(!$item || $item['username'] != $_username) message(); |
||||
|
|
||||
|
if($MG['edit_limit'] < 0) message($L['edit_refuse']); |
||||
|
if($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit']*86400) message(lang($L['edit_limit'], array($MG['edit_limit']))); |
||||
|
|
||||
|
if($submit) { |
||||
|
if($do->pass($post)) { |
||||
|
$CAT = get_cat($post['catid']); |
||||
|
if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); |
||||
|
$post['addtime'] = timetodate($item['addtime']); |
||||
|
$post['level'] = $item['level']; |
||||
|
$post['fee'] = $item['fee']; |
||||
|
$post['style'] = addslashes($item['style']); |
||||
|
$post['template'] = addslashes($item['template']); |
||||
|
$post['filepath'] = addslashes($item['filepath']); |
||||
|
$post['note'] = addslashes($item['note']); |
||||
|
$need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; |
||||
|
$post['status'] = get_status($item['status'], $need_check); |
||||
|
$post['hits'] = $item['hits']; |
||||
|
$post['username'] = $_username; |
||||
|
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); |
||||
|
if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); |
||||
|
set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); |
||||
|
dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); |
||||
|
} else { |
||||
|
dalert($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
extract($item); |
||||
|
$thumbs = get_thumbs($item); |
||||
|
$totime = $totime ? timetodate($totime, 6) : ''; |
||||
|
} |
||||
|
break; |
||||
|
case 'delete': |
||||
|
$MG['delete'] or message(); |
||||
|
$itemid or message(); |
||||
|
$itemids = is_array($itemid) ? $itemid : array($itemid); |
||||
|
foreach($itemids as $itemid) { |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $db->get_one("SELECT username FROM {$table} WHERE itemid=$itemid"); |
||||
|
if(!$item || $item['username'] != $_username) message(); |
||||
|
$do->recycle($itemid); |
||||
|
} |
||||
|
dmsg($L['success_delete'], $forward); |
||||
|
break; |
||||
|
case 'refresh': |
||||
|
$MG['refresh_limit'] > -1 or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); |
||||
|
$itemid or message($L['select_info']); |
||||
|
if($MOD['credit_refresh'] && $_credit < $MOD['credit_refresh']) message($L['credit_lack']); |
||||
|
$itemids = $itemid; |
||||
|
$s = $f = 0; |
||||
|
foreach($itemids as $itemid) { |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $db->get_one("SELECT username,edittime FROM {$table} WHERE itemid=$itemid"); |
||||
|
$could_refresh = $item && $item['username'] == $_username; |
||||
|
if($could_refresh && $MG['refresh_limit'] && $DT_TIME - $item['edittime'] < $MG['refresh_limit']) $could_refresh = false; |
||||
|
if($could_refresh && $MOD['credit_refresh'] && ($MOD['credit_refresh'] > $_credit || $_credit < 0)) $could_refresh = false; |
||||
|
if($could_refresh) { |
||||
|
$do->refresh($itemid); |
||||
|
$s++; |
||||
|
if($MOD['credit_refresh']) $_credit = $_credit - $MOD['credit_refresh']; |
||||
|
} else { |
||||
|
$f++; |
||||
|
} |
||||
|
} |
||||
|
if($MOD['credit_refresh'] && $s) { |
||||
|
$credit = $s*$MOD['credit_refresh']; |
||||
|
credit_add($_username, -$credit); |
||||
|
credit_record($_username, -$credit, 'system', lang($L['credit_record_refresh'], array($MOD['name'])), lang($L['refresh_total'], array($s))); |
||||
|
} |
||||
|
$msg = lang($L['refresh_success'], array($s)); |
||||
|
if($f) $msg = $msg.' '.lang($L['refresh_fail'], array($f)); |
||||
|
dmsg($msg, $forward); |
||||
|
break; |
||||
|
default: |
||||
|
$status = isset($status) ? intval($status) : 3; |
||||
|
in_array($status, array(1, 2, 3, 4)) or $status = 3; |
||||
|
$condition = "username='$_username'"; |
||||
|
$condition .= " AND status=$status"; |
||||
|
$typeid = isset($typeid) ? ($typeid === '' ? -1 : intval($typeid)) : -1; |
||||
|
if($keyword) $condition .= match_kw('keyword', $keyword); |
||||
|
if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; |
||||
|
if($typeid >=0 ) $condition .= " AND typeid=$typeid"; |
||||
|
$timetype = strpos($MOD['order'], 'add') !== false ? 'add' : ''; |
||||
|
$lists = $do->get_list($condition, $MOD['order']); |
||||
|
break; |
||||
|
} |
||||
|
if($_userid) { |
||||
|
$nums = array(); |
||||
|
for($i = 1; $i < 5; $i++) { |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='$_username' AND status=$i"); |
||||
|
$nums[$i] = $r['num']; |
||||
|
} |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); |
||||
|
} else { |
||||
|
$foot = ''; |
||||
|
if($action == 'add' || $action == 'edit') { |
||||
|
//
|
||||
|
} else { |
||||
|
$time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; |
||||
|
foreach($lists as $k=>$v) { |
||||
|
$lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); |
||||
|
$lists[$k]['date'] = timetodate($v[$time], 5); |
||||
|
} |
||||
|
$pages = mobile_pages($items, $page, $pagesize); |
||||
|
$back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'my.php'); |
||||
|
} |
||||
|
} |
||||
|
$head_title = lang($L['module_manage'], array($MOD['name'])); |
||||
|
include template($MOD['template_my'] ? $MOD['template_my'] : 'my_'.$module, 'member'); |
||||
|
?>
|
||||
@ -0,0 +1,98 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; |
||||
|
if($DT_PC) { |
||||
|
$itemid or dheader($MOD['linkurl']); |
||||
|
if(!check_group($_groupid, $MOD['group_show'])) include load('403.inc'); |
||||
|
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); |
||||
|
if($item['groupid'] == 2) include load('404.inc'); |
||||
|
if($item && $item['status'] > 2) { |
||||
|
if($MOD['show_html'] && is_file(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl'])) d301($MOD['linkurl'].$item['linkurl']); |
||||
|
require DT_ROOT.'/include/content.class.php'; |
||||
|
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']; |
||||
|
if($content) { |
||||
|
if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); |
||||
|
if($lazy) $content = DC::lazy($content); |
||||
|
$content = DC::format($content, $DT_PC); |
||||
|
} |
||||
|
$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, 5); |
||||
|
$editdate = timetodate($edittime, 5); |
||||
|
$todate = $totime ? timetodate($totime, 3) : 0; |
||||
|
$expired = $totime && $totime < $DT_TIME ? true : false; |
||||
|
$linkurl = $MOD['linkurl'].$linkurl; |
||||
|
$albums = get_albums($item); |
||||
|
$pics = count($albums); |
||||
|
$pics_width = $pics*70; |
||||
|
$update = ''; |
||||
|
$fee = DC::fee($item['fee'], $MOD['fee_view']); |
||||
|
if(check_group($_groupid, $MOD['group_contact'])) { |
||||
|
if($fee) { |
||||
|
$user_status = 4; |
||||
|
$destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid"; |
||||
|
} else { |
||||
|
$user_status = 3; |
||||
|
$member = $item['username'] ? userinfo($item['username']) : array(); |
||||
|
if($item['totime'] && $item['totime'] < $DT_TIME && $item['status'] == 3) $update .= ",status=4"; |
||||
|
if($member) { |
||||
|
$update_user = update_user($member, $item); |
||||
|
if($update_user) $db->query("UPDATE LOW_PRIORITY {$table} SET ".substr($update_user, 1)." WHERE username='$username'", 'UNBUFFERED'); |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
$user_status = $_userid ? 1 : 0; |
||||
|
if($_username && $item['username'] == $_username) { |
||||
|
$member = userinfo($item['username']); |
||||
|
$user_status = 3; |
||||
|
} |
||||
|
} |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); |
||||
|
} else { |
||||
|
$itemid or dheader($MOD['mobile']); |
||||
|
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); |
||||
|
($item && $item['status'] > 2) or message($L['msg_not_exist']); |
||||
|
if($item['groupid'] == 2) message($L['msg_not_exist']); |
||||
|
require DT_ROOT.'/include/content.class.php'; |
||||
|
extract($item); |
||||
|
$CAT = get_cat($catid); |
||||
|
if(!check_group($_groupid, $MOD['group_show']) || !check_group($_groupid, $CAT['group_show'])) message($L['msg_no_right']); |
||||
|
$member = array(); |
||||
|
$fee = DC::fee($item['fee'], $MOD['fee_view']); |
||||
|
include DT_ROOT.'/mobile/api/contact.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']; |
||||
|
if($content) { |
||||
|
if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); |
||||
|
if($share_icon) $share_icon = DC::icon($thumb, $content); |
||||
|
$content = DC::format($content, 0); |
||||
|
} |
||||
|
$albums = get_albums($item); |
||||
|
$editdate = timetodate($edittime, 5); |
||||
|
$expired = $totime && $totime < $DT_TIME ? true : false; |
||||
|
$could_price = ($user_status == 3 && $username && $username != $_username && !$expired) ? 1 : 0; |
||||
|
$update = ''; |
||||
|
$head_title = $head_name = $CAT['catname']; |
||||
|
$js_item = $js_album = 1; |
||||
|
$foot = ''; |
||||
|
} |
||||
|
if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php'; |
||||
|
$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')); |
||||
|
include template($template, $module); |
||||
|
?>
|
||||
@ -0,0 +1,53 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$MCFG = array(); |
||||
|
$MCFG['module'] = 'club'; |
||||
|
$MCFG['name'] = '商圈'; |
||||
|
$MCFG['author'] = 'DESTOON'; |
||||
|
$MCFG['homepage'] = 'www.destoon.com'; |
||||
|
$MCFG['copy'] = true; |
||||
|
$MCFG['uninstall'] = true; |
||||
|
$MCFG['moduleid'] = 0; |
||||
|
|
||||
|
$RT = array(); |
||||
|
$RT['file']['index'] = '帖子管理'; |
||||
|
$RT['file']['reply'] = '回复管理'; |
||||
|
$RT['file']['group'] = '商圈管理'; |
||||
|
$RT['file']['fans'] = '粉丝管理'; |
||||
|
$RT['file']['manage'] = '管理记录'; |
||||
|
$RT['file']['html'] = '更新网页'; |
||||
|
|
||||
|
$RT['action']['index']['add'] = '发表帖子'; |
||||
|
$RT['action']['index']['edit'] = '修改帖子'; |
||||
|
$RT['action']['index']['delete'] = '删除帖子'; |
||||
|
$RT['action']['index']['check'] = '审核帖子'; |
||||
|
$RT['action']['index']['reject'] = '未通过'; |
||||
|
$RT['action']['index']['recycle'] = '回收站'; |
||||
|
$RT['action']['index']['move'] = '移动帖子'; |
||||
|
$RT['action']['index']['level'] = '加入精华'; |
||||
|
$RT['action']['index']['ontop'] = '置顶帖子'; |
||||
|
$RT['action']['index']['style'] = '高亮帖子'; |
||||
|
|
||||
|
$RT['action']['reply']['edit'] = '修改回复'; |
||||
|
$RT['action']['reply']['delete'] = '删除回复'; |
||||
|
$RT['action']['reply']['check'] = '审核回复'; |
||||
|
$RT['action']['reply']['reject'] = '未通过'; |
||||
|
$RT['action']['reply']['recycle'] = '回收站'; |
||||
|
$RT['action']['reply']['cancel'] = '取消审核'; |
||||
|
|
||||
|
$RT['action']['group']['add'] = '添加商圈'; |
||||
|
$RT['action']['group']['edit'] = '修改商圈'; |
||||
|
$RT['action']['group']['delete'] = '删除商圈'; |
||||
|
$RT['action']['group']['check'] = '审核商圈'; |
||||
|
$RT['action']['group']['reject'] = '未通过'; |
||||
|
$RT['action']['group']['recycle'] = '回收站'; |
||||
|
$RT['action']['group']['level'] = '商圈级别'; |
||||
|
|
||||
|
$RT['action']['fans']['delete'] = '删除粉丝'; |
||||
|
$RT['action']['fans']['check'] = '审核粉丝'; |
||||
|
$RT['action']['fans']['reject'] = '未通过'; |
||||
|
$RT['action']['fans']['recycle'] = '回收站'; |
||||
|
$RT['action']['fans']['cancel'] = '取消审核'; |
||||
|
|
||||
|
$CT = true; |
||||
|
?>
|
||||
@ -0,0 +1,150 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$menus = array ( |
||||
|
array('添加商圈', '?moduleid='.$moduleid.'&file='.$file.'&action=add'), |
||||
|
array('商圈列表', '?moduleid='.$moduleid.'&file='.$file), |
||||
|
array('待审核', '?moduleid='.$moduleid.'&file='.$file.'&action=check'), |
||||
|
array('未通过', '?moduleid='.$moduleid.'&file='.$file.'&action=reject'), |
||||
|
array('回收站', '?moduleid='.$moduleid.'&file='.$file.'&action=recycle'), |
||||
|
); |
||||
|
$MOD['level'] = ''; |
||||
|
if(in_array($action, array('', 'check', 'reject', 'recycle'))) { |
||||
|
$level = isset($level) ? intval($level) : 0; |
||||
|
$sfields = array('按条件', '商圈名称', '商圈介绍', '创建理由', '创始人', '版主', '编辑', '静态目录'); |
||||
|
$dfields = array('title', 'title', 'content', 'reason', 'username', 'manager', 'editor', 'filepath'); |
||||
|
$sorder = array('结果排序方式', '创建时间降序', '创建时间升序', '修改时间降序', '修改时间升序', '发帖时间降序', '发帖时间升序', '回复时间降序', '回复时间升序', '群聊时间降序', '群聊时间升序', '帖子数量降序', '帖子数量升序', '回复数量降序', '回复数量升序', '粉丝数量降序', '粉丝数量升序', '群聊状态降序', '群聊状态升序', '推荐级别降序', '推荐级别升序', '圈子ID降序', '圈子ID升序'); |
||||
|
$dorder = array('addtime DESC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', 'posttime DESC', 'posttime ASC', 'replytime DESC', 'replytime ASC', 'chattime DESC', 'chattime ASC', 'post DESC', 'post ASC', 'reply DESC', 'reply ASC', 'fans DESC', 'fans ASC', 'chat DESC', 'chat ASC', 'level DESC', 'level ASC', 'itemid DESC', 'itemid ASC'); |
||||
|
|
||||
|
isset($fields) && isset($dfields[$fields]) or $fields = 0; |
||||
|
isset($order) && isset($dorder[$order]) or $order = 0; |
||||
|
$chat = isset($chat) ? intval($chat) : -1; |
||||
|
|
||||
|
$fields_select = dselect($sfields, 'fields', '', $fields); |
||||
|
$order_select = dselect($sorder, 'order', '', $order); |
||||
|
$level_select = level_select('level', '级别', $level, 'all'); |
||||
|
|
||||
|
$condition = ''; |
||||
|
if($_childs) $condition .= " AND catid IN (".$_childs.")";//CATE
|
||||
|
if($_areaids) $condition .= " AND areaid IN (".$_areaids.")";//CITY
|
||||
|
if($keyword) $condition .= match_kw($dfields[$fields], $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($level) $condition .= $level > 9 ? " AND level>0" : " AND level=$level"; |
||||
|
if($chat > -1) $condition .= " AND chat=$chat"; |
||||
|
} |
||||
|
require DT_ROOT.'/module/'.$module.'/group.class.php'; |
||||
|
$do = new group(); |
||||
|
switch($action) { |
||||
|
case 'add': |
||||
|
if($submit) { |
||||
|
if($do->pass($post)) { |
||||
|
$do->add($post); |
||||
|
dmsg('添加成功', '?moduleid='.$moduleid.'&file='.$file); |
||||
|
} else { |
||||
|
msg($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
foreach($do->fields as $v) { |
||||
|
isset($$v) or $$v = ''; |
||||
|
} |
||||
|
$status = 3; |
||||
|
$content = ''; |
||||
|
$addtime = timetodate($DT_TIME); |
||||
|
$menuid = 0; |
||||
|
include tpl('group_edit', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'edit': |
||||
|
$itemid or msg(); |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $do->get_one(); |
||||
|
if($submit) { |
||||
|
if($MOD['list_html']) { |
||||
|
if(preg_match("/^[0-9a-z_\-\/]+$/i", $post['filepath'])) { |
||||
|
$t = $db->get_one("SELECT itemid FROM {$table_group} WHERE filepath='$post[filepath]' AND itemid<>$itemid"); |
||||
|
if($t) msg('静态目录有重复'); |
||||
|
} else { |
||||
|
msg('静态目录规则错误'); |
||||
|
} |
||||
|
} |
||||
|
if($do->pass($post)) { |
||||
|
$do->edit($post); |
||||
|
if($post['catid'] != $item['catid']) $db->query("UPDATE {$table} SET catid=$post[catid] WHERE gid=$itemid"); |
||||
|
dmsg('修改成功', $forward); |
||||
|
} else { |
||||
|
msg($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
extract($item); |
||||
|
$addtime = timetodate($addtime); |
||||
|
$menuid = 1; |
||||
|
include tpl('group_edit', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'update': |
||||
|
is_array($itemid) or msg('请选择商圈'); |
||||
|
foreach($itemid as $v) { |
||||
|
$do->update($v); |
||||
|
} |
||||
|
dmsg('更新成功', $forward); |
||||
|
break; |
||||
|
case 'tohtml': |
||||
|
is_array($itemid) or msg('请选择商圈'); |
||||
|
$html_itemids = $itemid; |
||||
|
foreach($html_itemids as $itemid) { |
||||
|
tohtml('group', $module); |
||||
|
} |
||||
|
dmsg('生成成功', $forward); |
||||
|
break; |
||||
|
case 'delete': |
||||
|
$itemid or msg('请选择商圈'); |
||||
|
isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid); |
||||
|
dmsg('删除成功', $forward); |
||||
|
break; |
||||
|
case 'restore': |
||||
|
$itemid or msg('请选择商圈'); |
||||
|
$do->restore($itemid); |
||||
|
dmsg('还原成功', $forward); |
||||
|
break; |
||||
|
case 'clear': |
||||
|
$do->clear(); |
||||
|
dmsg('清空成功', $forward); |
||||
|
break; |
||||
|
case 'level': |
||||
|
$itemid or msg('请选择商圈'); |
||||
|
$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('group', $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('group', $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('group', $module); |
||||
|
} |
||||
|
break; |
||||
|
default: |
||||
|
$lists = $do->get_list('status=3'.$condition, $dorder[$order]); |
||||
|
$menuid = 1; |
||||
|
include tpl('group', $module); |
||||
|
break; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,184 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$menus = array ( |
||||
|
array('更新数据', '?moduleid='.$moduleid.'&file='.$file), |
||||
|
array('模块首页', $MOD['linkurl'], ' target="_blank"'), |
||||
|
); |
||||
|
$all = (isset($all) && $all) ? 1 : 0; |
||||
|
$one = (isset($one) && $one) ? 1 : 0; |
||||
|
$this_forward = '?moduleid='.$moduleid.'&file='.$file; |
||||
|
switch($action) { |
||||
|
case 'all': |
||||
|
msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=show&update=1&all=1&one='.$one); |
||||
|
break; |
||||
|
case 'index': |
||||
|
tohtml('index', $module); |
||||
|
$all ? msg($MOD['name'].'首页生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=list&all=1&one='.$one) : dmsg($MOD['name'].'首页生成成功', $this_forward); |
||||
|
break; |
||||
|
case 'list': |
||||
|
if(!$MOD['list_html']) { |
||||
|
$all ? msg($MOD['name'].'列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=group&all='.$all.'&one='.$one) : msg($MOD['name'].'列表生成成功', $this_forward); |
||||
|
} |
||||
|
if(isset($catids)) { |
||||
|
$CAT = $db->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('['.$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('['.$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('列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=group&all='.$all.'&one='.$one) : msg('列表生成成功', $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 'group': |
||||
|
if(!$MOD['list_html']) { |
||||
|
$all ? msg('商圈生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg('商圈生成成功', $this_forward); |
||||
|
} |
||||
|
if(isset($catids)) { |
||||
|
$GRP = $db->get_one("SELECT * FROM {$table_group} WHERE status=3 AND itemid>$catids ORDER BY itemid"); |
||||
|
if($GRP) { |
||||
|
$bitemid = $itemid = $GRP['itemid']; |
||||
|
$total = max(ceil($GRP['post']/$MOD['pagesize']), 1); |
||||
|
$num = 50; |
||||
|
$bfid = $fid; |
||||
|
isset($fpage) or $fpage = 1; |
||||
|
if($fpage <= $total) { |
||||
|
$fid = $fpage; |
||||
|
tohtml('group', $module); |
||||
|
$fid = $bfid; |
||||
|
msg('商圈 ['.$GRP['title'].'] 第'.$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('商圈 ['.$GRP['title'].'] 生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$itemid.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one); |
||||
|
} else { |
||||
|
$all ? msg('商圈生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg('商圈生成成功', $this_forward); |
||||
|
} |
||||
|
} else { |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_group} WHERE status=3"); |
||||
|
$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('帖子生成成功', $this_forward) : dmsg('帖子生成成功', $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 {$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 {$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 itemid>=$fid {$sql} ORDER BY itemid LIMIT 0,$num"); |
||||
|
if($db->affected_rows($result)) { |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$itemid = $r['itemid']; |
||||
|
if($update) { |
||||
|
$do->update($itemid); |
||||
|
} else { |
||||
|
$bfid= $fid; |
||||
|
$fid = 0; |
||||
|
tohtml('show', $module); |
||||
|
$fid = $bfid; |
||||
|
} |
||||
|
} |
||||
|
$itemid += 1; |
||||
|
} else { |
||||
|
$itemid = $fid + $num; |
||||
|
} |
||||
|
} else { |
||||
|
if($update) { |
||||
|
$all ? msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=groups&all=1&one='.$one) : dmsg('更新成功', $this_forward); |
||||
|
} else { |
||||
|
if($one) dheader( '?file=html&action=back&mid='.$moduleid); |
||||
|
$all ? msg('帖子生成成功', $this_forward) : dmsg('帖子生成成功', $this_forward); |
||||
|
} |
||||
|
} |
||||
|
msg('ID从'.$fid.'至'.($itemid-1).'帖子'.($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 'groups': |
||||
|
if(!isset($fid)) { |
||||
|
$r = $db->get_one("SELECT min(itemid) AS fid FROM {$table_group} WHERE status>2"); |
||||
|
$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_group} WHERE status>2"); |
||||
|
$tid = $r['tid'] ? $r['tid'] : 0; |
||||
|
} |
||||
|
require DT_ROOT.'/module/'.$module.'/group.class.php'; |
||||
|
$do = new group(); |
||||
|
isset($num) or $num = 100; |
||||
|
if($fid <= $tid) { |
||||
|
$result = $db->query("SELECT itemid FROM {$table_group} WHERE status=3 AND itemid>=$fid ORDER BY itemid LIMIT 0,$num"); |
||||
|
if($db->affected_rows($result)) { |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$itemid = $r['itemid']; |
||||
|
$do->update($itemid); |
||||
|
} |
||||
|
$itemid += 1; |
||||
|
} else { |
||||
|
$itemid = $fid + $num; |
||||
|
} |
||||
|
} else { |
||||
|
$all ? msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=index&all=1&one='.$one) : dmsg('更新成功', $this_forward); |
||||
|
} |
||||
|
msg('ID从'.$fid.'至'.($itemid-1).'商圈更新成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$itemid&tid=$tid&num=$num&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; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,13 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$menu = array( |
||||
|
array("商圈管理", "?moduleid=$moduleid&file=group"), |
||||
|
array("帖子管理", "?moduleid=$moduleid"), |
||||
|
array("回复管理", "?moduleid=$moduleid&file=reply"), |
||||
|
array("粉丝管理", "?moduleid=$moduleid&file=fans"), |
||||
|
array("管理记录", "?moduleid=$moduleid&file=manage"), |
||||
|
array("分类管理", "?file=category&mid=$moduleid"), |
||||
|
array("更新数据", "?moduleid=$moduleid&file=html"), |
||||
|
array("模块设置", "?moduleid=$moduleid&file=setting"), |
||||
|
); |
||||
|
?>
|
||||
@ -0,0 +1,111 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$tid = isset($tid) ? intval($tid) : 0; |
||||
|
$gid = isset($gid) ? intval($gid) : 0; |
||||
|
$rid = isset($rid) ? intval($rid) : 0; |
||||
|
require DT_ROOT.'/module/'.$module.'/reply.class.php'; |
||||
|
$do = new reply($moduleid); |
||||
|
$menus = array ( |
||||
|
array('回复列表', '?moduleid='.$moduleid.'&file='.$file.'&tid='.$tid), |
||||
|
array('待审核', '?moduleid='.$moduleid.'&file='.$file.'&tid='.$tid.'&action=check'), |
||||
|
array('未通过', '?moduleid='.$moduleid.'&file='.$file.'&tid='.$tid.'&action=reject'), |
||||
|
array('回收站', '?moduleid='.$moduleid.'&file='.$file.'&tid='.$tid.'&action=recycle'), |
||||
|
); |
||||
|
if(in_array($action, array('', 'check', 'reject', 'recycle'))) { |
||||
|
$sfields = array('内容', '会员名', '昵称', '编辑', 'IP'); |
||||
|
$dfields = array('content', 'username', 'passport', 'editor', 'ip'); |
||||
|
$sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '回复次数降序', '回复次数升序', '支持次数降序', '支持次数升序', '反对次数降序', '反对次数升序', '举报次数降序', '举报次数升序'); |
||||
|
$dorder = array('itemid desc', 'addtime DESC', 'addtime ASC', 'reply DESC', 'reply ASC', 'likes DESC', 'likes ASC', 'hates DESC', 'hates ASC', 'reports DESC', 'reports ASC'); |
||||
|
|
||||
|
isset($fields) && isset($dfields[$fields]) or $fields = 0; |
||||
|
isset($order) && isset($dorder[$order]) or $order = 0; |
||||
|
isset($ip) or $ip = ''; |
||||
|
$level = isset($level) ? intval($level) : 0; |
||||
|
(isset($fromdate) && is_time($fromdate)) or $fromdate = ''; |
||||
|
$fromtime = $fromdate ? datetotime($fromdate) : 0; |
||||
|
(isset($todate) && is_time($todate)) or $todate = ''; |
||||
|
$totime = $todate ? datetotime($todate) : 0; |
||||
|
$tid or $tid = ''; |
||||
|
$gid or $gid = ''; |
||||
|
$rid or $rid = ''; |
||||
|
|
||||
|
$fields_select = dselect($sfields, 'fields', '', $fields); |
||||
|
$level_select = level_select('level', '级别', $level); |
||||
|
$order_select = dselect($sorder, 'order', '', $order); |
||||
|
|
||||
|
$condition = ''; |
||||
|
if($keyword) $condition .= in_array($dfields[$fields], array('gid', 'itemid', 'ip')) ? " AND $dfields[$fields]='$kw'" : match_kw($dfields[$fields], $keyword); |
||||
|
if($tid) $condition .= " AND tid='$tid'"; |
||||
|
if($gid) $condition .= " AND gid='$gid'"; |
||||
|
if($rid) $condition .= " AND rid='$rid'"; |
||||
|
if($ip) $condition .= " AND ip='$ip'"; |
||||
|
if($level) $condition .= " AND level=$level"; |
||||
|
if($fromtime) $condition .= " AND addtime>=$fromtime"; |
||||
|
if($totime) $condition .= " AND addtime<=$totime"; |
||||
|
} |
||||
|
switch($action) { |
||||
|
case 'edit': |
||||
|
$itemid or msg(); |
||||
|
$do->itemid = $itemid; |
||||
|
if($submit) { |
||||
|
if($do->pass($post)) { |
||||
|
$do->edit($post); |
||||
|
dmsg('修改成功', $forward); |
||||
|
} else { |
||||
|
msg($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
extract($do->get_one()); |
||||
|
$history = history($moduleid, $file.'-'.$itemid); |
||||
|
$addtime = timetodate($addtime); |
||||
|
include tpl('reply_edit', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'delete': |
||||
|
$itemid or msg('请选择回复'); |
||||
|
isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid); |
||||
|
dmsg('删除成功', $forward); |
||||
|
break; |
||||
|
case 'recycle': |
||||
|
$lists = $do->get_list('status=0'.$condition, $dorder[$order]); |
||||
|
$menuid = 3; |
||||
|
include tpl('reply', $module); |
||||
|
break; |
||||
|
case 'reject': |
||||
|
if($itemid && !$psize) { |
||||
|
$do->reject($itemid); |
||||
|
dmsg('拒绝成功', $forward); |
||||
|
} else { |
||||
|
$lists = $do->get_list('status=1'.$condition, $dorder[$order]); |
||||
|
$menuid = 2; |
||||
|
include tpl('reply', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'check': |
||||
|
if($itemid) { |
||||
|
$do->check($itemid, 3); |
||||
|
dmsg('审核成功', $forward); |
||||
|
} else { |
||||
|
$lists = $do->get_list('status=2'.$condition, $dorder[$order]); |
||||
|
$menuid = 1; |
||||
|
include tpl('reply', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'level': |
||||
|
$itemid or msg('请选择回复'); |
||||
|
$level = intval($level); |
||||
|
$do->level($itemid, $level); |
||||
|
dmsg('级别设置成功', $forward); |
||||
|
break; |
||||
|
case 'cancel': |
||||
|
$itemid or msg('请选择回复'); |
||||
|
$do->check($itemid, 2); |
||||
|
dmsg('取消成功', $forward); |
||||
|
break; |
||||
|
default: |
||||
|
$lists = $do->get_list('status=3'.$condition, $dorder[$order]); |
||||
|
$menuid = 0; |
||||
|
include tpl('reply', $module); |
||||
|
break; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,51 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$tab = isset($tab) ? intval($tab) : 0; |
||||
|
$all = isset($all) ? intval($all) : 0; |
||||
|
if($submit) { |
||||
|
if($setting['split']) { |
||||
|
$setting['fulltext'] = 0; |
||||
|
cache_write($moduleid.'.part', $moduleid); |
||||
|
} else { |
||||
|
cache_delete($moduleid.'.part'); |
||||
|
} |
||||
|
foreach($setting as $k=>$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; |
||||
|
msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=groups&num=1000'); |
||||
|
} |
||||
|
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('\'(?!((<.*?)|(<a.*?)|(<strong.*?)))('.$kw.')(?!(([^<>]*?)>)|([^>]*?</a>)|([^>]*?</strong>))\'si', '<span class=highlight>'.$kw.'</span>', $data); |
||||
|
$data = preg_replace('/<span class=highlight>/', '<a name=high></a><span class=highlight>', $data, 1); |
||||
|
echo $data ? $data : $content; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,163 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?" id="dform" onsubmit="return check();"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<input type="hidden" name="itemid" value="<?php echo $itemid;?>"/> |
||||
|
<input type="hidden" name="forward" value="<?php echo $forward;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 所属分类</td> |
||||
|
<td><?php echo $_admin == 1 ? category_select('post[catid]', '选择分类', $catid, $moduleid) : ajax_category_select('post[catid]', '选择分类', $catid, $moduleid);?> <span id="dcatid" class="f_red"></span></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 商圈名称</td> |
||||
|
<td><input name="post[title]" type="text" id="title" size="20" value="<?php echo $title;?>"/> <?php echo level_select('post[level]', '级别', $level);?> <?php echo dstyle('post[style]', $style);?> <span id="dtitle" class="f_red"></span></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 商圈图标</td> |
||||
|
<td><input name="post[thumb]" id="thumb" type="text" size="70" value="<?php echo $thumb;?>" ondblclick="Dthumb(<?php echo $moduleid;?>,128,128, Dd('thumb').value);"> <span onclick="Dthumb(<?php echo $moduleid;?>,128,128, Dd('thumb').value);" class="jt">[上传]</span> <span onclick="_preview(Dd('thumb').value);" class="jt">[预览]</span> <span onclick="Dd('thumb').value='';" class="jt">[删除]</span><span id="dthumb" class="f_red"></span></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 商圈简介</td> |
||||
|
<td><textarea name="post[content]" id="content" style="width:90%;height:80px;"><?php echo $content;?></textarea><br/><span id="dcontent" class="f_red"></span>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 加圈方式</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[join_type]" value="0" <?php if($join_type == 0) echo 'checked';?>/> 自由
|
||||
|
<input type="radio" name="post[join_type]" value="1" <?php if($join_type == 1) echo 'checked';?>/> 申请
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 粉丝群聊</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[chat]" value="1" <?php if($chat == 1) echo 'checked';?>/> 开启
|
||||
|
<input type="radio" name="post[chat]" value="0" <?php if($chat == 0) echo 'checked';?>/> 关闭
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 浏览商圈</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[list_type]" value="0" <?php if($list_type == 0) echo 'checked';?>/> 不限
|
||||
|
<input type="radio" name="post[list_type]" value="1" <?php if($list_type == 1) echo 'checked';?>/> 成员
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 浏览帖子</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[show_type]" value="0" <?php if($show_type == 0) echo 'checked';?>/> 不限
|
||||
|
<input type="radio" name="post[show_type]" value="1" <?php if($show_type == 1) echo 'checked';?>/> 成员
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 发帖限制</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[post_type]" value="0" <?php if($post_type == 0) echo 'checked';?>/> 不限
|
||||
|
<input type="radio" name="post[post_type]" value="1" <?php if($post_type == 1) echo 'checked';?>/> 成员
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 回复限制</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[reply_type]" value="0" <?php if($reply_type == 0) echo 'checked';?>/> 不限
|
||||
|
<input type="radio" name="post[reply_type]" value="1" <?php if($reply_type == 1) echo 'checked';?>/> 成员
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 创建者</td> |
||||
|
<td><input name="post[username]" type="text" size="20" value="<?php echo $username;?>" id="username"/> <a href="javascript:_user(Dd('username').value);" class="t">[资料]</a> <span id="dusername" class="f_red"></span></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 版主</td> |
||||
|
<td><input name="post[manager]" type="text" size="70" value="<?php echo $manager;?>" id="manager"/><?php tips('请填写版主会员昵称,多个版主用|分隔');?> <span id="dmanager" class="f_red"></span></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 所在地区</td> |
||||
|
<td><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 商圈状态</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[status]" value="3" <?php if($status == 3) echo 'checked';?>/> 通过
|
||||
|
<input type="radio" name="post[status]" value="2" <?php if($status == 2) echo 'checked';?>/> 待审
|
||||
|
<input type="radio" name="post[status]" value="1" <?php if($status == 1) echo 'checked';?> onclick="if(this.checked) Dd('note').style.display='';"/> 拒绝
|
||||
|
<input type="radio" name="post[status]" value="0" <?php if($status == 0) echo 'checked';?>/> 删除
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr id="note" style="display:<?php echo $status==1 ? '' : 'none';?>"> |
||||
|
<td class="tl"><span class="f_red">*</span> 拒绝理由</td> |
||||
|
<td><input name="post[note]" type="text" size="40" value="<?php echo $note;?>"/></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 创建时间</td> |
||||
|
<td><?php echo dcalendar('post[addtime]', $addtime, '-', 1);?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 创建理由</td> |
||||
|
<td><textarea name="post[reason]" id="reason" style="width:90%;height:80px;"><?php echo $reason;?></textarea><br/><span id="dreason" class="f_red"></span>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 商圈模板</td> |
||||
|
<td><?php echo tpl_select('group', $module, 'post[template]', '默认模板', $template, 'id="template"');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 帖子模板</td> |
||||
|
<td><?php echo tpl_select('show', $module, 'post[show_template]', '默认模板', $show_template, 'id="show_template"');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 粉丝模板</td> |
||||
|
<td><?php echo tpl_select('fans', $module, 'post[fans_template]', '默认模板', $fans_template, 'id="fans_template"');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 群聊模板</td> |
||||
|
<td><?php echo tpl_select('chat', $module, 'post[chat_template]', '默认模板', $chat_template, 'id="chat_template"');?></td>
|
||||
|
</tr> |
||||
|
<?php if($MOD['list_html'] && $action == 'edit') { ?>
|
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 静态目录</td> |
||||
|
<td><input type="text" size="22" name="post[filepath]" value="<?php echo $filepath;?>"/> <?php echo tips('限英文、数字、中划线、下划线、斜线,该商圈相关的html文件将保存在此目录');?></td>
|
||||
|
</tr> |
||||
|
<?php } ?>
|
||||
|
</table> |
||||
|
<div class="sbt"><input type="submit" name="submit" value="<?php echo $action == 'edit' ? '修 改' : '添 加';?>" class="btn-g"/> <input type="button" value="<?php echo $action == 'edit' ? '返 回' : '取 消';?>" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>');"/></div> |
||||
|
</form> |
||||
|
<?php load('clear.js'); ?>
|
||||
|
<script type="text/javascript"> |
||||
|
function check() { |
||||
|
var l; |
||||
|
var f; |
||||
|
f = 'catid_1'; |
||||
|
if(Dd(f).value == 0) { |
||||
|
Dmsg('请选择所属分类', 'catid', 1); |
||||
|
return false; |
||||
|
} |
||||
|
f = 'title'; |
||||
|
l = Dd(f).value.length; |
||||
|
if(l < 2) { |
||||
|
Dmsg('请填写商圈名称', f); |
||||
|
return false; |
||||
|
} |
||||
|
f = 'thumb'; |
||||
|
l = Dd(f).value.length; |
||||
|
if(l < 10) { |
||||
|
Dmsg('请上传商圈LOGO', f); |
||||
|
return false; |
||||
|
} |
||||
|
f = 'username'; |
||||
|
l = Dd(f).value.length; |
||||
|
if(l < 2) { |
||||
|
Dmsg('请填写创建者', f); |
||||
|
return false; |
||||
|
} |
||||
|
return true; |
||||
|
} |
||||
|
</script> |
||||
|
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,61 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td height="30"> |
||||
|
<input type="submit" value="一键更新" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=all';" title="生成该模块所有网页"/> |
||||
|
<input type="submit" value="生成首页" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=index';" title="生成该模块首页"/> |
||||
|
<input type="submit" value="生成列表" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=list';" title="生成该模块所有分类"/> |
||||
|
<input type="submit" value=" 生成商圈 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=group';" title="生成该模块所有商圈"/> |
||||
|
<input type="submit" value="生成帖子" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show';" title="生成该模块所有帖子"/> |
||||
|
<input type="submit" value="更新商圈" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=groups';" title="更新该模块所有商圈地址等项目"/> |
||||
|
<input type="submit" value="更新帖子" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show&update=1';" title="更新该模块所有帖子地址等项目"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th>起始ID</th> |
||||
|
<th>结束ID</th> |
||||
|
<th width="200">每轮生成数量</th> |
||||
|
<th width="200">操作</th> |
||||
|
</tr> |
||||
|
<tr align="center"> |
||||
|
<td><input type="text" size="6" name="fid" value="<?php echo $fid;?>"/></td> |
||||
|
<td><input type="text" size="6" name="tid" value="<?php echo $tid;?>"/></td> |
||||
|
<td><input type="text" size="5" name="num" value="100"/></td> |
||||
|
<td><input type="submit" value="生成帖子" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show';"/> |
||||
|
<input type="submit" value="更新帖子" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show&update=1';"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th>选择分类</th> |
||||
|
<th width="200">每轮生成数量</th> |
||||
|
<th width="200">操作</th> |
||||
|
</tr> |
||||
|
<tr align="center"> |
||||
|
<td> |
||||
|
<?php echo category_select('catid', '选择分类', 0, $moduleid);?>
|
||||
|
|
||||
|
第 <input type="text" size="3" name="fpage" value="1"/> 页 至 <input type="text" size="3" name="tpage" value=""/> 页 |
||||
|
</td> |
||||
|
<td><input type="text" size="5" name="num" value="100"/></td> |
||||
|
<td> |
||||
|
<input type="submit" value="生成列表" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=cate';"/> |
||||
|
<input type="submit" value="生成内容" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=item';"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<script type="text/javascript">Menuon(0);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,33 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl">移动方式</td> |
||||
|
<td> |
||||
|
<input type="radio" name="fromtype" value="gid" <?php echo $itemid ? '' : 'checked';?> id="f_1"/><label for="f_1">从指定商圈ID</label>
|
||||
|
<input type="radio" name="fromtype" value="itemid" <?php echo $itemid ? 'checked' : '';?> id="f_2"/><label for="f_2">从指定帖子ID</label>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"></td> |
||||
|
<td> |
||||
|
<textarea style="height:50px;width:300px;" name="fromids"><?php echo $itemid;?></textarea><br/>
|
||||
|
<span class="f_gray">多个ID用,分开 结尾和开头不能有,</span> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">目标商圈</td> |
||||
|
<td><input name="tocatid" type="text" id="tocatid" size="30" value="点击选择" onfocus="Dwidget('?moduleid=<?php echo $moduleid;?>&file=group&itemid=1', '选择商圈');"/></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<div class="sbt"><input type="submit" name="submit" value="移 动" class="btn-g"/></div> |
||||
|
</form> |
||||
|
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,172 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
login(); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
require DT_ROOT.'/module/member/global.func.php'; |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
$gid = isset($gid) ? intval($gid) : 0; |
||||
|
($MOD['chat'] && $gid) or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); |
||||
|
$GRP = get_group($gid); |
||||
|
($GRP && $GRP['status'] == 3 && $GRP['chat']) or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); |
||||
|
$is_fans = is_fans($GRP); |
||||
|
$is_fans or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).$DT['file_my'].'?mid='.$moduleid.'&job=join&action=add&gid='.$gid); |
||||
|
$chatid = md5($gid.'@'.$moduleid); |
||||
|
$chat_poll = intval($MOD['chat_poll']); |
||||
|
$chat_ban = is_array($is_fans) ? $is_fans['ban'] : 0; |
||||
|
function emoji_encode($str){ |
||||
|
$string = ''; |
||||
|
$length = mb_strlen($str, DT_CHARSET); |
||||
|
for($i = 0; $i < $length; $i++) { |
||||
|
$tmp = mb_substr($str, $i, 1, DT_CHARSET); |
||||
|
if(strlen($tmp) >= 4) { |
||||
|
$string .= '[emoji]'.rawurlencode($tmp).'[/emoji]'; |
||||
|
} else { |
||||
|
$string .= $tmp; |
||||
|
} |
||||
|
} |
||||
|
return $string; |
||||
|
} |
||||
|
|
||||
|
switch($action) { |
||||
|
case 'send': |
||||
|
if($chat_ban) exit('ban'); |
||||
|
trim($word) or exit('ko'); |
||||
|
if($MOD['chat_maxlen'] && strlen($word) > $MOD['chat_maxlen']*3) exit('max'); |
||||
|
$word = stripslashes(trim($word)); |
||||
|
$word = strip_tags($word); |
||||
|
$word = dsafe($word); |
||||
|
$word = nl2br($word); |
||||
|
$word = strip_nr($word); |
||||
|
if(!$DT_PC) $word = emoji_encode($word); |
||||
|
$word = str_replace('|', ' ', $word); |
||||
|
if($MOD['chat_file'] && $MG['upload']) clear_upload($word, $_userid, $table); |
||||
|
$db->query("UPDATE {$table_group} SET chattime={$DT_TIME} WHERE itemid=$gid"); |
||||
|
$font_s = $font_s ? intval($font_s) : 0; |
||||
|
$font_c = $font_c ? intval($font_c) : 0; |
||||
|
$font_b = $font_b ? 1 : 0; |
||||
|
$font_i = $font_i ? 1 : 0; |
||||
|
$font_u = $font_u ? 1 : 0; |
||||
|
$css = ''; |
||||
|
if($font_s) $css .= ' s'.$font_s; |
||||
|
if($font_c) $css .= ' c'.$font_c; |
||||
|
if($font_b) $css .= ' fb'; |
||||
|
if($font_i) $css .= ' fi'; |
||||
|
if($font_u) $css .= ' fu'; |
||||
|
if($css) $word = '<span class="'.trim($css).'">'.$word.'</span>'; |
||||
|
if($word) { |
||||
|
$content = addslashes($word); |
||||
|
$nickname = $_cid ? addslashes($_child['nickname']) : ''; |
||||
|
$db->query("INSERT INTO ".get_chat_tb($chatid)." (chatid,username,nickname,addtime,content) VALUES ('$chatid','$_username','$nickname','$DT_TIME','$content')"); |
||||
|
exit('ok'); |
||||
|
} |
||||
|
exit('ko'); |
||||
|
break; |
||||
|
case 'load': |
||||
|
$chatid or exit; |
||||
|
$tb = get_chat_tb($chatid); |
||||
|
$chatlast = $_chatlast = isset($chatlast) ? intval($chatlast) : 0; |
||||
|
$first = isset($first) ? intval($first) : 0; |
||||
|
$i = $j = 0; |
||||
|
$chat_lastuser = ''; |
||||
|
$chat_repeat = 0; |
||||
|
$json = ''; |
||||
|
$time1 = 0; |
||||
|
if($chatlast < 1 || $GRP['chattime'] > $chatlast) { |
||||
|
if($chatlast < 1) { |
||||
|
$result = $db->query("SELECT addtime FROM {$tb} WHERE chatid='$chatid' ORDER BY addtime DESC LIMIT $pagesize"); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$chatlast = $r['addtime']; |
||||
|
} |
||||
|
if($chatlast > 1) $chatlast--; |
||||
|
} |
||||
|
$result = $db->query("SELECT itemid,addtime,username,nickname,content FROM {$tb} WHERE chatid='$chatid' AND addtime>$chatlast ORDER BY addtime ASC LIMIT $pagesize"); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$id = $r['itemid']; |
||||
|
$time = $r['addtime']; |
||||
|
$name = $r['username']; |
||||
|
$nick = $r['nickname'] ? $r['nickname'] : $r['username']; |
||||
|
$head = useravatar($name); |
||||
|
$home = ($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'chat.php?touser='.$name; |
||||
|
$word = $r['content']; |
||||
|
if($_username == $name) { $chat_repeat++; } else { $chat_repeat = 0; } |
||||
|
$chat_lastuser = $name; |
||||
|
$chatlast = $time; |
||||
|
$time2 = $time; |
||||
|
if($time2 - $time1 < 600) { |
||||
|
$date = ''; |
||||
|
} else { |
||||
|
$date = timetodate($time2, 5); |
||||
|
$time1 = $time2; |
||||
|
} |
||||
|
if($MOD['chat_url'] || $MOD['chat_img']) { |
||||
|
if(preg_match_all("/([http|https]+)\:\/\/([a-z0-9\/\-\_\.\,\?\&\#\=\%\+\;]{4,})/i", $word, $m)) { |
||||
|
foreach($m[0] as $u) { |
||||
|
if($MOD['chat_img'] && preg_match("/^(jpg|jpeg|gif|png|bmp)$/i", file_ext($u)) && !preg_match("/([\?\&\=]{1,})/i", $u)) { |
||||
|
$word = str_replace($u, '<img src="'.$u.'" onload="if(this.width>320)this.width=320;" onclick="'.($DT_PC ? 'window.open(this.src)' : 'chat_view(this.src)').';"/>', $word); |
||||
|
} else if($MOD['chat_img'] && preg_match("/^(mp4)$/i", file_ext($u)) && !preg_match("/([\?\&\=]{1,})/i", $u)) { |
||||
|
$word = str_replace($u, '<video src="'.$u.'" width="200" height="150" controls="controls"></video>', $word); |
||||
|
} else if($MOD['chat_url']) { |
||||
|
$word = str_replace($u, '<a href="'.$u.'" target="_blank">'.$u.'</a>', $word); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
if(strpos($word, ')') !== false) $word = parse_face($word); |
||||
|
if(strpos($word, '[emoji]') !== false) $word = emoji_decode($word); |
||||
|
$word = str_replace(array('"', "\r", "\n"), array('\"', "\\r", "\\n"), $word); |
||||
|
$self = $_username == $name ? 1 : 0; |
||||
|
if($self) { |
||||
|
//$name = 'Me';
|
||||
|
} else { |
||||
|
$j++; |
||||
|
} |
||||
|
$json .= ($i ? ',' : '').'{id:"'.$id.'",time:"'.$time.'",date:"'.$date.'",name:"'.$name.'",nick:"'.$nick.'",head:"'.$head.'",home:"'.$home.'",word:"'.$word.'",self:"'.$self.'"}'; |
||||
|
$i = 1; |
||||
|
} |
||||
|
} |
||||
|
if($_chatlast == 0) $j = 0; |
||||
|
$json = '{chat_msg:['.$json.'],chat_new:"'.$j.'",chat_last:"'.$chatlast.'"}'; |
||||
|
exit($json); |
||||
|
break; |
||||
|
case 'down': |
||||
|
if($data && is_md5($chatid)) { |
||||
|
$data = stripslashes(dsafe($data)); |
||||
|
$css = file_get(DT_ROOT.'/'.$MODULE[2]['moduledir'].'/image/chat_group.css'); |
||||
|
$css = str_replace('#chat {width:auto;height:466px;overflow:auto;', '#chat {width:700px;margin:auto;', $css); |
||||
|
$css = str_replace("url('", "url('".$MODULE[2]['linkurl']."image/", $css); |
||||
|
$css .= 'body {background:#D8D8D8;color:#333333;font-size:12px;margin:0;}'; |
||||
|
$data = str_replace('<i></i>', '', $data); |
||||
|
$data = '<!DOCTYPE html><html><head><meta charset="'.DT_CHARSET.'"/><title>'.$GRP['title'].'</title><style type="text/css">'.$css.'</style><base href="'.$MODULE[2]['linkurl'].'"/></head><body><div id="chat">'.$data.'</div></body></html>'; |
||||
|
file_down('', 'chat-'.$gid.'-'.timetodate($DT_TIME, 'YmdHi').'.html', $data); |
||||
|
} |
||||
|
exit; |
||||
|
break; |
||||
|
default: |
||||
|
$faces = get_face(); |
||||
|
|
||||
|
$lists = array(); |
||||
|
$condition = "gid='$gid' AND status=3"; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_fans} WHERE $condition"); |
||||
|
$items = $r['num']; |
||||
|
$pages = pages($items, $page, $pagesize); |
||||
|
$result = $db->query("SELECT * FROM {$table_fans} WHERE $condition ORDER BY addtime ASC LIMIT 35"); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$r['adddate'] = timetodate($r['addtime'], 'Y/m/d H:i'); |
||||
|
$lists[] = $r; |
||||
|
} |
||||
|
$admin = is_admin($GRP); |
||||
|
|
||||
|
include DT_ROOT.'/include/seo.inc.php'; |
||||
|
$seo_title = $L['chat_title'].$seo_delimiter.$GRP['title'].$MOD['seo_name'].$seo_delimiter.$seo_page.$seo_modulename.$seo_delimiter.$seo_sitename; |
||||
|
break; |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); |
||||
|
} else { |
||||
|
$js_pull = 0; |
||||
|
$foot = ''; |
||||
|
if($sns_app) $seo_title = $L['chat_title']; |
||||
|
} |
||||
|
$template = $GRP['chat_template'] ? $GRP['chat_template'] : ($MOD['template_chat'] ? $MOD['template_chat'] : 'chat'); |
||||
|
include template($template, $module); |
||||
|
?>
|
||||
@ -0,0 +1,124 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
class fans { |
||||
|
var $itemid; |
||||
|
var $table; |
||||
|
var $errmsg = errmsg; |
||||
|
|
||||
|
function __construct() { |
||||
|
global $table_fans; |
||||
|
$this->table = $table_fans; |
||||
|
} |
||||
|
|
||||
|
function fans() { |
||||
|
$this->__construct(); |
||||
|
} |
||||
|
|
||||
|
function get_one() { |
||||
|
return DB::get_one("SELECT * FROM {$this->table} WHERE itemid='$this->itemid'"); |
||||
|
} |
||||
|
|
||||
|
function get_list($condition = 'status=3', $order = 'itemid DESC') { |
||||
|
global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum, $table_group; |
||||
|
if($page > 1 && $sum) { |
||||
|
$items = $sum; |
||||
|
} else { |
||||
|
$r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition"); |
||||
|
$items = $r['num']; |
||||
|
} |
||||
|
$pages = pages($items, $page, $pagesize); |
||||
|
if($items < 1) return array(); |
||||
|
$lists = $groupids = array(); |
||||
|
$result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); |
||||
|
while($r = DB::fetch_array($result)) { |
||||
|
$r['adddate'] = timetodate($r['addtime'], 5); |
||||
|
$groupids[$r['gid']] = $r['gid']; |
||||
|
$lists[] = $r; |
||||
|
} |
||||
|
if($groupids) { |
||||
|
$GRPS = array(); |
||||
|
$result = DB::query("SELECT itemid,title,linkurl FROM {$table_group} WHERE itemid IN (".implode(',', $groupids).")"); |
||||
|
while($r = DB::fetch_array($result)) { |
||||
|
$GRPS[$r['itemid']] = $r; |
||||
|
} |
||||
|
if($GRPS) { |
||||
|
foreach($lists as $k=>$v) { |
||||
|
$lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : ''; |
||||
|
$lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'].$GRPS[$v['gid']]['linkurl'] : ''; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return $lists; |
||||
|
} |
||||
|
|
||||
|
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"); |
||||
|
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"); |
||||
|
return true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function delete($itemid) { |
||||
|
if(is_array($itemid)) { |
||||
|
foreach($itemid as $v) { |
||||
|
$this->delete($v); |
||||
|
} |
||||
|
} else { |
||||
|
DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function check($itemid, $status = 3) { |
||||
|
if(is_array($itemid)) { |
||||
|
foreach($itemid as $v) { |
||||
|
$this->check($v, $status); |
||||
|
} |
||||
|
} else { |
||||
|
DB::query("UPDATE {$this->table} SET status=$status WHERE itemid=$itemid"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function reject($itemid) { |
||||
|
if(is_array($itemid)) { |
||||
|
foreach($itemid as $v) { $this->reject($v); } |
||||
|
} else { |
||||
|
DB::query("UPDATE {$this->table} SET status=1 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 ban($itemid, $ban = 0) { |
||||
|
if(is_array($itemid)) { |
||||
|
foreach($itemid as $v) { |
||||
|
$this->ban($v, $ban); |
||||
|
} |
||||
|
} else { |
||||
|
DB::query("UPDATE {$this->table} SET ban=$ban WHERE itemid=$itemid"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function _($e) { |
||||
|
$this->errmsg = $e; |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,34 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
if($action == 'master') { |
||||
|
$name = isset($name) ? urldecode($name) : ''; |
||||
|
if($name && $catid) { |
||||
|
$T = $db->get_one("SELECT manager FROM {$table_group} WHERE itemid=$catid"); |
||||
|
if($T && $T['manager'] && strpos($T['manager'], $name) !== false) { |
||||
|
$username = get_user($name, 'passport', 'username'); |
||||
|
if($username) dheader(userurl($username)); |
||||
|
} |
||||
|
} |
||||
|
dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); |
||||
|
} else { |
||||
|
$itemid or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); |
||||
|
$R = $db->get_one("SELECT * FROM {$table_reply} WHERE itemid=$itemid"); |
||||
|
$R or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); |
||||
|
$tid = $R['tid']; |
||||
|
$T = $db->get_one("SELECT * FROM {$table} WHERE itemid=$tid"); |
||||
|
$T or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); |
||||
|
if($MOD['reply_pagesize']) $pagesize = $MOD['reply_pagesize']; |
||||
|
if($R['fid']) { |
||||
|
$page = ceil($R['fid']/$pagesize); |
||||
|
} else { |
||||
|
$page = ceil(($T['reply']+1)/$pagesize); |
||||
|
} |
||||
|
if($page == 1) { |
||||
|
$linkurl = $T['linkurl']; |
||||
|
} else { |
||||
|
$linkurl = itemurl($T, $page); |
||||
|
} |
||||
|
dheader($DT_PC ? $MOD['linkurl'].$linkurl.'#R'.$itemid : $MOD['mobile'].$linkurl); |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,271 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
class group { |
||||
|
var $itemid; |
||||
|
var $table; |
||||
|
var $fields; |
||||
|
var $errmsg = errmsg; |
||||
|
|
||||
|
function __construct() { |
||||
|
global $table_group; |
||||
|
$this->table = $table_group; |
||||
|
$this->fields = array('catid','areaid','title','level','style','thumb','filepath','content','template','show_template','fans_template','chat_template','chat','join_type','list_type','show_type','post_type','reply_type','status','manager','reason','username','addtime','editor','edittime'); |
||||
|
} |
||||
|
|
||||
|
function group() { |
||||
|
$this->__construct(); |
||||
|
} |
||||
|
|
||||
|
function pass($post) { |
||||
|
global $L; |
||||
|
if(!is_array($post)) return false; |
||||
|
if(!$post['catid']) return $this->_(lang('message->pass_catid')); |
||||
|
if(!$post['title']) return $this->_($L['group_pass_title']); |
||||
|
if(!is_url($post['thumb'])) return $this->_($L['group_pass_thumb']); |
||||
|
if(!check_name($post['username'])) return $this->_($L['group_pass_username']); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
function set($post) { |
||||
|
global $MOD, $_username, $_userid, $_cname; |
||||
|
$post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; |
||||
|
$post['editor'] = $_cname ? $_cname : $_username; |
||||
|
$post['edittime'] = DT_TIME; |
||||
|
if($this->itemid) { |
||||
|
$new = ''; |
||||
|
if($post['thumb']) $new .= '<img src="'.$post['thumb'].'"/>'; |
||||
|
$r = $this->get_one(); |
||||
|
$old = ''; |
||||
|
if($r['thumb']) $old .= '<img src="'.$r['thumb'].'"/>'; |
||||
|
delete_diff($new, $old); |
||||
|
} else { |
||||
|
$post['ip'] = DT_IP; |
||||
|
} |
||||
|
$post['chat'] = $post['chat'] ? 1 : 0; |
||||
|
$post['join_type'] = $post['join_type'] ? 1 : 0; |
||||
|
$post['list_type'] = $post['list_type'] ? 1 : 0; |
||||
|
$post['show_type'] = $post['show_type'] ? 1 : 0; |
||||
|
$post['post_type'] = $post['post_type'] ? 1 : 0; |
||||
|
$post['reply_type'] = $post['reply_type'] ? 1 : 0; |
||||
|
foreach(array('group_list', 'group_show', 'group_post', 'group_reply') as $v) { |
||||
|
$post[$v] = isset($post[$v]) ? implode(',', $post[$v]) : ''; |
||||
|
} |
||||
|
$post = dhtmlspecialchars($post); |
||||
|
return array_map("trim", $post); |
||||
|
} |
||||
|
|
||||
|
function get_one($condition = '') { |
||||
|
return DB::get_one("SELECT * FROM {$this->table} WHERE itemid='$this->itemid' $condition"); |
||||
|
} |
||||
|
|
||||
|
function get_list($condition = '1', $order = 'addtime DESC') { |
||||
|
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"); |
||||
|
$items = $r['num']; |
||||
|
} |
||||
|
$pages = 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"); |
||||
|
while($r = DB::fetch_array($result)) { |
||||
|
$r['adddate'] = timetodate($r['addtime'], 5); |
||||
|
$r['editdate'] = timetodate($r['edittime'], 5); |
||||
|
$r['chatid'] = md5($r['itemid'].'@'.$MOD['moduleid']); |
||||
|
$r['alt'] = $r['title']; |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
$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, $L; |
||||
|
$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(); |
||||
|
$t = get_cat($this->itemid); |
||||
|
if($t) { |
||||
|
$t = DB::get_one("SELECT MAX(catid) AS id FROM ".DT_PRE."category"); |
||||
|
$itemid = intval($t['id'] + 1); |
||||
|
DB::query("UPDATE {$this->table} SET itemid=$itemid WHERE itemid=$this->itemid"); |
||||
|
$maxid = $itemid + 100; |
||||
|
DB::query("INSERT ".DT_PRE."category (catid) VALUES ($maxid)"); |
||||
|
DB::query("DELETE FROM ".DT_PRE."category WHERE catid=$maxid"); |
||||
|
$this->itemid = $itemid; |
||||
|
} |
||||
|
$this->update($this->itemid); |
||||
|
clear_upload($post['thumb'], $this->itemid, $this->table); |
||||
|
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"); |
||||
|
$this->update($this->itemid); |
||||
|
clear_upload($post['thumb'], $this->itemid, $this->table); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
function tohtml($itemid = 0) { |
||||
|
global $module, $MOD; |
||||
|
if($MOD['list_html'] && $itemid) tohtml('group', $module, "itemid=$itemid"); |
||||
|
} |
||||
|
|
||||
|
function update($itemid) { |
||||
|
global $DT; |
||||
|
$item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); |
||||
|
$update = ''; |
||||
|
if(!$item['filepath']) { |
||||
|
$item['filepath'] = $itemid; |
||||
|
$update .= ",filepath='$item[filepath]'"; |
||||
|
} |
||||
|
if($item['username']) { |
||||
|
$passport = addslashes(get_user($item['username'], 'username', 'passport')); |
||||
|
if($passport != $item['passport']) $update .= ",passport='$passport'"; |
||||
|
$this->fans($itemid, $item['addtime'], $item['username'], $item['passport']); |
||||
|
} |
||||
|
if($item['manager']) { |
||||
|
$i = 1; |
||||
|
foreach(explode('|', $item['manager']) as $p) { |
||||
|
$u = get_user($p, 'passport', 'username'); |
||||
|
if($u) $this->fans($itemid, $item['addtime'] + $i++, $u, $p); |
||||
|
} |
||||
|
} |
||||
|
$linkurl = listurl(array('catid' => $item['itemid'], 'catdir' => $item['filepath'], 'catname' => $item['title'])); |
||||
|
if($DT['index']) $linkurl = str_replace($DT['index'].'.'.$DT['file_ext'], '', $linkurl); |
||||
|
if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; |
||||
|
if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); |
||||
|
$this->tohtml($itemid); |
||||
|
} |
||||
|
|
||||
|
function fans($gid, $addtime, $username, $passport) { |
||||
|
global $table_fans; |
||||
|
$passport = addslashes($passport); |
||||
|
$t = DB::get_one("SELECT itemid FROM {$table_fans} WHERE username='$username' AND gid=$gid"); |
||||
|
if($t) { |
||||
|
$fid = $t['itemid']; |
||||
|
DB::query("UPDATE {$table_fans} SET status=3,ban=0,addtime='$addtime',passport='$passport' WHERE itemid=$fid"); |
||||
|
} else { |
||||
|
DB::query("INSERT INTO {$table_fans} (gid,username,passport,ban,addtime,status) VALUES ('$gid','$username','$passport','0','$addtime','3')"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
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"); |
||||
|
$this->tohtml($itemid); |
||||
|
return true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function delete($itemid, $all = true) { |
||||
|
global $MOD, $table, $table_fans; |
||||
|
if(is_array($itemid)) { |
||||
|
foreach($itemid as $v) { $this->delete($v, $all); } |
||||
|
} else { |
||||
|
$r = $this->get_one(); |
||||
|
if($MOD['list_html']) { |
||||
|
$_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl'].$DT['index'].'.'.$DT['file_ext']; |
||||
|
html_del($_file); |
||||
|
$i = 1; |
||||
|
while($i) { |
||||
|
$_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl(array('catid' => $r['itemid'], 'catdir' => $r['filepath'], 'catname' => $r['title']), $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); |
||||
|
DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); |
||||
|
DB::query("DELETE FROM {$table_fans} WHERE gid=$itemid"); |
||||
|
DB::query("UPDATE {$table} SET status=0 WHERE gid=$itemid"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function check($itemid) { |
||||
|
global $_username; |
||||
|
if(is_array($itemid)) { |
||||
|
foreach($itemid as $v) { $this->check($v); } |
||||
|
} else { |
||||
|
DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid"); |
||||
|
$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; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,45 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
if($DT_PC) { |
||||
|
if($MOD['index_html']) { |
||||
|
$html_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext']; |
||||
|
if(!is_file($html_file)) tohtml('index', $module); |
||||
|
if(is_file($html_file)) exit(include($html_file)); |
||||
|
} |
||||
|
if(!check_group($_groupid, $MOD['group_index'])) include load('403.inc'); |
||||
|
$maincat = $childcat = get_maincat(0, $moduleid, 1); |
||||
|
$destoon_task = "moduleid=$moduleid&html=index"; |
||||
|
if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ? 'index.php?page='.$page : ''); |
||||
|
} else { |
||||
|
$gid = 0; |
||||
|
$GRP = array(); |
||||
|
$condition = "status=3"; |
||||
|
if($cityid) { |
||||
|
$areaid = $cityid; |
||||
|
$ARE = get_area($areaid); |
||||
|
$condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; |
||||
|
} |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_group} WHERE $condition", 'CACHE'); |
||||
|
$items = $r['num']; |
||||
|
$pages = mobile_pages($items, $page, $pagesize); |
||||
|
$tags = array(); |
||||
|
if($items) { |
||||
|
$order = $MOD['order']; |
||||
|
$time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; |
||||
|
$result = $db->query("SELECT * FROM {$table_group} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
$r['linkurl'] = $MOD['mobile'].$r['linkurl']; |
||||
|
$r['date'] = timetodate($r[$time], 3); |
||||
|
$tags[] = $r; |
||||
|
} |
||||
|
$db->free_result($result); |
||||
|
$js_load = $MOD['mobile'].'search.php?action=group&job=ajax'; |
||||
|
} |
||||
|
$head_title = $head_name = $MOD['name']; |
||||
|
} |
||||
|
$seo_file = 'index'; |
||||
|
include DT_ROOT.'/include/seo.inc.php'; |
||||
|
include template($MOD['template_index'] ? $MOD['template_index'] : 'index', $module); |
||||
|
?>
|
||||
@ -0,0 +1,225 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
include load($module.'.lang'); |
||||
|
include load('my.lang'); |
||||
|
if(in_array($job, array('group', 'reply', 'join', 'fans', 'manage'))) exit(include(DT_ROOT.'/module/'.$module.'/my_'.$job.'.inc.php')); |
||||
|
$job = ''; |
||||
|
$mod_limit = intval($MOD['limit_'.$_groupid]); |
||||
|
$mod_free_limit = intval($MOD['free_limit_'.$_groupid]); |
||||
|
if($mod_limit < 0) { |
||||
|
if($_userid) dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); |
||||
|
login(); |
||||
|
} |
||||
|
require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php'; |
||||
|
$do = new $module($moduleid); |
||||
|
if(in_array($action, array('add', 'edit'))) { |
||||
|
$FD = cache_read('fields-'.substr($table, strlen($DT_PRE)).'.php'); |
||||
|
if($FD) require DT_ROOT.'/include/fields.func.php'; |
||||
|
isset($post_fields) or $post_fields = array(); |
||||
|
$CP = $MOD['cat_property']; |
||||
|
if($CP) require DT_ROOT.'/include/property.func.php'; |
||||
|
isset($post_ppt) or $post_ppt = array(); |
||||
|
} |
||||
|
$sql = $_userid ? "username='$_username'" : "ip='$DT_IP'"; |
||||
|
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0; |
||||
|
if(in_array($action, array('', 'add'))) { |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND status>1"); |
||||
|
$limit_used = $r['num']; |
||||
|
$limit_free = $mod_limit > $limit_used ? $mod_limit - $limit_used : 0; |
||||
|
} |
||||
|
switch($action) { |
||||
|
case 'add': |
||||
|
$gid = isset($gid) ? intval($gid) : 0; |
||||
|
$gid or $gid = last_gid(); |
||||
|
$gid or message($L['my_choose_group'], $DT_PC ? $MOD['linkurl'] : $MOD['mobile']); |
||||
|
$GRP = get_group($gid); |
||||
|
($GRP && $GRP['status'] == 3) or message($L['my_not_group']); |
||||
|
if($mod_limit && $limit_used >= $mod_limit) dalert(lang($L['info_limit'], array($mod_limit, $limit_used)), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
$is_fans = is_fans($GRP); |
||||
|
$ban = is_array($is_fans) ? $is_fans['ban'] : 0; |
||||
|
if($ban) message($L['my_baned']); |
||||
|
if($GRP['post_type'] && !$is_fans) { |
||||
|
$action = 'post'; |
||||
|
$head_title = lang('message->without_permission'); |
||||
|
exit(include template('nofans', $module)); |
||||
|
} |
||||
|
if($MG['hour_limit']) { |
||||
|
$today = $DT_TIME - 3600; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); |
||||
|
if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
} |
||||
|
if($MG['day_limit']) { |
||||
|
$today = $DT_TODAY - 86400; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); |
||||
|
if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), $_userid ? '?mid='.$mid : '?action=index'); |
||||
|
} |
||||
|
|
||||
|
if($mod_free_limit >= 0) { |
||||
|
$fee_add = ($MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $mod_free_limit && $_userid) ? dround($MOD['fee_add']) : 0; |
||||
|
} else { |
||||
|
$fee_add = 0; |
||||
|
} |
||||
|
$fee_currency = $MOD['fee_currency']; |
||||
|
$fee_unit = $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; |
||||
|
$need_password = $fee_add && $fee_currency == 'money' && $fee_add > $DT['quick_pay']; |
||||
|
$need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; |
||||
|
$need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; |
||||
|
|
||||
|
if($submit) { |
||||
|
if($fee_add && $fee_add > ($fee_currency == 'money' ? $_money : $_credit)) dalert($L['balance_lack']); |
||||
|
if($need_password && !is_payword($_username, $password)) dalert($L['error_payword']); |
||||
|
$msg = captcha($captcha, $need_captcha, true); |
||||
|
if($msg) dalert($msg); |
||||
|
$msg = question($answer, $need_question, true); |
||||
|
if($msg) dalert($msg); |
||||
|
$post['gid'] = $GRP['itemid']; |
||||
|
$post['catid'] = $GRP['catid']; |
||||
|
if($do->pass($post)) { |
||||
|
$post['addtime'] = $post['level'] = $post['fee'] = 0; |
||||
|
$post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; |
||||
|
$need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; |
||||
|
$post['status'] = get_status(3, $need_check); |
||||
|
$post['hits'] = 0; |
||||
|
$post['username'] = $_username; |
||||
|
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); |
||||
|
if($fee_add) { |
||||
|
if($fee_currency == 'money') { |
||||
|
money_add($_username, -$fee_add); |
||||
|
money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); |
||||
|
} else { |
||||
|
credit_add($_username, -$fee_add); |
||||
|
credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); |
||||
|
} |
||||
|
} |
||||
|
$js = ''; |
||||
|
if(isset($post['sync_sina']) && $post['sync_sina']) $js .= sync_weibo('sina', $moduleid, $do->itemid); |
||||
|
if($post['status'] == 3) { |
||||
|
$r = $db->get_one("SELECT linkurl FROM {$table} WHERE itemid=$do->itemid"); |
||||
|
$forward = ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$r['linkurl']; |
||||
|
$msg = ''; |
||||
|
} else { |
||||
|
if($_userid) { |
||||
|
set_cookie('dmsg', $msg); |
||||
|
$forward = '?mid='.$mid.'&status='.$post['status']; |
||||
|
$msg = ''; |
||||
|
} else { |
||||
|
$forward = '?mid='.$mid.'&action=add'; |
||||
|
$msg = $L['success_check']; |
||||
|
} |
||||
|
} |
||||
|
$js .= 'window.onload=function(){parent.window.location="'.$forward.'";}'; |
||||
|
dalert($msg, '', $js); |
||||
|
} else { |
||||
|
dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : '')); |
||||
|
} |
||||
|
} else { |
||||
|
$_gid = $gid; |
||||
|
foreach($do->fields as $v) { |
||||
|
$$v = ''; |
||||
|
} |
||||
|
$gid = $_gid; |
||||
|
$catid = $GRP['catid']; |
||||
|
$content = ''; |
||||
|
if($kw) $title = $kw; |
||||
|
$item = array(); |
||||
|
} |
||||
|
break; |
||||
|
case 'edit': |
||||
|
$itemid or message(); |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $do->get_one(); |
||||
|
if(!$item || $item['username'] != $_username) message(); |
||||
|
$gid = $item['gid']; |
||||
|
$GRP = get_group($gid); |
||||
|
|
||||
|
if($MG['edit_limit'] < 0) message($L['edit_refuse']); |
||||
|
if($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit']*86400) message(lang($L['edit_limit'], array($MG['edit_limit']))); |
||||
|
|
||||
|
if($submit) { |
||||
|
$post['gid'] = $GRP['itemid']; |
||||
|
$post['catid'] = $GRP['catid']; |
||||
|
if($do->pass($post)) { |
||||
|
$post['addtime'] = timetodate($item['addtime']); |
||||
|
$post['level'] = $item['level']; |
||||
|
$post['fee'] = $item['fee']; |
||||
|
$post['style'] = addslashes($item['style']); |
||||
|
$post['template'] = addslashes($item['template']); |
||||
|
$post['filepath'] = addslashes($item['filepath']); |
||||
|
$post['note'] = addslashes($item['note']); |
||||
|
$need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; |
||||
|
$post['status'] = get_status($item['status'], $need_check); |
||||
|
$post['hits'] = $item['hits']; |
||||
|
$post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0; |
||||
|
$post['get_introduce'] = $MOD['get_introduce'] ? 1 : 0; |
||||
|
$post['introduce_length'] = $MOD['introduce_length'] ? $MOD['introduce_length'] : 0; |
||||
|
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); |
||||
|
if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); |
||||
|
set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); |
||||
|
dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); |
||||
|
} else { |
||||
|
dalert($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
extract($item); |
||||
|
} |
||||
|
break; |
||||
|
case 'delete': |
||||
|
$MG['delete'] or message(); |
||||
|
$itemid or message(); |
||||
|
$itemids = is_array($itemid) ? $itemid : array($itemid); |
||||
|
foreach($itemids as $itemid) { |
||||
|
$do->itemid = $itemid; |
||||
|
$item = $db->get_one("SELECT username FROM {$table} WHERE itemid=$itemid"); |
||||
|
if(!$item || $item['username'] != $_username) message(); |
||||
|
$do->recycle($itemid); |
||||
|
} |
||||
|
dmsg($L['success_delete'], $forward); |
||||
|
break; |
||||
|
default: |
||||
|
$status = isset($status) ? intval($status) : 3; |
||||
|
in_array($status, array(1, 2, 3)) or $status = 3; |
||||
|
$condition = "username='$_username'"; |
||||
|
$condition .= " AND status=$status"; |
||||
|
if($keyword) $condition .= match_kw('keyword', $keyword); |
||||
|
if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; |
||||
|
$timetype = strpos($MOD['order'], 'edit') === false ? 'add' : ''; |
||||
|
$lists = $do->get_list($condition, $MOD['order']); |
||||
|
break; |
||||
|
} |
||||
|
if($_userid) { |
||||
|
$nums = array(); |
||||
|
for($i = 1; $i < 4; $i++) { |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='$_username' AND status=$i"); |
||||
|
$nums[$i] = $r['num']; |
||||
|
} |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); |
||||
|
} else { |
||||
|
$foot = ''; |
||||
|
if($action == 'add' || $action == 'edit') { |
||||
|
//
|
||||
|
} else { |
||||
|
$time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; |
||||
|
foreach($lists as $k=>$v) { |
||||
|
$lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); |
||||
|
$lists[$k]['date'] = timetodate($v[$time], 5); |
||||
|
} |
||||
|
$pages = mobile_pages($items, $page, $pagesize); |
||||
|
$back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'my.php'); |
||||
|
} |
||||
|
} |
||||
|
$head_title = $L['my_title']; |
||||
|
include template($MOD['template_my'] ? $MOD['template_my'] : 'my_'.$module, 'member'); |
||||
|
?>
|
||||
@ -0,0 +1,111 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if(!$MOD['show_html'] || !$itemid) return false; |
||||
|
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); |
||||
|
if(!$item || $item['status'] < 3) 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); |
||||
|
$GRP = get_group($gid); |
||||
|
$GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array(); |
||||
|
$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']; |
||||
|
if($content) { |
||||
|
if($MOD['keylink']) $content = DC::keylink($content, $moduleid); |
||||
|
if($lazy) $content = DC::lazy($content); |
||||
|
$content = DC::format($content, 1); |
||||
|
} |
||||
|
$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); |
||||
|
$fileurl = $linkurl; |
||||
|
$linkurl = $MOD['linkurl'].$linkurl; |
||||
|
$admin = ''; |
||||
|
$fee = DC::fee($item['fee'], $MOD['fee_view']); |
||||
|
if($fee) { |
||||
|
$description = DC::description($content, $MOD['pre_view']); |
||||
|
$user_status = 4; |
||||
|
} else { |
||||
|
$user_status = 3; |
||||
|
} |
||||
|
$F = explode('|', $MOD['floor']); |
||||
|
$pages = ''; |
||||
|
$pagesize = $MOD['reply_pagesize']; |
||||
|
if($page == 1) { |
||||
|
$items = $db->count($table_reply, "tid=$itemid AND status=3"); |
||||
|
if($items != $reply) { |
||||
|
$item['reply'] = $reply = $items; |
||||
|
$db->query("UPDATE {$table} SET reply=$reply WHERE itemid=$itemid"); |
||||
|
} |
||||
|
} else { |
||||
|
$items = $reply; |
||||
|
} |
||||
|
$total = max(ceil($items/$pagesize), 1); |
||||
|
if(isset($fid) && isset($num) && $fid > 0) { |
||||
|
$page = $fid; |
||||
|
$topage = $fid + $num - 1; |
||||
|
$total = $topage < $total ? $topage : $total; |
||||
|
} |
||||
|
$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); |
||||
|
for(; $page <= $total; $page++) { |
||||
|
$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); |
||||
|
$replys = array(); |
||||
|
if($items) { |
||||
|
$offset = ($page-1)*$pagesize; |
||||
|
$pages = pages($items, $page, $pagesize, $MOD['linkurl'].itemurl($item, '{destoon_page}')); |
||||
|
$floor = $page == 1 ? 0 : ($page-1)*$pagesize; |
||||
|
$pages = pages($items, $page, $pagesize, $MOD['linkurl'].itemurl($item, '{destoon_page}')); |
||||
|
$result = $db->query("SELECT * FROM {$table_reply} WHERE tid=$itemid AND status=3 ORDER BY itemid ASC LIMIT $offset,$pagesize"); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$r['fname'] = isset($F[$floor]) ? $F[$floor] : ''; |
||||
|
$r['floor'] = ++$floor; |
||||
|
if($r['fid'] != $r['floor']) $db->query("UPDATE {$table_reply} SET fid='$r[floor]' WHERE itemid='$r[itemid]'"); |
||||
|
$replys[] = $r; |
||||
|
} |
||||
|
} |
||||
|
$seo_file = 'show'; |
||||
|
include DT_ROOT.'/include/seo.inc.php'; |
||||
|
$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 = $GRP['title'].$MOD['seo_name']; |
||||
|
$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; |
||||
|
?>
|
||||
@ -0,0 +1,164 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$all = (isset($all) && $all) ? 1 : 0; |
||||
|
$menus = array ( |
||||
|
array('更新数据', '?moduleid='.$moduleid.'&file='.$file), |
||||
|
array('模块首页', $MOD['linkurl'], ' target="_blank"'), |
||||
|
); |
||||
|
$all = (isset($all) && $all) ? 1 : 0; |
||||
|
$one = (isset($one) && $one) ? 1 : 0; |
||||
|
$this_forward = '?moduleid='.$moduleid.'&file='.$file; |
||||
|
$MOD['show_html'] = 0; |
||||
|
switch($action) { |
||||
|
case 'all': |
||||
|
msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=show&update=1&all=1&one='.$one); |
||||
|
break; |
||||
|
case 'index': |
||||
|
tohtml('index', $module); |
||||
|
$all ? msg($MOD['name'].'首页生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=list&all=1&one='.$one) : dmsg($MOD['name'].'首页生成成功', $this_forward); |
||||
|
break; |
||||
|
case 'list': |
||||
|
if(!$MOD['list_html']) { |
||||
|
$all ? msg($MOD['name'].'列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg($MOD['name'].'列表生成成功', $this_forward); |
||||
|
} |
||||
|
if(isset($catids)) { |
||||
|
$CAT = $db->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(userid) AS fid FROM {$table} WHERE groupid>0 {$sql}"); |
||||
|
$fid = $r['fid'] ? $r['fid'] : 0; |
||||
|
} |
||||
|
isset($sid) or $sid = $fid; |
||||
|
if(!isset($tid)) { |
||||
|
$r = $db->get_one("SELECT max(userid) AS tid FROM {$table} WHERE groupid>0 {$sql}"); |
||||
|
$tid = $r['tid'] ? $r['tid'] : 0; |
||||
|
} |
||||
|
if($update) { |
||||
|
require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php'; |
||||
|
$do = new $module(); |
||||
|
} |
||||
|
isset($num) or $num = 50; |
||||
|
if($fid <= $tid) { |
||||
|
$result = $db->query("SELECT userid FROM {$table} WHERE userid>=$fid {$sql} ORDER BY userid LIMIT 0,$num"); |
||||
|
if($db->affected_rows($result)) { |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$userid = $r['userid']; |
||||
|
$update ? $do->update($userid) : tohtml('show', $module); |
||||
|
} |
||||
|
$userid += 1; |
||||
|
} else { |
||||
|
$userid = $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.'至'.($userid-1).$MOD['name'].($update ? '更新' : '生成').'成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$userid&tid=$tid&num=$num&update=$update&all=$all&one=$one", 0); |
||||
|
break; |
||||
|
case 'passport': |
||||
|
if(!isset($fid)) { |
||||
|
$r = $db->get_one("SELECT min(userid) AS fid FROM {$table}"); |
||||
|
$fid = $r['fid'] ? $r['fid'] : 0; |
||||
|
} |
||||
|
isset($sid) or $sid = $fid; |
||||
|
if(!isset($tid)) { |
||||
|
$r = $db->get_one("SELECT max(userid) AS tid FROM {$table}"); |
||||
|
$tid = $r['tid'] ? $r['tid'] : 0; |
||||
|
} |
||||
|
isset($num) or $num = 50; |
||||
|
if($fid <= $tid) { |
||||
|
$result = $db->query("SELECT userid,username FROM {$table} WHERE userid>=$fid ORDER BY userid LIMIT 0,$num"); |
||||
|
if($db->affected_rows($result)) { |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$userid = $r['userid']; |
||||
|
$username = $r['username']; |
||||
|
$passport = get_user($userid, 'userid', 'passport'); |
||||
|
$passport = addslashes($passport); |
||||
|
|
||||
|
$db->query("UPDATE {$DT_PRE}comment SET passport='$passport' WHERE username='$username'"); |
||||
|
foreach($MODULE as $m) { |
||||
|
$mid = $m['moduleid']; |
||||
|
if($m['module'] == 'know') { |
||||
|
$db->query("UPDATE {$DT_PRE}know_{$mid} SET passport='$passport' WHERE username='$username'"); |
||||
|
$db->query("UPDATE {$DT_PRE}know_answer_{$mid} SET passport='$passport' WHERE username='$username'"); |
||||
|
$db->query("UPDATE {$DT_PRE}know_expert_{$mid} SET passport='$passport' WHERE username='$username'"); |
||||
|
$db->query("UPDATE {$DT_PRE}know_vote_{$mid} SET passport='$passport' WHERE username='$username'"); |
||||
|
} |
||||
|
if($m['module'] == 'club') { |
||||
|
$db->query("UPDATE {$DT_PRE}club_{$mid} SET passport='$passport' WHERE username='$username'"); |
||||
|
$db->query("UPDATE {$DT_PRE}club_fans_{$mid} SET passport='$passport' WHERE username='$username'"); |
||||
|
$db->query("UPDATE {$DT_PRE}club_group_{$mid} SET passport='$passport' WHERE username='$username'"); |
||||
|
$db->query("UPDATE {$DT_PRE}club_reply_{$mid} SET passport='$passport' WHERE username='$username'"); |
||||
|
$db->query("UPDATE {$DT_PRE}club_{$mid} SET replyer='$passport' WHERE replyuser='$username'"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
$userid += 1; |
||||
|
} else { |
||||
|
$userid = $fid + $num; |
||||
|
} |
||||
|
} else { |
||||
|
dmsg('更新成功', $this_forward); |
||||
|
} |
||||
|
msg('ID从'.$fid.'至'.($userid-1).'昵称更新成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$userid&tid=$tid&num=$num&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; |
||||
|
default: |
||||
|
$r = $db->get_one("SELECT min(userid) AS fid,max(userid) AS tid FROM {$table}"); |
||||
|
$fid = $r['fid'] ? $r['fid'] : 0; |
||||
|
$tid = $r['tid'] ? $r['tid'] : 0; |
||||
|
include tpl('html', $module); |
||||
|
break; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,16 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$menu = array( |
||||
|
array('公司列表', '?moduleid=4'), |
||||
|
array('子账号', '?moduleid=2&file=child'), |
||||
|
array('行业分类', '?file=category&mid=4'), |
||||
|
array('库存管理', '?moduleid=2&file=stock'), |
||||
|
array('荣誉资质', '?moduleid=2&file=honor'), |
||||
|
array('公司新闻', '?moduleid=2&file=news'), |
||||
|
array('公司单页', '?moduleid=2&file=page'), |
||||
|
array('友情链接', '?moduleid=2&file=link'), |
||||
|
array('公司模板', '?moduleid=2&file=style'), |
||||
|
array('更新数据', '?moduleid=4&file=html'), |
||||
|
array('模块设置', '?moduleid=4&file=setting'), |
||||
|
); |
||||
|
?>
|
||||
@ -0,0 +1,49 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$tab = isset($tab) ? intval($tab) : 0; |
||||
|
$all = isset($all) ? intval($all) : 0; |
||||
|
if($submit) { |
||||
|
if($setting['split']) { |
||||
|
cache_write($moduleid.'.part', $moduleid); |
||||
|
} else { |
||||
|
cache_delete($moduleid.'.part'); |
||||
|
} |
||||
|
foreach($setting as $k=>$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(userid) 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('\'(?!((<.*?)|(<a.*?)|(<strong.*?)))('.$kw.')(?!(([^<>]*?)>)|([^>]*?</a>)|([^>]*?</strong>))\'si', '<span class=highlight>'.$kw.'</span>', $data); |
||||
|
$data = preg_replace('/<span class=highlight>/', '<a name=high></a><span class=highlight>', $data, 1); |
||||
|
echo $data ? $data : $content; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1 @@ |
|||||
|
<meta http-equiv="refresh" content="0;url=../"> |
||||
@ -0,0 +1,134 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="25" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<?php echo $level_select;?>
|
||||
|
<select name="vip"> |
||||
|
<option value=""><?php echo VIP;?>级别</option>
|
||||
|
<?php |
||||
|
for($i = 0; $i < 11; $i++) { |
||||
|
echo '<option value="'.$i.'"'.($i == $vip ? ' selected' : '').'>'.$i.' 级</option>'; |
||||
|
} |
||||
|
?>
|
||||
|
</select> |
||||
|
<?php echo $group_select;?>
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo category_select('catid', '所属行业', $catid, $moduleid);?>
|
||||
|
<?php echo ajax_area_select('areaid', '所在地区', $areaid);?>
|
||||
|
<?php echo $mode_select;?>
|
||||
|
<?php echo $type_select;?>
|
||||
|
<?php echo $size_select;?>
|
||||
|
<?php echo $valid_select;?>
|
||||
|
<input type="text" name="username" value="<?php echo $username;?>" size="10" placeholder="会员名" title="会员名 双击显示会员资料" ondblclick="if(this.value){_user(this.value);}"/> |
||||
|
<input type="text" name="uid" value="<?php echo $uid;?>" size="10" title="会员ID" placeholder="会员ID"/> |
||||
|
<input type="checkbox" name="thumb" value="1"<?php echo $thumb ? ' checked' : '';?>/> 图片
|
||||
|
<input type="checkbox" name="domain" value="1"<?php echo $domain ? ' checked' : '';?>/> 域名
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<select name="datetype"> |
||||
|
<option value="totime" <?php if($datetype == 'totime') echo 'selected';?>>服务到期</option>
|
||||
|
<option value="fromtime" <?php if($datetype == 'fromtime') echo 'selected';?>>服务开始</option>
|
||||
|
<option value="validtime" <?php if($datetype == 'validtime') echo 'selected';?>>认证时间</option>
|
||||
|
<option value="styletime" <?php if($datetype == 'styletime') echo 'selected';?>>模板到期</option>
|
||||
|
</select> |
||||
|
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>
|
||||
|
注册年份:<input type="text" size="5" name="minregyear" value="<?php echo $minregyear;?>"/> ~ <input type="text" size="5" name="maxregyear" value="<?php echo $maxregyear;?>"/> |
||||
|
注册资本:<input type="text" size="5" name="mincapital" value="<?php echo $mincapital;?>"/> ~ <input type="text" size="5" name="maxcapital" value="<?php echo $maxcapital;?>"/> 万 |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');"><img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="60"><a href="javascript:;" onclick="Dq('thumb',<?php echo $thumb ? 0 : 1;?>);">图片</a></th> |
||||
|
<th><?php echo $MOD['name'];?>名称</th>
|
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 25 ? 26 : 25;?>');"><img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 26 ? 'asc' : ($order == 25 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th>会员名</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 31 ? 32 : 31;?>');">会员组 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 32 ? 'asc' : ($order == 31 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th>所在地</th> |
||||
|
<th data-hide-1200="1"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 27 ? 28 : 27;?>');">注册年份 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 28 ? 'asc' : ($order == 27 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 29 ? 30 : 29;?>');">注册资本 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 30 ? 'asc' : ($order == 29 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 9 ? 10 : 9;?>');">点赞 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 10 ? 'asc' : ($order == 9 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<?php if($order == 11 || $order == 12) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">反对 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 13 ? 14 : 13;?>');">收藏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 14 ? 'asc' : ($order == 13 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 15 || $order == 16) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 15 ? 16 : 15;?>');">打赏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 16 ? 'asc' : ($order == 15 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 17 || $order == 18) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 17 ? 18 : 17;?>');">赏金 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 18 ? 'asc' : ($order == 17 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 19 ? 20 : 19;?>');">分享 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 20 ? 'asc' : ($order == 19 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 21 ? 22 : 21;?>');">举报 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 22 ? 'asc' : ($order == 21 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 23 ? 24 : 23;?>');">评论 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 24 ? 'asc' : ($order == 23 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="80">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center"> |
||||
|
<td><input type="checkbox" name="userid[]" value="<?php echo $v['userid'];?>"/></td> |
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td><a href="javascript:_preview('<?php echo $v['thumb'];?>');"><img src="<?php echo $v['thumb'] ? $v['thumb'] : DT_SKIN.'image/nopic60.gif';?>" width="60"/></a></td> |
||||
|
<td> |
||||
|
<div class="lt"> |
||||
|
<a href="<?php echo $v['linkurl'];?>" target="_blank" class="t"><?php echo $v['company'];?></a>
|
||||
|
<div> |
||||
|
<?php if($domain) { ?>
|
||||
|
<?php echo $v['domain'] ? $v['domain'].'<br/>' : '';?>
|
||||
|
<?php echo $v['icp'];?>
|
||||
|
<?php } else { ?>
|
||||
|
<?php echo $v['type'] ? $v['type'].'<br/>' : '';?>
|
||||
|
<?php echo $v['size'];?>
|
||||
|
<?php } ?>
|
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td><?php if($v['vip']) {?><a href="javascript:;" onclick="Dq('vip','<?php echo $v['vip'];?>');"><img src="<?php echo DT_SKIN;?>image/vip_<?php echo $v['vip'];?>.gif" title="<?php echo VIP;?>:<?php echo $v['vip'];?>"/></a><?php } ?></td>
|
||||
|
<td><a href="javascript:_user('<?php echo $v['username'];?>');"><?php echo $v['username'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('groupid','<?php echo $v['groupid'];?>');"><?php echo $GROUP[$v['groupid']]['groupname'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('areaid','<?php echo $v['areaid'];?>');"><?php echo area_pos($v['areaid'], ' ');?></a></td>
|
||||
|
<td data-hide-1200="1"><a href="javascript:;" onclick="Dq('minregyear','<?php echo $v['regyear'];?>',0);Dq('maxregyear','<?php echo $v['regyear'];?>');"><?php echo $v['regyear'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('maxcapital','<?php echo $v['capital'];?>',0);Dq('mincapital','<?php echo $v['capital'];?>');"><?php echo $v['capital'] ? $v['capital'].'万'.$v['regunit'] : '未填';?></a></td>
|
||||
|
<td><a href="javascript:Dwidget('?file=stats&action=pv&homepage=<?php echo $v['username'];?>', '[<?php echo $v['company'];?>] 浏览记录');"><?php echo $v['hits'];?></a></td>
|
||||
|
<td><a href="javascript:Dwidget('?file=like&action=like&mid=<?php echo $moduleid;?>&tid=<?php echo $v['userid'];?>', '点赞记录');"><?php echo $v['likes'];?></a></td>
|
||||
|
<?php if($order == 11 || $order == 12) { ?><td><a href="javascript:Dwidget('?file=like&action=hate&mid=<?php echo $moduleid;?>&tid=<?php echo $v['userid'];?>', '反对记录');"><?php echo $v['hates'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=favorite&mid=<?php echo $moduleid;?>&tid=<?php echo $v['userid'];?>', '[<?php echo $v['company'];?>] 收藏记录');"><?php echo $v['favorites'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 15 || $order == 16) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['userid'];?>', '[<?php echo $v['company'];?>] 打赏记录');"><?php echo $v['awards'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 17 || $order == 18) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['userid'];?>', '[<?php echo $v['company'];?>] 打赏记录');"><?php echo $v['award'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['userid'];?>&kw=share.php', '[<?php echo $v['company'];?>] 分享记录');"><?php echo $v['shares'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><td><a href="javascript:Dwidget('?moduleid=3&file=guestbook&mid=<?php echo $moduleid;?>&tid=<?php echo $v['userid'];?>', '举报记录');"><?php echo $v['reports'];?></a></td><?php } ?>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=3&file=comment&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['userid'];?>', '[<?php echo $v['company'];?>] 评论列表');"><?php echo $v['comments'];?></a></td>
|
||||
|
|
||||
|
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=2&action=edit&userid=<?php echo $v['userid'];?>', '修改资料');"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=2&action=login&userid=<?php echo $v['userid'];?>" target="_blank"><img src="admin/image/set.png" width="16" height="16" title="进入会员商务中心" alt=""/></a> |
||||
|
<a href="?moduleid=2&action=delete&userid=<?php echo $v['userid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a></td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<div class="btns"> |
||||
|
<input type="submit" value="设置<?php echo VIP;?>" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&action=add';"/> |
||||
|
<input type="submit" value="删除公司" class="btn-r" onclick="if(confirm('确定要删除选中会员吗?系统将删除选中用户所有信息,此操作将不可撤销')){this.form.action='?moduleid=2&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="移动地区" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level\';this.form.submit();"');?>
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,35 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr class="on"> |
||||
|
<td> |
||||
|
<input type="radio" name="fromtype" value="areaid" id="f_2"/><label for="f_2">从地区ID</label> |
||||
|
<input type="radio" name="fromtype" value="userid" <?php echo $userid ? 'checked' : '';?> id="f_3"/><label for="f_3">从会员ID</label>
|
||||
|
</td> |
||||
|
<td></td> |
||||
|
<td> 目标地区</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td width="250" align="center" title="多个ID用,分开 结尾和开头不能有,"> |
||||
|
<textarea style="height:300px;width:250px;" name="fromids"><?php echo $userid;?></textarea>
|
||||
|
</td> |
||||
|
<td width="100" align="center"><strong>→</strong></td> |
||||
|
<td><?php echo ajax_area_select('toareaid', '', 0, 'size="2" style="height:300px;width:150px;"');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td></td> |
||||
|
<td align="center"><input type="submit" name="submit" value="移 动" class="btn-g"/></td> |
||||
|
<td></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
</form> |
||||
|
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,390 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
$menus = array ( |
||||
|
array('基本设置'), |
||||
|
array('SEO优化'), |
||||
|
array('权限收费'), |
||||
|
array('定义字段', 'javascript:Dwidget(\'?file=fields&tb='.$table.'\', \'['.$MOD['name'].']定义字段\');'), |
||||
|
); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="tab" id="tab" value="<?php echo $tab;?>"/> |
||||
|
<div id="Tabs0" style="display:"> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl">首页默认模板</td> |
||||
|
<td><?php echo tpl_select('index', $module, 'setting[template_index]', '默认模板', $template_index);?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">列表默认模板</td> |
||||
|
<td><?php echo tpl_select('list', $module, 'setting[template_list]', '默认模板', $template_list);?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">搜索默认模板</td> |
||||
|
<td><?php echo tpl_select('search', $module, 'setting[template_search]', '默认模板', $template_search);?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">信息排序方式</td> |
||||
|
<td> |
||||
|
<input type="text" size="50" name="setting[order]" value="<?php echo $order;?>" id="order"/> |
||||
|
<select onchange="if(this.value) Dd('order').value=this.value;"> |
||||
|
<option value="">请选择</option> |
||||
|
<option value="vip desc"<?php if($order == 'vip desc') echo ' selected';?>><?php echo VIP;?>级别</option>
|
||||
|
<option value="userid desc"<?php if($order == 'userid desc') echo ' selected';?>>会员ID</option>
|
||||
|
</select> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">列表或搜索主字段</td> |
||||
|
<td><input type="text" size="80" name="setting[fields]" value="<?php echo $fields;?>"/><?php tips('此项可在一定程度上提高列表或搜索效率,请勿随意修改以免导致SQL错误');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">内容分表</td> |
||||
|
<td> |
||||
|
<input type="radio" name="setting[split]" value="1" id="split_1"<?php if($split == 1) echo ' checked';?> onclick="Dwidget('?file=split&mid=<?php echo $moduleid;?>&maxid=<?php echo $maxid;?>&split=1', '开启内容分表');"/> 开启
|
||||
|
<input type="radio" name="setting[split]" value="0" id="split_0"<?php if($split == 0) echo ' checked';?> onclick="Dwidget('?file=split&mid=<?php echo $moduleid;?>&maxid=<?php echo $maxid;?>&split=0', '关闭内容分表');"/> 关闭
|
||||
|
<?php tips('如果开启内容分表,内容表将根据id号10万数据创建一个分区<br/>如果你的数据少于10万,则不需要开启,当前最大id为'.$maxid.','.($maxid > 100000 ? '建议开启' : '无需开启').'<br/>此项一旦开启,请不要随意关闭,以免出现未知错误,同时全文搜索将关闭');?>
|
||||
|
<input type="hidden" name="maxid" value="<?php echo $maxid;?>"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">公司主页显示评论</td> |
||||
|
<td> |
||||
|
<input type="radio" name="setting[comment]" value="1" <?php if($comment){ ?>checked <?php } ?>/> 开启
|
||||
|
<input type="radio" name="setting[comment]" value="0" <?php if(!$comment){ ?>checked <?php } ?>/> 关闭 </td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">公司主页信息链接到主站</td> |
||||
|
<td> |
||||
|
<input type="radio" name="setting[homeurl]" value="1" <?php if($homeurl){ ?>checked <?php } ?>/> 开启
|
||||
|
<input type="radio" name="setting[homeurl]" value="0" <?php if(!$homeurl){ ?>checked <?php } ?>/> 关闭 </td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">公司主页开启条件</td> |
||||
|
<td> |
||||
|
<input type="radio" name="setting[homecheck]" value="1" <?php if($homecheck == 1) echo 'checked';?>> 资料认证
|
||||
|
<input type="radio" name="setting[homecheck]" value="0" <?php if($homecheck == 0) echo 'checked';?>> 资料完善
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><?php echo VIP;?>到期自动删除</td>
|
||||
|
<td> |
||||
|
<input type="radio" name="setting[delvip]" value="1" <?php if($delvip){ ?>checked <?php } ?>/> 开启
|
||||
|
<input type="radio" name="setting[delvip]" value="0" <?php if(!$delvip){ ?>checked <?php } ?>/> 关闭
|
||||
|
<?php tips('如果选择开启,服务到期之后,系统自动将'.VIP.'会员设置成普通会员<br/>如果选择关闭,服务到期之后,会员可以继续使用'.VIP.'服务,需要管理员从过期'.VIP.'里手动删除');?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><?php echo VIP;?>指数计算规则</td>
|
||||
|
<td> |
||||
|
<table cellpadding="3" cellspacing="1" width="400" bgcolor="#E5E5E5" style="margin:5px;" class="ctb"> |
||||
|
<tr align="center" bgcolor="#F5F5F5"> |
||||
|
<td>项目</td> |
||||
|
<td>值</td> |
||||
|
<td>最大值</td> |
||||
|
</tr> |
||||
|
<tr align="center" bgcolor="#FFFFFF"> |
||||
|
<td>会员组<?php echo VIP;?>指数</td>
|
||||
|
<td>相等</td> |
||||
|
<td><input type="text" size="2" name="setting[vip_maxgroupvip]" value="<?php echo $vip_maxgroupvip;?>"/></td> |
||||
|
</tr> |
||||
|
<tr align="center" bgcolor="#FFFFFF"> |
||||
|
<td>企业资料认证</td> |
||||
|
<td><input type="text" size="2" name="setting[vip_cominfo]" value="<?php echo $vip_cominfo;?>"/></td> |
||||
|
<td><?php echo $vip_cominfo;?></td>
|
||||
|
</tr> |
||||
|
<tr align="center" bgcolor="#FFFFFF"> |
||||
|
<td>VIP年份(单位:值/年)</td> |
||||
|
<td><input type="text" size="2" name="setting[vip_year]" value="<?php echo $vip_year;?>"/></td> |
||||
|
<td><input type="text" size="2" name="setting[vip_maxyear]" value="<?php echo $vip_maxyear;?>"/></td> |
||||
|
</tr> |
||||
|
<tr align="center" bgcolor="#FFFFFF"> |
||||
|
<td>5张以上资质证书</td> |
||||
|
<td><input type="text" size="2" name="setting[vip_honor]" value="<?php echo $vip_honor;?>"/></td> |
||||
|
<td><?php echo $vip_honor;?></td>
|
||||
|
</tr> |
||||
|
</table> |
||||
|
<span class="f_gray"> 所有数值均为整数。<?php echo VIP;?>指数满分10分,故最大值之和应等于10</span>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">公司主页地图接口</td> |
||||
|
<td> |
||||
|
<select name="setting[map]"> |
||||
|
<option value="">请选择</option> |
||||
|
<?php |
||||
|
$dirs = list_dir('api/map'); |
||||
|
foreach($dirs as $v) { |
||||
|
$selected = ($map && $v['dir'] == $map) ? 'selected' : ''; |
||||
|
echo "<option value='".$v['dir']."' ".$selected.">".$v['name']."</option>"; |
||||
|
} |
||||
|
echo '</select>'; |
||||
|
tips('位于./api/map/目录,一个目录即为一个地图接口,请注意配置对应的config.inc.php文件默认坐标和key<br/>请不要频繁更换接口,以免用户的设置失效。'); |
||||
|
?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">公司主页统计接口</td> |
||||
|
<td> |
||||
|
<?php |
||||
|
$dirs = list_dir('api/stats'); |
||||
|
foreach($dirs as $v) { |
||||
|
echo '<input type="checkbox" name="setting[stats][]" value="'.$v['dir'].'"'.(strpos(','.$stats.',', ','.$v['dir'].',') !== false ? ' checked' : '').'/> '.$v['name'].' '; |
||||
|
} |
||||
|
tips('位于./api/stats/目录,一个目录即为一个统计接口<br/>请不要频繁更换接口,以免用户的设置失效。'); |
||||
|
?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">公司主页客服接口</td> |
||||
|
<td> |
||||
|
<?php |
||||
|
$dirs = list_dir('api/kf'); |
||||
|
foreach($dirs as $v) { |
||||
|
echo '<input type="checkbox" name="setting[kf][]" value="'.$v['dir'].'"'.(strpos(','.$kf.',', ','.$v['dir'].',') !== false ? ' checked' : '').'/> '.$v['name'].' '; |
||||
|
} |
||||
|
tips('位于./api/kf/目录,一个目录即为一个客服接口<br/>请不要频繁更换接口,以免用户的设置失效。'); |
||||
|
?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">级别中文别名</td> |
||||
|
<td> |
||||
|
<input type="text" name="setting[level]" style="width:98%;" value="<?php echo $level;?>"/> |
||||
|
<div style="padding:6px;">用 | 分隔不同别名 依次对应 1|2|3|4|5|6|7|8|9 级</div> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">级别效果预览</td> |
||||
|
<td><?php echo level_select('post[level]', '级别');?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">按分类浏览列数</td> |
||||
|
<td><input type="text" size="3" name="setting[page_subcat]" value="<?php echo $page_subcat;?>"/></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">首页名企推荐数量</td> |
||||
|
<td><input type="text" size="3" name="setting[page_irec]" value="<?php echo $page_irec;?>"/></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">首页最新<?php echo VIP;?>数量</td>
|
||||
|
<td><input type="text" size="3" name="setting[page_ivip]" value="<?php echo $page_ivip;?>"/></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">首页企业新闻数量</td> |
||||
|
<td><input type="text" size="3" name="setting[page_inews]" value="<?php echo $page_inews;?>"/></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">首页最新加入数量</td> |
||||
|
<td><input type="text" size="3" name="setting[page_inew]" value="<?php echo $page_inew;?>"/></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">列表信息分页数量</td> |
||||
|
<td><input type="text" size="3" name="setting[pagesize]" value="<?php echo $pagesize;?>"/></td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">内容点击次数</td> |
||||
|
<td> |
||||
|
<input type="radio" name="setting[hits]" value="1" <?php if($hits) echo 'checked';?>/> 开启
|
||||
|
<input type="radio" name="setting[hits]" value="0" <?php if(!$hits) echo 'checked';?>/> 关闭
|
||||
|
<?php tips('关闭后,有助于缓解频繁更新点击次数对数据表造成的压力');?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">内容点赞和反对</td> |
||||
|
<td> |
||||
|
<input type="radio" name="setting[likes]" value="1" <?php if($likes) echo 'checked';?>/> 开启
|
||||
|
<input type="radio" name="setting[likes]" value="0" <?php if(!$likes) echo 'checked';?>/> 关闭
|
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
</table> |
||||
|
</div> |
||||
|
|
||||
|
<div id="Tabs1" style="display:none"> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl">首页是否生成html</td> |
||||
|
<td> |
||||
|
<input type="radio" name="setting[index_html]" value="1" <?php if($index_html){ ?>checked <?php } ?>/> 是
|
||||
|
<input type="radio" name="setting[index_html]" value="0" <?php if(!$index_html){ ?>checked <?php } ?>/> 否
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">列表页是否生成html</td> |
||||
|
<td> |
||||
|
<input type="radio" name="setting[list_html]" value="1" <?php if($list_html){ ?>checked <?php } ?> onclick="Dd('list_html').style.display='';Dd('list_php').style.display='none';"/> 是
|
||||
|
<input type="radio" name="setting[list_html]" value="0" <?php if(!$list_html){ ?>checked <?php } ?> onclick="Dd('list_html').style.display='none';Dd('list_php').style.display='';"/> 否
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tbody id="list_html" style="display:<?php echo $list_html ? '' : 'none'; ?>"> |
||||
|
<tr> |
||||
|
<td class="tl">HTML列表页文件名前缀</td> |
||||
|
<td><input name="setting[htm_list_prefix]" type="text" id="htm_list_prefix" value="<?php echo $htm_list_prefix;?>" size="10"></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">HTML列表页地址规则</td> |
||||
|
<td><?php echo url_select('setting[htm_list_urlid]', 'htm', 'list', $htm_list_urlid);?><?php tips('提示:规则列表可在./api/url.inc.php文件里自定义');?></td>
|
||||
|
</tr> |
||||
|
</tbody> |
||||
|
<tr id="list_php" style="display:<?php echo $list_html ? 'none' : ''; ?>"> |
||||
|
<td class="tl">PHP列表页地址规则</td> |
||||
|
<td><?php echo url_select('setting[php_list_urlid]', 'php', 'list', $php_list_urlid);?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">模块首页Title<br/>(网页标题)</td> |
||||
|
<td><input name="setting[seo_title_index]" type="text" id="seo_title_index" value="<?php echo $seo_title_index;?>" style="width:90%;"/><br/> |
||||
|
常用变量:<?php echo seo_title('seo_title_index', array('modulename', 'sitename', 'sitetitle', 'page', 'delimiter'));?><br/>
|
||||
|
支持页面PHP变量,例如{$MOD[name]}表示模块名称 |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">模块首页Keywords<br/>(网页关键词)</td> |
||||
|
<td><input name="setting[seo_keywords_index]" type="text" id="seo_keywords_index" value="<?php echo $seo_keywords_index;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_keywords_index', array('modulename', 'sitename', 'sitetitle'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">模块首页Description<br/>(网页描述)</td> |
||||
|
<td><input name="setting[seo_description_index]" type="text" id="seo_description_index" value="<?php echo $seo_description_index;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_description_index', array('modulename', 'sitename', 'sitetitle'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">列表页Title<br/>(网页标题)</td> |
||||
|
<td><input name="setting[seo_title_list]" type="text" id="seo_title_list" value="<?php echo $seo_title_list;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_title_list', array('catname', 'cattitle', 'modulename', 'sitename', 'sitetitle', 'page', 'delimiter'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">列表页Keywords<br/>(网页关键词)</td> |
||||
|
<td><input name="setting[seo_keywords_list]" type="text" id="seo_keywords_list" value="<?php echo $seo_keywords_list;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_keywords_list', array('catname', 'catkeywords', 'modulename', 'sitename', 'sitekeywords'));?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">列表页Description<br/>(网页描述)</td> |
||||
|
<td><input name="setting[seo_description_list]" type="text" id="seo_description_list" value="<?php echo $seo_description_list;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_description_list', array('catname', 'catdescription', 'modulename', 'sitename', 'sitedescription'));?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">内容页Title<br/>(网页标题)</td> |
||||
|
<td><input name="setting[seo_title_show]" type="text" id="seo_title_show" value="<?php echo $seo_title_show;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_title_show', array('showtitle', 'catname', 'cattitle', 'modulename', 'sitename', 'sitetitle', 'delimiter'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">内容页Keywords<br/>(网页关键词)</td> |
||||
|
<td><input name="setting[seo_keywords_show]" type="text" id="seo_keywords_show" value="<?php echo $seo_keywords_show;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_keywords_show', array('showtitle', 'catname', 'catkeywords', 'modulename', 'sitename', 'sitekeywords'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">内容页Description<br/>(网页描述)</td> |
||||
|
<td><input name="setting[seo_description_show]" type="text" id="seo_description_show" value="<?php echo $seo_description_show;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_description_show', array('showtitle', 'showintroduce', 'catname', 'catdescription', 'modulename', 'sitename', 'sitedescription'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">搜索页Title<br/>(网页标题)</td> |
||||
|
<td><input name="setting[seo_title_search]" type="text" id="seo_title_search" value="<?php echo $seo_title_search;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_title_search', array('kw', 'areaname', 'catname', 'cattitle', 'modulename', 'sitename', 'sitetitle', 'page', 'delimiter'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">搜索页Keywords<br/>(网页关键词)</td> |
||||
|
<td><input name="setting[seo_keywords_search]" type="text" id="seo_keywords_search" value="<?php echo $seo_keywords_search;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_keywords_search', array('kw', 'areaname', 'catname', 'catkeywords', 'modulename', 'sitename', 'sitekeywords'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">搜索页Description<br/>(网页描述)</td> |
||||
|
<td><input name="setting[seo_description_search]" type="text" id="seo_description_search" value="<?php echo $seo_description_search;?>" style="width:90%;"/><br/> |
||||
|
<?php echo seo_title('seo_description_search', array('kw', 'areaname', 'catname', 'catdescription', 'modulename', 'sitename', 'sitedescription'));?>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
|
||||
|
<div id="Tabs2" style="display:none"> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl">允许浏览模块首页</td> |
||||
|
<td><?php echo group_checkbox('setting[group_index][]', $group_index);?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">允许浏览分类列表</td> |
||||
|
<td><?php echo group_checkbox('setting[group_list][]', $group_list);?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">允许搜索信息</td> |
||||
|
<td><?php echo group_checkbox('setting[group_search][]', $group_search);?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">查看公司主页联系方式</td> |
||||
|
<td><?php echo group_checkbox('setting[group_contact][]', $group_contact);?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">查看公司主页采购列表</td> |
||||
|
<td><?php echo group_checkbox('setting[group_buy][]', $group_buy);?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">允许在公司主页留言</td> |
||||
|
<td><?php echo group_checkbox('setting[group_message][]', $group_message);?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">允许在公司主页询盘</td> |
||||
|
<td><?php echo group_checkbox('setting[group_inquiry][]', $group_inquiry);?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">允许在公司主页报价</td> |
||||
|
<td><?php echo group_checkbox('setting[group_price][]', $group_price);?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td class="tl">向公司打赏</td> |
||||
|
<td><input type="text" size="2" name="setting[fee_award]" value="<?php echo $fee_award;?>"/> % <?php tips('请填写1-100之间的数字,用户打赏之后,系统将按此比例向发布人增加对应的赏金,填0代表关闭打赏');?></td>
|
||||
|
</tr> |
||||
|
|
||||
|
</table> |
||||
|
</div> |
||||
|
|
||||
|
<div class="sbt"> |
||||
|
<input type="submit" name="submit" value="保 存" class="btn-g"/> |
||||
|
<input type="button" value="展 开" id="ShowAll" class="btn" onclick="TabAll();" title="展 开/合 并"/> |
||||
|
</div> |
||||
|
</form> |
||||
|
<script type="text/javascript"> |
||||
|
var tab = <?php echo $tab;?>;
|
||||
|
var all = <?php echo $all;?>;
|
||||
|
$(function(){ |
||||
|
if(tab) Tab(tab); |
||||
|
if(all) {all = 0; TabAll();} |
||||
|
}); |
||||
|
</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,100 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<?php echo $group_select;?>
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<select name="datetype"> |
||||
|
<option value="fromtime" <?php if($datetype == 'fromtime') echo 'selected';?>>开通时间</option>
|
||||
|
<option value="totime" <?php if($datetype == 'totime') echo 'selected';?>>到期时间</option>
|
||||
|
</select> |
||||
|
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>
|
||||
|
<select name="vip"> |
||||
|
<option value="0"><?php echo VIP;?>指数</option>
|
||||
|
<?php |
||||
|
for($i = 1; $i < 11; $i++) { |
||||
|
echo '<option value="'.$i.'"'.($i == $vip ? ' selected' : '').'>'.$i.' 级</option>'; |
||||
|
} |
||||
|
?>
|
||||
|
</select> |
||||
|
<input type="text" name="vipt" value="<?php echo $vipt;?>" size="6" placeholder="理论值" title="理论值"/> |
||||
|
<input type="text" name="vipr" value="<?php echo $vipr;?>" size="6" placeholder="修正值" title="修正值"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th>公司名称</th> |
||||
|
<th>会员名</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">会员组 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');"><?php echo VIP;?>指数 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></th>
|
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">理论值 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 9 ? 10 : 9;?>');">修正值 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 10 ? 'asc' : ($order == 9 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 1 ? 2 : 1;?>');">开通时间 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 2 ? 'asc' : ($order == 1 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 3 ? 4 : 3;?>');">到期时间 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 4 ? 'asc' : ($order == 3 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 4 ? 3 : 4;?>');">剩余(天) <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 4 ? 'asc' : ($order == 3 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></th> |
||||
|
<th width="70">管理</th> |
||||
|
</tr> |
||||
|
<?php foreach($companys as $k=>$v) {?>
|
||||
|
<tr align="center"> |
||||
|
<td><input type="checkbox" name="userid[]" value="<?php echo $v['userid'];?>"/></td> |
||||
|
<td align="left"> <a href="<?php echo $v['linkurl'];?>" target="_blank"><?php echo $v['company'];?></a></td>
|
||||
|
<td><a href="javascript:_user('<?php echo $v['username'];?>');"><?php echo $v['username'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('groupid','<?php echo $v['groupid'];?>');"><?php echo $GROUP[$v['groupid']]['groupname'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('vip','<?php echo $v['vip'];?>');"><img src="<?php echo DT_SKIN;?>image/vip_<?php echo $v['vip'];?>.gif"/></a></td> |
||||
|
<td><a href="javascript:;" onclick="Dq('vipt','<?php echo $v['vipt'];?>');"><?php echo $v['vipt'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('vipr','<?php echo $v['vipr'];?>');"><?php echo $v['vipr'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('datetype','fromtime',0);Dq('date',this.innerHTML);"><?php echo timetodate($v['fromtime'], 3);?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('datetype','totime',0);Dq('date',this.innerHTML);"><?php echo timetodate($v['totime'], 3);?></a></td>
|
||||
|
<td><?php echo $v['totime'] > $DT_TIME ? intval(($v['totime']-$DT_TIME)/86400) : '<span class="f_red">过期</span>';?></td>
|
||||
|
<td> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=renew&userid=<?php echo $v['userid'];?>"><img src="admin/image/add.png" width="16" height="16" title="续费" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&userid=<?php echo $v['userid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=2&action=login&userid=<?php echo $v['userid'];?>" target="_blank"><img src="admin/image/set.png" width="16" height="16" title="进入会员商务中心" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<div class="btns"> |
||||
|
<input type="submit" value="更新指数" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=update';"/> |
||||
|
<input type="submit" value="撤销<?php echo VIP;?>" class="btn-r" onclick="if(confirm('确定要撤销选中公司<?php echo VIP;?>资格吗吗?')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<div class="tt">名词解释</div> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl"><?php echo VIP;?>指数</td>
|
||||
|
<td class="f_gray"><?php echo VIP;?>指数,是对<?php echo VIP;?>会员的综合评分的一组1-10的数字,是理论值和修正值之和。指数越大,会员的级别、实力、可信度等越高,信息排名越靠前</td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">理论值</td> |
||||
|
<td class="f_gray">理论值是由系统根据管理员设置的评分标准计算出的<?php echo VIP;?>指数值</td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">修正值</td> |
||||
|
<td class="f_gray">为了消除理论值与会员实际综合实力的误差,由管理员进行人工干预的数值,可为正数,也可为负数</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<script type="text/javascript">Menuon(1);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,63 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
$content_table = content_table(4, $userid, is_file(DT_CACHE.'/4.part'), $DT_PRE.'company_data'); |
||||
|
$r = $db->get_one("SELECT content FROM {$content_table} WHERE userid=$userid"); |
||||
|
$COM['content'] = $r['content']; |
||||
|
$intro_length = isset($HOME['intro_length']) && $HOME['intro_length'] ? intval($HOME['intro_length']) : 1000; |
||||
|
$COM['intro'] = nl2br(dsubstr(trim(strip_tags($r['content'])), $intro_length, '...')); |
||||
|
$COM['thumb'] = $COM['thumb'] ? $COM['thumb'] : DT_SKIN.'image/company.jpg'; |
||||
|
if($COMGROUP['main_d']) { |
||||
|
$_main_show = array(); |
||||
|
foreach($HMAIN as $k=>$v) { |
||||
|
$_main_show[$k] = strpos(','.$COMGROUP['main_d'].',', ','.$k.',') !== false ? 1 : 0; |
||||
|
} |
||||
|
$_main_show = implode(',', $_main_show); |
||||
|
} else { |
||||
|
$_main_show = '1,1,1,0,0,0,0'; |
||||
|
} |
||||
|
$_main_order = '0,10,20,30,40,50,60,70'; |
||||
|
$_main_num = '10,1,10,5,3,4,4,10'; |
||||
|
$_main_file= implode(',' , $IFILE); |
||||
|
$_main_name = implode(',' , $HMAIN); |
||||
|
|
||||
|
$main_show = explode(',', isset($HOME['main_show']) ? $HOME['main_show'] : $_main_show); |
||||
|
$main_order = explode(',', isset($HOME['main_order']) ? $HOME['main_order'] : $_main_order); |
||||
|
$main_num = explode(',', isset($HOME['main_num']) ? $HOME['main_num'] : $_main_num); |
||||
|
$main_file = explode(',', isset($HOME['main_file']) ? $HOME['main_file'] : $_main_file); |
||||
|
$main_name = explode(',', isset($HOME['main_name']) ? $HOME['main_name'] : $_main_name); |
||||
|
$_HMAIN = array(); |
||||
|
asort($main_order); |
||||
|
foreach($main_order as $k=>$v) { |
||||
|
if($main_show[$k] && in_array($main_file[$k], $IFILE)) { |
||||
|
$_HMAIN[$k] = $HMAIN[$k]; |
||||
|
} |
||||
|
if($main_num[$k] < 1 || $main_num[$k] > 50) $main_num[$k] = 10; |
||||
|
} |
||||
|
$HMAIN = $_HMAIN; |
||||
|
$seo_title = isset($HOME['seo_title']) && $HOME['seo_title'] ? $HOME['seo_title'] : ''; |
||||
|
$head_title = ''; |
||||
|
if($DT_PC) { |
||||
|
//
|
||||
|
} else { |
||||
|
$background = (isset($HOME['background']) && $HOME['background']) ? $HOME['background'] : ''; |
||||
|
$logo = (isset($HOME['logo']) && $HOME['logo']) ? $HOME['logo'] : ($COM['thumb'] ? $COM['thumb'] : 'static/img/home-logo.png'); |
||||
|
$M = array(); |
||||
|
$my_sell = $my_mall = 0; |
||||
|
foreach($MENU as $v) { |
||||
|
if(in_array($v['file'], array('introduce', 'news', 'credit', 'contact', 'honor', 'link'))) continue; |
||||
|
$M[] = $v; |
||||
|
if($v['file'] == 'sell') $my_sell = 1; |
||||
|
if($v['file'] == 'mall') $my_mall = 1; |
||||
|
} |
||||
|
if($bannerf) require DT_ROOT.'/include/content.class.php'; |
||||
|
$head_name = $L['com_home']; |
||||
|
$foot = 'home'; |
||||
|
} |
||||
|
include template('index', $template); |
||||
|
if(isset($update) && $db->cache_ids && ($username == $_username || $_groupid == 1 || $domain)) { |
||||
|
foreach($db->cache_ids as $v) { |
||||
|
$dc->rm($v); |
||||
|
} |
||||
|
dheader($COM['linkurl']); |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,58 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
$table = $DT_PRE.'honor'; |
||||
|
if($itemid) { |
||||
|
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); |
||||
|
if(!$item || $item['status'] < 3 || $item['username'] != $username) dheader($MENU[$menuid]['linkurl']); |
||||
|
require DT_ROOT.'/include/content.class.php'; |
||||
|
extract($item); |
||||
|
$image = str_replace('.thumb.'.file_ext($thumb), '', $thumb); |
||||
|
$content = DC::format($content, $DT_PC); |
||||
|
if(!$DT_BOT) $db->query("UPDATE LOW_PRIORITY {$table} SET hits=hits+1 WHERE itemid=$itemid", 'UNBUFFERED'); |
||||
|
$head_title = $title.$DT['seo_delimiter'].$head_title; |
||||
|
$head_keywords = $title.','.$COM['company']; |
||||
|
$head_description = dsubstr(strip_tags($content), 200); |
||||
|
if($DT_PC) { |
||||
|
//
|
||||
|
} else { |
||||
|
$js_item = 1; |
||||
|
$foot = 'honor'; |
||||
|
} |
||||
|
} else { |
||||
|
$url = "file=$file"; |
||||
|
$condition = "username='$username' AND status=3"; |
||||
|
if($kw) { |
||||
|
$condition .= match_kw('title', $keyword); |
||||
|
$url .= "&kw=$kw"; |
||||
|
$head_title = $kw.$DT['seo_delimiter'].$head_title; |
||||
|
} |
||||
|
$demo_url = userurl($username, $url.'&page={destoon_page}', $domain); |
||||
|
$pagesize = intval($menu_num[$menuid]); |
||||
|
if(!$pagesize || $pagesize > 100) $pagesize = 10; |
||||
|
$offset = ($page-1)*$pagesize; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); |
||||
|
$items = $r['num']; |
||||
|
$pages = $DT_PC ? home_pages($items, $page, $pagesize, $demo_url) : mobile_pages($items, $page, $pagesize, $demo_url); |
||||
|
$lists = array(); |
||||
|
if($items) { |
||||
|
$result = $db->query("SELECT * FROM {$table} WHERE {$condition} ORDER BY addtime DESC LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$r['alt'] = $r['title']; |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
$r['linkurl'] = userurl($username, "file=$file&itemid=$r[itemid]", $domain); |
||||
|
$r['image'] = str_replace('.thumb.'.file_ext($r['thumb']), '', $r['thumb']); |
||||
|
if($kw) { |
||||
|
$r['title'] = str_replace($kw, '<span class="f_red">'.$kw.'</span>', $r['title']); |
||||
|
} |
||||
|
$lists[] = $r; |
||||
|
} |
||||
|
$db->free_result($result); |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
//
|
||||
|
} else { |
||||
|
$foot = 'honor'; |
||||
|
} |
||||
|
} |
||||
|
include template('honor', $template); |
||||
|
?>
|
||||
@ -0,0 +1,54 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
$filename = DT_CACHE.'/htm/company.htm'; |
||||
|
if(!$MOD['index_html']) { |
||||
|
if(is_file($filename)) file_del($filename); |
||||
|
$mobfile = str_replace('company.htm', 'company.mob.htm', $filename); |
||||
|
if(is_file($mobfile)) file_del($mobfile); |
||||
|
return false; |
||||
|
} |
||||
|
if($DT['rewrite']) { |
||||
|
defined('DT_REWRITE') or define('DT_REWRITE', true); |
||||
|
$_SERVER["SCRIPT_NAME"] = 'index.php'; |
||||
|
$_SERVER['QUERY_STRING'] = ''; |
||||
|
} |
||||
|
$GLOBALS['DT_URL'] = $DT_URL = 'index.php'; |
||||
|
$CSS = array('catalog'); |
||||
|
$seo_file = 'index'; |
||||
|
include DT_ROOT.'/include/seo.inc.php'; |
||||
|
$destoon_task = "moduleid=$moduleid&html=index"; |
||||
|
if($page == 1) $head_canonical = $MOD['linkurl']; |
||||
|
$template = $MOD['template_index'] ? $MOD['template_index'] : 'index'; |
||||
|
if($EXT['mobile_enable']) $head_mobile = $MOD['mobile']; |
||||
|
$DT_PC = $GLOBALS['DT_PC'] = 1; |
||||
|
ob_start(); |
||||
|
include template($template, $module); |
||||
|
$data = ob_get_contents(); |
||||
|
ob_clean(); |
||||
|
file_put($filename, $data); |
||||
|
if($EXT['mobile_enable']) { |
||||
|
include DT_ROOT.'/include/mobile.htm.php'; |
||||
|
$head_pc = $MOD['linkurl']; |
||||
|
$condition = "groupid>5"; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition", 'CACHE'); |
||||
|
$items = $r['num']; |
||||
|
$pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].'index.php?page={destoon_page}'); |
||||
|
$tags = array(); |
||||
|
if($items) { |
||||
|
$order = $MOD['order']; |
||||
|
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$tags[] = $r; |
||||
|
} |
||||
|
$db->free_result($result); |
||||
|
$js_load = $MOD['mobile'].'search.php?job=ajax'; |
||||
|
} |
||||
|
$head_title = $head_name = $MOD['name']; |
||||
|
ob_start(); |
||||
|
include template($template, $module); |
||||
|
$data = ob_get_contents(); |
||||
|
ob_clean(); |
||||
|
file_put(str_replace('company.htm', 'company.mob.htm', $filename), $data); |
||||
|
} |
||||
|
return true; |
||||
|
?>
|
||||
@ -0,0 +1 @@ |
|||||
|
<meta http-equiv="refresh" content="0;url=../"> |
||||
@ -0,0 +1,300 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if(DT_TOUCH && $EXT['mobile_enable']) require_once DT_ROOT.'/include/mobile.inc.php'; |
||||
|
if($DT_PC) { |
||||
|
if($EXT['mobile_enable']) $head_mobile = $DT_URL; |
||||
|
} else { |
||||
|
$foot = 'home'; |
||||
|
} |
||||
|
isset($file) or $file = 'homepage'; |
||||
|
if(isset($update) || isset($preview)) { |
||||
|
$db->cids = 1; |
||||
|
userclean($username); |
||||
|
} |
||||
|
$COM = userinfo($username); |
||||
|
if(!$COM || ($COM['groupid'] < 5 && $COM['groupid'] > 1)) { |
||||
|
userclean($username); |
||||
|
$head_title = $head_name = $L['not_company']; |
||||
|
if($DT_BOT) dhttp(404, $DT_BOT); |
||||
|
$foot = 'channel'; |
||||
|
include template('com-notfound', 'message'); |
||||
|
exit; |
||||
|
} |
||||
|
if(!$COM['edittime'] || (!$COM['validated'] && $MOD['homecheck'])) { |
||||
|
if($DT_BOT) dhttp(404, $DT_BOT); |
||||
|
$head_title = $head_name = $COM['company']; |
||||
|
$foot = 'channel'; |
||||
|
include template('com-opening', 'message'); |
||||
|
exit; |
||||
|
} |
||||
|
$domain = $COM['domain']; |
||||
|
if($domain) { |
||||
|
if(!isset($preview) && !isset($update) && !isset($key)) { |
||||
|
if($CFG['com_domain']) { |
||||
|
if(strpos($DT_URL, $domain) === false) { |
||||
|
$subdomain = userurl($username); |
||||
|
if(strpos($DT_URL, $subdomain) === false) { |
||||
|
dheader('http://'.$domain.'/'); |
||||
|
} else { |
||||
|
if($DT_URL == $subdomain.'index.php' || $DT_URL == $subdomain) dheader('http://'.$domain.'/'); |
||||
|
dheader(str_replace($subdomain, 'http://'.$domain.'/', $DT_URL)); |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
if(strpos($DT_URL, $domain) === false) dheader(userurl($username, ($file && $file != 'homepage') ? 'file='.$file : '', $domain)); |
||||
|
} |
||||
|
} |
||||
|
$DT['rewrite'] = intval($CFG['com_rewrite']); |
||||
|
} |
||||
|
$userid = $COM['userid']; |
||||
|
$linkurl = userurl($username, '', $domain); |
||||
|
$clean = 0; |
||||
|
if($COM['linkurl'] != $linkurl) { |
||||
|
$COM['linkurl'] = $linkurl; |
||||
|
$db->query("UPDATE LOW_PRIORITY {$table} SET linkurl='$linkurl' WHERE userid=$userid", 'UNBUFFERED'); |
||||
|
$clean = 1; |
||||
|
} |
||||
|
if($MOD['delvip'] && $COM['vip'] && $COM['totime'] && $COM['totime'] < $DT_TIME) {//VIP Expired
|
||||
|
$COM['vip'] = 0; |
||||
|
$COM['groupid'] = $gid = $COM['regid'] == 5 ? 5 : 6; |
||||
|
$COM['styleid'] = $COM['styletime'] = 0; |
||||
|
$db->query("UPDATE {$table} SET groupid=$gid,vip=0,styletime=0,styleid=0 WHERE userid=$userid"); |
||||
|
$db->query("UPDATE {$DT_PRE}member SET groupid=$gid WHERE userid=$userid"); |
||||
|
$clean = 1; |
||||
|
} |
||||
|
if($COM['styletime'] && $COM['styletime'] < $DT_TIME) {//SKIN Expired
|
||||
|
$COM['styleid'] = $COM['styletime'] = 0; |
||||
|
$db->query("UPDATE {$table} SET styletime=0,styleid=0 WHERE userid=$userid"); |
||||
|
$clean = 1; |
||||
|
} |
||||
|
if($clean) userclean($username); |
||||
|
$COM['year'] = vip_year($COM['fromtime']); |
||||
|
$COMGROUP = cache_read('group-'.$COM['groupid'].'.php'); |
||||
|
if(!isset($COMGROUP['homepage']) || !$COMGROUP['homepage']) { |
||||
|
$head_title = $head_name = $COM['company']; |
||||
|
$head_keywords = $COM['keyword']; |
||||
|
$head_description = $COM['introduce']; |
||||
|
$member = $COM; |
||||
|
$content_table = content_table(4, $userid, is_file(DT_CACHE.'/4.part'), $DT_PRE.'company_data'); |
||||
|
$t = $db->get_one("SELECT content FROM {$content_table} WHERE userid=$userid", 'CACHE'); |
||||
|
$content = $t['content']; |
||||
|
$member['thumb'] = $member['thumb'] ? $member['thumb'] : DT_SKIN.'image/company.jpg'; |
||||
|
$could_comment = $COM['domain'] ? 0 : $MOD['comment']; |
||||
|
$itemid = $COM['userid']; |
||||
|
$title = $COM['company']; |
||||
|
$likes = $COM['likes']; |
||||
|
$hates = $COM['hates']; |
||||
|
$reports = $COM['reports']; |
||||
|
$favorites = $COM['favorites']; |
||||
|
$comments = $COM['comments']; |
||||
|
$shares = $COM['shares']; |
||||
|
include template('show', $module); |
||||
|
exit; |
||||
|
} |
||||
|
$api_map = ($MOD['map'] && $COMGROUP['map']) ? $MOD['map'] : ''; |
||||
|
$api_stats = ($MOD['stats'] && $COMGROUP['stats']) ? $MOD['stats'] : ''; |
||||
|
$api_kf = ($MOD['kf'] && $COMGROUP['kf']) ? $MOD['kf'] : ''; |
||||
|
isset($rewrite) or $rewrite = ''; |
||||
|
if($rewrite) { |
||||
|
$r = explode('-', $rewrite); |
||||
|
$rc = count($r); |
||||
|
if($rc%2 == 0) { |
||||
|
for($i = 0; $i < $rc; $i++) { |
||||
|
if(in_array($r[$i], array('itemid', 'typeid', 'page', 'view', 'kw', 'preview', 'update'))) { |
||||
|
${$r[$i]} = $r[++$i]; |
||||
|
} else { |
||||
|
++$i; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
$page = isset($page) ? max(intval($page), 1) : 1; |
||||
|
$catid = isset($catid) ? intval($catid) : 0; |
||||
|
$itemid = isset($itemid) ? (is_array($itemid) ? $itemid : intval($itemid)) : 0; |
||||
|
$kw = isset($kw) ? strip_kw($kw, $DT['max_kw']) : ''; |
||||
|
if(strlen($kw) < $DT['min_kw'] || strlen($kw) > $DT['max_kw']) $kw = ''; |
||||
|
$keyword = $kw ? str_replace(array(' ', '*'), array('%', '%'), $kw) : ''; |
||||
|
} |
||||
|
include load('homepage.lang'); |
||||
|
in_array($file, $MFILE) or dheader($MOD['linkurl']); |
||||
|
if($COMGROUP['menu_d']) { |
||||
|
$_menu_show = array(); |
||||
|
foreach($HMENU as $k=>$v) { |
||||
|
$_menu_show[$k] = strpos(','.$COMGROUP['menu_d'].',', ','.$k.',') !== false ? 1 : 0; |
||||
|
} |
||||
|
$_menu_show = implode(',', $_menu_show); |
||||
|
} else { |
||||
|
$_menu_show = '1,1,1,1,1,1,1,1,0,0,0,0,0,0'; |
||||
|
} |
||||
|
$_menu_order = '0,10,20,30,40,50,60,70,80,90,100,110,120,130,140'; |
||||
|
$_menu_num = '1,16,30,30,10,30,1,12,12,12,12,30,12,1,12'; |
||||
|
$_menu_file = implode(',' , $MFILE); |
||||
|
$_menu_name = implode(',' , $HMENU); |
||||
|
|
||||
|
if($COMGROUP['side_d']) { |
||||
|
$_side_show = array(); |
||||
|
foreach($HSIDE as $k=>$v) { |
||||
|
$_side_show[$k] = strpos(','.$COMGROUP['side_d'].',', ','.$k.',') !== false ? 1 : 0; |
||||
|
} |
||||
|
$_side_show = implode(',', $_side_show); |
||||
|
} else { |
||||
|
$_side_show = '1,1,1,0,1,0,1'; |
||||
|
} |
||||
|
$_side_order = '0,10,20,30,40,50,60'; |
||||
|
$_side_num = '1,5,10,1,1,5,5'; |
||||
|
$_side_file = implode(',' , $SFILE); |
||||
|
$_side_name = implode(',' , $HSIDE); |
||||
|
|
||||
|
$HOME = get_company_setting($COM['userid'], '', 'CACHE'); |
||||
|
|
||||
|
$menu_show = explode(',', isset($HOME['menu_show']) ? $HOME['menu_show'] : $_menu_show); |
||||
|
$menu_order = explode(',', isset($HOME['menu_order']) ? $HOME['menu_order'] : $_menu_order); |
||||
|
$menu_num = explode(',', isset($HOME['menu_num']) ? $HOME['menu_num'] : $_menu_num); |
||||
|
$menu_file = explode(',', isset($HOME['menu_file']) ? $HOME['menu_file'] : $_menu_file); |
||||
|
$menu_name = explode(',', isset($HOME['menu_name']) ? $HOME['menu_name'] : $_menu_name); |
||||
|
$_HMENU = array(); |
||||
|
asort($menu_order); |
||||
|
foreach($menu_order as $k=>$v) { |
||||
|
$_HMENU[$k] = $HMENU[$k]; |
||||
|
} |
||||
|
$HMENU = $_HMENU; |
||||
|
|
||||
|
$MENU = array(); |
||||
|
$menuid = 0; |
||||
|
foreach($HMENU as $k=>$v) { |
||||
|
if($menu_show[$k] && in_array($menu_file[$k], $MFILE)) { |
||||
|
$MENU[$k]['name'] = $menu_name[$k]; |
||||
|
$MENU[$k]['file'] = $menu_file[$k]; |
||||
|
$MENU[$k]['linkurl'] = userurl($username, 'file='.$menu_file[$k], $domain); |
||||
|
} |
||||
|
if($file == $menu_file[$k]) $menuid = $k; |
||||
|
if($menu_num[$k] < 1 || $menu_num[$k] > 50) $menu_num[$k] = 10; |
||||
|
} |
||||
|
|
||||
|
isset($_MENU['introduce']) or $_MENU['introduce'] = $L['com_introduce']; |
||||
|
isset($_MENU['news']) or $_MENU['news'] = $L['com_news']; |
||||
|
isset($_MENU['credit']) or $_MENU['credit'] = $L['com_credit']; |
||||
|
isset($_MENU['contact']) or $_MENU['contact'] = $L['com_contact']; |
||||
|
|
||||
|
$side_show = explode(',', isset($HOME['side_show']) ? $HOME['side_show'] : $_side_show); |
||||
|
$side_order = explode(',', isset($HOME['side_order']) ? $HOME['side_order'] : $_side_order); |
||||
|
$side_num = explode(',', isset($HOME['side_num']) ? $HOME['side_num'] : $_side_num); |
||||
|
$side_file = explode(',', isset($HOME['side_file']) ? $HOME['side_file'] : $_side_file); |
||||
|
$side_name = explode(',', isset($HOME['side_name']) ? $HOME['side_name'] : $_side_name); |
||||
|
$_HSIDE = array(); |
||||
|
asort($side_order); |
||||
|
foreach($side_order as $k=>$v) { |
||||
|
if($side_show[$k] && in_array($side_file[$k], $SFILE)) { |
||||
|
$_HSIDE[$k] = $HSIDE[$k]; |
||||
|
} |
||||
|
if($side_num[$k] < 1 || $side_num[$k] > 50) $side_num[$k] = 10; |
||||
|
} |
||||
|
$HSIDE = $_HSIDE; |
||||
|
$side_pos = isset($HOME['side_pos']) && $HOME['side_pos'] ? 1 : 0; |
||||
|
$side_width = isset($HOME['side_width']) && $HOME['side_width'] ? $HOME['side_width'] : 200; |
||||
|
$show_stats = isset($HOME['show_stats']) && $HOME['show_stats'] == 0 ? 0 : 1; |
||||
|
$mstyle = 0; |
||||
|
$skin = 'default'; |
||||
|
$template = 'homepage'; |
||||
|
if($COM['styleid']) { |
||||
|
$t = $db->get_one("SELECT * FROM {$DT_PRE}style WHERE itemid=$COM[styleid]", 'CACHE'); |
||||
|
if($t) { |
||||
|
$skin = $t['skin']; |
||||
|
$template = $t['template']; |
||||
|
$mstyle = $t['mobile']; |
||||
|
} |
||||
|
} else if($COMGROUP['styleid']) { |
||||
|
$gsid = intval($COMGROUP['styleid']); |
||||
|
$t = $db->get_one("SELECT * FROM {$DT_PRE}style WHERE itemid=$gsid", 'CACHE'); |
||||
|
if($t) { |
||||
|
$skin = $t['skin']; |
||||
|
$template = $t['template']; |
||||
|
$mstyle = $t['mobile']; |
||||
|
} |
||||
|
} |
||||
|
if($file == 'homepage') { |
||||
|
$preview = isset($preview) ? intval($preview) : 0; |
||||
|
if($preview) { |
||||
|
$t = $db->get_one("SELECT * FROM {$DT_PRE}style WHERE itemid={$preview}", 'CACHE'); |
||||
|
if($t) { |
||||
|
$skin = $t['skin']; |
||||
|
$template = $t['template']; |
||||
|
$mstyle = $t['mobile']; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
$bannert = isset($HOME['bannert']) ? $HOME['bannert'] : 0; |
||||
|
$banner = isset($HOME['banner']) ? $HOME['banner'] : ''; |
||||
|
$bannerf = isset($HOME['bannerf']) ? $HOME['bannerf'] : ''; |
||||
|
$banner1 = isset($HOME['banner1']) ? $HOME['banner1'] : ''; |
||||
|
$banner2 = isset($HOME['banner2']) ? $HOME['banner2'] : ''; |
||||
|
$banner3 = isset($HOME['banner3']) ? $HOME['banner3'] : ''; |
||||
|
$banner4 = isset($HOME['banner4']) ? $HOME['banner4'] : ''; |
||||
|
$banner5 = isset($HOME['banner5']) ? $HOME['banner5'] : ''; |
||||
|
$bannerlink1 = isset($HOME['bannerlink1']) ? $HOME['bannerlink1'] : ''; |
||||
|
$bannerlink2 = isset($HOME['bannerlink2']) ? $HOME['bannerlink2'] : ''; |
||||
|
$bannerlink3 = isset($HOME['bannerlink3']) ? $HOME['bannerlink3'] : ''; |
||||
|
$bannerlink4 = isset($HOME['bannerlink4']) ? $HOME['bannerlink4'] : ''; |
||||
|
$bannerlink5 = isset($HOME['bannerlink5']) ? $HOME['bannerlink5'] : ''; |
||||
|
if($bannert == 2) { |
||||
|
if($banner1) { |
||||
|
if(!$banner2) { |
||||
|
$bannert = 0; |
||||
|
$banner = $banner1; |
||||
|
} |
||||
|
} else { |
||||
|
$bannert = 0; |
||||
|
} |
||||
|
} else if($bannert == 1) { |
||||
|
if($bannerf) { |
||||
|
if(preg_match("/^(jpg|jpeg|gif|png|bmp)$/i", file_ext($bannerf))) { |
||||
|
$bannert = 0; |
||||
|
$banner = $bannert; |
||||
|
} |
||||
|
} else { |
||||
|
$bannert = 0; |
||||
|
} |
||||
|
} |
||||
|
$bannerw = (isset($HOME['bannerw']) && $HOME['bannerw']) ? intval($HOME['bannerw']) : 1200; |
||||
|
$bannerh = (isset($HOME['bannerh']) && $HOME['bannerh']) ? intval($HOME['bannerh']) : 300; |
||||
|
$could_comment = $domain ? 0 : $MOD['comment']; |
||||
|
$homeurl = $MOD['homeurl']; |
||||
|
$could_contact = check_group($_groupid, $MOD['group_contact']); |
||||
|
if($username == $_username || $domain) $could_contact = true; |
||||
|
$HSPATH = DT_STATIC.$MODULE[4]['moduledir'].'/skin/'.$skin.'/'; |
||||
|
if(!$banner) $banner = is_file(DT_ROOT.'/'.$MODULE[4]['moduledir'].'/skin/'.$skin.'/banner.jpg') ? $HSPATH.'banner.jpg' : ''; |
||||
|
$background = isset($HOME['background']) ? $HOME['background'] : ''; |
||||
|
$bgcolor = isset($HOME['bgcolor']) ? $HOME['bgcolor'] : ''; |
||||
|
$logo = isset($HOME['logo']) ? $HOME['logo'] : ''; |
||||
|
$video = isset($HOME['video']) ? $HOME['video'] : ''; |
||||
|
$css = isset($HOME['css']) ? $HOME['css'] : ''; |
||||
|
$announce = isset($HOME['announce']) ? $HOME['announce'] : ''; |
||||
|
$map = isset($HOME['map']) ? $HOME['map'] : ''; |
||||
|
$stats = isset($HOME['stats']) ? $HOME['stats'] : ''; |
||||
|
$kf = isset($HOME['kf']) ? $HOME['kf'] : ''; |
||||
|
$comment_proxy = ''; |
||||
|
if($domain) { |
||||
|
$comment_proxy = 'http://'.$domain.'/'; |
||||
|
} else { |
||||
|
if($CFG['com_domain']) { |
||||
|
$comment_proxy = $linkurl; |
||||
|
$comment_proxy = substr($CFG['com_domain'], 0, 1) == '.' ? $linkurl : 'http://'.$CFG['com_domain'].'/'; |
||||
|
} else { |
||||
|
$comment_proxy = DT_PATH; |
||||
|
} |
||||
|
} |
||||
|
$comment_proxy = encrypt($comment_proxy, DT_KEY.'PROXY'); |
||||
|
$album_js = 0; |
||||
|
$head_title = $head_name = isset($MENU[$menuid]) ? $MENU[$menuid]['name'] : $_MENU[$file]; |
||||
|
$seo_keywords = isset($HOME['seo_keywords']) ? $HOME['seo_keywords'] : ''; |
||||
|
$seo_description = isset($HOME['seo_description']) ? $HOME['seo_description'] : ''; |
||||
|
$head_keywords = strip_tags($seo_keywords ? $seo_keywords : $COM['company'].','.str_replace('|', ',', $COM['business'])); |
||||
|
$head_description = strip_tags($seo_description ? $seo_description : $COM['introduce']); |
||||
|
if(!$DT_BOT && $MOD['hits']) { |
||||
|
if($DT['cache_hits']) { |
||||
|
cache_hits($moduleid, $userid); |
||||
|
} else { |
||||
|
$db->query("UPDATE LOW_PRIORITY {$table} SET hits=hits+1 WHERE userid=$userid", 'UNBUFFERED'); |
||||
|
} |
||||
|
} |
||||
|
include DT_ROOT.'/module/company/'.$file.'.inc.php'; |
||||
|
?>
|
||||
@ -0,0 +1,144 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
$moduleid = 16; |
||||
|
$module = 'mall'; |
||||
|
$MOD = cache_read('module-'.$moduleid.'.php'); |
||||
|
$table = $DT_PRE.'mall_'.$moduleid; |
||||
|
$table_data = $DT_PRE.'mall_data_'.$moduleid; |
||||
|
$TYPE = get_type($module.'-'.$moduleid.'-'.$userid); |
||||
|
$_TP = sort_type($TYPE); |
||||
|
$elite = isset($elite) ? intval($elite) : 0; |
||||
|
(isset($orderby) && in_array($orderby, array('dcomments', 'dorders', 'dprice', 'aprice'))) or $orderby = ''; |
||||
|
$head_name = $head_title; |
||||
|
if($itemid) { |
||||
|
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); |
||||
|
if(!$item || $item['status'] < 3 || $item['username'] != $username) dheader($MENU[$menuid]['linkurl']); |
||||
|
unset($item['template']); |
||||
|
require DT_ROOT.'/include/content.class.php'; |
||||
|
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 = $t['content']; |
||||
|
$content = DC::format($content, $DT_PC); |
||||
|
$CP = $MOD['cat_property'] && $CAT['property']; |
||||
|
if($CP) { |
||||
|
require DT_ROOT.'/include/property.func.php'; |
||||
|
$options = property_option($catid); |
||||
|
$values = property_value($moduleid, $itemid); |
||||
|
} |
||||
|
require DT_ROOT.'/module/'.$module.'/global.func.php'; |
||||
|
$RL = $relate_id ? get_relate($item) : array(); |
||||
|
$P1 = get_nv($n1, $v1); |
||||
|
$P2 = get_nv($n2, $v2); |
||||
|
$P3 = get_nv($n3, $v3); |
||||
|
if($step) { |
||||
|
@extract(unserialize($step), EXTR_SKIP); |
||||
|
$mode = 2; |
||||
|
} else { |
||||
|
$a1 = 1; |
||||
|
$p1 = $item['price']; |
||||
|
$a2 = $a3 = $p2 = $p3 = ''; |
||||
|
$mode = $prices ? 1 : 0; |
||||
|
} |
||||
|
$stocks = ''; |
||||
|
if($stock) { |
||||
|
$stocks = json_encode(get_stocks($stock)); |
||||
|
$mode = 3; |
||||
|
} |
||||
|
if($subtext && $sublink) { |
||||
|
if(strpos($subtitle, $subtext) === false) { |
||||
|
$subtitle .= '<a href="'.$sublink.'" target="_blank"><span>'.$subtext.'</span></a>'; |
||||
|
} else { |
||||
|
$subtitle = str_replace($subtext, '<a href="'.$sublink.'" target="_blank"><span>'.$subtext.'</span></a>', $subtitle); |
||||
|
} |
||||
|
} |
||||
|
$unit or $unit = $L['unit']; |
||||
|
$adddate = timetodate($addtime, 3); |
||||
|
$editdate = timetodate($edittime, 3); |
||||
|
$linkurl = $MOD['linkurl'].$linkurl; |
||||
|
$albums = get_albums($item); |
||||
|
$pics = count($albums); |
||||
|
$pics_width = $pics*70; |
||||
|
$promos = get_promos($username); |
||||
|
$album_js = 1; |
||||
|
$typeid = $mycatid; |
||||
|
$update = ''; |
||||
|
$sku_amount = get_amount($item); |
||||
|
if($sku_amount != $amount) { |
||||
|
$amount = $sku_amount; |
||||
|
$update .= ",amount=$amount"; |
||||
|
} |
||||
|
if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php'; |
||||
|
$head_canonical = $linkurl; |
||||
|
$head_title = $title.$DT['seo_delimiter'].$head_title; |
||||
|
$head_keywords = $keyword; |
||||
|
$head_description = $introduce ? $introduce : $title; |
||||
|
if($DT_PC) { |
||||
|
//
|
||||
|
} else { |
||||
|
$member = array(); |
||||
|
$fee = DC::fee($item['fee'], $MOD['fee_view']); |
||||
|
include DT_ROOT.'/mobile/api/contact.inc.php'; |
||||
|
$js_item = $js_album = 1; |
||||
|
$foot = ''; |
||||
|
} |
||||
|
} else { |
||||
|
$typeid = isset($typeid) ? intval($typeid) : 0; |
||||
|
$view = isset($view) ? 1 : 0; |
||||
|
$url = "file=$file"; |
||||
|
$condition = "username='$username' AND status=3"; |
||||
|
if($typeid) { |
||||
|
if($TYPE[$typeid]['parentid']) { |
||||
|
$condition .= " AND mycatid='$typeid'"; |
||||
|
} else { |
||||
|
$cids = $typeid.','; |
||||
|
foreach($TYPE as $k=>$v) { |
||||
|
if($v['parentid'] == $typeid) $cids .= $k.','; |
||||
|
} |
||||
|
$cids = substr($cids, 0, -1); |
||||
|
$condition .= " AND mycatid IN ($cids)"; |
||||
|
} |
||||
|
$url .= "&typeid=$typeid"; |
||||
|
$head_title = $TYPE[$typeid]['typename'].$DT['seo_delimiter'].$head_title; |
||||
|
} |
||||
|
if($kw) { |
||||
|
$condition .= match_kw('keyword', $keyword); |
||||
|
$url .= "&kw=$kw"; |
||||
|
$head_title = $kw.$DT['seo_delimiter'].$head_title; |
||||
|
} |
||||
|
if($view) { |
||||
|
$url .= "&view=$view"; |
||||
|
} |
||||
|
if($elite) $condition .= " AND elite>0"; |
||||
|
$demo_url = $action == 'search' ? '' : userurl($username, $url.'&page={destoon_page}', $domain); |
||||
|
$pagesize = intval($menu_num[$menuid]); |
||||
|
if(!$pagesize || $pagesize > 100) $pagesize = 16; |
||||
|
if($view) $pagesize = ceil($pagesize/2); |
||||
|
$offset = ($page-1)*$pagesize; |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); |
||||
|
$items = $r['num']; |
||||
|
$pages = $DT_PC ? home_pages($items, $page, $pagesize, $demo_url) : mobile_pages($items, $page, $pagesize, $demo_url); |
||||
|
$lists = array(); |
||||
|
if($items) { |
||||
|
$order = 'edittime DESC'; |
||||
|
if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; |
||||
|
$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)) { |
||||
|
$r['alt'] = $r['title']; |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
if($kw) $r['title'] = str_replace($kw, '<span class="f_red">'.$kw.'</span>', $r['title']);; |
||||
|
$r['linkurl'] = $homeurl ? ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$r['linkurl'] : userurl($username, "file=$file&itemid=$r[itemid]", $domain); |
||||
|
$lists[] = $r; |
||||
|
} |
||||
|
$db->free_result($result); |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
//
|
||||
|
} else { |
||||
|
$tags = $lists; |
||||
|
if($typeid) $head_name = $TYPE[$typeid]['typename']; |
||||
|
} |
||||
|
} |
||||
|
include template('mall', $template); |
||||
|
?>
|
||||
@ -0,0 +1,129 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
if($DT['rewrite'] && $DT['search_rewrite'] && $_SERVER["REQUEST_URI"] && $_SERVER['QUERY_STRING'] && $job != 'ajax') { |
||||
|
$_URL = rewrite($_SERVER["REQUEST_URI"]); |
||||
|
if($_URL != $_SERVER["REQUEST_URI"]) dheader($_URL); |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
if(!check_group($_groupid, $MOD['group_search'])) include load('403.inc'); |
||||
|
include load('search.lang'); |
||||
|
$MS = cache_read('module-2.php'); |
||||
|
$modes = explode('|', $L['choose'].'|'.$MS['com_mode']); |
||||
|
$types = explode('|', $L['choose'].'|'.$MS['com_type']); |
||||
|
$sizes = explode('|', $L['choose'].'|'.$MS['com_size']); |
||||
|
$vips = array($L['vip_level'], VIP, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); |
||||
|
$thumb = isset($thumb) ? intval($thumb) : 0; |
||||
|
//$vip = isset($vip) ? intval($vip) : 0;
|
||||
|
$mincapital = isset($mincapital) ? dround($mincapital) : ''; |
||||
|
$mincapital or $mincapital = ''; |
||||
|
$maxcapital = isset($maxcapital) ? dround($maxcapital) : ''; |
||||
|
$maxcapital or $maxcapital = ''; |
||||
|
if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) { |
||||
|
$areaid = $cityid; |
||||
|
$ARE = get_area($areaid); |
||||
|
} |
||||
|
isset($mode) && isset($modes[$mode]) or $mode = 0; |
||||
|
isset($type) && isset($types[$type]) or $type = 0; |
||||
|
isset($size) && isset($sizes[$size]) or $size = 0; |
||||
|
isset($vip) && isset($vips[$vip]) or $vip = 0; |
||||
|
$category_select = ajax_category_select('catid', $L['all_category'], $catid, $moduleid); |
||||
|
$area_select = ajax_area_select('areaid', $L['all_area'], $areaid); |
||||
|
$mode_select = dselect($modes, 'mode', '', $mode); |
||||
|
$type_select = dselect($types, 'type', '', $type); |
||||
|
$size_select = dselect($sizes, 'size', '', $size); |
||||
|
$vip_select = dselect($vips, 'vip', '', $vip); |
||||
|
$tags = array(); |
||||
|
if($DT_QST) { |
||||
|
if($kw) { |
||||
|
if(strlen($kw) < $DT['min_kw'] || strlen($kw) > $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); |
||||
|
} |
||||
|
} |
||||
|
$fds = $MOD['fields']; |
||||
|
$condition = "groupid>5 AND catids<>''"; |
||||
|
if($keyword) $condition .= match_kw('keyword', $keyword); |
||||
|
if($mode) $condition .= match_kw('mode', $modes[$mode]); |
||||
|
if($type) $condition .= " AND type='$types[$type]'"; |
||||
|
if($size) $condition .= " AND size='$sizes[$size]'"; |
||||
|
if($catid) $condition .= " AND catids LIKE '%,".$catid.",%'"; |
||||
|
if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; |
||||
|
if($thumb) $condition .= " AND thumb<>''"; |
||||
|
if($vip) $condition .= $vip == 1 ? " AND vip>0" : " AND vip=$vip-1"; |
||||
|
if($mincapital) $condition .= " AND capital>$mincapital"; |
||||
|
if($maxcapital) $condition .= " AND capital<$maxcapital"; |
||||
|
$pagesize = $MOD['pagesize']; |
||||
|
$offset = ($page-1)*$pagesize; |
||||
|
$items = $db->count($table, $condition, $DT['cache_search']); |
||||
|
$pages = pages($items, $page, $pagesize); |
||||
|
if($items) { |
||||
|
$order = $MOD['order'] ? " ORDER BY ".$MOD['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)) { |
||||
|
if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; |
||||
|
if($kw) $r['company'] = str_replace($replacef, $replacet, $r['company']); |
||||
|
$tags[] = $r; |
||||
|
} |
||||
|
$db->free_result($result); |
||||
|
} |
||||
|
} |
||||
|
if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); |
||||
|
$showpage = 1; |
||||
|
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('dhits', 'dcomments', 'dvip', 'avip'))) or $orderby = ''; |
||||
|
$tags = array(); |
||||
|
if($DT_QST) { |
||||
|
$condition = "groupid>5"; |
||||
|
if($keyword) $condition .= match_kw('keyword', $keyword); |
||||
|
if($catid) $condition .= " AND catids like '%,".$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'; |
||||
|
$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['company'] = str_replace($kw, '<span class="f_red">'.$kw.'</span>', $r['company']); |
||||
|
$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); |
||||
|
?>
|
||||
@ -0,0 +1,26 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$MCFG['module'] = 'down'; |
||||
|
$MCFG['name'] = '下载'; |
||||
|
$MCFG['author'] = 'DESTOON'; |
||||
|
$MCFG['homepage'] = 'www.destoon.com'; |
||||
|
$MCFG['copy'] = true; |
||||
|
$MCFG['uninstall'] = true; |
||||
|
$MCFG['moduleid'] = 0; |
||||
|
|
||||
|
$RT = array(); |
||||
|
$RT['file']['index'] = '下载管理'; |
||||
|
$RT['file']['html'] = '更新网页'; |
||||
|
|
||||
|
$RT['action']['index']['add'] = '添加下载'; |
||||
|
$RT['action']['index']['edit'] = '修改下载'; |
||||
|
$RT['action']['index']['delete'] = '删除下载'; |
||||
|
$RT['action']['index']['check'] = '审核下载'; |
||||
|
$RT['action']['index']['expire'] = '过期下载'; |
||||
|
$RT['action']['index']['reject'] = '未通过'; |
||||
|
$RT['action']['index']['recycle'] = '回收站'; |
||||
|
$RT['action']['index']['move'] = '移动下载'; |
||||
|
$RT['action']['index']['level'] = '下载级别'; |
||||
|
|
||||
|
$CT = true; |
||||
|
?>
|
||||
@ -0,0 +1,9 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
file_copy(DT_ROOT.'/api/ajax.php', DT_ROOT.'/'.$dir.'/ajax.php'); |
||||
|
install_file($moduleid, 'index', $dir, 1); |
||||
|
install_file($moduleid, 'list', $dir, 1); |
||||
|
install_file($moduleid, 'show', $dir, 1); |
||||
|
install_file($moduleid, 'search', $dir, 1); |
||||
|
install_file($moduleid, 'down', $dir, 1); |
||||
|
?>
|
||||
@ -0,0 +1,50 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$tab = isset($tab) ? intval($tab) : 0; |
||||
|
$all = isset($all) ? intval($all) : 0; |
||||
|
if($submit) { |
||||
|
if($setting['split']) { |
||||
|
$setting['fulltext'] = 0; |
||||
|
cache_write($moduleid.'.part', $moduleid); |
||||
|
} else { |
||||
|
cache_delete($moduleid.'.part'); |
||||
|
} |
||||
|
foreach($setting as $k=>$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('\'(?!((<.*?)|(<a.*?)|(<strong.*?)))('.$kw.')(?!(([^<>]*?)>)|([^>]*?</a>)|([^>]*?</strong>))\'si', '<span class=highlight>'.$kw.'</span>', $data); |
||||
|
$data = preg_replace('/<span class=highlight>/', '<a name=high></a><span class=highlight>', $data, 1); |
||||
|
echo $data ? $data : $content; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,153 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<span data-hide-1200="1"><?php echo $level_select;?> </span>
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="text" name="username" value="<?php echo $username;?>" size="10" placeholder="会员名" title="会员名 双击显示会员资料" ondblclick="if(this.value){_user(this.value);}"/> |
||||
|
<input type="text" size="10" name="itemid" value="<?php echo $itemid;?>" placeholder="<?php echo $MOD['name'];?>ID" title="<?php echo $MOD['name'];?>ID"/> |
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo ext_select('fileext', $fileext, '', '文件类型');?>
|
||||
|
<select name="datetype"> |
||||
|
<option value="addtime" <?php if($datetype == 'addtime') echo 'selected';?>>发布时间</option>
|
||||
|
<option value="edittime" <?php if($datetype == 'edittime') echo 'selected';?>>更新时间</option>
|
||||
|
</select> |
||||
|
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>
|
||||
|
<?php echo $_admin == 1 ? category_select('catid', '不限分类', $catid, $moduleid) : ajax_category_select('catid', '不限分类', $catid, $moduleid);?>
|
||||
|
<?php echo $DT['city'] ? ajax_area_select('areaid', '不限地区', $areaid).' ' : '';?>
|
||||
|
<input type="checkbox" name="thumb" value="1"<?php echo $thumb ? ' checked' : '';?>/>图片
|
||||
|
<input type="checkbox" name="guest" value="1"<?php echo $guest ? ' checked' : '';?>/>游客
|
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
|
||||
|
<th>分类</th> |
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');"><img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="16"></th> |
||||
|
<th width="60">图片</th> |
||||
|
<th>标题</th> |
||||
|
<th>大小</th> |
||||
|
<th>会员</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 25 ? 26 : 25;?>');">下载 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 26 ? 'asc' : ($order == 25 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 9 ? 10 : 9;?>');">点赞 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 10 ? 'asc' : ($order == 9 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<?php if($order == 11 || $order == 12) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">反对 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 13 ? 14 : 13;?>');">收藏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 14 ? 'asc' : ($order == 13 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 15 ? 16 : 15;?>');">打赏 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 16 ? 'asc' : ($order == 15 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<?php if($order == 17 || $order == 18) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 17 ? 18 : 17;?>');">赏金 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 18 ? 'asc' : ($order == 17 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 19 ? 20 : 19;?>');">分享 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 20 ? 'asc' : ($order == 19 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 21 ? 22 : 21;?>');">举报 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 22 ? 'asc' : ($order == 21 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th><?php } ?>
|
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 23 ? 24 : 23;?>');">评论 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 24 ? 'asc' : ($order == 23 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="50">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td><a href="<?php echo $v['caturl'];?>" target="_blank"><?php echo $v['catname'];?></a></td>
|
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('fileext','<?php echo $v['fileext'];?>');"><img src="<?php echo DT_STATIC;?>file/ext/<?php echo $v['fileext'];?>.gif"/></a></td> |
||||
|
<td><a href="javascript:_preview('<?php echo $v['thumb'];?>');"><img src="<?php echo $v['thumb'] ? $v['thumb'] : DT_SKIN.'image/nopic60.gif';?>" width="60" class="thumb"/></a></td> |
||||
|
<td> |
||||
|
<div class="lt"> |
||||
|
<?php if($v['status'] == 3) {?>
|
||||
|
<a href="<?php echo $v['linkurl'];?>" target="_blank" class="t"><?php echo $v['title'];?></a>
|
||||
|
<?php } else { ?>
|
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>" class="t"><?php echo $v['title'];?></a>
|
||||
|
<?php } ?>
|
||||
|
<div> |
||||
|
更新:<span class="c_p" onclick="Dq('datetype','edittime');Dq('date',this.innerHTML);"><?php echo timetodate($v['edittime'], 6);?></span><br/>
|
||||
|
添加:<span class="c_p" onclick="Dq('datetype','addtime');Dq('date',this.innerHTML);"><?php echo timetodate($v['addtime'], 6);?></span>
|
||||
|
</div> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td><?php echo $v['filesize'];?><?php echo $v['unit'];?></td>
|
||||
|
<td title="编辑:<?php echo $v['editor'];?>"> |
||||
|
<?php if($v['username']) { ?>
|
||||
|
<a href="javascript:;" onclick="_user(this.innerHTML);"><?php echo $v['username'];?></a>
|
||||
|
<?php } else { ?>
|
||||
|
<a href="javascript:;" onclick="_ip(this.innerHTML);" title="游客"><?php echo $v['ip'];?></a>
|
||||
|
<?php } ?>
|
||||
|
</td> |
||||
|
<td><?php echo $v['download'];?></td>
|
||||
|
<td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&catid=<?php echo $v['catid'];?>&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 浏览记录');"><?php echo $v['hits'];?></a></td>
|
||||
|
<td><a href="javascript:Dwidget('?file=like&action=like&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '点赞记录');"><?php echo $v['likes'];?></a></td>
|
||||
|
<?php if($order == 11 || $order == 12) { ?><td><a href="javascript:Dwidget('?file=like&action=hate&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '反对记录');"><?php echo $v['hates'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 13 || $order == 14) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=favorite&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 收藏记录');"><?php echo $v['favorites'];?></a></td><?php } ?>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 打赏记录');"><?php echo $v['awards'];?></a></td>
|
||||
|
<?php if($order == 17 || $order == 18) { ?><td><a href="javascript:Dwidget('?moduleid=2&file=award&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 打赏记录');"><?php echo $v['award'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 19 || $order == 20) { ?><td><a href="javascript:Dwidget('?file=stats&action=pv&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['itemid'];?>&kw=share.php', '[<?php echo $v['alt'];?>] 分享记录');"><?php echo $v['shares'];?></a></td><?php } ?>
|
||||
|
<?php if($order == 21 || $order == 22) { ?><td><a href="javascript:Dwidget('?moduleid=3&file=guestbook&mid=<?php echo $moduleid;?>&tid=<?php echo $v['itemid'];?>', '举报记录');"><?php echo $v['reports'];?></a></td><?php } ?>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=3&file=comment&mid=<?php echo $moduleid;?>&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 评论列表');"><?php echo $v['comments'];?></a></td>
|
||||
|
<td> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<?php include tpl('notice_chip');?>
|
||||
|
<div class="btns"> |
||||
|
|
||||
|
<?php if($action == 'check') { ?>
|
||||
|
|
||||
|
<input type="submit" value="通过审核" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=check';"/> |
||||
|
<input type="submit" value="拒 绝" class="btn-r" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/> |
||||
|
<input type="submit" value="移动分类" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'reject') { ?>
|
||||
|
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中供应吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
|
||||
|
<?php } else if($action == 'recycle') { ?>
|
||||
|
|
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中供应吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="还 原" class="btn" onclick="if(confirm('确定要还原选中<?php echo $MOD['name'];?>吗?状态将被设置为已通过')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=restore'}else{return false;}"/> |
||||
|
<input type="submit" value="清 空" class="btn-r" onclick="if(confirm('确定要清空回收站吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=clear';}else{return false;}"/> |
||||
|
|
||||
|
<?php } else { ?>
|
||||
|
|
||||
|
<input type="submit" value=" 更新下载 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=update';"/> |
||||
|
<?php if($MOD['show_html']) { ?><input type="submit" value=" 生成网页 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=tohtml';"/> <?php } ?>
|
||||
|
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/> |
||||
|
<input type="submit" value="彻底删除" class="btn-r" onclick="if(confirm('确定要删除选中<?php echo $MOD['name'];?>吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<input type="submit" value="移动分类" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level\';this.form.submit();"');?>
|
||||
|
|
||||
|
<?php } ?>
|
||||
|
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<br/> |
||||
|
<script type="text/javascript"> |
||||
|
$(function(){ |
||||
|
Menuon(<?php echo $menuid;?>);
|
||||
|
$('.thumb').on('error', function(e) { |
||||
|
$(this).attr('src', '<?php echo DT_SKIN;?>image/nopic60.gif'); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,7 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/include/module.func.php'; |
||||
|
require DT_ROOT.'/module/'.$module.'/global.func.php'; |
||||
|
$table = $DT_PRE.$module.'_'.$moduleid; |
||||
|
$table_data = $DT_PRE.$module.'_data_'.$moduleid; |
||||
|
?>
|
||||
@ -0,0 +1,25 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
function ext_select($name, $value, $extend = '', $title = '') { |
||||
|
include DT_ROOT.'/file/config/filetype.inc.php'; |
||||
|
if(!$value && !$title) $value = 'oth'; |
||||
|
$select = '<select name="'.$name.'" '.$extend.'>'; |
||||
|
if($title) $select .= '<option value=""'.('' == $value ? ' selected' : '').'>'.$title.'</option>'; |
||||
|
foreach($FILETYPE as $k=>$v) { |
||||
|
$select .= '<option value="'.$k.'"'.($k == $value ? ' selected' : '').'>'.$v.'</option>'; |
||||
|
} |
||||
|
$select .= '</select>'; |
||||
|
return $select; |
||||
|
} |
||||
|
|
||||
|
function unit_select($name, $value, $extend = '') { |
||||
|
$UNIT = array('K', 'M', 'G', 'T'); |
||||
|
$value or $value = 'M'; |
||||
|
$select = '<select name="'.$name.'" '.$extend.'>'; |
||||
|
foreach($UNIT as $k=>$v) { |
||||
|
$select .= '<option value="'.$v.'"'.($v == $value ? ' selected' : '').'>'.$v.'</option>'; |
||||
|
} |
||||
|
$select .= '</select>'; |
||||
|
return $select; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1 @@ |
|||||
|
<meta http-equiv="refresh" content="0;url=../"> |
||||
@ -0,0 +1,27 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$MCFG['module'] = 'exhibit'; |
||||
|
$MCFG['name'] = '展会'; |
||||
|
$MCFG['author'] = 'DESTOON'; |
||||
|
$MCFG['homepage'] = 'www.destoon.com'; |
||||
|
$MCFG['copy'] = true; |
||||
|
$MCFG['uninstall'] = true; |
||||
|
$MCFG['moduleid'] = 0; |
||||
|
|
||||
|
$RT = array(); |
||||
|
$RT['file']['index'] = '展会管理'; |
||||
|
$RT['file']['sign'] = '报名管理'; |
||||
|
$RT['file']['html'] = '更新网页'; |
||||
|
|
||||
|
$RT['action']['index']['add'] = '添加展会'; |
||||
|
$RT['action']['index']['edit'] = '修改展会'; |
||||
|
$RT['action']['index']['delete'] = '删除展会'; |
||||
|
$RT['action']['index']['check'] = '审核展会'; |
||||
|
$RT['action']['index']['expire'] = '过期展会'; |
||||
|
$RT['action']['index']['reject'] = '未通过'; |
||||
|
$RT['action']['index']['recycle'] = '回收站'; |
||||
|
$RT['action']['index']['move'] = '移动展会'; |
||||
|
$RT['action']['index']['level'] = '信息级别'; |
||||
|
|
||||
|
$CT = true; |
||||
|
?>
|
||||
@ -0,0 +1,10 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$setting = include(DT_ROOT.'/file/setting/module-8.php'); |
||||
|
update_setting($moduleid, $setting); |
||||
|
$sql = file_get(DT_ROOT.'/file/setting/'.$module.'.sql'); |
||||
|
$sql = str_replace('_8', '_'.$moduleid, $sql); |
||||
|
$sql = str_replace('展会', $modulename, $sql); |
||||
|
sql_execute($sql); |
||||
|
include DT_ROOT.'/module/'.$module.'/admin/remkdir.inc.php'; |
||||
|
?>
|
||||
@ -0,0 +1,50 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$tab = isset($tab) ? intval($tab) : 0; |
||||
|
$all = isset($all) ? intval($all) : 0; |
||||
|
if($submit) { |
||||
|
if($setting['split']) { |
||||
|
$setting['fulltext'] = 0; |
||||
|
cache_write($moduleid.'.part', $moduleid); |
||||
|
} else { |
||||
|
cache_delete($moduleid.'.part'); |
||||
|
} |
||||
|
foreach($setting as $k=>$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('\'(?!((<.*?)|(<a.*?)|(<strong.*?)))('.$kw.')(?!(([^<>]*?)>)|([^>]*?</a>)|([^>]*?</strong>))\'si', '<span class=highlight>'.$kw.'</span>', $data); |
||||
|
$data = preg_replace('/<span class=highlight>/', '<a name=high></a><span class=highlight>', $data, 1); |
||||
|
echo $data ? $data : $content; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,8 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/include/module.func.php'; |
||||
|
require DT_ROOT.'/module/'.$module.'/global.func.php'; |
||||
|
$table = $DT_PRE.$module.'_'.$moduleid; |
||||
|
$table_data = $DT_PRE.$module.'_data_'.$moduleid; |
||||
|
$table_sign = $DT_PRE.$module.'_sign_'.$moduleid; |
||||
|
?>
|
||||
@ -0,0 +1,285 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
class exhibit { |
||||
|
var $moduleid; |
||||
|
var $itemid; |
||||
|
var $table; |
||||
|
var $table_data; |
||||
|
var $split; |
||||
|
var $fields; |
||||
|
var $errmsg = errmsg; |
||||
|
|
||||
|
function __construct($moduleid) { |
||||
|
global $table, $table_data, $MOD; |
||||
|
$this->moduleid = $moduleid; |
||||
|
$this->table = $table; |
||||
|
$this->table_data = $table_data; |
||||
|
$this->split = $MOD['split']; |
||||
|
$this->fields = array('catid','areaid','level','title','style','fee','introduce','fromtime','totime','city','address','postcode','homepage','hallname','remark','thumb','sponsor','undertaker','truename','addr','telephone','mobile','fax','email','qq','wx','sign','status','hits','username','addtime','editor','edittime','ip','template','linkurl','filepath','note'); |
||||
|
} |
||||
|
|
||||
|
function exhibit($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(!$post['fromtime'] || !is_time($post['fromtime'])) return $this->_(lang('message->pass_exhibit_fromdate')); |
||||
|
if(!$post['totime'] || !is_time($post['totime'])) return $this->_(lang('message->pass_exhibit_todate')); |
||||
|
if(datetotime($post['fromtime']) > datetotime($post['totime'])) return $this->_(lang('message->pass_exhibit_baddate')); |
||||
|
if(!$post['address']) return $this->_(lang('message->pass_exhibit_address')); |
||||
|
if(!$post['hallname']) return $this->_(lang('message->pass_exhibit_hallname')); |
||||
|
if(!$post['sponsor']) return $this->_(lang('message->pass_exhibit_sponsor')); |
||||
|
if(!$post['truename']) return $this->_(lang('message->pass_truename')); |
||||
|
if(!$post['telephone']) return $this->_(lang('message->pass_telephone')); |
||||
|
if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
function set($post) { |
||||
|
global $MOD, $AREA, $_username, $_userid, $_cname; |
||||
|
$AREA or $AREA = cache_read('area.php'); |
||||
|
$post['city'] or $post['city'] = $post['areaid'] ? $AREA[$post['areaid']]['areaname'] : ''; |
||||
|
is_url($post['thumb']) or $post['thumb'] = ''; |
||||
|
$post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; |
||||
|
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? datetotime($post['addtime']) : DT_TIME; |
||||
|
$post['editor'] = $_cname ? $_cname : $_username; |
||||
|
$post['edittime'] = DT_TIME; |
||||
|
$post['fromtime'] = datetotime($post['fromtime']); |
||||
|
$post['totime'] = datetotime($post['totime']); |
||||
|
$post['homepage'] = fix_link($post['homepage']); |
||||
|
$post['sign'] = $post['sign'] ? 1 : 0; |
||||
|
$post['fee'] = dround($post['fee']); |
||||
|
$post['content'] = stripslashes($post['content']); |
||||
|
$post['content'] = save_local($post['content']); |
||||
|
if($MOD['clear_link']) $post['content'] = clear_link($post['content']); |
||||
|
if($MOD['save_remotepic']) $post['content'] = save_remote($post['content']); |
||||
|
if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); |
||||
|
if($this->itemid) { |
||||
|
$new = $post['content']; |
||||
|
if($post['thumb']) $new .= '<img src="'.$post['thumb'].'"/>'; |
||||
|
$r = $this->get_one(); |
||||
|
$old = $r['content']; |
||||
|
if($r['thumb']) $old .= '<img src="'.$r['thumb'].'"/>'; |
||||
|
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['fromdate'] = timetodate($r['fromtime'], 3); |
||||
|
$r['todate'] = timetodate($r['totime'], 3); |
||||
|
$r['alt'] = $r['title']; |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
$r['process'] = get_process($r['fromtime'], $r['totime']); |
||||
|
$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'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')).','.$item['city'].','.$item['sponsor']; |
||||
|
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']) { |
||||
|
$_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; |
||||
|
html_del($_file); |
||||
|
} |
||||
|
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; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,41 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
if($DT_PC) { |
||||
|
if($MOD['index_html']) { |
||||
|
$html_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext']; |
||||
|
if(!is_file($html_file)) tohtml('index', $module); |
||||
|
if(is_file($html_file)) exit(include($html_file)); |
||||
|
} |
||||
|
if(!check_group($_groupid, $MOD['group_index'])) include load('403.inc'); |
||||
|
$maincat = get_maincat(0, $moduleid, 1); |
||||
|
$news_id = intval($MOD['news_id']); |
||||
|
$destoon_task = "moduleid=$moduleid&html=index"; |
||||
|
if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ? 'index.php?page='.$page : ''); |
||||
|
} else { |
||||
|
$condition = "status=3"; |
||||
|
if($cityid) { |
||||
|
$areaid = $cityid; |
||||
|
$ARE = get_area($areaid); |
||||
|
$condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; |
||||
|
} |
||||
|
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition", 'CACHE'); |
||||
|
$items = $r['num']; |
||||
|
$pages = mobile_pages($items, $page, $pagesize); |
||||
|
$tags = array(); |
||||
|
if($items) { |
||||
|
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}", ($CFG['db_expires'] && $page == 1) ? 'CACHE' : '', $CFG['db_expires']); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$r['title'] = set_style($r['title'], $r['style']); |
||||
|
$r['linkurl'] = $MOD['mobile'].$r['linkurl']; |
||||
|
$tags[] = $r; |
||||
|
} |
||||
|
$db->free_result($result); |
||||
|
$js_load = $MOD['mobile'].'search.php?job=ajax'; |
||||
|
} |
||||
|
$head_title = $head_name = $MOD['name']; |
||||
|
} |
||||
|
$seo_file = 'index'; |
||||
|
include DT_ROOT.'/include/seo.inc.php'; |
||||
|
include template($MOD['template_index'] ? $MOD['template_index'] : 'index', $module); |
||||
|
?>
|
||||
@ -0,0 +1,71 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if(!$MOD['show_html'] || !$itemid) return false; |
||||
|
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); |
||||
|
if(!$item || $item['status'] < 3) 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']; |
||||
|
if($content) { |
||||
|
if($MOD['keylink']) $content = DC::keylink($content, $moduleid); |
||||
|
if($lazy) $content = DC::lazy($content); |
||||
|
$content = DC::format($content, 1); |
||||
|
} |
||||
|
$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); |
||||
|
} |
||||
|
$process = get_process($fromtime, $totime); |
||||
|
$fromdate = timetodate($fromtime, 3); |
||||
|
$todate = timetodate($totime, 3); |
||||
|
$adddate = timetodate($addtime, 3); |
||||
|
$editdate = timetodate($edittime, 3); |
||||
|
$fileurl = $linkurl; |
||||
|
$linkurl = $MOD['linkurl'].$linkurl; |
||||
|
$maincat = get_maincat(0, $moduleid); |
||||
|
$fee = DC::fee($item['fee'], $MOD['fee_view']); |
||||
|
if($fee) { |
||||
|
$description = DC::description($content, $MOD['pre_view']); |
||||
|
$user_status = 4; |
||||
|
} else { |
||||
|
$user_status = 3; |
||||
|
} |
||||
|
$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')); |
||||
|
$destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid"; |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); |
||||
|
$DT_PC = $GLOBALS['DT_PC'] = 1; |
||||
|
ob_start(); |
||||
|
include template($template, $module); |
||||
|
$data = ob_get_contents(); |
||||
|
ob_clean(); |
||||
|
$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.$fileurl; |
||||
|
if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); |
||||
|
file_put($filename, $data); |
||||
|
if($EXT['mobile_enable']) { |
||||
|
include DT_ROOT.'/include/mobile.htm.php'; |
||||
|
$head_pc = $linkurl; |
||||
|
$could_sign = ($sign && $process == 1 && $user_status == 3 && $username) ? 1 : 0; |
||||
|
$head_title = $head_name = $CAT['catname']; |
||||
|
$js_item = 1; |
||||
|
$foot = ''; |
||||
|
if($_content) { |
||||
|
$content = $_content; |
||||
|
if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); |
||||
|
$content = DC::format($content, 0); |
||||
|
} |
||||
|
ob_start(); |
||||
|
include template($template, $module); |
||||
|
$data = ob_get_contents(); |
||||
|
ob_clean(); |
||||
|
file_put(str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename), $data); |
||||
|
} |
||||
|
return true; |
||||
|
?>
|
||||
@ -0,0 +1,71 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if($DT_BOT) dhttp(403); |
||||
|
$itemid or dheader($MOD['linkurl']); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
include load('misc.lang'); |
||||
|
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); |
||||
|
$item or message($L['not_exists']); |
||||
|
if($item['fromtime'] && $DT_TIME > $item['fromtime']) message($L['has_started']); |
||||
|
if($item['totime'] && $DT_TIME > $item['totime']) message($L['has_expired']); |
||||
|
$item['status'] == 3 or message($L['not_exists']); |
||||
|
$item['username'] or message($L['com_not_member']); |
||||
|
$_username != $item['username'] or message($L['sign_self']); |
||||
|
|
||||
|
$today = $DT_TODAY - 86400; |
||||
|
$sql = $_userid ? "username='$_username'" : "addtime>$today AND ip='$DT_IP'"; |
||||
|
$t = $db->get_one("SELECT id FROM {$table_sign} WHERE id=$itemid AND $sql"); |
||||
|
if($t) message($L['sign_again']); |
||||
|
|
||||
|
$linkurl = $MOD['linkurl'].$item['linkurl']; |
||||
|
$need_captcha = $MOD['captcha_sign'] == 2 ? $MG['captcha'] : $MOD['captcha_sign']; |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
|
||||
|
if($submit) { |
||||
|
captcha($captcha, $need_captcha); |
||||
|
$amount = intval($amount); |
||||
|
if($amount < 1) $amount = 1; |
||||
|
$company = dhtmlspecialchars($company); |
||||
|
$truename = dhtmlspecialchars($truename); |
||||
|
if(strlen($truename) < 6) message($L['msg_type_truename']); |
||||
|
if(!is_mobile($mobile)) message($L['msg_type_mobile']); |
||||
|
$areaid = intval($areaid); |
||||
|
$address = dhtmlspecialchars($address); |
||||
|
preg_match("/^[0-9]{6}$/", $postcode) or $postcode = ''; |
||||
|
is_email($email) or $email = ''; |
||||
|
is_qq($qq) or $qq = ''; |
||||
|
is_wx($wx) or $wx = ''; |
||||
|
$content = dhtmlspecialchars($content); |
||||
|
$user = $item['username']; |
||||
|
$title = addslashes($item['title']); |
||||
|
$db->query("INSERT INTO {$table_sign} (id,user,title,amount,company,truename,mobile,areaid,address,postcode,email,qq,wx,content,addtime,username,ip) VALUES ('$itemid','$user','$title','$amount','$company','$truename','$mobile','$areaid','$address','$postcode','$email','$qq','$wx','$content','$DT_TIME','$_username','$DT_IP')"); |
||||
|
$db->query("UPDATE {$table} SET orders=orders+1 WHERE itemid=$itemid"); |
||||
|
$forward = $DT_PC ? $linkurl : str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); |
||||
|
message($L['msg_sign_success'], $forward, 3); |
||||
|
} |
||||
|
if($_userid) { |
||||
|
$user = userinfo($_username); |
||||
|
$company = $user['company']; |
||||
|
$truename = $user['truename']; |
||||
|
$mobile = $user['mobile']; |
||||
|
$areaid = $user['areaid']; |
||||
|
$address = $user['address']; |
||||
|
$postcode = $user['postcode']; |
||||
|
$email = $user['mail'] ? $user['mail'] : $user['email']; |
||||
|
$qq = $user['qq']; |
||||
|
$wx = $user['wx']; |
||||
|
} else { |
||||
|
$company = $truename = $mobile = $areaid = $address = $postcode = $email = $qq = $wx = ''; |
||||
|
} |
||||
|
$head_title = $L['sign_title']; |
||||
|
if($DT_PC) { |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); |
||||
|
} else { |
||||
|
$forward = $MOD['mobile'].$item['linkurl']; |
||||
|
$head_name = $L['sign_title']; |
||||
|
if($sns_app) $seo_title = $MOD['name']; |
||||
|
$js_pull = 0; |
||||
|
$foot = ''; |
||||
|
} |
||||
|
include template($MOD['template_sign'] ? $MOD['template_sign'] : 'sign', $module); |
||||
|
?>
|
||||
@ -0,0 +1,107 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/comment.class.php'; |
||||
|
$do = new comment(); |
||||
|
$menus = array ( |
||||
|
array('评论禁止', '?moduleid='.$moduleid.'&file='.$file.'&action=ban'), |
||||
|
array('评论列表', '?moduleid='.$moduleid.'&file='.$file), |
||||
|
array('评论审核', '?moduleid='.$moduleid.'&file='.$file.'&action=check'), |
||||
|
array('模块设置', 'javascript:Dwidget(\'?moduleid='.$moduleid.'&file=setting&action='.$file.'\', \'模块设置\');'), |
||||
|
); |
||||
|
$this_forward = '?moduleid='.$moduleid.'&file='.$file; |
||||
|
if(in_array($action, array('', 'check'))) { |
||||
|
$sfields = array('内容', '原文标题', '会员名', '昵称', 'IP'); |
||||
|
$dfields = array('content', 'item_title', 'username', 'passport', 'ip'); |
||||
|
$sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '回复时间降序', '回复时间升序', '引用次数降序', '引用次数升序', '支持次数降序', '支持次数升序', '反对次数降序', '反对次数升序', '举报次数降序', '举报次数升序', '评分高低降序', '评分高低升序'); |
||||
|
$dorder = array('itemid desc', 'addtime DESC', 'addtime ASC', 'replytime DESC', 'replytime ASC', 'quotes DESC', 'quotes ASC', 'likes DESC', 'likes ASC', 'hates DESC', 'hates ASC', 'reports DESC', 'reports ASC', 'star DESC', 'star ASC'); |
||||
|
$sstar = $L['star_type']; |
||||
|
|
||||
|
isset($fields) && isset($dfields[$fields]) or $fields = 0; |
||||
|
isset($order) && isset($dorder[$order]) or $order = 0; |
||||
|
isset($star) && isset($sstar[$star]) or $star = 0; |
||||
|
isset($ip) or $ip = ''; |
||||
|
$level = isset($level) ? intval($level) : 0; |
||||
|
(isset($fromdate) && is_time($fromdate)) or $fromdate = ''; |
||||
|
$fromtime = $fromdate ? datetotime($fromdate) : 0; |
||||
|
(isset($todate) && is_time($todate)) or $todate = ''; |
||||
|
$totime = $todate ? datetotime($todate) : 0; |
||||
|
$qid = isset($qid) ? intval($qid) : 0; |
||||
|
$qid or $qid = ''; |
||||
|
$itemid or $itemid = ''; |
||||
|
|
||||
|
$fields_select = dselect($sfields, 'fields', '', $fields); |
||||
|
$module_select = module_select('mid', '模块', $mid); |
||||
|
$order_select = dselect($sorder, 'order', '', $order); |
||||
|
$level_select = level_select('level', '级别', $level, 'all'); |
||||
|
$star_select = dselect($sstar, 'star', '', $star); |
||||
|
|
||||
|
$condition = ''; |
||||
|
if($keyword) $condition .= in_array($dfields[$fields], array('item_id', 'itemid', 'ip')) ? " AND $dfields[$fields]='$kw'" : match_kw($dfields[$fields], $keyword); |
||||
|
if($mid) $condition .= " AND item_mid='$mid'"; |
||||
|
if($itemid) $condition .= " AND item_id='$itemid'"; |
||||
|
if($qid) $condition .= " AND qid='$qid'"; |
||||
|
if($ip) $condition .= " AND ip='$ip'"; |
||||
|
if($star) $condition .= " AND star='$star'"; |
||||
|
if($level) $condition .= $level > 9 ? " AND level>0" : " AND level=$level"; |
||||
|
if($fromtime) $condition .= " AND addtime>=$fromtime"; |
||||
|
if($totime) $condition .= " AND addtime<=$totime"; |
||||
|
} |
||||
|
switch($action) { |
||||
|
case 'edit': |
||||
|
$itemid or msg(); |
||||
|
$do->itemid = $itemid; |
||||
|
if($submit) { |
||||
|
if($do->pass($post)) { |
||||
|
$do->edit($post); |
||||
|
dmsg('修改成功', $forward); |
||||
|
} else { |
||||
|
msg($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
extract($do->get_one()); |
||||
|
$menuid = $status == 2 ? 2 : 1; |
||||
|
$addtime = timetodate($addtime); |
||||
|
$replytime = timetodate($replytime); |
||||
|
include tpl('comment_edit', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'ban': |
||||
|
if($submit) { |
||||
|
$do->ban_update($post); |
||||
|
dmsg('保存成功', '?moduleid='.$moduleid.'&file='.$file.'&action=ban&page='.$page); |
||||
|
} else { |
||||
|
$condition = 1; |
||||
|
if($mid) $condition = "moduleid=$mid"; |
||||
|
$lists = $do->get_ban_list($condition); |
||||
|
include tpl('comment_ban', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'delete': |
||||
|
$itemid or msg('请选择评论'); |
||||
|
$do->delete($itemid); |
||||
|
dmsg('删除成功', $forward); |
||||
|
break; |
||||
|
case 'level': |
||||
|
$itemid or msg('请选择评论'); |
||||
|
$level = intval($level); |
||||
|
$do->level($itemid, $level); |
||||
|
dmsg('级别设置成功', $forward); |
||||
|
break; |
||||
|
case 'check': |
||||
|
if($itemid) { |
||||
|
$status = $status == 3 ? 3 : 2; |
||||
|
$do->check($itemid, $status); |
||||
|
dmsg($status == 3 ? '审核成功' : '取消成功', $forward); |
||||
|
} else { |
||||
|
$lists = $do->get_list('status=2'.$condition, $dorder[$order]); |
||||
|
$menuid = 2; |
||||
|
include tpl('comment', $module); |
||||
|
} |
||||
|
break; |
||||
|
default: |
||||
|
$lists = $do->get_list('status=3'.$condition, $dorder[$order]); |
||||
|
$menuid = 1; |
||||
|
include tpl('comment', $module); |
||||
|
break; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,161 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$TYPE = get_type('gift', 1); |
||||
|
require DT_ROOT.'/module/'.$module.'/gift.class.php'; |
||||
|
$do = new gift(); |
||||
|
$menus = array ( |
||||
|
array('添加礼品', '?moduleid='.$moduleid.'&file='.$file.'&action=add'), |
||||
|
array('礼品列表', '?moduleid='.$moduleid.'&file='.$file), |
||||
|
array('订单列表', '?moduleid='.$moduleid.'&file='.$file.'&action=order'), |
||||
|
array('更新地址', '?moduleid='.$moduleid.'&file='.$file.'&action=html'), |
||||
|
array('礼品分类', 'javascript:Dwidget(\'?file=type&item='.$file.'\', \'礼品分类\');'), |
||||
|
array('模块设置', 'javascript:Dwidget(\'?moduleid='.$moduleid.'&file=setting&action='.$file.'\', \'模块设置\');'), |
||||
|
); |
||||
|
if($_catids || $_areaids) require DT_ROOT.'/admin/admin_check.inc.php'; |
||||
|
switch($action) { |
||||
|
case 'add': |
||||
|
if($submit) { |
||||
|
if($do->pass($post)) { |
||||
|
$do->add($post); |
||||
|
dmsg('添加成功', $forward); |
||||
|
} else { |
||||
|
msg($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
foreach($do->fields as $v) { |
||||
|
isset($$v) or $$v = ''; |
||||
|
} |
||||
|
$maxorder = 1; |
||||
|
$groupid = '5,6,7'; |
||||
|
$addtime = timetodate($DT_TIME); |
||||
|
$typeid = 0; |
||||
|
$menuid = 0; |
||||
|
include tpl('gift_edit', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'edit': |
||||
|
$itemid or msg(); |
||||
|
$do->itemid = $itemid; |
||||
|
if($submit) { |
||||
|
if($do->pass($post)) { |
||||
|
$do->edit($post); |
||||
|
dmsg('修改成功', $forward); |
||||
|
} else { |
||||
|
msg($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
extract($do->get_one()); |
||||
|
$addtime = timetodate($addtime); |
||||
|
$fromtime = $fromtime ? timetodate($fromtime) : ''; |
||||
|
$totime = $totime ? timetodate($totime) : ''; |
||||
|
$menuid = 1; |
||||
|
include tpl('gift_edit', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'html': |
||||
|
$all = (isset($all) && $all) ? 1 : 0; |
||||
|
$one = (isset($one) && $one) ? 1 : 0; |
||||
|
if(!isset($num)) { |
||||
|
$num = 50; |
||||
|
} |
||||
|
if(!isset($fid)) { |
||||
|
$r = $db->get_one("SELECT min(itemid) AS fid FROM {$DT_PRE}gift"); |
||||
|
$fid = $r['fid'] ? $r['fid'] : 0; |
||||
|
} |
||||
|
isset($sid) or $sid = $fid; |
||||
|
if(!isset($tid)) { |
||||
|
$r = $db->get_one("SELECT max(itemid) AS tid FROM {$DT_PRE}gift"); |
||||
|
$tid = $r['tid'] ? $r['tid'] : 0; |
||||
|
} |
||||
|
if($fid <= $tid) { |
||||
|
$result = $db->query("SELECT itemid,linkurl FROM {$DT_PRE}gift WHERE itemid>=$fid ORDER BY itemid LIMIT 0,$num"); |
||||
|
if($db->affected_rows($result)) { |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$itemid = $r['itemid']; |
||||
|
$linkurl = $do->linkurl($itemid); |
||||
|
if($linkurl != $r['linkurl']) $db->query("UPDATE {$DT_PRE}gift SET linkurl='$linkurl' WHERE itemid=$itemid"); |
||||
|
} |
||||
|
$itemid += 1; |
||||
|
} else { |
||||
|
$itemid = $fid + $num; |
||||
|
} |
||||
|
} else { |
||||
|
if($all) dheader("?moduleid=3&file=vote&action=html&all=1&one=$one"); |
||||
|
dmsg('更新成功', "?moduleid=$moduleid&file=$file"); |
||||
|
} |
||||
|
msg('ID从'.$fid.'至'.($itemid-1).'[礼品]更新成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$itemid&tid=$tid&num=$num&all=$all&one=$one"); |
||||
|
break; |
||||
|
case 'delete': |
||||
|
$itemid or msg('请选择礼品'); |
||||
|
$do->delete($itemid); |
||||
|
dmsg('删除成功', $forward); |
||||
|
break; |
||||
|
case 'level': |
||||
|
$itemid or msg('请选择礼品'); |
||||
|
$level = intval($level); |
||||
|
$do->level($itemid, $level); |
||||
|
dmsg('级别设置成功', $forward); |
||||
|
break; |
||||
|
case 'order': |
||||
|
if($submit) { |
||||
|
$do->update_order($post); |
||||
|
dmsg('删除成功', $forward); |
||||
|
} else { |
||||
|
$sfields = array('按条件', '礼品', '会员名', '快递', '单号', '状态', '备注'); |
||||
|
$dfields = array('g.title','g.title','o.username','o.express','o.expressid','o.status','o.note'); |
||||
|
isset($fields) && isset($dfields[$fields]) or $fields = 0; |
||||
|
isset($datetype) && in_array($datetype, array('edittime', 'addtime')) or $datetype = 'edittime'; |
||||
|
(isset($fromdate) && is_time($fromdate)) or $fromdate = ''; |
||||
|
$fromtime = $fromdate ? datetotime($fromdate) : 0; |
||||
|
(isset($todate) && is_time($todate)) or $todate = ''; |
||||
|
$totime = $todate ? datetotime($todate) : 0; |
||||
|
$fields_select = dselect($sfields, 'fields', '', $fields); |
||||
|
$condition = "1"; |
||||
|
if($itemid) $condition .= " AND o.itemid=$itemid"; |
||||
|
if($keyword) $condition .= match_kw($dfields[$fields], $keyword); |
||||
|
if($fromtime) $condition .= " AND o.`{$datetype}`>=$fromtime"; |
||||
|
if($totime) $condition .= " AND o.`{$datetype}`<=$totime"; |
||||
|
$lists = $do->get_list_order($condition); |
||||
|
include tpl('gift_order', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'order_show': |
||||
|
$itemid or msg(); |
||||
|
$do->itemid = $itemid; |
||||
|
if($submit) { |
||||
|
$do->update_order($post); |
||||
|
dmsg('保存成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&itemid='.$itemid); |
||||
|
} else { |
||||
|
extract($do->get_one_order()); |
||||
|
$itemid = $oid; |
||||
|
$_MOD = cache_read('module-2.php'); |
||||
|
$send_types = explode('|', trim($_MOD['send_types'])); |
||||
|
$addtime = timetodate($addtime); |
||||
|
$menuid = 2; |
||||
|
include tpl('gift_order_show', $module); |
||||
|
} |
||||
|
break; |
||||
|
default: |
||||
|
$sfields = array('按条件', '标题', '内容'); |
||||
|
$dfields = array('title','title','content'); |
||||
|
$sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '订单数量降序', '订单数量升序', '浏览次数降序', '浏览次数升序', '开始时间降序', '开始时间升序', '到期时间降序', '到期时间升序', '礼品积分降序', '礼品积分升序', '库存数量降序', '库存数量升序'); |
||||
|
$dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'orders DESC', 'orders ASC', 'hits DESC', 'hits ASC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC', 'credit DESC', 'credit ASC', 'amount DESC', 'amount ASC'); |
||||
|
isset($fields) && isset($dfields[$fields]) or $fields = 0; |
||||
|
isset($order) && isset($dorder[$order]) or $order = 0; |
||||
|
isset($typeid) or $typeid = 0; |
||||
|
$level = isset($level) ? intval($level) : 0; |
||||
|
$fields_select = dselect($sfields, 'fields', '', $fields); |
||||
|
$type_select = type_select('gift', 1, 'typeid', '请选择分类', $typeid); |
||||
|
$order_select = dselect($sorder, 'order', '', $order); |
||||
|
$level_select = level_select('level', '级别', $level, 'all'); |
||||
|
$condition = '1'; |
||||
|
if($_areaids) $condition .= " AND areaid IN (".$_areaids.")";//CITY
|
||||
|
if($keyword) $condition .= match_kw($dfields[$fields], $keyword); |
||||
|
if($typeid) $condition .= " AND typeid IN (".type_child($typeid, $TYPE).")"; |
||||
|
if($level) $condition .= $level > 9 ? " AND level>0" : " AND level=$level"; |
||||
|
if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; |
||||
|
$lists = $do->get_list($condition, $dorder[$order]); |
||||
|
include tpl('gift', $module); |
||||
|
break; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,75 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/guestbook.class.php'; |
||||
|
$do = new guestbook(); |
||||
|
$menus = array ( |
||||
|
array('留言列表', '?moduleid='.$moduleid.'&file='.$file), |
||||
|
array('模块设置', 'javascript:Dwidget(\'?moduleid='.$moduleid.'&file=setting&action='.$file.'\', \'模块设置\');'), |
||||
|
); |
||||
|
if($_catids || $_areaids) require DT_ROOT.'/admin/admin_check.inc.php'; |
||||
|
if(in_array($action, array('', 'check'))) { |
||||
|
$sfields = array('按条件', '留言标题', '会员名', '联系人', '联系电话', '电子邮件', 'QQ', '微信', '阿里旺旺', 'Skype', '留言IP', '留言内容', '回复内容'); |
||||
|
$dfields = array('title','title','username','truename','telephone','email','qq','wx','ali','skype','ip','content','reply'); |
||||
|
$sorder = array('结果排序方式', '留言时间降序', '留言时间升序', '回复时间降序', '回复时间升序'); |
||||
|
$dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC'); |
||||
|
|
||||
|
isset($fields) && isset($dfields[$fields]) or $fields = 0; |
||||
|
isset($order) && isset($dorder[$order]) or $order = 0; |
||||
|
isset($datetype) && in_array($datetype, array('edittime', 'addtime')) or $datetype = 'addtime'; |
||||
|
(isset($fromdate) && is_time($fromdate)) or $fromdate = ''; |
||||
|
$fromtime = $fromdate ? datetotime($fromdate) : 0; |
||||
|
(isset($todate) && is_time($todate)) or $todate = ''; |
||||
|
$totime = $todate ? datetotime($todate) : 0; |
||||
|
$tid = isset($tid) ? intval($tid) : 0; |
||||
|
$rid = isset($rid) ? intval($rid) : 0; |
||||
|
$tid or $tid = ''; |
||||
|
$rid or $rid = ''; |
||||
|
|
||||
|
$fields_select = dselect($sfields, 'fields', '', $fields); |
||||
|
$order_select = dselect($sorder, 'order', '', $order); |
||||
|
$module_select = module_select('mid', '模块', $mid, '', '1,2'); |
||||
|
|
||||
|
$condition = '1'; |
||||
|
if($_areaids) $condition .= " AND areaid IN (".$_areaids.")";//CITY
|
||||
|
if($keyword) $condition .= match_kw($dfields[$fields], $keyword); |
||||
|
if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; |
||||
|
if($fromtime) $condition .= " AND `$datetype`>=$fromtime"; |
||||
|
if($totime) $condition .= " AND `$datetype`<=$totime"; |
||||
|
if($mid) $condition .= " AND mid='$mid'"; |
||||
|
if($tid) $condition .= " AND tid='$tid'"; |
||||
|
if($rid) $condition .= " AND rid='$rid'"; |
||||
|
} |
||||
|
switch($action) { |
||||
|
case 'edit': |
||||
|
$itemid or msg(); |
||||
|
$do->itemid = $itemid; |
||||
|
if($submit) { |
||||
|
if($do->pass($post)) { |
||||
|
$do->edit($post); |
||||
|
dmsg('修改成功', $forward); |
||||
|
} else { |
||||
|
msg($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
extract($do->get_one()); |
||||
|
$addtime = timetodate($addtime); |
||||
|
$edittime = timetodate($edittime); |
||||
|
include tpl('guestbook_edit', $module); |
||||
|
} |
||||
|
break; |
||||
|
case 'check': |
||||
|
$itemid or msg('请选择留言'); |
||||
|
$do->check($itemid, $status); |
||||
|
dmsg('设置成功', $forward); |
||||
|
break; |
||||
|
case 'delete': |
||||
|
$itemid or msg('请选择留言'); |
||||
|
$do->delete($itemid); |
||||
|
dmsg('删除成功', $forward); |
||||
|
break; |
||||
|
default: |
||||
|
$lists = $do->get_list($condition, $dorder[$order]); |
||||
|
include tpl('guestbook', $module); |
||||
|
break; |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,17 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$menu = array( |
||||
|
array('排名推广', '?moduleid=3&file=spread'), |
||||
|
array('广告管理', '?moduleid=3&file=ad'), |
||||
|
array('公告管理', '?moduleid=3&file=announce'), |
||||
|
array('单页管理', '?moduleid=3&file=webpage'), |
||||
|
array('友情链接', '?moduleid=3&file=link'), |
||||
|
array('评论管理', '?moduleid=3&file=comment'), |
||||
|
array('留言管理', '?moduleid=3&file=guestbook'), |
||||
|
array('积分换礼', '?moduleid=3&file=gift'), |
||||
|
array('投票管理', '?moduleid=3&file=vote'), |
||||
|
array('票选管理', '?moduleid=3&file=poll'), |
||||
|
array('表单管理', '?moduleid=3&file=form'), |
||||
|
array('模块设置', '?moduleid=3&file=setting'), |
||||
|
); |
||||
|
?>
|
||||
@ -0,0 +1,31 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
$tab = isset($tab) ? intval($tab) : 0; |
||||
|
$all = isset($all) ? intval($all) : 0; |
||||
|
if($submit) { |
||||
|
foreach($setting as $k=>$v) { |
||||
|
if(strpos($k, '_domain') !== false && $v) $setting[$k] = fix_domain($v); |
||||
|
} |
||||
|
update_setting($moduleid, $setting); |
||||
|
cache_module($moduleid); |
||||
|
if($setting['show_url'] != $MOD['show_url']) { |
||||
|
msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html'); |
||||
|
} |
||||
|
dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); |
||||
|
} else { |
||||
|
$GROUP = cache_read('group.php'); |
||||
|
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('\'(?!((<.*?)|(<a.*?)|(<strong.*?)))('.$kw.')(?!(([^<>]*?)>)|([^>]*?</a>)|([^>]*?</strong>))\'si', '<span class=highlight>'.$kw.'</span>', $data); |
||||
|
$data = preg_replace('/<span class=highlight>/', '<a name=high></a><span class=highlight>', $data, 1); |
||||
|
echo $data ? $data : $content; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,93 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menusad); |
||||
|
?>
|
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<input type="hidden" name="job" value="<?php echo $job;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<?php echo $type_select;?>
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&job=<?php echo $job;?>&pid=<?php echo $pid ? $pid : 0;?>');"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<select name="datetype"> |
||||
|
<option value="totime" <?php if($datetype == 'totime') echo 'selected';?>>结束时间</option>
|
||||
|
<option value="fromtime" <?php if($datetype == 'fromtime') echo 'selected';?>>开始时间</option>
|
||||
|
<option value="addtime" <?php if($datetype == 'addtime') echo 'selected';?>>添加时间</option>
|
||||
|
<option value="edittime" <?php if($datetype == 'edittime') echo 'selected';?>>修改时间</option>
|
||||
|
</select> |
||||
|
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>
|
||||
|
<?php echo ajax_area_select('areaid', '地区(分站)', $areaid);?>
|
||||
|
<input type="text" name="pid" value="<?php echo $pid;?>" size="8" class="t_c" title="广告位ID" placeholder="广告位ID"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th width="40">排序</th> |
||||
|
<th data-hide-1200="1" data-hide-1400="1">ID</th> |
||||
|
<?php if($pid == 0) { ?>
|
||||
|
<th>广告类型</th> |
||||
|
<?php } ?>
|
||||
|
<th>广告名称</th> |
||||
|
<th data-hide-1200="1"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">费用 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th data-hide-1200="1">单位</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 9 ? 10 : 9;?>');">点击 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 10 ? 'asc' : ($order == 9 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th data-hide-1200="1"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');">开始时间 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">结束时间 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th data-hide-1200="1"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 8 ? 7 : 8;?>');">剩余(天) <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th>状态</th> |
||||
|
<th data-hide-1200="1">审核</th> |
||||
|
<th data-hide-1200="1">会员</th> |
||||
|
<th width="80">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center"> |
||||
|
<td><input type="checkbox" name="aids[]" value="<?php echo $v['aid'];?>"/></td> |
||||
|
<td><input type="text" size="2" name="listorder[<?php echo $v['aid'];?>]" value="<?php echo $v['listorder'];?>"/></td> |
||||
|
<td data-hide-1200="1" data-hide-1400="1"><?php echo $v['aid'];?></td>
|
||||
|
<?php if($pid == 0) { ?>
|
||||
|
<td><a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&job=<?php echo $job;?>&typeid=<?php echo $v['typeid'];?>"><?php echo $TYPE[$v['typeid']];?></a></td>
|
||||
|
<?php } ?>
|
||||
|
<td align="left" title="编辑:<?php echo $v['editor'];?> 添加时间:<<?php echo $v['adddate'];?> 更新时间:<?php echo $v['editdate'];?>"> <a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&aid=<?php echo $v['aid'];?>&pid=<?php echo $v['pid'];?>"><?php echo $v['title'];?></a></td>
|
||||
|
<td data-hide-1200="1" class="f_red"><?php echo $v['amount'];?></td>
|
||||
|
<td data-hide-1200="1"><?php echo $v['currency'] == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?></td>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=stats&pid=<?php echo $v['pid'];?>&aid=<?php echo $v['aid'];?>', '[<?php echo $v['title'];?>] 点击记录');"><?php echo $v['hits'];?></a></td>
|
||||
|
<td data-hide-1200="1"><a href="javascript:;" onclick="Dq('datetype','fromtime',0);Dq('date',this.innerHTML);"><?php echo $v['fromdate'];?></a></td>
|
||||
|
<td><a href="javascript:;" onclick="Dq('datetype','totime',0);Dq('date',this.innerHTML);"><?php echo $v['todate'];?></a></td>
|
||||
|
<td data-hide-1200="1"<?php if($v['days']<5) echo ' class="f_red"';?>><?php echo $v['days'];?></td>
|
||||
|
<td><?php echo $v['process'];?></td>
|
||||
|
<td data-hide-1200="1"><?php echo $v['status']==3 ? '已通过' : '<span class="f_red">待审核</span>';?></td>
|
||||
|
<td data-hide-1200="1"><a href="javascript:_user('<?php echo $v['username'];?>');"><?php echo $v['username'];?></a></td>
|
||||
|
<td> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=view&aid=<?php echo $v['aid'];?>" target="_blank"/><img src="admin/image/view.png" width="16" height="16" title="预览此广告" alt=""></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&aid=<?php echo $v['aid'];?>&pid=<?php echo $v['pid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&aids=<?php echo $v['aid'];?>&pid=<?php echo $v['pid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<div class="btns"> |
||||
|
<input type="submit" value="更新排序" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=order_ad&pid=<?php echo $pid;?>';"/> |
||||
|
<input type="submit" value="删 除" class="btn-r" onclick="if(confirm('确定要删除选中广告吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&pid=<?php echo $pid;?>'}else{return false;}"/> |
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<br/> |
||||
|
<script type="text/javascript">Menuon(<?php echo $job == 'check' ? 2 : 1;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,25 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include template('header'); |
||||
|
?>
|
||||
|
<div class="m"> |
||||
|
<br/> |
||||
|
<table width="800" cellpadding="5" cellspacing="3" align="center"> |
||||
|
<tr> |
||||
|
<td bgcolor="#E3EEF5" class="px14 f_b">代码预览</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><?php echo $codes;?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td bgcolor="#E3EEF5" class="px14"><span class="f_r"><a href="javascript:window.close();">[关闭窗口]</a> </span><strong>源代码</strong></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td><textarea style="width:100%;height:200px;font-family:Fixedsys,verdana;overflow:visible;"><?php echo $codes;?></textarea></td>
|
||||
|
</tr> |
||||
|
</table> |
||||
|
<br/> |
||||
|
</div> |
||||
|
<?php |
||||
|
include template('footer'); |
||||
|
?>
|
||||
@ -0,0 +1,50 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<input type="hidden" name="page" value="<?php echo $page;?>"/> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="40"><input type="checkbox" onclick="checkall(this.form);" title="全选/反选"/></th> |
||||
|
<th>模块ID</th> |
||||
|
<th>信息ID</th> |
||||
|
<th>模块</th> |
||||
|
<th>禁止时间</th> |
||||
|
<th>操作人</th> |
||||
|
<th>原文</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) { ?>
|
||||
|
<tr align="center"> |
||||
|
<td><input name="post[<?php echo $v['bid'];?>][delete]" type="checkbox" value="1"/></td> |
||||
|
<td><input name="post[<?php echo $v['bid'];?>][moduleid]" type="text" size="10" value="<?php echo $v['moduleid'];?>"/></td> |
||||
|
<td><input name="post[<?php echo $v['bid'];?>][itemid]" type="text" size="10" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td><a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&mid=<?php echo $v['moduleid'];?>"><?php echo isset($MODULE[$v['moduleid']]) ? $MODULE[$v['moduleid']]['name'] : '其他';?></a></td>
|
||||
|
<td><?php echo $v['edittime'];?></td>
|
||||
|
<td><?php echo $v['editor'];?></td>
|
||||
|
<td><a href="<?php echo DT_PATH;?>api/redirect.php?itemid=<?php echo $v['itemid'];?>&mid=<?php echo $v['moduleid'];?>" target="_blank" class="t">打开</a></td> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php } ?>
|
||||
|
<tr align="center"> |
||||
|
<td class="f_green">新增</td> |
||||
|
<td><?php echo module_select('post[0][moduleid]', '模块');?></td>
|
||||
|
<td><input name="post[0][itemid]" type="text" size="10" value=""/></td> |
||||
|
<td colspan="4"> </td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td></td> |
||||
|
<td height="30" colspan="7"> |
||||
|
<input type="submit" name="submit" value="保 存" onclick="if($(':checkbox:checked').length && !confirm('确定要删除'+$(':checkbox:checked').length+'个选中项吗?此操作将不可撤销')) return false;" class="btn-g"/> |
||||
|
<input type="submit" name="submit" value="删 除" onclick="if($(':checkbox:checked').length){if(!confirm('确定要删除'+$(':checkbox:checked').length+'个选中项吗?此操作将不可撤销')) return false;}else{confirm('请选择要删除的项目');return false;}" class="btn-r"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<script type="text/javascript">Menuon(0);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,66 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?" id="dform"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<input type="hidden" name="itemid" value="<?php echo $itemid;?>"/> |
||||
|
<input type="hidden" name="forward" value="<?php echo $forward;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 会员</td> |
||||
|
<td><a href="javascript:_user('<?php echo $username;?>');" class="t"><?php echo $username ? $passport : 'Guest';?></a> <input type="checkbox" name="post[hidden]" value="1" <?php if($hidden) echo 'checked';?>/> 匿名评论</td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> IP</td> |
||||
|
<td><?php echo $ip;?> - <?php echo ip2area($ip);?> </td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 原文</td> |
||||
|
<td><a href="<?php echo DT_PATH;?>api/redirect.php?mid=<?php echo $item_mid;?>&itemid=<?php echo $item_id;?>" target="_blank" class="t"><?php echo $item_title;?></a></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 引用</td> |
||||
|
<td><textarea name="post[quotation]" id="quotation" rows="8" cols="70"><?php echo $quotation;?></textarea><br/>请不要修改代码结构,仅可修改文字内容</td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 评分</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[star]" value="5" id="star_5"<?php echo $star == 5 ? ' checked' : '';?>/><label for="star_5"> <img src="<?php echo DT_STATIC;?>file/image/star5.gif" width="60" height="12" alt="" align="absmiddle"/></label>
|
||||
|
<input type="radio" name="post[star]" value="4" id="star_4"<?php echo $star == 4 ? ' checked' : '';?>/><label for="star_4"> <img src="<?php echo DT_STATIC;?>file/image/star4.gif" width="60" height="12" alt="" align="absmiddle"/></label>
|
||||
|
<input type="radio" name="post[star]" value="3" id="star_3"<?php echo $star == 3 ? ' checked' : '';?>/><label for="star_3"> <img src="<?php echo DT_STATIC;?>file/image/star3.gif" width="60" height="12" alt="" align="absmiddle"/></label>
|
||||
|
<input type="radio" name="post[star]" value="2" id="star_2"<?php echo $star == 2 ? ' checked' : '';?>/><label for="star_2"> <img src="<?php echo DT_STATIC;?>file/image/star2.gif" width="60" height="12" alt="" align="absmiddle"/></label>
|
||||
|
<input type="radio" name="post[star]" value="1" id="star_1"<?php echo $star == 1 ? ' checked' : '';?>/><label for="star_1"> <img src="<?php echo DT_STATIC;?>file/image/star1.gif" width="60" height="12" alt="" align="absmiddle"/></label>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 内容</td> |
||||
|
<td><textarea name="post[content]" id="content" rows="8" cols="70"><?php echo $content;?></textarea></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 级别</td> |
||||
|
<td><?php echo level_select('post[level]', '级别', $level);?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 回复</td> |
||||
|
<td><textarea name="post[reply]" id="reply" rows="8" cols="70"><?php echo $reply;?></textarea></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 时间</td> |
||||
|
<td><?php echo dcalendar('post[replytime]', $replytime, '-', 1);?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 状态</td> |
||||
|
<td> |
||||
|
<input type="radio" name="post[status]" value="3" <?php if($status == 3) echo 'checked';?>/> 通过
|
||||
|
<input type="radio" name="post[status]" value="2" <?php if($status == 2) echo 'checked';?>/> 待审
|
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<div class="sbt"><input type="submit" name="submit" value="修 改" class="btn-g"/> <input type="button" value="返 回" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?><?php echo $status == 2 ? '&action=check' : '';?>');"/></div> |
||||
|
</form> |
||||
|
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,74 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<div class="sbox"> |
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<?php echo $type_select;?>
|
||||
|
<?php echo $level_select;?>
|
||||
|
<?php echo $DT['city'] ? ajax_area_select('areaid', '地区(分站)', $areaid).' ' : '';?>
|
||||
|
<span data-hide-1200="1"><?php echo $order_select;?> </span>
|
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>');"/> |
||||
|
</form> |
||||
|
</div> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th data-hide-1200="1">ID</th> |
||||
|
<th data-hide-1200="1">分类</th> |
||||
|
<th width="16"></th> |
||||
|
<th>标题</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">状态 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">选项 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 3 ? 4 : 3;?>');">回复 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 4 ? 'asc' : ($order == 3 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="130"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 1 ? 2 : 1;?>');">添加时间 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 2 ? 'asc' : ($order == 1 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="100">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center" title="编辑:<?php echo $v['editor'];?> 更新时间:<?php echo $v['editdate'];?>"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td data-hide-1200="1"><?php echo $v['itemid'];?></td>
|
||||
|
<td data-hide-1200="1"><a href="<?php echo $v['typeurl'];?>" target="_blank"><?php echo $v['typename'];?></td>
|
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td align="left"> <a href="<?php echo $v['linkurl'];?>" target="_blank"><?php echo $v['title'];?></td>
|
||||
|
<td><img src="<?php echo DT_STATIC;?>file/image/process_<?php echo get_process($v['fromtime'], $v['totime']);?>.gif"/></td> |
||||
|
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=question&fid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 表单选项');"><?php echo $v['question'];?></a></td>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=answer&fid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 回复记录');"><?php echo $v['answer'];?></a></td>
|
||||
|
<td><?php echo $v['hits'];?></td>
|
||||
|
<td><?php echo $v['adddate'];?></td>
|
||||
|
<td> |
||||
|
<a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=question&fid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 表单选项');"><img src="admin/image/child.png" width="16" height="16" title="管理选项" alt=""/></a> |
||||
|
<a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=answer&fid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 回复记录');"><img src="admin/image/poll.png" width="16" height="16" title="回复记录" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<div class="btns"> |
||||
|
<input type="submit" value="删 除" class="btn-r" onclick="if(confirm('确定要删除选中表单吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level\';this.form.submit();"');?>
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<div class="tt">链接说明</div> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="lh20 f_gray"> |
||||
|
一般情况直接链接到表单网址,如果需要自定义参数来区分不同场景,可使用如下地址:<br/> |
||||
|
<?php echo $EXT['form_url'];?>index.php?itemid=表单ID&item=参数<br/>
|
||||
|
参数限制为a-z、A-Z、0-9、中划线(-)、下划线(_)的组合<br/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<script type="text/javascript">Menuon(1);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,60 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?" onsubmit="return check();"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<input type="hidden" name="job" value="<?php echo $job;?>"/> |
||||
|
<input type="hidden" name="fid" value="<?php echo $fid;?>"/> |
||||
|
<input type="hidden" name="forward" value="<?php echo $forward;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 复制方式</td> |
||||
|
<td> |
||||
|
<input type="radio" name="type" value="1" id="t1" onclick="Ds('f1');Dh('f2');" checked/> <label for="t1">批量</label> |
||||
|
<input type="radio" name="type" value="0" id="t2" onclick="Ds('f2');Dh('f1');"/> <label for="t2">单项</label> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr id="f1" style="display:;"> |
||||
|
<td class="tl"><span class="f_red">*</span> 表单ID</td> |
||||
|
<td><input type="text" size="10" name="ffid" id="ffid"/><span id="dffid" class="f_red"></span></td> |
||||
|
</tr> |
||||
|
<tr id="f2" style="display:none;"> |
||||
|
<td class="tl"><span class="f_red">*</span> 选项ID</td> |
||||
|
<td><input type="text" size="10" name="fqid" id="fqid"/><span id="dfqid" class="f_red"></span></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 同名过滤</td> |
||||
|
<td> |
||||
|
<input type="radio" name="name" value="1" id="n1" checked/> <label for="n1">是</label> |
||||
|
<input type="radio" name="name" value="0" id="n2"/> <label for="n2">否</label> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<div class="sbt"><input type="submit" name="submit" value="复 制" class="btn-g"/></div> |
||||
|
</form> |
||||
|
<script type="text/javascript"> |
||||
|
function check() { |
||||
|
if(Dd('t1').checked) { |
||||
|
if(Dd('ffid').value=='') { |
||||
|
Dmsg('请填写表单ID', 'ffid'); |
||||
|
return false; |
||||
|
} |
||||
|
if(Dd('ffid').value==<?php echo $fid;?>) {
|
||||
|
Dmsg('表单ID与当前表单相同', 'ffid'); |
||||
|
return false; |
||||
|
} |
||||
|
} else { |
||||
|
if(Dd('fqid').value=='') { |
||||
|
Dmsg('请填写选项ID', 'fqid'); |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
return true; |
||||
|
} |
||||
|
</script> |
||||
|
<script type="text/javascript">Menuon(1);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,114 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?" id="dform" onsubmit="return check();"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<input type="hidden" name="forward" value="<?php echo $forward;?>"/> |
||||
|
<input type="hidden" name="itemid" value="<?php echo $itemid;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 礼品分类</td> |
||||
|
<td><span id="type_box"><?php echo type_select($TYPE, 1, 'post[typeid]', '请选择分类', $typeid, 'id="typeid"');?></span> <a href="javascript:var type_item='<?php echo $file;?>',type_name='post[typeid]',type_default='请选择分类',type_id=<?php echo $typeid;?>,type_interval=setInterval('type_reload()',500);Dwidget('?file=type&item=<?php echo $file;?>', '礼品分类');"><img src="<?php echo DT_STATIC;?>file/image/ico-add.png" width="11" height="11" title="管理分类"/></a> <span id="dtypeid" class="f_red"></span></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 礼品标题</td> |
||||
|
<td><input name="post[title]" type="text" id="title" size="70" value="<?php echo $title;?>"/> <?php echo dstyle('post[style]', $style);?> <?php echo level_select('post[level]', '级别', $level);?> <span id="dtitle" class="f_red"></span></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 标题图片</td> |
||||
|
<td> |
||||
|
<input type="hidden" name="post[thumb]" id="thumb" value="<?php echo $thumb;?>"/> |
||||
|
<table width="130" class="ctb"> |
||||
|
<tr align="center" height="120" class="c_p"> |
||||
|
<td width="130"><img src="<?php echo $thumb ? $thumb : DT_SKIN.'image/waitpic.gif';?>" width="100" height="100" id="showthumb" title="预览图片" alt="" onclick="if(this.src.indexOf('waitpic.gif') == -1){_preview(Dd('showthumb').src, 1);}else{Dalbum('',<?php echo $moduleid;?>, 200, 200, Dd('thumb').value, true);}"/></td> |
||||
|
</tr> |
||||
|
<tr align="center" height="25"> |
||||
|
<td><span onclick="Dalbum('',<?php echo $moduleid;?>, 200, 200, Dd('thumb').value, true);" class="jt"><img src="<?php echo DT_STATIC;?>file/image/ico-upl.png" width="11" height="11" title="上传"/></span> <span onclick="delAlbum('','wait');" class="jt"><img src="<?php echo DT_STATIC;?>file/image/ico-del.png" width="11" height="11" title="删除"/></span></td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<span id="dthumb" class="f_red"></span> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 单价</td> |
||||
|
<td><input type="text" size="10" name="post[credit]" value="<?php echo $credit;?>" id="credit"/> <?php echo $DT['credit_name'];?> <span id="dcredit" class="f_red"></span></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 库存</td> |
||||
|
<td><input type="text" size="10" name="post[amount]" value="<?php echo $amount;?>" id="amount"/> <span id="damount" class="f_red"></span></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 会员组</td> |
||||
|
<td><?php echo group_checkbox('post[groupid][]', $groupid, '1,2,3,4');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 兑换次数</td> |
||||
|
<td><input type="text" size="10" name="post[maxorder]" value="<?php echo $maxorder;?>" id="maxorder"/> <?php echo tips('同一个帐号最多兑换次数,填0代表不限制');?> <span id="dmaxorder" class="f_red"></span></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 有效时间</td> |
||||
|
<td><?php echo dcalendar('post[fromtime]', $fromtime, '-', 1);?> 至 <?php echo dcalendar('post[totime]', $totime, '-', 1);?> <?php echo tips('不填表示不限时间');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 详细说明</td> |
||||
|
<td><textarea name="post[content]" id="content" class="dsn"><?php echo $content;?></textarea>
|
||||
|
<?php echo deditor($moduleid, 'content', 'Destoon', '100%', 350);?><br/><span id="dcontent" class="f_red"></span>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr title="请保持时间格式"> |
||||
|
<td class="tl"><span class="f_hid">*</span> 添加时间</td> |
||||
|
<td><?php echo dcalendar('post[addtime]', $addtime, '-', 1);?></td>
|
||||
|
</tr> |
||||
|
<?php if($DT['city']) { ?>
|
||||
|
<tr style="display:<?php echo $_areaids ? 'none' : '';?>;"> |
||||
|
<td class="tl"><span class="f_hid">*</span> 地区(分站)</td> |
||||
|
<td><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?></td>
|
||||
|
</tr> |
||||
|
<?php } ?>
|
||||
|
</table> |
||||
|
<div class="sbt"><input type="submit" name="submit" value="<?php echo $action == 'edit' ? '修 改' : '添 加';?>" class="btn-g"/> <input type="button" value="<?php echo $action == 'edit' ? '返 回' : '取 消';?>" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>');"/></div> |
||||
|
</form> |
||||
|
<?php load('clear.js'); ?>
|
||||
|
<script type="text/javascript"> |
||||
|
function check() { |
||||
|
var l; |
||||
|
var f; |
||||
|
f = 'typeid'; |
||||
|
l = Dd(f).value; |
||||
|
if(l == 0) { |
||||
|
Dmsg('请选择礼品分类', f); |
||||
|
return false; |
||||
|
} |
||||
|
f = 'title'; |
||||
|
l = Dd(f).value.length; |
||||
|
if(l < 2) { |
||||
|
Dmsg('标题最少2字,当前已输入'+l+'字', f); |
||||
|
return false; |
||||
|
} |
||||
|
f = 'thumb'; |
||||
|
l = Dd(f).value.length; |
||||
|
if(l < 10) { |
||||
|
Dmsg('请上传标题图片', f); |
||||
|
return false; |
||||
|
} |
||||
|
f = 'credit'; |
||||
|
l = Dd(f).value; |
||||
|
if(l < 1) { |
||||
|
Dmsg('请填写单价', f); |
||||
|
return false; |
||||
|
} |
||||
|
f = 'amount'; |
||||
|
l = Dd(f).value; |
||||
|
if(l < 1) { |
||||
|
Dmsg('请填写名额', f); |
||||
|
return false; |
||||
|
} |
||||
|
return true; |
||||
|
} |
||||
|
</script> |
||||
|
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,65 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?" id="dform"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<input type="hidden" name="forward" value="<?php echo $forward;?>"/> |
||||
|
<input type="hidden" name="itemid" value="<?php echo $itemid;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl">礼品</td> |
||||
|
<td><a href="<?php echo $linkurl;?>" target="_blank" class="t"><?php echo $title;?></a></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><?php echo $DT['credit_name'];?></td>
|
||||
|
<td><?php echo $credit;?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">下单</td> |
||||
|
<td><?php echo $addtime;?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">会员</td> |
||||
|
<td><a href="javascript:_user('<?php echo $username;?>');" class="t"><?php echo $username;?></a></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">快递</td> |
||||
|
<td> |
||||
|
<input name="post[<?php echo $itemid;?>][expressid]" type="text" size="20" value="<?php echo $expressid;?>" placeholder="快递单号:" title="快递单号:"/> |
||||
|
<?php echo dselect($send_types, 'post['.$itemid.'][express]', '快递类型', $express, '', 0, '', 1);?>
|
||||
|
<?php if($express && $expressid) {?>
|
||||
|
<a href="<?php echo DT_PATH;?>api/express.php?action=home&e=<?php echo urlencode($express);?>&n=<?php echo $expressid;?>" target="_blank"><img src="admin/image/link.png" width="16" height="16" title="快递追踪" alt=""/></a> |
||||
|
<?php } ?>
|
||||
|
<input type="hidden" name="post[<?php echo $itemid;?>][item_expressid]" value="<?php echo $expressid;?>"/> |
||||
|
<input type="hidden" name="post[<?php echo $itemid;?>][item_express]" value="<?php echo $express;?>"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">状态</td> |
||||
|
<td> |
||||
|
<input name="post[<?php echo $itemid;?>][status]" type="text" size="10" value="<?php echo $status;?>" id="status_<?php echo $itemid;?>"/> |
||||
|
<select onchange="if(this.value)Dd('status_<?php echo $itemid;?>').value=this.value;"> |
||||
|
<option value="">备选状态</option> |
||||
|
<option value="处理中">处理中</option> |
||||
|
<option value="审核中">审核中</option> |
||||
|
<option value="已取消">已取消</option> |
||||
|
<option value="已发货">已发货</option> |
||||
|
<option value="已完成">已完成</option> |
||||
|
</select> |
||||
|
<input type="hidden" name="post[<?php echo $itemid;?>][item_status]" value="<?php echo $status;?>"/> |
||||
|
<input type="hidden" name="post[<?php echo $itemid;?>][item_note]" value="<?php echo $note;?>"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl">备注</td> |
||||
|
<td><textarea name="post[<?php echo $itemid;?>][note]" style="width:400px;height:200px;overflow:visible;"><?php echo $note;?></textarea></td>
|
||||
|
</tr> |
||||
|
</table> |
||||
|
<div class="sbt"><input type="submit" name="submit" value="更 新" class="btn-g"/> <input type="button" value="取 消" class="btn" onclick="try{window.parent.cDialog();}catch(e){window.history.go(-1);}"/></div> |
||||
|
</form> |
||||
|
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,65 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form action="?"> |
||||
|
<div class="tt">链接搜索</div> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<?php echo $type_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<?php echo $level_select;?>
|
||||
|
<select name="type"> |
||||
|
<option value="0"<?php if($type == 0) echo ' selected';?>>类型</option>
|
||||
|
<option value="1"<?php if($type == 1) echo ' selected';?>>文字</option>
|
||||
|
<option value="2"<?php if($type == 2) echo ' selected';?>>LOGO</option>
|
||||
|
</select> |
||||
|
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>');"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</form> |
||||
|
<form method="post"> |
||||
|
<div class="tt">审核链接</div> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th>分类</th> |
||||
|
<th>网站名称</th> |
||||
|
<th>网站LOGO</th> |
||||
|
<th>链接类型</th> |
||||
|
<th>申请时间</th> |
||||
|
<th width="50">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center" title="网站介绍:<?php echo $v['introduce'];?>"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td><a href="<?php echo $v['typeurl'];?>" target="_blank"><?php echo $v['typename'];?></td>
|
||||
|
<td><a href="<?php echo DT_PATH;?>api/redirect.php?url=<?php echo urlencode($v['linkurl']);?>" target="_blank"><?php echo $v['title'];?></td>
|
||||
|
<td><?php if($v['thumb']) {?><img src="<?php echo $v['thumb'];?>" width="88" /><?php } ?></td>
|
||||
|
<td><?php echo $v['thumb'] ? 'LOGO' : '文字';?></td>
|
||||
|
<td><?php echo $v['adddate'];?></td>
|
||||
|
<td> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<div class="btns"> |
||||
|
<input type="submit" value=" 通过审核 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=check';"/> |
||||
|
<input type="submit" value="删 除" class="btn-r" onclick="if(confirm('确定要删除选中链接吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<br/> |
||||
|
<script type="text/javascript">Menuon(2);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,66 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<div class="sbox"> |
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<?php echo $type_select;?>
|
||||
|
<?php echo $level_select;?>
|
||||
|
<?php echo $DT['city'] ? ajax_area_select('areaid', '地区(分站)', $areaid).' ' : '';?>
|
||||
|
<span data-hide-1200="1"><?php echo $order_select;?> </span>
|
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>');"/> |
||||
|
</form> |
||||
|
</div> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th data-hide-1200="1">ID</th> |
||||
|
<th data-hide-1200="1">分类</th> |
||||
|
<th width="16"></th> |
||||
|
<th>标题</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 11 ? 12 : 11;?>');">状态 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 12 ? 'asc' : ($order == 11 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 7 ? 8 : 7;?>');">选项 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 8 ? 'asc' : ($order == 7 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 3 ? 4 : 3;?>');">票数 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 4 ? 'asc' : ($order == 3 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="130"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 1 ? 2 : 1;?>');">添加时间 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 2 ? 'asc' : ($order == 1 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th>调用代码</th> |
||||
|
<th width="100">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center" title="编辑:<?php echo $v['editor'];?> 更新时间:<?php echo $v['editdate'];?>"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td data-hide-1200="1"><?php echo $v['itemid'];?></td>
|
||||
|
<td data-hide-1200="1"><a href="<?php echo $v['typeurl'];?>" target="_blank"><?php echo $v['typename'];?></td>
|
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td align="left"> <a href="<?php echo $v['linkurl'];?>" target="_blank"><?php echo $v['title'];?></td>
|
||||
|
<td><img src="<?php echo DT_STATIC;?>file/image/process_<?php echo get_process($v['fromtime'], $v['totime']);?>.gif"/></td> |
||||
|
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=item&pollid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 投票选项');"><?php echo $v['items'];?></a></td>
|
||||
|
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=record&pollid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 投票记录');"><?php echo $v['polls'];?></a></td>
|
||||
|
<td><?php echo $v['hits'];?></td>
|
||||
|
<td><?php echo $v['adddate'];?></td>
|
||||
|
<td><input type="text" size="15" value="<script type="text/javascript" src="<?php echo $EXT['poll_url'];?>index.php?action=js&itemid=<?php echo $v['itemid'];?>"></script>" onmouseover="this.select();"/></td> |
||||
|
<td> |
||||
|
<a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=item&pollid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 投票选项');"><img src="admin/image/child.png" width="16" height="16" title="管理选项" alt=""/></a> |
||||
|
<a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=record&pollid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 投票记录');"><img src="admin/image/poll.png" width="16" height="16" title="投票记录" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<div class="btns"> |
||||
|
<input type="submit" value="删 除" class="btn-r" onclick="if(confirm('确定要删除选中票选吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level\';this.form.submit();"');?>
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<script type="text/javascript">Menuon(1);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,61 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<div class="sbox"> |
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<?php echo $type_select;?>
|
||||
|
<?php echo $level_select;?>
|
||||
|
<?php echo $DT['city'] ? ajax_area_select('areaid', '地区(分站)', $areaid).' ' : '';?>
|
||||
|
<span data-hide-1200="1"><?php echo $order_select;?> </span>
|
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>');"/> |
||||
|
</form> |
||||
|
</div> |
||||
|
<form method="post"> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th data-hide-1200="1">ID</th> |
||||
|
<th data-hide-1200="1">分类</th> |
||||
|
<th width="16"><a href="javascript:;" onclick="Dq('level','10');" title="全部级别"> </a></th> |
||||
|
<th>标题</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 9 ? 10 : 9;?>');">状态 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 10 ? 'asc' : ($order == 9 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 3 ? 4 : 3;?>');">票数 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 4 ? 'asc' : ($order == 3 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 5 ? 6 : 5;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 6 ? 'asc' : ($order == 5 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 1 ? 2 : 1;?>');">添加时间 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 2 ? 'asc' : ($order == 1 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="80">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center" title="编辑:<?php echo $v['editor'];?> 更新时间:<?php echo $v['editdate'];?>"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td data-hide-1200="1"><?php echo $v['itemid'];?></td>
|
||||
|
<td data-hide-1200="1"><a href="<?php echo $v['typeurl'];?>" target="_blank"><?php echo $v['typename'];?></td>
|
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td align="left"><div class="h"><a href="<?php echo $v['linkurl'];?>" target="_blank"><?php echo $v['title'];?></div></td>
|
||||
|
<td><img src="<?php echo DT_STATIC;?>file/image/process_<?php echo get_process($v['fromtime'], $v['totime']);?>.gif"/></td> |
||||
|
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=record&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 投票记录');"><?php echo $v['votes'];?></a></td>
|
||||
|
<td><?php echo $v['hits'];?></td>
|
||||
|
<td><?php echo $v['adddate'];?></td>
|
||||
|
<td> |
||||
|
<a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=record&itemid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 投票记录');"><img src="admin/image/poll.png" width="16" height="16" title="投票记录" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<div class="btns"> |
||||
|
<input type="submit" value="删 除" class="btn-r" onclick="if(confirm('确定要删除选中投票吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete'}else{return false;}"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level\';this.form.submit();"');?>
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<script type="text/javascript">Menuon(1);</script> |
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,62 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<div class="sbox"> |
||||
|
<form action="?" id="search"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="item" value="<?php echo $item;?>"/> |
||||
|
<input type="hidden" name="itemid" value="<?php echo $itemid;?>"/> |
||||
|
<?php echo $fields_select;?>
|
||||
|
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/> |
||||
|
<?php echo $level_select;?>
|
||||
|
<?php echo $DT['city'] ? ajax_area_select('areaid', '地区(分站)', $areaid).' ' : '';?>
|
||||
|
<?php echo $order_select;?>
|
||||
|
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/> |
||||
|
<input type="submit" value="搜 索" class="btn"/> |
||||
|
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&item=<?php echo $item;?>&itemid=<?php echo $itemid;?>');"/> |
||||
|
</form> |
||||
|
</div> |
||||
|
<form method="post"> |
||||
|
<input type="hidden" name="item" value="<?php echo $item;?>"/> |
||||
|
<table cellspacing="0" class="tb ls"> |
||||
|
<tr> |
||||
|
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th> |
||||
|
<th width="50">排序</th> |
||||
|
<th width="16"></th> |
||||
|
<th>标题</th> |
||||
|
<th>网址</th> |
||||
|
<th><a href="javascript:;" onclick="Dq('order','<?php echo $order == 3 ? 4 : 3;?>');">浏览 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 4 ? 'asc' : ($order == 3 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<?php if($itemid) { ?><th>分组标识</th><?php } ?>
|
||||
|
<th width="130"><a href="javascript:;" onclick="Dq('order','<?php echo $order == 1 ? 2 : 1;?>');">更新时间 <img src="<?php echo DT_STATIC;?>file/image/ico-<?php echo $order == 2 ? 'asc' : ($order == 1 ? 'dsc' : 'ord');?>.png" width="11" height="11"/></a></th> |
||||
|
<th width="50">操作</th> |
||||
|
</tr> |
||||
|
<?php foreach($lists as $k=>$v) {?>
|
||||
|
<tr align="center"> |
||||
|
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td> |
||||
|
<td><input type="text" size="2" name="listorder[<?php echo $v['itemid'];?>]" value="<?php echo $v['listorder'];?>"/></td> |
||||
|
<td><?php if($v['level']) {?><a href="javascript:;" onclick="Dq('level','<?php echo $v['level'];?>');"><img src="admin/image/level_<?php echo $v['level'];?>.gif" title="<?php echo $v['level'];?>级" alt=""/></a><?php } ?></td>
|
||||
|
<td align="left"> <a href="<?php echo $v['linkurl'];?>" target="_blank"><?php echo $v['title'];?></a></td>
|
||||
|
<td align="left"> <a href="<?php echo $v['linkurl'];?>" target="_blank"><?php echo $v['linkurl'];?></a></td>
|
||||
|
<td><?php echo $v['hits'];?></td>
|
||||
|
<?php if($itemid) { ?><td><?php echo $v['item'];?></td><?php } ?>
|
||||
|
<td><?php echo $v['editdate'];?></td>
|
||||
|
<td> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>&item=<?php echo $v['item'];?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a> |
||||
|
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>&item=<?php echo $v['item'];?>" onclick="return _delete();"><img src="admin/image/delete.png" width="16" height="16" title="删除" alt=""/></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<?php }?>
|
||||
|
</table> |
||||
|
<div class="btns"> |
||||
|
<input type="submit" value="更新排序" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=order&item=<?php echo $item;?>';"/> |
||||
|
<input type="submit" value="生成网页" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=html&item=<?php echo $item;?>';"/> |
||||
|
<input type="submit" value="删 除" class="btn-r" onclick="if(confirm('确定要删除选中单页吗?此操作将不可撤销')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&item=<?php echo $item;?>'}else{return false;}"/> |
||||
|
<?php echo level_select('level', '设置级别为</option><option value="0">取消', 0, 'onchange="this.form.action=\'?moduleid='.$moduleid.'&file='.$file.'&action=level&item='.$item.';?>\';this.form.submit();"');?>
|
||||
|
</div> |
||||
|
</form> |
||||
|
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
|
||||
|
<script type="text/javascript">Menuon(<?php echo $itemid ? 2 : 1;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,93 @@ |
|||||
|
<?php |
||||
|
defined('DT_ADMIN') or exit('Access Denied'); |
||||
|
include tpl('header'); |
||||
|
show_menu($menus); |
||||
|
?>
|
||||
|
<form method="post" action="?" id="dform" onsubmit="return check();"> |
||||
|
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/> |
||||
|
<input type="hidden" name="file" value="<?php echo $file;?>"/> |
||||
|
<input type="hidden" name="action" value="<?php echo $action;?>"/> |
||||
|
<input type="hidden" name="forward" value="<?php echo $forward;?>"/> |
||||
|
<input type="hidden" name="itemid" value="<?php echo $itemid;?>"/> |
||||
|
<table cellspacing="0" class="tb"> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_red">*</span> 单页标题</td> |
||||
|
<td><input name="post[title]" type="text" id="title" size="70" value="<?php echo $title;?>"/> <?php echo dstyle('post[style]', $style);?> <?php echo level_select('post[level]', '级别', $level);?> <input type="checkbox" name="post[islink]" value="1" id="islink" onclick="_islink();"<?php if($islink) echo ' checked';?>/><label for="islink"> 外部链接</label> <br/><span id="dtitle" class="f_red"></span></td>
|
||||
|
</tr> |
||||
|
<tr id="link" style="display:<?php echo $islink ? '' : 'none';?>;"> |
||||
|
<td class="tl"><span class="f_red">*</span> 链接地址</td> |
||||
|
<td><input name="post[linkurl]" type="text" id="linkurl" size="70" value="<?php echo $linkurl;?>"/> <span onclick="if(Dd('linkurl').value.length>10){window.open('<?php echo DT_PATH;?>api/redirect.php?url='+encodeURIComponent(Dd('linkurl').value));}else{Dmsg('请输入链接地址', 'linkurl');}" class="jt">[打开]</span> <span id="dlinkurl" class="f_red"></span></td> |
||||
|
</tr> |
||||
|
<tbody id="basic" style="display:<?php echo $islink ? 'none' : '';?>;"> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 单页内容</td> |
||||
|
<td><textarea name="post[content]" id="content" class="dsn"><?php echo $content;?></textarea>
|
||||
|
<?php echo deditor($moduleid, 'content', 'Destoon', '100%', 350);?><br/><span id="dcontent" class="f_red"></span>
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 保存路径</td> |
||||
|
<td><input name="post[filepath]" type="text" size="20" value="<?php echo $filepath;?>"/> <span class="f_gray">如不填写则生成在网站根目录,否则请以‘/’结尾,例如‘about/’</span></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 文件名称</td> |
||||
|
<td><input name="post[filename]" type="text" size="20" value="<?php echo $filename;?>"/> <span class="f_gray">如不填写则自动按ID生成文件名,例如‘page-1.html’</span></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 绑定域名</td> |
||||
|
<td><input name="post[domain]" type="text" size="70" value="<?php echo $domain;?>"/><?php tips('例如设置的生成路径为machine/index.html<br/>那么可以绑定machine.xxx.com至machine目录<br/>此处填写http://machine.xxx.com/');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> SEO标题</td> |
||||
|
<td><input name="post[seo_title]" type="text" size="70" value="<?php echo $seo_title;?>"/></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> SEO关键词</td> |
||||
|
<td><input name="post[seo_keywords]" type="text" size="70" value="<?php echo $seo_keywords;?>"/></td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> SEO描述</td> |
||||
|
<td><input name="post[seo_description]" type="text" size="70" value="<?php echo $seo_description;?>"/></td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
<?php if($DT['city']) { ?>
|
||||
|
<tr style="display:<?php echo $_areaids ? 'none' : '';?>;"> |
||||
|
<td class="tl"><span class="f_hid">*</span> 地区(分站)</td> |
||||
|
<td><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?></td>
|
||||
|
</tr> |
||||
|
<?php } ?>
|
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 分组标识</td> |
||||
|
<td><input name="post[item]" type="text" size="10" value="<?php echo $item;?>"/><?php tips('单页的分组标识,如果不理解含义,请勿修改');?></td>
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="tl"><span class="f_hid">*</span> 内容模板</td> |
||||
|
<td><?php echo tpl_select('webpage', $module, 'post[template]', '默认模板', $template);?></td>
|
||||
|
</tr> |
||||
|
</table> |
||||
|
<div class="sbt"><input type="submit" name="submit" value="<?php echo $action == 'edit' ? '修 改' : '添 加';?>" class="btn-g"/> <input type="button" value="<?php echo $action == 'edit' ? '返 回' : '取 消';?>" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>');"/></div> |
||||
|
</form> |
||||
|
<?php load('clear.js'); ?>
|
||||
|
<script type="text/javascript"> |
||||
|
function check() { |
||||
|
var l; |
||||
|
var f; |
||||
|
f = 'title'; |
||||
|
l = Dd(f).value.length; |
||||
|
if(l < 2) { |
||||
|
Dmsg('标题最少2字,当前已输入'+l+'字', f); |
||||
|
return false; |
||||
|
} |
||||
|
if(Dd('islink').checked) { |
||||
|
f = 'linkurl'; |
||||
|
l = Dd(f).value.length; |
||||
|
if(l < 12) { |
||||
|
Dmsg('请输入正确的链接地址', f); |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
return true; |
||||
|
} |
||||
|
</script> |
||||
|
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
|
||||
|
<?php include tpl('footer');?>
|
||||
@ -0,0 +1,24 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
if($DT_BOT) dhttp(403); |
||||
|
$url = isset($url) ? trim($url) : ''; |
||||
|
$url = str_replace('/mobile/file/upload/', '/file/upload/', $url); |
||||
|
$name = isset($name) ? trim($name) : ''; |
||||
|
strlen($url) > 15 or dheader($DT_PC ? DT_PATH : DT_MOB); |
||||
|
$ext = file_ext($url); |
||||
|
$ext or dheader($DT_PC ? DT_PATH : DT_MOB); |
||||
|
$name or dheader($url); |
||||
|
$ext == file_ext($name) or dheader($DT_PC ? DT_PATH : DT_MOB); |
||||
|
in_array($ext, array('rar', 'zip', 'gz', 'tar', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx')) or dheader($url); |
||||
|
$file = strpos($url, 'file/upload/') !== false ? cutstr($url, 'file/upload/') : str_replace($DT['remote_url'], '', $url); |
||||
|
preg_match("/^[0-9\-\/]{18,}$/", substr($file, 0, -strlen($ext)-1)) or dheader($url); |
||||
|
$localfile = DT_ROOT.'/file/upload/'.$file; |
||||
|
is_file($localfile) or dheader($url); |
||||
|
$title = substr($name, 0, -strlen($ext)-1); |
||||
|
$title = file_vname($title); |
||||
|
$title or dheader($url); |
||||
|
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) $title = str_replace(' ', '_', $title); |
||||
|
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'rv:1') !== false) $title = convert($title, DT_CHARSET, 'GBK'); |
||||
|
$title or dheader($url); |
||||
|
file_down($localfile, $title.'.'.$ext); |
||||
|
?>
|
||||
@ -0,0 +1,183 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
class comment { |
||||
|
var $itemid; |
||||
|
var $table; |
||||
|
var $table_stat; |
||||
|
var $table_ban; |
||||
|
var $errmsg = errmsg; |
||||
|
|
||||
|
function __construct() { |
||||
|
$this->table = DT_PRE.'comment'; |
||||
|
$this->table_stat = DT_PRE.'comment_stat'; |
||||
|
$this->table_ban = DT_PRE.'comment_ban'; |
||||
|
} |
||||
|
|
||||
|
function comment() { |
||||
|
$this->__construct(); |
||||
|
} |
||||
|
|
||||
|
function pass($post) { |
||||
|
global $L; |
||||
|
if(!is_array($post)) return false; |
||||
|
if(!$post['content']) return $this->_($L['comment_pass_content']); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
function set($post) { |
||||
|
global $_username; |
||||
|
$post['hidden'] = isset($post['hidden']) ? 1 : 0; |
||||
|
$post['status'] = $post['status'] == 3 ? 3 : 2; |
||||
|
$post['level'] = intval($post['level']); |
||||
|
$post['star'] = intval($post['star']); |
||||
|
in_array($post['star'], array(1, 2, 3, 4, 5)) or $post['star'] = 5; |
||||
|
if($post['reply']) $post['replytime'] = is_time($post['replytime']) ? strtotime($post['replytime']) : DT_TIME; |
||||
|
$post['editor'] = $_username; |
||||
|
$post = dhtmlspecialchars($post); |
||||
|
return array_map("trim", $post); |
||||
|
} |
||||
|
|
||||
|
function get_one() { |
||||
|
return DB::get_one("SELECT * FROM {$this->table} WHERE itemid='$this->itemid'"); |
||||
|
} |
||||
|
|
||||
|
function get_list($condition = 'status=3', $order = 'itemid DESC') { |
||||
|
global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items; |
||||
|
$r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition"); |
||||
|
$items = $r['num']; |
||||
|
$pages = pages($items, $page, $pagesize); |
||||
|
if($items < 1) return array(); |
||||
|
$lists = array(); |
||||
|
$result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); |
||||
|
while($r = DB::fetch_array($result)) { |
||||
|
$r['adddate'] = timetodate($r['addtime'], 6); |
||||
|
$r['replydate'] = $r['replytime'] ? timetodate($r['replytime'], 6) : ''; |
||||
|
if(strpos($r['content'], ')') !== false) $r['content'] = parse_face($r['content']); |
||||
|
if(strpos($r['quotation'], ')') !== false) $r['quotation'] = parse_face($r['quotation']); |
||||
|
$lists[] = $r; |
||||
|
} |
||||
|
return $lists; |
||||
|
} |
||||
|
|
||||
|
function edit($post) { |
||||
|
$post = $this->set($post); |
||||
|
$r = $this->get_one(); |
||||
|
if($r['star'] != $post['star']) { |
||||
|
$star = 'star'.$r['star']; |
||||
|
DB::query("UPDATE {$this->table_stat} SET `{$star}`=`{$star}`-1 WHERE itemid=$r[item_id] AND moduleid=$r[item_mid]"); |
||||
|
$star = 'star'.$post['star']; |
||||
|
DB::query("UPDATE {$this->table_stat} SET `{$star}`=`{$star}`+1 WHERE itemid=$r[item_id] AND moduleid=$r[item_mid]"); |
||||
|
} |
||||
|
$sql = ''; |
||||
|
foreach($post as $k=>$v) { |
||||
|
$sql .= ",$k='$v'"; |
||||
|
} |
||||
|
$sql = substr($sql, 1); |
||||
|
DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
function delete($itemid) { |
||||
|
global $MOD, $L; |
||||
|
if(is_array($itemid)) { |
||||
|
foreach($itemid as $v) { |
||||
|
$this->delete($v); |
||||
|
} |
||||
|
} else { |
||||
|
$this->itemid = $itemid; |
||||
|
$r = $this->get_one(); |
||||
|
if($r) { |
||||
|
$star = 'star'.$r['star']; |
||||
|
DB::query("UPDATE {$this->table_stat} SET comment=comment-1,`{$star}`=`{$star}`-1 WHERE itemid=$r[item_id] AND moduleid=$r[item_mid]"); |
||||
|
DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); |
||||
|
if($r['username'] && $MOD['credit_del_comment']) { |
||||
|
credit_add($r['username'], -$MOD['credit_del_comment']); |
||||
|
credit_record($r['username'], -$MOD['credit_del_comment'], 'system', $L['comment_record_del'], 'ID:'.$r['itemid']); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function check($itemid, $status = 3) { |
||||
|
global $MOD, $L; |
||||
|
if(is_array($itemid)) { |
||||
|
foreach($itemid as $v) { |
||||
|
$this->check($v, $status); |
||||
|
} |
||||
|
} else { |
||||
|
if($MOD['credit_add_comment'] && $status == 3) { |
||||
|
$this->itemid = $itemid; |
||||
|
$item = $this->get_one(); |
||||
|
if($item['username']) { |
||||
|
credit_add($item['username'], $MOD['credit_add_comment']); |
||||
|
credit_record($item['username'], $MOD['credit_add_comment'], 'system', $L['comment_record_add'], 'ID:'.$itemid); |
||||
|
} |
||||
|
} |
||||
|
DB::query("UPDATE {$this->table} SET status=$status WHERE itemid=$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 get_ban_list($condition = '1') { |
||||
|
global $pages, $page, $pagesize, $offset, $pagesize, $sum; |
||||
|
if($page > 1 && $sum) { |
||||
|
$items = $sum; |
||||
|
} else { |
||||
|
$r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table_ban} WHERE $condition"); |
||||
|
$items = $r['num']; |
||||
|
} |
||||
|
$pages = pages($items, $page, $pagesize); |
||||
|
$lists = array(); |
||||
|
$result = DB::query("SELECT * FROM {$this->table_ban} WHERE $condition ORDER BY bid DESC LIMIT $offset,$pagesize"); |
||||
|
while($r = DB::fetch_array($result)) { |
||||
|
$r['edittime'] = timetodate($r['edittime'], 6); |
||||
|
$lists[] = $r; |
||||
|
} |
||||
|
return $lists; |
||||
|
} |
||||
|
|
||||
|
function ban_update($post) { |
||||
|
$this->_add($post[0]); |
||||
|
unset($post[0]); |
||||
|
foreach($post as $k=>$v) { |
||||
|
if(isset($v['delete'])) { |
||||
|
$this->_delete($k); |
||||
|
unset($post[$k]); |
||||
|
} |
||||
|
} |
||||
|
$this->_edit($post); |
||||
|
cache_bancomment(); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
function _add($post) { |
||||
|
global $_username; |
||||
|
$post['moduleid'] = intval($post['moduleid']); |
||||
|
$post['itemid'] = intval($post['itemid']); |
||||
|
if(!$post['moduleid'] || !$post['itemid']) return false; |
||||
|
DB::query("INSERT INTO {$this->table_ban} (moduleid,itemid,editor,edittime) VALUES('$post[moduleid]','$post[itemid]','$_username','".DT_TIME."')"); |
||||
|
} |
||||
|
|
||||
|
function _edit($post) { |
||||
|
foreach($post as $k=>$v) { |
||||
|
$v['moduleid'] = intval($v['moduleid']); |
||||
|
$v['itemid'] = intval($v['itemid']); |
||||
|
if(!$v['moduleid'] || !$v['itemid']) return false; |
||||
|
DB::query("UPDATE {$this->table_ban} SET moduleid='$v[moduleid]',itemid='$v[itemid]' WHERE bid='$k'"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function _delete($bid) { |
||||
|
DB::query("DELETE FROM {$this->table_ban} WHERE bid=$bid"); |
||||
|
} |
||||
|
|
||||
|
function _($e) { |
||||
|
$this->errmsg = $e; |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
?>
|
||||
@ -0,0 +1,5 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/include/module.func.php'; |
||||
|
require DT_ROOT.'/module/'.$module.'/global.func.php'; |
||||
|
?>
|
||||
@ -0,0 +1,44 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
$MOD['feed_enable'] or dheader(DT_PATH); |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
$ext = 'feed'; |
||||
|
$url = $EXT[$ext.'_url']; |
||||
|
$mob = $EXT[$ext.'_mob']; |
||||
|
$FD = array(); |
||||
|
foreach($MODULE as $m) { |
||||
|
if($m['islink'] || !$m['ismenu'] || $m['moduleid'] < 5) continue; |
||||
|
$m['rssurl'] = $MOD['feed_url'].'rss.php?mid='.$m['moduleid']; |
||||
|
$FD[] = $m; |
||||
|
} |
||||
|
if($action == 'diy') { |
||||
|
$areaid = isset($areaid) ? intval($areaid) : 0; |
||||
|
$feed_code = ''; |
||||
|
$category_select = ''; |
||||
|
$area_select = ''; |
||||
|
if($mid && $mid > 4 && isset($MODULE[$mid]) && !$MODULE[$mid]['islink']) { |
||||
|
$feed_code .= $MOD['feed_url'].'rss.php?mid='.$mid; |
||||
|
if($kw == $L['keyword']) $kw = ''; |
||||
|
if($kw && strlen($kw) > 2 && strlen($kw) < 30) $feed_code .= '&kw='.urlencode($kw); |
||||
|
if($catid) $feed_code .= '&catid='.urlencode($catid); |
||||
|
if($areaid) $feed_code .= '&areaid='.urlencode($areaid); |
||||
|
$category_select = category_select('catid', $L['category'], $catid, $mid); |
||||
|
if(in_array($MODULE[$mid]['module'], array('sell','buy', 'exhibit', 'info', 'job', 'mall', 'group'))) $area_select = ajax_area_select('areaid', $L['rss_area'], $areaid); |
||||
|
} |
||||
|
} else { |
||||
|
//
|
||||
|
} |
||||
|
$template = $ext; |
||||
|
$head_title = $L['rss_title']; |
||||
|
$head_keywords = $head_description = ''; |
||||
|
if($DT_PC) { |
||||
|
$destoon_task = rand_task(); |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($url, $mob, $DT_URL); |
||||
|
} else { |
||||
|
$head_name = $L['rss_title']; |
||||
|
if($sns_app) $seo_title = $site_name; |
||||
|
$foot = ''; |
||||
|
} |
||||
|
include template($template, $module); |
||||
|
?>
|
||||
@ -0,0 +1,169 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
$MOD['form_enable'] or dheader(DT_PATH); |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
$ext = 'form'; |
||||
|
$url = $EXT[$ext.'_url']; |
||||
|
$mob = $EXT[$ext.'_mob']; |
||||
|
$TYPE = get_type($ext, 1); |
||||
|
$_TP = sort_type($TYPE); |
||||
|
require DT_ROOT.'/module/'.$module.'/'.$ext.'.class.php'; |
||||
|
$do = new $ext(); |
||||
|
$typeid = isset($typeid) ? intval($typeid) : 0; |
||||
|
if($itemid) { |
||||
|
$do->itemid = $itemid; |
||||
|
$f = $do->get_one(); |
||||
|
$f or dheader($DT_PC ? $url : $mob); |
||||
|
unset($f['answer']); |
||||
|
require DT_ROOT.'/include/content.class.php'; |
||||
|
extract($f); |
||||
|
(isset($item) && preg_match("/^[a-z0-9_\-]{1,}$/i", $item)) or $item = ''; |
||||
|
$could_form = true; |
||||
|
$error = 0; |
||||
|
if($maxanswer) { |
||||
|
$condition = $_username ? "AND username='$_username'" : "AND ip='$DT_IP'"; |
||||
|
$num = $db->count($DT_PRE.'form_record', "fid=$itemid $condition"); |
||||
|
if($num >= $maxanswer) { |
||||
|
$could_form = false; |
||||
|
$error = 1; |
||||
|
} |
||||
|
} |
||||
|
if($fromtime && $DT_TIME < $fromtime) { |
||||
|
$could_form = false; |
||||
|
$error = 2; |
||||
|
} |
||||
|
if($totime && $DT_TIME > $totime) { |
||||
|
$could_form = false; |
||||
|
$error = 3; |
||||
|
} |
||||
|
if(!check_group($_groupid, $groupid)) { |
||||
|
$could_form = false; |
||||
|
$error = 4; |
||||
|
if(!$_userid && $groupid && strpos(','.$groupid.',', ',3,') === false) $error = 5; |
||||
|
} |
||||
|
if($submit) { |
||||
|
if($verify == 1) captcha($captcha, 1); |
||||
|
if($verify == 2) question($answer, 1); |
||||
|
if($could_form) { |
||||
|
$post = $other = array(); |
||||
|
$result = $db->query("SELECT * FROM {$DT_PRE}form_question WHERE fid=$itemid ORDER BY listorder ASC,qid ASC LIMIT 100"); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$qid = $r['qid']; |
||||
|
$t = explode('-', $r['required']); |
||||
|
$r['min'] = isset($t[0]) ? intval($t[0]) : 0; |
||||
|
$r['max'] = isset($t[1]) ? intval($t[1]) : 0; |
||||
|
if($r['min'] && $r['max'] <= $r['min']) $r['max'] = 0; |
||||
|
$r['option'] = array(); |
||||
|
if($r['type'] == 0 || $r['type'] == 1) { |
||||
|
if(isset($a[$qid])) { |
||||
|
if($r['min'] && strlen($a[$qid]) < $r['min']) message(lang($L['form_min_word'], array($r['name'], $r['min']))); |
||||
|
if($r['max'] && strlen($a[$qid]) > $r['max']) message(lang($L['form_max_word'], array($r['name'], $r['max']))); |
||||
|
$post[$qid] = dhtmlspecialchars(trim($a[$qid])); |
||||
|
} else { |
||||
|
message(); |
||||
|
} |
||||
|
} else if($r['type'] == 2) { |
||||
|
if(isset($a[$qid])) { |
||||
|
if($r['min'] && strlen($a[$qid]) == 0) message(lang($L['form_choose'], array($r['name']))); |
||||
|
$post[$qid] = dhtmlspecialchars(trim($a[$qid])); |
||||
|
} else { |
||||
|
message(); |
||||
|
} |
||||
|
} else if($r['type'] == 3) { |
||||
|
if(isset($a[$qid])) { |
||||
|
if($r['min'] && count($a[$qid]) < $r['min']) message(lang($L['form_min_choose'], array($r['name'], $r['min']))); |
||||
|
if($r['max'] && count($a[$qid]) > $r['max']) message(lang($L['form_max_choose'], array($r['name'], $r['max']))); |
||||
|
$str = ','; |
||||
|
$val = str_replace('(*)', '', $r['value']).'|'; |
||||
|
foreach($a[$qid] as $s) { |
||||
|
if(strpos($val, $s.'|') === false) message(); |
||||
|
$str .= $s.','; |
||||
|
if($s == $L['form_other'] && isset($o[$qid])) $other[$qid] = dhtmlspecialchars(trim($o[$qid])); |
||||
|
} |
||||
|
$post[$qid] = dhtmlspecialchars(trim($str)); |
||||
|
} else { |
||||
|
message(); |
||||
|
} |
||||
|
} else if($r['type'] == 4) { |
||||
|
if(isset($a[$qid])) { |
||||
|
$val = str_replace('(*)', '', $r['value']).'|'; |
||||
|
if(strpos($val, $a[$qid].'|') === false) message(); |
||||
|
if($a[$qid] == $L['form_other'] && isset($o[$qid])) $other[$qid] = dhtmlspecialchars(trim($o[$qid])); |
||||
|
$post[$qid] = dhtmlspecialchars(trim($a[$qid])); |
||||
|
} else { |
||||
|
$post[$qid] = ''; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
$db->query("INSERT INTO {$DT_PRE}form_record (fid,username,ip,addtime,item) VALUES ('$itemid','$_username','$DT_IP','$DT_TIME','$item')"); |
||||
|
$rid = $db->insert_id(); |
||||
|
foreach($post as $k=>$v) { |
||||
|
$o = isset($other[$k]) ? $other[$k] : ''; |
||||
|
$db->query("INSERT INTO {$DT_PRE}form_answer (fid,rid,qid,username,ip,addtime,content,other,item) VALUES ('$itemid','$rid','$k','$_username','$DT_IP','$DT_TIME','$v','$o','$item')"); |
||||
|
} |
||||
|
$db->query("UPDATE {$DT_PRE}form SET answer=answer+1 WHERE itemid=$itemid"); |
||||
|
dheader('index.php?page=2&itemid='.$itemid); |
||||
|
} else { |
||||
|
dalert($L['form_failed'], $DT_PC ? $linkurl : str_replace($url, $mob, $linkurl)); |
||||
|
} |
||||
|
} |
||||
|
$back = $DT_PC ? $linkurl : str_replace($url, $mob, $linkurl); |
||||
|
$adddate = timetodate($addtime, 3); |
||||
|
$fromdate = $fromtime ? timetodate($fromtime, 3) : $L['timeless']; |
||||
|
$todate = $totime ? timetodate($totime, 3) : $L['timeless']; |
||||
|
$content = DC::format($content, $DT_PC); |
||||
|
$lists = array(); |
||||
|
$result = $db->query("SELECT * FROM {$DT_PRE}form_question WHERE fid=$itemid ORDER BY listorder ASC,qid ASC LIMIT 1000"); |
||||
|
while($r = $db->fetch_array($result)) { |
||||
|
$t = explode('-', $r['required']); |
||||
|
$r['min'] = isset($t[0]) ? intval($t[0]) : 0; |
||||
|
$r['max'] = isset($t[1]) ? intval($t[1]) : 0; |
||||
|
if($r['min'] && $r['max'] <= $r['min']) $r['max'] = 0; |
||||
|
$r['option'] = array(); |
||||
|
if($r['type'] == 0) { |
||||
|
if(strpos($r['extend'], 'size=') === false) $r['extend'] .= ' size="50"'; |
||||
|
} else if($r['type'] == 1) { |
||||
|
if(strpos($r['extend'], 'rows=') === false) $r['extend'] .= ' rows="5"'; |
||||
|
if(strpos($r['extend'], 'cols=') === false) $r['extend'] .= ' cols="80"'; |
||||
|
} else { |
||||
|
$t = explode('|', $r['value']); |
||||
|
foreach($t as $k=>$v) { |
||||
|
$r['option'][$k]['name'] = str_replace('(*)', '', $v); |
||||
|
$r['option'][$k]['on'] = strpos($v, '(*)') !== false ? 1 : 0; |
||||
|
} |
||||
|
} |
||||
|
$lists[] = $r; |
||||
|
} |
||||
|
//$display = 0;
|
||||
|
if(!$DT_BOT) $db->query("UPDATE LOW_PRIORITY {$DT_PRE}{$ext} SET hits=hits+1 WHERE itemid=$itemid", 'UNBUFFERED'); |
||||
|
$head_title = $title.$DT['seo_delimiter'].$L['form_title']; |
||||
|
$template = $f['template'] ? $f['template'] : $ext; |
||||
|
} else { |
||||
|
$head_title = $L['form_title']; |
||||
|
if($catid) $typeid = $catid; |
||||
|
$condition = '1'; |
||||
|
if($keyword) $condition .= match_kw('title', $keyword); |
||||
|
if($typeid) { |
||||
|
isset($TYPE[$typeid]) or dheader($url); |
||||
|
$condition .= " AND typeid IN (".type_child($typeid, $TYPE).")"; |
||||
|
$head_title = $TYPE[$typeid]['typename'].$DT['seo_delimiter'].$head_title; |
||||
|
} |
||||
|
if($cityid) $condition .= ($AREA[$cityid]['child']) ? " AND areaid IN (".$AREA[$cityid]['arrchildid'].")" : " AND areaid=$cityid"; |
||||
|
$lists = $do->get_list($condition, 'addtime DESC'); |
||||
|
$template = $ext; |
||||
|
} |
||||
|
if($DT_PC) { |
||||
|
$destoon_task = rand_task(); |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($url, $mob, $DT_URL); |
||||
|
} else { |
||||
|
$foot = ''; |
||||
|
if($itemid) { |
||||
|
$js_item = 1; |
||||
|
} else { |
||||
|
$pages = mobile_pages($items, $page, $pagesize); |
||||
|
} |
||||
|
if($sns_app) $seo_title = $site_name; |
||||
|
} |
||||
|
include template($template, $module); |
||||
|
?>
|
||||
@ -0,0 +1,65 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
$MOD['guestbook_enable'] or dheader(DT_PATH); |
||||
|
$MOD['guestbook_guest'] or login(); |
||||
|
$TYPE = explode('|', trim($MOD['guestbook_type'])); |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
$ext = 'guestbook'; |
||||
|
$url = $EXT[$ext.'_url']; |
||||
|
$mob = $EXT[$ext.'_mob']; |
||||
|
require DT_ROOT.'/module/'.$module.'/'.$ext.'.class.php'; |
||||
|
$do = new $ext(); |
||||
|
$destoon_task = rand_task(); |
||||
|
$report = isset($report) ? 1 : 0; |
||||
|
if($action == 'add') { |
||||
|
if($submit) { |
||||
|
captcha($captcha, $MOD['guestbook_captcha']); |
||||
|
if($do->pass($post)) { |
||||
|
$post['areaid'] = $cityid; |
||||
|
$do->add($post); |
||||
|
if($report) message($L['gbook_report_success'], $forward ? $forward : ($DT_PC ? $url : $mob)); |
||||
|
message($L['gbook_success'], $DT_PC ? $url : $mob); |
||||
|
} else { |
||||
|
message($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
$rid = isset($rid) ? intval($rid) : 0; |
||||
|
$content = isset($content) ? dhtmlspecialchars(stripslashes($content)) : ''; |
||||
|
$truename = $telephone = $email = $qq = $wx = $ali = $skype = ''; |
||||
|
if($_userid) { |
||||
|
$user = userinfo($_username); |
||||
|
$truename = $user['truename']; |
||||
|
$telephone = $user['telephone'] ? $user['telephone'] : $user['mobile']; |
||||
|
$email = $user['mail'] ? $user['mail'] : $user['email']; |
||||
|
$qq = $user['qq']; |
||||
|
$wx = $user['wx']; |
||||
|
$ali = $user['ali']; |
||||
|
$skype = $user['skype']; |
||||
|
} |
||||
|
$head_title = $report ? $L['gbook_report_title'] : $L['gbook_title']; |
||||
|
} |
||||
|
} else { |
||||
|
$type = ''; |
||||
|
$condition = "status=3 AND reply<>''"; |
||||
|
if($keyword) $condition .= match_kw('content', $keyword); |
||||
|
if($cityid) $condition .= ($AREA[$cityid]['child']) ? " AND areaid IN (".$AREA[$cityid]['arrchildid'].")" : " AND areaid=$cityid"; |
||||
|
$lists = $do->get_list($condition); |
||||
|
$head_title = $L['gbook_title']; |
||||
|
} |
||||
|
$template = $ext; |
||||
|
if($DT_PC) { |
||||
|
$destoon_task = rand_task(); |
||||
|
if($EXT['mobile_enable']) $head_mobile = strpos($DT_URL, '/api/') === false ? str_replace($url, $mob, $DT_URL) : str_replace(DT_PATH, DT_MOB, $DT_URL); |
||||
|
} else { |
||||
|
if($action == 'add') { |
||||
|
//
|
||||
|
} else { |
||||
|
$pages = mobile_pages($items, $page, $pagesize); |
||||
|
} |
||||
|
$head_name = $L['gbook_title']; |
||||
|
if($sns_app) $seo_title = $site_name; |
||||
|
$foot = ''; |
||||
|
} |
||||
|
include template($template, $module); |
||||
|
?>
|
||||
@ -0,0 +1,52 @@ |
|||||
|
<?php |
||||
|
defined('IN_DESTOON') or exit('Access Denied'); |
||||
|
require DT_ROOT.'/module/'.$module.'/common.inc.php'; |
||||
|
$MOD['link_enable'] or dheader(DT_PATH); |
||||
|
require DT_ROOT.'/include/post.func.php'; |
||||
|
$ext = 'link'; |
||||
|
$url = $EXT[$ext.'_url']; |
||||
|
$mob = $EXT[$ext.'_mob']; |
||||
|
$TYPE = get_type($ext, 1); |
||||
|
$_TP = sort_type($TYPE); |
||||
|
require DT_ROOT.'/module/'.$module.'/'.$ext.'.class.php'; |
||||
|
$do = new dlink(); |
||||
|
$typeid = isset($typeid) ? intval($typeid) : 0; |
||||
|
if($action == 'reg') { |
||||
|
$MOD['link_reg'] or message($L['link_reg_close']); |
||||
|
if($submit) { |
||||
|
captcha($captcha, 1); |
||||
|
$post = dhtmlspecialchars($post); |
||||
|
if($do->pass($post)) { |
||||
|
$r = $db->get_one("SELECT itemid FROM {$DT_PRE}link WHERE linkurl='$post[linkurl]' AND username=''"); |
||||
|
if($r) message($L['link_url_repeat']); |
||||
|
$post['status'] = 2; |
||||
|
$post['level'] = 0; |
||||
|
$post['areaid'] = $cityid; |
||||
|
$do->add($post); |
||||
|
message($L['link_check'], $DT_PC ? $url : $mob); |
||||
|
} else { |
||||
|
message($do->errmsg); |
||||
|
} |
||||
|
} else { |
||||
|
$type_select = type_select($TYPE, 1, 'post[typeid]', $L['link_choose_type'], 0, 'id="typeid"'); |
||||
|
$head_title = $L['link_reg'].$DT['seo_delimiter'].$L['link_title']; |
||||
|
} |
||||
|
} else { |
||||
|
$head_title = $L['link_title']; |
||||
|
if($catid) $typeid = $catid; |
||||
|
if($typeid) { |
||||
|
isset($TYPE[$typeid]) or dheader($DT_PC ? $url : $mob); |
||||
|
$head_title = $TYPE[$typeid]['typename'].$DT['seo_delimiter'].$head_title; |
||||
|
} |
||||
|
} |
||||
|
$template = $ext; |
||||
|
if($DT_PC) { |
||||
|
$destoon_task = rand_task(); |
||||
|
if($EXT['mobile_enable']) $head_mobile = str_replace($url, $mob, $DT_URL); |
||||
|
} else { |
||||
|
$head_name = $L['link_title']; |
||||
|
if($sns_app) $seo_title = $site_name; |
||||
|
$foot = ''; |
||||
|
} |
||||
|
include template($template, $module); |
||||
|
?>
|
||||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue