Browse Source

init

master
zhangf@suq.cn 4 days ago
parent
commit
209de0b9da
  1. 1
      module/article/admin/index.html
  2. 243
      module/article/admin/index.inc.php
  3. 10
      module/article/admin/install.inc.php
  4. 7
      module/article/admin/remkdir.inc.php
  5. 32
      module/article/admin/template/author.tpl.php
  6. 198
      module/article/admin/template/edit.tpl.php
  7. 35
      module/article/admin/template/from.tpl.php
  8. 59
      module/article/admin/template/html.tpl.php
  9. 1
      module/article/admin/template/index.html
  10. 520
      module/article/admin/template/setting.tpl.php
  11. 5
      module/article/admin/uninstall.inc.php
  12. 7
      module/article/common.inc.php
  13. 3
      module/article/global.func.php
  14. 43
      module/article/index.htm.php
  15. 1
      module/article/index.html
  16. 40
      module/article/index.inc.php
  17. 89
      module/article/list.inc.php
  18. 223
      module/article/my.inc.php
  19. 87
      module/article/task.inc.php
  20. 26
      module/brand/admin/config.inc.php
  21. 119
      module/brand/admin/html.inc.php
  22. 1
      module/brand/admin/index.html
  23. 10
      module/brand/admin/install.inc.php
  24. 11
      module/brand/admin/menu.inc.php
  25. 9
      module/brand/admin/remkdir.inc.php
  26. 50
      module/brand/admin/setting.inc.php
  27. 232
      module/brand/admin/template/edit.tpl.php
  28. 1
      module/brand/admin/template/index.html
  29. 491
      module/brand/admin/template/setting.tpl.php
  30. 7
      module/brand/common.inc.php
  31. 3
      module/brand/global.func.php
  32. 46
      module/brand/index.htm.php
  33. 1
      module/brand/index.html
  34. 40
      module/brand/index.inc.php
  35. 88
      module/brand/list.inc.php
  36. 112
      module/brand/message.inc.php
  37. 157
      module/brand/search.inc.php
  38. 92
      module/brand/show.inc.php
  39. 67
      module/brand/task.inc.php
  40. 119
      module/buy/admin/html.inc.php
  41. 251
      module/buy/admin/index.inc.php
  42. 11
      module/buy/admin/menu.inc.php
  43. 50
      module/buy/admin/setting.inc.php
  44. 442
      module/buy/admin/template/edit.tpl.php
  45. 59
      module/buy/admin/template/html.tpl.php
  46. 1
      module/buy/admin/template/index.html
  47. 506
      module/buy/admin/template/setting.tpl.php
  48. 5
      module/buy/admin/uninstall.inc.php
  49. 8
      module/buy/common.inc.php
  50. 54
      module/buy/index.htm.php
  51. 41
      module/buy/index.inc.php
  52. 91
      module/buy/list.htm.php
  53. 113
      module/buy/price.inc.php
  54. 164
      module/buy/search.inc.php
  55. 67
      module/buy/show.htm.php
  56. 69
      module/buy/task.inc.php
  57. 95
      module/club/admin/fans.inc.php
  58. 1
      module/club/admin/index.html
  59. 294
      module/club/admin/index.inc.php
  60. 10
      module/club/admin/install.inc.php
  61. 48
      module/club/admin/manage.inc.php
  62. 11
      module/club/admin/remkdir.inc.php
  63. 140
      module/club/admin/template/edit.tpl.php
  64. 77
      module/club/admin/template/fans.tpl.php
  65. 131
      module/club/admin/template/group.tpl.php
  66. 1
      module/club/admin/template/index.html
  67. 185
      module/club/admin/template/index.tpl.php
  68. 63
      module/club/admin/template/manage.tpl.php
  69. 109
      module/club/admin/template/reply.tpl.php
  70. 47
      module/club/admin/template/reply_edit.tpl.php
  71. 628
      module/club/admin/template/setting.tpl.php
  72. 9
      module/club/admin/uninstall.inc.php
  73. 311
      module/club/club.class.php
  74. 11
      module/club/common.inc.php
  75. 28
      module/club/fans.inc.php
  76. 43
      module/club/global.func.php
  77. 128
      module/club/group.htm.php
  78. 133
      module/club/group.inc.php
  79. 46
      module/club/index.htm.php
  80. 1
      module/club/index.html
  81. 119
      module/club/join.class.php
  82. 92
      module/club/list.htm.php
  83. 91
      module/club/list.inc.php
  84. 74
      module/club/manage.class.php
  85. 79
      module/club/my_fans.inc.php
  86. 128
      module/club/my_group.inc.php
  87. 102
      module/club/my_join.inc.php
  88. 291
      module/club/my_manage.inc.php
  89. 171
      module/club/my_reply.inc.php
  90. 216
      module/club/reply.class.php
  91. 222
      module/club/search.inc.php
  92. 140
      module/club/show.inc.php
  93. 95
      module/club/task.inc.php
  94. 24
      module/company/admin/config.inc.php
  95. 1
      module/company/admin/index.html
  96. 331
      module/company/admin/index.inc.php
  97. 76
      module/company/admin/template/html.tpl.php
  98. 77
      module/company/admin/template/vip_add.tpl.php
  99. 56
      module/company/admin/template/vip_edit.tpl.php
  100. 69
      module/company/admin/template/vip_record.tpl.php

1
module/article/admin/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

243
module/article/admin/index.inc.php

@ -0,0 +1,243 @@
<?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=expire'),
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('模糊', '标题', '关键词', '简介', '作者', '来源', '来源网址', '会员名', '编辑', 'IP', '文件路径', '内容模板');
$dfields = array('keyword', 'title', 'tag', 'introduce', 'author', 'copyfrom', 'fromurl', 'username', 'editor', 'ip', 'filepath', 'template');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '修改时间降序', '修改时间升序', '推荐级别降序', '推荐级别升序', '浏览次数降序', '浏览次数升序', '点赞次数降序', '点赞次数升序', '反对次数降序', '反对次数升序', '收藏次数降序', '收藏次数升序', '打赏次数降序', '打赏次数升序', '打赏金额降序', '打赏金额升序', '分享次数降序', '分享次数升序', '举报次数降序', '举报次数升序', '评论数量降序', '评论数量升序', '信息ID降序', '信息ID升序');
$dorder = array($MOD['order'], 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', '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', 'itemid DESC', 'itemid ASC');
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;
$level = isset($level) ? intval($level) : 0;
$thumb = isset($thumb) ? intval($thumb) : 0;
$link = isset($link) ? intval($link) : 0;
$guest = isset($guest) ? intval($guest) : 0;
$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 .= ($ARE['child']) ? " AND areaid IN (".$ARE['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($link) $condition .= " AND islink>0";
if($guest) $condition .= " AND username=''";
if($ip) $condition .= " AND ip='$ip'";
if($username) $condition .= " AND username='$username'";
if($itemid) $condition .= " AND itemid=$itemid";
$timetype = strpos($dorder[$order], 'edit') === 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);
$username = $_username;
$item = array();
$menuid = 0;
isset($url) or $url = '';
if($url) {
$tmp = fetch_url($url);
if($tmp) extract($tmp);
}
$pagebreak = 0;
$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);
$pagebreak = strpos($item['content'], 'de-pagebreak') === false ? 0 : 1;
$addtime = timetodate($addtime);
$menuon = array('5', '4', '2', '1', '3');
$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 = 6;
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']);
$html_itemids = $itemid;
foreach($html_itemids 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 '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 = 5;
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 = 4;
include tpl('index', $module);
}
break;
case 'expire':
if(isset($refresh)) {
$db->query("UPDATE {$table} SET status=3 WHERE status=4 AND addtime<$DT_TIME");
dmsg('刷新成功', $forward);
} else {
$lists = $do->get_list('status=4'.$condition);
$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;
case 'author':
$condition = "status=3";
if($keyword) $condition .= " AND `author` LIKE '%$keyword%'";
$lists = array();
$result = $db->query("SELECT COUNT(`author`) AS num,author FROM {$table} WHERE $condition GROUP BY `author` ORDER BY num DESC LIMIT 0,50");
$lists[]['author'] = '本站原创';
$lists[]['author'] = '佚名';
while($r = $db->fetch_array($result)) {
if(!$r['author']) continue;
$lists[] = $r;
}
include tpl('author', $module);
break;
case 'from':
$condition = "status=3";
if($keyword) $condition .= " AND (`copyfrom` LIKE '%$keyword%' OR `fromurl` LIKE '%$keyword%')";
$lists = array();
$result = $db->query("SELECT COUNT(`copyfrom`) AS num,copyfrom,fromurl FROM {$table} WHERE $condition GROUP BY `copyfrom` ORDER BY num DESC LIMIT 0,50");
while($r = $db->fetch_array($result)) {
if(!$r['copyfrom']) continue;
$lists[] = $r;
}
include tpl('from', $module);
break;
default:
$lists = $do->get_list('status=3'.$condition, $dorder[$order]);
$menuid = 1;
include tpl('index', $module);
break;
}
?>

10
module/article/admin/install.inc.php

@ -0,0 +1,10 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
$setting = include(DT_ROOT.'/file/setting/module-21.php');
update_setting($moduleid, $setting);
$sql = file_get(DT_ROOT.'/file/setting/'.$module.'.sql');
$sql = str_replace('_21', '_'.$moduleid, $sql);
$sql = str_replace('资讯', $modulename, $sql);
sql_execute($sql);
include DT_ROOT.'/module/'.$module.'/admin/remkdir.inc.php';
?>

7
module/article/admin/remkdir.inc.php

@ -0,0 +1,7 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
install_file($moduleid, 'index', $dir, 1);
install_file($moduleid, 'list', $dir, 1);
install_file($moduleid, 'show', $dir, 1);
install_file($moduleid, 'search', $dir, 1);
?>

32
module/article/admin/template/author.tpl.php

@ -0,0 +1,32 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
include tpl('header');
?>
<div class="sbox">
<form action="?" id="search">
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
<input type="hidden" name="action" value="<?php echo $action;?>"/>
<input type="text" size="40" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/>&nbsp;
<input type="submit" value="搜 索" class="btn"/>&nbsp;
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/>
</form>
</div>
<div class="tt">作者列表</div>
<table cellspacing="0" class="tb">
<?php
foreach($lists as $k=>$v) {
if($k%5==0) { echo '<tr>';}
?>
<td width="20%">&nbsp;&nbsp;<a href="javascript:TopUseBack('<?php echo $v['author'];?>');"><?php echo $v['author'];?></a></td>
<?php
if($k%5==4) { echo '</tr>';}
}
?>
</table>
<script type="text/javascript">
function TopUseBack(v) {
parent.Dd('author').value = v;
parent.cDialog();
}
</script>
<?php include tpl('footer');?>

198
module/article/admin/template/edit.tpl.php

@ -0,0 +1,198 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<form action="?" target="_blank" id="check_title">
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
<input type="hidden" name="file" value="<?php echo $file;?>"/>
<input type="hidden" name="kw" value="" id="kw"/>
</form>
<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">
<?php if($history) { ?>
<tr>
<td class="tl" style="background:#FDE7E7;"><span class="f_red">*</span> 审核提示</td>
<td style="background:#FDE7E7;">该信息存在修改记录,<a href="javascript:Dwidget('?file=history&mid=<?php echo $moduleid;?>&itemid=<?php echo $itemid;?>', '修改详情');" class="t">点击查看</a> 修改详情</td>
</tr>
<?php } ?>
<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);?>&nbsp;&nbsp;<input type="checkbox" name="post[islink]" value="1" id="islink" onclick="_islink();"<?php if($islink) echo ' checked';?>/><label for="islink"> 外部链接</label> <span id="dcatid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> <?php echo $MOD['name'];?>标题</td>
<td><input name="post[title]" type="text" id="title" size="70" value="<?php echo $title;?>"/> <?php echo level_select('post[level]', '级别', $level, 'id="level"');?> <?php echo dstyle('post[style]', $style);?>&nbsp;&nbsp;<input type="button" value="标题检测" onclick="check_title();" class="btn"/> <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 标题图片</td>
<td><input name="post[thumb]" id="thumb" type="text" size="70" value="<?php echo $thumb;?>" ondblclick="Dthumb(<?php echo $moduleid;?>,Dd('level').value==2 ? 430 : <?php echo $MOD['thumb_width'];?>,Dd('level').value==2 ? 325 : <?php echo $MOD['thumb_height'];?>, Dd('thumb').value);"/>&nbsp;&nbsp;<span onclick="Dthumb(<?php echo $moduleid;?>,Dd('level').value==2 ? 430 : <?php echo $MOD['thumb_width'];?>,Dd('level').value==2 ? 325 : <?php echo $MOD['thumb_height'];?>, Dd('thumb').value);" class="jt">[上传]</span>&nbsp;&nbsp;<span onclick="_preview(Dd('thumb').value);" class="jt">[预览]</span>&nbsp;&nbsp;<span onclick="Dd('thumb').value='';" class="jt">[删除]</span></td>
</tr>
<?php if($CP) { ?>
<script type="text/javascript">
var property_catid = <?php echo $catid;?>;
var property_itemid = <?php echo $itemid;?>;
var property_admin = 1;
</script>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/property.js?v=<?php echo DT_DEBUG ? DT_TIME : DT_REFRESH;?>"></script>
<tbody id="load_property" style="display:none;">
<tr><td></td><td></td></tr>
</tbody>
<?php } ?>
<?php echo $FD ? fields_html('<td class="tl">', '<td>', $item) : '';?>
<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;?>"/>&nbsp;&nbsp;<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_red">*</span> <?php echo $MOD['name'];?>内容</td>
<td><textarea name="post[content]" id="content" class="dsn"><?php echo $content;?></textarea>
<?php echo deditor($moduleid, 'content', $MOD['editor'], '98%', 350);?><br/><span id="dcontent" class="f_red"></span>
</td>
</tr>
<tr>
<td class="tl" height="30"><span class="f_hid">*</span> 内容选项</td>
<td>
<a href="javascript:pagebreak();Ds('subtitle');"><img src="admin/image/pagebreak.gif" align="absmiddle"/> 插入分页符</a>&nbsp; &nbsp;
<input type="checkbox" name="post[save_remotepic]" value="1"<?php if($MOD['save_remotepic']) echo 'checked';?>/> 下载远程图片&nbsp; &nbsp;
<input type="checkbox" name="post[clear_link]" value="1"<?php if($MOD['clear_link']) echo 'checked';?>/> 清除链接&nbsp; &nbsp;
截取内容 <input name="post[introduce_length]" type="text" size="2" value="<?php echo $MOD['introduce_length']?>"/> 字符至简介&nbsp; &nbsp;
设置内容第 <input name="post[thumb_no]" type="text" size="2" value=""/> 张图片为标题图&nbsp; &nbsp;
插入投票 <input name="post[voteid]" type="text" size="10" value="<?php echo $voteid;?>"/> <a href="javascript:Dwidget('?moduleid=3&file=vote', '投票列表');" class="t">[查看]</a> <?php tips('请填写投票ID,多个ID请用空格隔开');?>
</td>
</tr>
<tbody id="subtitle" style="display:<?php echo $pagebreak ? '' : 'none';?>;">
<tr>
<td class="tl"><span class="f_hid">*</span> 分页标题</td>
<td>
<textarea name="post[subtitle]" style="width:90%;height:45px;"><?php echo $subtitle;?></textarea>
<br/>1行一个分页标题,按回车换行
</td>
</tr>
</tbody>
<tr>
<td class="tl"><span class="f_hid">*</span> <?php echo $MOD['name'];?>简介</td>
<td><textarea name="post[introduce]" style="width:90%;height:45px;"><?php echo $introduce;?></textarea></td>
</tr>
<tr height="30">
<td class="tl"><span class="f_hid">*</span> <?php echo $MOD['name'];?>作者</td>
<td><input type="text" size="10" name="post[author]" value="<?php echo $author;?>" id="author"/> &nbsp; <img src="<?php echo DT_STATIC;?>file/image/ico-link.png" width="11" height="11" title="选择常用作者" class="c_p" onclick="Dwidget('?moduleid=<?php echo $moduleid;?>&action=author', '选择作者');"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;来源 <input type="text" size="12" name="post[copyfrom]" value="<?php echo $copyfrom;?>" id="copyfrom"/>&nbsp;&nbsp;&nbsp;&nbsp;链接 <input type="text" size="25" name="post[fromurl]" value="<?php echo $fromurl;?>" id="fromurl"/> &nbsp; <img src="<?php echo DT_STATIC;?>file/image/ico-link.png" width="11" height="11" title="选择常用来源" class="c_p" onclick="Dwidget('?moduleid=<?php echo $moduleid;?>&action=from', '选择来源');"/></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 标签(Tag)</td>
<td><input name="post[tag]" type="text" size="70" value="<?php echo $tag;?>"/><?php tips('多个标签请用空格隔开');?></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> <?php echo $MOD['name'];?>状态</td>
<td>
<input type="radio" name="post[status]" value="3" <?php if($status == 3) echo 'checked';?> id="status_3"/><label for="status_3"> 通过</label>
<input type="radio" name="post[status]" value="2" <?php if($status == 2) echo 'checked';?> id="status_2"/><label for="status_2"> 待审</label>
<input type="radio" name="post[status]" value="4" <?php if($status == 4) echo 'checked';?> id="status_4"/><label for="status_4"> 待发</label>
<input type="radio" name="post[status]" value="1" <?php if($status == 1) echo 'checked';?> onclick="if(this.checked) Dd('note').style.display='';" id="status_1"/><label for="status_1"> 拒绝</label>
<input type="radio" name="post[status]" value="0" <?php if($status == 0) echo 'checked';?> id="status_0"/><label for="status_0"> 删除</label>
</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><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 浏览次数</td>
<td><input name="post[hits]" type="text" size="10" value="<?php echo $hits;?>"/></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 内容收费</td>
<td><input name="post[fee]" type="text" size="5" value="<?php echo $fee;?>"/><?php tips('不填或填0表示继承模块设置价格,-1表示不收费<br/>大于0的数字表示具体收费价格');?>
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 内容模板</td>
<td><?php echo tpl_select('show', $module, 'post[template]', '默认模板', $template, 'id="template"');?><?php tips('如果没有特殊需要,一般不需要选择<br/>系统会自动继承分类或模块设置');?></td>
</tr>
<?php if($MOD['show_html']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> 自定义文件路径</td>
<td><input type="text" size="70" name="post[filepath]" value="<?php echo $filepath;?>" id="filepath"/>&nbsp;<input type="button" value="重名检测" onclick="ckpath(<?php echo $moduleid;?>, <?php echo $itemid;?>);" class="btn"/>&nbsp;<?php tips('可以包含目录和文件 例如 destoon/b2b.html<br/>请确保目录和文件名合法且可写入,否则可能生成失败');?>&nbsp; <span id="dfilepath" class="f_red"></span></td>
</tr>
<?php } ?>
</table>
<div class="sbt"><input type="submit" name="submit" value="<?php echo $action == 'edit' ? '修 改' : '添 加';?>" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;<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'); ?>
<?php if($action == 'add') { ?>
<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="catid" value="<?php echo $catid;?>"/>
<div class="tt">单页采编</div>
<table cellspacing="0" class="tb">
<tr>
<td class="tl"><span class="f_hid">*</span> 目标网址</td>
<td><input name="url" type="text" size="80" value="<?php echo $url;?>"/>&nbsp;&nbsp;<input type="submit" value=" 获 取 " class="btn"/>&nbsp;&nbsp;<input type="button" value=" 管理规则 " class="btn" onclick="Dwidget('?file=fetch', '管理规则');"/></td>
</tr>
</table>
</form>
<?php } ?>
<script type="text/javascript">
function check_title() {
if(Dd('title').value.length < 2) {
Dmsg('请填写标题', 'title');
} else {
Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&kw='+encodeURIComponent(Dd('title').value), '标题检测');
}
}
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('标题最少2字,当前已输入'+l+'字', f);
return false;
}
if(Dd('islink').checked) {
f = 'linkurl';
l = Dd(f).value.length;
if(l < 12) {
Dmsg('请输入正确的链接地址', f);
return false;
}
} else {
f = 'content';
l = EditorLen();
if(l < 5) {
Dmsg('内容最少5字,当前已输入'+l+'字', f);
return false;
}
}
<?php echo $FD ? fields_js() : '';?>
<?php echo $CP ? property_js() : '';?>
return true;
}
</script>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

35
module/article/admin/template/from.tpl.php

@ -0,0 +1,35 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
include tpl('header');
?>
<div class="sbox">
<form action="?" id="search">
<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
<input type="hidden" name="action" value="<?php echo $action;?>"/>
<input type="text" size="40" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/>&nbsp;
<input type="submit" value="搜 索" class="btn"/>&nbsp;
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/>
</form>
</div>
<table cellspacing="0" class="tb ls">
<tr>
<th>来源</th>
<th>网址</th>
<th width="40">选择</th>
</tr>
<?php foreach($lists as $k=>$v) { ?>
<tr>
<td>&nbsp;<a href="javascript:TopUseBack('<?php echo $v['copyfrom'];?>','<?php echo $v['fromurl'];?>');"><?php echo $v['copyfrom'];?></a></td>
<td>&nbsp;<a href="<?php echo DT_PATH;?>api/redirect.php?url=<?php echo urlencode(fix_link($v['fromurl']));?>" target="_blank"><?php echo $v['fromurl'];?></a></td>
<td align="center"><a href="javascript:TopUseBack('<?php echo $v['copyfrom'];?>','<?php echo $v['fromurl'];?>');" class="t">[选择]</a></td>
</tr>
<?php } ?>
</table>
<script type="text/javascript">
function TopUseBack(v, u) {
parent.Dd('copyfrom').value = v;
parent.Dd('fromurl').value = u;
parent.cDialog();
}
</script>
<?php include tpl('footer');?>

59
module/article/admin/template/html.tpl.php

@ -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">&nbsp;
<input type="submit" value="一键更新" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=all';" title="生成该模块所有网页"/>&nbsp;&nbsp;
<input type="submit" value="生成首页" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=index';" title="生成该模块首页"/>&nbsp;&nbsp;
<input type="submit" value="生成列表" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=list';" title="生成该模块所有分类"/>&nbsp;&nbsp;
<input type="submit" value="生成内容" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show';" title="生成该模块所有内容页"/>&nbsp;&nbsp;
<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';"/>&nbsp;
<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);?>
&nbsp;&nbsp;&nbsp;&nbsp;
<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';"/>&nbsp;
<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');?>

1
module/article/admin/template/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

520
module/article/admin/template/setting.tpl.php

@ -0,0 +1,520 @@
<?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('show', $module, 'setting[template_show]', '默认模板', $template_show);?></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><?php echo tpl_select('my_'.$module, 'member', 'setting[template_my]', '默认模板', $template_my);?></td>
</tr>
<tr>
<td class="tl">默认缩略图[宽X高]</td>
<td>
<input type="text" size="3" name="setting[thumb_width]" value="<?php echo $thumb_width;?>"/>
X
<input type="text" size="3" name="setting[thumb_height]" value="<?php echo $thumb_height;?>"/> px
</td>
</tr>
<tr>
<td class="tl">自动截取内容至简介</td>
<td><input type="text" size="3" name="setting[introduce_length]" value="<?php echo $introduce_length;?>"/> 字符</td>
</tr>
<tr>
<td class="tl">编辑器工具按钮</td>
<td>
<select name="setting[editor]">
<option value="Default"<?php if($editor == 'Default') echo ' selected';?>>全部</option>
<option value="Destoon"<?php if($editor == 'Destoon') echo ' selected';?>>精简</option>
<option value="Simple"<?php if($editor == 'Simple') echo ' selected';?>>简洁</option>
<option value="Basic"<?php if($editor == 'Basic') echo ' selected';?>>基础</option>
</select>
</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="addtime desc"<?php if($order == 'addtime desc') echo ' selected';?>>添加时间</option>
<option value="edittime desc"<?php if($order == 'edittime desc') echo ' selected';?>>更新时间</option>
<option value="itemid desc"<?php if($order == 'itemid 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[cat_property]" value="1" <?php if($cat_property) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[cat_property]" value="0" <?php if(!$cat_property) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">下载内容远程图片</td>
<td>
<input type="radio" name="setting[save_remotepic]" value="1" <?php if($save_remotepic) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[save_remotepic]" value="0" <?php if(!$save_remotepic) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">清除内容链接</td>
<td>
<input type="radio" name="setting[clear_link]" value="1" <?php if($clear_link) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[clear_link]" value="0" <?php if(!$clear_link) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">内容关联链接</td>
<td>
<input type="radio" name="setting[keylink]" value="1" <?php if($keylink) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[keylink]" value="0" <?php if(!$keylink) echo 'checked';?>/> 关闭
&nbsp;&nbsp;
<a href="javascript:Dwidget('?file=keylink&item=<?php echo $moduleid;?>', '[<?php echo $MOD['name'];?>]关联链接管理');" class="t">[管理链接]</a>
</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', '开启内容分表');"/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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', '关闭内容分表');"/> 关闭
&nbsp;<?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[fulltext]" value="1" <?php if($fulltext==1){ ?>checked <?php } ?>/> LIKE&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fulltext]" value="2" <?php if($fulltext==2){ ?>checked <?php } ?>/> MATCH&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fulltext]" value="0" <?php if($fulltext==0){ ?>checked <?php } ?>/> 关闭
<?php tips('此项会增加服务器负担,请根据需要和服务器配置决定是否开启。MATCH模式需要MySQL 4以上版本,且需要在MySQL的my.ini添加ft_min_word_len=1才能支持2个汉字的中文搜索。如果不能设置可以使用LIKE模式,但是效率会低于MATCH模式。<br/>开启MATCH模式请在数据库维护里执行以下SQL添加全文索引<br/>ALTER TABLE `'.$table_data.'` ADD FULLTEXT (`content`);<br/>全文索引占用一定数据空间,如果不开启MATCH模式可以执行以下语句删除索引<br/>ALTER TABLE `'.$table_data.'` DROP INDEX `content`;');?></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_islide]" value="<?php echo $page_islide;?>"/></td>
</tr>
<tr>
<td class="tl">首页分类信息数量</td>
<td><input type="text" size="3" name="setting[page_icat]" value="<?php echo $page_icat;?>"/></td>
</tr>
<tr>
<td class="tl">首页显示按分类浏览</td>
<td>
<input type="radio" name="setting[show_icat]" value="1" <?php if($show_icat) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[show_icat]" value="0" <?php if(!$show_icat) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">首页推荐图文数量</td>
<td><input type="text" size="3" name="setting[page_irecimg]" value="<?php echo $page_irecimg;?>"/></td>
</tr>
<tr>
<td class="tl">首页点击排行数量</td>
<td><input type="text" size="3" name="setting[page_ihits]" value="<?php echo $page_ihits;?>"/></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="text" size="3" name="setting[page_child]" value="<?php echo $page_child;?>"/></td>
</tr>
<tr>
<td class="tl">列表显示按分类浏览</td>
<td>
<input type="radio" name="setting[show_lcat]" value="1" <?php if($show_lcat) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[show_lcat]" value="0" <?php if(!$show_lcat) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">列表推荐图文数量</td>
<td><input type="text" size="3" name="setting[page_lrecimg]" value="<?php echo $page_lrecimg;?>"/></td>
</tr>
<tr>
<td class="tl">列表推荐信息数量</td>
<td><input type="text" size="3" name="setting[page_lrec]" value="<?php echo $page_lrec;?>"/></td>
</tr>
<tr>
<td class="tl">列表点击排行数量</td>
<td><input type="text" size="3" name="setting[page_lhits]" value="<?php echo $page_lhits;?>"/></td>
</tr>
<tr>
<td class="tl">内容同类信息数量</td>
<td><input type="text" size="3" name="setting[page_srelate]" value="<?php echo $page_srelate;?>"/></td>
</tr>
<tr>
<td class="tl">内容推荐图文数量</td>
<td><input type="text" size="3" name="setting[page_srecimg]" value="<?php echo $page_srecimg;?>"/></td>
</tr>
<tr>
<td class="tl">内容推荐信息数量</td>
<td><input type="text" size="3" name="setting[page_srec]" value="<?php echo $page_srec;?>"/></td>
</tr>
<tr>
<td class="tl">内容点击排行数量</td>
<td><input type="text" size="3" name="setting[page_shits]" value="<?php echo $page_shits;?>"/></td>
</tr>
<tr>
<td class="tl">内容图片最大宽度</td>
<td><input type="text" size="3" name="setting[max_width]" value="<?php echo $max_width;?>"/> px</td>
</tr>
<tr>
<td class="tl">内容点击次数</td>
<td>
<input type="radio" name="setting[hits]" value="1" <?php if($hits) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[likes]" value="0" <?php if(!$likes) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">内容显示上一篇下一篇</td>
<td>
<input type="radio" name="setting[show_np]" value="1" <?php if($show_np) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[show_np]" value="0" <?php if(!$show_np) echo 'checked';?>/> 关闭
<?php tips('此项会略微增加服务器负担');?>
</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 } ?>/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<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';"/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<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">内容页是否生成html</td>
<td>
<input type="radio" name="setting[show_html]" value="1" <?php if($show_html){ ?>checked <?php } ?> onclick="Dd('show_html').style.display='';Dd('show_php').style.display='none';"/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[show_html]" value="0" <?php if(!$show_html){ ?>checked <?php } ?> onclick="Dd('show_html').style.display='none';Dd('show_php').style.display='';"/> 否
</td>
</tr>
<tbody id="show_html" style="display:<?php echo $show_html ? '' : 'none'; ?>">
<tr>
<td class="tl">HTML内容页文件名前缀</td>
<td><input name="setting[htm_item_prefix]" type="text" id="htm_item_prefix" value="<?php echo $htm_item_prefix;?>" size="10"></td>
</tr>
<tr>
<td class="tl">HTML内容页地址规则</td>
<td><?php echo url_select('setting[htm_item_urlid]', 'htm', 'item', $htm_item_urlid);?></td>
</tr>
</tbody>
<tr id="show_php" style="display:<?php echo $show_html ? 'none' : ''; ?>">
<td class="tl">PHP内容页地址规则</td>
<td><?php echo url_select('setting[php_item_urlid]', 'php', 'item', $php_item_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_show][]', $group_show);?></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_color][]', $group_color);?></td>
</tr>
<tr>
<td class="tl">审核发布信息</td>
<td>
<input type="radio" name="setting[check_add]" value="2" <?php if($check_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_add]" value="1" <?php if($check_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_add]" value="0" <?php if($check_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">发布信息启用验证码</td>
<td>
<input type="radio" name="setting[captcha_add]" value="2" <?php if($captcha_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_add]" value="1" <?php if($captcha_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_add]" value="0" <?php if($captcha_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">发布信息验证问题</td>
<td>
<input type="radio" name="setting[question_add]" value="2" <?php if($question_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_add]" value="1" <?php if($question_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_add]" value="0" <?php if($question_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">会员是否收费</td>
<td>
<input type="radio" name="setting[fee_mode]" value="1" <?php if($fee_mode == 1) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fee_mode]" value="0" <?php if($fee_mode == 0) echo 'checked';?>> 全部启用
</td>
</tr>
<tr>
<td class="tl">会员收费使用</td>
<td>
<input type="radio" name="setting[fee_currency]" value="money" <?php if($fee_currency == 'money') echo 'checked';?>/> <?php echo $DT['money_name'];?>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fee_currency]" value="credit" <?php if($fee_currency == 'credit') echo 'checked';?>/> <?php echo $DT['credit_name'];?>
</td>
</tr>
<tr>
<td class="tl">发布信息收费</td>
<td><input type="text" size="5" name="setting[fee_add]" value="<?php echo $fee_add;?>"/> <?php echo $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?>/条</td>
</tr>
<tr>
<td class="tl">查看信息收费</td>
<td><input type="text" size="5" name="setting[fee_view]" value="<?php echo $fee_view;?>"/> <?php echo $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?>/条</td>
</tr>
<tr>
<td class="tl">收费有效时间</td>
<td><input type="text" size="5" name="setting[fee_period]" value="<?php echo $fee_period;?>"/> 分钟 <?php tips('如果支付时间超过有效时间,系统将重新收费<br/>填零表示不重复收费');?></td>
</tr>
<tr>
<td class="tl">向发布人返利</td>
<td><input type="text" size="2" name="setting[fee_back]" value="<?php echo $fee_back;?>"/> % <?php tips('请填写1-100之间的数字,用户支付之后,系统将按此比例向发布人增加对应的'.$DT['money_name'].'或者'.$DT['credit_name']);?></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>
<tr>
<td class="tl">未支付内容显示</td>
<td><input type="text" size="5" name="setting[pre_view]" value="<?php echo $pre_view;?>"/> 字符</td>
</tr>
</table>
<div class="tt"><?php echo $DT['credit_name'];?>规则</div>
<table cellspacing="0" class="tb">
<tr>
<td class="tl">发布信息奖励</td>
<td>
<input type="text" size="5" name="setting[credit_add]" value="<?php echo $credit_add;?>"/>
</td>
</tr>
<tr>
<td class="tl">信息被删除扣除</td>
<td>
<input type="text" size="5" name="setting[credit_del]" value="<?php echo $credit_del;?>"/>
</td>
</tr>
<tr>
<td class="tl">信息设置颜色扣除</td>
<td>
<input type="text" size="5" name="setting[credit_color]" value="<?php echo $credit_color;?>"/>
</td>
</tr>
</table>
<div class="tt">发布数量</div>
<table cellspacing="0" class="tb">
<tr align="center">
<td width="158">会员组</td>
<td width="100">总数限制</td>
<td width="100">免费数量</td>
<td align="right"><a href="<?php echo DT_PATH;?>api/redirect.php?url=https://www.destoon.com/doc/skill/94.html" target="_blank" class="t">设置说明</a></td>
</tr>
<?php foreach($GROUP as $v) {?>
<tr align="center">
<td><?php echo $v['groupname'];?></td>
<?php $k = 'limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<?php $k = 'free_limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<td></td>
</tr>
<?php }?>
</table>
</div>
<div class="sbt">
<input type="submit" name="submit" value="保 存" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;
<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');?>

5
module/article/admin/uninstall.inc.php

@ -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."`");
?>

7
module/article/common.inc.php

@ -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;
?>

3
module/article/global.func.php

@ -0,0 +1,3 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
?>

43
module/article/index.htm.php

@ -0,0 +1,43 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext'];
if(!$MOD['index_html']) return html_del($filename);
$maincat = $childcat = get_maincat(0, $moduleid, 1);
$seo_file = 'index';
include DT_ROOT.'/include/seo.inc.php';
$destoon_task = "moduleid=$moduleid&html=index";
$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 = "status=3";
$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) {
$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']);
if(!$r['islink']) $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'];
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;
?>

1
module/article/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

40
module/article/index.inc.php

@ -0,0 +1,40 @@
<?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 {
$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']);
if(!$r['islink']) $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);
?>

89
module/article/list.inc.php

@ -0,0 +1,89 @@
<?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']);
if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl'];
$tags[] = $r;
}
$db->free_result($result);
}
$showpage = 1;
$datetype = 3;
$cols = 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']);
if(!$r['islink']) $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);
?>

223
module/article/my.inc.php

@ -0,0 +1,223 @@
<?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;
}
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($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(isset($post['islink'])) unset($post['islink']);
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;
$post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0;
$post['clear_link'] = $MOD['clear_link'] ? 1 : 0;
$post['introduce_length'] = $MOD['introduce_length'] ? $MOD['introduce_length'] : 0;
$post['areaid'] = $cityid;
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 {
$_catid = $catid;
foreach($do->fields as $v) {
$$v = '';
}
$content = '';
$catid = $_catid;
$areaid = $cityid;
$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($item['islink']) {
$post['islink'] = 1;
} else if(isset($post['islink'])) {
unset($post['islink']);
}
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['username'] = $_username;
$post['hits'] = $item['hits'];
$post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0;
$post['clear_link'] = $MOD['clear_link'] ? 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 = lang($L['module_manage'], array($MOD['name']));
include template($MOD['template_my'] ? $MOD['template_my'] : 'my_'.$module, 'member');
?>

87
module/article/task.inc.php

@ -0,0 +1,87 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
if($html == 'show') {
$itemid or exit;
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid");
if(!$item || $item['status'] < 3) exit;
require DT_ROOT.'/include/content.class.php';
extract($item);
$fee = DC::fee($item['fee'], $MOD['fee_view']);
$currency = $MOD['fee_currency'];
$fee_unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];
$fee_name = $currency == 'money' ? $DT['money_name'] : $DT['credit_name'];
$inner = false;
if(check_group($_groupid, $MOD['group_show'])) {
if($fee) {
$inner = true;
if($MG['fee_mode'] && $MOD['fee_mode']) {
$user_status = 3;
} else {
$mid = $moduleid;
if($_userid) {
$user_status = check_pay($mid, $itemid) ? 3 : 2;
} else {
$user_status = 0;
}
}
} else {
$user_status = 3;
}
} else {
$inner = true;
$user_status = $_userid ? 1 : 0;
}
if($_username && $_username == $item['username']) $user_status = 3;
if($inner) {
if($user_status == 3 || $user_status == 2) {
$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data);
$content = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid");
$content = $content['content'];
if($content) {
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 = $contents[$page-1];
}
}
if($content) {
if($user_status == 2) $description = DC::description($content, $MOD['pre_view']);
if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC);
$content = DC::format($content, $DT_PC);
}
}
}
$content = strip_nr(ob_template('content', 'chip'), true);
echo 'Inner("content", \''.$content.'\');';
}
$update = '';
if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php';
if($MOD['hits']) echo 'Inner("hits", \''.$item['hits'].'\');';
if($MOD['show_html'] && $task_item && $DT_TIME - @filemtime(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl']) > $task_item) tohtml('show', $module);
} else if($html == 'list') {
$catid or exit;
if($MOD['list_html'] && $task_list && $CAT) {
$num = 1;
$totalpage = max(ceil($CAT['item']/$MOD['pagesize']), 1);
$demo = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, '{DEMO}');
$fid = $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
$fid = $page + 1;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
$fid = $totalpage + 1 - $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
}
} else if($html == 'index') {
if($DT['cache_hits'] && $MOD['hits']) {
$file = DT_CACHE.'/hits-'.$moduleid;
if($DT_TIME - @filemtime($file.'.dat') > $DT['cache_hits'] || @filesize($file.'.php') > 102400) update_hits($moduleid, $table);
}
if($MOD['index_html']) {
$file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext'];
if($DT_TIME - @filemtime($file) > $task_index) tohtml('index', $module);
}
}
?>

26
module/brand/admin/config.inc.php

@ -0,0 +1,26 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
$MCFG['module'] = 'brand';
$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;
?>

119
module/brand/admin/html.inc.php

@ -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 {$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'];
$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;
}
?>

1
module/brand/admin/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

10
module/brand/admin/install.inc.php

@ -0,0 +1,10 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
$setting = include(DT_ROOT.'/file/setting/module-13.php');
update_setting($moduleid, $setting);
$sql = file_get(DT_ROOT.'/file/setting/'.$module.'.sql');
$sql = str_replace('_13', '_'.$moduleid, $sql);
$sql = str_replace('品牌', $modulename, $sql);
sql_execute($sql);
include DT_ROOT.'/module/'.$module.'/admin/remkdir.inc.php';
?>

11
module/brand/admin/menu.inc.php

@ -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"),
);
?>

9
module/brand/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, 'message', $dir, 1);
?>

50
module/brand/admin/setting.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;
}
}
?>

232
module/brand/admin/template/edit.tpl.php

@ -0,0 +1,232 @@
<?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">
<?php if($history) { ?>
<tr>
<td class="tl" style="background:#FDE7E7;"><span class="f_red">*</span> 审核提示</td>
<td style="background:#FDE7E7;">该信息存在修改记录,<a href="javascript:Dwidget('?file=history&mid=<?php echo $moduleid;?>&itemid=<?php echo $itemid;?>', '修改详情');" class="t">点击查看</a> 修改详情</td>
</tr>
<?php } ?>
<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> <?php echo $MOD['name'];?>名称</td>
<td><input name="post[title]" type="text" id="title" size="70" value="<?php echo $title;?>"/> <?php echo level_select('post[level]', '级别', $level);?> <?php echo dstyle('post[style]', $style);?> <br/><span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 品牌LOGO</td>
<td><input name="post[thumb]" id="thumb" type="text" size="70" value="<?php echo $thumb;?>" ondblclick="Dthumb(<?php echo $moduleid;?>,<?php echo $MOD['thumb_width'];?>,<?php echo $MOD['thumb_height'];?>, Dd('thumb').value);"/>&nbsp;&nbsp;<span onclick="Dthumb(<?php echo $moduleid;?>,<?php echo $MOD['thumb_width'];?>,<?php echo $MOD['thumb_height'];?>, Dd('thumb').value);" class="jt">[上传]</span>&nbsp;&nbsp;<span onclick="_preview(Dd('thumb').value);" class="jt">[预览]</span>&nbsp;&nbsp;<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><input name="post[homepage]" id="homepage" type="text" size="70" value="<?php echo $homepage;?>"/></td>
</tr>
<?php if($CP) { ?>
<script type="text/javascript">
var property_catid = <?php echo $catid;?>;
var property_itemid = <?php echo $itemid;?>;
var property_admin = 1;
</script>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/property.js?v=<?php echo DT_DEBUG ? DT_TIME : DT_REFRESH;?>"></script>
<tbody id="load_property" style="display:none;">
<tr><td></td><td></td></tr>
</tbody>
<?php } ?>
<?php echo $FD ? fields_html('<td class="tl">', '<td>', $item) : '';?>
<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', $MOD['editor'], '98%', 350);?><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="ismember" value="1" <?php if($username) echo 'checked';?> onclick="Dh('d_guest');Ds('d_member');Dd('username').value='<?php echo $username;?>';" id="ismember_1"/><label for="ismember_1"> 是</label>&nbsp;&nbsp;&nbsp;
<input type="radio" name="ismember" value="0" <?php if(!$username) echo 'checked';?> onclick="Dh('d_member');Ds('d_guest');Dd('username').value='';" id="ismember_0"/><label for="ismember_0"> 否</label>
</td>
</tr>
<tbody id="d_member" style="display:<?php echo $username ? '' : 'none';?>">
<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>
</tbody>
<tbody id="d_guest" style="display:<?php echo $username ? 'none' : '';?>">
<tr>
<td class="tl"><span class="f_red">*</span> 公司名称</td>
<td class="tr"><input name="post[company]" type="text" id="company" size="70" value="<?php echo $company;?>" /> 个人请填姓名 例如:张三<br/><span id="dcompany" class="f_red"></span> </td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 所在地区</td>
<td class="tr"><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?> <span id="dareaid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 联系人</td>
<td class="tr"><input name="post[truename]" type="text" id="truename" size="20" value="<?php echo $truename;?>" /> <span id="dtruename" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 联系手机</td>
<td class="tr"><input name="post[mobile]" id="mobile" type="text" size="30" value="<?php echo $mobile;?>"/> <span id="dmobile" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 电子邮件</td>
<td class="tr"><input name="post[email]" id="email" type="text" size="30" value="<?php echo $email;?>" /> <span id="demail" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 联系电话</td>
<td class="tr"><input name="post[telephone]" id="telephone" type="text" size="30" value="<?php echo $telephone;?>"/> <span id="dtelephone" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 联系地址</td>
<td class="tr"><input name="post[address]" id="address" type="text" size="70" value="<?php echo $address;?>"/></td>
</tr>
<?php if($DT['im_qq']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> QQ</td>
<td class="tr"><input name="post[qq]" id="qq" type="text" size="30" value="<?php echo $qq;?>"/></td>
</tr>
<?php } ?>
<?php if($DT['im_wx']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> 微信</td>
<td class="tr"><input name="post[wx]" id="wx" type="text" size="30" value="<?php echo $wx;?>"/></td>
</tr>
<?php } ?>
<?php if($DT['im_ali']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> 阿里旺旺</td>
<td class="tr"><input name="post[ali]" id="ali" type="text" size="30" value="<?php echo $ali;?>"/></td>
</tr>
<?php } ?>
<?php if($DT['im_skype']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> Skype</td>
<td class="tr"><input name="post[skype]" id="skype" type="text" size="30" value="<?php echo $skype;?>"/></td>
</tr>
<?php } ?>
</tbody>
<tr>
<td class="tl"><span class="f_hid">*</span> <?php echo $MOD['name'];?>状态</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><input name="post[hits]" type="text" size="10" value="<?php echo $hits;?>"/></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 内容收费</td>
<td><input name="post[fee]" type="text" size="5" value="<?php echo $fee;?>"/><?php tips('不填或填0表示继承模块设置价格,-1表示不收费<br/>大于0的数字表示具体收费价格');?>
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 内容模板</td>
<td><?php echo tpl_select('show', $module, 'post[template]', '默认模板', $template, 'id="template"');?><?php tips('如果没有特殊需要,一般不需要选择<br/>系统会自动继承分类或模块设置');?></td>
</tr>
<?php if($MOD['show_html']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> 自定义文件路径</td>
<td><input type="text" size="70" name="post[filepath]" value="<?php echo $filepath;?>" id="filepath"/>&nbsp;<input type="button" value="重名检测" onclick="ckpath(<?php echo $moduleid;?>, <?php echo $itemid;?>);" class="btn"/>&nbsp;<?php tips('可以包含目录和文件 例如 destoon/b2b.html<br/>请确保目录和文件名合法且可写入,否则可能生成失败');?>&nbsp; <span id="dfilepath" class="f_red"></span></td>
</tr>
<?php } ?>
</table>
<div class="sbt"><input type="submit" name="submit" value="<?php echo $action == 'edit' ? '修 改' : '添 加';?>" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;<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'); ?>
<?php if($action == 'add') { ?>
<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;?>"/>
<div class="tt">单页采编</div>
<table cellspacing="0" class="tb">
<tr>
<td class="tl"><span class="f_hid">*</span> 目标网址</td>
<td><input name="url" type="text" size="80" value="<?php echo $url;?>"/>&nbsp;&nbsp;<input type="submit" value=" 获 取 " class="btn"/>&nbsp;&nbsp;<input type="button" value=" 管理规则 " class="btn" onclick="Dwidget('?file=fetch', '管理规则');"/></td>
</tr>
</table>
</form>
<?php } ?>
<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;
}
if(Dd('ismember_1').checked) {
f = 'username';
l = Dd(f).value.length;
if(l < 2) {
Dmsg('请填写会员名', f);
return false;
}
} else {
f = 'company';
l = Dd(f).value.length;
if(l < 2) {
Dmsg('请填写公司名称', f);
return false;
}
if(Dd('areaid_1').value == 0) {
Dmsg('请选择所在地区', 'areaid');
return false;
}
f = 'truename';
l = Dd(f).value.length;
if(l < 2) {
Dmsg('请填写联系人', f);
return false;
}
f = 'mobile';
l = Dd(f).value.length;
if(l < 7) {
Dmsg('请填写手机', f);
return false;
}
}
<?php echo $FD ? fields_js() : '';?>
<?php echo $CP ? property_js() : '';?>
return true;
}
</script>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

1
module/brand/admin/template/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

491
module/brand/admin/template/setting.tpl.php

@ -0,0 +1,491 @@
<?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('show', $module, 'setting[template_show]', '默认模板', $template_show);?></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><?php echo tpl_select('my_'.$module, 'member', 'setting[template_my]', '默认模板', $template_my);?></td>
</tr>
<tr>
<td class="tl">加盟默认模板</td>
<td><?php echo tpl_select('message', $module, 'setting[template_message]', '默认模板', $template_message);?></td>
</tr>
<tr>
<td class="tl">默认LOGO[宽X高]</td>
<td>
<input type="text" size="3" name="setting[thumb_width]" value="<?php echo $thumb_width;?>"/>
X
<input type="text" size="3" name="setting[thumb_height]" value="<?php echo $thumb_height;?>"/> px
</td>
</tr>
<tr>
<td class="tl">自动截取内容至简介</td>
<td><input type="text" size="3" name="setting[introduce_length]" value="<?php echo $introduce_length;?>"/> 字符</td>
</tr>
<tr>
<td class="tl">编辑器工具按钮</td>
<td>
<select name="setting[editor]">
<option value="Default"<?php if($editor == 'Default') echo ' selected';?>>全部</option>
<option value="Destoon"<?php if($editor == 'Destoon') echo ' selected';?>>精简</option>
<option value="Simple"<?php if($editor == 'Simple') echo ' selected';?>>简洁</option>
<option value="Basic"<?php if($editor == 'Basic') echo ' selected';?>>基础</option>
</select>
</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="editdate desc,vip desc,edittime desc"<?php if($order == 'editdate desc,vip desc,edittime desc') echo ' selected';?>>更新日期,<?php echo VIP;?>级别,更新时间</option>
<option value="adddate desc,vip desc,addtime desc"<?php if($order == 'adddate desc,vip desc,addtime desc') echo ' selected';?>>添加日期,<?php echo VIP;?>级别,添加时间</option>
<option value="edittime desc"<?php if($order == 'edittime desc') echo ' selected';?>>更新时间</option>
<option value="addtime desc"<?php if($order == 'addtime desc') echo ' selected';?>>添加时间</option>
<option value="vip desc"<?php if($order == 'vip desc') echo ' selected';?>><?php echo VIP;?>级别</option>
<option value="itemid desc"<?php if($order == 'itemid 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>
<textarea name="setting[message_ask]" style="width:98%;height:50px;overflow:visible;"><?php echo $message_ask;?></textarea>
<br/>不同问题用 | 分隔
</td>
</tr>
<tr>
<td class="tl">分类属性参数</td>
<td>
<input type="radio" name="setting[cat_property]" value="1" <?php if($cat_property) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[cat_property]" value="0" <?php if(!$cat_property) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">下载内容远程图片</td>
<td>
<input type="radio" name="setting[save_remotepic]" value="1" <?php if($save_remotepic) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[save_remotepic]" value="0" <?php if(!$save_remotepic) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">清除内容链接</td>
<td>
<input type="radio" name="setting[clear_link]" value="1" <?php if($clear_link) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[clear_link]" value="0" <?php if(!$clear_link) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">内容关联链接</td>
<td>
<input type="radio" name="setting[keylink]" value="1" <?php if($keylink) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[keylink]" value="0" <?php if(!$keylink) echo 'checked';?>/> 关闭
&nbsp;&nbsp;
<a href="javascript:Dwidget('?file=keylink&item=<?php echo $moduleid;?>', '[<?php echo $MOD['name'];?>]关联链接管理');" class="t">[管理链接]</a>
</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', '开启内容分表');"/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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', '关闭内容分表');"/> 关闭
&nbsp;<?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[fulltext]" value="1" <?php if($fulltext==1){ ?>checked <?php } ?>/> LIKE&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fulltext]" value="2" <?php if($fulltext==2){ ?>checked <?php } ?>/> MATCH&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fulltext]" value="0" <?php if($fulltext==0){ ?>checked <?php } ?>/> 关闭
<?php tips('此项会增加服务器负担,请根据需要和服务器配置决定是否开启。MATCH模式需要MySQL 4以上版本,且需要在MySQL的my.ini添加ft_min_word_len=1才能支持2个汉字的中文搜索。如果不能设置可以使用LIKE模式,但是效率会低于MATCH模式。<br/>开启MATCH模式请在数据库维护里执行以下SQL添加全文索引<br/>ALTER TABLE `'.$table_data.'` ADD FULLTEXT (`content`);<br/>全文索引占用一定数据空间,如果不开启MATCH模式可以执行以下语句删除索引<br/>ALTER TABLE `'.$table_data.'` DROP INDEX `content`;');?></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">首页分类信息数量</td>
<td><input type="text" size="3" name="setting[page_icat]" value="<?php echo $page_icat;?>"/></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="text" size="3" name="setting[max_width]" value="<?php echo $max_width;?>"/> px</td>
</tr>
<tr>
<td class="tl">内容点击次数</td>
<td>
<input type="radio" name="setting[hits]" value="1" <?php if($hits) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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 } ?>/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<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';"/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<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">内容页是否生成html</td>
<td>
<input type="radio" name="setting[show_html]" value="1" <?php if($show_html){ ?>checked <?php } ?> onclick="Dd('show_html').style.display='';Dd('show_php').style.display='none';"/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[show_html]" value="0" <?php if(!$show_html){ ?>checked <?php } ?> onclick="Dd('show_html').style.display='none';Dd('show_php').style.display='';"/> 否
</td>
</tr>
<tbody id="show_html" style="display:<?php echo $show_html ? '' : 'none'; ?>">
<tr>
<td class="tl">HTML内容页文件名前缀</td>
<td><input name="setting[htm_item_prefix]" type="text" id="htm_item_prefix" value="<?php echo $htm_item_prefix;?>" size="10"></td>
</tr>
<tr>
<td class="tl">HTML内容页地址规则</td>
<td><?php echo url_select('setting[htm_item_urlid]', 'htm', 'item', $htm_item_urlid);?></td>
</tr>
</tbody>
<tr id="show_php" style="display:<?php echo $show_html ? 'none' : ''; ?>">
<td class="tl">PHP内容页地址规则</td>
<td><?php echo url_select('setting[php_item_urlid]', 'php', 'item', $php_item_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_show][]', $group_show);?></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_search][]', $group_search);?></td>
</tr>
<tr>
<td class="tl">允许设置标题颜色</td>
<td><?php echo group_checkbox('setting[group_color][]', $group_color);?></td>
</tr>
<tr>
<td class="tl">刷新信息不扣积分</td>
<td><?php echo group_checkbox('setting[group_refresh][]', $group_refresh);?></td>
</tr>
<tr>
<td class="tl">留言启用验证码</td>
<td>
<input type="radio" name="setting[captcha_message]" value="2" <?php if($captcha_message == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_message]" value="1" <?php if($captcha_message == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_message]" value="0" <?php if($captcha_message == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">留言验证问题</td>
<td>
<input type="radio" name="setting[question_message]" value="2" <?php if($question_message == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_message]" value="1" <?php if($question_message == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_message]" value="0" <?php if($question_message == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">审核发布信息</td>
<td>
<input type="radio" name="setting[check_add]" value="2" <?php if($check_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_add]" value="1" <?php if($check_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_add]" value="0" <?php if($check_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">发布信息启用验证码</td>
<td>
<input type="radio" name="setting[captcha_add]" value="2" <?php if($captcha_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_add]" value="1" <?php if($captcha_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_add]" value="0" <?php if($captcha_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">发布信息验证问题</td>
<td>
<input type="radio" name="setting[question_add]" value="2" <?php if($question_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_add]" value="1" <?php if($question_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_add]" value="0" <?php if($question_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">会员是否收费</td>
<td>
<input type="radio" name="setting[fee_mode]" value="1" <?php if($fee_mode == 1) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fee_mode]" value="0" <?php if($fee_mode == 0) echo 'checked';?>> 全部启用
</td>
</tr>
<tr>
<td class="tl">会员收费使用</td>
<td>
<input type="radio" name="setting[fee_currency]" value="money" <?php if($fee_currency == 'money') echo 'checked';?>/> <?php echo $DT['money_name'];?>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fee_currency]" value="credit" <?php if($fee_currency == 'credit') echo 'checked';?>/> <?php echo $DT['credit_name'];?>
</td>
</tr>
<tr>
<td class="tl">发布信息收费</td>
<td><input type="text" size="5" name="setting[fee_add]" value="<?php echo $fee_add;?>"/> <?php echo $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?>/条</td>
</tr>
<tr>
<td class="tl">收费有效时间</td>
<td><input type="text" size="5" name="setting[fee_period]" value="<?php echo $fee_period;?>"/> 分钟 <?php tips('如果支付时间超过有效时间,系统将重新收费<br/>填零表示不重复收费');?></td>
</tr>
<tr>
<td class="tl">向发布人返利</td>
<td><input type="text" size="2" name="setting[fee_back]" value="<?php echo $fee_back;?>"/> % <?php tips('请填写1-100之间的数字,用户支付之后,系统将按此比例向发布人增加对应的'.$DT['money_name'].'或者'.$DT['credit_name']);?></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>
<tr>
<td class="tl">查看信息收费</td>
<td><input type="text" size="5" name="setting[fee_view]" value="<?php echo $fee_view;?>"/> <?php echo $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?>/条</td>
</tr>
</table>
<div class="tt"><?php echo $DT['credit_name'];?>规则</div>
<table cellspacing="0" class="tb">
<tr>
<td class="tl">发布信息奖励</td>
<td>
<input type="text" size="5" name="setting[credit_add]" value="<?php echo $credit_add;?>"/>
</td>
</tr>
<tr>
<td class="tl">信息被删除扣除</td>
<td>
<input type="text" size="5" name="setting[credit_del]" value="<?php echo $credit_del;?>"/>
</td>
</tr>
<tr>
<td class="tl">信息设置颜色扣除</td>
<td>
<input type="text" size="5" name="setting[credit_color]" value="<?php echo $credit_color;?>"/>
</td>
</tr>
<tr>
<td class="tl">刷新一条信息一次扣除</td>
<td>
<input type="text" size="5" name="setting[credit_refresh]" value="<?php echo $credit_refresh;?>"/>
</td>
</tr>
</table>
<div class="tt">发布数量</div>
<table cellspacing="0" class="tb">
<tr align="center">
<td width="158">会员组</td>
<td width="100">总数限制</td>
<td width="100">免费数量</td>
<td align="right"><a href="<?php echo DT_PATH;?>api/redirect.php?url=https://www.destoon.com/doc/skill/94.html" target="_blank" class="t">设置说明</a></td>
</tr>
<?php foreach($GROUP as $v) {?>
<tr align="center">
<td><?php echo $v['groupname'];?></td>
<?php $k = 'limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<?php $k = 'free_limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<td></td>
</tr>
<?php }?>
</table>
</div>
<div class="sbt">
<input type="submit" name="submit" value="保 存" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;
<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');?>

7
module/brand/common.inc.php

@ -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;
?>

3
module/brand/global.func.php

@ -0,0 +1,3 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
?>

46
module/brand/index.htm.php

@ -0,0 +1,46 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext'];
if(!$MOD['index_html']) return html_del($filename);
$maincat = get_maincat(0, $moduleid, 1);
$seo_file = 'index';
include DT_ROOT.'/include/seo.inc.php';
$destoon_task = "moduleid=$moduleid&html=index";
$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 = "status=3";
$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'];
$time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime';
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} 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?job=ajax';
}
$head_title = $head_name = $MOD['name'];
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;
?>

1
module/brand/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

40
module/brand/index.inc.php

@ -0,0 +1,40 @@
<?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);
$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);
?>

88
module/brand/list.inc.php

@ -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);
?>

112
module/brand/message.inc.php

@ -0,0 +1,112 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
if($DT_BOT) dhttp(403);
$itemid or dheader($MOD['linkurl']);
$MG['message_limit'] > -1 or message(lang('message->without_permission'));
require DT_ROOT.'/module/'.$module.'/common.inc.php';
include load('misc.lang');
$item = $db->get_one("SELECT title,linkurl,username,company,vip,status FROM {$table} WHERE itemid=$itemid");
$item or message($L['not_exists']);
$item['status'] == 3 or message($L['not_exists']);
$item['username'] or message($L['com_not_member']);
$_username != $item['username'] or message($L['send_self']);
$limit_used = $limit_free = 0;
if($MG['message_limit']) {
$today = $DT_TODAY - 86400;
$sql = $_userid ? "fromuser='$_username'" : "ip='$DT_IP'";
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}message WHERE $sql AND addtime>$today AND status=3");
$limit_used = $r['num'];
$limit_used < $MG['message_limit'] or message(lang($L['message_limit'], array($MG['message_limit'], $limit_used)));
$limit_free = $MG['message_limit'] > $limit_used ? $MG['message_limit'] - $limit_used : 0;
}
$linkurl = $MOD['linkurl'].$item['linkurl'];
$need_captcha = $MOD['captcha_message'] == 2 ? $MG['captcha'] : $MOD['captcha_message'];
$need_question = $MOD['question_message'] == 2 ? $MG['question'] : $MOD['question_message'];
require DT_ROOT.'/include/post.func.php';
if($_userid) {
$user = userinfo($_username);
$company = $user['company'];
$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'];
}
if($submit) {
captcha($captcha, $need_captcha);
question($answer, $need_question);
$title = dhtmlspecialchars(trim($title));
if(!$title) message($L['msg_type_title']);
$content = dhtmlspecialchars(trim($content));
if(!$content) message($L['msg_type_content']);
if(!$_userid) {
$truename = dhtmlspecialchars(trim($truename));
if(!$truename) message($L['msg_type_truename']);
$telephone = dhtmlspecialchars(trim($telephone));
if(!$telephone) message($L['msg_type_telephone']);
$email = dhtmlspecialchars(trim($email));
$company = dhtmlspecialchars(trim($company));
if($DT['im_qq']) $qq = dhtmlspecialchars(trim($qq));
if($DT['im_wx']) $wx = dhtmlspecialchars(trim($wx));
if($DT['im_ali'])$ali = dhtmlspecialchars(trim($ali));
if($DT['im_skype']) $skype = dhtmlspecialchars(trim($skype));
}
$content = nl2br($content);
if($company) $content .= '<br/>'.$L['content_company'].'<span data-company="1">'.$company.'</span>';
if($truename) $content .= '<br/>'.$L['content_truename'].'<span data-truename="1">'.$truename.'</span>';
if($telephone) $content .= '<br/>'.$L['content_telephone'].'<span data-telephone="1">'.$telephone.'</span>';
if(is_email($email)) $content .= '<br/>'.$L['content_email'].'<span data-email="1">'.$email.'</span>';
if($DT['im_qq'] && is_qq($qq)) $content .= '<br/>'.$L['content_qq'].' '.im_qq($qq).' <span data-qq="1">'.$qq.'</span>';
if($DT['im_wx'] && is_wx($wx)) $content .= '<br/>'.$L['content_wx'].' '.im_wx($wx, $_username).' <span data-wx="1">'.$wx.'</span>';
if($DT['im_ali'] && $ali) $content .= '<br/>'.$L['content_ali'].' '.im_ali($ali).' <span data-ali="1">'.$ali.'</span>';
if($DT['im_skype'] && $skype) $content .= '<br/>'.$L['content_skype'].' '.im_skype($skype).' <span data-skype="1">'.$skype.'</span>';
if(is_date($date)) $content .= '<br/>'.lang($L['content_date'], array($date));
$message = $L['content_brand'].'<a href="'.$linkurl.'"><strong>'.$item['title'].'</strong></a><br/>'.$content;
//send sms
if($DT['sms'] && $_sms && $item['username'] && isset($sendsms)) {
$touser = userinfo($item['username']);
if($touser['mobile']) {
$message = lang('sms->sms_message', array($item['title'], $itemid, $truename, $telephone));
$message = strip_sms($message);
$word = word_count($message);
$sms_num = ceil($word/$DT['sms_len']);
if($sms_num <= $_sms) {
$sms_code = send_sms($touser['mobile'], $message, $word);
if(strpos($sms_code, $DT['sms_ok']) !== false) {
$tmp = explode('/', $sms_code);
if(is_numeric($tmp[1])) $sms_num = $tmp[1];
if($sms_num) sms_add($_username, -$sms_num);
if($sms_num) sms_record($_username, -$sms_num, $_username, $MOD['name'].$L['sms_message'], 'ID:'.$itemid);
}
}
}
}
//send sms
$forward = $DT_PC ? $linkurl : str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl);
if(send_message($item['username'], $title, $message, 3, $_username, $moduleid, $itemid)) {
$db->query("UPDATE {$table} SET messages=messages+1 WHERE itemid=$itemid");
message($L['msg_message_success'], $forward);
} else {
message($_userid ? $L['msg_member_failed'] : $L['msg_guest_failed']);
}
}
$iask = explode('|', trim($MOD['message_ask']));
isset($content) or $content = '';
$date = timetodate($DT_TIME + 5*86400, 3);
$title = lang($L['brand_message_title'], array($item['title']));
$head_title = $L['brand_head_title'].$DT['seo_delimiter'].$item['title'].$DT['seo_delimiter'].$MOD['name'];
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['brand_head_title'];
if($sns_app) $seo_title = $MOD['name'];
$js_pull = 0;
$foot = '';
}
include template($MOD['template_message'] ? $MOD['template_message'] : 'message', $module);
?>

157
module/brand/search.inc.php

@ -0,0 +1,157 @@
<?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);
}
(isset($fromdate) && is_date($fromdate)) or $fromdate = '';
$fromtime = $fromdate ? datetotime($fromdate.' 0:0:0') : 0;
(isset($todate) && is_date($todate)) or $todate = '';
$totime = $todate ? datetotime($todate.' 23:59:59') : 0;
$sfields = array($L['by_auto'], $L['by_title'], $L['by_content'], $L['by_introduce'], $L['by_company']);
$dfields = array('keyword', 'title', 'content', 'introduce', 'company');
$sorder = array($L['order'], $L['order_auto'], $L['order_edittime'], $L['order_vip'], $L['order_hits']);
$dorder = array($MOD['order'], '', 'edittime DESC', 'vip 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 = 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($fromtime) $condition .= " AND addtime>=$fromtime";
if($totime) $condition .= " AND addtime<=$totime";
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']);
$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;
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('dmessages', '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']);
$r['linkurl'] = $MOD['mobile'].$r['linkurl'];
$r['date'] = timetodate($r[$time], 3);
$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);
?>

92
module/brand/show.inc.php

@ -0,0 +1,92 @@
<?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, 3);
$editdate = timetodate($edittime, 3);
$linkurl = $MOD['linkurl'].$linkurl;
$maincat = get_maincat(0, $moduleid);
$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);
}
$editdate = timetodate($edittime, 5);
$could_message = ($user_status == 3 && $username && $username != $_username) ? 1 : 0;
$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';
$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show'));
include template($template, $module);
?>

67
module/brand/task.inc.php

@ -0,0 +1,67 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
if($html == 'show') {
$itemid or exit;
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid");
if(!$item || $item['status'] < 3) exit;
require DT_ROOT.'/include/content.class.php';
extract($item);
$fee = DC::fee($item['fee'], $MOD['fee_view']);
$currency = $MOD['fee_currency'];
$fee_unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];
$fee_name = $currency == 'money' ? $DT['money_name'] : $DT['credit_name'];
$member = array();
if(check_group($_groupid, $MOD['group_contact'])) {
if($fee) {
if($MG['fee_mode'] && $MOD['fee_mode']) {
$user_status = 3;
} else {
$mid = $moduleid;
if($_userid) {
$user_status = check_pay($mid, $itemid) ? 3 : 2;
} else {
$user_status = 0;
}
}
} else {
$user_status = 3;
}
} else {
$user_status = $_userid ? 1 : 0;
}
if($_username && $_username == $item['username']) $user_status = 3;
if($user_status == 3 && $item['username']) $member = userinfo($item['username']);
$contact = strip_nr(ob_template('contact', 'chip'), true);
echo 'Inner("contact", \''.$contact.'\');';
if($MOD['hits']) echo 'Inner("hits", \''.$item['hits'].'\');';
$update = '';
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');
}
if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php';
if($MOD['show_html'] && $task_item && $DT_TIME - @filemtime(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl']) > $task_item) tohtml('show', $module);
} else if($html == 'list') {
$catid or exit;
if($MOD['list_html'] && $task_list && $CAT) {
$num = 1;
$totalpage = max(ceil($CAT['item']/$MOD['pagesize']), 1);
$demo = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, '{DEMO}');
$fid = $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
$fid = $page + 1;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
$fid = $totalpage + 1 - $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
}
} else if($html == 'index') {
if($DT['cache_hits'] && $MOD['hits']) {
$file = DT_CACHE.'/hits-'.$moduleid;
if($DT_TIME - @filemtime($file.'.dat') > $DT['cache_hits'] || @filesize($file.'.php') > 102400) update_hits($moduleid, $table);
}
if($MOD['index_html']) {
$file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext'];
if($DT_TIME - @filemtime($file) > $task_index) tohtml('index', $module);
}
}
?>

119
module/buy/admin/html.inc.php

@ -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 {$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'];
$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;
}
?>

251
module/buy/admin/index.inc.php

@ -0,0 +1,251 @@
<?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=expire'),
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', '参数名1', '参数名2', '参数名3', '参数值1', '参数值2', '参数值3', '文件路径', '内容模板');
$dfields = array('keyword', 'title', 'tag', 'thumbs', 'video', 'amount', 'price', 'pack', 'introduce', 'company', 'truename', 'telephone', 'address', 'email', 'qq', 'wx', 'username', 'editor', 'ip', 'n1', 'n2', 'n3', 'v1', 'v2', 'v3', '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;
$typeid = isset($typeid) ? ($typeid === '' ? -1 : intval($typeid)) : -1;
$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);
$type_select = dselect($TYPE, 'typeid', $MOD['name'].'类型', $typeid);
$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($typeid >=0 ) $condition .= " AND typeid=$typeid";
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);
} else {
msg($do->errmsg);
}
} else {
foreach($do->fields as $v) {
isset($$v) or $$v = '';
}
$content = '';
$status = 3;
$addtime = timetodate($DT_TIME);
$totime = '';
$username = $_username;
$typeid = 0;
$item = $thumbs = 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);
$thumbs = get_thumbs($item);
$addtime = timetodate($addtime);
$totime = $totime ? timetodate($totime, 6) : '';
$menuon = array('5', '4', '2', '1', '3');
$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 = 6;
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 'type':
$itemid or msg('请选择'.$MOD['name']);
$tid = intval($tid);
array_key_exists($tid, $TYPE) or $tid = 0;
$do->type($itemid, $tid);
dmsg('类型设置成功', $forward);
break;
case 'recycle':
$lists = $do->get_list('status=0'.$condition, $dorder[$order]);
$menuid = 5;
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 = 4;
include tpl('index', $module);
}
break;
case 'expire':
if(isset($refresh)) {
if(isset($extend)) {
$days = isset($days) ? intval($days) : 0;
$days or msg('请填写天数');
$itemid or msg('请选择信息');
foreach($itemid as $v) {
$db->query("UPDATE {$table} SET totime=totime+$days*86400,status=3 WHERE itemid='$v' AND totime>0");
}
$do->expire();
dmsg('延时成功', $forward);
} else {
$do->expire();
dmsg('刷新成功', $forward);
}
} else {
$lists = $do->get_list('status=4'.$condition);
$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;
}
?>

11
module/buy/admin/menu.inc.php

@ -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"),
);
?>

50
module/buy/admin/setting.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;
}
}
?>

442
module/buy/admin/template/edit.tpl.php

@ -0,0 +1,442 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/player.js?v=<?php echo DT_DEBUG ? DT_TIME : DT_REFRESH;?>"></script>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/url2video.js?v=<?php echo DT_DEBUG ? DT_TIME : DT_REFRESH;?>"></script>
<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">
<?php if($history) { ?>
<tr>
<td class="tl" style="background:#FDE7E7;"><span class="f_red">*</span> 审核提示</td>
<td style="background:#FDE7E7;">该信息存在修改记录,<a href="javascript:Dwidget('?file=history&mid=<?php echo $moduleid;?>&itemid=<?php echo $itemid;?>', '修改详情');" class="t">点击查看</a> 修改详情</td>
</tr>
<?php } ?>
<tr>
<td class="tl"><span class="f_red">*</span> 信息类型</td>
<td>
<?php foreach($TYPE as $k=>$v) {?>
<input type="radio" name="post[typeid]" value="<?php echo $k;?>" <?php if($k==$typeid) echo 'checked';?> id="typeid_<?php echo $k;?>"/> <label for="typeid_<?php echo $k;?>" id="t_<?php echo $k;?>"><?php echo $v;?></label>&nbsp;
<?php } ?>
</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 level_select('post[level]', '级别', $level);?> <?php echo dstyle('post[style]', $style);?> <br/><span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 行业分类</td>
<td><div id="catesch"></div><?php echo ajax_category_select('post[catid]', '选择分类', $catid, $moduleid);?> &nbsp; <a href="javascript:schcate(<?php echo $moduleid;?>);" class="t">搜索分类</a> <span id="dcatid" class="f_red"></span></td>
</tr>
<?php if($CP) { ?>
<script type="text/javascript">
var property_catid = <?php echo $catid;?>;
var property_itemid = <?php echo $itemid;?>;
var property_admin = 1;
</script>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/property.js?v=<?php echo DT_DEBUG ? DT_TIME : DT_REFRESH;?>"></script>
<tbody id="load_property" style="display:none;">
<tr><td></td><td></td></tr>
</tbody>
<?php } ?>
<?php echo $FD ? fields_html('<td class="tl">', '<td>', $item) : '';?>
<tr>
<td class="tl"><span class="f_hid">*</span> 产品图片</td>
<td>
<div id="thumbs">
<?php if(is_array($thumbs)) { foreach($thumbs as $k => $v) { ?>
<div class="thumbs">
<input type="hidden" name="post[thumbs][]" id="thumb<?php echo $k;?>" value="<?php echo $v;?>"/>
<div><img src="<?php if($v) { ?><?php echo $v;?><?php } else { ?><?php echo DT_SKIN;?>image/waitpic.gif<?php } ?>" width="100" height="100" id="showthumb<?php echo $k;?>" title="上传/预览图片" alt="" onerror="this.src='<?php echo DT_SKIN;?>image/waitpic.gif';" onclick="if(this.src.indexOf('waitpic.gif') == -1){_preview(Dd('showthumb<?php echo $k;?>').src, 1);}else{Dalbum(<?php echo $k;?>,<?php echo $moduleid;?>,<?php echo $MOD['thumb_width'];?>,<?php echo $MOD['thumb_height'];?>, Dd('thumb<?php echo $k;?>').value, true);}"/></div>
<p><img src="<?php echo DT_STATIC;?>file/image/ico-upl.png" width="11" height="11" title="上传" onclick="Dalbum(<?php echo $k;?>,<?php echo $moduleid;?>,<?php echo $MOD['thumb_width'];?>,<?php echo $MOD['thumb_height'];?>, Dd('thumb<?php echo $k;?>').value, true);"/><img src="<?php echo DT_STATIC;?>file/image/ico-sel.png" width="11" height="11" title="选择" onclick="selAlbum(<?php echo $k;?>);" style="margin:0 11px;"/><img src="<?php echo DT_STATIC;?>file/image/ico-del.png" width="11" height="11" title="删除" onclick="delAlbum(<?php echo $k;?>,'wait');"/></p>
</div>
<?php } } ?>
</div>
<div class="dsn" id="thumbtpl">
<div class="thumbs">
<input type="hidden" name="post[thumbs][]" id="thumb-99" value=""/>
<div><img src="<?php echo DT_SKIN;?>image/waitpic.gif" width="100" height="100" id="showthumb-99" title="上传/预览图片" alt="" onclick="if(this.src.indexOf('waitpic.gif') == -1){_preview(Dd('showthumb-99').src, 1);}else{Dalbum(-99,<?php echo $moduleid;?>,<?php echo $MOD['thumb_width'];?>,<?php echo $MOD['thumb_height'];?>, Dd('thumb-99').value, true);}"/></div>
<p><img src="<?php echo DT_STATIC;?>file/image/ico-upl.png" width="11" height="11" title="上传" onclick="Dalbum(-99,<?php echo $moduleid;?>,<?php echo $MOD['thumb_width'];?>,<?php echo $MOD['thumb_height'];?>, Dd('thumb<?php echo $thumbs ? $k : '0';?>').value, true);"/><img src="<?php echo DT_STATIC;?>file/image/ico-sel.png" width="11" height="11" title="选择" onclick="selAlbum(-99);" style="margin:0 11px;"/><img src="<?php echo DT_STATIC;?>file/image/ico-del.png" width="11" height="11" title="删除" onclick="delAlbum(-99,'wait');"/></p>
</div>
</div>
<div class="thumbs" id="thumbmuti" title="批量上传图片,按Ctrl键多选">
<div id="file-picker"><img src="<?php echo DT_SKIN;?>image/addpic.gif" width="100" height="100" alt=""/></div>
<p>批量上传<span id="file-progress"></span></p>
</div>
<span id="dthumb" class="f_red"></span>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/webuploader.min.js?v=<?php echo DT_DEBUG ? DT_TIME : DT_REFRESH;?>"></script>
<script type="text/javascript">
var album_max = parseInt(<?php echo $DT['thumb_max'];?>);
if(album_max < 5 || album_max > 99) album_max = 9;
var fileu = WebUploader.create({
auto: true,
server: UPPath+'?moduleid=<?php echo $moduleid;?>&action=webuploader&from=album&width=<?php echo $MOD['thumb_width'];?>&height=<?php echo $MOD['thumb_height'];?>',
pick: '#file-picker',
accept: {
title: 'image',
extensions: 'jpg,jpeg,png,gif',
mimeTypes: 'image/*'
},
resize: false
});
fileu.on('fileQueued', function(file) {
$('#file-progress').html('0%');
});
fileu.on('uploadProgress', function(file, percentage) {
var p = parseInt(percentage * 100);
if(p >= 100) p = 100;
$('#file-progress').html(p+'%');
});
fileu.on( 'uploadSuccess', function(file, data) {
if(data.error) {
Dmsg(data.message, 'thumb');
} else {
addAlbum(data.url);
}
});
fileu.on( 'uploadError', function(file, data) {
Dmsg(data.message, 'thumb');
});
fileu.on('uploadFinished', function(file) {
$('#file-progress').html('');
if($("#thumbs input[value!='']").length >= album_max) $('#thumbmuti').hide();
});
function addAlbum(url) {
for(var i = 0; i < album_max; i++) {
if($('#thumb'+i).length) {
if($('#thumb'+i).val() == '') {
$('#thumb'+i).val(url);
$('#showthumb'+i).attr('src', url);
return;
}
} else {
$('#thumbs').append($('#thumbtpl').html().replace(/-99/g, i));
$('#thumb'+i).val(url);
$('#showthumb'+i).attr('src', url);
return;
}
}
Dmsg('最多上传'+album_max+'张图片', 'thumb');
$('#thumbmuti').hide();
}
$(function(){
if($("#thumbs input[value!='']").length >= album_max) window.setTimeout(function(){$('#thumbmuti').hide();}, 3000);
});
</script>
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 宣传视频</td>
<td><input name="post[video]" type="text" id="video" size="70" value="<?php echo $video;?>" onblur="UpdateURL();"/>&nbsp;&nbsp;<span id="video-picker" class="jt">[上传]</span>&nbsp;&nbsp;<span onclick="vs();" class="jt">[预览]</span>&nbsp;&nbsp;<span onclick="Dd('video').value='';vh();$('#video-progress').html('');" class="jt">[删除]</span>&nbsp;&nbsp;<span id="video-progress" class="f_gray"></span> <span id="dvideo" class="f_red"></span>
<script type="text/javascript">
$(function(){
var filev = WebUploader.create({
auto: true,
server: UPPath+'?moduleid=<?php echo $moduleid;?>&action=webuploader&from=file',
pick: '#video-picker',
accept: {
title: 'video',
extensions: 'mp4',
mimeTypes: 'video/*'
},
resize: false
});
filev.on('fileQueued', function(file) {
$('#video-progress').html('0%');
});
filev.on('uploadProgress', function(file, percentage) {
var p = parseInt(percentage * 100);
if(p >= 100) p = 100;
$('#video-progress').html(p+'%');
});
filev.on( 'uploadSuccess', function(file, data) {
if(data.error) {
Dmsg(data.message, 'video');
} else {
$('#video-progress').html('100%');
$('#video').val(data.url);
}
});
filev.on( 'uploadError', function(file, data) {
Dmsg(data.message, 'video');
});
filev.on('uploadComplete', function(file) {
$('#video-progress').html('100%');
});
window.setTimeout(function() {
$('#video-progress').html(' ');
}, 1000);
});
function vs() {
UpdateURL();
if(Dd('video').value.length > 5) {
Ds('v_player');
Inner('v_play', player(Dd('video').value,400,300,1));
} else {
Dmsg('视频地址为空', 'video');
vh();
}
}
function vh() {Inner('v_play', '');Dh('v_player');}
function UpdateURL() {
var str = url2video(Dd('video').value);
if(str) Dd('video').value = str;
}
</script>
</td>
</tr>
<tr id="v_player" style="display:none;">
<td class="tl"><span class="f_hid">*</span> 视频预览</td>
<td><div id="v_play"></div><div style="padding-top:10px;"><a href="javascript:" onclick="vh();" class="t">[关闭预览]</a></div></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 主要参数</td>
<td class="nv">
<table cellspacing="1" class="ctb">
<tr bgcolor="#F7F7F7" align="center">
<td>参数名称</td>
<td>参数值</td>
</tr>
<tr>
<td><input name="post[n1]" type="text" size="10" value="<?php echo $n1;?>" id="n1"/></td>
<td><input name="post[v1]" type="text" size="20" value="<?php echo $v1;?>" id="v1"/></td>
</tr>
<tr>
<td><input name="post[n2]" type="text" size="10" value="<?php echo $n2;?>" id="n2"/></td>
<td><input name="post[v2]" type="text" size="20" value="<?php echo $v2;?>" id="v2"/></td>
</tr>
<tr>
<td><input name="post[n3]" type="text" size="10" value="<?php echo $n3;?>" id="n3"/></td>
<td><input name="post[v3]" type="text" size="20" value="<?php echo $v3;?>" id="v3"/></td>
</tr>
<tr>
<td class="f_gray">例如:规格</td>
<td class="f_gray">例如:10cm*20cm</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 交易条件</td>
<td class="nv">
<table cellspacing="1" class="ctb">
<tr bgcolor="#F7F7F7" align="center">
<td>需求数量</td>
<td>价格要求</td>
<td>包装要求</td>
</tr>
<tr>
<td><input name="post[amount]" type="text" size="20" value="<?php echo $amount;?>"/></td>
<td><input name="post[price]" type="text" size="20" value="<?php echo $price;?>"/></td>
<td><input name="post[pack]" type="text" size="20" value="<?php echo $pack;?>"/></td>
</tr>
</table>
</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', $MOD['editor'], '98%', 350);?><br/><span id="dcontent" class="f_red"></span>
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 过期时间</td>
<td><?php echo dcalendar('post[totime]', $totime, '-', 1);?>&nbsp;
<select onchange="Dd('posttotime').value=this.value;">
<option value="">快捷选择</option>
<option value="">长期有效</option>
<option value="<?php echo timetodate($DT_TIME+86400*3, 3);?> 23:59:59">3</option>
<option value="<?php echo timetodate($DT_TIME+86400*7, 3);?> 23:59:59">一周</option>
<option value="<?php echo timetodate($DT_TIME+86400*15, 3);?> 23:59:59">半月</option>
<option value="<?php echo timetodate($DT_TIME+86400*30, 3);?> 23:59:59">一月</option>
<option value="<?php echo timetodate($DT_TIME+86400*182, 3);?> 23:59:59">半年</option>
<option value="<?php echo timetodate($DT_TIME+86400*365, 3);?> 23:59:59">一年</option>
</select>&nbsp;
<span id="dposttotime" class="f_red"></span> 不选表示长期有效</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 会员信息</td>
<td>
<input type="radio" name="ismember" value="1" <?php if($username) echo 'checked';?> onclick="Dh('d_guest');Ds('d_member');Dd('username').value='<?php echo $username;?>';" id="ismember_1"/><label for="ismember_1"> 是</label>&nbsp;&nbsp;&nbsp;
<input type="radio" name="ismember" value="0" <?php if(!$username) echo 'checked';?> onclick="Dh('d_member');Ds('d_guest');Dd('username').value='';" id="ismember_0"/><label for="ismember_0"> 否</label>
</td>
</tr>
<tbody id="d_member" style="display:<?php echo $username ? '' : 'none';?>">
<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>
</tbody>
<tbody id="d_guest" style="display:<?php echo $username ? 'none' : '';?>">
<tr>
<td class="tl"><span class="f_red">*</span> 公司名称</td>
<td class="tr"><input name="post[company]" type="text" id="company" size="70" value="<?php echo $company;?>" /> 个人请填姓名 例如:张三<br/><span id="dcompany" class="f_red"></span> </td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 所在地区</td>
<td class="tr"><?php echo ajax_area_select('post[areaid]', '请选择', $areaid);?> <span id="dareaid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 联系人</td>
<td class="tr"><input name="post[truename]" type="text" id="truename" size="20" value="<?php echo $truename;?>" /> <span id="dtruename" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 联系手机</td>
<td class="tr"><input name="post[mobile]" id="mobile" type="text" size="30" value="<?php echo $mobile;?>"/> <span id="dmobile" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 电子邮件</td>
<td class="tr"><input name="post[email]" id="email" type="text" size="30" value="<?php echo $email;?>" /> <span id="demail" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 联系电话</td>
<td class="tr"><input name="post[telephone]" id="telephone" type="text" size="30" value="<?php echo $telephone;?>"/> <span id="dtelephone" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 联系地址</td>
<td class="tr"><input name="post[address]" id="address" type="text" size="70" value="<?php echo $address;?>"/></td>
</tr>
<?php if($DT['im_qq']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> QQ</td>
<td class="tr"><input name="post[qq]" id="qq" type="text" size="30" value="<?php echo $qq;?>"/></td>
</tr>
<?php } ?>
<?php if($DT['im_wx']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> 微信</td>
<td class="tr"><input name="post[wx]" id="wx" type="text" size="30" value="<?php echo $wx;?>"/></td>
</tr>
<?php } ?>
<?php if($DT['im_ali']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> 阿里旺旺</td>
<td class="tr"><input name="post[ali]" id="ali" type="text" size="30" value="<?php echo $ali;?>"/></td>
</tr>
<?php } ?>
<?php if($DT['im_skype']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> Skype</td>
<td class="tr"><input name="post[skype]" id="skype" type="text" size="30" value="<?php echo $skype;?>"/></td>
</tr>
<?php } ?>
</tbody>
<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="4" <?php if($status == 4) echo 'checked';?>/> 过期
<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><input name="post[hits]" type="text" size="10" value="<?php echo $hits;?>"/></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 内容收费</td>
<td><input name="post[fee]" type="text" size="5" value="<?php echo $fee;?>"/><?php tips('不填或填0表示继承模块设置价格,-1表示不收费<br/>大于0的数字表示具体收费价格');?>
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 内容模板</td>
<td><?php echo tpl_select('show', $module, 'post[template]', '默认模板', $template, 'id="template"');?><?php tips('如果没有特殊需要,一般不需要选择<br/>系统会自动继承分类或模块设置');?></td>
</tr>
<?php if($MOD['show_html']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> 自定义文件路径</td>
<td><input type="text" size="70" name="post[filepath]" value="<?php echo $filepath;?>" id="filepath"/>&nbsp;<input type="button" value="重名检测" onclick="ckpath(<?php echo $moduleid;?>, <?php echo $itemid;?>);" class="btn"/>&nbsp;<?php tips('可以包含目录和文件 例如 destoon/b2b.html<br/>请确保目录和文件名合法且可写入,否则可能生成失败');?>&nbsp; <span id="dfilepath" class="f_red"></span></td>
</tr>
<?php } ?>
</table>
<div class="sbt"><input type="submit" name="submit" value="<?php echo $action == 'edit' ? '修 改' : '添 加';?>" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;<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'); ?>
<?php if($action == 'add') { ?>
<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;?>"/>
<div class="tt">单页采编</div>
<table cellspacing="0" class="tb">
<tr>
<td class="tl"><span class="f_hid">*</span> 目标网址</td>
<td><input name="url" type="text" size="80" value="<?php echo $url;?>"/>&nbsp;&nbsp;<input type="submit" value=" 获 取 " class="btn"/>&nbsp;&nbsp;<input type="button" value=" 管理规则 " class="btn" onclick="Dwidget('?file=fetch', '管理规则');"/></td>
</tr>
</table>
</form>
<?php } ?>
<script type="text/javascript">
function _p() {
if(Dd('tag').value) {
Ds('reccate');
}
}
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('标题最少2字,当前已输入'+l+'字', f);
return false;
}
if(Dd('ismember_1').checked) {
f = 'username';
l = Dd(f).value.length;
if(l < 2) {
Dmsg('请填写会员名', f);
return false;
}
} else {
f = 'company';
l = Dd(f).value.length;
if(l < 2) {
Dmsg('请填写公司名称', f);
return false;
}
if(Dd('areaid_1').value == 0) {
Dmsg('请选择所在地区', 'areaid');
return false;
}
f = 'truename';
l = Dd(f).value.length;
if(l < 2) {
Dmsg('请填写联系人', f);
return false;
}
f = 'mobile';
l = Dd(f).value.length;
if(l < 7) {
Dmsg('请填写手机', f);
return false;
}
}
<?php echo $FD ? fields_js() : '';?>
<?php echo $CP ? property_js() : '';?>
return true;
}
</script>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

59
module/buy/admin/template/html.tpl.php

@ -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">&nbsp;
<input type="submit" value="一键更新" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=all';" title="生成该模块所有网页"/>&nbsp;&nbsp;
<input type="submit" value="生成首页" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=index';" title="生成该模块首页"/>&nbsp;&nbsp;
<input type="submit" value="生成列表" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=list';" title="生成该模块所有分类"/>&nbsp;&nbsp;
<input type="submit" value="生成内容" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=show';" title="生成该模块所有内容页"/>&nbsp;&nbsp;
<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';"/>&nbsp;
<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);?>
&nbsp;&nbsp;&nbsp;&nbsp;
<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';"/>&nbsp;
<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');?>

1
module/buy/admin/template/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

506
module/buy/admin/template/setting.tpl.php

@ -0,0 +1,506 @@
<?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('show', $module, 'setting[template_show]', '默认模板', $template_show);?></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><?php echo tpl_select('my_'.$module, 'member', 'setting[template_my]', '默认模板', $template_my);?></td>
</tr>
<tr>
<td class="tl">报价默认模板</td>
<td><?php echo tpl_select('price', $module, 'setting[template_price]', '默认模板', $template_price);?></td>
</tr>
<tr>
<td class="tl">默认缩略图[宽X高]</td>
<td>
<input type="text" size="3" name="setting[thumb_width]" value="<?php echo $thumb_width;?>"/>
X
<input type="text" size="3" name="setting[thumb_height]" value="<?php echo $thumb_height;?>"/> px
</td>
</tr>
<tr>
<td class="tl">自动截取内容至简介</td>
<td><input type="text" size="3" name="setting[introduce_length]" value="<?php echo $introduce_length;?>"/> 字符</td>
</tr>
<tr>
<td class="tl">编辑器工具按钮</td>
<td>
<select name="setting[editor]">
<option value="Default"<?php if($editor == 'Default') echo ' selected';?>>全部</option>
<option value="Destoon"<?php if($editor == 'Destoon') echo ' selected';?>>精简</option>
<option value="Simple"<?php if($editor == 'Simple') echo ' selected';?>>简洁</option>
<option value="Basic"<?php if($editor == 'Basic') echo ' selected';?>>基础</option>
</select>
</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="editdate desc,vip desc,edittime desc"<?php if($order == 'editdate desc,vip desc,edittime desc') echo ' selected';?>>更新日期,<?php echo VIP;?>级别,更新时间</option>
<option value="adddate desc,vip desc,addtime desc"<?php if($order == 'adddate desc,vip desc,addtime desc') echo ' selected';?>>添加日期,<?php echo VIP;?>级别,添加时间</option>
<option value="edittime desc"<?php if($order == 'edittime desc') echo ' selected';?>>更新时间</option>
<option value="addtime desc"<?php if($order == 'addtime desc') echo ' selected';?>>添加时间</option>
<option value="vip desc"<?php if($order == 'vip desc') echo ' selected';?>><?php echo VIP;?>级别</option>
<option value="itemid desc"<?php if($order == 'itemid 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"><?php echo $MOD['name'];?>类别</td>
<td><input type="text" size="80" name="setting[type]" value="<?php echo $type;?>"/><?php tips('不同类别用 | 分隔,设置好后,请勿频繁改动');?></td>
</tr>
<tr>
<td class="tl">报价快速提问</td>
<td>
<textarea name="setting[price_ask]" style="width:98%;height:50px;overflow:visible;"><?php echo $price_ask;?></textarea>
<br/>不同问题用 | 分隔
</td>
</tr>
<tr>
<td class="tl">分类属性参数</td>
<td>
<input type="radio" name="setting[cat_property]" value="1" <?php if($cat_property) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[cat_property]" value="0" <?php if(!$cat_property) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">下载内容远程图片</td>
<td>
<input type="radio" name="setting[save_remotepic]" value="1" <?php if($save_remotepic) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[save_remotepic]" value="0" <?php if(!$save_remotepic) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">清除内容链接</td>
<td>
<input type="radio" name="setting[clear_link]" value="1" <?php if($clear_link) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[clear_link]" value="0" <?php if(!$clear_link) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">内容关联链接</td>
<td>
<input type="radio" name="setting[keylink]" value="1" <?php if($keylink) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[keylink]" value="0" <?php if(!$keylink) echo 'checked';?>/> 关闭
&nbsp;&nbsp;
<a href="javascript:Dwidget('?file=keylink&item=<?php echo $moduleid;?>', '[<?php echo $MOD['name'];?>]关联链接管理');" class="t">[管理链接]</a>
</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', '开启内容分表');"/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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', '关闭内容分表');"/> 关闭
&nbsp;<?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[fulltext]" value="1" <?php if($fulltext==1){ ?>checked <?php } ?>/> LIKE&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fulltext]" value="2" <?php if($fulltext==2){ ?>checked <?php } ?>/> MATCH&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fulltext]" value="0" <?php if($fulltext==0){ ?>checked <?php } ?>/> 关闭
<?php tips('此项会增加服务器负担,请根据需要和服务器配置决定是否开启。MATCH模式需要MySQL 4以上版本,且需要在MySQL的my.ini添加ft_min_word_len=1才能支持2个汉字的中文搜索。如果不能设置可以使用LIKE模式,但是效率会低于MATCH模式。<br/>开启MATCH模式请在数据库维护里执行以下SQL添加全文索引<br/>ALTER TABLE `'.$table_data.'` ADD FULLTEXT (`content`);<br/>全文索引占用一定数据空间,如果不开启MATCH模式可以执行以下语句删除索引<br/>ALTER TABLE `'.$table_data.'` DROP INDEX `content`;');?></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">首页最新发布数量</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[page_iedit]" value="<?php echo $page_iedit;?>"/></td>
</tr>
<tr>
<td class="tl">首页点击排行数量</td>
<td><input type="text" size="3" name="setting[page_ihits]" value="<?php echo $page_ihits;?>"/></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="text" size="3" name="setting[max_width]" value="<?php echo $max_width;?>"/> px</td>
</tr>
<tr>
<td class="tl">内容点击次数</td>
<td>
<input type="radio" name="setting[hits]" value="1" <?php if($hits) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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 } ?>/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<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';"/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<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">内容页是否生成html</td>
<td>
<input type="radio" name="setting[show_html]" value="1" <?php if($show_html){ ?>checked <?php } ?> onclick="Dd('show_html').style.display='';Dd('show_php').style.display='none';"/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[show_html]" value="0" <?php if(!$show_html){ ?>checked <?php } ?> onclick="Dd('show_html').style.display='none';Dd('show_php').style.display='';"/> 否
</td>
</tr>
<tbody id="show_html" style="display:<?php echo $show_html ? '' : 'none'; ?>">
<tr>
<td class="tl">HTML内容页文件名前缀</td>
<td><input name="setting[htm_item_prefix]" type="text" id="htm_item_prefix" value="<?php echo $htm_item_prefix;?>" size="10"></td>
</tr>
<tr>
<td class="tl">HTML内容页地址规则</td>
<td><?php echo url_select('setting[htm_item_urlid]', 'htm', 'item', $htm_item_urlid);?></td>
</tr>
</tbody>
<tr id="show_php" style="display:<?php echo $show_html ? 'none' : ''; ?>">
<td class="tl">PHP内容页地址规则</td>
<td><?php echo url_select('setting[php_item_urlid]', 'php', 'item', $php_item_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_show][]', $group_show);?></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_search][]', $group_search);?></td>
</tr>
<tr>
<td class="tl">允许设置标题颜色</td>
<td><?php echo group_checkbox('setting[group_color][]', $group_color);?></td>
</tr>
<tr>
<td class="tl">刷新信息不扣积分</td>
<td><?php echo group_checkbox('setting[group_refresh][]', $group_refresh);?></td>
</tr>
<tr>
<td class="tl">报价启用验证码</td>
<td>
<input type="radio" name="setting[captcha_price]" value="2" <?php if($captcha_price == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_price]" value="1" <?php if($captcha_price == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_price]" value="0" <?php if($captcha_price == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">报价验证问题</td>
<td>
<input type="radio" name="setting[question_price]" value="2" <?php if($question_price == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_price]" value="1" <?php if($question_price == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_price]" value="0" <?php if($question_price == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">审核发布信息</td>
<td>
<input type="radio" name="setting[check_add]" value="2" <?php if($check_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_add]" value="1" <?php if($check_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_add]" value="0" <?php if($check_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">发布信息启用验证码</td>
<td>
<input type="radio" name="setting[captcha_add]" value="2" <?php if($captcha_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_add]" value="1" <?php if($captcha_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_add]" value="0" <?php if($captcha_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">发布信息验证问题</td>
<td>
<input type="radio" name="setting[question_add]" value="2" <?php if($question_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_add]" value="1" <?php if($question_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_add]" value="0" <?php if($question_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">会员是否收费</td>
<td>
<input type="radio" name="setting[fee_mode]" value="1" <?php if($fee_mode == 1) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fee_mode]" value="0" <?php if($fee_mode == 0) echo 'checked';?>> 全部启用
</td>
</tr>
<tr>
<td class="tl">会员收费使用</td>
<td>
<input type="radio" name="setting[fee_currency]" value="money" <?php if($fee_currency == 'money') echo 'checked';?>/> <?php echo $DT['money_name'];?>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fee_currency]" value="credit" <?php if($fee_currency == 'credit') echo 'checked';?>/> <?php echo $DT['credit_name'];?>
</td>
</tr>
<tr>
<td class="tl">发布信息收费</td>
<td><input type="text" size="5" name="setting[fee_add]" value="<?php echo $fee_add;?>"/> <?php echo $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?>/条</td>
</tr>
<tr>
<td class="tl">查看信息收费</td>
<td><input type="text" size="5" name="setting[fee_view]" value="<?php echo $fee_view;?>"/> <?php echo $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?>/条</td>
</tr>
<tr>
<td class="tl">收费有效时间</td>
<td><input type="text" size="5" name="setting[fee_period]" value="<?php echo $fee_period;?>"/> 分钟 <?php tips('如果支付时间超过有效时间,系统将重新收费<br/>填零表示不重复收费');?></td>
</tr>
<tr>
<td class="tl">向发布人返利</td>
<td><input type="text" size="2" name="setting[fee_back]" value="<?php echo $fee_back;?>"/> % <?php tips('请填写1-100之间的数字,用户支付之后,系统将按此比例向发布人增加对应的'.$DT['money_name'].'或者'.$DT['credit_name']);?></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 class="tt"><?php echo $DT['credit_name'];?>规则</div>
<table cellspacing="0" class="tb">
<tr>
<td class="tl">发布信息奖励</td>
<td>
<input type="text" size="5" name="setting[credit_add]" value="<?php echo $credit_add;?>"/>
</td>
</tr>
<tr>
<td class="tl">信息被删除扣除</td>
<td>
<input type="text" size="5" name="setting[credit_del]" value="<?php echo $credit_del;?>"/>
</td>
</tr>
<tr>
<td class="tl">信息设置颜色扣除</td>
<td>
<input type="text" size="5" name="setting[credit_color]" value="<?php echo $credit_color;?>"/>
</td>
</tr>
<tr>
<td class="tl">刷新一条信息一次扣除</td>
<td>
<input type="text" size="5" name="setting[credit_refresh]" value="<?php echo $credit_refresh;?>"/>
</td>
</tr>
</table>
<div class="tt">发布数量</div>
<table cellspacing="0" class="tb">
<tr align="center">
<td width="158">会员组</td>
<td width="100">总数限制</td>
<td width="100">免费数量</td>
<td align="right"><a href="<?php echo DT_PATH;?>api/redirect.php?url=https://www.destoon.com/doc/skill/94.html" target="_blank" class="t">设置说明</a></td>
</tr>
<?php foreach($GROUP as $v) {?>
<tr align="center">
<td><?php echo $v['groupname'];?></td>
<?php $k = 'limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<?php $k = 'free_limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<td></td>
</tr>
<?php }?>
</table>
</div>
<div class="sbt">
<input type="submit" name="submit" value="保 存" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;
<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');?>

5
module/buy/admin/uninstall.inc.php

@ -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."`");
?>

8
module/buy/common.inc.php

@ -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;
$TYPE = explode('|', trim($MOD['type']));
?>

54
module/buy/index.htm.php

@ -0,0 +1,54 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext'];
if(!$MOD['index_html']) return html_del($filename);
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';
$typeid = 99;
$dtype = '';
$maincat = get_maincat(0, $moduleid);
if($page == 1) $head_canonical = $MOD['linkurl'];
$seo_file = 'index';
include DT_ROOT.'/include/seo.inc.php';
$destoon_task = "moduleid=$moduleid&html=index";
$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 = "status=3";
$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'];
$time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime';
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} 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'];
$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(DT_ROOT, DT_ROOT.'/mobile', $filename), $data);
}
return true;
?>

41
module/buy/index.inc.php

@ -0,0 +1,41 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
require DT_ROOT.'/module/'.$module.'/common.inc.php';
if($DT_PC) {
if(!check_group($_groupid, $MOD['group_index'])) include load('403.inc');
$typeid = isset($typeid) ? intval($typeid) : 99;
isset($TYPE[$typeid]) or $typeid = 99;
$dtype = $typeid != 99 ? " AND typeid=$typeid" : '';
$maincat = get_maincat($catid ? $CAT['parentid'] : 0, $moduleid);
if($catid) $seo_title = $seo_catname.$seo_title;
if($typeid != 99) $seo_title = $TYPE[$typeid].$seo_delimiter.$seo_title;
if($page == 1) $head_canonical = $MOD['linkurl'];
$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);
?>

91
module/buy/list.htm.php

@ -0,0 +1,91 @@
<?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']);
$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;
?>

113
module/buy/price.inc.php

@ -0,0 +1,113 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
if($DT_BOT) dhttp(403);
$itemid or dheader($MOD['linkurl']);
$MG['price_limit'] > -1 or message(lang('message->without_permission'), 'goback');
require DT_ROOT.'/module/'.$module.'/common.inc.php';
include load('misc.lang');
$item = $db->get_one("SELECT title,tag,linkurl,totime,username,company,vip,status FROM {$table} WHERE itemid=$itemid");
$item or message($L['not_exists']);
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['price_self']);
$limit_used = $limit_free = 0;
if($MG['price_limit']) {
$today = $DT_TODAY - 86400;
$sql = $_userid ? "fromuser='$_username'" : "ip='$DT_IP'";
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}message WHERE $sql AND addtime>$today AND typeid=2 AND status=3");
$limit_used = $r['num'];
$limit_used < $MG['price_limit'] or message(lang($L['message_limit'], array($MG['price_limit'], $limit_used)), 'goback');
$limit_free = $MG['price_limit'] > $limit_used ? $MG['price_limit'] - $limit_used : 0;
}
$linkurl = $MOD['linkurl'].$item['linkurl'];
$need_captcha = $MOD['captcha_price'] == 2 ? $MG['captcha'] : $MOD['captcha_price'];
$need_question = $MOD['question_price'] == 2 ? $MG['question'] : $MOD['question_price'];
require DT_ROOT.'/include/post.func.php';
if($_userid) {
$user = userinfo($_username);
$company = $user['company'];
$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'];
}
if($submit) {
captcha($captcha, $need_captcha);
question($answer, $need_question);
$title = dhtmlspecialchars(trim($title));
if(!$title) message($L['msg_type_title']);
$content = dhtmlspecialchars(trim($content));
if(!$content) message($L['msg_type_content']);
if(!$_userid) {
$truename = dhtmlspecialchars(trim($truename));
if(!$truename) message($L['msg_type_truename']);
$telephone = dhtmlspecialchars(trim($telephone));
if(!$telephone) message($L['msg_type_telephone']);
$email = dhtmlspecialchars(trim($email));
$company = dhtmlspecialchars(trim($company));
if($DT['im_qq']) $qq = dhtmlspecialchars(trim($qq));
if($DT['im_wx']) $wx = dhtmlspecialchars(trim($wx));
if($DT['im_ali'])$ali = dhtmlspecialchars(trim($ali));
if($DT['im_skype']) $skype = dhtmlspecialchars(trim($skype));
}
$content = nl2br($content);
if($company) $content .= '<br/>'.$L['content_company'].'<span data-company="1">'.$company.'</span>';
if($truename) $content .= '<br/>'.$L['content_truename'].'<span data-truename="1">'.$truename.'</span>';
if($telephone) $content .= '<br/>'.$L['content_telephone'].'<span data-telephone="1">'.$telephone.'</span>';
if(is_email($email)) $content .= '<br/>'.$L['content_email'].'<span data-email="1">'.$email.'</span>';
if($DT['im_qq'] && is_qq($qq)) $content .= '<br/>'.$L['content_qq'].' '.im_qq($qq).' <span data-qq="1">'.$qq.'</span>';
if($DT['im_wx'] && is_wx($wx)) $content .= '<br/>'.$L['content_wx'].' '.im_wx($wx, $_username).' <span data-wx="1">'.$wx.'</span>';
if($DT['im_ali'] && $ali) $content .= '<br/>'.$L['content_ali'].' '.im_ali($ali).' <span data-ali="1">'.$ali.'</span>';
if($DT['im_skype'] && $skype) $content .= '<br/>'.$L['content_skype'].' '.im_skype($skype).' <span data-skype="1">'.$skype.'</span>';
if(is_date($date)) $content .= '<hr size="1"/>'.lang($L['content_date'], array($date));
$message = $L['content_product'].'<a href="'.$linkurl.'"><strong>'.$item['title'].'</strong></a><br/>'.$content;
//send sms
if($DT['sms'] && $_sms && $item['username'] && isset($sendsms)) {
$touser = userinfo($item['username']);
if($touser['mobile']) {
$message = lang('sms->sms_price', array($item['tag'] ? $item['tag'] : $item['title'], $itemid, $truename, $telephone));
$message = strip_sms($message);
$word = word_count($message);
$sms_num = ceil($word/$DT['sms_len']);
if($sms_num <= $_sms) {
$sms_code = send_sms($touser['mobile'], $message, $word);
if(strpos($sms_code, $DT['sms_ok']) !== false) {
$tmp = explode('/', $sms_code);
if(is_numeric($tmp[1])) $sms_num = $tmp[1];
if($sms_num) sms_add($_username, -$sms_num);
if($sms_num) sms_record($_username, -$sms_num, $_username, $L['sms_price'], 'ID:'.$itemid);
}
}
}
}
//send sms
$forward = $DT_PC ? $linkurl : str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl);
if(send_message($item['username'], $title, $message, 2, $_username, $moduleid, $itemid)) {
$db->query("UPDATE {$table} SET messages=messages+1 WHERE itemid=$itemid");
message($L['msg_price_success'], $forward);
} else {
message($_userid ? $L['msg_price_member_failed'] : $L['msg_price_guest_failed'], $forward);
}
}
$iask = explode('|', trim($MOD['price_ask']));
$date = timetodate($DT_TIME + 5*86400, 3);
$title = lang($L['price_message_title'], array($item['title']));
$head_title = $L['price_head_title'].$DT['seo_delimiter'].$item['title'].$DT['seo_delimiter'].$MOD['name'];
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['price_head_title'];
if($sns_app) $seo_title = $MOD['name'];
$js_pull = 0;
$foot = '';
}
include template($MOD['template_price'] ? $MOD['template_price'] : 'price', $module);
?>

164
module/buy/search.inc.php

@ -0,0 +1,164 @@
<?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'];
$thumb = isset($thumb) ? intval($thumb) : 0;
$vip = isset($vip) ? intval($vip) : 0;
$typeid = isset($typeid) && isset($TYPE[$typeid]) ? intval($typeid) : 99;
if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) {
$areaid = $cityid;
$ARE = get_area($areaid);
}
(isset($fromdate) && is_date($fromdate)) or $fromdate = '';
$fromtime = $fromdate ? datetotime($fromdate.' 0:0:0') : 0;
(isset($todate) && is_date($todate)) or $todate = '';
$totime = $todate ? datetotime($todate.' 23:59:59') : 0;
$sfields = array($L['by_auto'], $L['by_title'], $L['by_content'], $L['by_introduce']);
$dfields = array('keyword', 'title', 'content', 'introduce');
$sorder = array($L['order'], $L['order_auto']);
$dorder = array($MOD['order'], '');
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 = ajax_category_select('catid', $L['all_category'], $catid, $moduleid);
$area_select = ajax_area_select('areaid', $L['all_area'], $areaid);
$order_select = dselect($sorder, 'order', '', $order);
$type_select = dselect($TYPE, 'typeid', $L['all_type'], $typeid);
$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($thumb) $condition .= " AND thumb<>''";
if($vip) $condition .= " AND vip>0";
if($typeid != 99) $condition .= " AND typeid=$typeid";
if($fromtime) $condition .= " AND edittime>=$fromtime";
if($totime) $condition .= " AND edittime<=$totime";
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($kw) $r['introduce'] = str_replace($replacef, $replacet, $r['introduce']);
$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;
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('dmessages', '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']);
$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);
?>

67
module/buy/show.htm.php

@ -0,0 +1,67 @@
<?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, 5);
$editdate = timetodate($edittime, 5);
$todate = $totime ? timetodate($totime, 3) : 0;
$expired = $totime && $totime < $DT_TIME ? true : false;
$fileurl = $linkurl;
$linkurl = $MOD['linkurl'].$linkurl;
$albums = get_albums($item);
$pics = count($albums);
$pics_width = $pics*70;
$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_price = ($user_status == 3 && $username && !$expired) ? 1 : 0;
$head_title = $head_name = $CAT['catname'];
$js_item = $js_album = 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;
?>

69
module/buy/task.inc.php

@ -0,0 +1,69 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
if($html == 'show') {
$itemid or exit;
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid");
if(!$item || $item['status'] < 3) exit;
require DT_ROOT.'/include/content.class.php';
extract($item);
$fee = DC::fee($item['fee'], $MOD['fee_view']);
$currency = $MOD['fee_currency'];
$fee_unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];
$fee_name = $currency == 'money' ? $DT['money_name'] : $DT['credit_name'];
$member = array();
if(check_group($_groupid, $MOD['group_contact'])) {
if($fee) {
if($MG['fee_mode'] && $MOD['fee_mode']) {
$user_status = 3;
} else {
$mid = $moduleid;
if($_userid) {
$user_status = check_pay($mid, $itemid) ? 3 : 2;
} else {
$user_status = 0;
}
}
} else {
$user_status = 3;
}
} else {
$user_status = $_userid ? 1 : 0;
}
if($_username && $_username == $item['username']) $user_status = 3;
if($user_status == 3 && $item['username']) $member = userinfo($item['username']);
$contact = strip_nr(ob_template('contact', 'chip'), true);
echo 'Inner("contact", \''.$contact.'\');';
if($MOD['hits']) echo 'Inner("hits", \''.$item['hits'].'\');';
$update = '';
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');
}
if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php';
if($MOD['show_html'] && $task_item && $DT_TIME - @filemtime(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl']) > $task_item) tohtml('show', $module);
} else if($html == 'list') {
$catid or exit;
if($MOD['list_html'] && $task_list && $CAT) {
$num = 1;
$totalpage = max(ceil($CAT['item']/$MOD['pagesize']), 1);
$demo = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, '{DEMO}');
$fid = $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
$fid = $page + 1;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
$fid = $totalpage + 1 - $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
}
} else if($html == 'index') {
if($DT['cache_hits'] && $MOD['hits']) {
$file = DT_CACHE.'/hits-'.$moduleid;
if($DT_TIME - @filemtime($file.'.dat') > $DT['cache_hits'] || @filesize($file.'.php') > 102400) update_hits($moduleid, $table);
}
if($MOD['index_html']) {
$file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext'];
if($DT_TIME - @filemtime($file) > $task_index) tohtml('index', $module);
}
}
?>

95
module/club/admin/fans.inc.php

@ -0,0 +1,95 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
$gid = isset($gid) ? intval($gid) : 0;
require DT_ROOT.'/module/'.$module.'/fans.class.php';
$do = new fans();
$menus = array (
array('粉丝列表', '?moduleid='.$moduleid.'&file='.$file.'&gid='.$gid),
array('待审核', '?moduleid='.$moduleid.'&file='.$file.'&gid='.$gid.'&action=check'),
array('未通过', '?moduleid='.$moduleid.'&file='.$file.'&gid='.$gid.'&action=reject'),
array('回收站', '?moduleid='.$moduleid.'&file='.$file.'&gid='.$gid.'&action=recycle'),
);
if(in_array($action, array('', 'check', 'reject', 'recycle'))) {
$sfields = array('加入理由', '会员名', '昵称');
$dfields = array('content', 'username', 'passport');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$sorder = array('结果排序方式', '加入时间降序', '加入时间升序', '发言状态降序', '发言状态升序');
$dorder = array('itemid desc', 'addtime DESC', 'addtime ASC', 'ban DESC', 'ban ASC');
isset($order) && isset($dorder[$order]) or $order = 0;
$gid or $gid = '';
(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);
$order_select = dselect($sorder, 'order', '', $order);
$condition = '';
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
if($gid) $condition .= " AND gid='$gid'";
if($fromtime) $condition .= " AND addtime>=$fromtime";
if($totime) $condition .= " AND addtime<=$totime";
}
switch($action) {
case 'delete':
$itemid or msg('请选择粉丝');
isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
dmsg('删除成功', $forward);
break;
case 'cancel':
$itemid or msg('请选择粉丝');
$do->check($itemid, 2);
dmsg('取消成功', $forward);
break;
case 'ban':
$itemid or msg('请选择粉丝');
$do->ban($itemid, 1);
dmsg('禁言成功', $forward);
break;
case 'unban':
$itemid or msg('请选择粉丝');
$do->ban($itemid, 0);
dmsg('取消成功', $forward);
break;
case 'restore':
$itemid or msg('请选择粉丝');
$do->restore($itemid);
dmsg('还原成功', $forward);
break;
case 'clear':
$do->clear();
dmsg('清空成功', $forward);
break;
case 'recycle':
$lists = $do->get_list('status=0'.$condition, $dorder[$order]);
$menuid = 3;
include tpl('fans', $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('fans', $module);
}
break;
case 'check':
if($itemid) {
$do->check($itemid);
dmsg('审核成功', $forward);
} else {
$lists = $do->get_list('status=2'.$condition, $dorder[$order]);
$menuid = 1;
include tpl('fans', $module);
}
break;
default:
$lists = $do->get_list('status=3'.$condition, $dorder[$order]);
$menuid = 0;
include tpl('fans', $module);
break;
}
?>

1
module/club/admin/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

294
module/club/admin/index.inc.php

@ -0,0 +1,294 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
$gid = isset($gid) ? intval($gid) : 0;
function need_notice() {
global $reason, $msg, $eml, $sms, $wec;
if(isset($reason) && $reason == '操作原因') $reason = '';
if(strlen($reason) > 2) {
$msg = 1;
return true;
}
if(isset($msg)) return true;
if(isset($eml)) return true;
if(isset($sms)) return true;
if(isset($wec)) return true;
return false;
}
function send_notice($username, $subject, $body) {
global $DT, $msg, $eml, $sms, $wec;
if(!$username || !$subject || !$body) return;
if(isset($msg)) send_message($username, $subject, $body);
if(isset($wec)) send_weixin($username, $subject);
if(isset($eml) || isset($sms)) {
$user = userinfo($username);
if(isset($eml)) send_mail($user['email'], $subject, $body);
if(isset($sms)) send_sms($user['mobile'], $subject.$DT['sms_sign']);
}
}
$menus = array (
array('发表帖子', '?moduleid='.$moduleid.'&gid='.$gid.'&action=add'),
array('帖子列表', '?moduleid='.$moduleid.'&gid='.$gid),
array('待审核', '?moduleid='.$moduleid.'&gid='.$gid.'&action=check'),
array('未通过', '?moduleid='.$moduleid.'&gid='.$gid.'&action=reject'),
array('回收站', '?moduleid='.$moduleid.'&gid='.$gid.'&action=recycle'),
array('移动帖子', '?moduleid='.$moduleid.'&gid='.$gid.'&action=move'),
);
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();
}
if($_catids || $_areaids) require DT_ROOT.'/admin/admin_check.inc.php';
if(in_array($action, array('', 'check', 'reject', 'recycle'))) {
$sfields = array('模糊', '标题', '简介', '会员名', '昵称', '编辑', 'IP', '文件路径', '内容模板');
$dfields = array('keyword', 'title', 'introduce', 'username', 'passport', 'editor', 'ip', 'filepath', 'template');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '修改时间降序', '修改时间升序', '推荐级别降序', '推荐级别升序', '浏览次数降序', '浏览次数升序', '点赞次数降序', '点赞次数升序', '反对次数降序', '反对次数升序', '收藏次数降序', '收藏次数升序', '打赏次数降序', '打赏次数升序', '打赏金额降序', '打赏金额升序', '分享次数降序', '分享次数升序', '举报次数降序', '举报次数升序', '回复时间降序', '回复时间升序', '回复数量降序', '回复数量升序', '信息ID降序', '信息ID升序');
$dorder = array($MOD['order'], 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', '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', 'replytime DESC', 'replytime ASC', 'reply DESC', 'reply ASC', 'itemid DESC', 'itemid ASC');
isset($order) && isset($dorder[$order]) or $order = 0;
isset($datetype) && in_array($datetype, array('edittime', 'addtime', 'replytime')) 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;
$level = isset($level) ? intval($level) : 0;
$ontop = isset($ontop) ? intval($ontop) : 0;
isset($style) or $style = 0;
$style = isset($COLOR[$style]) ? '#'.$style : '';
$thumb = isset($thumb) ? intval($thumb) : 0;
$guest = isset($guest) ? intval($guest) : 0;
$gid or $gid = '';
$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 .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid";
if($level) $condition .= $level > 9 ? " AND level>0" : " AND level=$level";
if($ontop) $condition .= " AND ontop=$ontop";
if($style) $condition .= " AND style='$style'";
if($fromtime) $condition .= " AND `$datetype`>=$fromtime";
if($totime) $condition .= " AND `$datetype`<=$totime";
if($thumb) $condition .= " AND thumb<>''";
if($guest) $condition .= " AND username=''";
if($gid) $condition .= " AND gid=$gid";
if($ip) $condition .= " AND ip='$ip'";
if($username) $condition .= " AND username='$username'";
if($itemid) $condition .= " AND itemid=$itemid";
$timetype = strpos($dorder[$order], 'replytime') === false ? 'add' : '';
}
switch($action) {
case 'add':
if($submit) {
$GRP = get_group($post['gid']);
$GRP or msg('指定商圈ID不存在');
$post['catid'] = $GRP['catid'];
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);
$username = $_username;
$item = array();
$menuid = 0;
isset($url) or $url = '';
if($url) {
$tmp = fetch_url($url);
if($tmp) extract($tmp);
}
$history = 0;
$gid or $gid = last_gid();
$GRP = $gid ? get_group($gid) : array();
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);
$GRP = $gid ? get_group($gid) : array();
$history = history($moduleid, $itemid);
$addtime = timetodate($addtime);
$menuon = array('4', '3', '2', '1');
$menuid = $menuon[$status];
include tpl($action, $module);
}
break;
case 'move':
if($submit) {
$fromids or msg('请填写来源ID');
in_array($fromtype, array('gid', 'itemid')) or msg('请选择ID类型');
$tocatid = intval($tocatid);
$GRP = get_group($tocatid);
($GRP && $GRP['status'] == 3) or msg('目标商圈不存在');
if($tocatid) {
$db->query("UPDATE {$table} SET gid=$tocatid WHERE `{$fromtype}` IN ($fromids)");
$fromtype = $fromtype == 'itemid' ? 'tid' : 'gid';
$db->query("UPDATE {$table_reply} SET gid=$tocatid WHERE `{$fromtype}` IN ($fromids)");
dmsg('移动成功', $forward);
} else {
msg('请填写目标商圈ID');
}
} else {
$itemid = $itemid ? implode(',', $itemid) : '';
$menuid = 5;
include tpl($action, $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('show', $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);
($level >= 0 && $level <= 9) or $level = 0;
#$do->level($itemid, $level);
foreach($itemid as $tid) {
$db->query("UPDATE {$table} SET level=$level WHERE itemid=$tid");
}
if(need_notice()) {
foreach($itemid as $tid) {
$T = $db->get_one("SELECT title,linkurl,username FROM {$table} WHERE itemid=$tid");
$body = lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username));
send_notice($T['username'], lang($L['manage_msg_title'], array('帖子', dsubstr($T['title'], 20, '...'), $level ? '加入精华' : '取消精华')), lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username)));
}
}
dmsg($level ? '精华'.$level.'设置成功' : '精华取消成功', $forward);
break;
case 'ontop':
$itemid or msg('请选择帖子');
$ontop = intval($ontop);
in_array($ontop, array(0, 1, 2)) or $ontop = 0;
foreach($itemid as $tid) {
$db->query("UPDATE {$table} SET ontop=$ontop WHERE itemid=$tid");
}
if(need_notice()) {
foreach($itemid as $tid) {
$T = $db->get_one("SELECT title,linkurl,username FROM {$table} WHERE itemid=$tid");
$body = lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username));
send_notice($T['username'], lang($L['manage_msg_title'], array('帖子', dsubstr($T['title'], 20, '...'), $ontop ? '置顶' : '取消置顶')), lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username)));
}
}
dmsg($ontop ? '置顶设置成功' : '置顶取消成功', $forward);
break;
case 'style':
$itemid or msg('请选择帖子');
$style = isset($COLOR[$style]) ? '#'.$style : '';
foreach($itemid as $tid) {
$db->query("UPDATE {$table} SET style='$style' WHERE itemid=$tid");
}
if(need_notice()) {
foreach($itemid as $tid) {
$T = $db->get_one("SELECT title,linkurl,username FROM {$table} WHERE itemid=$tid");
$body = lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username));
send_notice($T['username'], lang($L['manage_msg_title'], array('帖子', dsubstr($T['title'], 20, '...'), $style ? '高亮' : '取消高亮')), lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username)));
}
}
dmsg($style ? '高亮设置成功' : '高亮取消成功', $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;
}
?>

10
module/club/admin/install.inc.php

@ -0,0 +1,10 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
$setting = include(DT_ROOT.'/file/setting/module-18.php');
update_setting($moduleid, $setting);
$sql = file_get(DT_ROOT.'/file/setting/'.$module.'.sql');
$sql = str_replace('_18', '_'.$moduleid, $sql);
$sql = str_replace('商圈', $modulename, $sql);
sql_execute($sql);
include DT_ROOT.'/module/'.$module.'/admin/remkdir.inc.php';
?>

48
module/club/admin/manage.inc.php

@ -0,0 +1,48 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
$gid = isset($gid) ? intval($gid) : 0;
require DT_ROOT.'/module/'.$module.'/manage.class.php';
$do = new manage();
$menus = array (
array('记录列表', '?moduleid='.$moduleid.'&file='.$file.'&gid='.$gid),
array('记录清理', '?moduleid='.$moduleid.'&file='.$file.'&action=clear', 'onclick="if(!confirm(\'为了系统安全,系统仅删除30天之前的记录\n此操作不可撤销,请谨慎操作\')) return false"'),
);
switch($action) {
case 'clear':
$time = $DT_TODAY - 30*86400;
$db->query("DELETE FROM {$table_manage} WHERE addtime<$time");
dmsg('清理成功', $forward);
break;
default:
$sfields = array('主题/回复', '操作原因', '操作内容', '操作人');
$dfields = array('title', 'reason', 'content', 'username');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$typeid = isset($typeid) ? intval($typeid) : 0;
$tid = isset($tid) ? intval($tid) : 0;
$rid = isset($rid) ? intval($rid) : 0;
$message = isset($message) ? intval($message) : -1;
$gid or $gid = '';
$tid or $tid = '';
$rid or $rid = '';
(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 = '';
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
if($typeid) $condition .= " AND typeid='$typeid'";
if($gid) $condition .= " AND gid='$gid'";
if($tid) $condition .= " AND tid='$tid'";
if($rid) $condition .= " AND rid='$rid'";
if($message > -1) $condition .= " AND message='$message'";
if($fromtime) $condition .= " AND addtime>=$fromtime";
if($totime) $condition .= " AND addtime<=$totime";
$lists = $do->get_list('1'.$condition);
$menuid = 0;
include tpl('manage', $module);
break;
}
?>

11
module/club/admin/remkdir.inc.php

@ -0,0 +1,11 @@
<?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, 'fans', $dir, 1);
install_file($moduleid, 'chat', $dir, 1);
install_file($moduleid, 'goto', $dir, 0);
?>

140
module/club/admin/template/edit.tpl.php

@ -0,0 +1,140 @@
<?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">
<?php if($history) { ?>
<tr>
<td class="tl" style="background:#FDE7E7;"><span class="f_red">*</span> 审核提示</td>
<td style="background:#FDE7E7;">该信息存在修改记录,<a href="javascript:Dwidget('?file=history&mid=<?php echo $moduleid;?>&itemid=<?php echo $itemid;?>', '修改详情');" class="t">点击查看</a> 修改详情</td>
</tr>
<?php } ?>
<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 level_select('post[level]', '级别', $level);?> <?php echo dstyle('post[style]', $style);?><br/><span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 标题图片</td>
<td><input name="post[thumb]" id="thumb" type="text" size="70" value="<?php echo $thumb;?>" ondblclick="Dthumb(<?php echo $moduleid;?>,<?php echo $MOD['thumb_width'];?>,<?php echo $MOD['thumb_height'];?>, Dd('thumb').value);"/>&nbsp;&nbsp;<span onclick="Dthumb(<?php echo $moduleid;?>,<?php echo $MOD['thumb_width'];?>,<?php echo $MOD['thumb_height'];?>, Dd('thumb').value);" class="jt">[上传]</span>&nbsp;&nbsp;<span onclick="_preview(Dd('thumb').value);" class="jt">[预览]</span>&nbsp;&nbsp;<span onclick="Dd('thumb').value='';" class="jt">[删除]</span></td>
</tr>
<?php if($CP) { ?>
<script type="text/javascript">
var property_catid = <?php echo $catid;?>;
var property_itemid = <?php echo $itemid;?>;
var property_admin = 1;
</script>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/property.js?v=<?php echo DT_DEBUG ? DT_TIME : DT_REFRESH;?>"></script>
<tbody id="load_property" style="display:none;">
<tr><td></td><td></td></tr>
</tbody>
<?php } ?>
<?php echo $FD ? fields_html('<td class="tl">', '<td>', $item) : '';?>
<tr>
<td class="tl"><span class="f_red">*</span> 帖子内容</td>
<td><textarea name="post[content]" id="content" class="dsn"><?php echo $content;?></textarea>
<?php echo deditor($moduleid, 'content', $MOD['editor'], '98%', 350);?><br/><span id="dcontent" class="f_red"></span>
</td>
</tr>
<tr>
<?php if($GRP) {?>
<td class="tl"><span class="f_red">*</span> 所属商圈</td>
<td><input name="post[gid]" type="hidden" value="<?php echo $gid;?>" id="gid"/><a href="<?php echo $action=='edit' ? $MOD['linkurl'].$GRP['linkurl'].'" target="_blank' : '?moduleid='.$moduleid.'&file=group';?>" class="t"><?php echo $GRP['title'].$MOD['seo_name'];?></a> <span id="dgid" class="f_red"></span></td>
<?php } else { ?>
<td class="tl"><span class="f_red">*</span> 商圈ID</td>
<td><input name="post[gid]" type="text" size="20" value="<?php echo $gid;?>" id="gid"/><?php echo $GRP ? ' '.$GRP['title'] : '';?> <span id="dgid" class="f_red"></span></td>
<?php } ?>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</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 type="radio" name="post[status]" value="3" <?php if($status == 3) echo 'checked';?> id="status_3"/><label for="status_3"> 通过</label>
<input type="radio" name="post[status]" value="2" <?php if($status == 2) echo 'checked';?> id="status_2"/><label for="status_2"> 待审</label>
<input type="radio" name="post[status]" value="1" <?php if($status == 1) echo 'checked';?> onclick="if(this.checked) Dd('note').style.display='';" id="status_1"/><label for="status_1"> 拒绝</label>
<input type="radio" name="post[status]" value="0" <?php if($status == 0) echo 'checked';?> id="status_0"/><label for="status_0"> 删除</label>
</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><input name="post[hits]" type="text" size="10" value="<?php echo $hits;?>"/></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 内容收费</td>
<td><input name="post[fee]" type="text" size="5" value="<?php echo $fee;?>"/><?php tips('不填或填0表示继承模块设置价格,-1表示不收费<br/>大于0的数字表示具体收费价格');?>
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 内容模板</td>
<td><?php echo tpl_select('show', $module, 'post[template]', '默认模板', $template, 'id="template"');?><?php tips('如果没有特殊需要,一般不需要选择<br/>系统会自动继承分类或模块设置');?></td>
</tr>
<?php if($MOD['show_html']) { ?>
<tr>
<td class="tl"><span class="f_hid">*</span> 自定义文件路径</td>
<td><input type="text" size="70" name="post[filepath]" value="<?php echo $filepath;?>" id="filepath"/>&nbsp;<input type="button" value="重名检测" onclick="ckpath(<?php echo $moduleid;?>, <?php echo $itemid;?>);" class="btn"/>&nbsp;<?php tips('可以包含目录和文件 例如 destoon/b2b.html<br/>请确保目录和文件名合法且可写入,否则可能生成失败');?>&nbsp; <span id="dfilepath" class="f_red"></span></td>
</tr>
<?php } ?>
</table>
<div class="sbt"><input type="submit" name="submit" value="<?php echo $action == 'edit' ? '修 改' : '添 加';?>" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;<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'); ?>
<?php if($action == 'add') { ?>
<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;?>"/>
<div class="tt">单页采编</div>
<table cellspacing="0" class="tb">
<tr>
<td class="tl"><span class="f_hid">*</span> 目标网址</td>
<td><input name="url" type="text" size="80" value="<?php echo $url;?>"/>&nbsp;&nbsp;<input type="submit" value=" 获 取 " class="btn"/>&nbsp;&nbsp;<input type="button" value=" 管理规则 " class="btn" onclick="Dwidget('?file=fetch', '管理规则');"/></td>
</tr>
</table>
</form>
<?php } ?>
<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;
}
f = 'content';
l = EditorLen();
if(l < 5) {
Dmsg('内容最少5字,当前已输入'+l+'字', f);
return false;
}
f = 'gid';
l = parseInt(Dd(f).value);
if(l < 1) {
Dmsg('请填写商圈ID', f);
return false;
}
<?php echo $FD ? fields_js() : '';?>
<?php echo $CP ? property_js() : '';?>
return true;
}
</script>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

77
module/club/admin/template/fans.tpl.php

@ -0,0 +1,77 @@
<?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="action" value="<?php echo $action;?>"/>
<?php echo $fields_select;?>&nbsp;
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/>&nbsp;
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>&nbsp;
<?php echo $order_select;?>&nbsp;
<input type="text" size="10" name="gid" value="<?php echo $gid;?>" placeholder="商圈ID" title="商圈ID"/>&nbsp;
<input type="submit" value="搜 索" class="btn"/>&nbsp;
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&gid=<?php echo $gid;?>');"/>
</form>
</div>
<form method="post">
<table cellspacing="0" class="tb ls">
<tr>
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th>
<th width="60">头像</th>
<th>会员名</th>
<th>商圈</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="260">加入理由</th>
<th width="60"><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>
</tr>
<?php foreach($lists as $k=>$v) {?>
<tr align="center">
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td>
<td><img src="<?php echo useravatar($v['username']);?>" width="48"/></td>
<td><a href="javascript:_user('<?php echo $v['username'];?>');"><?php echo $v['passport'];?></a></td>
<td><a href="<?php echo $v['groupurl'];?>" target="_blank"><?php echo $v['groupname'];?></a></td>
<td><a href="javascript:;" onclick="Dq('date',this.innerHTML);"><?php echo $v['adddate'];?></a></td>
<td><textarea style="width:200px;height:30px;"><?php echo $v['reason'];?></textarea></td>
<td><?php echo $v['ban'] ? '<span class="f_red">禁言</span>' : '<span class="f_green">正常</span>';?></td>
</tr>
<?php }?>
</table>
<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';"/>&nbsp;
<input type="submit" value="拒 绝" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/>&nbsp;
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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 == 'reject') { ?>
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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;}"/>&nbsp;
<input type="submit" value="还 原" class="btn" onclick="if(confirm('确定要还原选中粉丝吗?状态将被设置为已通过')){this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=restore'}else{return false;}"/>&nbsp;
<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-r" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=cancel';"/>&nbsp;
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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;}"/>&nbsp;
<?php } ?>
<input type="submit" value="禁止发言" class="btn-r" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=ban';"/>&nbsp;
<input type="submit" value="解除禁言" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=unban';"/>&nbsp;
</div>
</form>
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

131
module/club/admin/template/group.tpl.php

@ -0,0 +1,131 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
include tpl('header');
if(!$itemid) 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="action" value="<?php echo $action;?>"/>
<input type="hidden" name="itemid" value="<?php echo $itemid;?>"/>
<?php echo $fields_select;?>&nbsp;
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/>&nbsp;
<?php echo $level_select;?>&nbsp;
<select name="chat">
<option value="-1"<?php if($chat == -1) echo ' selected';?>>群聊</option>
<option value="1"<?php if($chat == 1) echo ' selected';?>>开启</option>
<option value="0"<?php if($chat == 0) echo ' selected';?>>关闭</option>
</select>&nbsp;
<?php echo category_select('catid', '不限分类', $catid, $moduleid);?>&nbsp;
<?php echo ajax_area_select('areaid', '不限地区', $areaid);?>&nbsp;
<?php echo $order_select;?>&nbsp;
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/>&nbsp;
<input type="submit" value="搜 索" class="btn"/>&nbsp;
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/>
</form>
</div>
<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 == 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>
<th width="90">图标</th>
<th>名称</th>
<th>创建者</th>
<th width="130">
<?php if($order == 10 || $order == 9) { ?>
<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>
<?php } elseif($order == 8 || $order == 7) { ?>
<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>
<?php } elseif($order == 6 || $order == 5) { ?>
<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>
<?php } elseif($order == 4 || $order == 3) { ?>
<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>
<?php } else { ?>
<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>
<?php } ?>
</th>
<?php if($itemid) { ?>
<th>ID</th>
<?php } else { ?>
<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 == 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>
<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>
<th width="60"><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>
<th width="100">操作</th>
<?php } ?>
</tr>
<?php foreach($lists as $k=>$v) {?>
<tr align="center">
<td<?php if($itemid) { ?> onclick="window.parent.Dd('tocatid').value='<?php echo $v['itemid'];?>';window.parent.cDialog();"<?php } ?>><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'];?>" style="width:80px;padding:5px;"/></a></td>
<td><a href="<?php echo $v['linkurl'];?>" target="_blank"><?php echo $v['title'];?></a></td>
<td><a href="javascript:_user('<?php echo $v['username'];?>');"><?php echo $v['passport'];?></a></td>
<td>
<?php
if($order == 10 || $order == 9) {
echo timetodate($v['chattime'], 5);
} else if($order == 8 || $order == 7) {
echo timetodate($v['replytime'], 5);
} else if($order == 6 || $order == 5) {
echo timetodate($v['posttime'], 5);
} else if($order == 4 || $order == 3) {
echo $v['editdate'];
} else {
echo $v['adddate'];
}
?>
</td>
<?php if($itemid) { ?>
<td onclick="window.parent.Dd('tocatid').value='<?php echo $v['itemid'];?>';window.parent.cDialog();" class="c_p" title="点击选择"><?php echo $v['itemid'];?></td>
<?php } else { ?>
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&gid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 帖子管理');"><?php echo $v['post'];?></a></td>
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=reply&gid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 回复管理');"><?php echo $v['reply'];?></a></td>
<td><a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=fans&gid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 粉丝管理');"><?php echo $v['fans'];?></a></td>
<td><a href="javascript:Dwidget('?moduleid=2&file=chat&action=view&chatid=<?php echo $v['chatid'];?>', '聊天记录');" title="查看聊天记录"><?php echo $v['chat'] ? '<span class="f_green">开启</span>' : '<span class="f_red">关闭</span>';?></a></td>
<td>
<a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&action=add&gid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 帖子管理');"><img src="admin/image/add.png" width="16" height="16" title="发帖" alt=""/></a>&nbsp;
<a href="javascript:Dwidget('?moduleid=<?php echo $moduleid;?>&file=manage&gid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 帖子管理记录');"><img src="admin/image/child.png" width="16" height="16" title="管理记录" alt=""/></a>&nbsp;
<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>&nbsp;
<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>
<?php } ?>
</tr>
<?php }?>
</table>
<div class="btns">
<?php if($action == 'check') { ?>
<input type="submit" value="通过审核" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=check';"/>&nbsp;
<input type="submit" value="拒 绝" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/>&nbsp;
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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';"/>&nbsp;
<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;}"/>&nbsp;
<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;}"/>&nbsp;
<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';"/>&nbsp;
<?php if($MOD['list_html']) { ?><input type="submit" value=" 生成商圈 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=tohtml';"/>&nbsp; <?php } ?>
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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;}"/>&nbsp;
<?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>' : '';?>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

1
module/club/admin/template/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

185
module/club/admin/template/index.tpl.php

@ -0,0 +1,185 @@
<?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>
&nbsp;<?php echo $fields_select;?>&nbsp;
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/>&nbsp;
<?php echo $level_select;?>&nbsp;
<select name="ontop">
<option value="0">置顶</option>
<option value="1"<?php if($ontop == 1) echo ' selected';?>>本圈</option>
<option value="2"<?php if($ontop == 2) echo ' selected';?>>全局</option>
</select>&nbsp;
<select name="style">
<option value="0">高亮</option>
<?php
foreach($COLOR as $k=>$v) {
?>
<option value="<?php echo $k;?>" style="color:#<?php echo $k;?>;"<?php if($style == '#'.$k) echo ' selected';?>><?php echo $v;?></option>
<?php
}
?>
</select>&nbsp;
<?php echo $order_select;?>&nbsp;
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/>&nbsp;
<input type="submit" value="搜 索" class="btn"/>&nbsp;
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&gid=<?php echo $gid;?>');"/>
</td>
</tr>
<tr>
<td>
&nbsp;<select name="datetype">
<option value="addtime" <?php if($datetype == 'addtime') echo 'selected';?>>发布时间</option>
<option value="replytime" <?php if($datetype == 'replytime') echo 'selected';?>>回复时间</option>
<option value="edittime" <?php if($datetype == 'edittime') echo 'selected';?>>修改时间</option>
</select>&nbsp;
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>&nbsp;
<?php echo category_select('catid', '不限分类', $catid, $moduleid);?>&nbsp;
<?php echo $DT['city'] ? ajax_area_select('areaid', '不限地区', $areaid).'&nbsp;' : '';?>
<input type="text" name="username" value="<?php echo $username;?>" size="10" placeholder="会员名" title="会员名 双击显示会员资料" ondblclick="if(this.value){_user(this.value);}"/>&nbsp;
<input type="text" name="gid" value="<?php echo $gid;?>" size="6" title="商圈ID" placeholder="商圈ID"/>&nbsp;
<input type="text" size="6" name="itemid" value="<?php echo $itemid;?>" title="帖子ID" placeholder="帖子ID"/>&nbsp;
<input type="checkbox" name="thumb" value="1"<?php echo $thumb ? ' checked' : '';?>/>图片&nbsp;
<input type="checkbox" name="guest" value="1"<?php echo $guest ? ' checked' : '';?>/>游客&nbsp;
</td>
</tr>
</table>
</form>
<form method="post">
<input type="hidden" name="gid" value="<?php echo $gid;?>"/>
<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 } ?>
<?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 == 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 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['groupurl'];?>" target="_blank"><?php echo $v['groupname'];?></a></td>
<td>
<?php if($v['ontop']) { ?>
<img src="<?php echo DT_SKIN;?>image/club_ontop_<?php echo $v['ontop'];?>.gif" alt="" title="<?php if($v['ontop']==1) { ?>本圈<?php } else { ?>全局<?php } ?>
置顶"/>
<?php } else if($v['level']) { ?>
<img src="<?php echo DT_SKIN;?>image/club_level_<?php echo $v['level'];?>.gif" alt="" title="精华<?php echo $v['level'];?>"/>
<?php } else if($v['video']) { ?>
<img src="<?php echo DT_SKIN;?>image/club_video.gif" alt="" title="有视频"/>
<?php } else { ?>
&nbsp;
<?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','replytime');Dq('date',this.innerHTML);"><?php echo timetodate($v['replytime'], 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 } ?>
<?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=<?php echo $moduleid;?>&file=reply&tid=<?php echo $v['itemid'];?>', '[<?php echo $v['alt'];?>] 回复管理');"><?php echo $v['reply'];?></a></td>
<td>
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>&gid=<?php echo $gid;?>"><img src="admin/image/edit.png" width="16" height="16" title="修改" alt=""/></a>&nbsp;
<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>&gid=<?php echo $gid;?>" 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" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=check';"/>&nbsp;
<input type="submit" value="拒 绝" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/>&nbsp;
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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';"/>&nbsp;
<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;}"/>&nbsp;
<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;}"/>&nbsp;
<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';"/>&nbsp;
<?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';"/>&nbsp; <?php } ?>
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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;}"/>&nbsp;
<input type="submit" value="移动帖子" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=move';"/>&nbsp;
<select name="level" onchange="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=level';this.form.submit();"><option value="0">加精</option><option value="0">取消</option><option value="1">精华1</option><option value="2">精华2</option><option value="3">精华3</option></select>&nbsp;
<select name="ontop" onchange="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=ontop';this.form.submit();"><option value="0">置顶</option><option value="0">取消</option><option value="1">本圈</option><option value="2">全局</option></select>&nbsp;
<select name="style" onchange="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=style';this.form.submit();"><option value="0">高亮</option><option value="0">取消</option>
<?php
foreach($COLOR as $k=>$v) {
?>
<option value="<?php echo $k;?>" style="color:#<?php echo $k;?>;"><?php echo $v;?></option>
<?php
}
?>
</select>
<?php } ?>
</div>
</form>
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
<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');?>

63
module/club/admin/template/manage.tpl.php

@ -0,0 +1,63 @@
<?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="action" value="<?php echo $action;?>"/>
<?php echo $fields_select;?>&nbsp;
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/>&nbsp;
<select name="typeid">
<?php
foreach($MANAGE as $k=>$v) {
?>
<option value="<?php echo $k;?>" <?php echo $k == $typeid ? ' selected' : '';?>><?php echo $v;?></option>
<?php
}
?>
</select>&nbsp;
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>&nbsp;
<select name="message">
<option value="-1">通知</option>
<option value="1"<?php echo $message==1 ? ' selected' : '';?>>已发</option>
<option value="0"<?php echo $message==0 ? ' selected' : '';?>>未发</option>
</select>&nbsp;
<input type="text" size="6" name="gid" value="<?php echo $gid;?>" placeholder="商圈ID" title="商圈ID"/>&nbsp;
<input type="text" size="6" name="tid" value="<?php echo $tid;?>" placeholder="帖子ID" title="帖子ID"/>&nbsp;
<input type="text" size="6" name="rid" value="<?php echo $rid;?>" placeholder="回复ID" title="回复ID"/>&nbsp;
<input type="submit" value="搜 索" class="btn"/>&nbsp;
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&gid=<?php echo $gid;?>');"/>
</form>
</div>
<form method="post">
<table cellspacing="0" class="tb ls">
<tr>
<th>商圈</th>
<th>帖子/回复</th>
<th width="40">操作</th>
<th width="80">操作内容</th>
<th>操作人</th>
<th width="130">操作时间</th>
<th width="120">操作原因</th>
<th width="40">通知</th>
</tr>
<?php foreach($lists as $k=>$v) {?>
<tr align="center">
<td><a href="<?php echo $v['groupurl'];?>" target="_blank"><?php echo $v['groupname'];?></a></td>
<td align="left">&nbsp;<a href="<?php echo $v['linkurl'];?>"<?php echo $v['blank'] ? ' target="_blank"' : '';?>><?php echo $v['title'];?></a></td>
<td><a href="javascript:;" onclick="Dq('typeid','<?php echo $v['typeid'];?>');"><?php echo $MANAGE[$v['typeid']];?></a></td>
<td><?php echo $v['value'];?></td>
<td><a href="javascript:_user('<?php echo $v['username'];?>');"><?php echo $v['username'];?></a></td>
<td><a href="javascript:;" onclick="Dq('date',this.innerHTML);"><?php echo $v['adddate'];?></a></td>
<td><textarea style="width:100px;height:16px;" title="<?php echo $v['reason'];?>"><?php echo $v['reason'];?></textarea></td>
<td><a href="javascript:;" onclick="Dq('message','<?php echo $v['message'];?>');"><?php echo $v['message'] ? '<span class="f_green">已发</span>' : '<span class="f_red">未发</span>';?></a></td>
</tr>
<?php }?>
</table>
</form>
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

109
module/club/admin/template/reply.tpl.php

@ -0,0 +1,109 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
include tpl('header');
show_menu($menus);
load('club.css');
?>
<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>&nbsp;
<?php echo $fields_select;?>&nbsp;
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/>&nbsp;
<?php echo $level_select;?>&nbsp;
<?php echo $order_select;?>&nbsp;
<input type="submit" value="搜 索" class="btn"/>&nbsp;
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&gid=<?php echo $gid;?>&tid=<?php echo $tid;?>');"/>
</td>
</tr>
<tr>
<td>&nbsp;
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>&nbsp;
<input type="text" size="10" name="gid" value="<?php echo $gid;?>" placeholder="商圈ID" title="商圈ID"/>&nbsp;
<input type="text" size="10" name="tid" value="<?php echo $tid;?>" placeholder="帖子ID" title="帖子ID"/>&nbsp;
<input type="text" size="10" name="rid" value="<?php echo $rid;?>" placeholder="回复ID" title="回复ID"/>&nbsp;
</td>
</tr>
</table>
</form>
<form method="post">
<div id="content">
<table cellspacing="0" class="tb ls">
<tr>
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th>
<th width="16"></th>
<th>回复内容</th>
<th width="60">操作</th>
</tr>
<?php foreach($lists as $k=>$v) {?>
<tr align="center">
<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></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" style="padding:10px;">
<div>
<span class="f_r f_gray">
<span class="c_p" onclick="Dwidget('?file=like&action=like&mid=<?php echo $moduleid;?>&rid=<?php echo $v['itemid'];?>', '支持记录');">支持 (<?php echo $v['likes'];?>)</span> &nbsp;|&nbsp;
<span class="c_p" onclick="Dwidget('?file=like&action=hate&mid=<?php echo $moduleid;?>&rid=<?php echo $v['itemid'];?>', '反对记录');">反对 (<?php echo $v['hates'];?>)</span> &nbsp;|&nbsp;
<span class="c_p" onclick="Dwidget('?moduleid=3&file=guestbook&mid=<?php echo $moduleid;?>&rid=<?php echo $v['itemid'];?>', '举报记录');">举报 (<?php echo $v['reports'];?>)</span> &nbsp;|&nbsp;
<span class="c_p" onclick="Dwidget('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&rid=<?php echo $v['itemid'];?>', '回复记录');">回复 (<?php echo $v['reply'];?>)</span>
</span>
<?php echo $v['adddate'];?>&nbsp;
<?php if($v['username']) { ?>
<a href="javascript:_user('<?php echo $v['username'];?>');"><?php echo $v['passport'];?></a>
<?php } else { ?>
Guest
<?php } ?>
</div>
<div style="padding:16px 0;line-height:200%;font-size:14px;">
<?php echo $v['content'];?>
</div>
<div><a href="<?php echo $MOD['linkurl'];?>goto.php?itemid=<?php echo $v['itemid'];?>" target="_blank"><img src="admin/image/link.png" width="16" height="16" title="点击打开原帖" alt="" align="absmiddle"/></a> IP:<a href="?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>&ip=<?php echo $v['ip'];?>"><?php echo $v['ip'];?></a> - <?php echo ip2area($v['ip']);?></div>
</td>
<td>
<img src="admin/image/edit.png" width="16" height="16" title="修改" alt="" class="c_p" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=edit&itemid=<?php echo $v['itemid'];?>');"/>&nbsp;
<img src="admin/image/delete.png" width="16" height="16" title="删除" alt="" class="c_p" onclick="if(_delete()){Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&itemid=<?php echo $v['itemid'];?>')}"/>
</td>
</tr>
<?php }?>
</table>
</div>
<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';"/>&nbsp;
<input type="submit" value="拒 绝" class="btn-r" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=reject';"/>&nbsp;
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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';"/>&nbsp;
<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;}"/>&nbsp;
<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;}"/>&nbsp;
<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-r" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=cancel';"/>&nbsp;
<input type="submit" value="回收站" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=delete&recycle=1';"/>&nbsp;
<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;}"/>&nbsp;
<?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>' : '';?>
<script type="text/javascript">
var content_id = 'content';
var img_max_width = <?php echo $MOD['max_width'];?>;
</script>
<script type="text/javascript" src="<?php echo DT_STATIC;?>file/script/content.js?v=<?php echo DT_DEBUG ? DT_TIME : DT_REFRESH;?>"></script>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

47
module/club/admin/template/reply_edit.tpl.php

@ -0,0 +1,47 @@
<?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">
<?php if($history) { ?>
<tr>
<td class="tl" style="background:#FDE7E7;"><span class="f_red">*</span> 审核提示</td>
<td style="background:#FDE7E7;">该信息存在修改记录,<a href="javascript:Dwidget('?file=history&mid=<?php echo $moduleid;?>&itemid=<?php echo $itemid;?>&action=<?php echo $file;?>', '修改详情');" class="t">点击查看</a> 修改详情</td>
</tr>
<?php } ?>
<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></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</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><?php echo level_select('post[level]', '级别', $level);?></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';?> id="status_3"/><label for="status_3"> 通过</label>
<input type="radio" name="post[status]" value="2" <?php if($status == 2) echo 'checked';?> id="status_2"/><label for="status_2"> 待审</label>
<input type="radio" name="post[status]" value="1" <?php if($status == 1) echo 'checked';?> id="status_1"/><label for="status_1"> 拒绝</label>
<input type="radio" name="post[status]" value="0" <?php if($status == 0) echo 'checked';?> id="status_0"/><label for="status_0"> 删除</label>
</td>
</tr>
</table>
<div class="sbt"><input type="submit" name="submit" value="<?php echo $action == 'edit' ? '修 改' : '添 加';?>" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;<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">Menuon(<?php echo $status == 3 ? 0 : 1;?>);</script>
<?php include tpl('footer');?>

628
module/club/admin/template/setting.tpl.php

@ -0,0 +1,628 @@
<?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('show', $module, 'setting[template_show]', '默认模板', $template_show);?></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><?php echo tpl_select('group', $module, 'setting[template_group]', '默认模板', $template_group);?></td>
</tr>
<tr>
<td class="tl">粉丝默认模板</td>
<td><?php echo tpl_select('fans', $module, 'setting[template_fans]', '默认模板', $template_fans);?></td>
</tr>
<tr>
<td class="tl">群聊默认模板</td>
<td><?php echo tpl_select('chat', $module, 'setting[template_chat]', '默认模板', $template_chat);?></td>
</tr>
<tr>
<td class="tl">帖子发布模板</td>
<td><?php echo tpl_select('my_'.$module, 'member', 'setting[template_my]', '默认模板', $template_my);?></td>
</tr>
<tr>
<td class="tl">商圈管理模板</td>
<td><?php echo tpl_select('my_club_group', 'member', 'setting[template_my_group]', '默认模板', $template_my_reply);?></td>
</tr>
<tr>
<td class="tl">回复管理模板</td>
<td><?php echo tpl_select('my_club_reply', 'member', 'setting[template_my_reply]', '默认模板', $template_my_reply);?></td>
</tr>
<tr>
<td class="tl">加圈管理模板</td>
<td><?php echo tpl_select('my_club_join', 'member', 'setting[template_my_join]', '默认模板', $template_my_join);?></td>
</tr>
<tr>
<td class="tl">粉丝管理模板</td>
<td><?php echo tpl_select('my_club_fans', 'member', 'setting[template_my_fans]', '默认模板', $template_my_fans);?></td>
</tr>
<tr>
<td class="tl">版主管理模板</td>
<td><?php echo tpl_select('my_club_manage', 'member', 'setting[template_my_manage]', '默认模板', $template_my_manage);?></td>
</tr>
<tr>
<td class="tl">默认缩略图[宽X高]</td>
<td>
<input type="text" size="3" name="setting[thumb_width]" value="<?php echo $thumb_width;?>"/>
X
<input type="text" size="3" name="setting[thumb_height]" value="<?php echo $thumb_height;?>"/> px
</td>
</tr>
<tr>
<td class="tl">自动截取内容至简介</td>
<td><input type="text" size="3" name="setting[introduce_length]" value="<?php echo $introduce_length;?>"/> 字符</td>
</tr>
<tr>
<td class="tl">编辑器工具按钮</td>
<td>
<select name="setting[editor]">
<option value="Default"<?php if($editor == 'Default') echo ' selected';?>>全部</option>
<option value="Destoon"<?php if($editor == 'Destoon') echo ' selected';?>>精简</option>
<option value="Simple"<?php if($editor == 'Simple') echo ' selected';?>>简洁</option>
<option value="Basic"<?php if($editor == 'Basic') echo ' selected';?>>基础</option>
</select>
</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="addtime desc"<?php if($order == 'addtime desc') echo ' selected';?>>添加时间</option>
<option value="replytime desc"<?php if($order == 'replytime desc') echo ' selected';?>>回复时间</option>
<option value="itemid desc"<?php if($order == 'itemid 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[cat_property]" value="1" <?php if($cat_property) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[cat_property]" value="0" <?php if(!$cat_property) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">下载内容远程图片</td>
<td>
<input type="radio" name="setting[save_remotepic]" value="1" <?php if($save_remotepic) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[save_remotepic]" value="0" <?php if(!$save_remotepic) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">清除内容链接</td>
<td>
<input type="radio" name="setting[clear_link]" value="1" <?php if($clear_link) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[clear_link]" value="0" <?php if(!$clear_link) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">清除回复链接</td>
<td>
<input type="radio" name="setting[clear_alink]" value="1" <?php if($clear_alink) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[clear_alink]" value="0" <?php if(!$clear_alink) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">内容关联链接</td>
<td>
<input type="radio" name="setting[keylink]" value="1" <?php if($keylink) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[keylink]" value="0" <?php if(!$keylink) echo 'checked';?>/> 关闭
&nbsp;&nbsp;
<a href="javascript:Dwidget('?file=keylink&item=<?php echo $moduleid;?>', '[<?php echo $MOD['name'];?>]关联链接管理');" class="t">[管理链接]</a>
</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', '开启内容分表');"/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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', '关闭内容分表');"/> 关闭
&nbsp;<?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[fulltext]" value="1" <?php if($fulltext==1){ ?>checked <?php } ?>/> LIKE&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fulltext]" value="2" <?php if($fulltext==2){ ?>checked <?php } ?>/> MATCH&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fulltext]" value="0" <?php if($fulltext==0){ ?>checked <?php } ?>/> 关闭
<?php tips('此项会增加服务器负担,请根据需要和服务器配置决定是否开启。MATCH模式需要MySQL 4以上版本,且需要在MySQL的my.ini添加ft_min_word_len=1才能支持2个汉字的中文搜索。如果不能设置可以使用LIKE模式,但是效率会低于MATCH模式。<br/>开启MATCH模式请在数据库维护里执行以下SQL添加全文索引<br/>ALTER TABLE `'.$table_data.'` ADD FULLTEXT (`content`);<br/>全文索引占用一定数据空间,如果不开启MATCH模式可以执行以下语句删除索引<br/>ALTER TABLE `'.$table_data.'` DROP INDEX `content`;');?></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>
<textarea name="setting[manage_reasons]" style="width:98%;height:30px;overflow:visible;"><?php echo $manage_reasons;?></textarea>
</td>
</tr>
<tr>
<td class="tl">前台管理操作原因</td>
<td>
<input type="radio" name="setting[manage_reason]" value="0" <?php if($manage_reason==0) echo 'checked';?>/> 选填&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[manage_reason]" value="1" <?php if($manage_reason==1) echo 'checked';?>/> 必填&nbsp;&nbsp;&nbsp;&nbsp;
</td>
</tr>
<tr>
<td class="tl">前台管理通知作者</td>
<td>
<input type="radio" name="setting[manage_message]" value="0" <?php if($manage_message==0) echo 'checked';?>/> 默认&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[manage_message]" value="1" <?php if($manage_message==1) echo 'checked';?>/> 选中&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[manage_message]" value="2" <?php if($manage_message==2) echo 'checked';?>/> 强制 <?php tips('默认 - 默认不选中通知选项,圈子或版主可以自行选中<br/>选中 - 默认选中通知选项,圈子或版主可以自行取消<br/>强制 - 默认选中通知选项,圈子或版主不能自行取消');?>
</td>
</tr>
<tr>
<td class="tl">楼层中文别名</td>
<td>
<input type="text" name="setting[floor]" style="width:98%;" value="<?php echo $floor;?>"/></td>
</tr>
<tr>
<td class="tl">商圈群聊功能</td>
<td>
<input type="radio" name="setting[chat]" value="1" <?php if($chat) echo 'checked';?>/> 开启&nbsp;&nbsp;
<input type="radio" name="setting[chat]" value="0" <?php if(!$chat) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">群聊内容长度限制</td>
<td><input type="text" size="5" name="setting[chat_maxlen]" value="<?php echo $chat_maxlen;?>"/> 字符</td>
</tr>
<tr>
<td class="tl">群聊超时限制</td>
<td><input type="text" size="5" name="setting[chat_timeout]" value="<?php echo $chat_timeout;?>"/> <?php tips('当交谈双方超过此时间没有发言时,系统自动断开以减轻服务器压力,填0表示不自动断开');?></td>
</tr>
<tr>
<td class="tl">群聊轮询时间</td>
<td><input type="text" size="5" name="setting[chat_poll]" value="<?php echo $chat_poll;?>"/> <?php tips('群聊客户端需要定时请求服务器端数据,时间设置越短,信息发送的延迟越小,但是服务器压力越大,至少需要设置为1秒,一般建议设置为2秒-5秒之间的数值,推荐设置为3秒');?></td>
</tr>
<tr>
<td class="tl">两次发言间隔时间</td>
<td><input type="text" size="5" name="setting[chat_mintime]" value="<?php echo $chat_mintime;?>"/> <?php tips('防止发言过快');?></td>
</tr>
<tr>
<td class="tl">群聊发送文件</td>
<td>
<input type="radio" name="setting[chat_file]" value="1" <?php if($chat_file) echo 'checked';?>/> 开启&nbsp;&nbsp;
<input type="radio" name="setting[chat_file]" value="0" <?php if(!$chat_file) echo 'checked';?>/> 关闭
</td>
</tr>
<tr>
<td class="tl">群聊自动解析网址</td>
<td>
<input type="radio" name="setting[chat_url]" value="1" <?php if($chat_url) echo 'checked';?>/> 开启&nbsp;&nbsp;
<input type="radio" name="setting[chat_url]" value="0" <?php if(!$chat_url) echo 'checked';?>/> 关闭<?php tips('当内容含有网址时,自动解析为超链接');?>
</td>
</tr>
<tr>
<td class="tl">群聊解析图片地址</td>
<td>
<input type="radio" name="setting[chat_img]" value="1" <?php if($chat_img) echo 'checked';?>/> 开启&nbsp;&nbsp;
<input type="radio" name="setting[chat_img]" value="0" <?php if(!$chat_img) echo 'checked';?>/> 关闭<?php tips('当内容含有图片地址时,自动显示图片');?>
</td>
</tr>
<tr>
<td class="tl">首页幻灯信息数量</td>
<td><input type="text" size="3" name="setting[page_islide]" value="<?php echo $page_islide;?>"/></td>
</tr>
<tr>
<td class="tl">首页分类商圈数量</td>
<td><input type="text" size="3" name="setting[page_icat]" value="<?php echo $page_icat;?>"/></td>
</tr>
<tr>
<td class="tl">列表置顶帖子数量</td>
<td><input type="text" size="3" name="setting[maxontop]" value="<?php echo $maxontop;?>"/></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="text" size="3" name="setting[reply_pagesize]" value="<?php echo $reply_pagesize;?>"/></td>
</tr>
<tr>
<td class="tl">内容图片最大宽度</td>
<td><input type="text" size="3" name="setting[max_width]" value="<?php echo $max_width;?>"/> px</td>
</tr>
<tr>
<td class="tl">内容点击次数</td>
<td>
<input type="radio" name="setting[hits]" value="1" <?php if($hits) echo 'checked';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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';?>/> 开启&nbsp;&nbsp;&nbsp;&nbsp;
<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 } ?>/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<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';"/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<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">内容页是否生成html</td>
<td>
<input type="radio" name="setting[show_html]" value="1" <?php if($show_html){ ?>checked <?php } ?> onclick="Dd('show_html').style.display='';Dd('show_php').style.display='none';"/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[show_html]" value="0" <?php if(!$show_html){ ?>checked <?php } ?> onclick="Dd('show_html').style.display='none';Dd('show_php').style.display='';"/> 否
</td>
</tr>
<tbody id="show_html" style="display:<?php echo $show_html ? '' : 'none'; ?>">
<tr>
<td class="tl">HTML内容页文件名前缀</td>
<td><input name="setting[htm_item_prefix]" type="text" id="htm_item_prefix" value="<?php echo $htm_item_prefix;?>" size="10"></td>
</tr>
<tr>
<td class="tl">HTML内容页地址规则</td>
<td><?php echo url_select('setting[htm_item_urlid]', 'htm', 'item', $htm_item_urlid);?></td>
</tr>
</tbody>
<tr id="show_php" style="display:<?php echo $show_html ? 'none' : ''; ?>">
<td class="tl">PHP内容页地址规则</td>
<td><?php echo url_select('setting[php_item_urlid]', 'php', 'item', $php_item_urlid);?></td>
</tr>
<tr>
<td class="tl">商圈名后缀</td>
<td><input name="setting[seo_name]" type="text" id="seo_name" value="<?php echo $seo_name;?>" size="5"/></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_show][]', $group_show);?></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_reply][]', $group_reply);?></td>
</tr>
<tr>
<td class="tl">审核创建商圈</td>
<td>
<input type="radio" name="setting[check_group]" value="2" <?php if($check_group == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_group]" value="1" <?php if($check_group == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_group]" value="0" <?php if($check_group == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">创建商圈验证码</td>
<td>
<input type="radio" name="setting[captcha_group]" value="2" <?php if($captcha_group == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_group]" value="1" <?php if($captcha_group == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_group]" value="0" <?php if($captcha_group == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">创建商圈验证问题</td>
<td>
<input type="radio" name="setting[question_group]" value="2" <?php if($question_group == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_group]" value="1" <?php if($question_group == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_group]" value="0" <?php if($question_group == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">审核商圈发帖</td>
<td>
<input type="radio" name="setting[check_add]" value="2" <?php if($check_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_add]" value="1" <?php if($check_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_add]" value="0" <?php if($check_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">商圈发帖验证码</td>
<td>
<input type="radio" name="setting[captcha_add]" value="2" <?php if($captcha_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_add]" value="1" <?php if($captcha_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_add]" value="0" <?php if($captcha_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">商圈发帖验证问题</td>
<td>
<input type="radio" name="setting[question_add]" value="2" <?php if($question_add == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_add]" value="1" <?php if($question_add == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_add]" value="0" <?php if($question_add == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">审核帖子回复</td>
<td>
<input type="radio" name="setting[check_reply]" value="2" <?php if($check_reply == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_reply]" value="1" <?php if($check_reply == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[check_reply]" value="0" <?php if($check_reply == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">帖子回复验证码</td>
<td>
<input type="radio" name="setting[captcha_reply]" value="2" <?php if($captcha_reply == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_reply]" value="1" <?php if($captcha_reply == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[captcha_reply]" value="0" <?php if($captcha_reply == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">帖子回复验证问题</td>
<td>
<input type="radio" name="setting[question_reply]" value="2" <?php if($question_reply == 2) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_reply]" value="1" <?php if($question_reply == 1) echo 'checked';?>> 全部启用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[question_reply]" value="0" <?php if($question_reply == 0) echo 'checked';?>> 全部关闭
</td>
</tr>
<tr>
<td class="tl">会员是否收费</td>
<td>
<input type="radio" name="setting[fee_mode]" value="1" <?php if($fee_mode == 1) echo 'checked';?>> 继承会员组设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fee_mode]" value="0" <?php if($fee_mode == 0) echo 'checked';?>> 全部启用
</td>
</tr>
<tr>
<td class="tl">会员收费使用</td>
<td>
<input type="radio" name="setting[fee_currency]" value="money" <?php if($fee_currency == 'money') echo 'checked';?>/> <?php echo $DT['money_name'];?>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="setting[fee_currency]" value="credit" <?php if($fee_currency == 'credit') echo 'checked';?>/> <?php echo $DT['credit_name'];?>
</td>
</tr>
<tr>
<td class="tl">发布信息收费</td>
<td><input type="text" size="5" name="setting[fee_add]" value="<?php echo $fee_add;?>"/> <?php echo $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?>/条</td>
</tr>
<tr>
<td class="tl">查看信息收费</td>
<td><input type="text" size="5" name="setting[fee_view]" value="<?php echo $fee_view;?>"/> <?php echo $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];?>/条</td>
</tr>
<tr>
<td class="tl">收费有效时间</td>
<td><input type="text" size="5" name="setting[fee_period]" value="<?php echo $fee_period;?>"/> 分钟 <?php tips('如果支付时间超过有效时间,系统将重新收费<br/>填零表示不重复收费');?></td>
</tr>
<tr>
<td class="tl">向发布人返利</td>
<td><input type="text" size="2" name="setting[fee_back]" value="<?php echo $fee_back;?>"/> % <?php tips('请填写1-100之间的数字,用户支付之后,系统将按此比例向发布人增加对应的'.$DT['money_name'].'或者'.$DT['credit_name']);?></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>
<tr>
<td class="tl">未支付内容显示</td>
<td><input type="text" size="5" name="setting[pre_view]" value="<?php echo $pre_view;?>"/> 字符</td>
</tr>
</table>
<div class="tt"><?php echo $DT['credit_name'];?>规则</div>
<table cellspacing="0" class="tb">
<tr>
<td class="tl">发布帖子奖励</td>
<td><input type="text" size="5" name="setting[credit_add]" value="<?php echo $credit_add;?>"/></td>
</tr>
<tr>
<td class="tl">帖子被加精奖励</td>
<td><input type="text" size="5" name="setting[credit_level]" value="<?php echo $credit_level;?>"/></td>
</tr>
<tr>
<td class="tl">帖子被删除扣除</td>
<td><input type="text" size="5" name="setting[credit_del]" value="<?php echo $credit_del;?>"/></td>
</tr>
<tr>
<td class="tl">发布回复奖励</td>
<td><input type="text" size="5" name="setting[credit_reply]" value="<?php echo $credit_reply;?>"/></td>
</tr>
<tr>
<td class="tl">回复被删除扣除</td>
<td><input type="text" size="5" name="setting[credit_del_reply]" value="<?php echo $credit_del_reply;?>"/></td>
</tr>
</table>
<div class="tt">发布数量</div>
<table cellspacing="0" class="tb">
<tr align="center">
<td width="158">会员组</td>
<td width="100">总数限制</td>
<td width="100">免费数量</td>
<td width="100">创建商圈</td>
<td width="100">加入商圈</td>
<td width="100">每日回复</td>
<td align="right"><a href="<?php echo DT_PATH;?>api/redirect.php?url=https://www.destoon.com/doc/skill/94.html" target="_blank" class="t">设置说明</a></td>
</tr>
<?php foreach($GROUP as $v) {?>
<tr align="center">
<td><?php echo $v['groupname'];?></td>
<?php $k = 'limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<?php $k = 'free_limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<?php $k = 'group_limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<?php $k = 'join_limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<?php $k = 'reply_limit_'.$v['groupid'];?>
<td><input type="text" name="setting[<?php echo $k;?>]" size="5" value="<?php echo $$k;?>"/></td>
<td></td>
</tr>
<?php }?>
</table>
</div>
<div class="sbt">
<input type="submit" name="submit" value="保 存" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;
<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');?>

9
module/club/admin/uninstall.inc.php

@ -0,0 +1,9 @@
<?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."`");
$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_fans_".$moduleid."`");
$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_group_".$moduleid."`");
$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_manage_".$moduleid."`");
$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_reply_".$moduleid."`");
?>

311
module/club/club.class.php

@ -0,0 +1,311 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
class club {
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','gid','video','level','title','style','fee','introduce','thumb','tag','status','hits','username','addtime','editor','edittime','ip','template', 'linkurl','filepath','note');
}
function club($moduleid) {
$this->__construct($moduleid);
}
function pass($post) {
if(!is_array($post)) return false;
if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title'));
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;
if($post['level'] > 3) $post['level'] = 3;
$post['video'] = strpos($post['content'], '<embed') !== false ? 1 : 0;
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']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME;
$post['edittime'] = DT_TIME;
$post['fee'] = dround($post['fee']);
$post['editor'] = $_cname ? $_cname : $_username;
$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, $table_group;
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 = $groupids = 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['replydate'] = timetodate($r['replytime'], 5);
$r['alt'] = $r['title'];
$r['title'] = set_style($r['title'], $r['style']);
$r['linkurl'] = $MOD['linkurl'].$r['linkurl'];
$catids[$r['catid']] = $r['catid'];
$groupids[$r['gid']] = $r['gid'];
$lists[] = $r;
}
if($catids) {
$CATS = array();
$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'] : '';
}
}
}
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 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) {
global $table_reply;
$item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid");
$update = '';
$GRP = get_group($item['gid']);
$keyword = $item['title'].','.$GRP['title'].','.strip_tags(cat_pos(get_cat($item['catid']), ','));
if($keyword != $item['keyword']) {
$keyword = str_replace("//", '', addslashes($keyword));
$update .= ",keyword='$keyword'";
}
if($item['username']) {
$passport = addslashes(get_user($item['username'], 'username', 'passport'));
if($passport != $item['passport']) $update .= ",passport='$passport'";
}
if($GRP['areaid'] != $item['areaid']) $update .= ",areaid='$GRP[areaid]'";
$item['itemid'] = $itemid;
$linkurl = itemurl($item);
if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'";
if($item['hits'] > 1 || $item['status'] == 3) {
$reply = DB::count($table_reply, "tid=$itemid AND status=3");
if($reply != $item['reply']) $update .= ",reply='$reply'";
}
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");
$this->tohtml($itemid);
return true;
}
}
function delete($itemid, $all = true) {
global $MOD, $table_reply;
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);
$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');
$result = DB::query("SELECT * FROM {$table_reply} WHERE tid=$itemid");
while($rr = DB::fetch_array($result)) {
if($rr['content']) delete_local($rr['content'], get_user($rr['username']));
}
DB::query("DELETE FROM {$table_reply} WHERE tid=$itemid");
}
}
}
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;
}
}
?>

11
module/club/common.inc.php

@ -0,0 +1,11 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
require_once 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_fans = $DT_PRE.$module.'_fans_'.$moduleid;
$table_group = $DT_PRE.$module.'_group_'.$moduleid;
$table_manage = $DT_PRE.$module.'_manage_'.$moduleid;
$table_reply = $DT_PRE.$module.'_reply_'.$moduleid;
?>

28
module/club/fans.inc.php

@ -0,0 +1,28 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
require DT_ROOT.'/module/'.$module.'/common.inc.php';
$gid = isset($gid) ? intval($gid) : 0;
$gid or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']);
$GRP = get_group($gid);
($GRP && $GRP['status'] == 3) or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']);
$admin = is_admin($GRP);
$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 $offset,$pagesize");
while($r = $db->fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 'Y/m/d H:i');
$lists[] = $r;
}
include DT_ROOT.'/include/seo.inc.php';
$seo_title = $L['fans_title'].$seo_delimiter.$GRP['title'].$MOD['seo_name'].$seo_delimiter.$seo_page.$seo_modulename.$seo_delimiter.$seo_sitename;
if($DT_PC) {
if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL);
} else {
if($sns_app) $seo_title = $MOD['name'];
}
$template = $GRP['fans_template'] ? $GRP['fans_template'] : ($MOD['template_fans'] ? $MOD['template_fans'] : 'fans');
include template($template, $module);
?>

43
module/club/global.func.php

@ -0,0 +1,43 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
function get_group($gid) {
global $table_group;
return $gid > 0 ? DB::get_one("SELECT * FROM {$table_group} WHERE itemid=$gid") : array();
}
function is_fans($GRP) {
global $table_fans, $_username, $_passport;
if($_username) {
if($GRP['username'] == $_username) return true;
if($GRP['manager'] && in_array($_passport, explode('|', $GRP['manager']))) return true;
$t = DB::get_one("SELECT * FROM {$table_fans} WHERE gid=$GRP[itemid] AND username='$_username' AND status=3");
if($t) return $t;
}
return false;
}
function is_admin($GRP) {
global $_admin, $_username, $_passport;
if($_username) {
if($_admin == 1) return 'admin';
if($GRP['username'] == $_username) return 'founder';
if($GRP['manager'] && in_array($_passport, explode('|', $GRP['manager']))) return 'manager';
}
return '';
}
function last_gid() {
global $_username, $table, $table_group, $table_fans, $table_reply;
$t = DB::get_one("SELECT gid FROM {$table} WHERE username='$_username' ORDER BY itemid DESC");
if($t) return $t['gid'];
$t = DB::get_one("SELECT itemid FROM {$table_group} WHERE status=3 AND username='$_username' ORDER BY itemid DESC");
if($t) return $t['itemid'];
$t = DB::get_one("SELECT gid FROM {$table_fans} WHERE username='$_username' ORDER BY itemid DESC");
if($t) return $t['gid'];
$t = DB::get_one("SELECT gid FROM {$table_reply} WHERE username='$_username' ORDER BY itemid DESC");
if($t) return $t['gid'];
$t = DB::get_one("SELECT itemid FROM {$table_group} WHERE status=3 ORDER BY itemid DESC");
if($t) return $t['itemid'];
return 0;
}
?>

128
module/club/group.htm.php

@ -0,0 +1,128 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
if(!$MOD['list_html'] || !$itemid) return false;
$gid = $catid = $itemid;
$GRP = get_group($gid);
if(!$GRP || $GRP['status'] != 3) return false;
$CAT = get_cat($GRP['catid']);
$GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array();
$admin = '';
$typeid = 0;
$condition = 'status=3 AND gid='.$catid;
if($page == 1) {
$items = $db->count($table, $condition);
if($items != $GRP['post']) {
$GRP['post'] = $items;
$db->query("UPDATE {$table_group} SET post=$items WHERE itemid=$catid");
}
$reply = $db->count($table_reply, $condition, $CFG['db_expires']);
if($reply != $GRP['reply']) {
$GRP['reply'] = $reply;
$db->query("UPDATE {$table_group} SET reply=$reply WHERE itemid=$catid");
}
$fans = $db->count($table_fans, $condition, $CFG['db_expires']);
if($fans != $GRP['fans']) {
$GRP['fans'] = $fans;
$db->query("UPDATE {$table_group} SET fans=$fans WHERE itemid=$catid");
}
} else {
$items = $GRP['post'];
}
$pagesize = $MOD['pagesize'];
$showpage = 1;
$datetype = 5;
$template = $GRP['template'] ? $GRP['template'] : 'group';
$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;
$_CAT = array('catid' => $GRP['itemid'], 'catdir' => $GRP['filepath'], 'catname' => $GRP['title'], 'linkurl' => $GRP['linkurl']);
$pages = listpages($_CAT, $items, $page, $pagesize);
$tags = array();
if($page == 1) {
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE status=3 AND ontop=2 ORDER BY addtime DESC LIMIT ".$MOD['maxontop'], 'CACHE');
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'];
if(!$r['username']) $r['username'] = 'Guest';
$tags[] = $r;
}
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE status=3 AND gid=$gid AND ontop=1 ORDER BY addtime DESC LIMIT ".$MOD['maxontop'], 'CACHE');
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'];
if(!$r['username']) $r['username'] = 'Guest';
$tags[] = $r;
}
}
if($items) {
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}");
while($r = $db->fetch_array($result)) {
if($r['ontop']) continue;
$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'];
if(!$r['username']) $r['username'] = 'Guest';
$tags[] = $r;
}
$db->free_result($result);
}
include DT_ROOT.'/include/seo.inc.php';
$seo_title = $GRP['title'].$MOD['seo_name'].$seo_delimiter.$seo_page.$seo_modulename.$seo_delimiter.$seo_sitename;
$head_keywords = $GRP['title'].$MOD['seo_name'].','.$MOD['name'];
$head_description = dsubstr(dtrim($GRP['content']), 200);
$destoon_task = "moduleid=$moduleid&html=list&catid=$catid&page=$page";
if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].listurl($_CAT, $page);
$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($_CAT, $page);
$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], 5);
$tags[] = $r;
}
if($items) $js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid.'&typeid='.$typeid;
$head_title = $head_name = $GRP['title'].$MOD['seo_name'];
$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;
?>

133
module/club/group.inc.php

@ -0,0 +1,133 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
$gid = $catid;
$GRP = get_group($gid);
if(!$GRP || $GRP['status'] != 3) include load('404.inc');
if($GRP['list_type'] && !is_fans($GRP)) {
$action = 'list';
$head_title = lang('message->without_permission');
exit(include template('nofans', $module));
}
$CAT = get_cat($GRP['catid']);
$GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array();
$admin = is_admin($GRP);
$typeid = isset($typeid) ? intval($typeid) : 0;
isset($TYPE[$typeid]) or $typeid = 0;
$condition = 'status=3 AND gid='.$catid;
if($typeid) {
switch($typeid) {
case 1:
$MOD['order'] = 'addtime DESC';
break;
case 2:
$MOD['order'] = 'replytime DESC';
break;
case 3:
$condition .= " AND level>0";
break;
case 4:
$condition .= " AND addtime>".($DT_TIME - 86400*30);
$MOD['order'] = 'hits DESC';
break;
}
}
if($typeid) {
$items = $db->count($table, $condition, $CFG['db_expires']);
} else {
if($page == 1) {
$items = $db->count($table, $condition, $CFG['db_expires']);
if($items != $GRP['post']) {
$GRP['post'] = $items;
$db->query("UPDATE {$table_group} SET post=$items WHERE itemid=$catid");
}
$reply = $db->count($table_reply, $condition, $CFG['db_expires']);
if($reply != $GRP['reply']) {
$GRP['reply'] = $reply;
$db->query("UPDATE {$table_group} SET reply=$reply WHERE itemid=$catid");
}
$fans = $db->count($table_fans, $condition, $CFG['db_expires']);
if($fans != $GRP['fans']) {
$GRP['fans'] = $fans;
$db->query("UPDATE {$table_group} SET fans=$fans WHERE itemid=$catid");
}
} else {
$items = $GRP['post'];
}
}
$pagesize = $MOD['pagesize'];
$offset = ($page-1)*$pagesize;
if($typeid) {
$pages = pages($items, $page, $pagesize);
} else {
$pages = listpages(array('catid' => $GRP['itemid'], 'catdir' => $GRP['filepath'], 'catname' => $GRP['title'], 'linkurl' => $GRP['linkurl']), $items, $page, $pagesize);
}
$tags = array();
if($typeid == 0 && $page == 1) {
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE status=3 AND ontop=2 ORDER BY addtime DESC LIMIT ".$MOD['maxontop'], 'CACHE');
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'];
if(!$r['username']) $r['username'] = 'Guest';
$tags[] = $r;
}
$result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE status=3 AND gid=$gid AND ontop=1 ORDER BY addtime DESC LIMIT ".$MOD['maxontop'], 'CACHE');
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'];
if(!$r['username']) $r['username'] = 'Guest';
$tags[] = $r;
}
}
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)) {
if($r['ontop']) continue;
$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'];
if(!$r['username']) $r['username'] = 'Guest';
$tags[] = $r;
}
$db->free_result($result);
}
$_CAT = array('catid' => $GRP['itemid'], 'catdir' => $GRP['filepath'], 'catname' => $GRP['title']);
if($DT_PC) {
if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].listurl($_CAT, $page);
} else {
$time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'replytime';
if(strpos($DT_URL, 'typeid') === false) {
$pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].listurl($_CAT, '{destoon_page}'));
} else {
$pages = mobile_pages($items, $page, $pagesize);
}
$lists = array();
foreach($tags as $r) {
$r['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $r['linkurl']);
$r['date'] = timetodate($r[$time], 5);
$lists[] = $r;
}
$tags = $lists;
if($items) $js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid.'&typeid='.$typeid;
$head_title = $head_name = $GRP['title'].$MOD['seo_name'];
if($sns_app) $seo_title = $MOD['name'];
}
$showpage = 1;
$datetype = 5;
include DT_ROOT.'/include/seo.inc.php';
$seo_title = ($typeid ? $TYPE[$typeid].$seo_delimiter : '').$GRP['title'].$MOD['seo_name'].$seo_delimiter.$seo_page.$seo_modulename.$seo_delimiter.$seo_sitename;
$head_keywords = $GRP['title'].$MOD['seo_name'].','.$MOD['name'];
$head_description = dsubstr(dtrim($GRP['content']), 200);
$template = $GRP['template'] ? $GRP['template'] : ($MOD['template_group'] ? $MOD['template_group'] : 'group');
include template($template, $module);
?>

46
module/club/index.htm.php

@ -0,0 +1,46 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext'];
if(!$MOD['index_html']) return html_del($filename);
$maincat = $childcat = get_maincat(0, $moduleid, 1);
$seo_file = 'index';
include DT_ROOT.'/include/seo.inc.php';
$destoon_task = "moduleid=$moduleid&html=index";
$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 = "status=3";
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_group} 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'];
$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'];
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;
?>

1
module/club/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

119
module/club/join.class.php

@ -0,0 +1,119 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
class djoin {
var $itemid;
var $table;
var $fields;
var $errmsg = errmsg;
function __construct() {
global $table_fans;
$this->table = $table_fans;
$this->fields = array('gid','reason','username','passport','addtime','status');
}
function djoin() {
$this->__construct();
}
function pass($post) {
global $GRP, $L;
if(!is_array($post)) return false;
if($GRP['join_type'] && !$post['reason']) return $this->_($L['join_pass_reason']);
if(strlen($post['reason']) > 3*500) return $this->_($L['join_pass_max_reason']);
return true;
}
function set($post) {
global $_username, $_passport;
$post['status'] = $post['status'] == 3 ? 3 : 2;
if($this->itemid) {
//
} else {
$post['addtime'] = DT_TIME;
$post['username'] = $_username;
$post['passport'] = $_passport;
}
$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, $table, $table_group, $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 = $gids = $GRPS = array();
$result = DB::query("SELECT itemid,gid,addtime FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize");
while($r = DB::fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 5);
$gids[$r['gid']] = $r['gid'];
$lists[] = $r;
}
if($gids) {
$result = DB::query("SELECT * FROM {$table_group} WHERE itemid IN (".implode(',', $gids).")");
while($r = DB::fetch_array($result)) {
$GRPS[$r['itemid']] = $r;
}
if($GRPS) {
foreach($lists as $k=>$v) {
$lists[$k]['title'] = $GRPS[$v['gid']]['title'];
$lists[$k]['thumb'] = $GRPS[$v['gid']]['thumb'];
$lists[$k]['post'] = $GRPS[$v['gid']]['post'];
$lists[$k]['fans'] = $GRPS[$v['gid']]['fans'];
$lists[$k]['linkurl'] = $MOD['linkurl'].$GRPS[$v['gid']]['linkurl'];
}
}
}
return $lists;
}
function add($post) {
$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();
return $this->itemid;
}
function edit($post) {
$post = $this->set($post);
$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) {
if(is_array($itemid)) {
foreach($itemid as $v) {
$this->delete($v);
}
} else {
DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid");
}
}
function _($e) {
$this->errmsg = $e;
return false;
}
}
?>

92
module/club/list.htm.php

@ -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_group, $condition);
if($items != $CAT['item']) {
$CAT['item'] = $items;
$db->query("UPDATE {$DT_PRE}category SET item=$items WHERE catid=$catid");
}
} else {
$items = $CAT['item'];
}
$showpage = 1;
$datetype = 5;
$template = $CAT['template'] ? $CAT['template'] : ($MOD['template_list'] ? $MOD['template_list'] : 'list');
$total = max(ceil($items/$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 * FROM {$table_group} WHERE {$condition} ORDER BY addtime DESC 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'];
$r['introduce'] = dsubstr(dtrim($r['content']), 60, '...');
$r['managers'] = $r['manager'] ? explode('|', $r['manager']) : array();
$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;
?>

91
module/club/list.inc.php

@ -0,0 +1,91 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
require DT_ROOT.'/module/'.$module.'/common.inc.php';
if(!$CAT) exit(include DT_ROOT.'/module/'.$module.'/group.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_group, $condition, $CFG['db_expires']);
} else {
if($page == 1) {
$items = $db->count($table_group, $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'];
}
}
$pages = listpages($CAT, $items, $page, $pagesize);
$tags = array();
if($items) {
$result = $db->query("SELECT * FROM {$table_group} WHERE {$condition} ORDER BY addtime DESC 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'];
$r['introduce'] = dsubstr(dtrim($r['content']), 60, '...');
$r['managers'] = $r['manager'] ? explode('|', $r['manager']) : array();
$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']);
$gid = 0;
$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_group} 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 * FROM {$table_group} WHERE {$condition} ORDER BY addtime DESC 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'];
$r['date'] = timetodate($r[$time], 3);
$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);
?>

74
module/club/manage.class.php

@ -0,0 +1,74 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
class manage {
var $itemid;
var $table;
var $errmsg = errmsg;
function __construct() {
global $table_manage;
$this->table = $table_manage;
}
function manage() {
$this->__construct();
}
function get_one() {
return DB::get_one("SELECT * FROM {$this->table} WHERE itemid='$this->itemid'");
}
function get_list($condition, $order = 'itemid DESC') {
global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum, $L, $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);
if($r['typeid'] == 1) {
$r['linkurl'] = "javascript:alert('".$L['manage_has_del']."');";
$r['blank'] = 0;
} else {
$r['linkurl'] = $r['tid'] ? DT_PATH.'api/redirect.php?mid='.$MOD['moduleid'].'&itemid='.$r['tid'] : $MOD['linkurl'].'goto.php?itemid='.$r['rid'];
$r['blank'] = 1;
}
$r['value'] = '';
if($r['typeid'] == 3) {
$r['value'] = $r['content'] ? $L['manage_level'].$r['content'] : $L['manage_cancel'];
} else if($r['typeid'] == 4) {
$r['value'] = $r['content'] ? ($r['content'] == 1 ? $L['manage_ontop_1'] : $L['manage_ontop_2']) : $L['manage_cancel'];
} else if($r['typeid'] == 5) {
$r['value'] = $r['content'] ? '<div style="width:10px;height:10px;line-height:10px;background:'.$r['content'].';">&nbsp;</div>' : $L['manage_cancel'];
}
$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 _($e) {
$this->errmsg = $e;
return false;
}
}
?>

79
module/club/my_fans.inc.php

@ -0,0 +1,79 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
login();
require DT_ROOT.'/module/'.$module.'/fans.class.php';
$do = new fans();
if($action) {
($itemid && is_array($itemid)) or message($L['my_choose_fans']);
foreach($itemid as $fid) {
$F = $db->get_one("SELECT * FROM {$table_fans} WHERE itemid=$fid");
$GRP = get_group($F['gid']);
($GRP && $GRP['status'] == 3) or message($L['my_not_group']);
($_admin || $GRP['username'] == $_username) or message($L['my_not_admin']);
}
}
switch($action) {
case 'delete':
$do->recycle($itemid);
dmsg($L['success_delete'], $forward);
break;
case 'cancel':
$do->check($itemid, 2);
dmsg($L['success_cancel'], $forward);
break;
case 'ban':
$do->ban($itemid, 1);
dmsg($L['success_ban'], $forward);
break;
case 'unban':
$do->ban($itemid, 0);
dmsg($L['success_cancel'], $forward);
break;
case 'check':
$do->check($itemid);
dmsg($L['success_checked'], $forward);
break;
case 'reject':
$do->reject($itemid);
dmsg($L['success_reject'], $forward);
break;
default:
$gid = isset($gid) ? intval($gid) : 0;
$ids = '';
$result = $db->query("SELECT itemid FROM {$table_group} WHERE username='$_username'");
while($r = $db->fetch_array($result)) {
$ids .= ','.$r['itemid'];
}
if(!$_admin && strpos($ids.',', ','.$gid.',') === false) $gid = 0;
$gid or $gid = '';
$status = isset($status) ? intval($status) : 3;
in_array($status, array(1, 2, 3)) or $status = 3;
$condition = $gid ? "gid=$gid" : ($ids ? "gid IN (".substr($ids, 1).")" : "gid=0");
$nums = array();
for($i = 1; $i < 4; $i++) {
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_fans} WHERE $condition AND status=$i");
$nums[$i] = $r['num'];
}
$sfields = $L['my_fans_fields'];
$dfields = array('username', 'reason');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$fields_select = dselect($sfields, 'fields', '', $fields);
$condition .= " AND status=$status";
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
$lists = $do->get_list($condition);
break;
}
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 {
$pages = mobile_pages($items, $page, $pagesize);
$foot = '';
}
}
$head_title = $L['my_fans_title'];
include template($MOD['template_my_fans'] ? $MOD['template_my_fans'] : 'my_club_fans', 'member');
?>

128
module/club/my_group.inc.php

@ -0,0 +1,128 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
login();
$group_limit = intval($MOD['group_limit_'.$_groupid]);
$group_limit > -1 or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1');
require DT_ROOT.'/module/'.$module.'/group.class.php';
$do = new group($moduleid);
$sql = "username='$_username'";
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0;
if(in_array($action, array('', 'add')) && $group_limit) {
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_group} WHERE $sql AND status>1");
$limit_used = $r['num'];
$limit_free = $group_limit > $limit_used ? $group_limit - $limit_used : 0;
}
switch($action) {
case 'add':
if($group_limit && $limit_used >= $group_limit) dalert(lang($L['info_limit'], array($group_limit, $limit_used)), $MODULE[2]['linkurl'].$DT['file_my'].'?mid='.$mid.'&job='.$job);
$need_captcha = $MOD['captcha_group'] == 2 ? $MG['captcha'] : $MOD['captcha_group'];
$need_question = $MOD['question_group'] == 2 ? $MG['question'] : $MOD['question_group'];
if($submit) {
$msg = captcha($captcha, $need_captcha, true);
if($msg) dalert($msg);
$msg = question($answer, $need_question, true);
if($msg) dalert($msg);
$post['username'] = $_username;
if($do->pass($post)) {
$CAT = get_cat($post['catid']);
if(!$CAT) dalert(lang($L['group'], array($CAT['catname'])));
$post['addtime'] = $post['level'] = $post['fee'] = 0;
$post['style'] = $post['template'] = $post['note'] = $post['filepath'] = '';
$need_check = $MOD['check_group'] == 2 ? $MG['check'] : $MOD['check_group'];
$post['status'] = get_status(3, $need_check);
$post['hits'] = 0;
$post['areaid'] = $cityid;
$post['filepath'] = '';
$do->add($post);
$msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add'];
$js = '';
set_cookie('dmsg', $msg);
$forward = '?mid='.$mid.'&job='.$job.'&status='.$post['status'];
$msg = '';
$js .= 'window.onload=function(){parent.window.location="'.$forward.'";}';
dalert($msg, '', $js);
} else {
dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : ''));
}
} else {
$_catid = $catid;
foreach($do->fields as $v) {
$$v = '';
}
$content = '';
$catid = $_catid;
$areaid = $cityid;
$item = array();
}
break;
case 'edit':
$itemid or message();
$do->itemid = $itemid;
$item = $do->get_one();
if(!$item || $item['username'] != $_username) message();
if($submit) {
$post['username'] = $_username;
if($do->pass($post)) {
$post['catid'] = $item['catid'];
$post['areaid'] = $item['areaid'];
$post['title'] = addslashes($item['title']);
$post['level'] = $item['level'];
$post['fee'] = $item['fee'];
$post['style'] = addslashes($item['style']);
$post['template'] = addslashes($item['template']);
$post['show_template'] = addslashes($item['show_template']);
$post['fans_template'] = addslashes($item['fans_template']);
$post['chat_template'] = addslashes($item['chat_template']);
$post['filepath'] = addslashes($item['filepath']);
$post['status'] = $item['status'];
$post['hits'] = $item['hits'];
$post['chat'] = $item['chat'];
$do->edit($post);
set_cookie('dmsg', $L['success_edit']);
dalert('', '', 'parent.window.location="'.$forward.'"');
} else {
dalert($do->errmsg);
}
} else {
extract($item);
}
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('title', $keyword);
if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid";
$lists = $do->get_list($condition, 'addtime desc');
break;
}
if($_userid) {
$nums = array();
for($i = 1; $i < 4; $i++) {
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_group} 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);
$foot = '';
}
}
$head_title = $L['my_group_title'];
include template($MOD['template_my_group'] ? $MOD['template_my_group'] : 'my_club_group', 'member');
?>

102
module/club/my_join.inc.php

@ -0,0 +1,102 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
login();
$join_limit = intval($MOD['join_limit_'.$_groupid]);
$join_limit > -1 or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1');
require DT_ROOT.'/module/'.$module.'/join.class.php';
$do = new djoin($moduleid);
$sql = "username='$_username'";
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0;
if(in_array($action, array('', 'add')) && $join_limit) {
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_fans} WHERE $sql AND status>1");
$limit_used = $r['num'];
$limit_free = $join_limit > $limit_used ? $join_limit - $limit_used : 0;
}
switch($action) {
case 'add':
if($join_limit && $limit_used >= $join_limit) dalert(lang($L['info_limit'], array($join_limit, $limit_used)), ($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).$DT['file_my'].'?mid='.$mid.'&job='.$job);
$gid = isset($gid) ? intval($gid) : 0;
$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']);
$M = $db->get_one("SELECT * FROM {$table_fans} WHERE gid=$gid AND username='$_username'");
if($M) {
if($M['status'] == 3) message($L['my_join_repeat'], ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).rewrite('fans.php?gid='.$gid));
message($L['my_join_check']);
}
if($submit) {
if($do->pass($post)) {
$post['gid'] = $gid;
$post['status'] = get_status(3, $GRP['join_type']);
$do->add($post);
$msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add'];
set_cookie('dmsg', $msg);
$forward = '?mid='.$mid.'&job='.$job.'&status='.$post['status'];
dalert('', '', 'window.onload=function(){parent.window.location="'.$forward.'";}');
} else {
dalert($do->errmsg);
}
} else {
$reason = '';
$status = 0;
}
break;
case 'edit':
$itemid or message();
$do->itemid = $itemid;
$item = $do->get_one();
if(!$item || $item['username'] != $_username) message();
$gid = $item['gid'];
$GRP = $db->get_one("SELECT * FROM {$table_group} WHERE itemid=$gid");
($GRP && $GRP['status'] == 3) or message($L['my_not_group']);
if($submit) {
if($do->pass($post)) {
$post['status'] = get_status($item['status'], $GRP['join_type']);
$do->edit($post);
set_cookie('dmsg', $L['success_edit']);
dalert('', '', 'parent.window.location="'.$forward.'"');
} else {
dalert($do->errmsg);
}
} else {
$reason = $item['reason'];
$status = $item['status'];
}
break;
case 'delete':
$itemid or message();
$do->itemid = $itemid;
$item = $do->get_one();
if(!$item || $item['username'] != $_username) message();
$do->delete($itemid);
dmsg($L['success_delete'], $forward);
break;
default:
$status = isset($status) ? intval($status) : 3;
in_array($status, array(1, 2, 3)) or $status = 3;
$lists = $do->get_list("username='$_username' AND status=$status");
break;
}
$nums = array();
for($i = 1; $i < 4; $i++) {
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_fans} 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 {
foreach($lists as $k=>$v) {
$lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']);
$lists[$k]['date'] = timetodate($v['addtime'], 5);
}
$pages = mobile_pages($items, $page, $pagesize);
$foot = '';
}
}
$head_title = $L['my_join_title'];
include template($MOD['template_my_join'] ? $MOD['template_my_join'] : 'my_club_join', 'member');
?>

291
module/club/my_manage.inc.php

@ -0,0 +1,291 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
login();
if($action) {
$gid = isset($gid) ? intval($gid) : 0;
$gid or message();
$GRP = get_group($gid);
($GRP && $GRP['status'] == 3) or message($L['my_not_group']);
if(!is_admin($GRP)) message($L['my_not_admin']);
$REASON = explode('|', trim($MOD['manage_reasons']));
if($MOD['manage_message'] == 2) $message = 1;
if($MOD['manage_reason']) {
$need_reason = 0;
if(in_array($action, array('edit', 'reply_edit'))) {
if($submit) $need_reason = 1;
} else if(in_array($action, array('delete', 'reply_delete', 'level', 'ontop', 'style'))){
$need_reason = 1;
}
if($need_reason && ($reason == $L['my_manage_reason'] || strlen($reason) < 4)) message($L['my_manage_input_reason']);
}
}
switch($action) {
case 'edit':
$itemid or message();
require DT_ROOT.'/module/'.$module.'/club.class.php';
$do = new club($moduleid);
$do->itemid = $itemid;
$T = $do->get_one();
if(!$T || $T['gid'] != $gid || $T['status'] != 3) message($L['my_not_post']);
if($submit) {
$_post = daddslashes($T);
$_post['addtime'] = timetodate($T['addtime']);
$_post['title'] = $post['title'];
$_post['thumb'] = $post['thumb'];
$_post['content'] = $post['content'];
$post = $_post;
if($do->pass($post)) {
$do->edit($post);
$tid = $itemid;
$title = $_post['title'];
$content = '';
if($reason == $L['my_manage_reason']) $reason = '';
$reason = dhtmlspecialchars($reason);
$message = isset($message) ? 1 : 0;
if($message) send_message($T['username'], lang($L['manage_msg_title'], array($L['my_manage_type_post'], dsubstr($T['title'], 20, '...'), $L['my_manage_type_edit'])), lang($L['manage_msg_content'], array(($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$T['linkurl'], nl2br($reason), $_username)));
$db->query("INSERT INTO {$table_manage} (gid,tid,username,addtime,typeid,title,content,reason,message) VALUES ('$gid','$itemid','$_username','$DT_TIME','2','$title','$content','$reason','$message')");
dmsg($L['post_success_edit'], $forward);
} else {
message($do->errmsg);
}
} else {
extract($T);
}
break;
case 'delete':
($itemid && is_array($itemid)) or message($L['my_choose_post']);
$content = '';
if($reason == $L['my_manage_reason']) $reason = '';
$reason = dhtmlspecialchars($reason);
$message = isset($message) ? 1 : 0;
require DT_ROOT.'/module/'.$module.'/club.class.php';
$do = new club($moduleid);
foreach($itemid as $tid) {
$do->itemid = $tid;
$T = $do->get_one();
if(!$T || $T['status'] != 3 || $T['gid'] != $gid) continue;
$do->recycle($tid);
if($message) send_message($T['username'], lang($L['manage_msg_title'], array($L['my_manage_type_post'], dsubstr($T['title'], 20, '...'), $L['my_manage_type_del'])), lang($L['manage_msg_content'], array(($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$T['linkurl'], nl2br($reason), $_username)));
$title = addslashes($T['title']);
$db->query("INSERT INTO {$table_manage} (gid,tid,username,addtime,typeid,title,content,reason,message) VALUES ('$gid','$tid','$_username','$DT_TIME','1','$title','$content','$reason','$message')");
}
dmsg($L['post_success_del'], $forward);
break;
case 'style':
($itemid && is_array($itemid)) or message($L['my_choose_post']);
$STYLE = array('red' => '#FF0000', 'blue' => '#0000FF', 'orange' => '#FF6600');
$_style = $style;
$style = isset($STYLE[$style]) ? $STYLE[$style] : '';
$content = $style;
if($reason == $L['my_manage_reason']) $reason = '';
$reason = dhtmlspecialchars($reason);
$message = isset($message) ? 1 : 0;
foreach($itemid as $tid) {
$T = $db->get_one("SELECT * FROM {$table} WHERE itemid=$tid");
if(!$T || $T['status'] != 3 || $T['gid'] != $gid || $T['style'] == $style) continue;
$db->query("UPDATE {$table} SET style='$style' WHERE itemid=$tid");
if($message) send_message($T['username'], lang($L['manage_msg_title'], array($L['my_manage_type_post'], dsubstr($T['title'], 20, '...'), $style ? $L['my_manage_type_style'] : $L['my_manage_type_style_cancel'])), lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username)));
$title = addslashes($T['title']);
$db->query("INSERT INTO {$table_manage} (gid,tid,username,addtime,typeid,title,content,reason,message) VALUES ('$gid','$tid','$_username','$DT_TIME','5','$title','$content','$reason','$message')");
if($MOD['show_html']) tohtml('show', $module, "itemid=$tid");
}
dmsg($style ? $L['post_success_style'] : $L['post_cancel_style'], $forward);
break;
case 'ontop':
($itemid && is_array($itemid)) or message($L['my_choose_post']);
$ontop = $ontop ? 1 : 0;
$content = $ontop;
if($reason == $L['my_manage_reason']) $reason = '';
$reason = dhtmlspecialchars($reason);
$message = isset($message) ? 1 : 0;
foreach($itemid as $tid) {
$T = $db->get_one("SELECT * FROM {$table} WHERE itemid=$tid");
if(!$T || $T['status'] != 3 || $T['gid'] != $gid || $T['ontop'] == $ontop || $T['ontop'] == 2) continue;
$db->query("UPDATE {$table} SET ontop=$ontop WHERE itemid=$tid");
if($message) send_message($T['username'], lang($L['manage_msg_title'], array($L['my_manage_type_post'], dsubstr($T['title'], 20, '...'), $ontop ? $L['my_manage_type_ontop'] : $L['my_manage_type_ontop_cancel'])), lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username)));
$title = addslashes($T['title']);
$db->query("INSERT INTO {$table_manage} (gid,tid,username,addtime,typeid,title,content,reason,message) VALUES ('$gid','$tid','$_username','$DT_TIME','4','$title','$content','$reason','$message')");
if($MOD['show_html']) tohtml('show', $module, "itemid=$tid");
}
dmsg($ontop ? $L['post_success_ontop'] : $L['post_cancel_ontop'], $forward);
break;
case 'level':
($itemid && is_array($itemid)) or message($L['my_choose_post']);
$level = isset($level) ? intval($level) : 0;
in_array($level, array(0, 1, 2, 3)) or message($L['my_manage_not_level']);
$content = $level;
if($reason == $L['my_manage_reason']) $reason = '';
$reason = dhtmlspecialchars($reason);
$message = isset($message) ? 1 : 0;
foreach($itemid as $tid) {
$T = $db->get_one("SELECT * FROM {$table} WHERE itemid=$tid");
if(!$T || $T['status'] != 3 || $T['gid'] != $gid || $T['level'] == $level) continue;
$db->query("UPDATE {$table} SET level=$level WHERE itemid=$tid");
if($message) send_message($T['username'], lang($L['manage_msg_title'], array($L['my_manage_type_post'], dsubstr($T['title'], 20, '...'), $level ? $L['my_manage_type_level'] : $L['my_manage_type_level_cancel'])), lang($L['manage_msg_content'], array($MOD['linkurl'].$T['linkurl'], nl2br($reason), $_username)));
$title = addslashes($T['title']);
$db->query("INSERT INTO {$table_manage} (gid,tid,username,addtime,typeid,title,content,reason,message) VALUES ('$gid','$tid','$_username','$DT_TIME','3','$title','$content','$reason','$message')");
if($MOD['show_html']) tohtml('show', $module, "itemid=$tid");
}
dmsg($level ? $L['post_success_level'] : $L['post_cancel_level'], $forward);
break;
case 'post':
require DT_ROOT.'/module/'.$module.'/club.class.php';
$do = new club($moduleid);
$sfields = $L['my_fields_post'];
$dfields = array('keyword', 'title', 'username');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$level = isset($level) ? intval($level) : 0;
$style = isset($style) ? intval($style) : 0;
$ontop = isset($ontop) ? intval($ontop) : 0;
$thumb = isset($thumb) ? intval($thumb) : 0;
$guest = isset($guest) ? intval($guest) : 0;
$fields_select = dselect($sfields, 'fields', '', $fields);
$condition = "gid=$gid AND status=3";
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
if($itemid) $condition .= " AND itemid=$itemid";
if($level) $condition .= " AND level>0";
if($style) $condition .= " AND style<>''";
if($ontop) $condition .= " AND ontop>0";
if($thumb) $condition .= " AND thumb<>''";
if($guest) $condition .= " AND username=''";
$lists = $do->get_list($condition);
break;
case 'reply':
require DT_ROOT.'/module/'.$module.'/reply.class.php';
$do = new reply($moduleid);
$sfields = $L['my_fields_reply'];
$dfields = array('content', 'username');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$tid = isset($tid) ? intval($tid) : 0;
$fields_select = dselect($sfields, 'fields', '', $fields);
$condition = "gid=$gid AND status=3";
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
if($tid) $condition .= " AND tid=$tid";
$lists = $do->get_list($condition, 'itemid ASC');
break;
case 'reply_edit':
$itemid or message();
require DT_ROOT.'/module/'.$module.'/reply.class.php';
$do = new reply($moduleid);
$do->itemid = $itemid;
$R = $do->get_one();
if(!$R || $R['gid'] != $gid || $R['status'] != 3) message($L['my_not_reply']);
if($submit) {
$_post = daddslashes($R);
$_post['content'] = $post['content'];
$post = $_post;
if($do->pass($post)) {
$do->edit($post);
$tid = $itemid;
$title = addslashes(get_intro(stripslashes($post['content']), 50));
$content = '';
if($reason == $L['my_manage_reason']) $reason = '';
$reason = dhtmlspecialchars($reason);
$message = isset($message) ? 1 : 0;
if($message) send_message($R['username'], lang($L['manage_msg_title'], array($L['my_manage_type_reply'], get_intro($R['content'], 20), $L['my_manage_type_edit'])), lang($L['manage_msg_content'], array(($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).'goto.php?itemid='.$R['itemid'], nl2br($reason), $_username)));
$db->query("INSERT INTO {$table_manage} (gid,rid,username,addtime,typeid,title,content,reason,message) VALUES ('$gid','$itemid','$_username','$DT_TIME','2','$title','$content','$reason','$message')");
dmsg($L['reply_success_edit'], $forward);
} else {
message($do->errmsg);
}
} else {
extract($R);
}
break;
case 'reply_delete':
($itemid && is_array($itemid)) or message($L['my_choose_reply']);
$content = '';
if($reason == $L['my_manage_reason']) $reason = '';
$reason = dhtmlspecialchars($reason);
$message = isset($message) ? 1 : 0;
require DT_ROOT.'/module/'.$module.'/reply.class.php';
$do = new reply($moduleid);
foreach($itemid as $rid) {
$do->itemid = $rid;
$R = $do->get_one();
if(!$R || $R['status'] != 3 || $R['gid'] != $gid) continue;
$do->recycle($rid);
if($message) send_message($R['username'], lang($L['manage_msg_title'], array($L['my_manage_type_reply'], get_intro($R['content'], 20), $L['my_manage_type_del'])), lang($L['manage_msg_content'], array($MOD['linkurl'].'goto.php?itemid='.$R['itemid'], nl2br($reason), $_username)));
$title = addslashes(get_intro($R['content'], 50));
$db->query("INSERT INTO {$table_manage} (gid,rid,username,addtime,typeid,title,content,reason,message) VALUES ('$gid','$rid','$_username','$DT_TIME','1','$title','$content','$reason','$message')");
}
dmsg($L['reply_success_del'], $forward);
break;
default:
require DT_ROOT.'/module/'.$module.'/manage.class.php';
$do = new manage();
$sfields = $L['my_fields_manage'];
$dfields = array('title', 'reason', 'content');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$typeid = isset($typeid) ? intval($typeid) : 0;
$message = isset($message) ? intval($message) : -1;
$fields_select = dselect($sfields, 'fields', '', $fields);
$condition = "username='$_username'";
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
if($typeid) $condition .= " AND typeid='$typeid'";
if($message > -1) $condition .= " AND message='$message'";
$lists = $do->get_list($condition);
$open_name = $open_url = '';
if(isset($gid)) {
$gid = intval($gid);
$pid = isset($pid) ? intval($pid) : 1;
$GRP = get_group($gid);
if($GRP && $GRP['status'] == 3) {
$open_name = '['.$GRP['title'].']'.$L['my_manage_post'];
$open_url = '?mid='.$mid.'&job='.$job.'&action=post&gid='.$gid.'&page='.$pid;
}
} else if(isset($tid)) {
$tid = intval($tid);
if($tid) {
$T = $db->get_one("SELECT * FROM {$table} WHERE itemid=$tid");
if($T && $T['status'] == 3) {
$gid = $T['gid'];
$GRP = get_group($gid);
if($GRP && $GRP['status'] == 3) {
$open_name ='['.$GRP['title'].']'.$L['my_manage_post'];
$open_url = '?mid='.$mid.'&job='.$job.'&action=post&gid='.$gid.'&itemid='.$tid;
}
}
}
} else if(isset($rid)) {
$rid = intval($rid);
if($rid) {
$T = $db->get_one("SELECT * FROM {$table_reply} WHERE itemid=$rid");
if($T && $T['status'] == 3) {
$gid = $T['gid'];
$tid = $T['tid'];
$GRP = get_group($gid);
if($GRP && $GRP['status'] == 3) {
$open_name = '['.$GRP['title'].']'.$L['my_manage_reply'];
$open_url = '?mid='.$mid.'&job='.$job.'&action=reply&gid='.$gid.'&tid='.$tid.'&itemid='.$rid.'&page='.$pid;
}
}
}
}
break;
}
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 {
foreach($lists as $k=>$v) {
$lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']);
$lists[$k]['date'] = timetodate($v['addtime'], 5);
}
$pages = mobile_pages($items, $page, $pagesize);
$foot = '';
}
}
$head_title = $L['my_manage_title'];
include template($MOD['template_my_manage'] ? $MOD['template_my_manage'] : 'my_club_manage', 'member');
?>

171
module/club/my_reply.inc.php

@ -0,0 +1,171 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
$reply_limit = intval($MOD['reply_limit_'.$_groupid]);
$reply_limit > -1 or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1');
require DT_ROOT.'/module/'.$module.'/reply.class.php';
$do = new reply($moduleid);
$sql = $_userid ? "username='$_username'" : "ip='$DT_IP'";
$limit_used = $limit_free = $need_password = $need_captcha = $need_question = $fee_add = 0;
$today = $DT_TODAY - 86400;
if(in_array($action, array('', 'add')) && $reply_limit) {
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_reply} WHERE $sql AND status>1 AND addtime>$today");
$limit_used = $r['num'];
$limit_free = $reply_limit > $limit_used ? $reply_limit - $limit_used : 0;
}
switch($action) {
case 'add':
check_group($_groupid, $MOD['group_reply']) or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1');
$tid = isset($tid) ? intval($tid) : 0;
$tid or dalert($L['my_choose_post'], $DT_PC ? $MOD['linkurl'] : $MOD['mobile']);
$T = $db->get_one("SELECT * FROM {$table} WHERE itemid=$tid");
($T && $T['status'] == 3) or dalert($L['my_not_post'], 'goback');
$gid = $T['gid'];
$GRP = get_group($gid);
($GRP && $GRP['status'] == 3) or dalert($L['my_not_group'], 'goback');
if($reply_limit && $limit_used >= $reply_limit) dalert(lang($L['day_limit'], array($reply_limit, $limit_used)), $MODULE[2]['linkurl'].$DT['file_my'].'?mid='.$mid.'&job='.$job);
$is_fans = is_fans($GRP);
$ban = is_array($is_fans) ? $is_fans['ban'] : 0;
if($ban) dalert($L['my_baned'], 'goback');
if($GRP['reply_type'] && !$is_fans) {
$action = 'reply';
$head_title = lang('message->without_permission');
exit(include template('nofans', $module));
}
$rid = isset($rid) ? intval($rid) : 0;
$R = array();
if($rid) {
$R = $db->get_one("SELECT * FROM {$table_reply} WHERE itemid=$rid");
($R && $R['status'] == 3 && $R['tid'] == $tid) or dalert($L['my_not_reply']);
$str = $R['content'];
if(strpos($str, '<hr class="club_break" />') !== false) {
$str = substr($str, strpos($str, '<hr class="club_break" />'));
} else if(strpos($str, '<hr class="club_break">') !== false) {
$str = substr($str, strpos($str, '<hr class="club_break">'));
} else if(strpos($str, '<hr class="club_break"/>') !== false) {
$str = substr($str, strpos($str, '<hr class="club_break"/>'));
}
$str = get_intro($str, 500);
$R['quote'] = '<div class="club_quote"><div><a href="'.$MOD['linkurl'].'goto.php?itemid='.$rid.'"><p>'.$R['passport'].$L['my_reply_at'].timetodate($R['addtime'], 5).'</p>'.$str.'</a></div></div><hr class="club_break" />';
}
$need_captcha = $MOD['captcha_reply'] == 2 ? $MG['captcha'] : $MOD['captcha_reply'];
$need_question = $MOD['question_reply'] == 2 ? $MG['question'] : $MOD['question_reply'];
if($submit) {
$msg = captcha($captcha, $need_captcha, true);
if($msg) dalert($msg);
$msg = question($answer, $need_question, true);
if($msg) dalert($msg);
if($do->pass($post)) {
$post['level'] = 0;
$post['tid'] = $tid;
$post['gid'] = $gid;
$post['rid'] = $rid;
if($R) $post['content'] = addslashes($R['quote']).$post['content'];
$need_check = $MOD['check_reply'] == 2 ? $MG['check'] : $MOD['check_reply'];
$post['status'] = get_status(3, $need_check);
$post['username'] = $_username;
$post['passport'] = $_passport;
$_DT_PC = $DT_PC;
$do->add($post);
$DT_PC = $_DT_PC;
$js = '';
if($post['status'] == 3) {
$forward = ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).'goto.php?itemid='.$do->itemid;
$msg = '';
} else {
if($_userid) {
set_cookie('dmsg', $msg);
$forward = '?mid='.$mid.'&job='.$job.'&status='.$post['status'];
$msg = '';
} else {
$forward = ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$T['linkurl'];
$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 {
foreach($do->fields as $v) {
if($v == 'tid' || $v == 'rid') continue;
$$v = '';
}
$content = '';
$item = array();
}
break;
case 'edit':
$itemid or message();
$do->itemid = $itemid;
$item = $do->get_one();
if(!$item || $item['username'] != $_username) message();
$tid = $item['tid'];
$T = $db->get_one("SELECT * FROM {$table} WHERE itemid=$tid");
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)) {
$need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add'];
$post['status'] = get_status($item['status'], $need_check);
$post['level'] = $item['level'];
$do->edit($post);
if($post['status'] < 3 && $item['status'] > 2) history($moduleid, 'reply-'.$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.'&job='.$job.'&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_reply} 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('content', $keyword);
$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_reply} 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 {
foreach($lists as $k=>$v) {
$lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']);
$lists[$k]['date'] = timetodate($v['addtime'], 5);
}
$pages = mobile_pages($items, $page, $pagesize);
$foot = '';
}
}
$head_title = $L['my_reply_title'];
include template($MOD['template_my_reply'] ? $MOD['template_my_reply'] : 'my_club_reply', 'member');
?>

216
module/club/reply.class.php

@ -0,0 +1,216 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
class reply {
var $moduleid;
var $itemid;
var $table;
var $fields;
var $errmsg = errmsg;
function __construct($moduleid) {
global $table_reply;
$this->moduleid = $moduleid;
$this->table = $table_reply;
$this->fields = array('gid','tid','rid','level','content','username','passport','addtime','editor','edittime','ip','status');
}
function reply($moduleid) {
$this->__construct($moduleid);
}
function pass($post) {
if(!is_array($post)) return false;
if(!$post['content']) return $this->_(lang('message->pass_club_reply'));
return true;
}
function set($post) {
global $_username, $_userid, $_cname;
$post['status'] = $post['status'] == 3 ? 3 : 2;
$post['editor'] = $_cname ? $_cname : $_username;
$post['edittime'] = DT_TIME;
if($this->itemid) {
$new = $post['content'];
$r = $this->get_one();
$old = $r['content'];
delete_diff($new, $old);
} else {
$post['addtime'] = DT_TIME;
}
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['content'] = dsafe($content);
$post['content'] = addslashes(save_remote(save_local(stripslashes($post['content']))));
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, $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 = 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);
if(strpos($r['content'], '<hr class="club_break" />') !== false) $r['content'] = substr($r['content'], strpos($r['content'], '<hr class="club_break" />'));
$r['title'] = get_intro($r['content'], 50);
$r['alt'] = get_intro($r['content'], 500);
$r['linkurl'] = $MOD['linkurl'].'goto.php?itemid='.$r['itemid'];
$lists[] = $r;
}
return $lists;
}
function add($post) {
global $MOD, $table, $_username, $_passport;
$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();
DB::query("UPDATE {$table} SET replyuser='$_username',replyer='$_passport',replytime=".DT_TIME."".($post['status'] == 3 ? ',reply=reply+1' : '')." WHERE itemid=$post[tid]");
if($post['rid']) DB::query("UPDATE {$this->table} SET reply=reply+1 WHERE itemid=$post[rid]");
if($post['status'] == 3 && $post['username'] && $MOD['credit_reply']) {
credit_add($post['username'], $MOD['credit_reply']);
credit_record($post['username'], $MOD['credit_reply'], 'system', lang('my->credit_record_reply_add'), 'ID:'.$this->itemid);
}
clear_upload($post['content'], $this->itemid, $this->table);
$this->tohtml($post['tid']);
return $this->itemid;
}
function edit($post) {
$post = $this->set($post);
$sql = '';
foreach($post as $k=>$v) {
$sql .= ",$k='$v'";
}
$sql = substr($sql, 1);
DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid");
clear_upload($post['content'], $this->itemid, $this->table);
if($post['status'] > 2) history($this->moduleid, 'reply-'.$this->itemid, 'del');
$this->tohtml($post['tid']);
return true;
}
function tohtml($itemid = 0) {
global $module, $MOD;
if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid");
}
function recycle($itemid) {
global $MOD;
if(is_array($itemid)) {
foreach($itemid as $v) { $this->recycle($v); }
} else {
DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid");
if($MOD['show_html']) {
$this->itemid = $itemid;
$item = $this->get_one();
$this->tohtml($item['tid']);
}
return true;
}
}
function restore($itemid) {
global $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']) {
$this->itemid = $itemid;
$item = $this->get_one();
$this->tohtml($item['tid']);
}
return true;
}
}
function delete($itemid) {
global $MOD;
if(is_array($itemid)) {
foreach($itemid as $v) {
$this->delete($v);
}
} else {
$this->itemid = $itemid;
$item = $this->get_one();
if($item) {
DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid");
if($item['content']) delete_local($item['content'], get_user($item['username']));
if($item['username'] && $MOD['credit_del_reply']) {
credit_add($item['username'], -$MOD['credit_del_reply']);
credit_record($item['username'], -$MOD['credit_del_reply'], 'system', lang('my->credit_record_reply_del'), 'ID:'.$itemid);
}
history($this->moduleid, 'reply-'.$this->itemid, 'del');
$this->tohtml($item['tid']);
}
}
}
function check($itemid, $status = 3) {
global $_username, $MOD;
if(is_array($itemid)) {
foreach($itemid as $v) {
$this->check($v, $status);
}
} else {
$this->itemid = $itemid;
$item = $this->get_one();
if($MOD['credit_reply'] && $status == 3) {
if($item['username'] && $item['addtime'] >= $item['edittime']) {
credit_add($item['username'], $MOD['credit_reply']);
credit_record($item['username'], $MOD['credit_reply'], 'system', lang('my->credit_record_reply_add'), 'ID:'.$itemid);
}
}
DB::query("UPDATE {$this->table} SET status=$status,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid");
history($this->moduleid, 'reply-'.$itemid, 'del');
$this->tohtml($item['tid']);
}
}
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;
}
}
?>

222
module/club/search.inc.php

@ -0,0 +1,222 @@
<?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);
}
$typeid = isset($typeid) ? intval($typeid) : 0;
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'];
(isset($username) && check_name($username)) or $username = '';
$thumb = isset($thumb) ? intval($thumb) : 0;
$level = isset($level) ? intval($level) : 0;
if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) {
$areaid = $cityid;
$ARE = get_area($areaid);
}
$areaid = isset($areaid) ? intval($areaid) : 0;
(isset($fromdate) && is_date($fromdate)) or $fromdate = '';
$fromtime = $fromdate ? datetotime($fromdate.' 0:0:0') : 0;
(isset($todate) && is_date($todate)) or $todate = '';
$totime = $todate ? datetotime($todate.' 23:59:59') : 0;
$category_select = ajax_category_select('catid', $L['all_category'], $catid, $moduleid);
$area_select = ajax_area_select('areaid', $L['all_area'], $areaid);
$tags = array();
$pagesize = $MOD['pagesize'];
$offset = ($page-1)*$pagesize;
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);
}
$replacef = explode(' ', $kw);
$replacet = array_map('highlight', $replacef);
}
if($action == 'group') {
$condition = 'status=3';
if($keyword) $condition .= match_kw('title', $keyword);
if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid";
$items = $db->count($table_group, $condition, $DT['cache_search']);
$pages = pages($items, $page, $pagesize);
if($items) {
$result = $db->query("SELECT * FROM {$table_group} WHERE {$condition} ORDER BY itemid DESC LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']);
while($r = $db->fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 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']);
$r['linkurl'] = $MOD['linkurl'].$r['linkurl'];
$r['introduce'] = dsubstr(dtrim($r['content']), 60, '...');
$r['managers'] = $r['manager'] ? explode('|', $r['manager']) : array();
$tags[] = $r;
}
$db->free_result($result);
}
} else if($action == 'reply') {
$condition = 'status=3';
if($keyword) $condition .= match_kw('content', $keyword);
if($username) $condition .= " AND passport='$username'";
if($fromtime) $condition .= " AND addtime>=$fromtime";
if($totime) $condition .= " AND addtime<=$totime";
$items = $db->count($table_reply, $condition, $DT['cache_search']);
$pages = pages($items, $page, $pagesize);
if($items) {
$result = $db->query("SELECT * FROM {$table_reply} WHERE {$condition} ORDER BY itemid DESC LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']);
while($r = $db->fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 5);
if(strpos($r['content'], '<hr class="club_break" />') !== false) $r['content'] = substr($r['content'], strpos($r['content'], '<hr class="club_break" />'));
$r['title'] = get_intro($r['content'], 90);
$r['alt'] = $r['title'];
if($kw) $r['title'] = str_replace($replacef, $replacet, $r['title']);
$r['linkurl'] = $MOD['linkurl'].'goto.php?itemid='.$r['itemid'];
$tags[] = $r;
}
$db->free_result($result);
}
} else {
$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);
}
}
}
}
$condition = 'status=3';
if($keyword) $condition .= match_kw('keyword', $keyword);
if($username) $condition .= " AND passport='$username'";
if($fromtime) $condition .= " AND edittime>=$fromtime";
if($totime) $condition .= " AND edittime<=$totime";
if($pptsql) $condition .= $pptsql;//PPT
require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php';
$do = new $module($moduleid);
$tags = $do->get_list($condition, $MOD['order'], $DT['cache_search'] ? 'CACHE' : '');
if($tags && $kw) {
foreach($tags as $k=>$v) {
$tags[$k]['title'] = str_replace($kw, '<span class="highlight">'.$kw.'</span>', $v['title']);
}
}
if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid);
$showpage = 1;
$datetype = 5;
}
}
$action or $action = 'post';
if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL);
} else {
$head_title = $MOD['name'].$DT['seo_delimiter'].$head_title;
(isset($username) && check_name($username)) or $username = '';
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) or $orderby = '';
$tags = array();
if($DT_QST) {
if($action == 'group') {
in_array($orderby, array('dpost', 'dreply', 'dfans')) or $orderby = '';
$condition = 'status=3';
if($keyword) $condition .= match_kw('title', $keyword);
if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid";
if($elite) $condition .= " AND level>0";
$items = $db->count($table_group, $condition, $DT['cache_search']);
$pages = pages($items, $page, $pagesize);
if($items) {
$order = 'itemid DESC';
if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC';
$result = $db->query("SELECT * FROM {$table_group} WHERE {$condition} ORDER BY $order LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']);
while($r = $db->fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 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($kw, '<span class="f_red">'.$kw.'</span>', $r['title']);
$r['linkurl'] = $MOD['mobile'].$r['linkurl'];
$r['introduce'] = dsubstr(dtrim($r['content']), 60, '...');
$r['managers'] = $r['manager'] ? explode('|', $r['manager']) : array();
$tags[] = $r;
}
$db->free_result($result);
}
} else if($action == 'reply') {
$condition = 'status=3';
if($keyword) $condition .= match_kw('content', $keyword);
if($username) $condition .= " AND passport='$username'";
if($elite) $condition .= " AND level>0";
$items = $db->count($table_reply, $condition, $DT['cache_search']);
$pages = pages($items, $page, $pagesize);
if($items) {
$result = $db->query("SELECT * FROM {$table_reply} WHERE {$condition} ORDER BY itemid DESC LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']);
while($r = $db->fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 5);
$r['title'] = get_intro($r['content'], 60);
$r['alt'] = $r['title'];
if($kw) $r['title'] = str_replace($kw, '<span class="f_red">'.$kw.'</span>', $r['title']);
$r['linkurl'] = $MOD['mobile'].'goto.php?itemid='.$r['itemid'];
$tags[] = $r;
}
$db->free_result($result);
}
} else {
$action = '';
in_array($orderby, array('dhits', 'dreply', 'dreplytime')) or $orderby = '';
$condition = "status=3";
if($keyword) $condition .= match_kw('keyword', $keyword);
if($catid) {
if($CAT) {
$condition .= $CAT['child'] ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid";
} else {
$condition .= " AND gid=$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']);
$r['linkurl'] = $MOD['mobile'].$r['linkurl'];
$r['date'] = timetodate($r[$time], 5);
$tags[] = $r;
}
$db->free_result($result);
}
if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid);
}
$js_load = preg_replace("/(.*)([&?]page=[0-9]*)(.*)/i", "\\1\\3", rewrite($DT_URL, 1)).'&job=ajax';
if($job == 'ajax') {
if($tags) include template('list-'.$module.($action ? '-'.$action : ''), '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);
?>

140
module/club/show.inc.php

@ -0,0 +1,140 @@
<?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 && $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');
$GRP = get_group($gid);
$GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array();
if($GRP['show_type'] && !is_fans($GRP)) {
$action = 'show';
$head_title = lang('message->without_permission');
exit(include template('nofans', $module));
}
$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, 3);
$editdate = timetodate($edittime, 3);
$linkurl = $MOD['linkurl'].$linkurl;
$admin = is_admin($GRP);
$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;
}
$F = explode('|', $MOD['floor']);
$replys = array();
$pages = '';
if($MOD['reply_pagesize']) {
$pagesize = $MOD['reply_pagesize'];
$offset = ($page-1)*$pagesize;
}
if($page == 1) {
$items = $db->count($table_reply, "tid=$itemid AND status=3");
if($items != $reply) $update .= ",reply='$items'";
if($GRP['areaid'] != $item['areaid']) $update .= ",areaid='$GRP[areaid]'";
} else {
$items = $reply;
}
if($items > 0) {
$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;
}
}
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']);
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']);
$GRP = get_group($gid);
$GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array();
if($GRP['show_type'] && !is_fans($GRP)) {
$action = 'show';
$head_title = lang('message->without_permission');
exit(include template('nofans', $module));
}
$member = array();
$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'];
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);
}
$editdate = timetodate($edittime, 5);
$F = explode('|', $MOD['floor']);
$replys = array();
$pages = '';
if($MOD['reply_pagesize']) {
$pagesize = $MOD['reply_pagesize'];
$offset = ($page-1)*$pagesize;
}
if($page == 1) {
$items = $db->count($table_reply, "tid=$itemid AND status=3");
if($items != $reply) $update .= ",reply='$items'";
if($GRP['areaid'] != $item['areaid']) $update .= ",areaid='$GRP[areaid]'";
} else {
$items = $reply;
}
if($items > 0) {
$floor = $page == 1 ? 0 : ($page-1)*$pagesize;
$pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].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;
}
}
$update = '';
$head_title = $head_name = $GRP['title'].$MOD['seo_name'];
$js_item = 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);
?>

95
module/club/task.inc.php

@ -0,0 +1,95 @@
<?php
defined('IN_DESTOON') or exit('Access Denied');
if($html == 'show') {
$itemid or exit;
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid");
if(!$item || $item['status'] < 3) exit;
require DT_ROOT.'/include/content.class.php';
extract($item);
$fee = DC::fee($item['fee'], $MOD['fee_view']);
$currency = $MOD['fee_currency'];
$fee_unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];
$fee_name = $currency == 'money' ? $DT['money_name'] : $DT['credit_name'];
$inner = false;
if(check_group($_groupid, $MOD['group_show'])) {
if($fee) {
$inner = true;
if($MG['fee_mode'] && $MOD['fee_mode']) {
$user_status = 3;
} else {
$mid = $moduleid;
if($_userid) {
$user_status = check_pay($mid, $itemid) ? 3 : 2;
} else {
$user_status = 0;
}
}
} else {
$user_status = 3;
}
} else {
$inner = true;
$user_status = $_userid ? 1 : 0;
}
if($_username && $_username == $item['username']) $user_status = 3;
if($inner) {
if($user_status == 3 || $user_status == 2) {
$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data);
$content = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid");
$content = $content['content'];
if($content) {
if($user_status == 2) $description = DC::description($content, $MOD['pre_view']);
if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC);
$content = DC::format($content, $DT_PC);
}
}
$content = strip_nr(ob_template('content', 'chip'), true);
echo 'Inner("content", \''.$content.'\');';
}
if($_userid && is_admin(get_group($gid))) echo '$(".manage").show();';
$update = '';
if($GRP['areaid'] != $item['areaid']) $update .= ",areaid='$GRP[areaid]'";
if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php';
if($page == 1) if($MOD['hits']) echo 'Inner("hits", \''.$item['hits'].'\');';
if($MOD['show_html'] && $task_item && $DT_TIME - @filemtime(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl']) > $task_item) tohtml('show', $module);
} else if($html == 'list') {
$catid or exit;
if($MOD['list_html'] && $task_list) {
if($CAT) {
$num = 1;
$totalpage = max(ceil($CAT['item']/$MOD['pagesize']), 1);
$demo = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, '{DEMO}');
$fid = $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
$fid = $page + 1;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
$fid = $totalpage + 1 - $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('list', $module);
} else {
$itemid = $gid = $catid;
$GRP = get_group($gid);
if($GRP) {
$num = 1;
$totalpage = max(ceil($GRP['post']/$MOD['pagesize']), 1);
$demo = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl(array('catid' => $GRP['itemid'], 'catdir' => $GRP['filepath'], 'catname' => $GRP['title']), '{DEMO}');
$fid = $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('group', $module);
$fid = $page + 1;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('group', $module);
$fid = $totalpage + 1 - $page;
if($fid >= 1 && $fid <= $totalpage && $DT_TIME - @filemtime(str_replace('{DEMO}', $fid, $demo)) > $task_list) tohtml('group', $module);
if($_userid && is_admin($GRP)) echo '$(".manage").show();';
}
}
}
} else if($html == 'index') {
if($DT['cache_hits'] && $MOD['hits']) {
$file = DT_CACHE.'/hits-'.$moduleid;
if($DT_TIME - @filemtime($file.'.dat') > $DT['cache_hits'] || @filesize($file.'.php') > 102400) update_hits($moduleid, $table);
}
if($MOD['index_html']) {
$file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$DT['index'].'.'.$DT['file_ext'];
if($DT_TIME - @filemtime($file) > $task_index) tohtml('index', $module);
}
}
?>

24
module/company/admin/config.inc.php

@ -0,0 +1,24 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
$MCFG['module'] = 'company';
$MCFG['name'] = '公司';
$MCFG['author'] = 'DESTOON';
$MCFG['homepage'] = 'www.destoon.com';
$MCFG['copy'] = false;
$MCFG['uninstall'] = false;
$RT = array();
$RT['file']['index'] = '公司列表';
$RT['file']['html'] = '更新网页';
$RT['action']['index']['add'] = '开通'.VIP;
$RT['action']['index']['edit'] = '修改'.VIP;
$RT['action']['index']['renew'] = '续费'.VIP;
$RT['action']['index']['delete'] = '撤销'.VIP;
$RT['action']['index']['vip'] = VIP.'列表';
$RT['action']['index']['record'] = VIP.'记录';
$RT['action']['index']['move'] = '移动地区';
$RT['action']['index']['update'] = '更新指数';
$CT = false;
?>

1
module/company/admin/index.html

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;url=../">

331
module/company/admin/index.inc.php

@ -0,0 +1,331 @@
<?php
defined('DT_ADMIN') or exit('Access Denied');
require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php';
$do = new $module();
$menus = array (
array('开通'.VIP, '?moduleid='.$moduleid.'&action=add'),
array(VIP.'列表', '?moduleid='.$moduleid.'&action=vip'),
array(VIP.'记录', '?moduleid='.$moduleid.'&action=record'),
array($MOD['name'].'列表', '?moduleid='.$moduleid),
array('移动地区', '?moduleid='.$moduleid.'&action=move'),
);
if($_catids || $_areaids) {
if(isset($userid)) $itemid = $userid;
if(isset($member['areaid'])) $post['areaid'] = $member['areaid'];
require DT_ROOT.'/admin/admin_check.inc.php';
}
$GROUP = cache_read('group.php');
switch($action) {
case 'add':
if($submit) {
$post['username'] = trim($post['username']);
if(!$post['username']) msg('会员名不能为空');
$amount = dround($amount);
$pay = $pay ? 1 : 0;
if($amount < 0) msg('应付金额不能小于0');
$post['fromtime'] = timetodate($DT_TIME, 3);
$groupid = $post['groupid'];
$fromtime = datetotime($post['fromtime'].' 00:00:00');
$totime = datetotime($post['totime'].' 23:59:59');
$reason = '开通';
$note = htmlspecialchars(trim($note));
if($amount && $pay) $note = $note.'站内扣款';
$usernames = explode("\n", trim($post['username']));
foreach($usernames as $username) {
$username = trim($username);
if(!check_name($username)) continue;
$user = $do->get_one($username);
if(!$user || $user['vip']) continue;
if($amount && $pay && $user['money'] < $amount) msg('会员'.$username.'余额不足');
$post['username'] = $user['username'];
$post['validated'] = $user['validated'];
$post['validator'] = $user['validator'];
$post['validtime'] = $user['validtime'] ? timetodate($user['validtime'], 3) : 0;
$do->vip_edit($post, $user);
if($amount && $pay) {
money_add($username, -$amount);
money_record($username, -$amount, '站内', $_username, VIP.'升级', $GROUP[$post['groupid']]['groupname']);
}
$gid = $user['groupid'];
$company = addslashes($user['company']);
$db->query("INSERT INTO {$DT_PRE}company_vip (username,company,amount,gid,groupid,fromtime,totime,addtime,reason,note,editor) VALUES ('$username','$company','$amount','$gid','$groupid','$fromtime','$totime','$DT_TIME', '$reason','$note','$_username')");
}
dmsg('开通成功', '?moduleid='.$moduleid.'&action=vip');
} else {
isset($username) or $username = '';
if(isset($userid)) {
if($userid) {
$userids = is_array($userid) ? implode(',', $userid) : $userid;
$result = $db->query("SELECT username FROM {$DT_PRE}member WHERE userid IN ($userids)");
while($r = $db->fetch_array($result)) {
$username .= $r['username']."\n";
}
}
}
$fromdate = timetodate($DT_TIME, 3);
$todate = timetodate($DT_TIME+365*86400, 3);
include tpl('vip_add', $module);
}
break;
case 'edit':
$userid or msg();
$do->userid = $userid;
$user = $do->get_one();
if($submit) {
$post['username'] = $user['username'];
$post['fromtime'] = timetodate($user['fromtime'], 3);
$post['totime'] = timetodate($user['totime'], 3);
if($do->vip_edit($post, $user)) {
dmsg('修改成功', $forward);
} else {
msg($do->errmsg);
}
} else {
extract($user);
$validtime = $validtime ? timetodate($validtime, 3) : '';
include tpl('vip_edit', $module);
}
break;
case 'renew':
$userid or msg();
$do->userid = $userid;
$user = $do->get_one();
$FM_TIME = $user['totime'] > $DT_TIME ? $user['totime'] : $DT_TIME;
if($submit) {
$amount = dround($amount);
$pay = $pay ? 1 : 0;
if($amount < 0) msg('应付金额不能小于0');
$username = $user['username'];
$groupid = $post['groupid'];
$fromtime = datetotime(timetodate($FM_TIME, 3).' 00:00:00');
$totime = datetotime($post['totime'].' 23:59:59');
$reason = '续费';
$note = htmlspecialchars(trim($note));
if($amount && $pay) $note = $note.'站内扣款';
if($amount && $pay && $user['money'] < $amount) msg('会员'.$username.'余额不足');
$post['username'] = $user['username'];
$post['validated'] = $user['validated'];
$post['validator'] = $user['validator'];
$post['validtime'] = $user['validtime'] ? timetodate($user['validtime'], 3) : 0;
$post['fromtime'] = timetodate($user['fromtime'], 3);
if($do->vip_edit($post, $user)) {
if($amount && $pay) {
money_add($username, -$amount);
money_record($username, -$amount, '站内', $_username, VIP.'续费', $GROUP[$post['groupid']]['groupname']);
}
$gid = $user['groupid'];
$company = addslashes($user['company']);
$db->query("INSERT INTO {$DT_PRE}company_vip (username,company,amount,gid,groupid,fromtime,totime,addtime,reason,note,editor) VALUES ('$username','$company','$amount','$gid','$groupid','$fromtime','$totime','$DT_TIME', '$reason','$note','$_username')");
dmsg('续费成功', $forward);
} else {
msg($do->errmsg);
}
} else {
extract($user);
$fromdate = timetodate($FM_TIME, 3);
$todate = timetodate($FM_TIME+365*86400, 3);
include tpl('vip_renew', $module);
}
break;
case 'delete':
$userid or msg('请选择公司');
$do->vip_delete($userid);
dmsg('撤销成功', $forward);
break;
case 'update':
is_array($userid) or msg('请选择'.$MOD['name']);
foreach($userid as $v) {
$do->update($v);
}
dmsg('更新成功', $forward);
break;
case 'move':
if($submit) {
$fromids or msg('请填写来源ID');
if($toareaid) {
$db->query("UPDATE {$table} SET areaid=$toareaid WHERE `{$fromtype}` IN ($fromids)");
$db->query("UPDATE {$DT_PRE}member SET areaid=$toareaid WHERE `{$fromtype}` IN ($fromids)");
}
dmsg('移动成功', $forward);
} else {
$userid = isset($userid) ? implode(',', $userid) : '';
$menuid = 4;
include tpl($action, $module);
}
break;
case 'level':
$userid or msg('请选择'.$MOD['name']);
$level = intval($level);
$do->level($userid, $level);
dmsg('级别设置成功', $forward);
break;
case 'record':
$sfields = array('按条件', '公司名', '会员名', '操作事由', '备注信息', '操作人');
$dfields = array('company', 'company', 'username', 'reason', 'note', 'editor');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$sorder = array('排序方式', '发生时间降序', '发生时间升序', '开始时间降序', '开始时间升序', '到期时间降序', '到期时间升序', '支付费用降序', '支付费用升序', '原会员组ID降序', '原会员组ID升序', '新会员组ID降序', '新会员组ID升序');
$dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC', 'amount DESC', 'amount ASC', 'gid DESC', 'gid ASC', 'groupid DESC', 'groupid ASC');
isset($order) && isset($dorder[$order]) or $order = 0;
isset($datetype) && in_array($datetype, array('addtime', 'fromtime', 'totime')) 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;
(isset($username) && check_name($username)) or $username = '';
(isset($editor) && check_name($editor)) or $editor = '';
$gid = isset($gid) ? intval($gid) : 0;
$groupid = isset($groupid) ? intval($groupid) : 0;
$minamount = isset($minamount) ? dround($minamount) : '';
$minamount or $minamount = '';
$maxamount = isset($maxamount) ? dround($maxamount) : '';
$maxamount or $maxamount = '';
$fields_select = dselect($sfields, 'fields', '', $fields);
$order_select = dselect($sorder, 'order', '', $order);
$fgroup_select = group_select('gid', '原会员组', $gid);
$tgroup_select = group_select('groupid', '新会员组', $groupid);
$condition = "1";
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
if($fromtime) $condition .= " AND `$datetype`>=$fromtime";
if($totime) $condition .= " AND `$datetype`<=$totime";
if($minamount) $condition .= " AND amount>=$minamount";
if($maxamount) $condition .= " AND amount<=$maxamount";
if($gid) $condition .= " AND gid=$gid";
if($groupid) $condition .= " AND groupid=$groupid";
if($editor) $condition .= " AND editor='$editor'";
if($username) $condition .= " AND username='$username'";
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}company_vip WHERE $condition");
$items = $r['num'];
$pages = pages($items, $page, $pagesize);
$lists = array();
$result = $db->query("SELECT * FROM {$DT_PRE}company_vip WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize");
$income = $expense = 0;
while($r = $db->fetch_array($result)) {
$r['addtime'] = timetodate($r['addtime'], 6);
$r['fromdate'] = timetodate($r['fromtime'], 3);
$r['todate'] = timetodate($r['totime'], 3);
$r['linkurl'] = userurl($r['username']);
$lists[] = $r;
}
$menuid = 2;
include tpl('vip_record', $module);
break;
case 'vip':
$sfields = array('按条件', '公司名', '会员名');
$dfields = array('keyword', 'company', 'username');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$sorder = array('结果排序方式', '开通时间降序', '开通时间升序', '到期时间降序', '到期时间升序', VIP.'指数降序', VIP.'指数升序', '理论值降序', '理论值升序', '修正值降序', '修正值升序', '会员组ID降序', '会员组ID升序', '会员ID降序', '会员ID升序');
$dorder = array('fromtime DESC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC', 'vip DESC', 'vip ASC', 'vipt DESC', 'vipt ASC', 'vipr DESC', 'vipr ASC', 'groupid DESC', 'groupid ASC', 'userid DESC', 'userid ASC');
isset($order) && isset($dorder[$order]) or $order = 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;
isset($datetype) && in_array($datetype, array('fromtime', 'totime')) or $datetype = 'fromtime';
$vipt = isset($vipt) ? intval($vipt) : 0;
$vipt or $vipt = '';
$vipr = isset($vipr) ? intval($vipr) : 0;
$vipr or $vipr = '';
$vip = isset($vip) ? intval($vip) : 0;
$groupid = isset($groupid) ? intval($groupid) : 0;
$fields_select = dselect($sfields, 'fields', '', $fields);
$order_select = dselect($sorder, 'order', '', $order);
$group_select = group_select('groupid', '会员组', $groupid);
$condition = $vip ? "vip=$vip" : "vip>0";
if($_areaids) $condition .= " AND areaid IN (".$_areaids.")";//CITY
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
if($groupid) $condition .= " AND groupid=$groupid";
if($fromtime) $condition .= " AND $datetype>=$fromtime";
if($totime) $condition .= " AND $datetype<=$totime";
if($vipt != '') $condition .= " AND vipt=".intval($vipt);
if($vipr != '') $condition .= " AND vipr=".intval($vipr);
$companys = $do->get_list($condition, $dorder[$order]);
include tpl('vip', $module);
break;
default:
$sfields = array('按条件', '公司名', '会员名', '公司类型', '公司规模', '销售', '采购', '主营行业', '经营模式', '电话', '传真', 'Email', '地址', '邮编', '主页', '绑定域名', '备案号');
$dfields = array('keyword', 'company', 'username', 'type', 'size', 'sell', 'buy', 'business', 'mode', 'telephone', 'fax', 'mail', 'address', 'postcode', 'homepage', 'domain', 'icp');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$sorder = array('结果排序方式', '服务开始降序', '服务开始升序', '服务结束降序', '服务结束升序', '推荐级别降序', '推荐级别升序', '浏览人气降序','浏览人气升序', '点赞次数降序', '点赞次数升序', '反对次数降序', '反对次数升序', '收藏次数降序', '收藏次数升序', '打赏次数降序', '打赏次数升序', '打赏金额降序', '打赏金额升序', '分享次数降序', '分享次数升序', '举报次数降序', '举报次数升序', '评论数量降序', '评论数量升序', VIP.'指数降序', VIP.'指数升序', '注册年份降序', '注册年份升序', '注册资本降序', '注册资本升序', '会员组ID降序', '会员组ID升序', '会员ID降序', '会员ID升序');
$dorder = array('userid DESC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC', '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', 'regyear DESC', 'regyear ASC', 'capital DESC', 'capital ASC', 'groupid DESC', 'groupid ASC', 'userid DESC', 'userid ASC');
isset($order) && isset($dorder[$order]) or $order = 0;
$svalid = array('认证', '已通过' , '未通过');
$MS = cache_read('module-2.php');
$modes = explode('|', '经营模式|'.$MS['com_mode']);
$types = explode('|', '公司类型|'.$MS['com_type']);
$sizes = explode('|', '公司规模|'.$MS['com_size']);
$thumb = isset($thumb) ? intval($thumb) : 0;
$domain = isset($domain) ? intval($domain) : 0;
$mincapital = isset($mincapital) ? dround($mincapital) : '';
$mincapital or $mincapital = '';
$maxcapital = isset($maxcapital) ? dround($maxcapital) : '';
$maxcapital or $maxcapital = '';
$minregyear = isset($minregyear) ? intval($minregyear) : '';
$minregyear or $minregyear = '';
$maxregyear = isset($maxregyear) ? intval($maxregyear) : '';
$maxregyear or $maxregyear = '';
$areaid = isset($areaid) ? intval($areaid) : 0;
isset($mode) && isset($modes[$mode]) or $mode = 0;
isset($type) && isset($types[$type]) or $type = 0;
isset($size) && isset($sizes[$size]) or $size = 0;
$vip = isset($vip) ? ($vip === '' ? -1 : intval($vip)) : -1;
$groupid = isset($groupid) ? intval($groupid) : 0;
$valid = isset($valid) ? intval($valid) : 0;
$level = isset($level) ? intval($level) : 0;
$uid = isset($uid) ? intval($uid) : '';
$uid or $uid = '';
(isset($username) && check_name($username)) or $username = '';
(isset($fromdate) && is_time($fromdate)) or $fromdate = '';
$fromtime = $fromdate ? datetotime($fromdate) : 0;
(isset($todate) && is_time($todate)) or $todate = '';
$totime = $todate ? datetotime($todate) : 0;
isset($datetype) && in_array($datetype, array('totime', 'fromtime', 'styletime', 'validtime')) or $datetype = 'totime';
$fields_select = dselect($sfields, 'fields', '', $fields);
$level_select = level_select('level', '级别', $level, 'all');
$order_select = dselect($sorder, 'order', '', $order);
$valid_select = dselect($svalid, 'valid', '', $valid);
$group_select = group_select('groupid', '会员组', $groupid);
$mode_select = dselect($modes, 'mode', '', $mode);
$type_select = dselect($types, 'type', '', $type);
$size_select = dselect($sizes, 'size', '', $size);
$condition = 'groupid>5';
if($action == 'domain') $condition .= " AND domain<>''";
if($_areaids) $condition .= " AND areaid IN (".$_areaids.")";//CITY
if($keyword) $condition .= match_kw($dfields[$fields], $keyword);
if($groupid) $condition .= " AND groupid=$groupid";
if($vip > -1) $condition .= " AND vip=$vip";
if($level) $condition .= $level > 9 ? " AND level>0" : " AND level=$level";
if($valid) $condition .= $valid == 1 ? " AND validated=1" : " AND validated=0";
if($catid) $condition .= " AND catids LIKE '%,".$catid.",%'";
if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid";
if($mode) $condition .= match_kw('mode', $modes[$mode]);
if($type) $condition .= " AND type='$types[$type]'";
if($size) $condition .= " AND size='$sizes[$size]'";
if($mincapital) $condition .= " AND capital>=$mincapital";
if($maxcapital) $condition .= " AND capital<=$maxcapital";
if($minregyear) $condition .= " AND regyear>=$minregyear";
if($maxregyear) $condition .= " AND regyear<=$maxregyear";
if($thumb) $condition .= " AND thumb<>''";
if($domain) $condition .= " AND domain<>''";
if($uid) $condition .= " AND userid=$uid";
if($username) $condition .= " AND username='$username'";
if($fromtime) $condition .= " AND $datetype>=$fromtime";
if($totime) $condition .= " AND $datetype<=$totime";
$lists = $do->get_list($condition, $dorder[$order]);
$menuid = 3;
include tpl('index', $module);
break;
}
?>

76
module/company/admin/template/html.tpl.php

@ -0,0 +1,76 @@
<?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">&nbsp;
<input type="submit" value="一键更新" class="btn-g" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=all';" title="生成该模块所有网页"/>&nbsp;&nbsp;
<input type="submit" value="生成首页" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=index';" title="生成该模块首页"/>&nbsp;&nbsp;
<input type="submit" value="生成列表" class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=list';" title="生成该模块所有列表"/>&nbsp;&nbsp;
<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="1000"/></td>
<td>
<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);?>
&nbsp;&nbsp;&nbsp;&nbsp;
<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';"/>
</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="1000"/></td>
<td>
<input type="submit" value=" 更新昵称 " class="btn" onclick="this.form.action='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=passport';"/>
</td>
</tr>
</table>
</form>
<script type="text/javascript">Menuon(0);</script>
<?php include tpl('footer');?>

77
module/company/admin/template/vip_add.tpl.php

@ -0,0 +1,77 @@
<?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" id="price" value="<?php echo $GROUP[7]['fee'];?>"/>
<table cellspacing="0" class="tb">
<tr>
<td class="tl"><span class="f_red">*</span> 会员名</td>
<td><textarea name="post[username]" id="username" style="width:200px;height:100px;overflow:visible;"><?php echo $username;?></textarea><?php tips('允许批量添加,一行一个,点回车换行');?><br/><span id="dusername" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 会员组</td>
<td id="groupid">
<?php foreach($GROUP as $g) {
if($g['vip'] > 0) echo '<input type="radio" name="post[groupid]" value="'.$g['groupid'].'"'.($g['groupid'] == 7 ? 'checked' : '').' onclick="Dd(\'amount\').value=\''.$g['fee'].'\';Dd(\'price\').value=\''.$g['fee'].'\';"/> '.$g['groupname'].'&nbsp;&nbsp;';
}
?>
</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 开通时间</td>
<td><input type="text" value="<?php echo $fromdate;?>" disabled style="width:100px;"/></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 到期时间</td>
<td>
<?php echo dcalendar('post[totime]', $todate);?>&nbsp;
<select onchange="if(this.value){Dd('posttotime').value=this.value;Dd('amount').value=this.selectedIndex*Dd('price').value;}">
<option value="">快捷选择</option>
<option value="<?php echo timetodate($DT_TIME+86400*365*1, 3);?>" selected>一年</option>
<option value="<?php echo timetodate($DT_TIME+86400*365*2, 3);?>">两年</option>
<option value="<?php echo timetodate($DT_TIME+86400*365*3, 3);?>">三年</option>
<option value="<?php echo timetodate($DT_TIME+86400*365*4, 3);?>">四年</option>
<option value="<?php echo timetodate($DT_TIME+86400*365*5, 3);?>">五年</option>
</select>&nbsp;<span id="dtime" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 应付金额</td>
<td><input type="text" name="amount" size="10" id="amount" value="<?php echo $GROUP[7]['fee'];?>"/> <?php echo $DT['money_unit'];?> <span id="damount" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 余额扣除</td>
<td>
<input type="radio" name="pay" value="1" checked/> &nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="pay" value="0"/> <?php tips('从会员账户余额里扣除相关费用,请选是<br/>如果已经通过其他方式收款,请选否');?>
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 备注信息</td>
<td><input type="text" name="note" size="60" value=""/></td>
</tr>
</table>
<div class="sbt"><input type="submit" name="submit" value="开 通" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="取 消" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&action=vip');"/></div>
</form>
<script type="text/javascript">
function check() {
var l;
var f;
f = 'username';
if(Dd(f).value == '') {
Dmsg('请填写会员名', f);
return false;
}
if(Dd('posttotime').value.length != 10) {
Dmsg('请选择服务有效期', 'time', 1);
return false;
}
return true;
}
</script>
<script type="text/javascript">Menuon(0);</script>
<?php include tpl('footer');?>

56
module/company/admin/template/vip_edit.tpl.php

@ -0,0 +1,56 @@
<?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="userid" value="<?php echo $userid;?>"/>
<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><a href="javascript:_user('<?php echo $username;?>');" class="t"><?php echo $username;?></a></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 会员组</td>
<td>
<?php foreach($GROUP as $g) {
if($g['vip'] > 0) echo '<input type="radio" name="post[groupid]" value="'.$g['groupid'].'" '.($groupid == $g['groupid'] ? 'checked' : '').'/> '.$g['groupname'].'&nbsp;';
}
?>
</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 第三方认证</td>
<td>
<input type="radio" name="post[validated]" value="1" <?php if($validated) echo 'checked';?>/> 是&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="post[validated]" value="0" <?php if(!$validated) echo 'checked';?>/> 否
</td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 认证名称或机构</td>
<td><input type="text" name="post[validator]" size="30" value="<?php echo $validator;?>"/></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> 认证日期</td>
<td><?php echo dcalendar('post[validtime]', $validtime);?></td>
</tr>
<tr>
<td class="tl"><span class="f_hid">*</span> <?php echo VIP;?>指数修正值</td>
<td><input type="text" name="post[vipr]" size="2" value="<?php echo $vipr;?>"/></td>
</tr>
</table>
<div class="sbt"><input type="submit" name="submit" value="修 改" class="btn-g"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="取 消" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&action=vip');"/></div>
</form>
<script type="text/javascript">
function check() {
var l;
var f;
return true;
}
</script>
<script type="text/javascript">Menuon(1);</script>
<?php include tpl('footer');?>

69
module/company/admin/template/vip_record.tpl.php

@ -0,0 +1,69 @@
<?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>&nbsp;
<?php echo $fields_select;?>&nbsp;
<input type="text" size="30" name="kw" value="<?php echo $kw;?>" placeholder="请输入关键词" title="请输入关键词"/>&nbsp;
<?php echo $fgroup_select;?>&nbsp;
<?php echo $tgroup_select;?>&nbsp;
<?php echo $order_select;?>&nbsp;
<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" placeholder="条/页" title="条/页"/>&nbsp;
<input type="submit" value="搜 索" class="btn"/>&nbsp;
<input type="button" value="重 置" class="btn" onclick="Go('?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>');"/>
</td>
</tr>
<tr>
<td>&nbsp;
<select name="datetype">
<option value="addtime"<?php if($datetype == 'addtime') echo ' selected';?>>发生时间</option>
<option value="fromtime"<?php if($datetype == 'fromtime') echo ' selected';?>>开始时间</option>
<option value="totime"<?php if($datetype == 'totime') echo ' selected';?>>到期时间</option>
</select>&nbsp;
<?php echo dcalendar('fromdate', $fromdate, '-', 1);?> 至 <?php echo dcalendar('todate', $todate, '-', 1);?>&nbsp;
费用 <input type="text" name="minamount" value="<?php echo $minamount;?>" size="10"/>
<input type="text" name="maxamount" value="<?php echo $maxamount;?>" size="10"/>&nbsp;
<input type="text" name="username" value="<?php echo $username;?>" size="10" placeholder="会员名" title="会员名 双击显示会员资料" ondblclick="if(this.value){_user(this.value);}"/>&nbsp;
</td>
</tr>
</table>
</form>
<table cellspacing="0" class="tb ls">
<tr>
<th width="160"><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><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>公司名称</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 == 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 == 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 data-hide-1200="1" width="130">事由</th>
<th data-hide-1200="1" width="130">备注</th>
</tr>
<?php foreach($lists as $k=>$v) {?>
<tr align="center">
<td><a href="javascript:;" onclick="Dq('datetype','addtime',0);Dq('date',this.innerHTML);"><?php echo $v['addtime'];?></a></td>
<td><a href="javascript:;" onclick="Dq('minamount','<?php echo $v['amount'];?>',0);Dq('maxamount','<?php echo $v['amount'];?>');"><?php echo $v['amount'];?></a></td>
<td align="left">&nbsp;<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('gid','<?php echo $v['gid'];?>');"><?php echo $GROUP[$v['gid']]['groupname'];?></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('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" title="<?php echo $v['reason'];?>"><input type="text" size="15" value="<?php echo $v['reason'];?>"/></td>
<td data-hide-1200="1" title="<?php echo $v['note'];?> <?php echo $v['editor'];?>"><input type="text" size="15" value="<?php echo $v['note'];?>"/></td>
</tr>
<?php }?>
</table>
<?php echo $pages ? '<div class="pages">'.$pages.'</div>' : '';?>
<br/>
<script type="text/javascript">Menuon(<?php echo $menuid;?>);</script>
<?php include tpl('footer');?>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save