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

', '


', '
', '

'), array('


', '

', '


', '
'), $post['content']); + } + if($post['content'] && !$post['introduce'] && $post['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $post['introduce_length'])); + if($this->itemid) { + $new = $post['content']; + if($post['thumb']) $new .= ''; + $r = $this->get_one(); + $old = $r['content']; + if($r['thumb']) $old .= ''; + delete_diff($new, $old); + } else { + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) { + credit_add($post['username'], $MOD['credit_add']); + credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'], $this->itemid); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.($item['tag'] ? str_replace(' ', ',', trim($item['tag'])).',' : '').strip_tags(cat_pos(get_cat($item['catid']), ',')); + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $item['itemid'] = $itemid; + $linkurl = itemurl($item); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html'] && !$r['islink']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + $i = 1; + while($i) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($r, $i); + if(is_file($_file)) { + html_del($_file); + $i++; + } else { + break; + } + } + } + if($all) { + $userid = get_user($r['username']); + if($r['thumb']) delete_upload($r['thumb'], $userid); + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + } + } + } + + function check($itemid) { + global $_username, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + $this->itemid = $itemid; + $item = $this->get_one(); + if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { + credit_add($item['username'], $MOD['credit_add']); + credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid"); + history($this->moduleid, $itemid, 'del'); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/article/list.htm.php b/module/article/list.htm.php new file mode 100644 index 0000000..68f5b8d --- /dev/null +++ b/module/article/list.htm.php @@ -0,0 +1,92 @@ +count($table, $condition); + if($items != $CAT['item']) { + $CAT['item'] = $items; + $db->query("UPDATE {$DT_PRE}category SET item=$items WHERE catid=$catid"); + } +} else { + $items = $CAT['item']; +} +$pagesize = $MOD['pagesize']; +$showpage = 1; +$datetype = 3; +$cols = 5; +$template = $CAT['template'] ? $CAT['template'] : ($MOD['template_list'] ? $MOD['template_list'] : 'list'); +$total = max(ceil($items/$MOD['pagesize']), 1); +if(isset($fid) && isset($num)) { + $page = $fid; + $topage = $fid + $num - 1; + $total = $topage < $total ? $topage : $total; +} +for(; $page <= $total; $page++) { + $offset = ($page-1)*$pagesize; + $pages = listpages($CAT, $items, $page, $pagesize); + $tags = array(); + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $tags[] = $r; + } + $seo_file = 'list'; + include DT_ROOT.'/include/seo.inc.php'; + $destoon_task = "moduleid=$moduleid&html=list&catid=$catid&page=$page"; + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ?listurl($CAT, $page) : $CAT['linkurl']); + $filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, $page); + $_tags = $tags; + $DT_PC = $GLOBALS['DT_PC'] = 1; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + if($CAT['parentid']) $PCAT = get_cat($CAT['parentid']); + $pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].listurl($CAT, '{destoon_page}')); + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $tags = array(); + foreach($_tags as $r) { + $r['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $r['linkurl']); + $tags[] = $r; + } + if($items) $js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid; + $head_title = $head_name = $CAT['catname']; + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put($filename, $data); + if($page == 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/article/search.inc.php b/module/article/search.inc.php new file mode 100644 index 0000000..2c2483c --- /dev/null +++ b/module/article/search.inc.php @@ -0,0 +1,153 @@ + $DT['max_kw']) message(lang($L['word_limit'], array($DT['min_kw'], $DT['max_kw'])), $MOD['linkurl'].'search.php'); + if($DT['search_limit'] && $page == 1) { + if(($DT_TIME - $DT['search_limit']) < get_cookie('last_search')) message(lang($L['time_limit'], array($DT['search_limit'])), $MOD['linkurl'].'search.php'); + set_cookie('last_search', $DT_TIME); + } + } + + $pptsql = ''; + if($CP) { + require DT_ROOT.'/include/property.func.php'; + $PPT = property_condition($catid); + foreach($PPT as $k=>$v) { + $PPT[$k]['select'] = ''; + $oid = $v['oid']; + $tmp = 'ppt_'.$oid; + if(isset($$tmp)) { + $PPT[$k]['select'] = $tmp = strip_kw($$tmp); + if($tmp && in_array($tmp, $v['options'])) { + $tmp = 'O'.$oid.':'.$tmp.';'; + $pptsql .= match_kw('pptword', $tmp); + } + } + } + } + $fds = $MOD['fields']; + $condition = ''; + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($dfields[$fields] == 'content') { + if($keyword && $MOD['fulltext'] == 1) $condition .= match_kw($dfields[$fields], $keyword); + $condition = str_replace('AND ', 'AND i.', $condition); + $condition = str_replace('i.content', 'd.content', $condition); + $condition = "i.status=3 AND i.itemid=d.itemid".$condition; + if($keyword && $MOD['fulltext'] == 2) $condition .= " AND MATCH(`content`) AGAINST('$kw'".(preg_match("/[+-<>()~*]/", $kw) ? ' IN BOOLEAN MODE' : '').")"; + $table = $table.' i,'.$table_data.' d'; + $fds = 'i.'.str_replace(',', ',i.', $fds); + } else { + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($pptsql) $condition .= $pptsql;//PPT + $condition = "status=3".$condition; + } + $pagesize = $MOD['pagesize']; + $offset = ($page-1)*$pagesize; + $items = $db->count($table, $condition, $DT['cache_search']); + $pages = pages($items, $page, $pagesize); + if($items) { + $order = $dorder[$order] ? " ORDER BY $dorder[$order]" : ''; + $result = $db->query("SELECT {$fds} FROM {$table} WHERE {$condition}{$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + if($kw) { + $replacef = explode(' ', $kw); + $replacet = array_map('highlight', $replacef); + } + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if($kw) $r['title'] = str_replace($replacef, $replacet, $r['title']); + if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $tags[] = $r; + } + $db->free_result($result); + } + } + if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); + $showpage = 1; + $datetype = 5; + $target = '_blank'; + $cols = 5; + $class = ''; + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + if($kw) { + check_group($_groupid, $MOD['group_search']) or message($L['msg_no_search']); + } else if($catid) { + $CAT or message($L['msg_not_cate']); + if(!check_group($_groupid, $MOD['group_list']) || !check_group($_groupid, $CAT['group_list'])) message($L['msg_no_right']); + } else { + check_group($_groupid, $MOD['group_index']) or message($L['msg_no_right']); + } + $head_title = $MOD['name'].$DT['seo_delimiter'].$head_title; + if($kw) $head_title = $kw.$DT['seo_delimiter'].$head_title; + if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) { + $areaid = $cityid; + $ARE = get_area($areaid); + } + $elite = isset($elite) ? intval($elite) : 0; + (isset($orderby) && in_array($orderby, array('dlikes', 'dhits', 'dcomments'))) or $orderby = ''; + $tags = array(); + if($DT_QST) { + $condition = "status=3"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= $CAT['child'] ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($elite) $condition .= " AND level>0"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize); + if($items) { + $order = $MOD['order']; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + if($kw) $r['title'] = str_replace($kw, ''.$kw.'', $r['title']); + if(!$r['islink']) $r['linkurl'] = $MOD['mobile'].$r['linkurl']; + $tags[] = $r; + } + $db->free_result($result); + $js_load = preg_replace("/(.*)([&?]page=[0-9]*)(.*)/i", "\\1\\3", rewrite($DT_URL, 1)).'&job=ajax'; + } + if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); + } + if($job == 'ajax') { + if($tags) include template('list-'.$module, 'tag'); + exit; + } + $head_title = $MOD['name'].$L['search']; +} +$seo_file = 'search'; +include DT_ROOT.'/include/seo.inc.php'; +include template($MOD['template_search'] ? $MOD['template_search'] : 'search', $module); +?> \ No newline at end of file diff --git a/module/article/show.htm.php b/module/article/show.htm.php new file mode 100644 index 0000000..7ffa21c --- /dev/null +++ b/module/article/show.htm.php @@ -0,0 +1,107 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3 || $item['islink'] > 0) return false; +require_once DT_ROOT.'/include/content.class.php'; +$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; +extract($item); +$CAT = get_cat($catid); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_content = $t['content']; +$CP = $MOD['cat_property'] && $CAT['property']; +if($CP) { + require_once DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); +} +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +if($voteid) $voteid = explode(' ', $voteid); +if($fromurl) $fromurl = fix_link($fromurl); +$fileurl = $linkurl; +$linkurl = $MOD['linkurl'].$linkurl; +$titles = array(); +if($subtitle) { + $titles = explode("\n", $subtitle); + $titles = array_map('trim', $titles); +} +$keytags = $tag ? explode(' ', $tag) : array(); +$fee = DC::fee($item['fee'], $MOD['fee_view']); +if($fee) { + $description = DC::description($content, $MOD['pre_view']); + $user_status = 4; +} else { + $user_status = 3; +} +$pages = ''; +$total = 1; +$subtitles = count($titles); +if(strpos($content, 'pagebreak') !== false) { + $contents = DC::pagebreak($content); + if($contents) { + $total = count($contents); + if($total < $subtitles) $subtitles = $total; + } +} +$seo_file = 'show'; +include DT_ROOT.'/include/seo.inc.php'; +$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); +if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_title = $head_name = $CAT['catname']; + $foot = ''; +} +for(; $page <= $total; $page++) { + $subtitle = isset($titles[$page-1]) ? $titles[$page-1] : ''; + if($subtitle) $seo_title = $subtitle.$seo_delimiter.$seo_title; + $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid&page=$page"; + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ? itemurl($item, $page) : $item['linkurl']); + $filename = $total == 1 ? DT_ROOT.'/'.$MOD['moduledir'].'/'.$fileurl : DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, $page); + if($total > 1) { + $pages = pages($total, $page, 1, $MOD['linkurl'].itemurl($item, '{destoon_page}')); + if($pages) $pages = substr($pages, 0, strpos($pages, '')); + $content = $contents[$page-1]; + } + $_content = $content; + if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, 1); + } + $DT_PC = $GLOBALS['DT_PC'] = 1; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1 && $total > 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + $head_title = $head_name = $CAT['catname']; + $js_item = 1; + $foot = ''; + if($total > 1) $pages = mobile_pages($total, $page, 1, $MOD['mobile'].itemurl($item, '{destoon_page}')); + if($_content) { + $content = $_content; + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); + $content = DC::format($content, 0); + } + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put($filename, $data); + if($page == 1 && $total > 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/article/show.inc.php b/module/article/show.inc.php new file mode 100644 index 0000000..2a01786 --- /dev/null +++ b/module/article/show.inc.php @@ -0,0 +1,120 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + if($item && $item['status'] == 3) { + if($item['islink']) dheader($item['linkurl']); + if($MOD['show_html'] && is_file(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl'])) d301($MOD['linkurl'].$item['linkurl']); + extract($item); + } else { + include load('404.inc'); + } + $CAT = get_cat($catid); + if(!check_group($_groupid, $CAT['group_show'])) include load('403.inc'); + $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); + $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); + $content = $t['content']; + $CP = $MOD['cat_property'] && $CAT['property']; + if($CP) { + require DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); + } + $adddate = timetodate($addtime, 3); + $editdate = timetodate($edittime, 3); + if($voteid) $voteid = explode(' ', $voteid); + if($fromurl) $fromurl = fix_link($fromurl); + $linkurl = $MOD['linkurl'].$linkurl; + $titles = array(); + if($subtitle) { + $titles = explode("\n", $subtitle); + $titles = array_map('trim', $titles); + } + $subtitle = isset($titles[$page-1]) ? $titles[$page-1] : ''; + $keytags = $tag ? explode(' ', $tag) : array(); + $update = ''; + $fee = DC::fee($item['fee'], $MOD['fee_view']); + if($fee) { + $user_status = 4; + $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid&page=$page"; + $description = DC::description($content, $MOD['pre_view']); + } else { + $user_status = 3; + } + $pages = ''; + $subtitles = count($titles); + $total = 1; + if(strpos($content, 'pagebreak') !== false) { + $contents = DC::pagebreak($content); + if($contents) { + $total = count($contents); + $pages = pages($total, $page, 1, $MOD['linkurl'].itemurl($item, '{destoon_page}')); + if($pages) $pages = substr($pages, 0, strpos($pages, '')); + $content = isset($contents[$page-1]) ? $contents[$page-1] : ''; + if($total < $subtitles) $subtitles = $total; + } + } + if($page > $total) include load('404.inc'); + if($content) { + $content = DC::format($content, $DT_PC); + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); + if($lazy) $content = DC::lazy($content); + } + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ? itemurl($item, $page) : $item['linkurl']); +} else { + $itemid or dheader($MOD['mobile']); + $item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + ($item && $item['status'] == 3) or message($L['msg_not_exist']); + extract($item); + $CAT = get_cat($catid); + if(!check_group($_groupid, $MOD['group_show']) || !check_group($_groupid, $CAT['group_show'])) message($L['msg_no_right']); + $description = ''; + $user_status = 3; + $fee = DC::fee($item['fee'], $MOD['fee_view']); + include DT_ROOT.'/mobile/api/content.inc.php'; + $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); + $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); + $content = $t['content']; + $titles = array(); + if($subtitle) { + $titles = explode("\n", $subtitle); + $titles = array_map('trim', $titles); + } + $subtitle = isset($titles[$page-1]) ? $titles[$page-1] : ''; + $keytags = $tag ? explode(' ', $tag) : array(); + $pages = ''; + $subtitles = count($titles); + $total = 1; + if(strpos($content, 'pagebreak') !== false) { + $contents = DC::pagebreak($content); + if($contents) { + $total = count($contents); + $pages = mobile_pages($total, $page, 1, $MOD['mobile'].itemurl($item, '{destoon_page}')); + $content = isset($contents[$page-1]) ? $contents[$page-1] : ''; + if($total < $subtitles) $subtitles = $total; + } + } + if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); + if($share_icon) $share_icon = DC::icon($thumb, $content); + if($user_status == 2) $description = DC::description($content, $MOD['pre_view']); + $content = DC::format($content, $DT_PC); + } + $editdate = timetodate($addtime, 5); + $update = ''; + $head_title = $head_name = $CAT['catname']; + $js_item = 1; + $foot = ''; +} +if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php'; +$seo_file = 'show'; +include DT_ROOT.'/include/seo.inc.php'; +if($subtitle) $seo_title = $subtitle.$seo_delimiter.$seo_title; +$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); +include template($template, $module); +?> \ No newline at end of file diff --git a/module/brand/admin/index.inc.php b/module/brand/admin/index.inc.php new file mode 100644 index 0000000..1ecb963 --- /dev/null +++ b/module/brand/admin/index.inc.php @@ -0,0 +1,217 @@ + 9 ? " AND level>0" : " AND level=$level"; + if($fromtime) $condition .= " AND `$datetype`>=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; + if($thumb) $condition .= " AND thumb<>''"; + if($guest) $condition .= " AND username=''"; + if($minvip) $condition .= " AND vip>=$minvip"; + if($maxvip) $condition .= " AND vip<=$maxvip"; + if($ip) $condition .= " AND ip='$ip'"; + if($username) $condition .= " AND username='$username'"; + if($itemid) $condition .= " AND itemid=$itemid"; + + $timetype = strpos($dorder[$order], 'add') !== false ? 'add' : ''; +} +switch($action) { + case 'add': + if($submit) { + if($do->pass($post)) { + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + $do->add($post); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid); + dmsg('添加成功', '?moduleid='.$moduleid.'&action='.$action.'&catid='.$post['catid']); + } else { + msg($do->errmsg); + } + } else { + foreach($do->fields as $v) { + isset($$v) or $$v = ''; + } + $content = ''; + $status = 3; + $addtime = timetodate($DT_TIME); + $totime = ''; + $username = $_username; + $item = array(); + $menuid = 0; + isset($url) or $url = ''; + if($url) { + $tmp = fetch_url($url); + if($tmp) extract($tmp); + } + $history = 0; + include tpl('edit', $module); + } + break; + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + $item = $do->get_one(); + extract($item); + $history = history($moduleid, $itemid); + $addtime = timetodate($addtime); + $totime = $totime ? timetodate($totime, 3) : ''; + $menuon = array('4', '3', '2', '1'); + $menuid = $menuon[$status]; + include tpl($action, $module); + } + break; + case 'move': + if($submit) { + $fromids or msg('请填写来源ID'); + if($tocatid) { + $db->query("UPDATE {$table} SET catid=$tocatid WHERE `{$fromtype}` IN ($fromids)"); + dmsg('移动成功', $forward); + } else { + msg('请选择目标分类'); + } + } else { + $itemid = $itemid ? implode(',', $itemid) : ''; + $menuid = 5; + include tpl($action); + } + break; + case 'update': + is_array($itemid) or msg('请选择'.$MOD['name']); + foreach($itemid as $v) { + $do->update($v); + } + dmsg('更新成功', $forward); + break; + case 'tohtml': + is_array($itemid) or msg('请选择'.$MOD['name']); + foreach($itemid as $itemid) { + tohtml('show', $module); + } + dmsg('生成成功', $forward); + break; + case 'delete': + $itemid or msg('请选择'.$MOD['name']); + isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid); + dmsg('删除成功', $forward); + break; + case 'restore': + $itemid or msg('请选择'.$MOD['name']); + $do->restore($itemid); + dmsg('还原成功', $forward); + break; + case 'refresh': + $itemid or msg('请选择'.$MOD['name']); + $do->refresh($itemid); + dmsg('刷新成功', $forward); + break; + case 'clear': + $do->clear(); + dmsg('清空成功', $forward); + break; + case 'level': + $itemid or msg('请选择'.$MOD['name']); + $level = intval($level); + $do->level($itemid, $level); + dmsg('级别设置成功', $forward); + break; + case 'recycle': + $lists = $do->get_list('status=0'.$condition, $dorder[$order]); + $menuid = 4; + include tpl('index', $module); + break; + case 'reject': + if($itemid && !$psize) { + $do->reject($itemid); + dmsg('拒绝成功', $forward); + } else { + $lists = $do->get_list('status=1'.$condition, $dorder[$order]); + $menuid = 3; + include tpl('index', $module); + } + break; + case 'check': + if($itemid && !$psize) { + $do->check($itemid); + dmsg('审核成功', $forward); + } else { + $lists = $do->get_list('status=2'.$condition, $dorder[$order]); + $menuid = 2; + include tpl('index', $module); + } + break; + default: + $lists = $do->get_list('status=3'.$condition, $dorder[$order]); + $menuid = 1; + include tpl('index', $module); + break; +} +?> \ No newline at end of file diff --git a/module/brand/admin/template/html.tpl.php b/module/brand/admin/template/html.tpl.php new file mode 100644 index 0000000..339891c --- /dev/null +++ b/module/brand/admin/template/html.tpl.php @@ -0,0 +1,59 @@ + +
+ + + + +
  +   +   +   +   + +
+
+
+ + + + + + + + + + + + + +
起始ID结束ID每轮生成数量操作
  + +
+
+
+ + + + + + + + + + + +
选择分类每轮生成数量操作
+ +     +第 页 至 页 + +  + +
+
+ + \ No newline at end of file diff --git a/module/brand/admin/template/index.tpl.php b/module/brand/admin/template/index.tpl.php new file mode 100644 index 0000000..70abac6 --- /dev/null +++ b/module/brand/admin/template/index.tpl.php @@ -0,0 +1,160 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + + +
分类LOGO标题会员留言 浏览 点赞 反对 收藏 打赏 赏金 分享 举报 评论 操作
+
+ + + + + +
+更新:
+添加: +
+
+
+ + + + + + +  + +
+ +
+ + + +  +  +  +  + + + + + +批量延长过期时间 +天 + + +  + + + + +  + + + + +  +  + + + + +  +  +  +  +  +  +
+
+'.$pages.'
' : '';?> +
+ + \ No newline at end of file diff --git a/module/brand/admin/uninstall.inc.php b/module/brand/admin/uninstall.inc.php new file mode 100644 index 0000000..7c6acf7 --- /dev/null +++ b/module/brand/admin/uninstall.inc.php @@ -0,0 +1,5 @@ +query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_".$moduleid."`"); +$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_data_".$moduleid."`"); +?> \ No newline at end of file diff --git a/module/brand/brand.class.php b/module/brand/brand.class.php new file mode 100644 index 0000000..39aa24c --- /dev/null +++ b/module/brand/brand.class.php @@ -0,0 +1,285 @@ +moduleid = $moduleid; + $this->table = $table; + $this->table_data = $table_data; + $this->split = $MOD['split']; + $this->fields = array('catid','level','title','style','fee','introduce','areaid','thumb','homepage','status','hits','username','addtime','adddate','editor','edittime','editdate','ip','template', 'linkurl','filepath','note','company','truename','telephone','mobile','address','email','qq','wx','ali','skype'); + } + + function brand($moduleid) { + $this->__construct($moduleid); + } + + function pass($post) { + global $MOD; + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_catid')); + if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); + if(!is_url($post['thumb'])) return $this->_(lang('message->pass_logo')); + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $_username, $_userid, $_cname; + $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['adddate'] = timetodate($post['addtime'], 3); + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['editdate'] = timetodate($post['edittime'], 3); + $post['fee'] = dround($post['fee']); + $post['homepage'] = fix_link($post['homepage']); + $post['video'] = fix_link($post['video']); + $post['video_width'] = intval($post['video_width']); + $post['video_height'] = intval($post['video_height']); + $post['content'] = stripslashes($post['content']); + $post['content'] = save_local($post['content']); + if($MOD['clear_link']) $post['content'] = clear_link($post['content']); + if($MOD['save_remotepic']) $post['content'] = save_remote($post['content']); + if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); + if($this->itemid) { + $new = $post['content']; + if($post['thumb']) $new .= ''; + $r = $this->get_one(); + $old = $r['content']; + if($r['thumb']) $old .= ''; + delete_diff($new, $old); + } else { + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['todate'] = timetodate($r['totime'], 3); + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) { + credit_add($post['username'], $MOD['credit_add']); + credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'], $this->itemid); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.$item['company'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')).strip_tags(area_pos($item['areaid'], ',')); + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $item['itemid'] = $itemid; + $linkurl = itemurl($item); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + $member = $item['username'] ? userinfo($item['username']) : array(); + if($member) $update .= update_user($member, $item); + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + } + if($all) { + $userid = get_user($r['username']); + if($r['thumb']) delete_upload($r['thumb'], $userid); + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + } + } + } + + function check($itemid) { + global $_username, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + $this->itemid = $itemid; + $item = $this->get_one(); + if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { + credit_add($item['username'], $MOD['credit_add']); + credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + $editdate = timetodate(DT_TIME, 3); + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME.",editdate='$editdate' WHERE itemid=$itemid"); + history($this->moduleid, $itemid, 'del'); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function refresh($itemid) { + $editdate = timetodate(DT_TIME, 3); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET edittime='".DT_TIME."',editdate='$editdate' WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/brand/list.htm.php b/module/brand/list.htm.php new file mode 100644 index 0000000..7ea9157 --- /dev/null +++ b/module/brand/list.htm.php @@ -0,0 +1,92 @@ +count($table, $condition); + if($items != $CAT['item']) { + $CAT['item'] = $items; + $db->query("UPDATE {$DT_PRE}category SET item=$items WHERE catid=$catid"); + } +} else { + $items = $CAT['item']; +} +$pagesize = $MOD['pagesize']; +$showpage = 1; +$datetype = 5; +$template = $CAT['template'] ? $CAT['template'] : ($MOD['template_list'] ? $MOD['template_list'] : 'list'); +$total = max(ceil($items/$MOD['pagesize']), 1); +if(isset($fid) && isset($num)) { + $page = $fid; + $topage = $fid + $num - 1; + $total = $topage < $total ? $topage : $total; +} +for(; $page <= $total; $page++) { + $offset = ($page-1)*$pagesize; + $pages = listpages($CAT, $items, $page, $pagesize); + $tags = array(); + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $tags[] = $r; + } + $seo_file = 'list'; + include DT_ROOT.'/include/seo.inc.php'; + $destoon_task = "moduleid=$moduleid&html=list&catid=$catid&page=$page"; + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ?listurl($CAT, $page) : $CAT['linkurl']); + $filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, $page); + $_tags = $tags; + $DT_PC = $GLOBALS['DT_PC'] = 1; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + if($CAT['parentid']) $PCAT = get_cat($CAT['parentid']); + $pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].listurl($CAT, '{destoon_page}')); + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $tags = array(); + foreach($_tags as $r) { + $r['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $r['linkurl']); + $r['date'] = timetodate($r[$time], 3); + $tags[] = $r; + } + if($items) $js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid; + $head_title = $head_name = $CAT['catname']; + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put($filename, $data); + if($page == 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/brand/my.inc.php b/module/brand/my.inc.php new file mode 100644 index 0000000..7c46543 --- /dev/null +++ b/module/brand/my.inc.php @@ -0,0 +1,268 @@ +get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND status>1"); + $limit_used = $r['num']; + $limit_free = $mod_limit > $limit_used ? $mod_limit - $limit_used : 0; +} +if(check_group($_groupid, $MOD['group_refresh'])) $MOD['credit_refresh'] = 0; +switch($action) { + case 'add': + if($mod_limit && $limit_used >= $mod_limit) dalert(lang($L['info_limit'], array($mod_limit, $limit_used)), $_userid ? '?mid='.$mid : '?action=index'); + if($MG['hour_limit']) { + $today = $DT_TIME - 3600; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); + if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), $_userid ? '?mid='.$mid : '?action=index'); + } + if($MG['day_limit']) { + $today = $DT_TODAY - 86400; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); + if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), $_userid ? '?mid='.$mid : '?action=index'); + } + + if($mod_free_limit >= 0) { + $fee_add = ($MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $mod_free_limit && $_userid) ? dround($MOD['fee_add']) : 0; + } else { + $fee_add = 0; + } + $fee_currency = $MOD['fee_currency']; + $fee_unit = $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; + $need_password = $fee_add && $fee_currency == 'money' && $fee_add > $DT['quick_pay']; + $need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; + $need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; + $could_color = check_group($_groupid, $MOD['group_color']) && $MOD['credit_color'] && $_userid; + + if($submit) { + if($fee_add && $fee_add > ($fee_currency == 'money' ? $_money : $_credit)) dalert($L['balance_lack']); + if($need_password && !is_payword($_username, $password)) dalert($L['error_payword']); + + if(!$_userid) { + if(strlen($post['company']) < 4) dalert($L['type_company']); + if($AREA) { + if(!isset($AREA[$post['areaid']])) dalert($L['type_area']); + } else { + if(!$post['areaid']) dalert($L['type_area']); + } + if(strlen($post['truename']) < 4) dalert($L['type_truename']); + if(strlen($post['mobile']) < 7) dalert($L['type_mobile']); + } + + if($MG['add_limit']) { + $last = $db->get_one("SELECT addtime FROM {$table} WHERE $sql ORDER BY itemid DESC"); + if($last && $DT_TIME - $last['addtime'] < $MG['add_limit']) dalert(lang($L['add_limit'], array($MG['add_limit']))); + } + $msg = captcha($captcha, $need_captcha, true); + if($msg) dalert($msg); + $msg = question($answer, $need_question, true); + if($msg) dalert($msg); + if($do->pass($post)) { + $CAT = get_cat($post['catid']); + if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); + $post['addtime'] = $post['level'] = $post['fee'] = 0; + $post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status(3, $need_check); + $post['hits'] = 0; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($could_color && $color && $_credit > $MOD['credit_color']) { + $post['style'] = $color; + credit_add($_username, -$MOD['credit_color']); + credit_record($_username, -$MOD['credit_color'], 'system', $L['title_color'], '['.$MOD['name'].']'.$post['title']); + } + $do->add($post); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid); + if($fee_add) { + if($fee_currency == 'money') { + money_add($_username, -$fee_add); + money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); + } else { + credit_add($_username, -$fee_add); + credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); + } + } + + $msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add']; + $js = ''; + if(isset($post['sync_sina']) && $post['sync_sina']) $js .= sync_weibo('sina', $moduleid, $do->itemid); + if($_userid) { + set_cookie('dmsg', $msg); + $forward = '?mid='.$mid.'&status='.$post['status']; + $msg = ''; + } else { + $forward = '?mid='.$mid.'&action=add'; + } + $js .= 'window.onload=function(){parent.window.location="'.$forward.'";}'; + dalert($msg, '', $js); + } else { + dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : '')); + } + } else { + if($itemid) { + $MG['copy'] && $_userid or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); + + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + extract($item); + $thumb = ''; + $totime = $totime > $DT_TIME ? timetodate($totime, 3) : ''; + } else { + $_catid = $catid; + foreach($do->fields as $v) { + $$v = ''; + } + $content = ''; + $catid = $_catid; + $totime = ''; + if($_userid) { + $user = $db->get_one("SELECT m.truename,m.qq,m.wx,c.areaid,c.mail,c.telephone,c.fax,c.address FROM {$DT_PRE}member m,{$DT_PRE}company c WHERE m.userid=c.userid AND m.userid='$_userid'"); + extract($user); + } + } + $item = array(); + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + + if($MG['edit_limit'] < 0) message($L['edit_refuse']); + if($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit']*86400) message(lang($L['edit_limit'], array($MG['edit_limit']))); + + if($submit) { + if($do->pass($post)) { + $CAT = get_cat($post['catid']); + if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); + $post['addtime'] = timetodate($item['addtime']); + $post['level'] = $item['level']; + $post['fee'] = $item['fee']; + $post['style'] = addslashes($item['style']); + $post['template'] = addslashes($item['template']); + $post['filepath'] = addslashes($item['filepath']); + $post['note'] = addslashes($item['note']); + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status($item['status'], $need_check); + $post['hits'] = $item['hits']; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); + set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); + dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); + } else { + dalert($do->errmsg); + } + } else { + extract($item); + $totime = $totime ? timetodate($totime, 3) : ''; + } + break; + case 'delete': + $MG['delete'] or message(); + $itemid or message(); + $itemids = is_array($itemid) ? $itemid : array($itemid); + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $db->get_one("SELECT username FROM {$table} WHERE itemid=$itemid"); + if(!$item || $item['username'] != $_username) message(); + $do->recycle($itemid); + } + dmsg($L['success_delete'], $forward); + break; + case 'refresh': + $MG['refresh_limit'] > -1 or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); + $itemid or message($L['select_info']); + if($MOD['credit_refresh'] && $_credit < $MOD['credit_refresh']) message($L['credit_lack']); + $itemids = $itemid; + $s = $f = 0; + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $db->get_one("SELECT username,edittime FROM {$table} WHERE itemid=$itemid"); + $could_refresh = $item && $item['username'] == $_username; + if($could_refresh && $MG['refresh_limit'] && $DT_TIME - $item['edittime'] < $MG['refresh_limit']) $could_refresh = false; + if($could_refresh && $MOD['credit_refresh'] && ($MOD['credit_refresh'] > $_credit || $_credit < 0)) $could_refresh = false; + if($could_refresh) { + $do->refresh($itemid); + $s++; + if($MOD['credit_refresh']) $_credit = $_credit - $MOD['credit_refresh']; + } else { + $f++; + } + } + if($MOD['credit_refresh'] && $s) { + $credit = $s*$MOD['credit_refresh']; + credit_add($_username, -$credit); + credit_record($_username, -$credit, 'system', lang($L['credit_record_refresh'], array($MOD['name'])), lang($L['refresh_total'], array($s))); + } + $msg = lang($L['refresh_success'], array($s)); + if($f) $msg = $msg.' '.lang($L['refresh_fail'], array($f)); + dmsg($msg, $forward); + break; + default: + $status = isset($status) ? intval($status) : 3; + in_array($status, array(1, 2, 3, 4)) or $status = 3; + $condition = "username='$_username'"; + $condition .= " AND status=$status"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + $timetype = strpos($MOD['order'], 'add') !== false ? 'add' : ''; + $lists = $do->get_list($condition, $MOD['order']); + break; +} +if($_userid) { + $nums = array(); + for($i = 1; $i < 5; $i++) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='$_username' AND status=$i"); + $nums[$i] = $r['num']; + } +} +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); +} else { + $foot = ''; + if($action == 'add' || $action == 'edit') { + // + } else { + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + foreach($lists as $k=>$v) { + $lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); + $lists[$k]['date'] = timetodate($v[$time], 5); + } + $pages = mobile_pages($items, $page, $pagesize); + $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'my.php'); + } +} +$head_title = lang($L['module_manage'], array($MOD['name'])); +include template($MOD['template_my'] ? $MOD['template_my'] : 'my_'.$module, 'member'); +?> \ No newline at end of file diff --git a/module/brand/show.htm.php b/module/brand/show.htm.php new file mode 100644 index 0000000..a65a75b --- /dev/null +++ b/module/brand/show.htm.php @@ -0,0 +1,63 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3) return false; +require_once DT_ROOT.'/include/content.class.php'; +$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; +extract($item); +$CAT = get_cat($catid); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_content = $t['content']; +if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, 1); +} +$CP = $MOD['cat_property'] && $CAT['property']; +if($CP) { + require_once DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); +} +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$fileurl = $linkurl; +$linkurl = $MOD['linkurl'].$linkurl; +$maincat = get_maincat(0, $moduleid); +$fee = DC::fee($item['fee'], $MOD['fee_view']); +$user_status = 4; +$seo_file = 'show'; +include DT_ROOT.'/include/seo.inc.php'; +$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); +$destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid"; +if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); +$DT_PC = $GLOBALS['DT_PC'] = 1; +ob_start(); +include template($template, $module); +$data = ob_get_contents(); +ob_clean(); +$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.$fileurl; +if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); +file_put($filename, $data); +if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = $linkurl; + $could_message = ($user_status == 3 && $username) ? 1 : 0; + $head_title = $head_name = $CAT['catname']; + $js_item = 1; + $foot = ''; + if($_content) { + $content = $_content; + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); + $content = DC::format($content, 0); + } + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put(str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename), $data); +} +return true; +?> \ No newline at end of file diff --git a/module/buy/admin/config.inc.php b/module/buy/admin/config.inc.php new file mode 100644 index 0000000..d0ffafd --- /dev/null +++ b/module/buy/admin/config.inc.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/module/buy/admin/index.html b/module/buy/admin/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/buy/admin/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/buy/admin/install.inc.php b/module/buy/admin/install.inc.php new file mode 100644 index 0000000..bc6834d --- /dev/null +++ b/module/buy/admin/install.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/module/buy/admin/remkdir.inc.php b/module/buy/admin/remkdir.inc.php new file mode 100644 index 0000000..4af2461 --- /dev/null +++ b/module/buy/admin/remkdir.inc.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/module/buy/admin/template/index.tpl.php b/module/buy/admin/template/index.tpl.php new file mode 100644 index 0000000..4cba6cf --- /dev/null +++ b/module/buy/admin/template/index.tpl.php @@ -0,0 +1,169 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + + + +
行业类型图片标题会员报价 浏览 点赞 反对 收藏 打赏 赏金 分享 举报 评论 操作
+
+ + + + + +
+更新:
+添加: +
+
+
+ + + + + + +  + +
+ +
+ + +  +  +  +  + + + + + +批量延长过期时间 +天 + + +   +  + + + + +  + + + + +  +  + + + +  +  +  +  +  +  +
+
+'.$pages.'' : '';?> +
+ + \ No newline at end of file diff --git a/module/buy/buy.class.php b/module/buy/buy.class.php new file mode 100644 index 0000000..e5213ad --- /dev/null +++ b/module/buy/buy.class.php @@ -0,0 +1,320 @@ +moduleid = $moduleid; + $this->table = $table; + $this->table_data = $table_data; + $this->split = $MOD['split']; + $this->fields = array('catid','areaid','typeid','level','title','style','fee','introduce','n1','n2','n3','v1','v2','v3','amount','price','pack','days','thumb','thumb1','thumb2','thumbs','video','tag','status','hits','username','totime','editor','addtime','adddate','edittime','editdate','ip','template','linkurl','filepath','note','company','truename','telephone','mobile','address','email','qq','wx','ali','skype'); + } + + function buy($moduleid) { + $this->__construct($moduleid); + } + + function pass($post) { + global $MOD; + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_cate')); + if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); + if($post['totime']) { + if(!is_time($post['totime'])) return $this->_(lang('message->pass_date')); + if(datetotime($post['totime']) < DT_TIME) return $this->_(lang('message->pass_todate')); + } + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $TYPE, $_username, $_userid, $_cname; + $thumbs = array(); + foreach($post['thumbs'] as $v) { + if(is_url($v)) $thumbs[] = $v; + } + if($thumbs) { + $post['thumb'] = $thumbs[0]; + array_shift($thumbs); + $post['thumbs'] = implode('|', $thumbs); + } else { + $post['thumb'] = $post['thumbs'] = ''; + } + $post['thumb1'] = $post['thumb2'] = ''; + is_url($post['video']) or $post['video'] = ''; + $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['adddate'] = timetodate($post['addtime'], 3); + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['editdate'] = timetodate($post['edittime'], 3); + $post['totime'] = is_time($post['totime']) ? datetotime($post['totime']) : 0; + $post['fee'] = dround($post['fee']); + $post['content'] = stripslashes($post['content']); + $post['content'] = save_local($post['content']); + if($MOD['clear_link']) $post['content'] = clear_link($post['content']); + if($MOD['save_remotepic']) $post['content'] = save_remote($post['content']); + if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); + if($this->itemid) { + $new = $post['content']; + $new .= ''; + foreach($thumbs as $v) { + $new .= ''; + } + $r = $this->get_one(); + $old = $r['content']; + $old .= ''; + foreach(explode('|', $r['thumbs']) as $v) { + $old .= ''; + } + delete_diff($new, $old); + if($r['video'] != $post['video']) delete_upload($r['video'], match_userid($r['video'])); + } else { + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) { + credit_add($post['username'], $MOD['credit_add']); + credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'].$post['thumbs'].$post['video'], $this->itemid); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'].$post['thumbs'].$post['video'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + global $TYPE; + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.($item['tag'] ? $item['tag'].',' : '').$TYPE[$item['typeid']].','.strip_tags(cat_pos(get_cat($item['catid']), ',')); + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $video = url2video($item['video']); + if($video && $video != $item['video']) $update .= ",video='$video'"; + $item['itemid'] = $itemid; + $linkurl = itemurl($item); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + $member = $item['username'] ? userinfo($item['username']) : array(); + if($member) $update .= update_user($member, $item); + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + } + if($all) { + $userid = get_user($r['username']); + if($r['video']) delete_upload($r['video'], $userid); + if($r['thumb']) delete_upload($r['thumb'], $userid); + if($r['thumbs']) { + foreach(explode('|', $r['thumbs']) as $v) { + if($v) delete_upload($v, $userid); + } + } + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + } + } + } + + function check($itemid) { + global $_username, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + $this->itemid = $itemid; + $item = $this->get_one(); + if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { + credit_add($item['username'], $MOD['credit_add']); + credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + $editdate = timetodate(DT_TIME, 3); + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME.",editdate='$editdate' WHERE itemid=$itemid"); + history($this->moduleid, $itemid, 'del'); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function expire($condition = '') { + DB::query("UPDATE {$this->table} SET status=4 WHERE status=3 AND totime>0 AND totime<".DT_TIME." $condition"); + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function type($itemid, $typeid) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET typeid=$typeid WHERE itemid IN ($itemids)"); + } + + function refresh($itemid) { + $editdate = timetodate(DT_TIME, 3); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET edittime='".DT_TIME."',editdate='$editdate' WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/buy/global.func.php b/module/buy/global.func.php new file mode 100644 index 0000000..7ca7b97 --- /dev/null +++ b/module/buy/global.func.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/module/buy/index.html b/module/buy/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/buy/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/buy/list.inc.php b/module/buy/list.inc.php new file mode 100644 index 0000000..b9f4a39 --- /dev/null +++ b/module/buy/list.inc.php @@ -0,0 +1,88 @@ +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); +?> \ No newline at end of file diff --git a/module/buy/my.inc.php b/module/buy/my.inc.php new file mode 100644 index 0000000..e312c3a --- /dev/null +++ b/module/buy/my.inc.php @@ -0,0 +1,267 @@ +get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND status>1"); + $limit_used = $r['num']; + $limit_free = $mod_limit > $limit_used ? $mod_limit - $limit_used : 0; +} +if(check_group($_groupid, $MOD['group_refresh'])) $MOD['credit_refresh'] = 0; +switch($action) { + case 'add': + if($mod_limit && $limit_used >= $mod_limit) dalert(lang($L['info_limit'], array($mod_limit, $limit_used)), $_userid ? '?mid='.$mid : '?action=index'); + if($MG['hour_limit']) { + $today = $DT_TIME - 3600; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); + if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), $_userid ? '?mid='.$mid : '?action=index'); + } + if($MG['day_limit']) { + $today = $DT_TODAY - 86400; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); + if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), $_userid ? '?mid='.$mid : '?action=index'); + } + + if($mod_free_limit >= 0) { + $fee_add = ($MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $mod_free_limit && $_userid) ? dround($MOD['fee_add']) : 0; + } else { + $fee_add = 0; + } + $fee_currency = $MOD['fee_currency']; + $fee_unit = $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; + $need_password = $fee_add && $fee_currency == 'money' && $fee_add > $DT['quick_pay']; + $need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; + $need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; + $could_color = check_group($_groupid, $MOD['group_color']) && $MOD['credit_color'] && $_userid; + + if($submit) { + if($fee_add && $fee_add > ($fee_currency == 'money' ? $_money : $_credit)) dalert($L['balance_lack']); + if($need_password && !is_payword($_username, $password)) dalert($L['error_payword']); + + if(!$_userid) { + if(strlen($post['company']) < 4) dalert($L['type_company']); + if($AREA) { + if(!isset($AREA[$post['areaid']])) dalert($L['type_area']); + } else { + if(!$post['areaid']) dalert($L['type_area']); + } + if(strlen($post['truename']) < 4) dalert($L['type_truename']); + if(strlen($post['mobile']) < 7) dalert($L['type_mobile']); + } + + if($MG['add_limit']) { + $last = $db->get_one("SELECT addtime FROM {$table} WHERE $sql ORDER BY itemid DESC"); + if($last && $DT_TIME - $last['addtime'] < $MG['add_limit']) dalert(lang($L['add_limit'], array($MG['add_limit']))); + } + $msg = captcha($captcha, $need_captcha, true); + if($msg) dalert($msg); + $msg = question($answer, $need_question, true); + if($msg) dalert($msg); + + if($do->pass($post)) { + $CAT = get_cat($post['catid']); + if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); + $post['addtime'] = $post['level'] = $post['fee'] = 0; + $post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status(3, $need_check); + $post['hits'] = 0; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($could_color && $color && $_credit > $MOD['credit_color']) { + $post['style'] = $color; + credit_add($_username, -$MOD['credit_color']); + credit_record($_username, -$MOD['credit_color'], 'system', $L['title_color'], '['.$MOD['name'].']'.$post['title']); + } + $do->add($post); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid); + if($fee_add) { + if($fee_currency == 'money') { + money_add($_username, -$fee_add); + money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); + } else { + credit_add($_username, -$fee_add); + credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); + } + } + + $msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add']; + $js = ''; + if(isset($post['sync_sina']) && $post['sync_sina']) $js .= sync_weibo('sina', $moduleid, $do->itemid); + if($_userid) { + set_cookie('dmsg', $msg); + $forward = '?mid='.$mid.'&status='.$post['status']; + $msg = ''; + } else { + $forward = '?mid='.$mid.'&action=add'; + } + $js .= 'window.onload=function(){parent.window.location="'.$forward.'";}'; + dalert($msg, '', $js); + } else { + dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : '')); + } + } else { + if($itemid) { + $MG['copy'] && $_userid or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + extract($item); + $totime = $totime > $DT_TIME ? timetodate($totime, 6) : ''; + } else { + $_catid = $catid; + foreach($do->fields as $v) { + $$v = ''; + } + $content = ''; + $catid = $_catid; + $totime = ''; + $typeid = 0; + } + $item = $thumbs = array(); + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + + if($MG['edit_limit'] < 0) message($L['edit_refuse']); + if($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit']*86400) message(lang($L['edit_limit'], array($MG['edit_limit']))); + + if($submit) { + if($do->pass($post)) { + $CAT = get_cat($post['catid']); + if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); + $post['addtime'] = timetodate($item['addtime']); + $post['level'] = $item['level']; + $post['fee'] = $item['fee']; + $post['style'] = addslashes($item['style']); + $post['template'] = addslashes($item['template']); + $post['filepath'] = addslashes($item['filepath']); + $post['note'] = addslashes($item['note']); + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status($item['status'], $need_check); + $post['hits'] = $item['hits']; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); + set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); + dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); + } else { + dalert($do->errmsg); + } + } else { + extract($item); + $thumbs = get_thumbs($item); + $totime = $totime ? timetodate($totime, 6) : ''; + } + break; + case 'delete': + $MG['delete'] or message(); + $itemid or message(); + $itemids = is_array($itemid) ? $itemid : array($itemid); + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $db->get_one("SELECT username FROM {$table} WHERE itemid=$itemid"); + if(!$item || $item['username'] != $_username) message(); + $do->recycle($itemid); + } + dmsg($L['success_delete'], $forward); + break; + case 'refresh': + $MG['refresh_limit'] > -1 or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); + $itemid or message($L['select_info']); + if($MOD['credit_refresh'] && $_credit < $MOD['credit_refresh']) message($L['credit_lack']); + $itemids = $itemid; + $s = $f = 0; + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $db->get_one("SELECT username,edittime FROM {$table} WHERE itemid=$itemid"); + $could_refresh = $item && $item['username'] == $_username; + if($could_refresh && $MG['refresh_limit'] && $DT_TIME - $item['edittime'] < $MG['refresh_limit']) $could_refresh = false; + if($could_refresh && $MOD['credit_refresh'] && ($MOD['credit_refresh'] > $_credit || $_credit < 0)) $could_refresh = false; + if($could_refresh) { + $do->refresh($itemid); + $s++; + if($MOD['credit_refresh']) $_credit = $_credit - $MOD['credit_refresh']; + } else { + $f++; + } + } + if($MOD['credit_refresh'] && $s) { + $credit = $s*$MOD['credit_refresh']; + credit_add($_username, -$credit); + credit_record($_username, -$credit, 'system', lang($L['credit_record_refresh'], array($MOD['name'])), lang($L['refresh_total'], array($s))); + } + $msg = lang($L['refresh_success'], array($s)); + if($f) $msg = $msg.' '.lang($L['refresh_fail'], array($f)); + dmsg($msg, $forward); + break; + default: + $status = isset($status) ? intval($status) : 3; + in_array($status, array(1, 2, 3, 4)) or $status = 3; + $condition = "username='$_username'"; + $condition .= " AND status=$status"; + $typeid = isset($typeid) ? ($typeid === '' ? -1 : intval($typeid)) : -1; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($typeid >=0 ) $condition .= " AND typeid=$typeid"; + $timetype = strpos($MOD['order'], 'add') !== false ? 'add' : ''; + $lists = $do->get_list($condition, $MOD['order']); + break; +} +if($_userid) { + $nums = array(); + for($i = 1; $i < 5; $i++) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='$_username' AND status=$i"); + $nums[$i] = $r['num']; + } +} +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); +} else { + $foot = ''; + if($action == 'add' || $action == 'edit') { + // + } else { + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + foreach($lists as $k=>$v) { + $lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); + $lists[$k]['date'] = timetodate($v[$time], 5); + } + $pages = mobile_pages($items, $page, $pagesize); + $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'my.php'); + } +} +$head_title = lang($L['module_manage'], array($MOD['name'])); +include template($MOD['template_my'] ? $MOD['template_my'] : 'my_'.$module, 'member'); +?> \ No newline at end of file diff --git a/module/buy/show.inc.php b/module/buy/show.inc.php new file mode 100644 index 0000000..64fd7a4 --- /dev/null +++ b/module/buy/show.inc.php @@ -0,0 +1,98 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + if($item['groupid'] == 2) include load('404.inc'); + if($item && $item['status'] > 2) { + if($MOD['show_html'] && is_file(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl'])) d301($MOD['linkurl'].$item['linkurl']); + require DT_ROOT.'/include/content.class.php'; + extract($item); + } else { + include load('404.inc'); + } + $CAT = get_cat($catid); + if(!check_group($_groupid, $CAT['group_show'])) include load('403.inc'); + $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); + $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); + $content = $t['content']; + if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, $DT_PC); + } + $CP = $MOD['cat_property'] && $CAT['property']; + if($CP) { + require DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); + } + $adddate = timetodate($addtime, 5); + $editdate = timetodate($edittime, 5); + $todate = $totime ? timetodate($totime, 3) : 0; + $expired = $totime && $totime < $DT_TIME ? true : false; + $linkurl = $MOD['linkurl'].$linkurl; + $albums = get_albums($item); + $pics = count($albums); + $pics_width = $pics*70; + $update = ''; + $fee = DC::fee($item['fee'], $MOD['fee_view']); + if(check_group($_groupid, $MOD['group_contact'])) { + if($fee) { + $user_status = 4; + $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid"; + } else { + $user_status = 3; + $member = $item['username'] ? userinfo($item['username']) : array(); + if($item['totime'] && $item['totime'] < $DT_TIME && $item['status'] == 3) $update .= ",status=4"; + if($member) { + $update_user = update_user($member, $item); + if($update_user) $db->query("UPDATE LOW_PRIORITY {$table} SET ".substr($update_user, 1)." WHERE username='$username'", 'UNBUFFERED'); + } + } + } else { + $user_status = $_userid ? 1 : 0; + if($_username && $item['username'] == $_username) { + $member = userinfo($item['username']); + $user_status = 3; + } + } + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); +} else { + $itemid or dheader($MOD['mobile']); + $item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + ($item && $item['status'] > 2) or message($L['msg_not_exist']); + if($item['groupid'] == 2) message($L['msg_not_exist']); + require DT_ROOT.'/include/content.class.php'; + extract($item); + $CAT = get_cat($catid); + if(!check_group($_groupid, $MOD['group_show']) || !check_group($_groupid, $CAT['group_show'])) message($L['msg_no_right']); + $member = array(); + $fee = DC::fee($item['fee'], $MOD['fee_view']); + include DT_ROOT.'/mobile/api/contact.inc.php'; + $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); + $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); + $content = $t['content']; + if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); + if($share_icon) $share_icon = DC::icon($thumb, $content); + $content = DC::format($content, 0); + } + $albums = get_albums($item); + $editdate = timetodate($edittime, 5); + $expired = $totime && $totime < $DT_TIME ? true : false; + $could_price = ($user_status == 3 && $username && $username != $_username && !$expired) ? 1 : 0; + $update = ''; + $head_title = $head_name = $CAT['catname']; + $js_item = $js_album = 1; + $foot = ''; +} +if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php'; +$seo_file = 'show'; +include DT_ROOT.'/include/seo.inc.php'; +$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); +include template($template, $module); +?> \ No newline at end of file diff --git a/module/club/admin/config.inc.php b/module/club/admin/config.inc.php new file mode 100644 index 0000000..9017769 --- /dev/null +++ b/module/club/admin/config.inc.php @@ -0,0 +1,53 @@ + \ No newline at end of file diff --git a/module/club/admin/group.inc.php b/module/club/admin/group.inc.php new file mode 100644 index 0000000..b529f9b --- /dev/null +++ b/module/club/admin/group.inc.php @@ -0,0 +1,150 @@ + 9 ? " AND level>0" : " AND level=$level"; + if($chat > -1) $condition .= " AND chat=$chat"; +} +require DT_ROOT.'/module/'.$module.'/group.class.php'; +$do = new group(); +switch($action) { + case 'add': + if($submit) { + if($do->pass($post)) { + $do->add($post); + dmsg('添加成功', '?moduleid='.$moduleid.'&file='.$file); + } else { + msg($do->errmsg); + } + } else { + foreach($do->fields as $v) { + isset($$v) or $$v = ''; + } + $status = 3; + $content = ''; + $addtime = timetodate($DT_TIME); + $menuid = 0; + include tpl('group_edit', $module); + } + break; + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + $item = $do->get_one(); + if($submit) { + if($MOD['list_html']) { + if(preg_match("/^[0-9a-z_\-\/]+$/i", $post['filepath'])) { + $t = $db->get_one("SELECT itemid FROM {$table_group} WHERE filepath='$post[filepath]' AND itemid<>$itemid"); + if($t) msg('静态目录有重复'); + } else { + msg('静态目录规则错误'); + } + } + if($do->pass($post)) { + $do->edit($post); + if($post['catid'] != $item['catid']) $db->query("UPDATE {$table} SET catid=$post[catid] WHERE gid=$itemid"); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($item); + $addtime = timetodate($addtime); + $menuid = 1; + include tpl('group_edit', $module); + } + break; + case 'update': + is_array($itemid) or msg('请选择商圈'); + foreach($itemid as $v) { + $do->update($v); + } + dmsg('更新成功', $forward); + break; + case 'tohtml': + is_array($itemid) or msg('请选择商圈'); + $html_itemids = $itemid; + foreach($html_itemids as $itemid) { + tohtml('group', $module); + } + dmsg('生成成功', $forward); + break; + case 'delete': + $itemid or msg('请选择商圈'); + isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid); + dmsg('删除成功', $forward); + break; + case 'restore': + $itemid or msg('请选择商圈'); + $do->restore($itemid); + dmsg('还原成功', $forward); + break; + case 'clear': + $do->clear(); + dmsg('清空成功', $forward); + break; + case 'level': + $itemid or msg('请选择商圈'); + $level = intval($level); + $do->level($itemid, $level); + dmsg('级别设置成功', $forward); + break; + case 'recycle': + $lists = $do->get_list('status=0'.$condition, $dorder[$order]); + $menuid = 4; + include tpl('group', $module); + break; + case 'reject': + if($itemid && !$psize) { + $do->reject($itemid); + dmsg('拒绝成功', $forward); + } else { + $lists = $do->get_list('status=1'.$condition, $dorder[$order]); + $menuid = 3; + include tpl('group', $module); + } + break; + case 'check': + if($itemid && !$psize) { + $do->check($itemid); + dmsg('审核成功', $forward); + } else { + $lists = $do->get_list('status=2'.$condition, $dorder[$order]); + $menuid = 2; + include tpl('group', $module); + } + break; + default: + $lists = $do->get_list('status=3'.$condition, $dorder[$order]); + $menuid = 1; + include tpl('group', $module); + break; +} +?> \ No newline at end of file diff --git a/module/club/admin/html.inc.php b/module/club/admin/html.inc.php new file mode 100644 index 0000000..c9ab244 --- /dev/null +++ b/module/club/admin/html.inc.php @@ -0,0 +1,184 @@ +get_one("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid AND catid>$catids ORDER BY catid"); + if($CAT) { + $bcatid = $catid = $CAT['catid']; + $total = max(ceil($CAT['item']/$MOD['pagesize']), 1); + $num = 50; + $bfid = $fid; + isset($fpage) or $fpage = 1; + if($fpage <= $total) { + $fid = $fpage; + tohtml('list', $module); + $fid = $bfid; + msg('['.$CAT['catname'].'] 第'.$fpage.'页至第'.($fpage+$num-1).'页生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catids.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one.'&fpage='.($fpage+$num), 0); + } + $fid++; + msg('['.$CAT['catname'].'] 生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catid.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one); + } else { + $all ? msg('列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=group&all='.$all.'&one='.$one) : msg('列表生成成功', $this_forward); + } + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + $tid = $r['num']; + msg('', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids=0&fid=1&&tid='.$tid.'&all='.$all.'&one='.$one); + } + break; + case 'group': + if(!$MOD['list_html']) { + $all ? msg('商圈生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg('商圈生成成功', $this_forward); + } + if(isset($catids)) { + $GRP = $db->get_one("SELECT * FROM {$table_group} WHERE status=3 AND itemid>$catids ORDER BY itemid"); + if($GRP) { + $bitemid = $itemid = $GRP['itemid']; + $total = max(ceil($GRP['post']/$MOD['pagesize']), 1); + $num = 50; + $bfid = $fid; + isset($fpage) or $fpage = 1; + if($fpage <= $total) { + $fid = $fpage; + tohtml('group', $module); + $fid = $bfid; + msg('商圈 ['.$GRP['title'].'] 第'.$fpage.'页至第'.($fpage+$num-1).'页生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catids.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one.'&fpage='.($fpage+$num), 0); + } + $fid++; + msg('商圈 ['.$GRP['title'].'] 生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$itemid.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one); + } else { + $all ? msg('商圈生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg('商圈生成成功', $this_forward); + } + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_group} WHERE status=3"); + $tid = $r['num']; + msg('', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids=0&fid=1&&tid='.$tid.'&all='.$all.'&one='.$one); + } + break; + case 'show': + $update = (isset($update) && $update) ? 1 : 0; + if(!$update && !$MOD['show_html']) { + if($one) dheader( '?file=html&action=back&mid='.$moduleid); + $all ? msg('帖子生成成功', $this_forward) : dmsg('帖子生成成功', $this_forward); + } + $catid = isset($catid) ? intval($catid) : ''; + $sql = $catid ? " AND catid=$catid" : ''; + if(!isset($fid)) { + $r = $db->get_one("SELECT min(itemid) AS fid FROM {$table} WHERE status>2 {$sql}"); + $fid = $r['fid'] ? $r['fid'] : 0; + } + isset($sid) or $sid = $fid; + if(!isset($tid)) { + $r = $db->get_one("SELECT max(itemid) AS tid FROM {$table} WHERE status>2 {$sql}"); + $tid = $r['tid'] ? $r['tid'] : 0; + } + if($update) { + require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php'; + $do = new $module($moduleid); + } + isset($num) or $num = 100; + if($fid <= $tid) { + $result = $db->query("SELECT itemid FROM {$table} WHERE status>2 AND itemid>=$fid {$sql} ORDER BY itemid LIMIT 0,$num"); + if($db->affected_rows($result)) { + while($r = $db->fetch_array($result)) { + $itemid = $r['itemid']; + if($update) { + $do->update($itemid); + } else { + $bfid= $fid; + $fid = 0; + tohtml('show', $module); + $fid = $bfid; + } + } + $itemid += 1; + } else { + $itemid = $fid + $num; + } + } else { + if($update) { + $all ? msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=groups&all=1&one='.$one) : dmsg('更新成功', $this_forward); + } else { + if($one) dheader( '?file=html&action=back&mid='.$moduleid); + $all ? msg('帖子生成成功', $this_forward) : dmsg('帖子生成成功', $this_forward); + } + } + msg('ID从'.$fid.'至'.($itemid-1).'帖子'.($update ? '更新' : '生成').'成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$itemid&tid=$tid&num=$num&update=$update&all=$all&one=$one", 0); + break; + case 'groups': + if(!isset($fid)) { + $r = $db->get_one("SELECT min(itemid) AS fid FROM {$table_group} WHERE status>2"); + $fid = $r['fid'] ? $r['fid'] : 0; + } + isset($sid) or $sid = $fid; + if(!isset($tid)) { + $r = $db->get_one("SELECT max(itemid) AS tid FROM {$table_group} WHERE status>2"); + $tid = $r['tid'] ? $r['tid'] : 0; + } + require DT_ROOT.'/module/'.$module.'/group.class.php'; + $do = new group(); + isset($num) or $num = 100; + if($fid <= $tid) { + $result = $db->query("SELECT itemid FROM {$table_group} WHERE status=3 AND itemid>=$fid ORDER BY itemid LIMIT 0,$num"); + if($db->affected_rows($result)) { + while($r = $db->fetch_array($result)) { + $itemid = $r['itemid']; + $do->update($itemid); + } + $itemid += 1; + } else { + $itemid = $fid + $num; + } + } else { + $all ? msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=index&all=1&one='.$one) : dmsg('更新成功', $this_forward); + } + msg('ID从'.$fid.'至'.($itemid-1).'商圈更新成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$itemid&tid=$tid&num=$num&all=$all&one=$one", 0); + break; + case 'cate': + $catid or msg('请选择分类'); + isset($num) or $num = 50; + isset($fid) or $fid = 1; + $total = max(ceil($CAT['item']/$MOD['pagesize']), 1); + if($fpage && $tpage) { + $fid = $fpage; + $num = $tpage - $fpage + 1; + tohtml('list', $module); + dmsg('生成成功', $this_forward); + } + if($fid <= $total) { + tohtml('list', $module); + msg('第'.$fid.'页至第'.($fid+$num-1).'页生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catid='.$catid.'&fid='.($fid+$num).'&num='.$num.'&fpage='.$fpage.'&tpage='.$tpage, 0); + } else { + dmsg('生成成功', $this_forward); + } + break; + case 'item': + $catid or msg('请选择分类'); + msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=show&catid='.$catid.'&num='.$num); + break; + default: + $r = $db->get_one("SELECT min(itemid) AS fid,max(itemid) AS tid FROM {$table} WHERE status=3"); + $fid = $r['fid'] ? $r['fid'] : 0; + $tid = $r['tid'] ? $r['tid'] : 0; + include tpl('html', $module); + break; +} +?> \ No newline at end of file diff --git a/module/club/admin/menu.inc.php b/module/club/admin/menu.inc.php new file mode 100644 index 0000000..06c99be --- /dev/null +++ b/module/club/admin/menu.inc.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/module/club/admin/reply.inc.php b/module/club/admin/reply.inc.php new file mode 100644 index 0000000..3653e2f --- /dev/null +++ b/module/club/admin/reply.inc.php @@ -0,0 +1,111 @@ +=$fromtime"; + if($totime) $condition .= " AND addtime<=$totime"; +} +switch($action) { + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($do->get_one()); + $history = history($moduleid, $file.'-'.$itemid); + $addtime = timetodate($addtime); + include tpl('reply_edit', $module); + } + break; + case 'delete': + $itemid or msg('请选择回复'); + isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid); + dmsg('删除成功', $forward); + break; + case 'recycle': + $lists = $do->get_list('status=0'.$condition, $dorder[$order]); + $menuid = 3; + include tpl('reply', $module); + break; + case 'reject': + if($itemid && !$psize) { + $do->reject($itemid); + dmsg('拒绝成功', $forward); + } else { + $lists = $do->get_list('status=1'.$condition, $dorder[$order]); + $menuid = 2; + include tpl('reply', $module); + } + break; + case 'check': + if($itemid) { + $do->check($itemid, 3); + dmsg('审核成功', $forward); + } else { + $lists = $do->get_list('status=2'.$condition, $dorder[$order]); + $menuid = 1; + include tpl('reply', $module); + } + break; + case 'level': + $itemid or msg('请选择回复'); + $level = intval($level); + $do->level($itemid, $level); + dmsg('级别设置成功', $forward); + break; + case 'cancel': + $itemid or msg('请选择回复'); + $do->check($itemid, 2); + dmsg('取消成功', $forward); + break; + default: + $lists = $do->get_list('status=3'.$condition, $dorder[$order]); + $menuid = 0; + include tpl('reply', $module); + break; +} +?> \ No newline at end of file diff --git a/module/club/admin/setting.inc.php b/module/club/admin/setting.inc.php new file mode 100644 index 0000000..2297e61 --- /dev/null +++ b/module/club/admin/setting.inc.php @@ -0,0 +1,51 @@ +$v) { + if(strpos($k, 'seo_') === false) continue; + seo_check($v) or msg('SEO信息包含非法字符'); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) { + $_MOD = $MOD; + $MOD = $setting; + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + while($r = $db->fetch_array($result)) { + update_category($r); + } + cache_category($moduleid); + $MOD = $_MOD; + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=groups&num=1000'); + } + if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + $r = $db->get_one("SELECT MAX(itemid) AS maxid FROM {$table}"); + $maxid = $r['maxid']; + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/club/admin/template/group_edit.tpl.php b/module/club/admin/template/group_edit.tpl.php new file mode 100644 index 0000000..621f5de --- /dev/null +++ b/module/club/admin/template/group_edit.tpl.php @@ -0,0 +1,163 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 所属分类
* 商圈名称
* 商圈图标  [上传]  [预览]  [删除]
* 商圈简介
+
* 加圈方式 +/> 自由 +/> 申请 +
* 粉丝群聊 +/> 开启 +/> 关闭 +
* 浏览商圈 +/> 不限 +/> 成员 +
* 浏览帖子 +/> 不限 +/> 成员 +
* 发帖限制 +/> 不限 +/> 成员 +
* 回复限制 +/> 不限 +/> 成员 +
* 创建者 [资料]
* 版主
* 所在地区
* 商圈状态 +/> 通过 +/> 待审 + onclick="if(this.checked) Dd('note').style.display='';"/> 拒绝 +/> 删除 +
* 拒绝理由
* 创建时间
* 创建理由
+
* 商圈模板
* 帖子模板
* 粉丝模板
* 群聊模板
* 静态目录
+
    
+
+ + + + \ No newline at end of file diff --git a/module/club/admin/template/html.tpl.php b/module/club/admin/template/html.tpl.php new file mode 100644 index 0000000..1170078 --- /dev/null +++ b/module/club/admin/template/html.tpl.php @@ -0,0 +1,61 @@ + +
+ + + + +
  +   +   +   +   +   +   + +
+
+
+ + + + + + + + + + + + + +
起始ID结束ID每轮生成数量操作
  + +
+
+
+ + + + + + + + + + + +
选择分类每轮生成数量操作
+ +     +第 页 至 页 + +  + +
+
+ + \ No newline at end of file diff --git a/module/club/admin/template/move.tpl.php b/module/club/admin/template/move.tpl.php new file mode 100644 index 0000000..872d309 --- /dev/null +++ b/module/club/admin/template/move.tpl.php @@ -0,0 +1,33 @@ + +
+ + + + + + + + + + + + + + + + +
移动方式 + id="f_1"/>   + id="f_2"/> +
+
+多个ID用,分开 结尾和开头不能有, +
目标商圈
+
+
+ + \ No newline at end of file diff --git a/module/club/chat.inc.php b/module/club/chat.inc.php new file mode 100644 index 0000000..0a0aec9 --- /dev/null +++ b/module/club/chat.inc.php @@ -0,0 +1,172 @@ += 4) { + $string .= '[emoji]'.rawurlencode($tmp).'[/emoji]'; + } else { + $string .= $tmp; + } + } + return $string; +} + +switch($action) { + case 'send': + if($chat_ban) exit('ban'); + trim($word) or exit('ko'); + if($MOD['chat_maxlen'] && strlen($word) > $MOD['chat_maxlen']*3) exit('max'); + $word = stripslashes(trim($word)); + $word = strip_tags($word); + $word = dsafe($word); + $word = nl2br($word); + $word = strip_nr($word); + if(!$DT_PC) $word = emoji_encode($word); + $word = str_replace('|', ' ', $word); + if($MOD['chat_file'] && $MG['upload']) clear_upload($word, $_userid, $table); + $db->query("UPDATE {$table_group} SET chattime={$DT_TIME} WHERE itemid=$gid"); + $font_s = $font_s ? intval($font_s) : 0; + $font_c = $font_c ? intval($font_c) : 0; + $font_b = $font_b ? 1 : 0; + $font_i = $font_i ? 1 : 0; + $font_u = $font_u ? 1 : 0; + $css = ''; + if($font_s) $css .= ' s'.$font_s; + if($font_c) $css .= ' c'.$font_c; + if($font_b) $css .= ' fb'; + if($font_i) $css .= ' fi'; + if($font_u) $css .= ' fu'; + if($css) $word = ''.$word.''; + if($word) { + $content = addslashes($word); + $nickname = $_cid ? addslashes($_child['nickname']) : ''; + $db->query("INSERT INTO ".get_chat_tb($chatid)." (chatid,username,nickname,addtime,content) VALUES ('$chatid','$_username','$nickname','$DT_TIME','$content')"); + exit('ok'); + } + exit('ko'); + break; + case 'load': + $chatid or exit; + $tb = get_chat_tb($chatid); + $chatlast = $_chatlast = isset($chatlast) ? intval($chatlast) : 0; + $first = isset($first) ? intval($first) : 0; + $i = $j = 0; + $chat_lastuser = ''; + $chat_repeat = 0; + $json = ''; + $time1 = 0; + if($chatlast < 1 || $GRP['chattime'] > $chatlast) { + if($chatlast < 1) { + $result = $db->query("SELECT addtime FROM {$tb} WHERE chatid='$chatid' ORDER BY addtime DESC LIMIT $pagesize"); + while($r = $db->fetch_array($result)) { + $chatlast = $r['addtime']; + } + if($chatlast > 1) $chatlast--; + } + $result = $db->query("SELECT itemid,addtime,username,nickname,content FROM {$tb} WHERE chatid='$chatid' AND addtime>$chatlast ORDER BY addtime ASC LIMIT $pagesize"); + while($r = $db->fetch_array($result)) { + $id = $r['itemid']; + $time = $r['addtime']; + $name = $r['username']; + $nick = $r['nickname'] ? $r['nickname'] : $r['username']; + $head = useravatar($name); + $home = ($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'chat.php?touser='.$name; + $word = $r['content']; + if($_username == $name) { $chat_repeat++; } else { $chat_repeat = 0; } + $chat_lastuser = $name; + $chatlast = $time; + $time2 = $time; + if($time2 - $time1 < 600) { + $date = ''; + } else { + $date = timetodate($time2, 5); + $time1 = $time2; + } + if($MOD['chat_url'] || $MOD['chat_img']) { + if(preg_match_all("/([http|https]+)\:\/\/([a-z0-9\/\-\_\.\,\?\&\#\=\%\+\;]{4,})/i", $word, $m)) { + foreach($m[0] as $u) { + if($MOD['chat_img'] && preg_match("/^(jpg|jpeg|gif|png|bmp)$/i", file_ext($u)) && !preg_match("/([\?\&\=]{1,})/i", $u)) { + $word = str_replace($u, '', $word); + } else if($MOD['chat_img'] && preg_match("/^(mp4)$/i", file_ext($u)) && !preg_match("/([\?\&\=]{1,})/i", $u)) { + $word = str_replace($u, '', $word); + } else if($MOD['chat_url']) { + $word = str_replace($u, ''.$u.'', $word); + } + } + } + } + if(strpos($word, ')') !== false) $word = parse_face($word); + if(strpos($word, '[emoji]') !== false) $word = emoji_decode($word); + $word = str_replace(array('"', "\r", "\n"), array('\"', "\\r", "\\n"), $word); + $self = $_username == $name ? 1 : 0; + if($self) { + //$name = 'Me'; + } else { + $j++; + } + $json .= ($i ? ',' : '').'{id:"'.$id.'",time:"'.$time.'",date:"'.$date.'",name:"'.$name.'",nick:"'.$nick.'",head:"'.$head.'",home:"'.$home.'",word:"'.$word.'",self:"'.$self.'"}'; + $i = 1; + } + } + if($_chatlast == 0) $j = 0; + $json = '{chat_msg:['.$json.'],chat_new:"'.$j.'",chat_last:"'.$chatlast.'"}'; + exit($json); + break; + case 'down': + if($data && is_md5($chatid)) { + $data = stripslashes(dsafe($data)); + $css = file_get(DT_ROOT.'/'.$MODULE[2]['moduledir'].'/image/chat_group.css'); + $css = str_replace('#chat {width:auto;height:466px;overflow:auto;', '#chat {width:700px;margin:auto;', $css); + $css = str_replace("url('", "url('".$MODULE[2]['linkurl']."image/", $css); + $css .= 'body {background:#D8D8D8;color:#333333;font-size:12px;margin:0;}'; + $data = str_replace('', '', $data); + $data = ''.$GRP['title'].'
'.$data.'
'; + file_down('', 'chat-'.$gid.'-'.timetodate($DT_TIME, 'YmdHi').'.html', $data); + } + exit; + break; + default: + $faces = get_face(); + + $lists = array(); + $condition = "gid='$gid' AND status=3"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_fans} WHERE $condition"); + $items = $r['num']; + $pages = pages($items, $page, $pagesize); + $result = $db->query("SELECT * FROM {$table_fans} WHERE $condition ORDER BY addtime ASC LIMIT 35"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 'Y/m/d H:i'); + $lists[] = $r; + } + $admin = is_admin($GRP); + + include DT_ROOT.'/include/seo.inc.php'; + $seo_title = $L['chat_title'].$seo_delimiter.$GRP['title'].$MOD['seo_name'].$seo_delimiter.$seo_page.$seo_modulename.$seo_delimiter.$seo_sitename; + break; +} +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + $js_pull = 0; + $foot = ''; + if($sns_app) $seo_title = $L['chat_title']; +} +$template = $GRP['chat_template'] ? $GRP['chat_template'] : ($MOD['template_chat'] ? $MOD['template_chat'] : 'chat'); +include template($template, $module); +?> \ No newline at end of file diff --git a/module/club/fans.class.php b/module/club/fans.class.php new file mode 100644 index 0000000..74f2bfa --- /dev/null +++ b/module/club/fans.class.php @@ -0,0 +1,124 @@ +table = $table_fans; + } + + function fans() { + $this->__construct(); + } + + function get_one() { + return DB::get_one("SELECT * FROM {$this->table} WHERE itemid='$this->itemid'"); + } + + function get_list($condition = 'status=3', $order = 'itemid DESC') { + global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items, $sum, $table_group; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $groupids = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $groupids[$r['gid']] = $r['gid']; + $lists[] = $r; + } + if($groupids) { + $GRPS = array(); + $result = DB::query("SELECT itemid,title,linkurl FROM {$table_group} WHERE itemid IN (".implode(',', $groupids).")"); + while($r = DB::fetch_array($result)) { + $GRPS[$r['itemid']] = $r; + } + if($GRPS) { + foreach($lists as $k=>$v) { + $lists[$k]['groupname'] = $v['gid'] ? $GRPS[$v['gid']]['title'] : ''; + $lists[$k]['groupurl'] = $v['gid'] ? $MOD['linkurl'].$GRPS[$v['gid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + return true; + } + } + + function delete($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v); + } + } else { + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + } + } + + function check($itemid, $status = 3) { + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->check($v, $status); + } + } else { + DB::query("UPDATE {$this->table} SET status=$status WHERE itemid=$itemid"); + } + } + + function reject($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1 WHERE itemid=$itemid"); + return true; + } + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function ban($itemid, $ban = 0) { + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->ban($v, $ban); + } + } else { + DB::query("UPDATE {$this->table} SET ban=$ban WHERE itemid=$itemid"); + } + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/club/goto.inc.php b/module/club/goto.inc.php new file mode 100644 index 0000000..f21e683 --- /dev/null +++ b/module/club/goto.inc.php @@ -0,0 +1,34 @@ +get_one("SELECT manager FROM {$table_group} WHERE itemid=$catid"); + if($T && $T['manager'] && strpos($T['manager'], $name) !== false) { + $username = get_user($name, 'passport', 'username'); + if($username) dheader(userurl($username)); + } + } + dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); +} else { + $itemid or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); + $R = $db->get_one("SELECT * FROM {$table_reply} WHERE itemid=$itemid"); + $R or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); + $tid = $R['tid']; + $T = $db->get_one("SELECT * FROM {$table} WHERE itemid=$tid"); + $T or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); + if($MOD['reply_pagesize']) $pagesize = $MOD['reply_pagesize']; + if($R['fid']) { + $page = ceil($R['fid']/$pagesize); + } else { + $page = ceil(($T['reply']+1)/$pagesize); + } + if($page == 1) { + $linkurl = $T['linkurl']; + } else { + $linkurl = itemurl($T, $page); + } + dheader($DT_PC ? $MOD['linkurl'].$linkurl.'#R'.$itemid : $MOD['mobile'].$linkurl); +} +?> \ No newline at end of file diff --git a/module/club/group.class.php b/module/club/group.class.php new file mode 100644 index 0000000..fae3417 --- /dev/null +++ b/module/club/group.class.php @@ -0,0 +1,271 @@ +table = $table_group; + $this->fields = array('catid','areaid','title','level','style','thumb','filepath','content','template','show_template','fans_template','chat_template','chat','join_type','list_type','show_type','post_type','reply_type','status','manager','reason','username','addtime','editor','edittime'); + } + + function group() { + $this->__construct(); + } + + function pass($post) { + global $L; + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_catid')); + if(!$post['title']) return $this->_($L['group_pass_title']); + if(!is_url($post['thumb'])) return $this->_($L['group_pass_thumb']); + if(!check_name($post['username'])) return $this->_($L['group_pass_username']); + return true; + } + + function set($post) { + global $MOD, $_username, $_userid, $_cname; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + if($this->itemid) { + $new = ''; + if($post['thumb']) $new .= ''; + $r = $this->get_one(); + $old = ''; + if($r['thumb']) $old .= ''; + delete_diff($new, $old); + } else { + $post['ip'] = DT_IP; + } + $post['chat'] = $post['chat'] ? 1 : 0; + $post['join_type'] = $post['join_type'] ? 1 : 0; + $post['list_type'] = $post['list_type'] ? 1 : 0; + $post['show_type'] = $post['show_type'] ? 1 : 0; + $post['post_type'] = $post['post_type'] ? 1 : 0; + $post['reply_type'] = $post['reply_type'] ? 1 : 0; + foreach(array('group_list', 'group_show', 'group_post', 'group_reply') as $v) { + $post[$v] = isset($post[$v]) ? implode(',', $post[$v]) : ''; + } + $post = dhtmlspecialchars($post); + return array_map("trim", $post); + } + + function get_one($condition = '') { + return DB::get_one("SELECT * FROM {$this->table} WHERE itemid='$this->itemid' $condition"); + } + + function get_list($condition = '1', $order = 'addtime DESC') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['chatid'] = md5($r['itemid'].'@'.$MOD['moduleid']); + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD, $L; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $t = get_cat($this->itemid); + if($t) { + $t = DB::get_one("SELECT MAX(catid) AS id FROM ".DT_PRE."category"); + $itemid = intval($t['id'] + 1); + DB::query("UPDATE {$this->table} SET itemid=$itemid WHERE itemid=$this->itemid"); + $maxid = $itemid + 100; + DB::query("INSERT ".DT_PRE."category (catid) VALUES ($maxid)"); + DB::query("DELETE FROM ".DT_PRE."category WHERE catid=$maxid"); + $this->itemid = $itemid; + } + $this->update($this->itemid); + clear_upload($post['thumb'], $this->itemid, $this->table); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $this->update($this->itemid); + clear_upload($post['thumb'], $this->itemid, $this->table); + return true; + } + + function tohtml($itemid = 0) { + global $module, $MOD; + if($MOD['list_html'] && $itemid) tohtml('group', $module, "itemid=$itemid"); + } + + function update($itemid) { + global $DT; + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + if(!$item['filepath']) { + $item['filepath'] = $itemid; + $update .= ",filepath='$item[filepath]'"; + } + if($item['username']) { + $passport = addslashes(get_user($item['username'], 'username', 'passport')); + if($passport != $item['passport']) $update .= ",passport='$passport'"; + $this->fans($itemid, $item['addtime'], $item['username'], $item['passport']); + } + if($item['manager']) { + $i = 1; + foreach(explode('|', $item['manager']) as $p) { + $u = get_user($p, 'passport', 'username'); + if($u) $this->fans($itemid, $item['addtime'] + $i++, $u, $p); + } + } + $linkurl = listurl(array('catid' => $item['itemid'], 'catdir' => $item['filepath'], 'catname' => $item['title'])); + if($DT['index']) $linkurl = str_replace($DT['index'].'.'.$DT['file_ext'], '', $linkurl); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + $this->tohtml($itemid); + } + + function fans($gid, $addtime, $username, $passport) { + global $table_fans; + $passport = addslashes($passport); + $t = DB::get_one("SELECT itemid FROM {$table_fans} WHERE username='$username' AND gid=$gid"); + if($t) { + $fid = $t['itemid']; + DB::query("UPDATE {$table_fans} SET status=3,ban=0,addtime='$addtime',passport='$passport' WHERE itemid=$fid"); + } else { + DB::query("INSERT INTO {$table_fans} (gid,username,passport,ban,addtime,status) VALUES ('$gid','$username','$passport','0','$addtime','3')"); + } + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + $this->tohtml($itemid); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD, $table, $table_fans; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->delete($v, $all); } + } else { + $r = $this->get_one(); + if($MOD['list_html']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl'].$DT['index'].'.'.$DT['file_ext']; + html_del($_file); + $i = 1; + while($i) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl(array('catid' => $r['itemid'], 'catdir' => $r['filepath'], 'catname' => $r['title']), $i); + if(is_file($_file)) { + html_del($_file); + $i++; + } else { + break; + } + } + } + if($all) { + $userid = get_user($r['username']); + if($r['thumb']) delete_upload($r['thumb'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + DB::query("DELETE FROM {$table_fans} WHERE gid=$itemid"); + DB::query("UPDATE {$table} SET status=0 WHERE gid=$itemid"); + } + } + } + + function check($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid"); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/club/index.inc.php b/module/club/index.inc.php new file mode 100644 index 0000000..0759084 --- /dev/null +++ b/module/club/index.inc.php @@ -0,0 +1,45 @@ + 1 ? 'index.php?page='.$page : ''); +} else { + $gid = 0; + $GRP = array(); + $condition = "status=3"; + if($cityid) { + $areaid = $cityid; + $ARE = get_area($areaid); + $condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + } + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_group} WHERE $condition", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize); + $tags = array(); + if($items) { + $order = $MOD['order']; + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $result = $db->query("SELECT * FROM {$table_group} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['mobile'].$r['linkurl']; + $r['date'] = timetodate($r[$time], 3); + $tags[] = $r; + } + $db->free_result($result); + $js_load = $MOD['mobile'].'search.php?action=group&job=ajax'; + } + $head_title = $head_name = $MOD['name']; +} +$seo_file = 'index'; +include DT_ROOT.'/include/seo.inc.php'; +include template($MOD['template_index'] ? $MOD['template_index'] : 'index', $module); +?> \ No newline at end of file diff --git a/module/club/my.inc.php b/module/club/my.inc.php new file mode 100644 index 0000000..eb7c58b --- /dev/null +++ b/module/club/my.inc.php @@ -0,0 +1,225 @@ +get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND status>1"); + $limit_used = $r['num']; + $limit_free = $mod_limit > $limit_used ? $mod_limit - $limit_used : 0; +} +switch($action) { + case 'add': + $gid = isset($gid) ? intval($gid) : 0; + $gid or $gid = last_gid(); + $gid or message($L['my_choose_group'], $DT_PC ? $MOD['linkurl'] : $MOD['mobile']); + $GRP = get_group($gid); + ($GRP && $GRP['status'] == 3) or message($L['my_not_group']); + if($mod_limit && $limit_used >= $mod_limit) dalert(lang($L['info_limit'], array($mod_limit, $limit_used)), $_userid ? '?mid='.$mid : '?action=index'); + $is_fans = is_fans($GRP); + $ban = is_array($is_fans) ? $is_fans['ban'] : 0; + if($ban) message($L['my_baned']); + if($GRP['post_type'] && !$is_fans) { + $action = 'post'; + $head_title = lang('message->without_permission'); + exit(include template('nofans', $module)); + } + if($MG['hour_limit']) { + $today = $DT_TIME - 3600; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); + if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), $_userid ? '?mid='.$mid : '?action=index'); + } + if($MG['day_limit']) { + $today = $DT_TODAY - 86400; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); + if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), $_userid ? '?mid='.$mid : '?action=index'); + } + + if($mod_free_limit >= 0) { + $fee_add = ($MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $mod_free_limit && $_userid) ? dround($MOD['fee_add']) : 0; + } else { + $fee_add = 0; + } + $fee_currency = $MOD['fee_currency']; + $fee_unit = $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; + $need_password = $fee_add && $fee_currency == 'money' && $fee_add > $DT['quick_pay']; + $need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; + $need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; + + if($submit) { + if($fee_add && $fee_add > ($fee_currency == 'money' ? $_money : $_credit)) dalert($L['balance_lack']); + if($need_password && !is_payword($_username, $password)) dalert($L['error_payword']); + $msg = captcha($captcha, $need_captcha, true); + if($msg) dalert($msg); + $msg = question($answer, $need_question, true); + if($msg) dalert($msg); + $post['gid'] = $GRP['itemid']; + $post['catid'] = $GRP['catid']; + if($do->pass($post)) { + $post['addtime'] = $post['level'] = $post['fee'] = 0; + $post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status(3, $need_check); + $post['hits'] = 0; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + $do->add($post); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid); + if($fee_add) { + if($fee_currency == 'money') { + money_add($_username, -$fee_add); + money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); + } else { + credit_add($_username, -$fee_add); + credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); + } + } + $js = ''; + if(isset($post['sync_sina']) && $post['sync_sina']) $js .= sync_weibo('sina', $moduleid, $do->itemid); + if($post['status'] == 3) { + $r = $db->get_one("SELECT linkurl FROM {$table} WHERE itemid=$do->itemid"); + $forward = ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$r['linkurl']; + $msg = ''; + } else { + if($_userid) { + set_cookie('dmsg', $msg); + $forward = '?mid='.$mid.'&status='.$post['status']; + $msg = ''; + } else { + $forward = '?mid='.$mid.'&action=add'; + $msg = $L['success_check']; + } + } + $js .= 'window.onload=function(){parent.window.location="'.$forward.'";}'; + dalert($msg, '', $js); + } else { + dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : '')); + } + } else { + $_gid = $gid; + foreach($do->fields as $v) { + $$v = ''; + } + $gid = $_gid; + $catid = $GRP['catid']; + $content = ''; + if($kw) $title = $kw; + $item = array(); + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + $gid = $item['gid']; + $GRP = get_group($gid); + + if($MG['edit_limit'] < 0) message($L['edit_refuse']); + if($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit']*86400) message(lang($L['edit_limit'], array($MG['edit_limit']))); + + if($submit) { + $post['gid'] = $GRP['itemid']; + $post['catid'] = $GRP['catid']; + if($do->pass($post)) { + $post['addtime'] = timetodate($item['addtime']); + $post['level'] = $item['level']; + $post['fee'] = $item['fee']; + $post['style'] = addslashes($item['style']); + $post['template'] = addslashes($item['template']); + $post['filepath'] = addslashes($item['filepath']); + $post['note'] = addslashes($item['note']); + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status($item['status'], $need_check); + $post['hits'] = $item['hits']; + $post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0; + $post['get_introduce'] = $MOD['get_introduce'] ? 1 : 0; + $post['introduce_length'] = $MOD['introduce_length'] ? $MOD['introduce_length'] : 0; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); + set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); + dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); + } else { + dalert($do->errmsg); + } + } else { + extract($item); + } + break; + case 'delete': + $MG['delete'] or message(); + $itemid or message(); + $itemids = is_array($itemid) ? $itemid : array($itemid); + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $db->get_one("SELECT username FROM {$table} WHERE itemid=$itemid"); + if(!$item || $item['username'] != $_username) message(); + $do->recycle($itemid); + } + dmsg($L['success_delete'], $forward); + break; + default: + $status = isset($status) ? intval($status) : 3; + in_array($status, array(1, 2, 3)) or $status = 3; + $condition = "username='$_username'"; + $condition .= " AND status=$status"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + $timetype = strpos($MOD['order'], 'edit') === false ? 'add' : ''; + $lists = $do->get_list($condition, $MOD['order']); + break; +} +if($_userid) { + $nums = array(); + for($i = 1; $i < 4; $i++) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='$_username' AND status=$i"); + $nums[$i] = $r['num']; + } +} +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); +} else { + $foot = ''; + if($action == 'add' || $action == 'edit') { + // + } else { + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + foreach($lists as $k=>$v) { + $lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); + $lists[$k]['date'] = timetodate($v[$time], 5); + } + $pages = mobile_pages($items, $page, $pagesize); + $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'my.php'); + } +} +$head_title = $L['my_title']; +include template($MOD['template_my'] ? $MOD['template_my'] : 'my_'.$module, 'member'); +?> \ No newline at end of file diff --git a/module/club/show.htm.php b/module/club/show.htm.php new file mode 100644 index 0000000..75c2b2f --- /dev/null +++ b/module/club/show.htm.php @@ -0,0 +1,111 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3) return false; +require_once DT_ROOT.'/include/content.class.php'; +$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; +extract($item); +$CAT = get_cat($catid); +$GRP = get_group($gid); +$GRP['managers'] = $GRP['manager'] ? explode('|', $GRP['manager']) : array(); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_content = $t['content']; +if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, 1); +} +$CP = $MOD['cat_property'] && $CAT['property']; +if($CP) { + require_once DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); +} +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$fileurl = $linkurl; +$linkurl = $MOD['linkurl'].$linkurl; +$admin = ''; +$fee = DC::fee($item['fee'], $MOD['fee_view']); +if($fee) { + $description = DC::description($content, $MOD['pre_view']); + $user_status = 4; +} else { + $user_status = 3; +} +$F = explode('|', $MOD['floor']); +$pages = ''; +$pagesize = $MOD['reply_pagesize']; +if($page == 1) { + $items = $db->count($table_reply, "tid=$itemid AND status=3"); + if($items != $reply) { + $item['reply'] = $reply = $items; + $db->query("UPDATE {$table} SET reply=$reply WHERE itemid=$itemid"); + } +} else { + $items = $reply; +} +$total = max(ceil($items/$pagesize), 1); +if(isset($fid) && isset($num) && $fid > 0) { + $page = $fid; + $topage = $fid + $num - 1; + $total = $topage < $total ? $topage : $total; +} +$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); +for(; $page <= $total; $page++) { + $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid&page=$page"; + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ? itemurl($item, $page) : $item['linkurl']); + $filename = $total == 1 ? DT_ROOT.'/'.$MOD['moduledir'].'/'.$fileurl : DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, $page); + $replys = array(); + if($items) { + $offset = ($page-1)*$pagesize; + $pages = pages($items, $page, $pagesize, $MOD['linkurl'].itemurl($item, '{destoon_page}')); + $floor = $page == 1 ? 0 : ($page-1)*$pagesize; + $pages = pages($items, $page, $pagesize, $MOD['linkurl'].itemurl($item, '{destoon_page}')); + $result = $db->query("SELECT * FROM {$table_reply} WHERE tid=$itemid AND status=3 ORDER BY itemid ASC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['fname'] = isset($F[$floor]) ? $F[$floor] : ''; + $r['floor'] = ++$floor; + if($r['fid'] != $r['floor']) $db->query("UPDATE {$table_reply} SET fid='$r[floor]' WHERE itemid='$r[itemid]'"); + $replys[] = $r; + } + } + $seo_file = 'show'; + include DT_ROOT.'/include/seo.inc.php'; + $DT_PC = $GLOBALS['DT_PC'] = 1; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1 && $total > 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + $head_title = $head_name = $GRP['title'].$MOD['seo_name']; + $js_item = 1; + $foot = ''; + if($total > 1) $pages = mobile_pages($total, $page, 1, $MOD['mobile'].itemurl($item, '{destoon_page}')); + if($_content) { + $content = $_content; + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); + $content = DC::format($content, 0); + } + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put($filename, $data); + if($page == 1 && $total > 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/company/admin/html.inc.php b/module/company/admin/html.inc.php new file mode 100644 index 0000000..babbff8 --- /dev/null +++ b/module/company/admin/html.inc.php @@ -0,0 +1,164 @@ +get_one("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid AND catid>$catids ORDER BY catid"); + if($CAT) { + $bcatid = $catid = $CAT['catid']; + $total = max(ceil($CAT['item']/$MOD['pagesize']), 1); + $num = 50; + $bfid = $fid; + isset($fpage) or $fpage = 1; + if($fpage <= $total) { + $fid = $fpage; + tohtml('list', $module); + $fid = $bfid; + msg($MOD['name'].' ['.$CAT['catname'].'] 第'.$fpage.'页至第'.($fpage+$num-1).'页生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catids.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one.'&fpage='.($fpage+$num), 0); + } + $fid++; + msg($MOD['name'].' ['.$CAT['catname'].'] 生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catid.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one); + } else { + $all ? msg($MOD['name'].'列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg($MOD['name'].'列表生成成功', $this_forward); + } + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + $tid = $r['num']; + msg('', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids=0&fid=1&&tid='.$tid.'&all='.$all.'&one='.$one); + } + break; + case 'show': + $update = (isset($update) && $update) ? 1 : 0; + if(!$update && !$MOD['show_html']) { + if($one) dheader( '?file=html&action=back&mid='.$moduleid); + $all ? msg($MOD['name'].'生成成功', $this_forward) : dmsg($MOD['name'].'生成成功', $this_forward); + } + $catid = isset($catid) ? intval($catid) : ''; + $sql = $catid ? " AND catid=$catid" : ''; + if(!isset($fid)) { + $r = $db->get_one("SELECT min(userid) AS fid FROM {$table} WHERE groupid>0 {$sql}"); + $fid = $r['fid'] ? $r['fid'] : 0; + } + isset($sid) or $sid = $fid; + if(!isset($tid)) { + $r = $db->get_one("SELECT max(userid) AS tid FROM {$table} WHERE groupid>0 {$sql}"); + $tid = $r['tid'] ? $r['tid'] : 0; + } + if($update) { + require DT_ROOT.'/module/'.$module.'/'.$module.'.class.php'; + $do = new $module(); + } + isset($num) or $num = 50; + if($fid <= $tid) { + $result = $db->query("SELECT userid FROM {$table} WHERE userid>=$fid {$sql} ORDER BY userid LIMIT 0,$num"); + if($db->affected_rows($result)) { + while($r = $db->fetch_array($result)) { + $userid = $r['userid']; + $update ? $do->update($userid) : tohtml('show', $module); + } + $userid += 1; + } else { + $userid = $fid + $num; + } + } else { + if($update) { + $all ? msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=index&all=1&one='.$one) : dmsg('更新成功', $this_forward); + } else { + if($one) dheader( '?file=html&action=back&mid='.$moduleid); + $all ? msg($MOD['name'].'生成成功', $this_forward) : dmsg($MOD['name'].'生成成功', $this_forward); + } + } + msg('ID从'.$fid.'至'.($userid-1).$MOD['name'].($update ? '更新' : '生成').'成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$userid&tid=$tid&num=$num&update=$update&all=$all&one=$one", 0); + break; + case 'passport': + if(!isset($fid)) { + $r = $db->get_one("SELECT min(userid) AS fid FROM {$table}"); + $fid = $r['fid'] ? $r['fid'] : 0; + } + isset($sid) or $sid = $fid; + if(!isset($tid)) { + $r = $db->get_one("SELECT max(userid) AS tid FROM {$table}"); + $tid = $r['tid'] ? $r['tid'] : 0; + } + isset($num) or $num = 50; + if($fid <= $tid) { + $result = $db->query("SELECT userid,username FROM {$table} WHERE userid>=$fid ORDER BY userid LIMIT 0,$num"); + if($db->affected_rows($result)) { + while($r = $db->fetch_array($result)) { + $userid = $r['userid']; + $username = $r['username']; + $passport = get_user($userid, 'userid', 'passport'); + $passport = addslashes($passport); + + $db->query("UPDATE {$DT_PRE}comment SET passport='$passport' WHERE username='$username'"); + foreach($MODULE as $m) { + $mid = $m['moduleid']; + if($m['module'] == 'know') { + $db->query("UPDATE {$DT_PRE}know_{$mid} SET passport='$passport' WHERE username='$username'"); + $db->query("UPDATE {$DT_PRE}know_answer_{$mid} SET passport='$passport' WHERE username='$username'"); + $db->query("UPDATE {$DT_PRE}know_expert_{$mid} SET passport='$passport' WHERE username='$username'"); + $db->query("UPDATE {$DT_PRE}know_vote_{$mid} SET passport='$passport' WHERE username='$username'"); + } + if($m['module'] == 'club') { + $db->query("UPDATE {$DT_PRE}club_{$mid} SET passport='$passport' WHERE username='$username'"); + $db->query("UPDATE {$DT_PRE}club_fans_{$mid} SET passport='$passport' WHERE username='$username'"); + $db->query("UPDATE {$DT_PRE}club_group_{$mid} SET passport='$passport' WHERE username='$username'"); + $db->query("UPDATE {$DT_PRE}club_reply_{$mid} SET passport='$passport' WHERE username='$username'"); + $db->query("UPDATE {$DT_PRE}club_{$mid} SET replyer='$passport' WHERE replyuser='$username'"); + } + } + } + $userid += 1; + } else { + $userid = $fid + $num; + } + } else { + dmsg('更新成功', $this_forward); + } + msg('ID从'.$fid.'至'.($userid-1).'昵称更新成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$userid&tid=$tid&num=$num&all=$all&one=$one", 0); + break; + case 'cate': + $catid or msg('请选择分类'); + isset($num) or $num = 50; + isset($fid) or $fid = 1; + $total = max(ceil($CAT['item']/$MOD['pagesize']), 1); + if($fpage && $tpage) { + $fid = $fpage; + $num = $tpage - $fpage + 1; + tohtml('list', $module); + dmsg('生成成功', $this_forward); + } + if($fid <= $total) { + tohtml('list', $module); + msg('第'.$fid.'页至第'.($fid+$num-1).'页生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catid='.$catid.'&fid='.($fid+$num).'&num='.$num.'&fpage='.$fpage.'&tpage='.$tpage, 0); + } else { + dmsg('生成成功', $this_forward); + } + break; + default: + $r = $db->get_one("SELECT min(userid) AS fid,max(userid) AS tid FROM {$table}"); + $fid = $r['fid'] ? $r['fid'] : 0; + $tid = $r['tid'] ? $r['tid'] : 0; + include tpl('html', $module); + break; +} +?> \ No newline at end of file diff --git a/module/company/admin/menu.inc.php b/module/company/admin/menu.inc.php new file mode 100644 index 0000000..96ba6ec --- /dev/null +++ b/module/company/admin/menu.inc.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/module/company/admin/setting.inc.php b/module/company/admin/setting.inc.php new file mode 100644 index 0000000..f1a3210 --- /dev/null +++ b/module/company/admin/setting.inc.php @@ -0,0 +1,49 @@ +$v) { + if(strpos($k, 'seo_') === false) continue; + seo_check($v) or msg('SEO信息包含非法字符'); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) { + $_MOD = $MOD; + $MOD = $setting; + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + while($r = $db->fetch_array($result)) { + update_category($r); + } + cache_category($moduleid); + $MOD = $_MOD; + } + if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + $r = $db->get_one("SELECT MAX(userid) AS maxid FROM {$table}"); + $maxid = $r['maxid']; + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/company/admin/template/index.html b/module/company/admin/template/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/company/admin/template/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/company/admin/template/index.tpl.php b/module/company/admin/template/index.tpl.php new file mode 100644 index 0000000..c3e3bfc --- /dev/null +++ b/module/company/admin/template/index.tpl.php @@ -0,0 +1,134 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + + + + + + +
图片名称会员名会员组 所在地注册年份 注册资本 浏览 点赞 反对 收藏 打赏 赏金 分享 举报 评论 操作
+
+ +
+ + ' : '';?> + + + ' : '';?> + + +
+
+
  +  +
+
+  +  +  +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/company/admin/template/move.tpl.php b/module/company/admin/template/move.tpl.php new file mode 100644 index 0000000..0d9b066 --- /dev/null +++ b/module/company/admin/template/move.tpl.php @@ -0,0 +1,35 @@ + +
+ + + + + + + + + + + + + + + + + + + +
+   + id="f_3"/> + 目标地区
+ +
+ +
+ + \ No newline at end of file diff --git a/module/company/admin/template/setting.tpl.php b/module/company/admin/template/setting.tpl.php new file mode 100644 index 0000000..0e927dd --- /dev/null +++ b/module/company/admin/template/setting.tpl.php @@ -0,0 +1,390 @@ + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
首页默认模板
列表默认模板
搜索默认模板
信息排序方式 + + +
列表或搜索主字段
内容分表 + onclick="Dwidget('?file=split&mid=&maxid=&split=1', '开启内容分表');"/> 开启     + onclick="Dwidget('?file=split&mid=&maxid=&split=0', '关闭内容分表');"/> 关闭 + 如果你的数据少于10万,则不需要开启,当前最大id为'.$maxid.','.($maxid > 100000 ? '建议开启' : '无需开启').'
此项一旦开启,请不要随意关闭,以免出现未知错误,同时全文搜索将关闭');?> + +
公司主页显示评论 +checked /> 开启     +checked /> 关闭
公司主页信息链接到主站 +checked /> 开启     +checked /> 关闭
公司主页开启条件 +> 资料认证        +> 资料完善 +
到期自动删除 +checked /> 开启     +checked /> 关闭 +如果选择关闭,服务到期之后,会员可以继续使用'.VIP.'服务,需要管理员从过期'.VIP.'里手动删除');?> +
指数计算规则 + + + + + + + + + + + + + + + + + + + + + + + + + + +
项目最大值
会员组指数相等
企业资料认证
VIP年份(单位:值/年)
5张以上资质证书
+   所有数值均为整数。指数满分10分,故最大值之和应等于10 +
公司主页地图接口 +'; +tips('位于./api/map/目录,一个目录即为一个地图接口,请注意配置对应的config.inc.php文件默认坐标和key
请不要频繁更换接口,以免用户的设置失效。'); +?> +
公司主页统计接口 + '.$v['name'].' '; +} +tips('位于./api/stats/目录,一个目录即为一个统计接口
请不要频繁更换接口,以免用户的设置失效。'); +?> +
公司主页客服接口 + '.$v['name'].' '; +} +tips('位于./api/kf/目录,一个目录即为一个客服接口
请不要频繁更换接口,以免用户的设置失效。'); +?> +
级别中文别名 + +
用 | 分隔不同别名 依次对应 1|2|3|4|5|6|7|8|9 级
+
级别效果预览
按分类浏览列数
首页名企推荐数量
首页最新数量
首页企业新闻数量
首页最新加入数量
列表信息分页数量
内容点击次数 +/> 开启     +/> 关闭 + +
内容点赞和反对 +/> 开启     +/> 关闭 +
+
+ + + + + +
+     + +
+
+ + \ No newline at end of file diff --git a/module/company/admin/template/vip.tpl.php b/module/company/admin/template/vip.tpl.php new file mode 100644 index 0000000..071fa68 --- /dev/null +++ b/module/company/admin/template/vip.tpl.php @@ -0,0 +1,100 @@ + + +
+ + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + +
公司名称会员名会员组 指数 理论值 修正值 开通时间 到期时间 剩余(天) 管理
  $DT_TIME ? intval(($v['totime']-$DT_TIME)/86400) : '过期';?> +  +  + +
+
+  +  +
+
+'.$pages.'' : '';?> +
名词解释
+ + + + + + + + + + + + + +
指数指数,是对会员的综合评分的一组1-10的数字,是理论值和修正值之和。指数越大,会员的级别、实力、可信度等越高,信息排名越靠前
理论值理论值是由系统根据管理员设置的评分标准计算出的指数值
修正值为了消除理论值与会员实际综合实力的误差,由管理员进行人工干预的数值,可为正数,也可为负数
+ + \ No newline at end of file diff --git a/module/company/homepage.inc.php b/module/company/homepage.inc.php new file mode 100644 index 0000000..ef77832 --- /dev/null +++ b/module/company/homepage.inc.php @@ -0,0 +1,63 @@ +get_one("SELECT content FROM {$content_table} WHERE userid=$userid"); +$COM['content'] = $r['content']; +$intro_length = isset($HOME['intro_length']) && $HOME['intro_length'] ? intval($HOME['intro_length']) : 1000; +$COM['intro'] = nl2br(dsubstr(trim(strip_tags($r['content'])), $intro_length, '...')); +$COM['thumb'] = $COM['thumb'] ? $COM['thumb'] : DT_SKIN.'image/company.jpg'; +if($COMGROUP['main_d']) { + $_main_show = array(); + foreach($HMAIN as $k=>$v) { + $_main_show[$k] = strpos(','.$COMGROUP['main_d'].',', ','.$k.',') !== false ? 1 : 0; + } + $_main_show = implode(',', $_main_show); +} else { + $_main_show = '1,1,1,0,0,0,0'; +} +$_main_order = '0,10,20,30,40,50,60,70'; +$_main_num = '10,1,10,5,3,4,4,10'; +$_main_file= implode(',' , $IFILE); +$_main_name = implode(',' , $HMAIN); + +$main_show = explode(',', isset($HOME['main_show']) ? $HOME['main_show'] : $_main_show); +$main_order = explode(',', isset($HOME['main_order']) ? $HOME['main_order'] : $_main_order); +$main_num = explode(',', isset($HOME['main_num']) ? $HOME['main_num'] : $_main_num); +$main_file = explode(',', isset($HOME['main_file']) ? $HOME['main_file'] : $_main_file); +$main_name = explode(',', isset($HOME['main_name']) ? $HOME['main_name'] : $_main_name); +$_HMAIN = array(); +asort($main_order); +foreach($main_order as $k=>$v) { + if($main_show[$k] && in_array($main_file[$k], $IFILE)) { + $_HMAIN[$k] = $HMAIN[$k]; + } + if($main_num[$k] < 1 || $main_num[$k] > 50) $main_num[$k] = 10; +} +$HMAIN = $_HMAIN; +$seo_title = isset($HOME['seo_title']) && $HOME['seo_title'] ? $HOME['seo_title'] : ''; +$head_title = ''; +if($DT_PC) { + // +} else { + $background = (isset($HOME['background']) && $HOME['background']) ? $HOME['background'] : ''; + $logo = (isset($HOME['logo']) && $HOME['logo']) ? $HOME['logo'] : ($COM['thumb'] ? $COM['thumb'] : 'static/img/home-logo.png'); + $M = array(); + $my_sell = $my_mall = 0; + foreach($MENU as $v) { + if(in_array($v['file'], array('introduce', 'news', 'credit', 'contact', 'honor', 'link'))) continue; + $M[] = $v; + if($v['file'] == 'sell') $my_sell = 1; + if($v['file'] == 'mall') $my_mall = 1; + } + if($bannerf) require DT_ROOT.'/include/content.class.php'; + $head_name = $L['com_home']; + $foot = 'home'; +} +include template('index', $template); +if(isset($update) && $db->cache_ids && ($username == $_username || $_groupid == 1 || $domain)) { + foreach($db->cache_ids as $v) { + $dc->rm($v); + } + dheader($COM['linkurl']); +} +?> \ No newline at end of file diff --git a/module/company/honor.inc.php b/module/company/honor.inc.php new file mode 100644 index 0000000..7e09f86 --- /dev/null +++ b/module/company/honor.inc.php @@ -0,0 +1,58 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + if(!$item || $item['status'] < 3 || $item['username'] != $username) dheader($MENU[$menuid]['linkurl']); + require DT_ROOT.'/include/content.class.php'; + extract($item); + $image = str_replace('.thumb.'.file_ext($thumb), '', $thumb); + $content = DC::format($content, $DT_PC); + if(!$DT_BOT) $db->query("UPDATE LOW_PRIORITY {$table} SET hits=hits+1 WHERE itemid=$itemid", 'UNBUFFERED'); + $head_title = $title.$DT['seo_delimiter'].$head_title; + $head_keywords = $title.','.$COM['company']; + $head_description = dsubstr(strip_tags($content), 200); + if($DT_PC) { + // + } else { + $js_item = 1; + $foot = 'honor'; + } +} else { + $url = "file=$file"; + $condition = "username='$username' AND status=3"; + if($kw) { + $condition .= match_kw('title', $keyword); + $url .= "&kw=$kw"; + $head_title = $kw.$DT['seo_delimiter'].$head_title; + } + $demo_url = userurl($username, $url.'&page={destoon_page}', $domain); + $pagesize = intval($menu_num[$menuid]); + if(!$pagesize || $pagesize > 100) $pagesize = 10; + $offset = ($page-1)*$pagesize; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = $DT_PC ? home_pages($items, $page, $pagesize, $demo_url) : mobile_pages($items, $page, $pagesize, $demo_url); + $lists = array(); + if($items) { + $result = $db->query("SELECT * FROM {$table} WHERE {$condition} ORDER BY addtime DESC LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = userurl($username, "file=$file&itemid=$r[itemid]", $domain); + $r['image'] = str_replace('.thumb.'.file_ext($r['thumb']), '', $r['thumb']); + if($kw) { + $r['title'] = str_replace($kw, ''.$kw.'', $r['title']); + } + $lists[] = $r; + } + $db->free_result($result); + } + if($DT_PC) { + // + } else { + $foot = 'honor'; + } +} +include template('honor', $template); +?> \ No newline at end of file diff --git a/module/company/index.htm.php b/module/company/index.htm.php new file mode 100644 index 0000000..faf89ed --- /dev/null +++ b/module/company/index.htm.php @@ -0,0 +1,54 @@ +5"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].'index.php?page={destoon_page}'); + $tags = array(); + if($items) { + $order = $MOD['order']; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $tags[] = $r; + } + $db->free_result($result); + $js_load = $MOD['mobile'].'search.php?job=ajax'; + } + $head_title = $head_name = $MOD['name']; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put(str_replace('company.htm', 'company.mob.htm', $filename), $data); +} +return true; +?> \ No newline at end of file diff --git a/module/company/index.html b/module/company/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/company/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/company/init.inc.php b/module/company/init.inc.php new file mode 100644 index 0000000..624c5e7 --- /dev/null +++ b/module/company/init.inc.php @@ -0,0 +1,300 @@ +cids = 1; + userclean($username); +} +$COM = userinfo($username); +if(!$COM || ($COM['groupid'] < 5 && $COM['groupid'] > 1)) { + userclean($username); + $head_title = $head_name = $L['not_company']; + if($DT_BOT) dhttp(404, $DT_BOT); + $foot = 'channel'; + include template('com-notfound', 'message'); + exit; +} +if(!$COM['edittime'] || (!$COM['validated'] && $MOD['homecheck'])) { + if($DT_BOT) dhttp(404, $DT_BOT); + $head_title = $head_name = $COM['company']; + $foot = 'channel'; + include template('com-opening', 'message'); + exit; +} +$domain = $COM['domain']; +if($domain) { + if(!isset($preview) && !isset($update) && !isset($key)) { + if($CFG['com_domain']) { + if(strpos($DT_URL, $domain) === false) { + $subdomain = userurl($username); + if(strpos($DT_URL, $subdomain) === false) { + dheader('http://'.$domain.'/'); + } else { + if($DT_URL == $subdomain.'index.php' || $DT_URL == $subdomain) dheader('http://'.$domain.'/'); + dheader(str_replace($subdomain, 'http://'.$domain.'/', $DT_URL)); + } + } + } else { + if(strpos($DT_URL, $domain) === false) dheader(userurl($username, ($file && $file != 'homepage') ? 'file='.$file : '', $domain)); + } + } + $DT['rewrite'] = intval($CFG['com_rewrite']); +} +$userid = $COM['userid']; +$linkurl = userurl($username, '', $domain); +$clean = 0; +if($COM['linkurl'] != $linkurl) { + $COM['linkurl'] = $linkurl; + $db->query("UPDATE LOW_PRIORITY {$table} SET linkurl='$linkurl' WHERE userid=$userid", 'UNBUFFERED'); + $clean = 1; +} +if($MOD['delvip'] && $COM['vip'] && $COM['totime'] && $COM['totime'] < $DT_TIME) {//VIP Expired + $COM['vip'] = 0; + $COM['groupid'] = $gid = $COM['regid'] == 5 ? 5 : 6; + $COM['styleid'] = $COM['styletime'] = 0; + $db->query("UPDATE {$table} SET groupid=$gid,vip=0,styletime=0,styleid=0 WHERE userid=$userid"); + $db->query("UPDATE {$DT_PRE}member SET groupid=$gid WHERE userid=$userid"); + $clean = 1; +} +if($COM['styletime'] && $COM['styletime'] < $DT_TIME) {//SKIN Expired + $COM['styleid'] = $COM['styletime'] = 0; + $db->query("UPDATE {$table} SET styletime=0,styleid=0 WHERE userid=$userid"); + $clean = 1; +} +if($clean) userclean($username); +$COM['year'] = vip_year($COM['fromtime']); +$COMGROUP = cache_read('group-'.$COM['groupid'].'.php'); +if(!isset($COMGROUP['homepage']) || !$COMGROUP['homepage']) { + $head_title = $head_name = $COM['company']; + $head_keywords = $COM['keyword']; + $head_description = $COM['introduce']; + $member = $COM; + $content_table = content_table(4, $userid, is_file(DT_CACHE.'/4.part'), $DT_PRE.'company_data'); + $t = $db->get_one("SELECT content FROM {$content_table} WHERE userid=$userid", 'CACHE'); + $content = $t['content']; + $member['thumb'] = $member['thumb'] ? $member['thumb'] : DT_SKIN.'image/company.jpg'; + $could_comment = $COM['domain'] ? 0 : $MOD['comment']; + $itemid = $COM['userid']; + $title = $COM['company']; + $likes = $COM['likes']; + $hates = $COM['hates']; + $reports = $COM['reports']; + $favorites = $COM['favorites']; + $comments = $COM['comments']; + $shares = $COM['shares']; + include template('show', $module); + exit; +} +$api_map = ($MOD['map'] && $COMGROUP['map']) ? $MOD['map'] : ''; +$api_stats = ($MOD['stats'] && $COMGROUP['stats']) ? $MOD['stats'] : ''; +$api_kf = ($MOD['kf'] && $COMGROUP['kf']) ? $MOD['kf'] : ''; +isset($rewrite) or $rewrite = ''; +if($rewrite) { + $r = explode('-', $rewrite); + $rc = count($r); + if($rc%2 == 0) { + for($i = 0; $i < $rc; $i++) { + if(in_array($r[$i], array('itemid', 'typeid', 'page', 'view', 'kw', 'preview', 'update'))) { + ${$r[$i]} = $r[++$i]; + } else { + ++$i; + } + } + } + $page = isset($page) ? max(intval($page), 1) : 1; + $catid = isset($catid) ? intval($catid) : 0; + $itemid = isset($itemid) ? (is_array($itemid) ? $itemid : intval($itemid)) : 0; + $kw = isset($kw) ? strip_kw($kw, $DT['max_kw']) : ''; + if(strlen($kw) < $DT['min_kw'] || strlen($kw) > $DT['max_kw']) $kw = ''; + $keyword = $kw ? str_replace(array(' ', '*'), array('%', '%'), $kw) : ''; +} +include load('homepage.lang'); +in_array($file, $MFILE) or dheader($MOD['linkurl']); +if($COMGROUP['menu_d']) { + $_menu_show = array(); + foreach($HMENU as $k=>$v) { + $_menu_show[$k] = strpos(','.$COMGROUP['menu_d'].',', ','.$k.',') !== false ? 1 : 0; + } + $_menu_show = implode(',', $_menu_show); +} else { + $_menu_show = '1,1,1,1,1,1,1,1,0,0,0,0,0,0'; +} +$_menu_order = '0,10,20,30,40,50,60,70,80,90,100,110,120,130,140'; +$_menu_num = '1,16,30,30,10,30,1,12,12,12,12,30,12,1,12'; +$_menu_file = implode(',' , $MFILE); +$_menu_name = implode(',' , $HMENU); + +if($COMGROUP['side_d']) { + $_side_show = array(); + foreach($HSIDE as $k=>$v) { + $_side_show[$k] = strpos(','.$COMGROUP['side_d'].',', ','.$k.',') !== false ? 1 : 0; + } + $_side_show = implode(',', $_side_show); +} else { + $_side_show = '1,1,1,0,1,0,1'; +} +$_side_order = '0,10,20,30,40,50,60'; +$_side_num = '1,5,10,1,1,5,5'; +$_side_file = implode(',' , $SFILE); +$_side_name = implode(',' , $HSIDE); + +$HOME = get_company_setting($COM['userid'], '', 'CACHE'); + +$menu_show = explode(',', isset($HOME['menu_show']) ? $HOME['menu_show'] : $_menu_show); +$menu_order = explode(',', isset($HOME['menu_order']) ? $HOME['menu_order'] : $_menu_order); +$menu_num = explode(',', isset($HOME['menu_num']) ? $HOME['menu_num'] : $_menu_num); +$menu_file = explode(',', isset($HOME['menu_file']) ? $HOME['menu_file'] : $_menu_file); +$menu_name = explode(',', isset($HOME['menu_name']) ? $HOME['menu_name'] : $_menu_name); +$_HMENU = array(); +asort($menu_order); +foreach($menu_order as $k=>$v) { + $_HMENU[$k] = $HMENU[$k]; +} +$HMENU = $_HMENU; + +$MENU = array(); +$menuid = 0; +foreach($HMENU as $k=>$v) { + if($menu_show[$k] && in_array($menu_file[$k], $MFILE)) { + $MENU[$k]['name'] = $menu_name[$k]; + $MENU[$k]['file'] = $menu_file[$k]; + $MENU[$k]['linkurl'] = userurl($username, 'file='.$menu_file[$k], $domain); + } + if($file == $menu_file[$k]) $menuid = $k; + if($menu_num[$k] < 1 || $menu_num[$k] > 50) $menu_num[$k] = 10; +} + +isset($_MENU['introduce']) or $_MENU['introduce'] = $L['com_introduce']; +isset($_MENU['news']) or $_MENU['news'] = $L['com_news']; +isset($_MENU['credit']) or $_MENU['credit'] = $L['com_credit']; +isset($_MENU['contact']) or $_MENU['contact'] = $L['com_contact']; + +$side_show = explode(',', isset($HOME['side_show']) ? $HOME['side_show'] : $_side_show); +$side_order = explode(',', isset($HOME['side_order']) ? $HOME['side_order'] : $_side_order); +$side_num = explode(',', isset($HOME['side_num']) ? $HOME['side_num'] : $_side_num); +$side_file = explode(',', isset($HOME['side_file']) ? $HOME['side_file'] : $_side_file); +$side_name = explode(',', isset($HOME['side_name']) ? $HOME['side_name'] : $_side_name); +$_HSIDE = array(); +asort($side_order); +foreach($side_order as $k=>$v) { + if($side_show[$k] && in_array($side_file[$k], $SFILE)) { + $_HSIDE[$k] = $HSIDE[$k]; + } + if($side_num[$k] < 1 || $side_num[$k] > 50) $side_num[$k] = 10; +} +$HSIDE = $_HSIDE; +$side_pos = isset($HOME['side_pos']) && $HOME['side_pos'] ? 1 : 0; +$side_width = isset($HOME['side_width']) && $HOME['side_width'] ? $HOME['side_width'] : 200; +$show_stats = isset($HOME['show_stats']) && $HOME['show_stats'] == 0 ? 0 : 1; +$mstyle = 0; +$skin = 'default'; +$template = 'homepage'; +if($COM['styleid']) { + $t = $db->get_one("SELECT * FROM {$DT_PRE}style WHERE itemid=$COM[styleid]", 'CACHE'); + if($t) { + $skin = $t['skin']; + $template = $t['template']; + $mstyle = $t['mobile']; + } +} else if($COMGROUP['styleid']) { + $gsid = intval($COMGROUP['styleid']); + $t = $db->get_one("SELECT * FROM {$DT_PRE}style WHERE itemid=$gsid", 'CACHE'); + if($t) { + $skin = $t['skin']; + $template = $t['template']; + $mstyle = $t['mobile']; + } +} +if($file == 'homepage') { + $preview = isset($preview) ? intval($preview) : 0; + if($preview) { + $t = $db->get_one("SELECT * FROM {$DT_PRE}style WHERE itemid={$preview}", 'CACHE'); + if($t) { + $skin = $t['skin']; + $template = $t['template']; + $mstyle = $t['mobile']; + } + } +} +$bannert = isset($HOME['bannert']) ? $HOME['bannert'] : 0; +$banner = isset($HOME['banner']) ? $HOME['banner'] : ''; +$bannerf = isset($HOME['bannerf']) ? $HOME['bannerf'] : ''; +$banner1 = isset($HOME['banner1']) ? $HOME['banner1'] : ''; +$banner2 = isset($HOME['banner2']) ? $HOME['banner2'] : ''; +$banner3 = isset($HOME['banner3']) ? $HOME['banner3'] : ''; +$banner4 = isset($HOME['banner4']) ? $HOME['banner4'] : ''; +$banner5 = isset($HOME['banner5']) ? $HOME['banner5'] : ''; +$bannerlink1 = isset($HOME['bannerlink1']) ? $HOME['bannerlink1'] : ''; +$bannerlink2 = isset($HOME['bannerlink2']) ? $HOME['bannerlink2'] : ''; +$bannerlink3 = isset($HOME['bannerlink3']) ? $HOME['bannerlink3'] : ''; +$bannerlink4 = isset($HOME['bannerlink4']) ? $HOME['bannerlink4'] : ''; +$bannerlink5 = isset($HOME['bannerlink5']) ? $HOME['bannerlink5'] : ''; +if($bannert == 2) { + if($banner1) { + if(!$banner2) { + $bannert = 0; + $banner = $banner1; + } + } else { + $bannert = 0; + } +} else if($bannert == 1) { + if($bannerf) { + if(preg_match("/^(jpg|jpeg|gif|png|bmp)$/i", file_ext($bannerf))) { + $bannert = 0; + $banner = $bannert; + } + } else { + $bannert = 0; + } +} +$bannerw = (isset($HOME['bannerw']) && $HOME['bannerw']) ? intval($HOME['bannerw']) : 1200; +$bannerh = (isset($HOME['bannerh']) && $HOME['bannerh']) ? intval($HOME['bannerh']) : 300; +$could_comment = $domain ? 0 : $MOD['comment']; +$homeurl = $MOD['homeurl']; +$could_contact = check_group($_groupid, $MOD['group_contact']); +if($username == $_username || $domain) $could_contact = true; +$HSPATH = DT_STATIC.$MODULE[4]['moduledir'].'/skin/'.$skin.'/'; +if(!$banner) $banner = is_file(DT_ROOT.'/'.$MODULE[4]['moduledir'].'/skin/'.$skin.'/banner.jpg') ? $HSPATH.'banner.jpg' : ''; +$background = isset($HOME['background']) ? $HOME['background'] : ''; +$bgcolor = isset($HOME['bgcolor']) ? $HOME['bgcolor'] : ''; +$logo = isset($HOME['logo']) ? $HOME['logo'] : ''; +$video = isset($HOME['video']) ? $HOME['video'] : ''; +$css = isset($HOME['css']) ? $HOME['css'] : ''; +$announce = isset($HOME['announce']) ? $HOME['announce'] : ''; +$map = isset($HOME['map']) ? $HOME['map'] : ''; +$stats = isset($HOME['stats']) ? $HOME['stats'] : ''; +$kf = isset($HOME['kf']) ? $HOME['kf'] : ''; +$comment_proxy = ''; +if($domain) { + $comment_proxy = 'http://'.$domain.'/'; +} else { + if($CFG['com_domain']) { + $comment_proxy = $linkurl; + $comment_proxy = substr($CFG['com_domain'], 0, 1) == '.' ? $linkurl : 'http://'.$CFG['com_domain'].'/'; + } else { + $comment_proxy = DT_PATH; + } +} +$comment_proxy = encrypt($comment_proxy, DT_KEY.'PROXY'); +$album_js = 0; +$head_title = $head_name = isset($MENU[$menuid]) ? $MENU[$menuid]['name'] : $_MENU[$file]; +$seo_keywords = isset($HOME['seo_keywords']) ? $HOME['seo_keywords'] : ''; +$seo_description = isset($HOME['seo_description']) ? $HOME['seo_description'] : ''; +$head_keywords = strip_tags($seo_keywords ? $seo_keywords : $COM['company'].','.str_replace('|', ',', $COM['business'])); +$head_description = strip_tags($seo_description ? $seo_description : $COM['introduce']); +if(!$DT_BOT && $MOD['hits']) { + if($DT['cache_hits']) { + cache_hits($moduleid, $userid); + } else { + $db->query("UPDATE LOW_PRIORITY {$table} SET hits=hits+1 WHERE userid=$userid", 'UNBUFFERED'); + } +} +include DT_ROOT.'/module/company/'.$file.'.inc.php'; +?> \ No newline at end of file diff --git a/module/company/mall.inc.php b/module/company/mall.inc.php new file mode 100644 index 0000000..d4b51cd --- /dev/null +++ b/module/company/mall.inc.php @@ -0,0 +1,144 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + if(!$item || $item['status'] < 3 || $item['username'] != $username) dheader($MENU[$menuid]['linkurl']); + unset($item['template']); + require DT_ROOT.'/include/content.class.php'; + extract($item); + $CAT = get_cat($catid); + $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); + $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); + $content = $t['content']; + $content = DC::format($content, $DT_PC); + $CP = $MOD['cat_property'] && $CAT['property']; + if($CP) { + require DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); + } + require DT_ROOT.'/module/'.$module.'/global.func.php'; + $RL = $relate_id ? get_relate($item) : array(); + $P1 = get_nv($n1, $v1); + $P2 = get_nv($n2, $v2); + $P3 = get_nv($n3, $v3); + if($step) { + @extract(unserialize($step), EXTR_SKIP); + $mode = 2; + } else { + $a1 = 1; + $p1 = $item['price']; + $a2 = $a3 = $p2 = $p3 = ''; + $mode = $prices ? 1 : 0; + } + $stocks = ''; + if($stock) { + $stocks = json_encode(get_stocks($stock)); + $mode = 3; + } + if($subtext && $sublink) { + if(strpos($subtitle, $subtext) === false) { + $subtitle .= ''.$subtext.''; + } else { + $subtitle = str_replace($subtext, ''.$subtext.'', $subtitle); + } + } + $unit or $unit = $L['unit']; + $adddate = timetodate($addtime, 3); + $editdate = timetodate($edittime, 3); + $linkurl = $MOD['linkurl'].$linkurl; + $albums = get_albums($item); + $pics = count($albums); + $pics_width = $pics*70; + $promos = get_promos($username); + $album_js = 1; + $typeid = $mycatid; + $update = ''; + $sku_amount = get_amount($item); + if($sku_amount != $amount) { + $amount = $sku_amount; + $update .= ",amount=$amount"; + } + if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php'; + $head_canonical = $linkurl; + $head_title = $title.$DT['seo_delimiter'].$head_title; + $head_keywords = $keyword; + $head_description = $introduce ? $introduce : $title; + if($DT_PC) { + // + } else { + $member = array(); + $fee = DC::fee($item['fee'], $MOD['fee_view']); + include DT_ROOT.'/mobile/api/contact.inc.php'; + $js_item = $js_album = 1; + $foot = ''; + } +} else { + $typeid = isset($typeid) ? intval($typeid) : 0; + $view = isset($view) ? 1 : 0; + $url = "file=$file"; + $condition = "username='$username' AND status=3"; + if($typeid) { + if($TYPE[$typeid]['parentid']) { + $condition .= " AND mycatid='$typeid'"; + } else { + $cids = $typeid.','; + foreach($TYPE as $k=>$v) { + if($v['parentid'] == $typeid) $cids .= $k.','; + } + $cids = substr($cids, 0, -1); + $condition .= " AND mycatid IN ($cids)"; + } + $url .= "&typeid=$typeid"; + $head_title = $TYPE[$typeid]['typename'].$DT['seo_delimiter'].$head_title; + } + if($kw) { + $condition .= match_kw('keyword', $keyword); + $url .= "&kw=$kw"; + $head_title = $kw.$DT['seo_delimiter'].$head_title; + } + if($view) { + $url .= "&view=$view"; + } + if($elite) $condition .= " AND elite>0"; + $demo_url = $action == 'search' ? '' : userurl($username, $url.'&page={destoon_page}', $domain); + $pagesize = intval($menu_num[$menuid]); + if(!$pagesize || $pagesize > 100) $pagesize = 16; + if($view) $pagesize = ceil($pagesize/2); + $offset = ($page-1)*$pagesize; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = $DT_PC ? home_pages($items, $page, $pagesize, $demo_url) : mobile_pages($items, $page, $pagesize, $demo_url); + $lists = array(); + if($items) { + $order = 'edittime DESC'; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if($kw) $r['title'] = str_replace($kw, ''.$kw.'', $r['title']);; + $r['linkurl'] = $homeurl ? ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$r['linkurl'] : userurl($username, "file=$file&itemid=$r[itemid]", $domain); + $lists[] = $r; + } + $db->free_result($result); + } + if($DT_PC) { + // + } else { + $tags = $lists; + if($typeid) $head_name = $TYPE[$typeid]['typename']; + } +} +include template('mall', $template); +?> \ No newline at end of file diff --git a/module/company/search.inc.php b/module/company/search.inc.php new file mode 100644 index 0000000..bd3e79f --- /dev/null +++ b/module/company/search.inc.php @@ -0,0 +1,129 @@ + $DT['max_kw']) message(lang($L['word_limit'], array($DT['min_kw'], $DT['max_kw'])), $MOD['linkurl'].'search.php'); + if($DT['search_limit'] && $page == 1) { + if(($DT_TIME - $DT['search_limit']) < get_cookie('last_search')) message(lang($L['time_limit'], array($DT['search_limit'])), $MOD['linkurl'].'search.php'); + set_cookie('last_search', $DT_TIME); + } + } + $fds = $MOD['fields']; + $condition = "groupid>5 AND catids<>''"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($mode) $condition .= match_kw('mode', $modes[$mode]); + if($type) $condition .= " AND type='$types[$type]'"; + if($size) $condition .= " AND size='$sizes[$size]'"; + if($catid) $condition .= " AND catids LIKE '%,".$catid.",%'"; + if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($thumb) $condition .= " AND thumb<>''"; + if($vip) $condition .= $vip == 1 ? " AND vip>0" : " AND vip=$vip-1"; + if($mincapital) $condition .= " AND capital>$mincapital"; + if($maxcapital) $condition .= " AND capital<$maxcapital"; + $pagesize = $MOD['pagesize']; + $offset = ($page-1)*$pagesize; + $items = $db->count($table, $condition, $DT['cache_search']); + $pages = pages($items, $page, $pagesize); + if($items) { + $order = $MOD['order'] ? " ORDER BY ".$MOD['order'] : ''; + $result = $db->query("SELECT {$fds} FROM {$table} WHERE {$condition}{$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + if($kw) { + $replacef = explode(' ', $kw); + $replacet = array_map('highlight', $replacef); + } + while($r = $db->fetch_array($result)) { + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + if($kw) $r['company'] = str_replace($replacef, $replacet, $r['company']); + $tags[] = $r; + } + $db->free_result($result); + } + } + if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); + $showpage = 1; + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + if($kw) { + check_group($_groupid, $MOD['group_search']) or message($L['msg_no_search']); + } else if($catid) { + $CAT or message($L['msg_not_cate']); + if(!check_group($_groupid, $MOD['group_list']) || !check_group($_groupid, $CAT['group_list'])) message($L['msg_no_right']); + } else { + check_group($_groupid, $MOD['group_index']) or message($L['msg_no_right']); + } + $head_title = $MOD['name'].$DT['seo_delimiter'].$head_title; + if($kw) $head_title = $kw.$DT['seo_delimiter'].$head_title; + if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) { + $areaid = $cityid; + $ARE = get_area($areaid); + } + $elite = isset($elite) ? intval($elite) : 0; + (isset($orderby) && in_array($orderby, array('dhits', 'dcomments', 'dvip', 'avip'))) or $orderby = ''; + $tags = array(); + if($DT_QST) { + $condition = "groupid>5"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= " AND catids like '%,".$catid.",%'"; + if($areaid) $condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($elite) $condition .= " AND level>0"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize); + if($items) { + $order = $MOD['order']; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + if($kw) $r['company'] = str_replace($kw, ''.$kw.'', $r['company']); + $tags[] = $r; + } + $db->free_result($result); + $js_load = preg_replace("/(.*)([&?]page=[0-9]*)(.*)/i", "\\1\\3", rewrite($DT_URL, 1)).'&job=ajax'; + } + if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); + } + if($job == 'ajax') { + if($tags) include template('list-'.$module, 'tag'); + exit; + } + $head_title = $MOD['name'].$L['search']; +} +$seo_file = 'search'; +include DT_ROOT.'/include/seo.inc.php'; +include template($MOD['template_search'] ? $MOD['template_search'] : 'search', $module); +?> \ No newline at end of file diff --git a/module/down/admin/config.inc.php b/module/down/admin/config.inc.php new file mode 100644 index 0000000..4843a2d --- /dev/null +++ b/module/down/admin/config.inc.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/module/down/admin/remkdir.inc.php b/module/down/admin/remkdir.inc.php new file mode 100644 index 0000000..d697950 --- /dev/null +++ b/module/down/admin/remkdir.inc.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/module/down/admin/setting.inc.php b/module/down/admin/setting.inc.php new file mode 100644 index 0000000..c0d7609 --- /dev/null +++ b/module/down/admin/setting.inc.php @@ -0,0 +1,50 @@ +$v) { + if(strpos($k, 'seo_') === false) continue; + seo_check($v) or msg('SEO信息包含非法字符'); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) { + $_MOD = $MOD; + $MOD = $setting; + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + while($r = $db->fetch_array($result)) { + update_category($r); + } + cache_category($moduleid); + $MOD = $_MOD; + } + if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + $r = $db->get_one("SELECT MAX(itemid) AS maxid FROM {$table}"); + $maxid = $r['maxid']; + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/down/admin/template/index.tpl.php b/module/down/admin/template/index.tpl.php new file mode 100644 index 0000000..c7947e2 --- /dev/null +++ b/module/down/admin/template/index.tpl.php @@ -0,0 +1,153 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + + + +
分类图片标题大小会员下载 浏览 点赞 反对 收藏 打赏 赏金 分享 举报 评论 操作
+
+ + + + + +
+更新:
+添加: +
+
+
+ + + + + + +  + +
+ +
+ + + +  +  +  +  + + + + +  + + + + +  +  + + + + +  +  +  +  +  +
+
+'.$pages.'' : '';?> +
+ + \ No newline at end of file diff --git a/module/down/common.inc.php b/module/down/common.inc.php new file mode 100644 index 0000000..3f748b1 --- /dev/null +++ b/module/down/common.inc.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/module/down/global.func.php b/module/down/global.func.php new file mode 100644 index 0000000..ae8d134 --- /dev/null +++ b/module/down/global.func.php @@ -0,0 +1,25 @@ +'; + if($title) $select .= ''; + foreach($FILETYPE as $k=>$v) { + $select .= ''; + } + $select .= ''; + return $select; +} + +function unit_select($name, $value, $extend = '') { + $UNIT = array('K', 'M', 'G', 'T'); + $value or $value = 'M'; + $select = ''; + return $select; +} +?> \ No newline at end of file diff --git a/module/down/index.html b/module/down/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/down/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/exhibit/admin/config.inc.php b/module/exhibit/admin/config.inc.php new file mode 100644 index 0000000..62b8316 --- /dev/null +++ b/module/exhibit/admin/config.inc.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/module/exhibit/admin/install.inc.php b/module/exhibit/admin/install.inc.php new file mode 100644 index 0000000..6fa1426 --- /dev/null +++ b/module/exhibit/admin/install.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/module/exhibit/admin/setting.inc.php b/module/exhibit/admin/setting.inc.php new file mode 100644 index 0000000..c0d7609 --- /dev/null +++ b/module/exhibit/admin/setting.inc.php @@ -0,0 +1,50 @@ +$v) { + if(strpos($k, 'seo_') === false) continue; + seo_check($v) or msg('SEO信息包含非法字符'); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) { + $_MOD = $MOD; + $MOD = $setting; + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + while($r = $db->fetch_array($result)) { + update_category($r); + } + cache_category($moduleid); + $MOD = $_MOD; + } + if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + $r = $db->get_one("SELECT MAX(itemid) AS maxid FROM {$table}"); + $maxid = $r['maxid']; + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/exhibit/common.inc.php b/module/exhibit/common.inc.php new file mode 100644 index 0000000..6f47430 --- /dev/null +++ b/module/exhibit/common.inc.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/module/exhibit/exhibit.class.php b/module/exhibit/exhibit.class.php new file mode 100644 index 0000000..4b63a33 --- /dev/null +++ b/module/exhibit/exhibit.class.php @@ -0,0 +1,285 @@ +moduleid = $moduleid; + $this->table = $table; + $this->table_data = $table_data; + $this->split = $MOD['split']; + $this->fields = array('catid','areaid','level','title','style','fee','introduce','fromtime','totime','city','address','postcode','homepage','hallname','remark','thumb','sponsor','undertaker','truename','addr','telephone','mobile','fax','email','qq','wx','sign','status','hits','username','addtime','editor','edittime','ip','template','linkurl','filepath','note'); + } + + function exhibit($moduleid) { + $this->__construct($moduleid); + } + + function pass($post) { + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_catid')); + if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); + if(!$post['fromtime'] || !is_time($post['fromtime'])) return $this->_(lang('message->pass_exhibit_fromdate')); + if(!$post['totime'] || !is_time($post['totime'])) return $this->_(lang('message->pass_exhibit_todate')); + if(datetotime($post['fromtime']) > datetotime($post['totime'])) return $this->_(lang('message->pass_exhibit_baddate')); + if(!$post['address']) return $this->_(lang('message->pass_exhibit_address')); + if(!$post['hallname']) return $this->_(lang('message->pass_exhibit_hallname')); + if(!$post['sponsor']) return $this->_(lang('message->pass_exhibit_sponsor')); + if(!$post['truename']) return $this->_(lang('message->pass_truename')); + if(!$post['telephone']) return $this->_(lang('message->pass_telephone')); + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $AREA, $_username, $_userid, $_cname; + $AREA or $AREA = cache_read('area.php'); + $post['city'] or $post['city'] = $post['areaid'] ? $AREA[$post['areaid']]['areaname'] : ''; + is_url($post['thumb']) or $post['thumb'] = ''; + $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; + $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? datetotime($post['addtime']) : DT_TIME; + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['fromtime'] = datetotime($post['fromtime']); + $post['totime'] = datetotime($post['totime']); + $post['homepage'] = fix_link($post['homepage']); + $post['sign'] = $post['sign'] ? 1 : 0; + $post['fee'] = dround($post['fee']); + $post['content'] = stripslashes($post['content']); + $post['content'] = save_local($post['content']); + if($MOD['clear_link']) $post['content'] = clear_link($post['content']); + if($MOD['save_remotepic']) $post['content'] = save_remote($post['content']); + if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); + if($this->itemid) { + $new = $post['content']; + if($post['thumb']) $new .= ''; + $r = $this->get_one(); + $old = $r['content']; + if($r['thumb']) $old .= ''; + delete_diff($new, $old); + } else { + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['fromdate'] = timetodate($r['fromtime'], 3); + $r['todate'] = timetodate($r['totime'], 3); + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['process'] = get_process($r['fromtime'], $r['totime']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) { + credit_add($post['username'], $MOD['credit_add']); + credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'], $this->itemid); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')).','.$item['city'].','.$item['sponsor']; + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $item['itemid'] = $itemid; + $linkurl = itemurl($item); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + } + if($all) { + $userid = get_user($r['username']); + if($r['thumb']) delete_upload($r['thumb'], $userid); + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + } + } + } + + function check($itemid) { + global $_username, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + $this->itemid = $itemid; + $item = $this->get_one(); + if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { + credit_add($item['username'], $MOD['credit_add']); + credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid"); + history($this->moduleid, $itemid, 'del'); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/exhibit/index.inc.php b/module/exhibit/index.inc.php new file mode 100644 index 0000000..a9557eb --- /dev/null +++ b/module/exhibit/index.inc.php @@ -0,0 +1,41 @@ + 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); +?> \ No newline at end of file diff --git a/module/exhibit/show.htm.php b/module/exhibit/show.htm.php new file mode 100644 index 0000000..167712b --- /dev/null +++ b/module/exhibit/show.htm.php @@ -0,0 +1,71 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3) return false; +require_once DT_ROOT.'/include/content.class.php'; +$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; +extract($item); +$CAT = get_cat($catid); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_content = $t['content']; +if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, 1); +} +$CP = $MOD['cat_property'] && $CAT['property']; +if($CP) { + require_once DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); +} +$process = get_process($fromtime, $totime); +$fromdate = timetodate($fromtime, 3); +$todate = timetodate($totime, 3); +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$fileurl = $linkurl; +$linkurl = $MOD['linkurl'].$linkurl; +$maincat = get_maincat(0, $moduleid); +$fee = DC::fee($item['fee'], $MOD['fee_view']); +if($fee) { + $description = DC::description($content, $MOD['pre_view']); + $user_status = 4; +} else { + $user_status = 3; +} +$seo_file = 'show'; +include DT_ROOT.'/include/seo.inc.php'; +$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); +$destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid"; +if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); +$DT_PC = $GLOBALS['DT_PC'] = 1; +ob_start(); +include template($template, $module); +$data = ob_get_contents(); +ob_clean(); +$filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.$fileurl; +if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); +file_put($filename, $data); +if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = $linkurl; + $could_sign = ($sign && $process == 1 && $user_status == 3 && $username) ? 1 : 0; + $head_title = $head_name = $CAT['catname']; + $js_item = 1; + $foot = ''; + if($_content) { + $content = $_content; + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); + $content = DC::format($content, 0); + } + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put(str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename), $data); +} +return true; +?> \ No newline at end of file diff --git a/module/exhibit/sign.inc.php b/module/exhibit/sign.inc.php new file mode 100644 index 0000000..851e77b --- /dev/null +++ b/module/exhibit/sign.inc.php @@ -0,0 +1,71 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +$item or message($L['not_exists']); +if($item['fromtime'] && $DT_TIME > $item['fromtime']) message($L['has_started']); +if($item['totime'] && $DT_TIME > $item['totime']) message($L['has_expired']); +$item['status'] == 3 or message($L['not_exists']); +$item['username'] or message($L['com_not_member']); +$_username != $item['username'] or message($L['sign_self']); + +$today = $DT_TODAY - 86400; +$sql = $_userid ? "username='$_username'" : "addtime>$today AND ip='$DT_IP'"; +$t = $db->get_one("SELECT id FROM {$table_sign} WHERE id=$itemid AND $sql"); +if($t) message($L['sign_again']); + +$linkurl = $MOD['linkurl'].$item['linkurl']; +$need_captcha = $MOD['captcha_sign'] == 2 ? $MG['captcha'] : $MOD['captcha_sign']; +require DT_ROOT.'/include/post.func.php'; + +if($submit) { + captcha($captcha, $need_captcha); + $amount = intval($amount); + if($amount < 1) $amount = 1; + $company = dhtmlspecialchars($company); + $truename = dhtmlspecialchars($truename); + if(strlen($truename) < 6) message($L['msg_type_truename']); + if(!is_mobile($mobile)) message($L['msg_type_mobile']); + $areaid = intval($areaid); + $address = dhtmlspecialchars($address); + preg_match("/^[0-9]{6}$/", $postcode) or $postcode = ''; + is_email($email) or $email = ''; + is_qq($qq) or $qq = ''; + is_wx($wx) or $wx = ''; + $content = dhtmlspecialchars($content); + $user = $item['username']; + $title = addslashes($item['title']); + $db->query("INSERT INTO {$table_sign} (id,user,title,amount,company,truename,mobile,areaid,address,postcode,email,qq,wx,content,addtime,username,ip) VALUES ('$itemid','$user','$title','$amount','$company','$truename','$mobile','$areaid','$address','$postcode','$email','$qq','$wx','$content','$DT_TIME','$_username','$DT_IP')"); + $db->query("UPDATE {$table} SET orders=orders+1 WHERE itemid=$itemid"); + $forward = $DT_PC ? $linkurl : str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); + message($L['msg_sign_success'], $forward, 3); +} +if($_userid) { + $user = userinfo($_username); + $company = $user['company']; + $truename = $user['truename']; + $mobile = $user['mobile']; + $areaid = $user['areaid']; + $address = $user['address']; + $postcode = $user['postcode']; + $email = $user['mail'] ? $user['mail'] : $user['email']; + $qq = $user['qq']; + $wx = $user['wx']; +} else { + $company = $truename = $mobile = $areaid = $address = $postcode = $email = $qq = $wx = ''; +} +$head_title = $L['sign_title']; +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + $forward = $MOD['mobile'].$item['linkurl']; + $head_name = $L['sign_title']; + if($sns_app) $seo_title = $MOD['name']; + $js_pull = 0; + $foot = ''; +} +include template($MOD['template_sign'] ? $MOD['template_sign'] : 'sign', $module); +?> \ No newline at end of file diff --git a/module/extend/admin/comment.inc.php b/module/extend/admin/comment.inc.php new file mode 100644 index 0000000..f35242f --- /dev/null +++ b/module/extend/admin/comment.inc.php @@ -0,0 +1,107 @@ + 9 ? " AND level>0" : " AND level=$level"; + if($fromtime) $condition .= " AND addtime>=$fromtime"; + if($totime) $condition .= " AND addtime<=$totime"; +} +switch($action) { + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($do->get_one()); + $menuid = $status == 2 ? 2 : 1; + $addtime = timetodate($addtime); + $replytime = timetodate($replytime); + include tpl('comment_edit', $module); + } + break; + case 'ban': + if($submit) { + $do->ban_update($post); + dmsg('保存成功', '?moduleid='.$moduleid.'&file='.$file.'&action=ban&page='.$page); + } else { + $condition = 1; + if($mid) $condition = "moduleid=$mid"; + $lists = $do->get_ban_list($condition); + include tpl('comment_ban', $module); + } + break; + case 'delete': + $itemid or msg('请选择评论'); + $do->delete($itemid); + dmsg('删除成功', $forward); + break; + case 'level': + $itemid or msg('请选择评论'); + $level = intval($level); + $do->level($itemid, $level); + dmsg('级别设置成功', $forward); + break; + case 'check': + if($itemid) { + $status = $status == 3 ? 3 : 2; + $do->check($itemid, $status); + dmsg($status == 3 ? '审核成功' : '取消成功', $forward); + } else { + $lists = $do->get_list('status=2'.$condition, $dorder[$order]); + $menuid = 2; + include tpl('comment', $module); + } + break; + default: + $lists = $do->get_list('status=3'.$condition, $dorder[$order]); + $menuid = 1; + include tpl('comment', $module); + break; +} +?> \ No newline at end of file diff --git a/module/extend/admin/gift.inc.php b/module/extend/admin/gift.inc.php new file mode 100644 index 0000000..e4e0551 --- /dev/null +++ b/module/extend/admin/gift.inc.php @@ -0,0 +1,161 @@ +pass($post)) { + $do->add($post); + dmsg('添加成功', $forward); + } else { + msg($do->errmsg); + } + } else { + foreach($do->fields as $v) { + isset($$v) or $$v = ''; + } + $maxorder = 1; + $groupid = '5,6,7'; + $addtime = timetodate($DT_TIME); + $typeid = 0; + $menuid = 0; + include tpl('gift_edit', $module); + } + break; + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($do->get_one()); + $addtime = timetodate($addtime); + $fromtime = $fromtime ? timetodate($fromtime) : ''; + $totime = $totime ? timetodate($totime) : ''; + $menuid = 1; + include tpl('gift_edit', $module); + } + break; + case 'html': + $all = (isset($all) && $all) ? 1 : 0; + $one = (isset($one) && $one) ? 1 : 0; + if(!isset($num)) { + $num = 50; + } + if(!isset($fid)) { + $r = $db->get_one("SELECT min(itemid) AS fid FROM {$DT_PRE}gift"); + $fid = $r['fid'] ? $r['fid'] : 0; + } + isset($sid) or $sid = $fid; + if(!isset($tid)) { + $r = $db->get_one("SELECT max(itemid) AS tid FROM {$DT_PRE}gift"); + $tid = $r['tid'] ? $r['tid'] : 0; + } + if($fid <= $tid) { + $result = $db->query("SELECT itemid,linkurl FROM {$DT_PRE}gift WHERE itemid>=$fid ORDER BY itemid LIMIT 0,$num"); + if($db->affected_rows($result)) { + while($r = $db->fetch_array($result)) { + $itemid = $r['itemid']; + $linkurl = $do->linkurl($itemid); + if($linkurl != $r['linkurl']) $db->query("UPDATE {$DT_PRE}gift SET linkurl='$linkurl' WHERE itemid=$itemid"); + } + $itemid += 1; + } else { + $itemid = $fid + $num; + } + } else { + if($all) dheader("?moduleid=3&file=vote&action=html&all=1&one=$one"); + dmsg('更新成功', "?moduleid=$moduleid&file=$file"); + } + msg('ID从'.$fid.'至'.($itemid-1).'[礼品]更新成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$itemid&tid=$tid&num=$num&all=$all&one=$one"); + break; + case 'delete': + $itemid or msg('请选择礼品'); + $do->delete($itemid); + dmsg('删除成功', $forward); + break; + case 'level': + $itemid or msg('请选择礼品'); + $level = intval($level); + $do->level($itemid, $level); + dmsg('级别设置成功', $forward); + break; + case 'order': + if($submit) { + $do->update_order($post); + dmsg('删除成功', $forward); + } else { + $sfields = array('按条件', '礼品', '会员名', '快递', '单号', '状态', '备注'); + $dfields = array('g.title','g.title','o.username','o.express','o.expressid','o.status','o.note'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + isset($datetype) && in_array($datetype, array('edittime', 'addtime')) or $datetype = 'edittime'; + (isset($fromdate) && is_time($fromdate)) or $fromdate = ''; + $fromtime = $fromdate ? datetotime($fromdate) : 0; + (isset($todate) && is_time($todate)) or $todate = ''; + $totime = $todate ? datetotime($todate) : 0; + $fields_select = dselect($sfields, 'fields', '', $fields); + $condition = "1"; + if($itemid) $condition .= " AND o.itemid=$itemid"; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($fromtime) $condition .= " AND o.`{$datetype}`>=$fromtime"; + if($totime) $condition .= " AND o.`{$datetype}`<=$totime"; + $lists = $do->get_list_order($condition); + include tpl('gift_order', $module); + } + break; + case 'order_show': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + $do->update_order($post); + dmsg('保存成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&itemid='.$itemid); + } else { + extract($do->get_one_order()); + $itemid = $oid; + $_MOD = cache_read('module-2.php'); + $send_types = explode('|', trim($_MOD['send_types'])); + $addtime = timetodate($addtime); + $menuid = 2; + include tpl('gift_order_show', $module); + } + break; + default: + $sfields = array('按条件', '标题', '内容'); + $dfields = array('title','title','content'); + $sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '订单数量降序', '订单数量升序', '浏览次数降序', '浏览次数升序', '开始时间降序', '开始时间升序', '到期时间降序', '到期时间升序', '礼品积分降序', '礼品积分升序', '库存数量降序', '库存数量升序'); + $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'orders DESC', 'orders ASC', 'hits DESC', 'hits ASC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC', 'credit DESC', 'credit ASC', 'amount DESC', 'amount ASC'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + isset($order) && isset($dorder[$order]) or $order = 0; + isset($typeid) or $typeid = 0; + $level = isset($level) ? intval($level) : 0; + $fields_select = dselect($sfields, 'fields', '', $fields); + $type_select = type_select('gift', 1, 'typeid', '请选择分类', $typeid); + $order_select = dselect($sorder, 'order', '', $order); + $level_select = level_select('level', '级别', $level, 'all'); + $condition = '1'; + if($_areaids) $condition .= " AND areaid IN (".$_areaids.")";//CITY + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($typeid) $condition .= " AND typeid IN (".type_child($typeid, $TYPE).")"; + if($level) $condition .= $level > 9 ? " AND level>0" : " AND level=$level"; + if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + $lists = $do->get_list($condition, $dorder[$order]); + include tpl('gift', $module); + break; +} +?> \ No newline at end of file diff --git a/module/extend/admin/guestbook.inc.php b/module/extend/admin/guestbook.inc.php new file mode 100644 index 0000000..6a805c0 --- /dev/null +++ b/module/extend/admin/guestbook.inc.php @@ -0,0 +1,75 @@ +=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; + if($mid) $condition .= " AND mid='$mid'"; + if($tid) $condition .= " AND tid='$tid'"; + if($rid) $condition .= " AND rid='$rid'"; +} +switch($action) { + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($do->get_one()); + $addtime = timetodate($addtime); + $edittime = timetodate($edittime); + include tpl('guestbook_edit', $module); + } + break; + case 'check': + $itemid or msg('请选择留言'); + $do->check($itemid, $status); + dmsg('设置成功', $forward); + break; + case 'delete': + $itemid or msg('请选择留言'); + $do->delete($itemid); + dmsg('删除成功', $forward); + break; + default: + $lists = $do->get_list($condition, $dorder[$order]); + include tpl('guestbook', $module); + break; +} +?> \ No newline at end of file diff --git a/module/extend/admin/menu.inc.php b/module/extend/admin/menu.inc.php new file mode 100644 index 0000000..bf0ac72 --- /dev/null +++ b/module/extend/admin/menu.inc.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/module/extend/admin/setting.inc.php b/module/extend/admin/setting.inc.php new file mode 100644 index 0000000..4a147c3 --- /dev/null +++ b/module/extend/admin/setting.inc.php @@ -0,0 +1,31 @@ +$v) { + if(strpos($k, '_domain') !== false && $v) $setting[$k] = fix_domain($v); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['show_url'] != $MOD['show_url']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/extend/admin/template/ad_list.tpl.php b/module/extend/admin/template/ad_list.tpl.php new file mode 100644 index 0000000..4001edd --- /dev/null +++ b/module/extend/admin/template/ad_list.tpl.php @@ -0,0 +1,93 @@ + + +
+ + + + + + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + +
排序ID广告类型广告名称费用 单位点击 开始时间 结束时间 剩余(天) 状态审核会员操作
 >待审核';?> +  +  + +
+
+  +  +
+
+'.$pages.'' : '';?> +
+ + \ No newline at end of file diff --git a/module/extend/admin/template/ad_runcode.tpl.php b/module/extend/admin/template/ad_runcode.tpl.php new file mode 100644 index 0000000..0854a35 --- /dev/null +++ b/module/extend/admin/template/ad_runcode.tpl.php @@ -0,0 +1,25 @@ + +
+
+ + + + + + + + + + + + + +
代码预览
[关闭窗口] 源代码
+
+
+ \ No newline at end of file diff --git a/module/extend/admin/template/comment_ban.tpl.php b/module/extend/admin/template/comment_ban.tpl.php new file mode 100644 index 0000000..c90de02 --- /dev/null +++ b/module/extend/admin/template/comment_ban.tpl.php @@ -0,0 +1,50 @@ + +
+ + + + + + + + + + + + + + +$v) { ?> + + + + + + + + + + + + + + + + + + + + + +
模块ID信息ID模块禁止时间操作人原文
打开
新增
     +     +     +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/extend/admin/template/comment_edit.tpl.php b/module/extend/admin/template/comment_edit.tpl.php new file mode 100644 index 0000000..f4bdc40 --- /dev/null +++ b/module/extend/admin/template/comment_edit.tpl.php @@ -0,0 +1,66 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 会员 /> 匿名评论
* IP -
* 原文
* 引用
请不要修改代码结构,仅可修改文字内容
* 评分 +/> +/> +/> +/> +/> +
* 内容
* 级别
* 回复
* 时间
* 状态 +/> 通过     +/> 待审 +
+
    
+
+ + \ No newline at end of file diff --git a/module/extend/admin/template/form.tpl.php b/module/extend/admin/template/form.tpl.php new file mode 100644 index 0000000..e9e15bb --- /dev/null +++ b/module/extend/admin/template/form.tpl.php @@ -0,0 +1,74 @@ + +
+ +
+
+ + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + +
ID分类标题状态 选项 回复 浏览 添加时间 操作
  +  +  +  + +
+
+  +
+
+'.$pages.'' : '';?> +
链接说明
+ + + + +
+   一般情况直接链接到表单网址,如果需要自定义参数来区分不同场景,可使用如下地址:
+   index.php?itemid=表单ID&item=参数
+   参数限制为a-z、A-Z、0-9、中划线(-)、下划线(_)的组合
+
+ + \ No newline at end of file diff --git a/module/extend/admin/template/form_question_copy.tpl.php b/module/extend/admin/template/form_question_copy.tpl.php new file mode 100644 index 0000000..e44e653 --- /dev/null +++ b/module/extend/admin/template/form_question_copy.tpl.php @@ -0,0 +1,60 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
* 复制方式 +      + +
* 表单ID
* 同名过滤 +      + +
+
+
+ + + \ No newline at end of file diff --git a/module/extend/admin/template/gift_edit.tpl.php b/module/extend/admin/template/gift_edit.tpl.php new file mode 100644 index 0000000..4e68d6a --- /dev/null +++ b/module/extend/admin/template/gift_edit.tpl.php @@ -0,0 +1,114 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 礼品分类
* 礼品标题  
* 标题图片 + + + + + + + + +
   
+ +
* 单价
* 库存
* 会员组
* 兑换次数
* 有效时间
* 详细说明 +
+
* 添加时间
* 地区(分站)
+
    
+
+ + + + \ No newline at end of file diff --git a/module/extend/admin/template/gift_order_show.tpl.php b/module/extend/admin/template/gift_order_show.tpl.php new file mode 100644 index 0000000..4fc4845 --- /dev/null +++ b/module/extend/admin/template/gift_order_show.tpl.php @@ -0,0 +1,65 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
礼品
下单
会员
快递 +  +  + + + + + +
状态 +  +  + + +
备注
+
    
+
+ + \ No newline at end of file diff --git a/module/extend/admin/template/link_check.tpl.php b/module/extend/admin/template/link_check.tpl.php new file mode 100644 index 0000000..96d5746 --- /dev/null +++ b/module/extend/admin/template/link_check.tpl.php @@ -0,0 +1,65 @@ + +
+
链接搜索
+ + + + + + + +
  +  +  + +  +  +  + +
+
+
+
审核链接
+ + + + + + + + + + +$v) {?> + + + + + + + + + + +
分类网站名称网站LOGO链接类型申请时间操作
+  + +
+
+  + +
+
+'.$pages.'' : '';?> +
+ + \ No newline at end of file diff --git a/module/extend/admin/template/poll.tpl.php b/module/extend/admin/template/poll.tpl.php new file mode 100644 index 0000000..5e996ec --- /dev/null +++ b/module/extend/admin/template/poll.tpl.php @@ -0,0 +1,66 @@ + +
+ +
+
+ + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + +
ID分类标题状态 选项 票数 浏览 添加时间 调用代码操作
  +  +  +  + +
+
+  +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/extend/admin/template/vote.tpl.php b/module/extend/admin/template/vote.tpl.php new file mode 100644 index 0000000..4e77197 --- /dev/null +++ b/module/extend/admin/template/vote.tpl.php @@ -0,0 +1,61 @@ + +
+ +
+
+ + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + +
ID分类 标题状态 票数 浏览 添加时间 操作
+  +  + +
+
+  +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/extend/admin/template/webpage.tpl.php b/module/extend/admin/template/webpage.tpl.php new file mode 100644 index 0000000..5436b72 --- /dev/null +++ b/module/extend/admin/template/webpage.tpl.php @@ -0,0 +1,62 @@ + +
+ +
+
+ + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + +
排序标题网址浏览 分组标识更新时间 操作
   +  + +
+
+  +  +  +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/extend/admin/template/webpage_edit.tpl.php b/module/extend/admin/template/webpage_edit.tpl.php new file mode 100644 index 0000000..f3d4de0 --- /dev/null +++ b/module/extend/admin/template/webpage_edit.tpl.php @@ -0,0 +1,93 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 单页标题    />
* 单页内容 +
+
* 保存路径 如不填写则生成在网站根目录,否则请以‘/’结尾,例如‘about/’
* 文件名称 如不填写则自动按ID生成文件名,例如‘page-1.html’
* 绑定域名那么可以绑定machine.xxx.com至machine目录
此处填写http://machine.xxx.com/');?>
* SEO标题
* SEO关键词
* SEO描述
* 地区(分站)
* 分组标识
* 内容模板
+
    
+
+ + + + \ No newline at end of file diff --git a/module/extend/attach.inc.php b/module/extend/attach.inc.php new file mode 100644 index 0000000..7b5caf9 --- /dev/null +++ b/module/extend/attach.inc.php @@ -0,0 +1,24 @@ + 15 or dheader($DT_PC ? DT_PATH : DT_MOB); +$ext = file_ext($url); +$ext or dheader($DT_PC ? DT_PATH : DT_MOB); +$name or dheader($url); +$ext == file_ext($name) or dheader($DT_PC ? DT_PATH : DT_MOB); +in_array($ext, array('rar', 'zip', 'gz', 'tar', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx')) or dheader($url); +$file = strpos($url, 'file/upload/') !== false ? cutstr($url, 'file/upload/') : str_replace($DT['remote_url'], '', $url); +preg_match("/^[0-9\-\/]{18,}$/", substr($file, 0, -strlen($ext)-1)) or dheader($url); +$localfile = DT_ROOT.'/file/upload/'.$file; +is_file($localfile) or dheader($url); +$title = substr($name, 0, -strlen($ext)-1); +$title = file_vname($title); +$title or dheader($url); +if(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) $title = str_replace(' ', '_', $title); +if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'rv:1') !== false) $title = convert($title, DT_CHARSET, 'GBK'); +$title or dheader($url); +file_down($localfile, $title.'.'.$ext); +?> \ No newline at end of file diff --git a/module/extend/comment.class.php b/module/extend/comment.class.php new file mode 100644 index 0000000..5c16012 --- /dev/null +++ b/module/extend/comment.class.php @@ -0,0 +1,183 @@ +table = DT_PRE.'comment'; + $this->table_stat = DT_PRE.'comment_stat'; + $this->table_ban = DT_PRE.'comment_ban'; + } + + function comment() { + $this->__construct(); + } + + function pass($post) { + global $L; + if(!is_array($post)) return false; + if(!$post['content']) return $this->_($L['comment_pass_content']); + return true; + } + + function set($post) { + global $_username; + $post['hidden'] = isset($post['hidden']) ? 1 : 0; + $post['status'] = $post['status'] == 3 ? 3 : 2; + $post['level'] = intval($post['level']); + $post['star'] = intval($post['star']); + in_array($post['star'], array(1, 2, 3, 4, 5)) or $post['star'] = 5; + if($post['reply']) $post['replytime'] = is_time($post['replytime']) ? strtotime($post['replytime']) : DT_TIME; + $post['editor'] = $_username; + $post = dhtmlspecialchars($post); + return array_map("trim", $post); + } + + function get_one() { + return DB::get_one("SELECT * FROM {$this->table} WHERE itemid='$this->itemid'"); + } + + function get_list($condition = 'status=3', $order = 'itemid DESC') { + global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $items; + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition"); + $items = $r['num']; + $pages = pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 6); + $r['replydate'] = $r['replytime'] ? timetodate($r['replytime'], 6) : ''; + if(strpos($r['content'], ')') !== false) $r['content'] = parse_face($r['content']); + if(strpos($r['quotation'], ')') !== false) $r['quotation'] = parse_face($r['quotation']); + $lists[] = $r; + } + return $lists; + } + + function edit($post) { + $post = $this->set($post); + $r = $this->get_one(); + if($r['star'] != $post['star']) { + $star = 'star'.$r['star']; + DB::query("UPDATE {$this->table_stat} SET `{$star}`=`{$star}`-1 WHERE itemid=$r[item_id] AND moduleid=$r[item_mid]"); + $star = 'star'.$post['star']; + DB::query("UPDATE {$this->table_stat} SET `{$star}`=`{$star}`+1 WHERE itemid=$r[item_id] AND moduleid=$r[item_mid]"); + } + $sql = ''; + foreach($post as $k=>$v) { + $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + return true; + } + + function delete($itemid) { + global $MOD, $L; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($r) { + $star = 'star'.$r['star']; + DB::query("UPDATE {$this->table_stat} SET comment=comment-1,`{$star}`=`{$star}`-1 WHERE itemid=$r[item_id] AND moduleid=$r[item_mid]"); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + if($r['username'] && $MOD['credit_del_comment']) { + credit_add($r['username'], -$MOD['credit_del_comment']); + credit_record($r['username'], -$MOD['credit_del_comment'], 'system', $L['comment_record_del'], 'ID:'.$r['itemid']); + } + } + } + } + + function check($itemid, $status = 3) { + global $MOD, $L; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->check($v, $status); + } + } else { + if($MOD['credit_add_comment'] && $status == 3) { + $this->itemid = $itemid; + $item = $this->get_one(); + if($item['username']) { + credit_add($item['username'], $MOD['credit_add_comment']); + credit_record($item['username'], $MOD['credit_add_comment'], 'system', $L['comment_record_add'], 'ID:'.$itemid); + } + } + DB::query("UPDATE {$this->table} SET status=$status WHERE itemid=$itemid"); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function get_ban_list($condition = '1') { + global $pages, $page, $pagesize, $offset, $pagesize, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table_ban} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = DB::query("SELECT * FROM {$this->table_ban} WHERE $condition ORDER BY bid DESC LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['edittime'] = timetodate($r['edittime'], 6); + $lists[] = $r; + } + return $lists; + } + + function ban_update($post) { + $this->_add($post[0]); + unset($post[0]); + foreach($post as $k=>$v) { + if(isset($v['delete'])) { + $this->_delete($k); + unset($post[$k]); + } + } + $this->_edit($post); + cache_bancomment(); + return true; + } + + function _add($post) { + global $_username; + $post['moduleid'] = intval($post['moduleid']); + $post['itemid'] = intval($post['itemid']); + if(!$post['moduleid'] || !$post['itemid']) return false; + DB::query("INSERT INTO {$this->table_ban} (moduleid,itemid,editor,edittime) VALUES('$post[moduleid]','$post[itemid]','$_username','".DT_TIME."')"); + } + + function _edit($post) { + foreach($post as $k=>$v) { + $v['moduleid'] = intval($v['moduleid']); + $v['itemid'] = intval($v['itemid']); + if(!$v['moduleid'] || !$v['itemid']) return false; + DB::query("UPDATE {$this->table_ban} SET moduleid='$v[moduleid]',itemid='$v[itemid]' WHERE bid='$k'"); + } + } + + function _delete($bid) { + DB::query("DELETE FROM {$this->table_ban} WHERE bid=$bid"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/extend/common.inc.php b/module/extend/common.inc.php new file mode 100644 index 0000000..0d6d5f4 --- /dev/null +++ b/module/extend/common.inc.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/module/extend/feed.inc.php b/module/extend/feed.inc.php new file mode 100644 index 0000000..be2c74b --- /dev/null +++ b/module/extend/feed.inc.php @@ -0,0 +1,44 @@ + 4 && isset($MODULE[$mid]) && !$MODULE[$mid]['islink']) { + $feed_code .= $MOD['feed_url'].'rss.php?mid='.$mid; + if($kw == $L['keyword']) $kw = ''; + if($kw && strlen($kw) > 2 && strlen($kw) < 30) $feed_code .= '&kw='.urlencode($kw); + if($catid) $feed_code .= '&catid='.urlencode($catid); + if($areaid) $feed_code .= '&areaid='.urlencode($areaid); + $category_select = category_select('catid', $L['category'], $catid, $mid); + if(in_array($MODULE[$mid]['module'], array('sell','buy', 'exhibit', 'info', 'job', 'mall', 'group'))) $area_select = ajax_area_select('areaid', $L['rss_area'], $areaid); + } +} else { + // +} +$template = $ext; +$head_title = $L['rss_title']; +$head_keywords = $head_description = ''; +if($DT_PC) { + $destoon_task = rand_task(); + if($EXT['mobile_enable']) $head_mobile = str_replace($url, $mob, $DT_URL); +} else { + $head_name = $L['rss_title']; + if($sns_app) $seo_title = $site_name; + $foot = ''; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/extend/form.inc.php b/module/extend/form.inc.php new file mode 100644 index 0000000..eeb591b --- /dev/null +++ b/module/extend/form.inc.php @@ -0,0 +1,169 @@ +itemid = $itemid; + $f = $do->get_one(); + $f or dheader($DT_PC ? $url : $mob); + unset($f['answer']); + require DT_ROOT.'/include/content.class.php'; + extract($f); + (isset($item) && preg_match("/^[a-z0-9_\-]{1,}$/i", $item)) or $item = ''; + $could_form = true; + $error = 0; + if($maxanswer) { + $condition = $_username ? "AND username='$_username'" : "AND ip='$DT_IP'"; + $num = $db->count($DT_PRE.'form_record', "fid=$itemid $condition"); + if($num >= $maxanswer) { + $could_form = false; + $error = 1; + } + } + if($fromtime && $DT_TIME < $fromtime) { + $could_form = false; + $error = 2; + } + if($totime && $DT_TIME > $totime) { + $could_form = false; + $error = 3; + } + if(!check_group($_groupid, $groupid)) { + $could_form = false; + $error = 4; + if(!$_userid && $groupid && strpos(','.$groupid.',', ',3,') === false) $error = 5; + } + if($submit) { + if($verify == 1) captcha($captcha, 1); + if($verify == 2) question($answer, 1); + if($could_form) { + $post = $other = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}form_question WHERE fid=$itemid ORDER BY listorder ASC,qid ASC LIMIT 100"); + while($r = $db->fetch_array($result)) { + $qid = $r['qid']; + $t = explode('-', $r['required']); + $r['min'] = isset($t[0]) ? intval($t[0]) : 0; + $r['max'] = isset($t[1]) ? intval($t[1]) : 0; + if($r['min'] && $r['max'] <= $r['min']) $r['max'] = 0; + $r['option'] = array(); + if($r['type'] == 0 || $r['type'] == 1) { + if(isset($a[$qid])) { + if($r['min'] && strlen($a[$qid]) < $r['min']) message(lang($L['form_min_word'], array($r['name'], $r['min']))); + if($r['max'] && strlen($a[$qid]) > $r['max']) message(lang($L['form_max_word'], array($r['name'], $r['max']))); + $post[$qid] = dhtmlspecialchars(trim($a[$qid])); + } else { + message(); + } + } else if($r['type'] == 2) { + if(isset($a[$qid])) { + if($r['min'] && strlen($a[$qid]) == 0) message(lang($L['form_choose'], array($r['name']))); + $post[$qid] = dhtmlspecialchars(trim($a[$qid])); + } else { + message(); + } + } else if($r['type'] == 3) { + if(isset($a[$qid])) { + if($r['min'] && count($a[$qid]) < $r['min']) message(lang($L['form_min_choose'], array($r['name'], $r['min']))); + if($r['max'] && count($a[$qid]) > $r['max']) message(lang($L['form_max_choose'], array($r['name'], $r['max']))); + $str = ','; + $val = str_replace('(*)', '', $r['value']).'|'; + foreach($a[$qid] as $s) { + if(strpos($val, $s.'|') === false) message(); + $str .= $s.','; + if($s == $L['form_other'] && isset($o[$qid])) $other[$qid] = dhtmlspecialchars(trim($o[$qid])); + } + $post[$qid] = dhtmlspecialchars(trim($str)); + } else { + message(); + } + } else if($r['type'] == 4) { + if(isset($a[$qid])) { + $val = str_replace('(*)', '', $r['value']).'|'; + if(strpos($val, $a[$qid].'|') === false) message(); + if($a[$qid] == $L['form_other'] && isset($o[$qid])) $other[$qid] = dhtmlspecialchars(trim($o[$qid])); + $post[$qid] = dhtmlspecialchars(trim($a[$qid])); + } else { + $post[$qid] = ''; + } + } + } + $db->query("INSERT INTO {$DT_PRE}form_record (fid,username,ip,addtime,item) VALUES ('$itemid','$_username','$DT_IP','$DT_TIME','$item')"); + $rid = $db->insert_id(); + foreach($post as $k=>$v) { + $o = isset($other[$k]) ? $other[$k] : ''; + $db->query("INSERT INTO {$DT_PRE}form_answer (fid,rid,qid,username,ip,addtime,content,other,item) VALUES ('$itemid','$rid','$k','$_username','$DT_IP','$DT_TIME','$v','$o','$item')"); + } + $db->query("UPDATE {$DT_PRE}form SET answer=answer+1 WHERE itemid=$itemid"); + dheader('index.php?page=2&itemid='.$itemid); + } else { + dalert($L['form_failed'], $DT_PC ? $linkurl : str_replace($url, $mob, $linkurl)); + } + } + $back = $DT_PC ? $linkurl : str_replace($url, $mob, $linkurl); + $adddate = timetodate($addtime, 3); + $fromdate = $fromtime ? timetodate($fromtime, 3) : $L['timeless']; + $todate = $totime ? timetodate($totime, 3) : $L['timeless']; + $content = DC::format($content, $DT_PC); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}form_question WHERE fid=$itemid ORDER BY listorder ASC,qid ASC LIMIT 1000"); + while($r = $db->fetch_array($result)) { + $t = explode('-', $r['required']); + $r['min'] = isset($t[0]) ? intval($t[0]) : 0; + $r['max'] = isset($t[1]) ? intval($t[1]) : 0; + if($r['min'] && $r['max'] <= $r['min']) $r['max'] = 0; + $r['option'] = array(); + if($r['type'] == 0) { + if(strpos($r['extend'], 'size=') === false) $r['extend'] .= ' size="50"'; + } else if($r['type'] == 1) { + if(strpos($r['extend'], 'rows=') === false) $r['extend'] .= ' rows="5"'; + if(strpos($r['extend'], 'cols=') === false) $r['extend'] .= ' cols="80"'; + } else { + $t = explode('|', $r['value']); + foreach($t as $k=>$v) { + $r['option'][$k]['name'] = str_replace('(*)', '', $v); + $r['option'][$k]['on'] = strpos($v, '(*)') !== false ? 1 : 0; + } + } + $lists[] = $r; + } + //$display = 0; + if(!$DT_BOT) $db->query("UPDATE LOW_PRIORITY {$DT_PRE}{$ext} SET hits=hits+1 WHERE itemid=$itemid", 'UNBUFFERED'); + $head_title = $title.$DT['seo_delimiter'].$L['form_title']; + $template = $f['template'] ? $f['template'] : $ext; +} else { + $head_title = $L['form_title']; + if($catid) $typeid = $catid; + $condition = '1'; + if($keyword) $condition .= match_kw('title', $keyword); + if($typeid) { + isset($TYPE[$typeid]) or dheader($url); + $condition .= " AND typeid IN (".type_child($typeid, $TYPE).")"; + $head_title = $TYPE[$typeid]['typename'].$DT['seo_delimiter'].$head_title; + } + if($cityid) $condition .= ($AREA[$cityid]['child']) ? " AND areaid IN (".$AREA[$cityid]['arrchildid'].")" : " AND areaid=$cityid"; + $lists = $do->get_list($condition, 'addtime DESC'); + $template = $ext; +} +if($DT_PC) { + $destoon_task = rand_task(); + if($EXT['mobile_enable']) $head_mobile = str_replace($url, $mob, $DT_URL); +} else { + $foot = ''; + if($itemid) { + $js_item = 1; + } else { + $pages = mobile_pages($items, $page, $pagesize); + } + if($sns_app) $seo_title = $site_name; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/extend/guestbook.inc.php b/module/extend/guestbook.inc.php new file mode 100644 index 0000000..f39585e --- /dev/null +++ b/module/extend/guestbook.inc.php @@ -0,0 +1,65 @@ +pass($post)) { + $post['areaid'] = $cityid; + $do->add($post); + if($report) message($L['gbook_report_success'], $forward ? $forward : ($DT_PC ? $url : $mob)); + message($L['gbook_success'], $DT_PC ? $url : $mob); + } else { + message($do->errmsg); + } + } else { + $rid = isset($rid) ? intval($rid) : 0; + $content = isset($content) ? dhtmlspecialchars(stripslashes($content)) : ''; + $truename = $telephone = $email = $qq = $wx = $ali = $skype = ''; + if($_userid) { + $user = userinfo($_username); + $truename = $user['truename']; + $telephone = $user['telephone'] ? $user['telephone'] : $user['mobile']; + $email = $user['mail'] ? $user['mail'] : $user['email']; + $qq = $user['qq']; + $wx = $user['wx']; + $ali = $user['ali']; + $skype = $user['skype']; + } + $head_title = $report ? $L['gbook_report_title'] : $L['gbook_title']; + } +} else { + $type = ''; + $condition = "status=3 AND reply<>''"; + if($keyword) $condition .= match_kw('content', $keyword); + if($cityid) $condition .= ($AREA[$cityid]['child']) ? " AND areaid IN (".$AREA[$cityid]['arrchildid'].")" : " AND areaid=$cityid"; + $lists = $do->get_list($condition); + $head_title = $L['gbook_title']; +} +$template = $ext; +if($DT_PC) { + $destoon_task = rand_task(); + if($EXT['mobile_enable']) $head_mobile = strpos($DT_URL, '/api/') === false ? str_replace($url, $mob, $DT_URL) : str_replace(DT_PATH, DT_MOB, $DT_URL); +} else { + if($action == 'add') { + // + } else { + $pages = mobile_pages($items, $page, $pagesize); + } + $head_name = $L['gbook_title']; + if($sns_app) $seo_title = $site_name; + $foot = ''; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/extend/link.inc.php b/module/extend/link.inc.php new file mode 100644 index 0000000..ec9206e --- /dev/null +++ b/module/extend/link.inc.php @@ -0,0 +1,52 @@ +pass($post)) { + $r = $db->get_one("SELECT itemid FROM {$DT_PRE}link WHERE linkurl='$post[linkurl]' AND username=''"); + if($r) message($L['link_url_repeat']); + $post['status'] = 2; + $post['level'] = 0; + $post['areaid'] = $cityid; + $do->add($post); + message($L['link_check'], $DT_PC ? $url : $mob); + } else { + message($do->errmsg); + } + } else { + $type_select = type_select($TYPE, 1, 'post[typeid]', $L['link_choose_type'], 0, 'id="typeid"'); + $head_title = $L['link_reg'].$DT['seo_delimiter'].$L['link_title']; + } +} else { + $head_title = $L['link_title']; + if($catid) $typeid = $catid; + if($typeid) { + isset($TYPE[$typeid]) or dheader($DT_PC ? $url : $mob); + $head_title = $TYPE[$typeid]['typename'].$DT['seo_delimiter'].$head_title; + } +} +$template = $ext; +if($DT_PC) { + $destoon_task = rand_task(); + if($EXT['mobile_enable']) $head_mobile = str_replace($url, $mob, $DT_URL); +} else { + $head_name = $L['link_title']; + if($sns_app) $seo_title = $site_name; + $foot = ''; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/extend/poll.class.php b/module/extend/poll.class.php new file mode 100644 index 0000000..5345ef8 --- /dev/null +++ b/module/extend/poll.class.php @@ -0,0 +1,259 @@ +table = DT_PRE.'poll'; + $this->table_item = DT_PRE.'poll_item'; + $this->table_record = DT_PRE.'poll_record'; + $this->fields = array('typeid','areaid', 'title','style','level','content','groupid','verify','addtime','fromtime','totime','editor','edittime','template_poll','template', 'linkurl','poll_max','poll_page','poll_cols','poll_order','thumb_width','thumb_height'); + } + + function poll() { + $this->__construct(); + } + + function pass($post) { + global $L; + if(!is_array($post)) return false; + if(!$post['typeid']) return $this->_($L['poll_pass_type']); + if(!$post['title']) return $this->_($L['poll_pass_title']); + return true; + } + + function set($post) { + global $MOD, $_username, $_userid; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['edittime'] = DT_TIME; + $post['editor'] = $_username; + $post['content'] = addslashes(save_remote(save_local(stripslashes($post['content'])))); + if($this->itemid) { + $new = $post['content']; + $r = $this->get_one(); + $old = $r['content']; + delete_diff($new, $old); + } + $post['fromtime'] = is_time($post['fromtime']) ? datetotime($post['fromtime']) : 0; + $post['totime'] = is_time($post['totime']) ? datetotime($post['totime']) : 0; + $post['groupid'] = implode(',', $post['groupid']); + $post['verify'] = intval($post['verify']); + $post['poll_max'] = intval($post['poll_max']); + $post['poll_page'] = intval($post['poll_page']); + $post['poll_page'] or $post['poll_page'] = 30; + $post['poll_cols'] = intval($post['poll_cols']); + $post['poll_cols'] or $post['poll_cols'] = 1; + $post['thumb_width'] = intval($post['thumb_width']); + $post['thumb_width'] or $post['thumb_width'] = 120; + $post['thumb_height'] = intval($post['thumb_height']); + $post['thumb_height'] or $post['thumb_height'] = 90; + return array_map("trim", $post); + } + + function get_one() { + return DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + } + + function get_list($condition = '1', $order = 'addtime DESC') { + global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $L, $sum, $items; + 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['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['fromdate'] = $r['fromtime'] ? timetodate($r['fromtime'], 3) : $L['timeless']; + $r['todate'] = $r['totime'] ? timetodate($r['totime'], 3) : $L['timeless']; + $r['typename'] = $TYPE[$r['typeid']]['typename']; + $r['typeurl'] = $MOD['poll_url'].list_url($r['typeid']); + $lists[] = $r; + } + return $lists; + } + + function get_list_record($condition = '1', $order = 'rid DESC') { + global $MOD, $TYPE, $pages, $page, $pagesize, $offset, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table_record} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = array(); + $result = DB::query("SELECT * FROM {$this->table_record} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['polldate'] = timetodate($r['polltime'], 6); + $lists[] = $r; + } + return $lists; + } + + function add($post) { + global $DT, $MOD, $module; + $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(); + $linkurl = $this->linkurl($this->itemid); + DB::query("UPDATE {$this->table} SET linkurl='$linkurl' WHERE itemid=$this->itemid"); + clear_upload($post['content'], $this->itemid, $this->table); + return $this->itemid; + } + + function edit($post) { + global $DT, $MOD, $module; + $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"); + $linkurl = $this->linkurl($this->itemid); + DB::query("UPDATE {$this->table} SET linkurl='$linkurl' WHERE itemid=$this->itemid"); + clear_upload($post['content'], $this->itemid, $this->table); + return true; + } + + function linkurl($itemid) { + global $MOD; + $linkurl = show_url($itemid); + return $MOD['poll_url'].$linkurl; + } + + function delete($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + $userid = get_user($r['editor']); + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + DB::query("DELETE FROM {$this->table_item} WHERE pollid=$itemid"); + DB::query("DELETE FROM {$this->table_record} WHERE pollid=$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 item_list($condition, $order = 'listorder DESC,itemid DESC', $num = 0) { + global $pages, $page, $pagesize, $offset, $pagesize, $items; + $items = DB::count($this->table_item, $condition); + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = DB::query("SELECT * FROM {$this->table_item} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if($r['linkurl']) $r['linkurl'] = DT_PATH.'api/redirect.php?url='.urlencode($r['linkurl']); + $lists[] = $r; + } + if($num != $items) DB::query("UPDATE {$this->table} SET items=$items WHERE itemid=$this->itemid"); + return $lists; + } + + function item_all($condition, $order = 'listorder DESC,itemid DESC') { + $lists = array(); + $result = DB::query("SELECT * FROM {$this->table_item} WHERE $condition ORDER BY $order"); + while($r = DB::fetch_array($result)) { + $lists[$r['itemid']] = $r; + } + return $lists; + } + + function item_order($listorder) { + if(!is_array($listorder)) return false; + foreach($listorder as $k=>$v) { + $k = intval($k); + $v = intval($v); + DB::query("UPDATE {$this->table_item} SET listorder=$v WHERE itemid=$k"); + } + return true; + } + + function item_add($post) { + $post['title'] = trim($post['title']); + if(!$post['title']) return false; + is_url($post['linkurl']) or $post['linkurl'] = ''; + $post['listorder'] = intval($post['listorder']); + $post['polls'] = intval($post['polls']); + $post['pollid'] = $this->itemid; + $post = dhtmlspecialchars($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + $sqlk .= ','.$k; + $sqlv .= ",'$v'"; + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table_item} ($sqlk) VALUES ($sqlv)"); + if($post['thumb']) clear_upload($post['thumb'], $this->itemid, $this->table); + } + + function item_edit($post, $item) { + global $_userid; + $itemid = $item['itemid']; + $post['title'] = trim($post['title']); + if(!$post['title']) return false; + is_url($post['linkurl']) or $post['linkurl'] = ''; + $post['listorder'] = intval($post['listorder']); + $post['polls'] = intval($post['polls']); + $post['pollid'] = $this->itemid; + $post = dhtmlspecialchars($post); + $sql = ''; + foreach($post as $k=>$v) { + $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table_item} SET $sql WHERE itemid=$itemid"); + if($post['thumb']) clear_upload($post['thumb'], $this->itemid, $this->table); + if($post['thumb'] != $item['thumb'] && $item['thumb']) delete_upload($item['thumb'], $_userid); + } + + function item_delete($itemid) { + global $_userid; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->item_delete($v); + } + } else { + $r = DB::get_one("SELECT thumb FROM {$this->table_item} WHERE itemid=$itemid"); + if($r['thumb']) delete_upload($r['thumb'], $_userid); + DB::query("DELETE FROM {$this->table_item} WHERE itemid=$itemid"); + DB::query("DELETE FROM {$this->table_record} WHERE itemid=$itemid"); + } + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/extend/poll.inc.php b/module/extend/poll.inc.php new file mode 100644 index 0000000..9d62021 --- /dev/null +++ b/module/extend/poll.inc.php @@ -0,0 +1,127 @@ +\');'); +} else if($action == 'ajax') { + $itemid or exit($L['poll_error_3']); + $I = $db->get_one("SELECT * FROM {$DT_PRE}poll_item WHERE itemid=$itemid"); + $I or exit($L['poll_error_4']); + $do->itemid = $pollid = $I['pollid']; + $item = $do->get_one(); + $item or exit($L['poll_error_5']); + if(!check_group($_groupid, $item['groupid'])) exit($_userid ? $L['poll_error_1'] : $L['poll_error_2']); + if($item['fromtime'] && $item['fromtime'] > $DT_TIME) exit($L['poll_error_6']); + if($item['totime'] && $item['totime'] < $DT_TIME) exit($L['poll_error_7']); + if($item['verify'] == 1) { + $msg = captcha($captcha, 1, true); + if($msg) exit($msg); + } + if($item['verify'] == 2) { + $msg = question($answer, 1, true); + if($msg) exit($msg); + } + $condition = $_username ? "AND username='$_username'" : "AND ip='$DT_IP' AND polltime>".($DT_TIME - 86400); + $t = $db->get_one("SELECT * FROM {$DT_PRE}poll_record WHERE itemid=$itemid {$condition}"); + if($t) exit($L['poll_error_8']); + if($item['poll_max']) { + $t = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}poll_record WHERE pollid=$pollid {$condition}"); + if($t['num'] >= $item['poll_max']) exit(lang($L['poll_error_9'], array($item['poll_max']))); + } + $db->query("INSERT INTO {$DT_PRE}poll_record (itemid,pollid,username,ip,polltime) VALUES ('$itemid','$pollid','$_username','$DT_IP','$DT_TIME')"); + $db->query("UPDATE {$DT_PRE}poll_item SET polls=polls+1 WHERE itemid=$itemid"); + $db->query("UPDATE {$DT_PRE}poll SET polls=polls+1 WHERE itemid=$pollid"); + exit('ok'); +} else if($action == 'show') { + $itemid or exit; + $do->itemid = $itemid; + $P = $do->get_one(); + $P or exit; + extract($P); + $cols = $poll_cols; + $percent = dround(100/$cols).'%'; + $pagesize = $poll_page; + $offset = ($page-1)*$pagesize; + $order = $poll_cols ? 'polls DESC,listorder DESC,itemid DESC' : 'listorder DESC,itemid DESC'; + $polls = $do->item_list("pollid=$itemid", $order); + $condition = $_username ? "AND username='$_username'" : "AND ip='$DT_IP' AND polltime>".($DT_TIME - 86400); + $votes = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}poll_record WHERE pollid=$itemid $condition"); + while($r = $db->fetch_array($result)) { + $votes[$r['itemid']] = $r['itemid']; + } + if(!$DT_BOT) $db->query("UPDATE LOW_PRIORITY {$DT_PRE}{$ext} SET hits=hits+1 WHERE itemid=$itemid", 'UNBUFFERED'); + $template_poll = $P['template_poll'] ? $P['template_poll'] : 'poll'; + $template = $ext; +} else { + if($itemid) { + $do->itemid = $itemid; + $item = $do->get_one(); + $item or dheader($DT_PC ? $url : $mob); + require DT_ROOT.'/include/content.class.php'; + extract($item); + $adddate = timetodate($addtime, 3); + $fromdate = $fromtime ? timetodate($fromtime, 3) : $L['timeless']; + $todate = $totime ? timetodate($totime, 3) : $L['timeless']; + $content = DC::format($content, $DT_PC); + $head_title = $title.$DT['seo_delimiter'].$L['poll_title']; + $template = $item['template'] ? $item['template'] : $ext; + if($DT_PC) { + // + } else { + $P = $item; + $pagesize = 1000; + $offset = ($page-1)*$pagesize; + $order = $poll_cols ? 'polls DESC,listorder DESC,itemid DESC' : 'listorder DESC,itemid DESC'; + $polls = $do->item_list("pollid=$itemid", $order); + $condition = $_username ? "AND username='$_username'" : "AND ip='$DT_IP' AND polltime>".($DT_TIME - 86400); + $votes = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}poll_record WHERE pollid=$itemid $condition"); + while($r = $db->fetch_array($result)) { + $votes[$r['itemid']] = $r['itemid']; + } + if(!$DT_BOT) $db->query("UPDATE LOW_PRIORITY {$DT_PRE}{$ext} SET hits=hits+1 WHERE itemid=$itemid", 'UNBUFFERED'); + $template_poll = $P['template_poll'] ? $P['template_poll'] : 'poll'; + $pages = ''; + } + } else { + $head_title = $L['poll_title']; + if($catid) $typeid = $catid; + $condition = '1'; + if($keyword) $condition .= match_kw('title', $keyword); + if($typeid) { + isset($TYPE[$typeid]) or dheader($url); + $condition .= " AND typeid IN (".type_child($typeid, $TYPE).")"; + $head_title = $TYPE[$typeid]['typename'].$DT['seo_delimiter'].$head_title; + } + if($cityid) $condition .= ($AREA[$cityid]['child']) ? " AND areaid IN (".$AREA[$cityid]['arrchildid'].")" : " AND areaid=$cityid"; + $lists = $do->get_list($condition, 'addtime DESC'); + $template = $ext; + } +} +if($DT_PC) { + $destoon_task = rand_task(); + if($EXT['mobile_enable']) $head_mobile = str_replace($url, $mob, $DT_URL); +} else { + if($itemid) { + $js_item = 1; + } else { + $pages = mobile_pages($items, $page, $pagesize); + } + $head_name = $L['poll_title']; + if($sns_app) $seo_title = $site_name; + $foot = ''; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/extend/share.inc.php b/module/extend/share.inc.php new file mode 100644 index 0000000..9102103 --- /dev/null +++ b/module/extend/share.inc.php @@ -0,0 +1,49 @@ +get_one("SELECT * FROM {$table} WHERE userid=$itemid"); + ($item && $item['groupid'] > 4) or message($L['msg_not_exist']); + $title = $item['company']; + $linkurl = $item['linkurl']; + $thumb = isset($item['thumb']) ? $item['thumb'] : ''; + $pic = isset($item['thumb']) ? str_replace('.thumb.'.file_ext($item['thumb']), '', $item['thumb']) : ''; + $introduce = isset($item['introduce']) ? $item['introduce'] : ''; + $auth = urlencode(str_replace('amp;', '', $linkurl)); + $db->query("UPDATE {$table} SET shares=shares+1 WHERE userid=$itemid"); + } else if($mid > 4) { + $item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + ($item && $item['status'] > 2) or message($L['msg_not_exist']); + $title = $item['title']; + $linkurl = $item['linkurl']; + if(strpos($linkurl, '://') === false) $linkurl = ($DT_PC ? $MODULE[$mid]['linkurl'] : $MODULE[$mid]['mobile']).$linkurl; + $thumb = isset($item['thumb']) ? $item['thumb'] : ''; + $pic = isset($item['thumb']) ? str_replace('.thumb.'.file_ext($item['thumb']), '', $item['thumb']) : ''; + $introduce = isset($item['introduce']) ? $item['introduce'] : ''; + $auth = urlencode(str_replace('amp;', '', $linkurl)); + $db->query("UPDATE {$table} SET shares=shares+1 WHERE itemid=$itemid"); + } else { + message($L['share_not_support']); + } +} else { + message($L['share_not_support']); +} +$_title = urlencode($title); +$_linkurl = urlencode($linkurl); +$sms = 'sms:?body='.$linkurl; +if(preg_match("/(iPhone|iPod|iPad)/i", DT_UA)) $sms = 'sms: &body='.$title.$linkurl; +$template = 'share'; +$head_title = $L['share_title']; +if($DT_PC) { + $destoon_task = rand_task(); + if($EXT['mobile_enable']) $head_mobile = str_replace(DT_PATH, DT_MOB, $DT_URL); + $moduleid = $mid; +} else { + $head_name = $head_title; + if($sns_app) $seo_title = $site_name; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/extend/sitemap.inc.php b/module/extend/sitemap.inc.php new file mode 100644 index 0000000..4943258 --- /dev/null +++ b/module/extend/sitemap.inc.php @@ -0,0 +1,39 @@ + 3 && isset($MODULE[$mid]) && !$MODULE[$mid]['islink']) or $mid = 0; +$LETTER = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); +$letter = isset($letter) ? strtolower($letter) : ''; +in_array($letter, $LETTER) or $letter = ''; +$head_title = $L['sitemap_title']; +if($mid) { + $moduleid = $mid; + $M = $MODULE[$mid]; + $head_title = $M['name'].$DT['seo_delimiter'].$head_title; + if($letter) { + $action = 'letter'; + $CATALOG = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$mid AND letter='$letter' ORDER BY listorder,catid ASC"); + while($r = $db->fetch_array($result)) { + $CATALOG[] = $r; + } + $head_title = strtoupper($letter).$DT['seo_delimiter'].$head_title; + } else { + $action = 'module'; + } +} else { + $action = 'sitemap'; +} +$template = 'sitemap'; +$head_keywords = $head_description = ''; +if($DT_PC) { + $CSS = array('catalog'); + $destoon_task = rand_task(); + if($EXT['mobile_enable']) $head_mobile = str_replace(DT_PATH, DT_MOB, $DT_URL); +} else { + $head_name = $L['sitemap_title']; + if($sns_app) $seo_title = $site_name; + $foot = ''; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/extend/spread.htm.php b/module/extend/spread.htm.php new file mode 100644 index 0000000..ebf4bf4 --- /dev/null +++ b/module/extend/spread.htm.php @@ -0,0 +1,60 @@ +get_one("SELECT * FROM {$DT_PRE}spread WHERE itemid=$itemid"); +if(!$item) return false; + +$filename = DT_CACHE.'/htm/m'.urlencode($item['mid']).'_k'.urlencode($item['word']).'.htm'; +if($DT_TIME - @filemtime($filename) < 60) return false; + +$result = $db->query("SELECT * FROM {$DT_PRE}spread WHERE mid=$item[mid] AND word='$item[word]' AND fromtime<=$DT_TIME AND totime>=$DT_TIME ORDER BY price DESC,itemid ASC"); +$totime = 0; +$itemids = array(); +while($r = $db->fetch_array($result)) { + if($r['totime'] > $totime) $totime = $r['totime']; + $itemids[] = $r['tid']; +} +if(!$itemids) { + file_del($filename); + return false; +} +$spread_itemids = implode(',', $itemids); +$spread_moduleid = $item['mid']; +$spread_module = $MODULE[$spread_moduleid]['module']; +$id = $spread_moduleid == 4 ? 'userid' : 'itemid'; +$bmid = $moduleid; +$moduleid = $spread_moduleid; +if(!isset($MODULE[$moduleid])) { + file_del($filename); + return false; +} +$pages = ''; +$datetype = 5; +$showpage = 0; +$tags = $tag = array(); +$result = $db->query("SELECT * FROM ".get_table($moduleid)." WHERE `{$id}` IN ($spread_itemids)"); +while($r = $db->fetch_array($result)) { + if(strpos($r['linkurl'], '://') === false) $r['linkurl'] = $MODULE[$spread_moduleid]['linkurl'].$r['linkurl']; + $tag[$r[$id]] = $r; +} +if(!$tag) { + file_del($filename); + return false; +} +$spread_url = $EXT['spread_url'].rewrite('index.php?kw='.urlencode($item['word'])); +foreach($itemids as $v) {//Order + if($tag[$v]) $tags[] = $tag[$v]; +} +if($spread_module == 'sell' && !defined('SELL_ORDER')) { + $_MOD = cache_read('module-'.$spread_moduleid.'.php'); + define('SELL_ORDER', $_MOD['checkorder'] == 2 ? 0 : 1); +} +ob_start(); +echo ''; +include template('spread', 'chip'); +$data = ob_get_contents(); +ob_clean(); +file_put($filename, $data); +$moduleid = $bmid; +return true; +?> \ No newline at end of file diff --git a/module/extend/spread.inc.php b/module/extend/spread.inc.php new file mode 100644 index 0000000..ddd6d8c --- /dev/null +++ b/module/extend/spread.inc.php @@ -0,0 +1,65 @@ +get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}spread WHERE $condition"); + if($MOD['spread_list']) { + $items = $r['num']; + $pages = pages($items, $page, $pagesize); + } else { + $pages = ''; + $page = 1; + $items = $offset = 0; + } + $i = $j = 0; + $lists = array(); + $result = $db->query("SELECT DATE_FORMAT(FROM_UNIXTIME(fromtime),'%Y%m') as id,itemid,mid,tid,word,price,currency,company,username,addtime,fromtime,totime FROM {$DT_PRE}spread WHERE $condition ORDER BY id DESC,price DESC,itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + if($r['totime'] < $DT_TIME) { + $r['process'] = $L['status_expired']; + } else if($r['fromtime'] > $DT_TIME) { + $r['process'] = $L['status_not_start']; + } else { + $r['process'] = $L['status_displaying']; + } + if($j == 0) $i = $r['id']; + $r['bg'] = $i == $r['id'] ? 0 : 1; + if($i != $r['id']) $i = $r['id']; + $j++; + $lists[] = $r; + } + $head_title = $kw.($mid ? $DT['seo_delimiter'].$MODULE[$mid]['name'] : '').$DT['seo_delimiter'].$L['spread_title']; + } else { + dheader('./'); + } +} else { + $head_title = $L['spread_title']; + if($kw) dheader(rewrite('list.php?kw='.urlencode($kw))); +} +$template = $ext; +if($DT_PC) { + $destoon_task = "moduleid=$moduleid&html=$ext"; + if($EXT['mobile_enable']) $head_mobile = str_replace($url, $mob, $DT_URL); +} else { + if($action == 'list') $pages = mobile_pages($items, $page, $pagesize); + $head_name = $L['spread_title']; + if($sns_app) $seo_title = $site_name; + $foot = ''; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/group/admin/index.html b/module/group/admin/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/group/admin/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/group/admin/install.inc.php b/module/group/admin/install.inc.php new file mode 100644 index 0000000..343af2c --- /dev/null +++ b/module/group/admin/install.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/module/group/admin/remkdir.inc.php b/module/group/admin/remkdir.inc.php new file mode 100644 index 0000000..496ea39 --- /dev/null +++ b/module/group/admin/remkdir.inc.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/module/group/admin/setting.inc.php b/module/group/admin/setting.inc.php new file mode 100644 index 0000000..f8cff99 --- /dev/null +++ b/module/group/admin/setting.inc.php @@ -0,0 +1,51 @@ +$v) { + if(strpos($k, 'seo_') === false) continue; + seo_check($v) or msg('SEO信息包含非法字符'); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) { + $_MOD = $MOD; + $MOD = $setting; + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + while($r = $db->fetch_array($result)) { + update_category($r); + } + cache_category($moduleid); + $MOD = $_MOD; + } + if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + $r = $db->get_one("SELECT MAX(itemid) AS maxid FROM {$table}"); + $maxid = $r['maxid']; + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/group/admin/template/edit.tpl.php b/module/group/admin/template/edit.tpl.php new file mode 100644 index 0000000..9d00c73 --- /dev/null +++ b/module/group/admin/template/edit.tpl.php @@ -0,0 +1,233 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +', ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 审核提示该信息存在修改记录,点击查看 修改详情
* 所属分类
* 标题
* 产品图片  [上传]  [预览]  [删除]
* 团购价
* 市场价
* 最低人数
* 最多人数
', $item) : '';?> +
* 简介
* 详细说明 +
+
* 需要快递 + id="logistic_1"/>    + id="logistic_0"/> +
* 会员名 [资料]
* 过期时间  +  + 不选表示长期有效
* 信息状态 +/> 通过 +/> 待审 + onclick="if(this.checked) Dd('note').style.display='';"/> 拒绝 +/> 过期 +/> 删除 +
* 拒绝理由
* 添加时间
* 团购人数
* 浏览次数
* 内容收费大于0的数字表示具体收费价格');?> +
* 内容模板系统会自动继承分类或模块设置');?>
* 自定义文件路径  请确保目录和文件名合法且可写入,否则可能生成失败');?> 
+
    
+
+ + +
+ + + +
单页采编
+ + + + + +
* 目标网址    
+
+ + + + \ No newline at end of file diff --git a/module/group/admin/template/index.tpl.php b/module/group/admin/template/index.tpl.php new file mode 100644 index 0000000..2f327ca --- /dev/null +++ b/module/group/admin/template/index.tpl.php @@ -0,0 +1,186 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + + + + + + +
行业图片标题会员团购价 折扣 订单 销量 浏览 点赞 反对 收藏 打赏 赏金 分享 举报 评论 状态操作
+
+ + + + + +
+更新:
+添加: +
+
+
+ + + + + + +  + +
+ +
+ + + +  +  +  +  +  + + + + +批量延长过期时间 +天 + + +  +  +  + + + +  +  + + + +  +  + + + + +  +  +  +  +  +
+
+'.$pages.'' : '';?> +
+ + \ No newline at end of file diff --git a/module/group/admin/template/order_express.tpl.php b/module/group/admin/template/order_express.tpl.php new file mode 100644 index 0000000..32a9e64 --- /dev/null +++ b/module/group/admin/template/order_express.tpl.php @@ -0,0 +1,58 @@ + +
+ + + + + + + + + + +
  +  +  +  +  +  + +
  +快递单号:  +订单单号:  +卖家:  +买家:  +
+
+ + + + + + + + + + + +$v) {?> + + + + + + + + + + + +
订单单号快递公司快递单号快递状态卖家买家下单时间更新时间
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/group/admin/template/order_refund.tpl.php b/module/group/admin/template/order_refund.tpl.php new file mode 100644 index 0000000..af23064 --- /dev/null +++ b/module/group/admin/template/order_refund.tpl.php @@ -0,0 +1,204 @@ + +
+ + + + + + +
商品信息
+ + + + + + + + + + + + + + + + + + + + + + + + +
订单单号
商品名称
商品图片
买家   +
卖家  +
+ +
快递信息
+ + + + + + + + + + + + + + + + + + + + + + + + + + 0) { ?> + + + + + + + + + + + + + + + +
邮编
地址
姓名
手机
电话
买家备注 +
快递类型
快递单号
追踪结果
正在查询...
+ +
+ +
验证信息
+ + + + + + + + + +
密码
手机
+ +
价格信息
+ + + + + + + + + + + + + +
商品单价
购买数量
订单总额
+
订单详情
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
订单进程 +
+ + -
+ +
+
下单时间
最后更新
发货时间
交易状态
退款原因
受理结果 + 将交易金额退还给买家
+ 将交易金额支付给卖家 +
操作理由 + + +
请在和买卖双方沟通后谨慎填写,一经提交将不可更改 +
通知双方 + + + + +
+
    
+
+ + + \ No newline at end of file diff --git a/module/group/admin/template/order_show.tpl.php b/module/group/admin/template/order_show.tpl.php new file mode 100644 index 0000000..339e26c --- /dev/null +++ b/module/group/admin/template/order_show.tpl.php @@ -0,0 +1,169 @@ + +
商品信息
+ + + + + + + + + + + + + + + + + + + + + + + + +
订单单号
商品名称
商品图片
买家   +
卖家  +
+ +
快递信息
+ + + + + + + + + + + + + + + + + + + + + + + + + + 0) { ?> + + + + + + + + + + + + + + + +
邮编
地址
姓名
手机
电话
买家备注 +
快递类型
快递单号
追踪结果
正在查询...
+ +
+ +
验证信息
+ + + + + + + + + +
密码
手机
+ +
价格信息
+ + + + + + + + + + + + + +
商品单价
购买数量
订单总额
+
订单详情
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
订单进程 +
+ + -
+ +
+
下单时间
最后更新
发货时间
交易状态
退款原因
操作原因
操作人
操作时间
+ + \ No newline at end of file diff --git a/module/group/admin/template/setting.tpl.php b/module/group/admin/template/setting.tpl.php new file mode 100644 index 0000000..301af77 --- /dev/null +++ b/module/group/admin/template/setting.tpl.php @@ -0,0 +1,481 @@ + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
首页默认模板
列表默认模板
内容默认模板
搜索默认模板
信息发布模板
下单默认模板
默认缩略图[宽X高] + +X + px +
自动截取内容至简介 字符
编辑器工具按钮 + +
信息排序方式 + + +
列表或搜索主字段
分类属性参数 +/> 开启     +/> 关闭 +
下载内容远程图片 +/> 开启     +/> 关闭 +
清除内容链接 +/> 开启     +/> 关闭 +
内容关联链接 +/> 开启     +/> 关闭 +   +[管理链接] +
内容分表 + onclick="Dwidget('?file=split&mid=&maxid=&split=1', '开启内容分表');"/> 开启     + onclick="Dwidget('?file=split&mid=&maxid=&split=0', '关闭内容分表');"/> 关闭 + 如果你的数据少于10万,则不需要开启,当前最大id为'.$maxid.','.($maxid > 100000 ? '建议开启' : '无需开启').'
此项一旦开启,请不要随意关闭,以免出现未知错误,同时全文搜索将关闭');?> + +
全文搜索 +checked /> LIKE    +checked /> MATCH     +checked /> 关闭 +开启MATCH模式请在数据库维护里执行以下SQL添加全文索引
ALTER TABLE `'.$table_data.'` ADD FULLTEXT (`content`);
全文索引占用一定数据空间,如果不开启MATCH模式可以执行以下语句删除索引
ALTER TABLE `'.$table_data.'` DROP INDEX `content`;');?>
级别中文别名 + +
用 | 分隔不同别名 依次对应 1|2|3|4|5|6|7|8|9 级
+
级别效果预览
按分类浏览列数
首页推荐信息数量
首页分类信息数量
列表信息分页数量
内容图片最大宽度 px
内容点击次数 +/> 开启     +/> 关闭 + +
内容点赞和反对 +/> 开启     +/> 关闭 +
+
+ + + + +
+     + +
+
+ + \ No newline at end of file diff --git a/module/group/list.htm.php b/module/group/list.htm.php new file mode 100644 index 0000000..81f61ea --- /dev/null +++ b/module/group/list.htm.php @@ -0,0 +1,93 @@ +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; +$width = 285; +$height = 210; +$template = $CAT['template'] ? $CAT['template'] : ($MOD['template_list'] ? $MOD['template_list'] : 'list'); +$total = max(ceil($items/$MOD['pagesize']), 1); +if(isset($fid) && isset($num)) { + $page = $fid; + $topage = $fid + $num - 1; + $total = $topage < $total ? $topage : $total; +} +for(; $page <= $total; $page++) { + $offset = ($page-1)*$pagesize; + $pages = listpages($CAT, $items, $page, $pagesize); + $tags = array(); + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $tags[] = $r; + } + $seo_file = 'list'; + include DT_ROOT.'/include/seo.inc.php'; + $destoon_task = "moduleid=$moduleid&html=list&catid=$catid&page=$page"; + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ?listurl($CAT, $page) : $CAT['linkurl']); + $filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, $page); + $_tags = $tags; + $DT_PC = $GLOBALS['DT_PC'] = 1; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + if($CAT['parentid']) $PCAT = get_cat($CAT['parentid']); + $pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].listurl($CAT, '{destoon_page}')); + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $tags = array(); + foreach($_tags as $r) { + $r['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $r['linkurl']); + $r['date'] = timetodate($r[$time], 3); + $tags[] = $r; + } + if($items) $js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid; + $head_title = $head_name = $CAT['catname']; + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put($filename, $data); + if($page == 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/group/show.htm.php b/module/group/show.htm.php new file mode 100644 index 0000000..5ad1086 --- /dev/null +++ b/module/group/show.htm.php @@ -0,0 +1,67 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3) return false; +require_once DT_ROOT.'/include/content.class.php'; +$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; +extract($item); +$CAT = get_cat($catid); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_content = $t['content']; +if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, 1); +} +$CP = $MOD['cat_property'] && $CAT['property']; +if($CP) { + require_once DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); +} +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$todate = $totime ? timetodate($totime, 3) : 0; +$expired = $totime && $totime < $DT_TIME ? true : false; +$fileurl = $linkurl; +$linkurl = $MOD['linkurl'].$linkurl; +$jsdate = $totime ? timetodate($totime, 'Y,').(timetodate($totime, 'n')-1).timetodate($totime, ',j,H,i,s') : ''; +$iprice = file_ext($price) == '00' ? intval($price) : $price; +$fee = DC::fee($item['fee'], $MOD['fee_view']); +$left = $minamount ? $minamount - $orders : 1 - $orders; +$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; + $purchase = $process < 2 && $username ? 1 : 0; + $head_title = $head_name = $CAT['catname']; + $js_item = 1; + $foot = ''; + if($_content) { + $content = $_content; + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); + $content = DC::format($content, 0); + } + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put(str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename), $data); +} +return true; +?> \ No newline at end of file diff --git a/module/group/show.inc.php b/module/group/show.inc.php new file mode 100644 index 0000000..9c6b44b --- /dev/null +++ b/module/group/show.inc.php @@ -0,0 +1,117 @@ +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); + $todate = $totime ? timetodate($totime, 3) : 0; + $expired = $totime && $totime < $DT_TIME ? true : false; + $linkurl = $MOD['linkurl'].$linkurl; + $jsdate = $totime ? timetodate($totime, 'Y,').(timetodate($totime, 'n')-1).timetodate($totime, ',j,H,i,s') : ''; + $iprice = file_ext($price) == '00' ? intval($price) : $price; + $fee = DC::fee($item['fee'], $MOD['fee_view']); + $update = ''; + $left = $minamount ? $minamount - $orders : 1 - $orders; + if($expired) { + if($process < 2) { + $update .= ",process=2,endtime=$DT_TIME"; + $item['process'] = $process = 2; + $item['endtime'] = $endtime = $DT_TIME; + } + } else { + if($process == 0) { + if(($minamount > 0 && $orders >= $minamount) || ($minamount == 0 && $orders >= 1)) { + $update .= ",process=1"; + $item['process'] = $process = 1; + } + } else if($process == 1) { + if($amount && $amount <= $orders) { + $update .= ",process=2,endtime=$DT_TIME"; + $item['process'] = $process = 2; + $item['endtime'] = $endtime = $DT_TIME; + } + } + } + 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); + $left = $minamount ? $minamount - $orders : 1 - $orders; + $purchase = $process < 2 && $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); +?> \ No newline at end of file diff --git a/module/info/admin/index.inc.php b/module/info/admin/index.inc.php new file mode 100644 index 0000000..6df5a7b --- /dev/null +++ b/module/info/admin/index.inc.php @@ -0,0 +1,242 @@ + 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($minvip) $condition .= " AND vip>=$minvip"; + if($maxvip) $condition .= " AND vip<=$maxvip"; + if($ip) $condition .= " AND ip='$ip'"; + if($username) $condition .= " AND username='$username'"; + if($itemid) $condition .= " AND itemid=$itemid"; + + $timetype = strpos($dorder[$order], 'add') !== false ? 'add' : ''; +} +switch($action) { + case 'add': + if($submit) { + if($do->pass($post)) { + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + $do->add($post); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid); + dmsg('添加成功', '?moduleid='.$moduleid.'&action='.$action.'&catid='.$post['catid']); + } else { + msg($do->errmsg); + } + } else { + foreach($do->fields as $v) { + isset($$v) or $$v = ''; + } + $content = ''; + $status = 3; + $addtime = timetodate($DT_TIME); + $totime = ''; + $username = $_username; + $item = $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 '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, $dorder[$order]); + $menuid = 3; + include tpl('index', $module); + } + break; + case 'check': + if($itemid && !$psize) { + $do->check($itemid); + dmsg('审核成功', $forward); + } else { + $lists = $do->get_list('status=2'.$condition, $dorder[$order]); + $menuid = 2; + include tpl('index', $module); + } + break; + default: + $lists = $do->get_list('status=3'.$condition, $dorder[$order]); + $menuid = 1; + include tpl('index', $module); + break; +} +?> \ No newline at end of file diff --git a/module/info/admin/install.inc.php b/module/info/admin/install.inc.php new file mode 100644 index 0000000..d64a5f1 --- /dev/null +++ b/module/info/admin/install.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/module/info/admin/uninstall.inc.php b/module/info/admin/uninstall.inc.php new file mode 100644 index 0000000..7c6acf7 --- /dev/null +++ b/module/info/admin/uninstall.inc.php @@ -0,0 +1,5 @@ +query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_".$moduleid."`"); +$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_data_".$moduleid."`"); +?> \ No newline at end of file diff --git a/module/info/common.inc.php b/module/info/common.inc.php new file mode 100644 index 0000000..3f748b1 --- /dev/null +++ b/module/info/common.inc.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/module/info/index.inc.php b/module/info/index.inc.php new file mode 100644 index 0000000..0c5027f --- /dev/null +++ b/module/info/index.inc.php @@ -0,0 +1,41 @@ + 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']; + $r['thumb'] = str_replace('.thumb.', '.middle.', $r['thumb']); + $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); +?> \ No newline at end of file diff --git a/module/info/info.class.php b/module/info/info.class.php new file mode 100644 index 0000000..7b89422 --- /dev/null +++ b/module/info/info.class.php @@ -0,0 +1,324 @@ +moduleid = $moduleid; + $this->table = $table; + $this->table_data = $table_data; + $this->split = $MOD['split']; + $this->fields = array('catid','level','title','style','fee','introduce','n1','n2','n3','v1','v2','v3','totime','areaid','thumb','thumb1','thumb2','thumbs','video','status','hits','username','addtime','adddate','editor','edittime','editdate','ip','template','islink', 'linkurl','filepath','note','company','truename','telephone','mobile','address','email','qq','wx','ali','skype'); + } + + function info($moduleid) { + $this->__construct($moduleid); + } + + function pass($post) { + global $MOD; + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_catid')); + if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); + if($post['totime']) { + if(!is_time($post['totime'])) return $this->_(lang('message->pass_date')); + if(datetotime($post['totime']) < DT_TIME) return $this->_(lang('message->pass_todate')); + } + if(isset($post['islink'])) { + if(!$post['linkurl']) return $this->_(lang('message->pass_linkurl')); + } else { + //if(!$post['content']) return $this->_(lang('message->pass_content')); + } + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $AREA, $_username, $_userid, $_cname; + $thumbs = array(); + foreach($post['thumbs'] as $v) { + if(is_url($v)) $thumbs[] = $v; + } + if($thumbs) { + $post['thumb'] = $thumbs[0]; + array_shift($thumbs); + $post['thumbs'] = implode('|', $thumbs); + } else { + $post['thumb'] = $post['thumbs'] = ''; + } + $post['thumb1'] = $post['thumb2'] = ''; + is_url($post['video']) or $post['video'] = ''; + $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; + $post['islink'] = isset($post['islink']) ? 1 : 0; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['adddate'] = timetodate($post['addtime'], 3); + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['editdate'] = timetodate($post['edittime'], 3); + $post['totime'] = is_time($post['totime']) ? datetotime($post['totime']) : 0; + $post['fee'] = dround($post['fee']); + $post['content'] = stripslashes($post['content']); + $post['content'] = save_local($post['content']); + if($MOD['clear_link']) $post['content'] = clear_link($post['content']); + if($MOD['save_remotepic']) $post['content'] = save_remote($post['content']); + if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); + if($this->itemid) { + $new = $post['content']; + $new .= ''; + foreach($thumbs as $v) { + $new .= ''; + } + $r = $this->get_one(); + $old = $r['content']; + $old .= ''; + foreach(explode('|', $r['thumbs']) as $v) { + $old .= ''; + } + delete_diff($new, $old); + if($r['video'] != $post['video']) delete_upload($r['video'], match_userid($r['video'])); + } else { + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['todate'] = timetodate($r['totime'], 3); + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) { + credit_add($post['username'], $MOD['credit_add']); + credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'].$post['thumbs'].$post['video'], $this->itemid); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'].$post['thumbs'].$post['video'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')).strip_tags(area_pos($item['areaid'], ',')); + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $video = url2video($item['video']); + if($video && $video != $item['video']) $update .= ",video='$video'"; + $item['itemid'] = $itemid; + $linkurl = itemurl($item); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + $member = $item['username'] ? userinfo($item['username']) : array(); + if($member) $member['areaid'] = $item['areaid']; + if($member) $update .= update_user($member, $item); + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html'] && !$r['islink']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + } + if($all) { + $userid = get_user($r['username']); + if($r['video']) delete_upload($r['video'], $userid); + if($r['thumb']) delete_upload($r['thumb'], $userid); + if($r['thumbs']) { + foreach(explode('|', $r['thumbs']) as $v) { + if($v) delete_upload($v, $userid); + } + } + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + } + } + } + + function check($itemid) { + global $_username, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + $this->itemid = $itemid; + $item = $this->get_one(); + if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { + credit_add($item['username'], $MOD['credit_add']); + credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + $editdate = timetodate(DT_TIME, 3); + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME.",editdate='$editdate' WHERE itemid=$itemid"); + history($this->moduleid, $itemid, 'del'); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function expire($condition = '') { + DB::query("UPDATE {$this->table} SET status=4 WHERE status=3 AND totime>0 AND totime<".DT_TIME." $condition"); + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function refresh($itemid) { + $editdate = timetodate(DT_TIME, 3); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET edittime='".DT_TIME."',editdate='$editdate' WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/info/list.htm.php b/module/info/list.htm.php new file mode 100644 index 0000000..e8cd420 --- /dev/null +++ b/module/info/list.htm.php @@ -0,0 +1,93 @@ +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; +$introduce = 150; +$template = $CAT['template'] ? $CAT['template'] : ($MOD['template_list'] ? $MOD['template_list'] : 'list'); +$total = max(ceil($items/$MOD['pagesize']), 1); +if(isset($fid) && isset($num)) { + $page = $fid; + $topage = $fid + $num - 1; + $total = $topage < $total ? $topage : $total; +} +for(; $page <= $total; $page++) { + $offset = ($page-1)*$pagesize; + $pages = listpages($CAT, $items, $page, $pagesize); + $tags = array(); + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $tags[] = $r; + } + $seo_file = 'list'; + include DT_ROOT.'/include/seo.inc.php'; + $destoon_task = "moduleid=$moduleid&html=list&catid=$catid&page=$page"; + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ?listurl($CAT, $page) : $CAT['linkurl']); + $filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, $page); + $_tags = $tags; + $DT_PC = $GLOBALS['DT_PC'] = 1; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + if($CAT['parentid']) $PCAT = get_cat($CAT['parentid']); + $pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].listurl($CAT, '{destoon_page}')); + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $tags = array(); + foreach($_tags as $r) { + $r['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $r['linkurl']); + $r['date'] = timetodate($r[$time], 3); + $r['thumb'] = str_replace('.thumb.', '.middle.', $r['thumb']); + $tags[] = $r; + } + if($items) $js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid; + $head_title = $head_name = $CAT['catname']; + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put($filename, $data); + if($page == 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/info/my.inc.php b/module/info/my.inc.php new file mode 100644 index 0000000..25e96cf --- /dev/null +++ b/module/info/my.inc.php @@ -0,0 +1,264 @@ +get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND status>1"); + $limit_used = $r['num']; + $limit_free = $mod_limit > $limit_used ? $mod_limit - $limit_used : 0; +} +if(check_group($_groupid, $MOD['group_refresh'])) $MOD['credit_refresh'] = 0; +switch($action) { + case 'add': + if($mod_limit && $limit_used >= $mod_limit) dalert(lang($L['info_limit'], array($mod_limit, $limit_used)), $_userid ? '?mid='.$mid : '?action=index'); + if($MG['hour_limit']) { + $today = $DT_TIME - 3600; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); + if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), $_userid ? '?mid='.$mid : '?action=index'); + } + if($MG['day_limit']) { + $today = $DT_TODAY - 86400; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $sql AND addtime>$today"); + if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), $_userid ? '?mid='.$mid : '?action=index'); + } + + if($mod_free_limit >= 0) { + $fee_add = ($MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $mod_free_limit && $_userid) ? dround($MOD['fee_add']) : 0; + } else { + $fee_add = 0; + } + $fee_currency = $MOD['fee_currency']; + $fee_unit = $fee_currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; + $need_password = $fee_add && $fee_currency == 'money' && $fee_add > $DT['quick_pay']; + $need_captcha = $MOD['captcha_add'] == 2 ? $MG['captcha'] : $MOD['captcha_add']; + $need_question = $MOD['question_add'] == 2 ? $MG['question'] : $MOD['question_add']; + $could_color = check_group($_groupid, $MOD['group_color']) && $MOD['credit_color'] && $_userid; + + if($submit) { + if($fee_add && $fee_add > ($fee_currency == 'money' ? $_money : $_credit)) dalert($L['balance_lack']); + if($need_password && !is_payword($_username, $password)) dalert($L['error_payword']); + + if(!$_userid) { + if(strlen($post['company']) < 4) dalert($L['type_company']); + if(strlen($post['truename']) < 4) dalert($L['type_truename']); + if(strlen($post['mobile']) < 7) dalert($L['type_mobile']); + } + + if($MG['add_limit']) { + $last = $db->get_one("SELECT addtime FROM {$table} WHERE $sql ORDER BY itemid DESC"); + if($last && $DT_TIME - $last['addtime'] < $MG['add_limit']) dalert(lang($L['add_limit'], array($MG['add_limit']))); + } + $msg = captcha($captcha, $need_captcha, true); + if($msg) dalert($msg); + $msg = question($answer, $need_question, true); + if($msg) dalert($msg); + if($do->pass($post)) { + $CAT = get_cat($post['catid']); + if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); + $post['addtime'] = $post['level'] = $post['fee'] = 0; + $post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status(3, $need_check); + $post['hits'] = 0; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($could_color && $color && $_credit > $MOD['credit_color']) { + $post['style'] = $color; + credit_add($_username, -$MOD['credit_color']); + credit_record($_username, -$MOD['credit_color'], 'system', $L['title_color'], '['.$MOD['name'].']'.$post['title']); + } + $do->add($post); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid); + if($fee_add) { + if($fee_currency == 'money') { + money_add($_username, -$fee_add); + money_record($_username, -$fee_add, $L['in_site'], 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); + } else { + credit_add($_username, -$fee_add); + credit_record($_username, -$fee_add, 'system', lang($L['credit_record_add'], array($MOD['name'])), 'ID:'.$do->itemid); + } + } + + $msg = $post['status'] == 2 ? $L['success_check'] : $L['success_add']; + $js = ''; + if(isset($post['sync_sina']) && $post['sync_sina']) $js .= sync_weibo('sina', $moduleid, $do->itemid); + if($_userid) { + set_cookie('dmsg', $msg); + $forward = '?mid='.$mid.'&status='.$post['status']; + $msg = ''; + } else { + $forward = '?mid='.$mid.'&action=add'; + } + $js .= 'window.onload=function(){parent.window.location="'.$forward.'";}'; + dalert($msg, '', $js); + } else { + dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : '')); + } + } else { + if($itemid) { + $MG['copy'] && $_userid or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); + + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + extract($item); + $totime = $totime > $DT_TIME ? timetodate($totime, 6) : ''; + } else { + $_catid = $catid; + foreach($do->fields as $v) { + $$v = ''; + } + $content = ''; + $catid = $_catid; + $totime = ''; + } + $item = $thumbs = array(); + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + + if($MG['edit_limit'] < 0) message($L['edit_refuse']); + if($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit']*86400) message(lang($L['edit_limit'], array($MG['edit_limit']))); + + if($submit) { + if($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['hits'] = $item['hits']; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); + set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); + dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); + } else { + dalert($do->errmsg); + } + } else { + extract($item); + $thumbs = get_thumbs($item); + $totime = $totime ? timetodate($totime, 6) : ''; + } + break; + case 'delete': + $MG['delete'] or message(); + $itemid or message(); + $itemids = is_array($itemid) ? $itemid : array($itemid); + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $db->get_one("SELECT username FROM {$table} WHERE itemid=$itemid"); + if(!$item || $item['username'] != $_username) message(); + $do->recycle($itemid); + } + dmsg($L['success_delete'], $forward); + break; + case 'refresh': + $MG['refresh_limit'] > -1 or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); + $itemid or message($L['select_info']); + if($MOD['credit_refresh'] && $_credit < $MOD['credit_refresh']) message($L['credit_lack']); + $itemids = $itemid; + $s = $f = 0; + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $db->get_one("SELECT username,edittime FROM {$table} WHERE itemid=$itemid"); + $could_refresh = $item && $item['username'] == $_username; + if($could_refresh && $MG['refresh_limit'] && $DT_TIME - $item['edittime'] < $MG['refresh_limit']) $could_refresh = false; + if($could_refresh && $MOD['credit_refresh'] && ($MOD['credit_refresh'] > $_credit || $_credit < 0)) $could_refresh = false; + if($could_refresh) { + $do->refresh($itemid); + $s++; + if($MOD['credit_refresh']) $_credit = $_credit - $MOD['credit_refresh']; + } else { + $f++; + } + } + if($MOD['credit_refresh'] && $s) { + $credit = $s*$MOD['credit_refresh']; + credit_add($_username, -$credit); + credit_record($_username, -$credit, 'system', lang($L['credit_record_refresh'], array($MOD['name'])), lang($L['refresh_total'], array($s))); + } + $msg = lang($L['refresh_success'], array($s)); + if($f) $msg = $msg.' '.lang($L['refresh_fail'], array($f)); + dmsg($msg, $forward); + break; + default: + $status = isset($status) ? intval($status) : 3; + in_array($status, array(1, 2, 3, 4)) or $status = 3; + $condition = "username='$_username'"; + $condition .= " AND status=$status"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + $timetype = strpos($MOD['order'], 'add') !== false ? 'add' : ''; + $lists = $do->get_list($condition, $MOD['order']); + break; +} +if($_userid) { + $nums = array(); + for($i = 1; $i < 5; $i++) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE username='$_username' AND status=$i"); + $nums[$i] = $r['num']; + } +} +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); +} else { + $foot = ''; + if($action == 'add' || $action == 'edit') { + // + } else { + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + foreach($lists as $k=>$v) { + $lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); + $lists[$k]['date'] = timetodate($v[$time], 5); + } + $pages = mobile_pages($items, $page, $pagesize); + $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'my.php'); + } +} +$head_title = lang($L['module_manage'], array($MOD['name'])); +include template($MOD['template_my'] ? $MOD['template_my'] : 'my_'.$module, 'member'); +?> \ No newline at end of file diff --git a/module/info/show.htm.php b/module/info/show.htm.php new file mode 100644 index 0000000..5a592a0 --- /dev/null +++ b/module/info/show.htm.php @@ -0,0 +1,66 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3 || $item['islink'] > 0) return false; +require_once DT_ROOT.'/include/content.class.php'; +$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; +extract($item); +$CAT = get_cat($catid); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_content = $t['content']; +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; + $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; +?> \ No newline at end of file diff --git a/module/info/show.inc.php b/module/info/show.inc.php new file mode 100644 index 0000000..7d82583 --- /dev/null +++ b/module/info/show.inc.php @@ -0,0 +1,99 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + if($item['groupid'] == 2) include load('404.inc'); + if($item && $item['status'] > 2) { + if($item['islink']) dheader($item['linkurl']); + if($MOD['show_html'] && is_file(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl'])) d301($MOD['linkurl'].$item['linkurl']); + require DT_ROOT.'/include/content.class.php'; + extract($item); + } else { + include load('404.inc'); + } + $CAT = get_cat($catid); + if(!check_group($_groupid, $CAT['group_show'])) include load('403.inc'); + $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); + $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); + $content = $t['content']; + if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, $DT_PC); + } + $CP = $MOD['cat_property'] && $CAT['property']; + if($CP) { + require DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); + } + $adddate = timetodate($addtime, 5); + $editdate = timetodate($edittime, 5); + $todate = $totime ? timetodate($totime, 3) : 0; + $expired = $totime && $totime < $DT_TIME ? true : false; + $linkurl = $MOD['linkurl'].$linkurl; + $albums = get_albums($item); + $pics = count($albums); + $pics_width = $pics*70; + $update = ''; + $fee = DC::fee($item['fee'], $MOD['fee_view']); + if(check_group($_groupid, $MOD['group_contact'])) { + if($fee) { + $user_status = 4; + $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid"; + } else { + $user_status = 3; + $member = $item['username'] ? userinfo($item['username']) : array(); + if($item['totime'] && $item['totime'] < $DT_TIME && $item['status'] == 3) $update .= ",status=4"; + if($member) { + unset($item['areaid']); + $update_user = update_user($member, $item); + if($update_user) $db->query("UPDATE LOW_PRIORITY {$table} SET ".substr($update_user, 1)." WHERE username='$username'", 'UNBUFFERED'); + } + } + } else { + $user_status = $_userid ? 1 : 0; + if($_username && $item['username'] == $_username) { + $member = userinfo($item['username']); + $user_status = 3; + } + } + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); +} else { + $itemid or dheader($MOD['mobile']); + $item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + ($item && $item['status'] > 2) or message($L['msg_not_exist']); + if($item['groupid'] == 2) message($L['msg_not_exist']); + require DT_ROOT.'/include/content.class.php'; + extract($item); + $CAT = get_cat($catid); + if(!check_group($_groupid, $MOD['group_show']) || !check_group($_groupid, $CAT['group_show'])) message($L['msg_no_right']); + $member = array(); + $fee = DC::fee($item['fee'], $MOD['fee_view']); + include DT_ROOT.'/mobile/api/contact.inc.php'; + $content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); + $t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); + $content = $t['content']; + if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); + if($share_icon) $share_icon = DC::icon($thumb, $content); + $content = DC::format($content, 0); + } + $albums = get_albums($item); + $editdate = timetodate($edittime, 5); + $could_message = ($user_status == 3 && $username && $username != $_username) ? 1 : 0; + $update = ''; + $head_title = $head_name = $CAT['catname']; + $js_item = $js_album = 1; + $foot = ''; +} +if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php'; +$seo_file = 'show'; +include DT_ROOT.'/include/seo.inc.php'; +$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); +include template($template, $module); +?> \ No newline at end of file diff --git a/module/job/admin/config.inc.php b/module/job/admin/config.inc.php new file mode 100644 index 0000000..a5ff82a --- /dev/null +++ b/module/job/admin/config.inc.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/module/job/admin/html.inc.php b/module/job/admin/html.inc.php new file mode 100644 index 0000000..55e2019 --- /dev/null +++ b/module/job/admin/html.inc.php @@ -0,0 +1,153 @@ +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 'update_resume': + $table = $table_resume; + $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; + } + if(!isset($tid)) { + $r = $db->get_one("SELECT max(itemid) AS tid FROM {$table} WHERE status>2 {$sql}"); + $tid = $r['tid'] ? $r['tid'] : 0; + } + require DT_ROOT.'/module/'.$module.'/resume.class.php'; + $do = new resume($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']; + $do->update($itemid); + } + $itemid += 1; + } else { + $itemid = $fid + $num; + } + } else { + dmsg('更新成功', $this_forward); + } + msg('ID从'.$fid.'至'.($itemid-1).'简历更新成功', "?moduleid=$moduleid&file=$file&action=$action&fid=$itemid&tid=$tid&num=$num"); + 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; + $r = $db->get_one("SELECT min(itemid) AS fid,max(itemid) AS tid FROM {$table_resume} WHERE status>2"); + $rfid = $r['fid'] ? $r['fid'] : 0; + $rtid = $r['tid'] ? $r['tid'] : 0; + include tpl('html', $module); + break; +} +?> \ No newline at end of file diff --git a/module/job/admin/template/html.tpl.php b/module/job/admin/template/html.tpl.php new file mode 100644 index 0000000..3751f94 --- /dev/null +++ b/module/job/admin/template/html.tpl.php @@ -0,0 +1,77 @@ + +
+ + + + +
  +   +   +   +   + +
+
+
+ + + + + + + + + + + + + +
起始ID结束ID每轮生成数量操作
  + +
+
+
+ + + + + + + + + + + +
选择分类每轮生成数量操作
+ +     +第 页 至 页 + +  + +
+
+
+ + + + + + + + + + + + + +
起始ID结束ID每轮生成数量操作
+ +
+
+ + \ No newline at end of file diff --git a/module/job/admin/template/index.html b/module/job/admin/template/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/job/admin/template/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/job/admin/template/index.tpl.php b/module/job/admin/template/index.tpl.php new file mode 100644 index 0000000..92956e4 --- /dev/null +++ b/module/job/admin/template/index.tpl.php @@ -0,0 +1,207 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
信息标题行业职位部门人数 会员添加时间 更新时间 浏览 点赞 反对 收藏 打赏 赏金 分享 举报 评论 操作
  + + + + + + + + + + + + +  + +
+ +
+ + + +  +  +  +  +  + + + + +批量延长过期时间 +天 + + +  +  +  + + + +  +  + + + +  +  +  + + + +  +  +  +  +  +  +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/job/admin/uninstall.inc.php b/module/job/admin/uninstall.inc.php new file mode 100644 index 0000000..c6a1f02 --- /dev/null +++ b/module/job/admin/uninstall.inc.php @@ -0,0 +1,9 @@ +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."_apply_".$moduleid."`"); +$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_talent_".$moduleid."`"); +$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_resume_".$moduleid."`"); +$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_resume_data_".$moduleid."`"); +?> \ No newline at end of file diff --git a/module/job/index.htm.php b/module/job/index.htm.php new file mode 100644 index 0000000..eccf288 --- /dev/null +++ b/module/job/index.htm.php @@ -0,0 +1,47 @@ +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); + $r['parentid'] = $CATEGORY[$r['catid']]['parentid'] ? $CATEGORY[$r['catid']]['parentid'] : $r['catid']; + $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; +?> \ No newline at end of file diff --git a/module/job/job.class.php b/module/job/job.class.php new file mode 100644 index 0000000..4a9f9e1 --- /dev/null +++ b/module/job/job.class.php @@ -0,0 +1,289 @@ +moduleid = $moduleid; + $this->table = $table; + $this->table_data = $table_data; + $this->split = $MOD['split']; + $this->fields = array('catid','areaid','level','title','style','fee','introduce','department','total','minsalary','maxsalary','type','gender','marriage','education','minage','maxage','experience','status','hits','username','truename','telephone', 'mobile','address','email','qq','wx','ali','skype','sex','totime','editor','addtime','adddate','edittime','editdate','ip','template','linkurl','filepath','note','company'); + } + + function job($moduleid) { + $this->__construct($moduleid); + } + + function pass($post) { + global $MOD; + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_cate')); + if(strlen($post['title']) < 3) return $this->_(lang('message->pass_job_title')); + if(!$post['areaid']) return $this->_(lang('message->pass_job_areaid')); + if(!$post['content']) return $this->_(lang('message->pass_job_content')); + if($post['totime']) { + if(!is_time($post['totime'])) return $this->_(lang('message->pass_date')); + if(datetotime($post['totime']) < DT_TIME) return $this->_(lang('message->pass_todate')); + } + if(!$post['truename']) return $this->_(lang('message->pass_truename')); + if(!$post['telephone']) return $this->_(lang('message->pass_telephone')); + if(!is_email(trim($post['email']))) return $this->_(lang('message->pass_email')); + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $TYPE, $_username, $_userid, $_cname; + $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['adddate'] = timetodate($post['addtime'], 3); + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['editdate'] = timetodate($post['edittime'], 3); + $post['totime'] = is_time($post['totime']) ? datetotime($post['totime']) : 0; + $post['fee'] = dround($post['fee']); + $post['total'] = intval($post['total']); + $post['minsalary'] = intval($post['minsalary']); + $post['maxsalary'] = intval($post['maxsalary']); + $post['type'] = intval($post['type']); + $post['gender'] = intval($post['gender']); + $post['education'] = intval($post['education']); + $post['experience'] = intval($post['experience']); + $post['minage'] = intval($post['minage']); + $post['maxage'] = intval($post['maxage']); + $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']; + $r = $this->get_one(); + $old = $r['content']; + delete_diff($new, $old); + } else { + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'edittime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $CATEGORY, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['userurl'] = userurl($r['username']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $r['parentid'] = $CATEGORY[$r['catid']]['parentid'] ? $CATEGORY[$r['catid']]['parentid'] : $r['catid']; + $lists[] = $r; + } + 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'], $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'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.$item['department'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')).strip_tags(area_pos($item['areaid'], ',')); + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $item['itemid'] = $itemid; + $linkurl = itemurl($item); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + $member = $item['username'] ? userinfo($item['username']) : array(); + if($member) { + foreach(array('groupid','vip','validated','company') as $v) { + if($item[$v] != $member[$v]) $update .= ",$v='".addslashes($member[$v])."'"; + } + } + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + } + if($all) { + $userid = get_user($r['username']); + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + } + } + } + + function check($itemid) { + global $_username, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + $this->itemid = $itemid; + $item = $this->get_one(); + if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { + credit_add($item['username'], $MOD['credit_add']); + credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + $editdate = timetodate(DT_TIME, 3); + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME.",editdate='$editdate' WHERE itemid=$itemid"); + history($this->moduleid, $itemid, 'del'); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function expire($condition = '') { + DB::query("UPDATE {$this->table} SET status=4 WHERE status=3 AND totime>0 AND totime<".DT_TIME." $condition"); + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function refresh($itemid) { + $editdate = timetodate(DT_TIME, 3); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET edittime='".DT_TIME."',editdate='$editdate' WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/job/list.inc.php b/module/job/list.inc.php new file mode 100644 index 0000000..7ecc330 --- /dev/null +++ b/module/job/list.inc.php @@ -0,0 +1,89 @@ +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 = 3; + 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']; + $r['parentid'] = $CATEGORY[$r['catid']]['parentid'] ? $CATEGORY[$r['catid']]['parentid'] : $r['catid']; + $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); +?> \ No newline at end of file diff --git a/module/job/resume.inc.php b/module/job/resume.inc.php new file mode 100644 index 0000000..e0c2284 --- /dev/null +++ b/module/job/resume.inc.php @@ -0,0 +1,64 @@ +get_one("SELECT * FROM {$table_resume} WHERE itemid=$itemid AND status=3"); +if($item) { + if($item['open'] != 3) include load('404.inc'); + require DT_ROOT.'/include/content.class.php'; + extract($item); +} else { + include load('404.inc'); +} +$content = $db->get_one("SELECT content FROM {$table_resume_data} WHERE itemid=$itemid"); +$content = $content['content']; +$print = isset($print) ? 1 : 0; +$CAT = get_cat($catid); +if(!check_group($_groupid, $MOD['group_show_resume']) || !check_group($_groupid, $CAT['group_show'])) include load('403.inc'); +$parentid = $CATEGORY[$catid]['parentid'] ? $CATEGORY[$catid]['parentid'] : $catid; +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$linkurl = $MOD['linkurl'].$linkurl; +$user_status = 4; +$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']; +if(check_group($_groupid, $MOD['group_contact_resume'])) { + if($MG['fee_mode'] && $MOD['fee_mode']) { + $user_status = 3; + } else { + if($fee) { + $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; +$description = ''; +if($print && $DT_PC) { + if($user_status != 3) dheader($linkurl); + include template('print', $module); + exit; +} +if(!$DT_BOT) $db->query("UPDATE LOW_PRIORITY {$table_resume} SET hits=hits+1 WHERE itemid=$itemid", 'UNBUFFERED'); +include DT_ROOT.'/include/seo.inc.php'; +$seo_title = lang($L['resume_title'], array($truename)).$seo_delimiter.$seo_catname.$seo_modulename.$seo_delimiter.$seo_sitename; +$head_keywords = $keyword; +$head_description = $introduce ? $introduce : $title; +$template = $item['template'] ? $item['template'] : ($MOD['template_resume'] ? $MOD['template_resume'] : 'resume'); +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + // +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/job/search.inc.php b/module/job/search.inc.php new file mode 100644 index 0000000..dca2e8e --- /dev/null +++ b/module/job/search.inc.php @@ -0,0 +1,174 @@ + $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 = '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($thumb) $condition .= " AND thumb<>''"; + if($vip) $condition .= " AND vip>0"; + if($minsalary) $condition .= " AND minsalary>$minsalary"; + if($maxsalary) $condition .= " AND maxsalary<$maxsalary"; + if($fromtime) $condition .= " AND edittime>=$fromtime"; + if($totime) $condition .= " AND edittime<=$totime"; + if($level) $condition .= " AND level=$level"; + if($gender) $condition .= " AND gender=$gender"; + if($type) $condition .= " AND type=$type"; + if($marriage) $condition .= " AND marriage=$marriage"; + if($education) $condition .= " AND education>=$education"; + if($experience) $condition .= " AND experience>=$experience"; + if($minsalary) $condition .= " AND minsalary>=$minsalary"; + if($maxsalary) $condition .= " AND maxsalary<=$maxsalary"; + $GENDER[0] = $L['all_gender']; + $TYPE[0] = $L['all_work']; + $MARRIAGE[0] = $L['all_marriage']; + $EDUCATION[0] = $L['all_education']; + $pagesize = $MOD['pagesize']; + $offset = ($page-1)*$pagesize; + if($pptsql) $condition .= $pptsql;//PPT + + $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']; + $r['parentid'] = $CATEGORY[$r['catid']]['parentid'] ? $CATEGORY[$r['catid']]['parentid'] : $r['catid']; + $tags[] = $r; + } + $db->free_result($result); + } + } + if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); + $showpage = 1; + $datetype = 5; + $target = '_blank'; + 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('dmaxsalary', 'amaxsalary', 'dhits', 'dcomments'))) or $orderby = ''; + $tags = array(); + if($DT_QST) { + $condition = "status=3"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= $CAT['child'] ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($elite) $condition .= " AND level>0"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize); + if($items) { + $order = $MOD['order']; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + if($kw) $r['title'] = str_replace($kw, ''.$kw.'', $r['title']); + $r['linkurl'] = $MOD['mobile'].$r['linkurl']; + $r['date'] = timetodate($r[$time], 3); + $r['parentid'] = $CATEGORY[$r['catid']]['parentid'] ? $CATEGORY[$r['catid']]['parentid'] : $r['catid']; + $tags[] = $r; + } + $db->free_result($result); + $js_load = preg_replace("/(.*)([&?]page=[0-9]*)(.*)/i", "\\1\\3", rewrite($DT_URL, 1)).'&job=ajax'; + } + if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); + } + if($job == 'ajax') { + if($tags) include template('list-'.$module, 'tag'); + exit; + } + $head_title = $MOD['name'].$L['search']; +} +$seo_file = 'search'; +include DT_ROOT.'/include/seo.inc.php'; +include template($MOD['template_search'] ? $MOD['template_search'] : 'search', $module); +?> \ No newline at end of file diff --git a/module/know/admin/install.inc.php b/module/know/admin/install.inc.php new file mode 100644 index 0000000..037ee51 --- /dev/null +++ b/module/know/admin/install.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/module/know/admin/remkdir.inc.php b/module/know/admin/remkdir.inc.php new file mode 100644 index 0000000..00ed378 --- /dev/null +++ b/module/know/admin/remkdir.inc.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/module/know/admin/setting.inc.php b/module/know/admin/setting.inc.php new file mode 100644 index 0000000..c0d7609 --- /dev/null +++ b/module/know/admin/setting.inc.php @@ -0,0 +1,50 @@ +$v) { + if(strpos($k, 'seo_') === false) continue; + seo_check($v) or msg('SEO信息包含非法字符'); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) { + $_MOD = $MOD; + $MOD = $setting; + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + while($r = $db->fetch_array($result)) { + update_category($r); + } + cache_category($moduleid); + $MOD = $_MOD; + } + if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + $r = $db->get_one("SELECT MAX(itemid) AS maxid FROM {$table}"); + $maxid = $r['maxid']; + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/know/admin/template/answer.tpl.php b/module/know/admin/template/answer.tpl.php new file mode 100644 index 0000000..89a8dd4 --- /dev/null +++ b/module/know/admin/template/answer.tpl.php @@ -0,0 +1,104 @@ + + +
+
+ + + + + + +$v) {?> + + + + + + +
答案内容操作
+
+ +支持 ()  |  +反对 ()  |  +举报 ()  |  +票数 () + +  + + + +Guest + + +(匿名) + +  专家 +
+
+ +
+ +
IP: -
+ + +
参考资料:
+ +
+  + +
+
+
+ +  + +  + +  +
+
+'.$pages.'' : '';?> + + + \ No newline at end of file diff --git a/module/know/admin/template/edit.tpl.php b/module/know/admin/template/edit.tpl.php new file mode 100644 index 0000000..d2ca382 --- /dev/null +++ b/module/know/admin/template/edit.tpl.php @@ -0,0 +1,163 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +', ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 审核提示该信息存在修改记录,点击查看 修改详情
* 问题分类
  搜索分类
* 标题
* 标题图片  [上传]  [预览]  [删除]
', $item) : '';?> +
* 问题说明 +
+
* 补充信息 +
* 悬赏 + +
* 最佳答案ID + + +
* 会员名 [资料]
* 匿名设定 + id="hidden_1"/>     + id="hidden_0"/> +
* 状态 + id="status_3"/> + id="status_2"/> + onclick="if(this.checked) Dd('note').style.display='';" id="status_1"/> + id="status_0"/> +
* 拒绝理由
* 添加时间
* 地区(分站)
* 浏览次数
* 内容收费大于0的数字表示具体收费价格');?> +
* 内容模板系统会自动继承分类或模块设置');?>
* 自定义文件路径  请确保目录和文件名合法且可写入,否则可能生成失败');?> 
+
    
+
+ + +
+ + + +
单页采编
+ + + + + +
* 目标网址    
+
+ + + + \ No newline at end of file diff --git a/module/know/admin/template/expert_edit.tpl.php b/module/know/admin/template/expert_edit.tpl.php new file mode 100644 index 0000000..4ec50a4 --- /dev/null +++ b/module/know/admin/template/expert_edit.tpl.php @@ -0,0 +1,65 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
* 会员名 [资料]
* 专家姓名
* 擅长领域
* 专家介绍 +
+
* 添加时间
+
    
+
+ + + + \ No newline at end of file diff --git a/module/know/admin/template/index.html b/module/know/admin/template/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/know/admin/template/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/know/admin/uninstall.inc.php b/module/know/admin/uninstall.inc.php new file mode 100644 index 0000000..3237c88 --- /dev/null +++ b/module/know/admin/uninstall.inc.php @@ -0,0 +1,8 @@ +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."_answer_".$moduleid."`"); +$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_expert_".$moduleid."`"); +$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_vote_".$moduleid."`"); +?> \ No newline at end of file diff --git a/module/know/answer.inc.php b/module/know/answer.inc.php new file mode 100644 index 0000000..5172043 --- /dev/null +++ b/module/know/answer.inc.php @@ -0,0 +1,286 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +$item['status'] > 2 or exit; +$item or exit; +include load('misc.lang'); +$linkurl = $MOD['linkurl'].$item['linkurl']; +$aid = isset($aid) ? intval($aid) : 0; +$aser = $aid ? $db->get_one("SELECT * FROM {$table_answer} WHERE itemid=$aid AND status=3") : array(); +if($aser && $aser['qid'] != $itemid) exit; +$could_admin = $could_addition = $could_close = $_username && $_username == $item['username']; +if($item['process'] > 1) $could_addition = $could_close = false; +$could_answer = false; +switch($action) { + case 'addition': + if($could_addition) { + $content = dhtmlspecialchars($content); + $db->query("UPDATE {$table} SET addition='$content' WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module); + } + dalert('', $linkurl); + break; + case 'vote': + $could_vote = $could_admin; + if($item['process'] != 1) $could_vote = false; + if($could_vote) { + $items = $db->count($table_answer, "qid=$itemid AND status=3"); + if($items < 2) $could_vote = false; + } + if($could_vote) { + $totime = $DT_TIME + $MOD['votedays']*86400; + $db->query("UPDATE {$table} SET process=2,totime=$totime WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module); + } + dalert('', $linkurl); + break; + case 'vote_del': + if($item['process'] != 2) dalert($L['vote_end']); + $items = $db->count($table_answer, "qid=$itemid AND status=3"); + if($items < 3) dalert($L['min_answer']); + if($aser['qid'] == $itemid) $db->query("DELETE FROM {$table_answer} WHERE itemid=$aid"); + dalert('', '', 'parent.window.location=parent.window.location;'); + break; + case 'vote_add': + $could_vote = check_group($_groupid, $MOD['group_vote']); + if(get_cookie('answer_vote_'.$itemid)) $could_vote = false; + if($could_vote) { + if($_userid) { + $v = $db->get_one("SELECT itemid FROM {$table_vote} WHERE qid=$itemid AND username='$_username'"); + } else { + $v = $db->get_one("SELECT itemid FROM {$table_vote} WHERE qid=$itemid AND ip='$DT_IP' AND addtime>$DT_TIME-86400"); + } + } + if($v) $could_vote = false; + set_cookie('answer_vote_'.$itemid, 1, $DT_TIME + 86400); + if($could_vote) { + $db->query("INSERT INTO {$table_vote} (qid,aid,username,passport,addtime,ip) VALUES ('$itemid','$aid','$_username','$_passport','$DT_TIME','$DT_IP')"); + $db->query("UPDATE {$table_answer} SET vote=vote+1 WHERE itemid=$aid"); + if($MOD['credit_vote'] && $_username) { + $could_credit = true; + if($MOD['credit_maxvote'] > 0) { + $r = $db->get_one("SELECT SUM(amount) AS total FROM {$DT_PRE}finance_credit WHERE username='$_username' AND addtime>$DT_TIME-86400 AND reason='".$L['vote_answer']."'"); + if($r['total'] > $MOD['credit_maxvote']) $could_credit = false; + } + if($could_credit) { + credit_add($_username, $MOD['credit_vote']); + credit_record($_username, $MOD['credit_vote'], 'system', $L['vote_answer'], 'ID:'.$itemid); + } + } + dalert('', '', 'parent.window.location=parent.window.location;'); + } else { + dalert($L['vote_reject'], '', 'parent.window.location=parent.window.location;'); + } + break; + case 'vote_show': + if($item['process'] != 2) dalert($L['vote_end'], 'goback'); + $votes = array(); + $result = $db->query("SELECT * FROM {$table_answer} WHERE qid=$itemid AND status=3 ORDER BY itemid ASC"); + $total = 0; + while($r = $db->fetch_array($result)) { + $total += $r['vote']; + $votes[] = $r; + } + foreach($votes as $k=>$v) { + $votes[$k]['precent'] = $total ? dround($v['vote']*100/$total, 2, true).'%' : '1%'; + } + break; + case 'close': + if($could_close) { + $db->query("UPDATE {$table} SET process=0 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module); + } + dalert('', $linkurl); + break; + case 'choose': + $could_choose = $could_admin; + if($item['process'] != 1) $could_choose = false; + $aid = intval($aid); + if(!$aid) $could_choose = false; + if($could_choose) { + $a = $db->get_one("SELECT * FROM {$table_answer} WHERE itemid=$aid AND qid=$itemid"); + if($a) { + $content = dhtmlspecialchars($thx); + $expert = $a['expert'] ? $a['username'] : ''; + if($expert) $db->query("UPDATE {$table_expert} SET best=best+1 WHERE username='$expert'"); + $db->query("UPDATE {$table} SET process=3,aid=$aid,expert='$expert',comment='$content',updatetime='$DT_TIME' WHERE itemid=$itemid"); + if($a['username']) { + if($item['credit']) { + credit_add($a['username'], $item['credit']); + credit_record($a['username'], $item['credit'], 'system', lang($L['record_reward'], array($MODULE[$moduleid]['name'])), 'ID:'.$itemid); + } + if($MOD['credit_best']) { + credit_add($a['username'], $MOD['credit_best']); + credit_record($a['username'], $MOD['credit_best'], 'system', lang($L['record_best'], array($MODULE[$moduleid]['name'])), 'ID:'.$itemid); + } + $credit = intval($credit); + if(in_array($credit, $CREDITS) && $credit > 1 && $credit <= $_credit) { + credit_add($_username, -$credit); + credit_record($_username, -$credit, 'system', lang($L['record_thank'], array($MODULE[$moduleid]['name'])), 'ID:'.$itemid); + credit_add($a['username'], $credit); + credit_record($a['username'], $credit, 'system', lang($L['record_thank'], array($MODULE[$moduleid]['name'])), 'ID:'.$itemid); + } + } + if($MOD['show_html']) tohtml('show', $module); + } + } + dalert('', $linkurl); + break; + case 'raise': + $credit = intval($credit); + if($credit < 1 || !in_array($credit, $CREDITS)) dalert($L['select_credit'], 'goback'); + if($credit > $_credit) dalert($L['lack_credit'], 'goback'); + $could_raise = $could_admin; + if($item['process'] != 1) $could_raise = false; + if($item['raise'] >= $MOD['maxraise']) $could_raise = false; + if($could_raise) { + if($credit >= $MOD['raisecredit']) { + $addtime = $DT_TIME; + $totime = $DT_TIME + $MOD['overdays']*86400 + $MOD['raisedays']*86400; + } else { + $addtime = $item['addtime']; + $totime = $item['totime'] + $MOD['raisedays']*86400; + } + $db->query("UPDATE {$table} SET credit=credit+$credit,raise=raise+1,addtime=$addtime,totime=$totime WHERE itemid=$itemid"); + credit_add($_username, -$credit); + credit_record($_username, -$credit, 'system', lang($L['record_addto'], array($MODULE[$moduleid]['name'])), 'ID:'.$itemid); + if($MOD['show_html']) tohtml('show', $module); + } + dalert('', $linkurl); + break; + default: + $could_answer = check_group($_groupid, $MOD['group_answer']); + if($item['process'] != 1 || $could_admin) $could_answer = false; + if($MOD['answer_pagesize']) { + $pagesize = $MOD['answer_pagesize']; + $offset = ($page-1)*$pagesize; + } + $need_captcha = $MOD['captcha_answer'] == 2 ? $MG['captcha'] : $MOD['captcha_answer']; + $need_question = $MOD['question_answer'] == 2 ? $MG['question'] : $MOD['question_answer']; + if($could_answer && !$MOD['answer_repeat']) { + if($_username) { + $r = $db->get_one("SELECT itemid FROM {$table_answer} WHERE username='$_username' AND qid=$itemid"); + } else { + $r = $db->get_one("SELECT itemid FROM {$table_answer} WHERE ip='$DT_IP' AND qid=$itemid AND addtime>$DT_TIME-86400"); + } + if($r) $could_answer = false; + } + + if($submit && $could_answer) { + $msg = captcha($captcha, $need_captcha, true); + if($msg) dalert($msg); + $msg = question($answer, $need_question, true); + if($msg) dalert($msg); + $content = dhtmlspecialchars(strip_tags(trim($content))); + if(!$content) dalert($L['type_answer']); + $content = nl2br($content); + is_url($url) or $url = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_answer']; + $status = get_status(3, $need_check); + $hidden = isset($hidden) ? 1 : 0; + $expert = 0; + if($_username) { + $t = $db->get_one("SELECT itemid FROM {$table_expert} WHERE username='$_username'"); + if($t) { + $expert = 1; + $db->query("UPDATE {$table_expert} SET answer=answer+1 WHERE username='$_username'"); + } + } + $db->query("INSERT INTO {$table_answer} (qid,url,content,username,passport,expert,addtime,ip,status,hidden) VALUES ('$itemid','$url','$content','$_username','$_passport','$expert','$DT_TIME','$DT_IP','$status','$hidden')"); + if($MOD['credit_answer'] && $_username && $status == 3) { + $could_credit = true; + if($MOD['credit_maxanswer'] > 0) { + $r = $db->get_one("SELECT SUM(amount) AS total FROM {$DT_PRE}finance_credit WHERE username='$_username' AND addtime>$DT_TIME-86400 AND reason='".$L['answer_question']."'"); + if($r['total'] >= $MOD['credit_maxanswer']) $could_credit = false; + } + if($could_credit) { + credit_add($_username, $MOD['credit_answer']); + credit_record($_username, $MOD['credit_answer'], 'system', $L['answer_question'], 'ID:'.$itemid); + } + } + if($MOD['answer_message'] && $item['username']) { + send_message($item['username'], lang($L['answer_msg_title'], array(dsubstr($item['title'], 20, '...'))), lang($L['answer_msg_content'], array($item['title'], stripslashes($content), $linkurl))); + } + if($status == 3) { + $items = isset($items) ? intval($items)+1 : 1; + $page = ceil($items/$pagesize); + $forward = 'answer.php?itemid='.$itemid.'&page='.$page.'&rand='.mt_rand(10, 99).'#last'; + dalert('', '', 'parent.window.location="'.$forward.'";'); + } else { + dalert($L['answer_check'], '', 'parent.window.location=parent.window.location;'); + } + } else { + $could_vote = check_group($_groupid, $MOD['group_vote']); + if(get_cookie('answer_vote_'.$itemid)) $could_vote = false; + $pages = ''; + $answers = array(); + $items = $db->count($table_answer, "qid=$itemid AND status=3 AND itemid!=$item[aid]"); + $a = $items; + if($item['aid']) $a += 1; + if($item['answer'] != $a) { + $item['answer'] = $a; + $db->query("UPDATE {$table} SET answer=$a WHERE itemid=$itemid"); + } + if($item['process'] == 1 && $item['username'] && !$item['message'] && $MOD['messagedays']) { + if($item['totime'] - $DT_TIME < $MOD['messagedays']*86400) { + send_message($item['username'], lang($L['expired_msg_title'], array(dsubstr($item['title'], 20, '...'))), lang($L['expired_msg_content'], array($linkurl))); + $db->query("UPDATE {$table} SET message=1 WHERE itemid=$itemid"); + } + } + if($DT_TIME > $item['totime']) { + $reload = false; + if($item['process'] == 1) { + if($item['username'] && $MOD['credit_deal'] > 0) { + credit_add($item['username'], -$MOD['credit_deal']); + credit_record($item['username'], -$MOD['credit_deal'], 'system', lang($L['record_expired'], array($MODULE[$moduleid]['name'])), 'ID:'.$itemid); + } + if($item['answer'] > 1) { + $totime = $DT_TIME + $MOD['votedays']*86400; + $db->query("UPDATE {$table} SET process=2,totime=$totime,updatetime='$DT_TIME' WHERE itemid=$itemid"); + } else { + $db->query("UPDATE {$table} SET process=0,updatetime='$DT_TIME' WHERE itemid=$itemid"); + } + $reload = true; + } else if($item['process'] == 2) { + $a = $db->get_one("SELECT * FROM {$table_answer} WHERE qid=$itemid ORDER BY vote DESC"); + if($a && $a['vote'] > $MOD['minvote']) { + $aid = intval($a['itemid']); + $expert = $a['expert'] ? $a['username'] : ''; + if($expert) $db->query("UPDATE {$table_expert} SET best=best+1 WHERE username='$expert'"); + $db->query("UPDATE {$table} SET process=3,aid=$aid,expert='$expert',updatetime='$DT_TIME' WHERE itemid=$itemid"); + if($a['username']) { + if($item['credit']) { + credit_add($a['username'], $item['credit']); + credit_record($a['username'], $item['credit'], 'system', lang($L['record_reward'], array($MODULE[$moduleid]['name'])), 'ID:'.$itemid); + } + if($MOD['credit_best']) { + credit_add($a['username'], $MOD['credit_best']); + credit_record($a['username'], $MOD['credit_best'], 'system', lang($L['record_best'], array($MODULE[$moduleid]['name'])), 'ID:'.$itemid); + } + } + } else { + $db->query("UPDATE {$table} SET process=0,updatetime='$DT_TIME' WHERE itemid=$itemid"); + } + $reload = true; + } + if($reload) { + if($MOD['show_html']) tohtml('show', $module); + dalert('', '', 'top.window.location.reload();'); + } + } + $pages = pages($items, $page, $pagesize); + $result = $db->query("SELECT * FROM {$table_answer} WHERE qid=$itemid AND status=3 ORDER BY itemid ASC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + if($r['itemid'] == $aid) continue; + $answers[] = $r; + } + $head_title = $L['answer_question'].$DT['seo_delimiter'].$item['title'].$DT['seo_delimiter'].$MOD['name']; + } + break; +} +include template($MOD['template_answer'] ? $MOD['template_answer'] : 'answer', $module); +?> \ No newline at end of file diff --git a/module/know/common.inc.php b/module/know/common.inc.php new file mode 100644 index 0000000..f6e115f --- /dev/null +++ b/module/know/common.inc.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/module/know/expert.inc.php b/module/know/expert.inc.php new file mode 100644 index 0000000..0c4e24f --- /dev/null +++ b/module/know/expert.inc.php @@ -0,0 +1,46 @@ +get_one("SELECT * FROM {$table_expert} WHERE username='$username'"); + if($t) $itemid = $t['itemid']; +} +if($itemid) { + $item = $db->get_one("SELECT * FROM {$table_expert} WHERE itemid=$itemid"); + if($item) { + extract($item); + } else { + include load('404.inc'); + } + $rate = ($answer && $best < $answer) ? dround($best*100/$answer, 2, true).'%' : '100%'; + if(!$DT_BOT && $page == 1) $db->query("UPDATE LOW_PRIORITY {$table_expert} SET hits=hits+1 WHERE itemid=$itemid", 'UNBUFFERED'); + include DT_ROOT.'/include/seo.inc.php'; + $seo_title = $title.$seo_delimiter.$L['expert_title'].$seo_delimiter.$seo_page.$seo_modulename.$seo_delimiter.$seo_sitename; +} else { + $condition = "1"; + if($keyword) $condition .= match_kw('title', $keyword); + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_expert} WHERE $condition"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = array(); + if($items) { + $result = $db->query("SELECT * FROM {$table_expert} WHERE $condition ORDER BY addtime DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $lists[] = $r; + } + $db->free_result($result); + } + include DT_ROOT.'/include/seo.inc.php'; + $seo_title = $L['expert_title'].$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 { + $head_name = $L['expert_title']; + if($sns_app) $seo_title = $MOD['name']; +} +include template($MOD['template_expert'] ? $MOD['template_expert'] : 'expert', $module); +?> \ No newline at end of file diff --git a/module/know/global.func.php b/module/know/global.func.php new file mode 100644 index 0000000..7ca7b97 --- /dev/null +++ b/module/know/global.func.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/module/know/index.html b/module/know/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/know/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/know/know.class.php b/module/know/know.class.php new file mode 100644 index 0000000..de235d3 --- /dev/null +++ b/module/know/know.class.php @@ -0,0 +1,300 @@ +moduleid = $moduleid; + $this->table = $table; + $this->table_data = $table_data; + $this->split = $MOD['split']; + $this->fields = array('catid','areaid','level','title','style','fee','credit','aid','process','hidden','introduce','addition','thumb','tag','status','hits','username','ask','addtime','totime','editor','edittime','ip','template', 'linkurl','filepath','note'); + } + + function know($moduleid) { + $this->__construct($moduleid); + } + + function pass($post) { + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_catid')); + if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $_username, $_userid, $_cname; + is_url($post['thumb']) or $post['thumb'] = ''; + $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['credit'] = intval($post['credit']); + $post['fee'] = dround($post['fee']); + $post['hidden'] = (isset($post['hidden']) && $post['hidden']) ? 1 : 0; + $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 .= ''; + $r = $this->get_one(); + $old = $r['content']; + if($r['thumb']) $old .= ''; + delete_diff($new, $old); + } else { + $post['aid'] = 0; + $post['totime'] = DT_TIME + $MOD['overdays']*86400; + $post['process'] = 1; + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) { + credit_add($post['username'], $MOD['credit_add']); + credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'], $this->itemid); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + global $table_answer; + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')); + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $item['itemid'] = $itemid; + $linkurl = itemurl($item); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + if($item['process'] == 0 || $item['process'] == 3) { + $answer = DB::count($table_answer, "qid=$itemid AND status=3"); + if($answer != $item['answer']) $update .= ",answer='$answer'"; + } + if($item['username']) { + $passport = addslashes(get_user($item['username'], 'username', 'passport')); + if($passport != $item['passport']) $update .= ",passport='$passport'"; + } + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD, $table_answer, $table_vote; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + } + if($all) { + $userid = get_user($r['username']); + if($r['thumb']) delete_upload($r['thumb'], $userid); + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + DB::query("DELETE FROM {$table_vote} WHERE qid=$itemid"); + $result = DB::query("SELECT * FROM {$table_answer} WHERE qid=$itemid"); + while($rr = DB::fetch_array($result)) { + if($rr['content']) delete_local($rr['content'], get_user($rr['username'])); + } + DB::query("DELETE FROM {$table_answer} WHERE qid=$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 active($itemid) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->active($v); } + } else { + $totime = DT_TIME + $MOD['overdays']*86400; + DB::query("UPDATE {$this->table} SET totime=$totime,process=1,updatetime=".DT_TIME." WHERE itemid=$itemid AND process=0"); + $this->tohtml($itemid); + return true; + } + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/know/list.inc.php b/module/know/list.inc.php new file mode 100644 index 0000000..7764fdd --- /dev/null +++ b/module/know/list.inc.php @@ -0,0 +1,93 @@ +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; + $target = '_blank'; + 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']); + $typeid = isset($typeid) ? intval($typeid) : 0; + in_array($typeid, array(0, 1, 2)) or $typeid = 0; + $condition = "status=3"; + if($typeid == 1) $condition .= " AND process=1"; + if($typeid == 2) $condition .= " AND process=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); +?> \ No newline at end of file diff --git a/module/know/my_answer.inc.php b/module/know/my_answer.inc.php new file mode 100644 index 0000000..13bce4d --- /dev/null +++ b/module/know/my_answer.inc.php @@ -0,0 +1,142 @@ +get_one("SELECT COUNT(*) AS num FROM {$table_answer} WHERE $sql AND status>1 AND addtime>$today"); + $limit_used = $r['num']; + $limit_free = $answer_limit > $limit_used ? $answer_limit - $limit_used : 0; +} +switch($action) { + case 'add': + $itemid or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); + $item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + $item['status'] > 2 or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); + $linkurl = ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$item['linkurl']; + $could_answer = check_group($_groupid, $MOD['group_answer']); + if($item['process'] != 1 || ($_username && $_username == $item['username'])) $could_answer = false; + $need_captcha = $MOD['captcha_answer'] == 2 ? $MG['captcha'] : $MOD['captcha_answer']; + $need_question = $MOD['question_answer'] == 2 ? $MG['question'] : $MOD['question_answer']; + if($could_answer && !$MOD['answer_repeat']) { + if($_username) { + $r = $db->get_one("SELECT itemid FROM {$table_answer} WHERE username='$_username' AND qid=$itemid"); + } else { + $r = $db->get_one("SELECT itemid FROM {$table_answer} WHERE ip='$DT_IP' AND qid=$itemid AND addtime>$DT_TIME-86400"); + } + if($r) $could_answer = false; + } + $could_answer or dheader($linkurl); + if($submit) { + $msg = captcha($captcha, $need_captcha, true); + if($msg) dalert($msg); + $msg = question($answer, $need_question, true); + if($msg) dalert($msg); + $content = stripslashes(trim($content)); + if(!$content) dalert($L['type_answer']); + $content = save_local($content); + if($MOD['clear_alink']) $content = clear_link($content); + if($MOD['save_remotepic']) $content = save_remote($content); + $content = dsafe($content); + $content = addslashes($content); + is_url($url) or $url = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_answer']; + $status = get_status(3, $need_check); + $hidden = isset($hidden) ? 1 : 0; + $expert = 0; + if($_username) { + $t = $db->get_one("SELECT itemid FROM {$table_expert} WHERE username='$_username'"); + if($t) { + $expert = 1; + $db->query("UPDATE {$table_expert} SET answer=answer+1 WHERE username='$_username'"); + } + } + $db->query("INSERT INTO {$table_answer} (qid,url,content,username,passport,expert,addtime,ip,status,hidden) VALUES ('$itemid','$url','$content','$_username','$_passport','$expert','$DT_TIME','$DT_IP','$status','$hidden')"); + $aid = $db->insert_id(); + clear_upload($content, $aid, $table_answer); + if($MOD['credit_answer'] && $_username && $status == 3) { + $could_credit = true; + if($MOD['credit_maxanswer'] > 0) { + $r = $db->get_one("SELECT SUM(amount) AS total FROM {$DT_PRE}finance_credit WHERE username='$_username' AND addtime>$DT_TIME-86400 AND reason='".$L['answer_question']."'"); + if($r['total'] >= $MOD['credit_maxanswer']) $could_credit = false; + } + if($could_credit) { + credit_add($_username, $MOD['credit_answer']); + credit_record($_username, $MOD['credit_answer'], 'system', $L['answer_question'], 'ID:'.$itemid); + } + } + if($MOD['answer_message'] && $item['username']) { + send_message($item['username'], lang($L['answer_msg_title'], array(dsubstr($item['title'], 20, '...'))), lang($L['answer_msg_content'], array($item['title'], stripslashes($content), $linkurl))); + } + dalert($status == 3 ? $L['answer_success'] : $L['answer_check'], '', 'parent.window.location="'.$linkurl.'";'); + } else { + $content = $url = $hidden = ''; + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $r = $do->get_one(); + if(!$r || $r['username'] != $_username) message(); + + $qid = $r['qid']; + $item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$qid"); + + 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']))); + + $need_question = $need_captcha = ''; + + if($submit) { + $content = stripslashes(trim($content)); + if(!$content) dalert($L['type_answer']); + $content = save_local($content); + if($MOD['clear_alink']) $content = clear_link($content); + if($MOD['save_remotepic']) $content = save_remote($content); + $content = dsafe($content); + $content = addslashes($content); + clear_upload($content, $itemid, $table_answer); + is_url($url) or $url = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_answer']; + $status = get_status($r['status'], $need_check); + $hidden = isset($hidden) ? 1 : 0; + $db->query("UPDATE {$table_answer} SET content='$content',url='$url',hidden='$hidden',status='$status',edittime='$DT_TIME' WHERE itemid=$itemid"); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, 'answer-'.$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 { + extract($r); + } + 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); + $lists = $do->get_list($condition, $MOD['order']); + break; +} +if($_userid) { + $nums = array(); + for($i = 2; $i < 4; $i++) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table_answer} 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 = ''; +} +$head_title = $L['answer_title']; +include template($MOD['template_my_answer'] ? $MOD['template_my_answer'] : 'my_know_answer', 'member'); +?> \ No newline at end of file diff --git a/module/know/task.inc.php b/module/know/task.inc.php new file mode 100644 index 0000000..fa5c663 --- /dev/null +++ b/module/know/task.inc.php @@ -0,0 +1,71 @@ +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) { + $best = $aid ? $db->get_one("SELECT * FROM {$table_answer} WHERE itemid=$aid") : array(); + if($_username && $best && $_username == $best['username']) $user_status = 3; + if($user_status == 2 && $best) $description = DC::description($best['content'], $MOD['pre_view']); + } + $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); + } +} +?> \ No newline at end of file diff --git a/module/mall/admin/index.html b/module/mall/admin/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/mall/admin/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/mall/admin/install.inc.php b/module/mall/admin/install.inc.php new file mode 100644 index 0000000..782422f --- /dev/null +++ b/module/mall/admin/install.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/module/mall/admin/template/edit.tpl.php b/module/mall/admin/template/edit.tpl.php new file mode 100644 index 0000000..60b61ee --- /dev/null +++ b/module/mall/admin/template/edit.tpl.php @@ -0,0 +1,839 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +', ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 审核提示该信息存在修改记录,点击查看 修改详情
* 商品分类
  搜索分类
* 商品条码  [选择]  [管理]
* 商品名称
* 商品卖点
* 卖点链接  链接文字
* 商品品牌
* 价格模式 + checked id="mode_0" onclick="Dmode(0);"/> +     + checked id="mode_1" onclick="Dmode(1);"/> +     + checked id="mode_2" onclick="Dmode(2);"/> +     + checked id="mode_3" onclick="Dmode(3);"/> +
* 商品单价
* 商品价格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
数量价格数量价格
填写示例
+ +
* 商品库存
* 商品属性 + + + + + + + + + + + + + + + + + + + + + + + + + + +
属性名称属性值* 价格
例如:颜色例如:黑色|白色|红色|蓝色 多个属性用|分隔例如:100.00|200.00|300.00|400.00 多个价格用|分隔
+ +
* 销售属性点击设置
', $item) : '';?> +
* 商品图片 +
+ $v) { ?> +
+ +
+

+
+ +
+
+
+ +
+

+
+
+
+
+

批量上传

+
+ + + +
* 宣传视频  [上传]  [预览]  [删除]   + +
* 商品详情 +
+
* 运费设置 + + + + + + + + + + + + + + + + + + + + + + + + + +
快递默认运费增加一件商品增加选择模板 | 管理模板
+ +
+ +
+ +
+ 填写示例:包邮 / 满500包邮 / 快递10元 / 快递10元,满500包邮 +
* 货到付款 + +
* 会员名 [资料]
* 会员推荐产品 +/> 是    +/> 否 +
* 信息状态 +/> 通过 +/> 待审 + onclick="if(this.checked) Dd('note').style.display='';"/> 拒绝 +/> 下架 +/> 删除 +
* 拒绝理由
* 添加时间
* 浏览次数
* 内容收费大于0的数字表示具体收费价格');?> +
* 内容模板系统会自动继承分类或模块设置');?>
* 自定义文件路径  请确保目录和文件名合法且可写入,否则可能生成失败');?> 
+
    
+
+ + +
+ + + +
单页采编
+ + + + + +
* 目标网址    
+
+ + + + \ No newline at end of file diff --git a/module/mall/admin/template/order.tpl.php b/module/mall/admin/template/order.tpl.php new file mode 100644 index 0000000..51b1b48 --- /dev/null +++ b/module/mall/admin/template/order.tpl.php @@ -0,0 +1,170 @@ + + + +
+ + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + $t) { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
单号缩略图商品或服务单价 数量 交易总额 卖家买家下单时间 更新时间 状态 操作
+
+ +
+
+
+ 0) {?> + + +
+
+ 0) {?> + + +
+ + + + + +
+
+ +
+
小计 
+
+ +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/mall/admin/template/order_comment_edit.tpl.php b/module/mall/admin/template/order_comment_edit.tpl.php new file mode 100644 index 0000000..807ad65 --- /dev/null +++ b/module/mall/admin/template/order_comment_edit.tpl.php @@ -0,0 +1,313 @@ + + +
订单详情
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
卖家 
买家 
订单进程 +
+ + -
+ +
+
下单时间
最后更新
发货时间
交易状态
退款原因
操作原因
操作人
操作时间
+ + + +
修改评价
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
买家评分 +/> 5星   +/> 4星   +/> 3星   +/> 2星   +/> 1星   +/> 待评 +
物流评分 +/> 5星   +/> 4星   +/> 3星   +/> 2星   +/> 1星   +/> 待评 +
商家评分 +/> 5星   +/> 4星   +/> 3星   +/> 2星   +/> 1星   +/> 待评 +
买家评价
买家图片 +
+ $v) { ?> +
+ +
+

+
+ +
+
+
+ +
+

+
+
+
+
+

批量上传

+
+ + + +
买家视频  [上传]  [预览]  [删除]   + +
评价时间
卖家解释
解释时间
卖家评分 +/> 5星   +/> 4星   +/> 3星   +/> 2星   +/> 1星   +/> 待评 +
卖家评价
评价时间
买家解释
解释时间
+ +
    
+
+ + + + \ No newline at end of file diff --git a/module/mall/common.inc.php b/module/mall/common.inc.php new file mode 100644 index 0000000..c715c62 --- /dev/null +++ b/module/mall/common.inc.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/module/mall/global.func.php b/module/mall/global.func.php new file mode 100644 index 0000000..4104234 --- /dev/null +++ b/module/mall/global.func.php @@ -0,0 +1,119 @@ + 1 ? $lists : array(); + } +} + +function get_nv($n, $v) { + $p = array(); + if($n && $v) $p = explode('|', $v); + return count($p) > 1 ? $p : array(); +} + +function get_price($r) { + if($r['step']) { + $s = unserialize($r['step']); + if($s['a3'] && $r['a'] > $s['a3']) return $s['p3']; + if($s['a2'] && $r['a'] > $s['a2']) return $s['p2']; + return $s['p1']; + } + if($r['prices']) { + $s = explode('|', $r['prices']); + if(isset($s[$r['s1']])) return $s[$r['s1']]; + return 0.00; + } + return $r['price']; +} + +function get_amount($r) { + if($r['skuid']) { + $s = get_sku($r['skuid'], $r['username']); + return $s['amount']; + } + return $r['amount']; +} + +function get_sku($skuid, $username) { + return DB::get_one("SELECT itemid,title,style,price,amount,unit,skuid,thumb FROM ".DT_PRE."stock WHERE skuid='$skuid' AND username='$username'"); +} + +function get_stock($r) { + $s = unserialize($r['stock']); + if(!$s) return array(); + $k = $r['s1'].'-'.$r['s2'].'-'.$r['s3']; + if(!isset($s[$k])) return array('valid' => 0); + $sid = $s[$k]; + $t = DB::get_one("SELECT itemid,title,style,price,amount,unit,skuid,thumb FROM ".DT_PRE."stock WHERE itemid=$sid"); + if(!$t) return array('valid' => 0); + return array('p1' => $t['price'], 'price' => $t['price'], 'amount' => $t['amount'], 'thumb' => $t['thumb'], 'skuid' => $t['skuid']); +} + +function get_stocks($stock) { + $stks = unserialize($stock); + $sids = implode(',', $stks); + $lists = $tags = array(); + if(preg_match("/^[0-9\,]{1,}$/", $sids)) { + $result = DB::query("SELECT itemid,title,style,price,amount,unit,skuid,thumb FROM ".DT_PRE."stock WHERE itemid IN ($sids)"); + while($r = DB::fetch_array($result)) { + $lists[$r['itemid']] = $r; + } + foreach($stks as $k=>$v) { + if($v > 0) $tags[$k] = $lists[$v]; + } + } + return $tags; +} + +function get_promos($username) { + $lists = array(); + $result = DB::query("SELECT * FROM ".DT_PRE."finance_promo WHERE username='$username' AND fromtime<".DT_TIME." AND totime>".DT_TIME." AND number".DT_TIME." AND oid=0 ORDER BY price ASC LIMIT 10", 'CACHE'); + while($r = DB::fetch_array($result)) { + $lists[] = $r; + } + return $lists; +} + +function view_log($item) { + global $table_view, $_username; + if($item && $_username) { + $uid = $_username.'|'.$item['itemid']; + $itemid = $item['itemid']; + $seller = $item['username']; + if($itemid > 0 && check_name($seller)) DB::query("REPLACE INTO {$table_view} (uid,itemid,username,seller,lasttime) VALUES ('$uid','$itemid','$_username','$seller','".DT_TIME."')"); + } +} + +function view_txt($date) { + global $L; + if($date == timetodate(DT_TIME, 3)) return $L['view_txt_0']; + if($date == timetodate(datetotime('-1 day'), 3)) return $L['view_txt_1']; + if($date == timetodate(datetotime('-2 day'), 3)) return $L['view_txt_2']; + return $date; +} +?> \ No newline at end of file diff --git a/module/mall/index.inc.php b/module/mall/index.inc.php new file mode 100644 index 0000000..06cd717 --- /dev/null +++ b/module/mall/index.inc.php @@ -0,0 +1,37 @@ + 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']; + $r['thumb'] = str_replace('.thumb.', '.middle.', $r['thumb']); + $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); +?> \ No newline at end of file diff --git a/module/mall/list.htm.php b/module/mall/list.htm.php new file mode 100644 index 0000000..e083e39 --- /dev/null +++ b/module/mall/list.htm.php @@ -0,0 +1,92 @@ +count($table, $condition); + if($items != $CAT['item']) { + $CAT['item'] = $items; + $db->query("UPDATE {$DT_PRE}category SET item=$items WHERE catid=$catid"); + } +} else { + $items = $CAT['item']; +} +$pagesize = $MOD['pagesize']; +$showpage = 1; +$datetype = 5; +$template = $CAT['template'] ? $CAT['template'] : ($MOD['template_list'] ? $MOD['template_list'] : 'list'); +$total = max(ceil($items/$MOD['pagesize']), 1); +if(isset($fid) && isset($num)) { + $page = $fid; + $topage = $fid + $num - 1; + $total = $topage < $total ? $topage : $total; +} +for(; $page <= $total; $page++) { + $offset = ($page-1)*$pagesize; + $pages = listpages($CAT, $items, $page, $pagesize); + $tags = array(); + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY ".$MOD['order']." LIMIT {$offset},{$pagesize}"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $tags[] = $r; + } + $seo_file = 'list'; + include DT_ROOT.'/include/seo.inc.php'; + $destoon_task = "moduleid=$moduleid&html=list&catid=$catid&page=$page"; + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ?listurl($CAT, $page) : $CAT['linkurl']); + $filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, $page); + $_tags = $tags; + $DT_PC = $GLOBALS['DT_PC'] = 1; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.listurl($CAT, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + if($CAT['parentid']) $PCAT = get_cat($CAT['parentid']); + $pages = mobile_pages($items, $page, $pagesize, $MOD['mobile'].listurl($CAT, '{destoon_page}')); + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $tags = array(); + foreach($_tags as $r) { + $r['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $r['linkurl']); + $r['date'] = timetodate($r[$time], 3); + $r['thumb'] = str_replace('.thumb.', '.middle.', $r['thumb']); + $tags[] = $r; + } + if($items) $js_load = $MOD['mobile'].'search.php?job=ajax&catid='.$catid; + $head_title = $head_name = $CAT['catname']; + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put($filename, $data); + if($page == 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/mall/list.inc.php b/module/mall/list.inc.php new file mode 100644 index 0000000..8c18dc6 --- /dev/null +++ b/module/mall/list.inc.php @@ -0,0 +1,89 @@ +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']; + $r['thumb'] = str_replace('.thumb.', '.middle.', $r['thumb']); + $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); +?> \ No newline at end of file diff --git a/module/mall/show.htm.php b/module/mall/show.htm.php new file mode 100644 index 0000000..a40815a --- /dev/null +++ b/module/mall/show.htm.php @@ -0,0 +1,93 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3) return false; +$could_comment = false; +require_once DT_ROOT.'/include/content.class.php'; +extract($item); +$CAT = get_cat($catid); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_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); +} +$RL = $item['relate_id'] ? get_relate($item) : array(); +$P1 = get_nv($n1, $v1); +$P2 = get_nv($n2, $v2); +$P3 = get_nv($n3, $v3); +if($step) { + @extract(unserialize($step), EXTR_SKIP); + $mode = 2; +} else { + $a1 = 1; + $p1 = $item['price']; + $a2 = $a3 = $p2 = $p3 = ''; + $mode = $prices ? 1 : 0; +} +$stocks = ''; +if($stock) { + $stocks = json_encode(get_stocks($stock)); + $mode = 3; +} +if($subtext && $sublink) { + if(strpos($subtitle, $subtext) === false) { + $subtitle .= ''.$subtext.''; + } else { + $subtitle = str_replace($subtext, ''.$subtext.'', $subtitle); + } +} +$unit or $unit = $L['unit']; +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$fileurl = $linkurl; +$linkurl = $MOD['linkurl'].$linkurl; +$albums = get_albums($item); +$pics = count($albums); +$pics_width = $pics*70; +$promos = get_promos($username); +$fee = DC::fee($item['fee'], $MOD['fee_view']); +$user_status = 4; +$sku_amount = get_amount($item); +if($sku_amount != $amount) $amount = $sku_amount; +$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; + $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; +?> \ No newline at end of file diff --git a/module/member/admin.inc.php b/module/member/admin.inc.php new file mode 100644 index 0000000..c0935e7 --- /dev/null +++ b/module/member/admin.inc.php @@ -0,0 +1,23 @@ +get_one("SELECT username,passport,company,truename,mobile,password,groupid,email,message,chat,sound,online,sms,credit,money,loginip,admin,aid,edittime FROM {$DT_PRE}member WHERE userid=$__userid"); + if($USER) { + if($USER['groupid'] == 1 && !is_founder($_userid)) exit('Request Denied'); + $_userid = $__userid; + extract($USER, EXTR_PREFIX_ALL, ''); + $MG = cache_read('group-'.$_groupid.'.php'); + $admin_user = true; + } + } + } + } +} +?> \ No newline at end of file diff --git a/module/member/admin/ask.inc.php b/module/member/admin/ask.inc.php new file mode 100644 index 0000000..7882b10 --- /dev/null +++ b/module/member/admin/ask.inc.php @@ -0,0 +1,109 @@ +受理中
', '已解决', '未解决'); +$dstatus = array('待受理', '受理中', '已解决', '未解决'); +$stars = array('未评分', '不满意', '基本满意', '非常满意'); +switch($action) { + case 'edit': + $itemid or msg(); + $a = $db->get_one("SELECT * FROM {$DT_PRE}ask WHERE itemid=$itemid"); + $a or msg(); + if($submit) { + if($status > 1 && strlen($reply) < 5) msg('请填写回复内容'); + $reply = addslashes(save_remote(save_local(stripslashes($reply)))); + $db->query("UPDATE {$DT_PRE}ask SET status=$status,editor='$_username',edittime='$DT_TIME',reply='$reply' WHERE itemid=$itemid"); + if($status > 1) { + $msg = isset($msg) ? 1 : 0; + $eml = isset($eml) ? 1 : 0; + $sms = isset($sms) ? 1 : 0; + $wec = isset($wec) ? 1 : 0; + if($msg == 0) $sms = $wec = 0; + if($msg || $eml || $sms || $wec) { + $linkurl = $MOD['linkurl'].'ask.php?action=show&itemid='.$itemid; + $subject = '您的[问题]'.dsubstr($a['title'], 30, '...').'(流水号:'.$a['itemid'].')已经回复'; + $content = '尊敬的会员:
您的[问题]'.$a['title'].'(流水号:'.$a['itemid'].')已经回复!
'; + $content .= '请点击下面的链接查看详情:
'; + $content .= ''.$linkurl.'
'; + $user = userinfo($a['username']); + if($msg) send_message($user['username'], $subject, $content); + if($eml) send_mail($user['email'], $subject, $content); + if($sms) send_sms($user['mobile'], $subject.$DT['sms_sign']); + if($wec) send_weixin($user['username'], $subject); + } + } + dmsg('受理成功', '?moduleid='.$moduleid.'&file='.$file.'&status='.$status); + } else { + extract($a); + if($status == 0) { + $status = 1; + $db->query("UPDATE {$DT_PRE}ask SET status=1,edittime=$DT_TIME WHERE itemid=$itemid"); + } + $addtime = timetodate($addtime, 6); + $edittime = timetodate($edittime, 6); + include tpl('ask_edit', $module); + } + break; + case 'delete': + $itemid or msg(); + $db->query("DELETE FROM {$DT_PRE}ask WHERE itemid=$itemid "); + dmsg('删除成功', '?moduleid='.$moduleid.'&file='.$file); + break; + default: + $sfields = array('按条件', '标题', '内容', '会员名', '回复', '受理人'); + $dfields = array('title', 'title', 'content', 'username', 'reply', 'editor'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('结果排序方式', '提交时间降序', '提交时间升序', '受理时间降序', '受理时间升序', '会员评分降序', '会员评分升序', '受理状态降序', '受理状态升序'); + $dorder = array('itemid DESC', 'itemid DESC', 'itemid ASC', 'edittime DESC', 'edittime ASC', 'star DESC', 'star ASC', 'status DESC', 'status ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + isset($typeid) or $typeid = 0; + $status = isset($status) && isset($dstatus[$status]) ? intval($status) : -1; + $star = isset($star) && isset($stars[$star]) ? intval($star) : -1; + 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; + (isset($username) && check_name($username)) or $username = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $type_select = type_select($TYPE, 1, 'typeid', '请选择分类', $typeid); + $status_select = dselect($dstatus, 'status', '受理状态', $status, '', 1, '', 1); + $star_select = dselect($stars, 'star', '评分', $star, '', 1, '', 1); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($typeid > 0) $condition .= " AND typeid=$typeid"; + if($status > -1) $condition .= " AND status=$status"; + if($star > -1) $condition .= " AND star=$star"; + if($fromtime) $condition .= " AND `$datetype`>=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; + if($username) $condition .= " AND username='$username'"; + #echo $condition; + + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}ask WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}ask WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = $r['edittime'] ? timetodate($r['edittime'], 5) : 'N/A'; + $r['dstatus'] = $_status[$r['status']]; + $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : '默认'; + $lists[] = $r; + } + include tpl('ask', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/award.inc.php b/module/member/admin/award.inc.php new file mode 100644 index 0000000..3713c5a --- /dev/null +++ b/module/member/admin/award.inc.php @@ -0,0 +1,99 @@ + 1) { $xd .= ','; $y0 .= ','; } + $xd .= "'".$i."日'"; + $F = datetotime($year.'-'.$month.'-'.$i.' 00:00:00'); + $T = datetotime($year.'-'.$month.'-'.$i.' 23:59:59'); + $t = $db->get_one("SELECT SUM(`fee`) AS num FROM {$table} WHERE paytime>=$F AND paytime<=$T"); + $num = $t['num'] ? dround($t['num']) : 0; + $y0 .= $num; + } + $title = $year.'年'.$month.'月信息打赏统计报表(单位:'.$DT['money_unit'].')'; + } else { + for($i = 1; $i < 13; $i++) { + if($i > 1) { $xd .= ','; $y0 .= ','; } + $xd .= "'".$i."月'"; + $F = datetotime($year.'-'.$i.'-01 00:00:00'); + $T = datetotime($year.'-'.$i.'-'.date('t', $F).' 23:59:59'); + $t = $db->get_one("SELECT SUM(`fee`) AS num FROM {$table} WHERE paytime>=$F AND paytime<=$T"); + $num = $t['num'] ? dround($t['num']) : 0; + $y0 .= $num; + } + $title = $year.'年信息打赏统计报表(单位:'.$DT['money_unit'].')'; + } + include tpl('award_stats', $module); + break; + case 'delete': + $itemid or msg('未选择记录'); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + $db->query("DELETE FROM {$table} WHERE itemid IN ($itemids)"); + dmsg('删除成功', $forward); + break; + default: + $sfields = array('按条件', '标题', '会员名', '金额', 'IP'); + $dfields = array('title', 'title', 'fee', 'ip'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('排序方式', '金额降序', '金额升序', '时间降序', '时间升序', '流水降序', '流水升序'); + $dorder = array('itemid DESC', 'fee DESC', 'fee ASC', 'paytime DESC', 'paytime ASC', 'itemid DESC', 'itemid ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + (isset($username) && check_name($username)) or $username = ''; + (isset($editor) && check_name($editor)) or $editor = ''; + isset($tid) or $tid = ''; + (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($currency) or $currency = ''; + isset($minamount) or $minamount = ''; + isset($maxamount) or $maxamount = ''; + $itemid or $itemid = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $module_select = module_select('mid', '模块', $mid); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($fromtime) $condition .= " AND paytime>=$fromtime"; + if($totime) $condition .= " AND paytime<=$totime"; + if($mid) $condition .= " AND mid=$mid"; + if($username) $condition .= " AND username='$username'"; + if($editor) $condition .= " AND editor='$editor'"; + if($itemid) $condition .= " AND itemid=$itemid"; + if($minamount != '') $condition .= " AND fee>=$minamount"; + if($maxamount != '') $condition .= " AND fee<=$maxamount"; + if($tid) $condition .= " AND tid=$tid"; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + $fee = 0; + while($r = $db->fetch_array($result)) { + $r['paytime'] = timetodate($r['paytime'], 5); + $fee += $r['fee']; + $lists[] = $r; + } + include tpl('award', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/cash.inc.php b/module/member/admin/cash.inc.php new file mode 100644 index 0000000..4b63b64 --- /dev/null +++ b/module/member/admin/cash.inc.php @@ -0,0 +1,159 @@ +等待受理
', '拒绝申请', '支付失败', '付款成功'); +$table = $DT_PRE.'finance_cash'; +if($action == 'edit' || $action == 'show') { + $itemid or msg('未指定记录'); + $item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid "); + $item or msg('记录不存在'); + $item['addtime'] = timetodate($item['addtime'], 5); + $item['edittime'] = timetodate($item['edittime'], 5); + $member = userinfo($item['username']); +} +switch($action) { + case 'stats': + $year = isset($year) ? intval($year) : date('Y', $DT_TIME); + $year or $year = date('Y', $DT_TIME); + $month = isset($month) ? intval($month) : date('n', $DT_TIME); + $xd = $y0 = $y1 = $y2 = $y3 = ''; + if($month) { + $L = date('t', datetotime($year.'-'.$month.'-01')); + for($i = 1; $i <= $L; $i++) { + if($i > 1) { $xd .= ','; $y0 .= ','; $y1 .= ','; $y2 .= ','; $y3 .= ','; } + $xd .= "'".$i."日'"; + $F = datetotime($year.'-'.$month.'-'.$i.' 00:00:00'); + $T = datetotime($year.'-'.$month.'-'.$i.' 23:59:59'); + $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE addtime>=$F AND addtime<=$T AND status=3"); + $num = $t['num'] ? dround($t['num']) : 0; + $y0 .= $num; + $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE addtime>=$F AND addtime<=$T AND status=0"); + $num = $t['num'] ? dround($t['num']) : 0; + $y1 .= $num; + $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE addtime>=$F AND addtime<=$T AND status=2"); + $num = $t['num'] ? dround($t['num']) : 0; + $y2 .= $num; + $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE addtime>=$F AND addtime<=$T AND status=1"); + $num = $t['num'] ? dround($t['num']) : 0; + $y3 .= $num; + } + $title = $year.'年'.$month.'月会员提现统计报表(单位:'.$DT['money_unit'].')'; + } else { + for($i = 1; $i < 13; $i++) { + if($i > 1) { $xd .= ','; $y0 .= ','; $y1 .= ','; $y2 .= ','; $y3 .= ','; } + $xd .= "'".$i."月'"; + $F = datetotime($year.'-'.$i.'-01 00:00:00'); + $T = datetotime($year.'-'.$i.'-'.date('t', $F).' 23:59:59'); + $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE addtime>=$F AND addtime<=$T AND status=3"); + $num = $t['num'] ? dround($t['num']) : 0; + $y0 .= $num; + $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE addtime>=$F AND addtime<=$T AND status=0"); + $num = $t['num'] ? dround($t['num']) : 0; + $y1 .= $num; + $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE addtime>=$F AND addtime<=$T AND status=2"); + $num = $t['num'] ? dround($t['num']) : 0; + $y2 .= $num; + $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE addtime>=$F AND addtime<=$T AND status=1"); + $num = $t['num'] ? dround($t['num']) : 0; + $y3 .= $num; + } + $title = $year.'年会员提现统计报表(单位:'.$DT['money_unit'].')'; + } + include tpl('cash_stats', $module); + break; + case 'edit': + if($item['status'] > 0) msg('此申请已受理'); + if($submit) { + isset($status) or msg('请指定受理结果'); + $money = $item['amount'] + $item['fee']; + if($status == 3) { + // + } else if($status == 2 || $status == 1) { + $note or msg('请填写原因备注'); + money_add($item['username'], $money); + money_record($item['username'], $money, '站内', 'system', '提现失败', '流水号:'.$itemid); + } else { + msg(); + } + $db->query("UPDATE {$table} SET status=$status,editor='$_username',edittime=$DT_TIME,note='$note' WHERE itemid=$itemid"); + dmsg('受理成功', $forward); + } else { + include tpl('cash_edit', $module); + } + break; + case 'show': + if($item['status'] == 0) msg('申请尚未受理'); + include tpl('cash_show', $module); + break; + case 'delete': + $itemid or msg('未选择记录'); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + $db->query("DELETE FROM {$table} WHERE itemid IN ($itemids)"); + dmsg('删除成功', $forward); + break; + default: + $sfields = array('按条件', '会员名', '金额', '手续费', '收款方式', '开户网点', '收款户名', '收款帐号', '备注', '受理人'); + $dfields = array('username', 'username', 'amount', 'fee', 'bank', 'branch', 'truename', 'account', 'note', 'editor'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('排序方式', '提现金额降序', '提现金额升序', '手续费降序', '手续费升序', '申请时间降序', '申请时间升序', '受理时间降序', '受理时间升序', '流水降序', '流水升序'); + $dorder = array('itemid DESC', 'amount DESC', 'amount ASC', 'fee DESC', 'fee ASC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', 'itemid DESC', 'itemid ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + $status = isset($status) && isset($dstatus[$status]) ? intval($status) : ''; + (isset($username) && check_name($username)) or $username = ''; + (isset($editor) && check_name($editor)) or $editor = ''; + isset($datetype) && in_array($datetype, array('addtime', 'edittime')) 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($bank) or $bank = ''; + isset($mtype) or $mtype = 'amount'; + isset($minamount) or $minamount = ''; + isset($maxamount) or $maxamount = ''; + $itemid or $itemid = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $status_select = dselect($dstatus, 'status', '状态', $status, '', 1, '', 1); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($bank) $condition .= " AND bank='$bank'"; + if($fromtime) $condition .= " AND $datetype>=$fromtime"; + if($totime) $condition .= " AND $datetype<=$totime"; + if($status !== '') $condition .= " AND status='$status'"; + if($username) $condition .= " AND username='$username'"; + if($editor) $condition .= " AND editor='$editor'"; + if($itemid) $condition .= " AND itemid=$itemid"; + if($minamount != '') $condition .= " AND $mtype>=$minamount"; + if($maxamount != '') $condition .= " AND $mtype<=$maxamount"; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + $amount = $fee = 0; + while($r = $db->fetch_array($result)) { + $r['addtime'] = timetodate($r['addtime'], 5); + $r['edittime'] = $r['edittime'] ? timetodate($r['edittime'], 5) : '--'; + $r['dstatus'] = $_status[$r['status']]; + $amount += $r['amount']; + $fee += $r['fee']; + $lists[] = $r; + } + $amount = dround($amount, 2, 1); + $fee = dround($fee, 2, 1); + include tpl('cash', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/check.inc.php b/module/member/admin/check.inc.php new file mode 100644 index 0000000..1c9533c --- /dev/null +++ b/module/member/admin/check.inc.php @@ -0,0 +1,36 @@ +query("DELETE FROM {$DT_PRE}oauth WHERE itemid IN ($itemids)"); + dmsg('解除成功', $forward); + break; + default: + $sfields = array('按条件', '会员名', '修改内容'); + $dfields = array('username', 'username', 'content'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $fields_select = dselect($sfields, 'fields', '', $fields); + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}member_check WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}member_check WHERE $condition ORDER BY addtime DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $lists[] = $r; + } + include tpl('check', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/config.inc.php b/module/member/admin/config.inc.php new file mode 100644 index 0000000..2044893 --- /dev/null +++ b/module/member/admin/config.inc.php @@ -0,0 +1,150 @@ + \ No newline at end of file diff --git a/module/member/admin/favorite.inc.php b/module/member/admin/favorite.inc.php new file mode 100644 index 0000000..751c046 --- /dev/null +++ b/module/member/admin/favorite.inc.php @@ -0,0 +1,58 @@ +itemid = $itemid; + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($do->get_one()); + include tpl('favorite_edit', $module); + } + break; + case 'delete': + $itemid or msg('请选择收藏'); + $do->delete($itemid); + dmsg('删除成功', $forward); + break; + default: + $sfields = array('按条件', '标题', 'URL'); + $dfields = array('title', 'title', 'url'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + + $userid = isset($userid) ? intval($userid) : 0; + $userid or $userid = ''; + (isset($fromdate) && is_time($fromdate)) or $fromdate = ''; + $fromtime = $fromdate ? datetotime($fromdate) : 0; + (isset($todate) && is_time($todate)) or $todate = ''; + $totime = $todate ? datetotime($todate) : 0; + $tid = isset($tid) ? intval($tid) : 0; + $tid or $tid = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $module_select = module_select('mid', '模块', $mid); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($userid) $condition .= " AND userid=$userid"; + if($fromtime) $condition .= " AND addtime>=$fromtime"; + if($totime) $condition .= " AND addtime<=$totime"; + if($mid) $condition .= " AND mid='$mid'"; + if($tid) $condition .= " AND tid='$tid'"; + $lists = $do->get_list($condition); + include tpl('favorite', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/group.inc.php b/module/member/admin/group.inc.php new file mode 100644 index 0000000..440705b --- /dev/null +++ b/module/member/admin/group.inc.php @@ -0,0 +1,150 @@ +groupid = $groupid; +if(isset($groupname)) $do->groupname = $groupname; +if(isset($vip)) $do->vip = intval($vip); +$this_forward = '?moduleid='.$moduleid.'&file='.$file; + +if($action == 'add') { + if($submit) { + if(!$groupname) msg('会员组名称不能为空'); + if($setting['fee_mode']) {//收费会员 + if($vip > 9) $do->vip = $vip = 9; + if($vip < 1) $do->vip = $vip = 1; + $setting['fee'] = intval($setting['fee']); + if($setting['fee'] < 1) $setting['fee'] = 3000; + } else { + $do->vip = $vip = $setting['fee'] = 0; + } + $do->add($setting); + dmsg('添加成功', $this_forward); + } else { + include load('homepage.lang'); + $do->groupid = 7; + extract($do->get_one()); + $groupname = ''; + $discount = 100; + $menuid = 0; + include tpl('group_edit', $module); + } +} else if($action == 'edit') { + $groupid or msg(); + if($submit) { + if(!$groupname) msg('会员组名称不能为空'); + if($setting['fee_mode']) {//收费会员 + if($vip > 9) $do->vip = $vip = 9; + if($vip < 1) $do->vip = $vip = 1; + $setting['fee'] = intval($setting['fee']); + if($setting['fee'] < 1) $setting['fee'] = 3000; + $setting['reg'] = 0; + } else { + $do->vip = $vip = $setting['fee'] = 0; + } + if($groupid == 6) $setting['reg'] = 1; + $do->listorder = intval($listorder); + $do->edit($setting); + dmsg('修改成功', '?moduleid='.$moduleid.'&file='.$file.'&action=edit&groupid='.$groupid); + } else { + include load('homepage.lang'); + extract($do->get_one()); + $menuid = 1; + if($kw) { + $all = 1; + ob_start(); + } + include tpl('group_edit', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } + } +} else if($action == 'delete') { + $groupid or msg(); + $do->delete(); + dmsg('删除成功', $this_forward); +} else if($action == 'order') { + $do->order($listorder); + dmsg('排序成功', $forward); +} else { + $groups = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}member_group ORDER BY listorder ASC,groupid ASC"); + while($r = $db->fetch_array($result)) { + $r['type'] = $r['groupid'] > 7 ? '自定义' : '系统'; + $groups[]=$r; + } + include tpl('group', $module); +} + +class group { + var $groupid; + var $groupname; + var $vip; + var $listorder; + var $table; + + function __construct() { + $this->table = DT_PRE.'member_group'; + } + + function group() { + $this->__construct(); + } + + function add($setting) { + if(!is_array($setting)) return false; + DB::query("INSERT INTO {$this->table} (groupname,vip) VALUES('$this->groupname','$this->vip')"); + $this->groupid = DB::insert_id(); + DB::query("UPDATE {$this->table} SET `listorder`=`groupid` WHERE groupid=$this->groupid"); + update_setting('group-'.$this->groupid, $setting); + cache_group(); + return $this->groupid; + } + + function edit($setting) { + if(!is_array($setting)) return false; + update_setting('group-'.$this->groupid, $setting); + $setting = addslashes(serialize(dstripslashes($setting))); + DB::query("UPDATE {$this->table} SET groupname='$this->groupname',vip='$this->vip',listorder='$this->listorder' WHERE groupid=$this->groupid"); + cache_group(); + return true; + } + + function order($listorder) { + if(!is_array($listorder)) return false; + foreach($listorder as $k=>$v) { + $k = intval($k); + $v = intval($v); + if($v > 6) DB::query("UPDATE {$this->table} SET listorder=$v WHERE groupid=$k"); + } + cache_group(); + return true; + } + + function delete() { + if($this->groupid < 5) return false; + DB::query("DELETE FROM {$this->table} WHERE groupid=$this->groupid"); + cache_delete('group-'.$this->groupid.'.php'); + cache_group(); + return true; + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE groupid=$this->groupid"); + $tmp = get_setting('group-'.$this->groupid); + if($tmp) { + foreach($tmp as $k=>$v) { + isset($r[$k]) or $r[$k] = $v; + } + } + return $r; + } +} +?> \ No newline at end of file diff --git a/module/member/admin/honor.inc.php b/module/member/admin/honor.inc.php new file mode 100644 index 0000000..e5e2f6e --- /dev/null +++ b/module/member/admin/honor.inc.php @@ -0,0 +1,142 @@ +=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; +} +switch($action) { + case 'add': + if($submit) { + if($do->pass($post)) { + $do->add($post); + dmsg('添加成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catid='.$post['catid']); + } else { + msg($do->errmsg); + } + } else { + foreach($do->fields as $v) { + isset($$v) or $$v = ''; + } + $content = ''; + $username = $_username; + $status = 3; + $addtime = timetodate($DT_TIME); + $history = 0; + $menuid = 0; + include tpl('honor_edit', $module); + } + break; + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($do->get_one()); + $history = history($moduleid, $file.'-'.$itemid); + $addtime = timetodate($addtime); + $fromtime = timetodate($fromtime, 3); + $totime = $totime ? timetodate($totime, 3) : ''; + $menuon = array('5', '4', '2', '1', '3'); + $menuid = $menuon[$status]; + include tpl('honor_edit', $module); + } + 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 'recycle': + $lists = $do->get_list('status=0'.$condition, $dorder[$order]); + $menuid = 5; + include tpl('honor', $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('honor', $module); + } + break; + case 'expire': + if(isset($refresh)) { + if(isset($delete)) { + $days = isset($days) ? intval($days) : 0; + $days or msg('请填写天数'); + $do->clear("status=4 AND totime>0 AND totime<$DT_TIME-$days*86400"); + dmsg('删除成功', $forward); + } else { + $do->expire(); + dmsg('刷新成功', $forward); + } + } else { + $lists = $do->get_list('status=4'.$condition); + $menuid = 3; + include tpl('honor', $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('honor', $module); + } + break; + default: + $lists = $do->get_list('status=3'.$condition, $dorder[$order]); + $menuid = 1; + include tpl('honor', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/index.html b/module/member/admin/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/member/admin/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/member/admin/mail.inc.php b/module/member/admin/mail.inc.php new file mode 100644 index 0000000..e25a330 --- /dev/null +++ b/module/member/admin/mail.inc.php @@ -0,0 +1,164 @@ +query("INSERT INTO {$DT_PRE}mail (title,typeid,content,addtime,editor,edittime) VALUES ('$title','$typeid','$content','$DT_TIME','$_username','$DT_TIME')"); + dmsg('添加成功', $forward); + } else { + $typeid = 0; + $title = $content = ''; + include tpl('mail_edit', $module); + } + break; + case 'edit': + $itemid or msg(); + if($submit) { + $typeid or msg('请选择邮件分类'); + $title or msg('请填写邮件标题'); + $content or msg('请填写邮件内容'); + $content = addslashes(save_remote(save_local(stripslashes($content)))); + $db->query("UPDATE {$DT_PRE}mail SET title='$title',typeid='$typeid',content='$content',editor='$_username',edittime='$DT_TIME' WHERE itemid=$itemid"); + dmsg('修改成功', $forward); + } else { + $r = $db->get_one("SELECT * FROM {$DT_PRE}mail WHERE itemid=$itemid"); + $r or msg(); + extract($r); + include tpl('mail_edit', $module); + } + break; + case 'delete': + $itemid or msg(); + $db->query("DELETE FROM {$DT_PRE}mail WHERE itemid=$itemid "); + dmsg('删除成功', '?moduleid='.$moduleid.'&file='.$file); + break; + case 'list_delete': + $itemid or msg(); + $db->query("DELETE FROM {$DT_PRE}mail_list WHERE itemid=$itemid "); + dmsg('删除成功', '?moduleid='.$moduleid.'&file='.$file.'&action=list'); + break; + case 'send': + $itemid or msg(); + if(isset($num)) { + $m = cache_read($_username.'_mail.php'); + } else { + $num = 0; + $m = $db->get_one("SELECT title,content,typeid FROM {$DT_PRE}mail WHERE itemid=$itemid"); + $m or msg(); + cache_write($_username.'_mail.php', $m); + } + $pagesize = 2; + $offset = ($page-1)*$pagesize; + $result = $db->query("SELECT email FROM {$DT_PRE}mail_list WHERE typeids LIKE '%,".$m['typeid'].",%' ORDER BY itemid DESC LIMIT $offset,$pagesize"); + $i = false; + while($r = $db->fetch_array($result)) { + send_mail($r['email'], $m['title'], $m['content']); + $i = true; + $num++; + } + if($i) { + $page++; + msg('已发送 '.$num.' 封邮件,系统将自动继续,请稍候...', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&page='.$page.'&itemid='.$itemid.'&num='.$num); + } else { + cache_delete($_username.'_mail.php'); + $db->query("UPDATE {$DT_PRE}mail SET sendtime='$DT_TIME' WHERE itemid=$itemid"); + msg('邮件发送成功 共发送 '.$num.' 封邮件', '?moduleid='.$moduleid.'&file='.$file, 5); + } + break; + case 'list': + $sorder = array('结果排序方式', '订阅时间降序', '订阅时间升序', '更新时间降序', '更新时间升序'); + $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + $typeid = isset($typeid) ? ($typeid === '' ? -1 : intval($typeid)) : -1; + isset($datetype) && in_array($datetype, array('addtime', 'edittime')) 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 = ''; + + $type_select = type_select($TYPE, 1, 'typeid', '请选择分类', $typeid); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw('email', $keyword); + if($typeid > 0) $condition .= " AND typeids LIKE '%,$typeid,%'"; + if($fromtime) $condition .= " AND `$datetype`>=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; + if($username) $condition .= " AND username='$username'"; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}mail_list WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}mail_list WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['addtime'] = timetodate($r['addtime'], 5); + $r['edittime'] = timetodate($r['edittime'], 5); + $typeids = explode(',', substr($r['typeids'], 1, -1)); + $r['type'] = ''; + $lists[] = $r; + } + include tpl('mail_list', $module); + break; + default: + $sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '更新时间降序', '更新时间升序', '发送时间降序', '发送时间升序'); + $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', 'sendtime DESC', 'sendtime ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + $typeid = isset($typeid) ? ($typeid === '' ? -1 : intval($typeid)) : -1; + isset($datetype) && in_array($datetype, array('addtime', 'edittime', 'sendtime')) 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; + + $type_select = type_select($TYPE, 1, 'typeid', '请选择分类', $typeid); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw('title', $keyword); + if($typeid > 0) $condition .= " AND typeid=$typeid"; + if($fromtime) $condition .= " AND `$datetype`>=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}mail WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}mail WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['addtime'] = timetodate($r['addtime'], 5); + $r['edittime'] = timetodate($r['edittime'], 5); + $r['sendtime'] = $r['sendtime'] ? timetodate($r['sendtime'], 5) : '未发送'; + $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : '未分类'; + $num = $db->get_one("SELECT count(itemid) as num FROM {$DT_PRE}mail_list WHERE typeids LIKE '%,".$r['typeid'].",%' "); + $r['num'] = $num['num']; + $lists[] = $r; + } + include tpl('mail', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/promo.inc.php b/module/member/admin/promo.inc.php new file mode 100644 index 0000000..6cccaac --- /dev/null +++ b/module/member/admin/promo.inc.php @@ -0,0 +1,169 @@ +pass($post)) { + $do->add($post); + dmsg('添加成功', $forward); + } else { + msg($do->errmsg); + } + } else { + foreach($do->fields as $v) { + $$v = ''; + } + $fromtime = timetodate($DT_TIME, 3).' 00:00:00'; + $menuid = 0; + include tpl('promo_edit', $module); + } + break; + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($do->get_one()); + $fromtime = $fromtime ? timetodate($fromtime, 6) : ''; + $totime = $totime ? timetodate($totime, 6) : ''; + $menuid = 1; + include tpl('promo_edit', $module); + } + break; + case 'give': + $itemid or msg(); + $do->itemid = $itemid; + $r = $do->get_one(); + if($submit) { + check_name($username) or msg('请填写会员名'); + $t = $db->get_one("SELECT itemid FROM {$DT_PRE}finance_coupon WHERE username='$_username' AND pid=$itemid"); + if($t) msg('会员已领取过该券'); + $user = userinfo($username); + $user or msg('会员不存在'); + if($r['username'] == $username) msg('不能赠送商家自己的优惠券'); + if($r['totime'] < $DT_TIME) msg('优惠活动已结束'); + $title = addslashes($r['title']); + $db->query("INSERT INTO {$DT_PRE}finance_coupon (title,username,seller,addtime,fromtime,totime,price,cost,pid,editor,edittime,note) VALUES ('$title','$username','$r[username]','$DT_TIME','$r[fromtime]','$r[totime]','$r[price]','$r[cost]','$itemid','$_username','$DT_TIME','$note')"); + $db->query("UPDATE {$DT_PRE}finance_promo SET number=number+1 WHERE itemid=$itemid"); + dmsg('赠送成功', '?moduleid='.$moduleid.'&file='.$file.'&action=coupon'); + } else { + extract($r); + $fromtime = $fromtime ? timetodate($fromtime, 6) : ''; + $totime = $totime ? timetodate($totime, 6) : ''; + $menuid = 1; + include tpl('promo_give', $module); + } + break; + case 'order': + $itemid or msg(); + $r = $db->get_one("SELECT mid FROM {$DT_PRE}order WHERE itemid=$itemid"); + if($r) dheader('?moduleid='.$r['mid'].'&file=order&action=show&itemid='.$itemid); + msg('订单不存在'); + break; + case 'del': + $itemid or msg('请选择优惠券'); + $do->del($itemid); + dmsg('删除成功', $forward); + break; + case 'delete': + $itemid or msg('请选择优惠'); + $do->delete($itemid); + dmsg('删除成功', $forward); + break; + case 'coupon': + $sfields = array('按条件', '优惠名称', '会员', '商家', '编辑', '备注'); + $dfields = array('title', 'title', 'username', 'seller', 'editor', 'note'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('排序方式', '领取时间降序', '领取时间升序', '优惠额度降序', '优惠额度升序', '最低消费降序', '最低消费升序', '开始时间降序', '开始时间升序', '结束时间降序', '结束时间升序', '更新时间降序', '更新时间升序'); + $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'price DESC', 'price ASC', 'cost DESC', 'cost ASC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC', 'edittime DESC', 'edittime ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + (isset($username) && check_name($username)) or $username = ''; + (isset($editor) && check_name($editor)) or $editor = ''; + (isset($seller) && check_name($seller)) or $seller = ''; + $pid = isset($pid) ? intval($pid) : ''; + $pid or $pid = ''; + $oid = isset($oid) ? intval($oid) : ''; + $oid or $oid = ''; + (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) or $datetype = 'addtime'; + isset($mtype) or $mtype = 'price'; + isset($minamount) or $minamount = ''; + isset($maxamount) or $maxamount = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($username) $condition .= " AND username='$username'"; + if($seller) $condition .= " AND seller='$seller'"; + if($pid) $condition .= " AND pid=$pid"; + if($oid) $condition .= " AND oid=$oid"; + if($minamount != '') $condition .= " AND $mtype>=$minamount"; + if($maxamount != '') $condition .= " AND $mtype<=$maxamount"; + if($fromtime) $condition .= " AND $datetype>=$fromtime"; + if($totime) $condition .= " AND $datetype<=$totime"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}finance_coupon WHERE $condition"); + $pages = pages($r['num'], $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}finance_coupon WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $lists[] = $r; + } + include tpl('promo_coupon', $module); + break; + default: + $sfields = array('按条件', '优惠名称', '卖家', '编辑', '备注'); + $dfields = array('title', 'title', 'username', 'editor', 'note'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('排序方式', '添加时间降序', '添加时间升序', '优惠额度降序', '优惠额度升序', '最低消费降序', '最低消费升序', '数量限制降序', '数量限制升序', '领券人数降序', '领券人数升序', '开始时间降序', '开始时间升序', '结束时间降序', '结束时间升序', '更新时间降序', '更新时间升序'); + $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'price DESC', 'price ASC', 'cost DESC', 'cost ASC', 'amount DESC', 'amount ASC', 'number DESC', 'number ASC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC', 'edittime DESC', 'edittime ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + (isset($username) && check_name($username)) or $username = ''; + (isset($editor) && check_name($editor)) or $editor = ''; + isset($datetype) && in_array($datetype, array('addtime', 'edittime', '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; + $open = isset($open) ? intval($open) : -1; + isset($mtype) or $mtype = 'price'; + isset($minamount) or $minamount = ''; + isset($maxamount) or $maxamount = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($username) $condition .= " AND username='$username'"; + if($editor) $condition .= " AND editor='$editor'"; + if($fromtime) $condition .= " AND $datetype>=$fromtime"; + if($totime) $condition .= " AND $datetype<=$totime"; + if($minamount != '') $condition .= " AND $mtype>=$minamount"; + if($maxamount != '') $condition .= " AND $mtype<=$maxamount"; + if($open > -1) $condition .= " AND open=$open"; + $lists = $do->get_list($condition, $dorder[$order]); + include tpl('promo', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/record.inc.php b/module/member/admin/record.inc.php new file mode 100644 index 0000000..f98827b --- /dev/null +++ b/module/member/admin/record.inc.php @@ -0,0 +1,125 @@ +query("DELETE FROM {$table} WHERE addtime<$time"); + dmsg('清理成功', $forward); + break; + case 'add': + if($submit) { + $username or msg('请填写会员名'); + $amount or msg('请填写金额'); + $bank or msg('请选择支付方式'); + $reason or msg('请填写事由'); + $amount = dround($amount); + if($amount <= 0) msg('金额格式错误'); + $bank = trim($bank); + if(!$type) $amount = -$amount; + $error = ''; + $success = 0; + $usernames = explode("\n", trim($username)); + foreach($usernames as $username) { + $username = trim($username); + if(!$username) continue; + $r = $db->get_one("SELECT username,money FROM {$DT_PRE}member WHERE username='$username'"); + if(!$r) { + $error .= '
会员['.$username.']不存在'; + continue; + } + if(!$type && $r['money'] < abs($amount)) { + $error .= '
会员['.$username.']余额不足,当前余额为:'.$r['money']; + continue; + } + $reason or $reason = '现金'; + $note or $note = '手工'; + money_add($username, $amount); + money_record($username, $amount, $bank, $_username, $reason, $note); + $success++; + } + if($error) msg('操作成功 '.$success.' 位会员,发生以下错误:'.$error); + dmsg('操作成功', '?moduleid='.$moduleid.'&file='.$file); + } else { + 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"; + } + } + } + include tpl('record_add', $module); + } + break; + case 'delete': + $itemid or msg('未选择记录'); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + $db->query("DELETE FROM {$table} WHERE itemid IN ($itemids)"); + dmsg('删除成功', $forward); + break; + default: + $sfields = array('按条件', '会员名', '金额', '银行', '事由', '备注', '操作人'); + $dfields = array('username', 'username', 'amount', 'bank', 'reason', 'note', 'editor'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('排序方式', '金额降序', '金额升序', '余额降序', '余额升序', '时间降序', '时间升序', '流水降序', '流水升序'); + $dorder = array('itemid DESC', 'amount DESC', 'amount ASC', 'balance DESC', 'balance ASC', 'addtime DESC', 'addtime ASC', 'itemid DESC', 'itemid ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + (isset($username) && check_name($username)) or $username = ''; + (isset($editor) && check_name($editor)) or $editor = ''; + (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($bank) or $bank = ''; + isset($type) or $type = 0; + isset($mtype) && in_array($mtype, array('amount', 'balance')) or $mtype = 'amount'; + $minamount = isset($minamount) ? dround($minamount, 2, 1) : ''; + $minamount != 0.00 or $minamount = ''; + $maxamount = isset($maxamount) ? dround($maxamount, 2, 1) : ''; + $maxamount != 0.00 or $maxamount = ''; + $itemid or $itemid = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($bank) $condition .= " AND bank='$bank'"; + if($fromtime) $condition .= " AND addtime>=$fromtime"; + if($totime) $condition .= " AND addtime<=$totime"; + if($type) $condition .= $type == 1 ? " AND amount>0" : " AND amount<0"; + if($username) $condition .= " AND username='$username'"; + if($editor) $condition .= " AND editor='$editor'"; + if($itemid) $condition .= " AND itemid=$itemid"; + if($minamount != '') $condition .= " AND $mtype>=$minamount"; + if($maxamount != '') $condition .= " AND $mtype<=$maxamount"; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + $income = $expense = 0; + while($r = $db->fetch_array($result)) { + $r['addtime'] = timetodate($r['addtime'], 5); + $r['amount'] > 0 ? $income += $r['amount'] : $expense += $r['amount']; + $lists[] = $r; + } + $income = dround($income, 2, 1); + $expense = dround($expense, 2, 1); + include tpl('record', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/sendsms.inc.php b/module/member/admin/sendsms.inc.php new file mode 100644 index 0000000..8ec37ef --- /dev/null +++ b/module/member/admin/sendsms.inc.php @@ -0,0 +1,274 @@ +$mailfile) { + $tmp = basename($mailfile); + $mail['filename'] = $tmp; + $mail['filesize'] = round(filesize($mailfile)/(1024), 2); + $mail['mtime'] = timetodate(filemtime($mailfile), 5); + $mail['count'] = substr_count(file_get($mailfile), "\n") + 1; + $mails[] = $mail; + } + } + include tpl('sendsms_list', $module); + break; + case 'make': + if(isset($make)) { + if(isset($first)) { + $tb or $tb = $DT_PRE.'member'; + $tb = strip_sql($tb, 0); + $num or $num = 1000; + $sql or $sql = 'groupid>4'; + $title = $title ? file_vname('-'.$title) : ''; + $random = strtolower(random(10)); + $item = array(); + $item['tb'] = $tb; + $item['num'] = $num; + $item['sql'] = $sql; + $item['title'] = $title; + $item['random'] = $random; + cache_write('mobile-list-'.$_userid.'.php', $item); + } else { + $item = cache_read('mobile-list-'.$_userid.'.php'); + $item or msg(); + extract($item); + } + $pagesize = $num; + $offset = ($page-1)*$pagesize; + $result = $db->query("SELECT mobile FROM $tb WHERE $sql AND mobile<>'' LIMIT $offset,$pagesize"); + $data = ''; + while($r = $db->fetch_array($result)) { + if(is_mobile($r['mobile'])) $data .= $r['mobile']."\r\n"; + } + if($data) { + $filename = timetodate($DT_TIME, 'YmdHis').$title.'-'.$random.'-'.$page.'.txt'; + file_put(DT_ROOT.'/file/mobile/'.$filename, trim($data)); + $page++; + msg('文件'.$filename.'获取成功。
请稍候,程序将自动继续...', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&page='.$page.'&make=1'); + } else { + cache_delete('mobile-list-'.$_userid.'.php'); + msg('列表获取成功', '?moduleid='.$moduleid.'&file='.$file.'&action=list'); + } + } else { + include tpl('sendsms_make', $module); + } + break; + case 'download': + $file_ext = file_ext($filename); + if($file_ext != 'txt') msg('只能下载TxT文件'); + file_down(DT_ROOT.'/file/mobile/'.$filename); + break; + case 'upload': + require DT_ROOT.'/include/upload.class.php'; + $do = new upload($_FILES, 'file/mobile/', $uploadfile_name, 'txt'); + $do->adduserid = false; + if($do->save()) msg('上传成功', '?moduleid='.$moduleid.'&file='.$file.'&action=list'); + msg($do->errmsg); + break; + case 'delete': + if(is_array($filenames)) { + foreach($filenames as $filename) { + if(file_ext($filename) == 'txt') @unlink(DT_ROOT.'/file/mobile/'.$filename); + } + } else { + if(file_ext($filenames) == 'txt') @unlink(DT_ROOT.'/file/mobile/'.$filenames); + } + dmsg('删除成功', '?moduleid='.$moduleid.'&file='.$file.'&action=list'); + break; + case 'delete_record': + $itemid or msg('未选择记录'); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + $db->query("DELETE FROM {$DT_PRE}sms WHERE itemid IN ($itemids)"); + dmsg('删除成功', $forward); + break; + case 'clear': + $time = $DT_TODAY - 90*86400; + $db->query("DELETE FROM {$DT_PRE}sms WHERE sendtime<$time"); + dmsg('清理成功', $forward); + break; + case 'record': + $sfields = array('按条件', '短信内容', '发送结果', '手机号', 'IP', '操作人'); + $dfields = array('message', 'message', 'code', 'mobile', 'editor'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + + (isset($mobile) && is_mobile($mobile)) or $mobile = ''; + (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; + + $fields_select = dselect($sfields, 'fields', '', $fields); + + $condition = '1'; + if($keyword) $condition .= $fields < 3 ? match_kw($dfields[$fields], $keyword) : " AND $dfields[$fields]='$keyword'"; + if($fromtime) $condition .= " AND sendtime>=$fromtime"; + if($totime) $condition .= " AND sendtime<=$totime"; + if($mobile) $condition .= " AND mobile='$mobile'"; + + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}sms WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}sms WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['sendtime'] = timetodate($r['sendtime'], 6); + $r['num'] = ceil($r['word']/$DT['sms_len']); + $lists[] = $r; + } + include tpl('sendsms_record', $module); + break; + default: + if(isset($send)) { + if(isset($preview) && $preview) { + if($sendtype == 2) { + $mobiles = explode("\n", $mobiles); + $mobile = trim($mobiles[0]); + } else if($sendtype == 3) { + $mobiles = explode("\n", file_get(DT_ROOT.'/file/mobile/'.$mobilelist)); + $mobile = trim($mobiles[0]); + } + $user = _userinfo($mobile); + if($user && _safecheck($content)) eval("\$content = \"$content\";"); + exit($content.$sign); + } + if($sendtype == 1) { + $content or msg('请填写短信内容'); + $mobile or msg('请填写接收号码'); + $mobile = trim($mobile); + $DT['sms_sign'] = $sign; + $s = 0; + if(is_mobile($mobile)) { + $user = _userinfo($mobile); + if($user && _safecheck($content)) eval("\$content = \"$content\";"); + $content = strip_sms($content); + $sms_code = send_sms($mobile, $content); + if(strpos($sms_code, $DT['sms_ok']) !== false) $s++; + } + dmsg($s ? '短信发送成功' : '短信发送失败', $forward); + } else if($sendtype == 2) { + $content or msg('请填写短信内容'); + $mobiles or msg('请填写接收号码'); + $mobiles = explode("\n", $mobiles); + $_content = $content; + $DT['sms_sign'] = $sign; + $s = $f = 0; + foreach($mobiles as $mobile) { + $mobile = trim($mobile); + if(is_mobile($mobile)) { + $user = _userinfo($mobile); + $content = $_content; + if($user && _safecheck($content)) eval("\$content = \"$content\";"); + $content = strip_sms($content); + $sms_code = send_sms($mobile, $content); + if(strpos($sms_code, $DT['sms_ok']) !== false) { + $s++; + } else { + $f++; + } + } + } + dmsg('发送成功('.$s.'),发送失败('.$f.')', $forward); + } else if($sendtype == 3) { + if(isset($id)) { + $data = cache_read($_username.'_sendsms.php'); + $content = $data['content']; + $mobilelist = $data['mobilelist']; + $sign = $data['sign']; + } else { + $id = $s = $f = 0; + $content or msg('请填写短信内容'); + $mobilelist or msg('请选择号码列表'); + $data = array(); + $data['mobilelist'] = $mobilelist; + $data['content'] = $content; + $data['sign'] = $sign; + cache_write($_username.'_sendsms.php', $data); + } + $_content = $content; + $DT['sms_sign'] = $sign; + $pernum = intval($pernum); + if(!$pernum) $pernum = 10; + $mobiles = file_get(DT_ROOT.'/file/mobile/'.$mobilelist); + $mobiles = explode("\n", $mobiles); + for($i = 1; $i <= $pernum; $i++) { + $mobile = trim($mobiles[$id++]); + if(is_mobile($mobile)) { + $user = _userinfo($mobile); + $content = $_content; + if($user && _safecheck($content)) eval("\$content = \"$content\";"); + $content = strip_sms($content); + $sms_code = send_sms($mobile, $content); + if(strpos($sms_code, $DT['sms_ok']) !== false) { + $s++; + } else { + $f++; + } + } + } + if($id < count($mobiles)) { + msg('已发送('.$id.')条短信,('.$s.')成功('.$f.')失败,系统将自动继续,请稍候...', '?moduleid='.$moduleid.'&file='.$file.'&sendtype=3&id='.$id.'&s='.$s.'&f='.$f.'&pernum='.$pernum.'&send=1'); + } + cache_delete($_username.'_sendsms.php'); + dmsg('发送成功('.$s.'),发送失败('.$f.')', '?moduleid='.$moduleid.'&file='.$file); + } + } else { + $sendtype = isset($sendtype) ? intval($sendtype) : 1; + isset($mobile) or $mobile = ''; + $mobiles = ''; + if(isset($userid)) { + if($userid) { + $userids = is_array($userid) ? implode(',', $userid) : $userid; + $result = $db->query("SELECT mobile FROM {$DT_PRE}member WHERE userid IN ($userids)"); + while($r = $db->fetch_array($result)) { + if($r['mobile']) $mobiles .= $r['mobile']."\n"; + } + } + } + if($mobile) { + if(strpos($mobile, ',') === false) { + is_mobile($mobile) or $mobile = ''; + } else { + $tmp = explode(',', $mobile); + foreach($tmp as $mob) { + if(is_mobile($mob)) $mobiles .= $mob."\n"; + } + $mobile = ''; + } + } + if($mobiles && strpos($mobiles, "\n") !== false) $sendtype = 2; + include tpl('sendsms', $module); + } + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/sms.inc.php b/module/member/admin/sms.inc.php new file mode 100644 index 0000000..a056653 --- /dev/null +++ b/module/member/admin/sms.inc.php @@ -0,0 +1,120 @@ +query("DELETE FROM {$table} WHERE addtime<$time"); + dmsg('清理成功', $forward); + break; + case 'add': + if($submit) { + $username or msg('请填写会员名'); + $amount or msg('请填写数量'); + $reason or msg('请填写事由'); + $amount = intval($amount); + if($amount <= 0) msg('数量格式错误'); + if(!$type) $amount = -$amount; + $error = ''; + $success = 0; + $usernames = explode("\n", trim($username)); + foreach($usernames as $username) { + $username = trim($username); + if(!$username) continue; + $r = $db->get_one("SELECT username,sms FROM {$DT_PRE}member WHERE username='$username'"); + if(!$r) { + $error .= '
会员['.$username.']不存在'; + continue; + } + if(!$type && $r['sms'] < abs($amount)) { + $error .= '
会员['.$username.']短信余额不足,当前余额为:'.$r['sms']; + continue; + } + $reason or $reason = '奖励'; + $note or $note = '手工'; + sms_add($username, $amount); + sms_record($username, $amount, $_username, $reason, $note); + } + if($error) msg('操作成功 '.$success.' 位会员,发生以下错误:'.$error); + dmsg('操作成功', '?moduleid='.$moduleid.'&file='.$file.'&action=record'); + } else { + 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"; + } + } + } + include tpl('sms_add', $module); + } + break; + case 'delete': + $itemid or msg('未选择记录'); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + $db->query("DELETE FROM {$table} WHERE itemid IN ($itemids)"); + dmsg('删除成功', $forward); + break; + default: + $sfields = array('按条件', '会员名', '数量', '事由', '备注', '操作人'); + $dfields = array('username', 'username', 'amount', 'reason', 'note', 'editor'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('排序方式', '数量降序', '数量升序', '余额降序', '余额升序', '时间降序', '时间升序', '流水降序', '流水升序'); + $dorder = array('itemid DESC', 'amount DESC', 'amount ASC', 'balance DESC', 'balance ASC', 'addtime DESC', 'addtime ASC', 'itemid DESC', 'itemid ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + (isset($username) && check_name($username)) or $username = ''; + (isset($editor) && check_name($editor)) or $editor = ''; + (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($type) or $type = 0; + isset($mtype) && in_array($mtype, array('amount', 'balance')) or $mtype = 'amount'; + $minamount = isset($minamount) ? intval($minamount) : ''; + $minamount or $minamount = ''; + $maxamount = isset($maxamount) ? intval($maxamount) : ''; + $maxamount or $maxamount = ''; + $itemid or $itemid = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($fromtime) $condition .= " AND addtime>=$fromtime"; + if($totime) $condition .= " AND addtime<=$totime"; + if($type) $condition .= $type == 1 ? " AND amount>0" : " AND amount<0"; + if($username) $condition .= " AND username='$username'"; + if($editor) $condition .= " AND editor='$editor'"; + if($itemid) $condition .= " AND itemid=$itemid"; + if($minamount != '') $condition .= " AND $mtype>=$minamount"; + if($maxamount != '') $condition .= " AND $mtype<=$maxamount"; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + $income = $expense = 0; + while($r = $db->fetch_array($result)) { + $r['addtime'] = timetodate($r['addtime'], 5); + $r['amount'] > 0 ? $income += $r['amount'] : $expense += $r['amount']; + $lists[] = $r; + } + include tpl('sms', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/style.inc.php b/module/member/admin/style.inc.php new file mode 100644 index 0000000..531f6f0 --- /dev/null +++ b/module/member/admin/style.inc.php @@ -0,0 +1,137 @@ +pass($post)) { + $do->add($post); + dmsg('添加成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action); + } else { + msg($do->errmsg); + } + } else { + foreach($do->fields as $v) { + isset($$v) or $$v = ''; + } + $currency = 'money'; + $typeid = 0; + $addtime = timetodate($DT_TIME); + $menuid = 0; + include tpl('style_edit', $module); + } + break; + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + extract($do->get_one()); + $groupid = substr($groupid, 1, -1); + $addtime = timetodate($addtime); + $menuid = 1; + include tpl('style_edit', $module); + } + break; + case 'show': + $itemid or msg(); + $u = $db->get_one("SELECT c.username FROM {$DT_PRE}company c,{$DT_PRE}member m WHERE c.userid=m.userid AND c.vip>0 AND m.edittime>0 ORDER BY m.logintimes DESC"); + if($u) dheader(DT_PATH.'index.php?homepage='.$u['username'].'&preview='.$itemid); + msg('暂无符合条件的会员'); + break; + case 'update': + $do->order($listorder); + dmsg('更新成功', $forward); + break; + case 'delete': + $itemid or msg('请选择模板'); + $do->delete($itemid); + dmsg('删除成功', $forward); + break; + case 'del': + $itemid or msg('请选择订单'); + $do->del($itemid); + dmsg('删除成功', $forward); + break; + case 'order': + $sfields = array('按条件', '模板名称', '风格目录', '会员'); + $dfields = array('title', 'title', 'skin', 'username'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('结果排序方式', '模板价格降序', '模板价格升序', '购买时长降序', '购买时长升序', '订单总额降序', '订单总额升序', '购买时间降序', '购买时间升序', '到期时间降序', '到期时间升序'); + $dorder = array('itemid DESC', 'fee DESC', 'fee ASC', 'number DESC', 'number ASC', 'amount DESC', 'amount ASC', 'addtime DESC', 'addtime ASC', 'totime DESC', 'totime ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + isset($currency) && in_array($currency, array('money', 'credit')) or $currency = ''; + isset($mtype) && in_array($mtype, array('fee', 'number', 'amount')) or $mtype = 'fee'; + isset($minfee) or $minfee = ''; + isset($maxfee) or $maxfee = ''; + isset($datetype) && in_array($datetype, array('addtime', '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; + $itemid or $itemid = ''; + (isset($username) && check_name($username)) or $username = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($currency) $condition .= " AND currency='$currency'"; + if($minfee) $condition .= " AND $mtype>=$minfee"; + if($maxfee) $condition .= " AND $mtype<=$maxfee"; + if($fromtime) $condition .= " AND `$datetype`>=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; + if($itemid) $condition .= " AND styleid=$itemid"; + if($username) $condition .= " AND username='$username'"; + + $lists = $do->get_order($condition, $dorder[$order]); + include tpl('style_order', $module); + break; + default: + $sfields = array('按条件', '模板名称', '风格目录', '模板目录', '作者', '编辑'); + $dfields = array('title', 'title', 'skin', 'template', 'author', 'editor'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('结果排序方式', '模板价格降序', '模板价格升序', $DT['money_name'].'收益降序', $DT['money_name'].'收益升序', $DT['credit_name'].'收益降序', $DT['credit_name'].'收益升序', '使用人数降序', '使用人数升序', '订单数量降序', '订单数量升序', '安装时间降序', '安装时间升序', '修改时间降序', '修改时间升序'); + $dorder = array('listorder DESC,addtime DESC', 'fee DESC', 'fee ASC', 'money DESC', 'money ASC', 'credit DESC', 'credit ASC', 'hits DESC', 'hits ASC', 'orders DESC', 'orders ASC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + $groupid = isset($groupid) ? intval($groupid) : 0; + $typeid = isset($typeid) ? intval($typeid) : 0; + isset($currency) && in_array($currency, array('free', 'money', 'credit')) or $currency = ''; + isset($mtype) && in_array($mtype, array('fee', 'money', 'credit', 'hits', 'orders')) or $mtype = 'fee'; + isset($minfee) or $minfee = ''; + isset($maxfee) or $maxfee = ''; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $order_select = dselect($sorder, 'order', '', $order); + $type_select = type_select($TYPE, 1, 'typeid', '请选择分类', $typeid); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($groupid) $condition .= " AND groupid LIKE '%,$groupid,%'"; + if($typeid) $condition .= " AND typeid=$typeid"; + if($currency) $condition .= $currency == 'free' ? " AND fee=0" : " AND currency='$currency' AND fee>0"; + if($minfee) $condition .= " AND $mtype>=$minfee"; + if($maxfee) $condition .= " AND $mtype<=$maxfee"; + $lists = $do->get_list($condition, $dorder[$order]); + include tpl('style', $module); + break; +} +?> \ No newline at end of file diff --git a/module/member/admin/template/address.tpl.php b/module/member/admin/template/address.tpl.php new file mode 100644 index 0000000..1664b02 --- /dev/null +++ b/module/member/admin/template/address.tpl.php @@ -0,0 +1,65 @@ + + +
+ + + + + + + + + + +$v) {?> + + + + + + + + + + +
会员地址姓名手机添加时间操作
  +  + +
+
+ +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/member/admin/template/alert.tpl.php b/module/member/admin/template/alert.tpl.php new file mode 100644 index 0000000..84b94a9 --- /dev/null +++ b/module/member/admin/template/alert.tpl.php @@ -0,0 +1,89 @@ + + +
+ + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + +
类别关键词行业地区添加时间 上次发送 频率 会员邮箱管理
不限不限不限从未不限 + + +
+
+ +  + +  + + +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/member/admin/template/ask.tpl.php b/module/member/admin/template/ask.tpl.php new file mode 100644 index 0000000..718d8b9 --- /dev/null +++ b/module/member/admin/template/ask.tpl.php @@ -0,0 +1,68 @@ + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + +
分类标题提交时间 受理时间 会员名称评分 状态 操作
+  + +
+'.$pages.'' : '';?> + + + + +
+ \ No newline at end of file diff --git a/module/member/admin/template/award.tpl.php b/module/member/admin/template/award.tpl.php new file mode 100644 index 0000000..4834c2d --- /dev/null +++ b/module/member/admin/template/award.tpl.php @@ -0,0 +1,72 @@ + + +
+ + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + +
流水号 金额() 模块标题会员名称IP支付时间
小计 
+
+ +
+
+'.$pages.'' : '';?> + +
+ \ No newline at end of file diff --git a/module/member/admin/template/card_add.tpl.php b/module/member/admin/template/card_add.tpl.php new file mode 100644 index 0000000..37c6659 --- /dev/null +++ b/module/member/admin/template/card_add.tpl.php @@ -0,0 +1,56 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 面额
* 卡号前缀 [刷新]
* 卡号组成 + +
* 卡号长度 推荐8-15位之间
* 密码长度 6位以上
* 有效期至
* 生成数量
+
    
+
+ + + \ No newline at end of file diff --git a/module/member/admin/template/cash.tpl.php b/module/member/admin/template/cash.tpl.php new file mode 100644 index 0000000..76e7666 --- /dev/null +++ b/module/member/admin/template/cash.tpl.php @@ -0,0 +1,102 @@ + + +
+ + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + + + +
流水号 实付金额 手续费 会员名称收款方式申请时间 受理时间 操作人状态备注管理
+ +查看 + +受理 + +
小计 
+
+ +
+
+'.$pages.'' : '';?> + +
+ \ No newline at end of file diff --git a/module/member/admin/template/cash_stats.tpl.php b/module/member/admin/template/cash_stats.tpl.php new file mode 100644 index 0000000..e113d83 --- /dev/null +++ b/module/member/admin/template/cash_stats.tpl.php @@ -0,0 +1,86 @@ + +
+ +
+ +
+ + + \ No newline at end of file diff --git a/module/member/admin/template/charge_stats.tpl.php b/module/member/admin/template/charge_stats.tpl.php new file mode 100644 index 0000000..c8daa2d --- /dev/null +++ b/module/member/admin/template/charge_stats.tpl.php @@ -0,0 +1,87 @@ + +
+ +
+ +
+ + + \ No newline at end of file diff --git a/module/member/admin/template/credit_add.tpl.php b/module/member/admin/template/credit_add.tpl.php new file mode 100644 index 0000000..3042eb9 --- /dev/null +++ b/module/member/admin/template/credit_add.tpl.php @@ -0,0 +1,67 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 会员名
* 类型 + 收入     + 支出 +
* 分值
* 事由
* 备注
* 注意此表单一经提交,将不可再修改或删除,请务必谨慎操作
+
    
+
+ + + \ No newline at end of file diff --git a/module/member/admin/template/deposit_add.tpl.php b/module/member/admin/template/deposit_add.tpl.php new file mode 100644 index 0000000..d757a17 --- /dev/null +++ b/module/member/admin/template/deposit_add.tpl.php @@ -0,0 +1,67 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 会员名
* 类型 + 收入     + 支出 +
* 金额
* 事由 客户可见
* 备注
* 注意此表单一经提交,将不可再修改或删除,请务必谨慎操作
+
    
+
+ + + \ No newline at end of file diff --git a/module/member/admin/template/favorite_edit.tpl.php b/module/member/admin/template/favorite_edit.tpl.php new file mode 100644 index 0000000..073eb60 --- /dev/null +++ b/module/member/admin/template/favorite_edit.tpl.php @@ -0,0 +1,48 @@ + +
+ + + + + + + + + + + + + + + + + + +
* 标题
* URL
* 备注
+
    
+
+ + + \ No newline at end of file diff --git a/module/member/admin/template/loginlog.tpl.php b/module/member/admin/template/loginlog.tpl.php new file mode 100644 index 0000000..cab9aba --- /dev/null +++ b/module/member/admin/template/loginlog.tpl.php @@ -0,0 +1,57 @@ + +
+ +
+ + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + +
登录时间会员名位置结果IP端口地区客户端系统浏览器
后台' : '前台';?>
+
+ +
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/member/admin/template/member_edit.tpl.php b/module/member/admin/template/member_edit.tpl.php new file mode 100644 index 0000000..5a91e32 --- /dev/null +++ b/module/member/admin/template/member_edit.tpl.php @@ -0,0 +1,494 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +', '
* 会员头像
* 会员登录名    [修改]
* 昵称    [修改]
* 会员组 
* 登录密码  如不更改,请留空
* 重复输入密码 
* 支付密码  如不更改,请留空
* 重复支付密码 
* 真实姓名  
* 性别 +/> 先生     +/> 女士 +
* 所在地区 
* 部门
* 职位
* 手机号码     查询
* 电子邮件   [不公开]
* QQ
* 微信
* 微信二维码  [上传]  [预览]  [删除]
* 阿里旺旺
* Skype
* 站内信提示音 +
+checked="checked" id="sound_0"/>     +checked="checked" id="sound_1"/> 提示音1     +checked="checked" id="sound_2"/> 提示音2     +checked="checked" id="sound_3"/> 提示音3     +
* 开户银行 + +
* 帐号类型 + checked/> 对私 + checked/> 对公 +
* 开户网点
* 收款帐号 
', $user, $MFD) : '';?> +
+
* 公司资料
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +', '
* 公司名称     查询
* 公司类型 
* 形象图片  [上传]  [预览]  [删除]
+建议使用LOGO、办公环境等标志性图片,最佳大小为px*px
* 主营行业 + +
+   添加   搜索 +
+
style="display:none;" +>请添加主营行业,最多可添加
+ + + +
+ + +
* 主要经营范围 
* 经营模式 + (最多可选种)
* 公司规模
* 注册资本
* 成立年份  (年份,如:2004)
* 公司地址 
* 邮政编码
* 公司电话 
* 公司传真
* 公司邮件 [公开]
* 公司网址
* 微信公众号
* 公众号二维码 [上传]  [预览]  [删除]
* 销售的产品(服务) 多个产品或服务请用'|'号隔开
* 采购的产品(服务) 多个产品或服务请用'|'号隔开
* 公司介绍 +
', $user, $CFD) : '';?> +
+
资料认证
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 企业资料是否通过认证 +/> 是     +/> 否 + +
* 认证名称或机构
* 认证日期
* 邮件认证 +/> 是     +/> 否 + +
* 手机认证 +/> 是     +/> 否 + +
* 银行认证 +/> 是     +/> 否 + +
* 实名认证 +/> 是     +/> 否 + +
* 公司认证 +/> 是     +/> 否 + +
* 商铺认证 +/> 是     +/> 否 + +
+
高级设置
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 商铺名称  
* 绑定域名同时需要会员将此域名IP指向本站服务器');?>
* 域名ICP备案号
* 站内信黑名单
* 客服专员 [资料]
* 推荐注册人 [资料]
* 会员资料是否完整 + id="edittime"/> 是     + /> 否   +如果选择是,系统将不再提示会员完善资料 +
* 验证必填项 + 是     + 否   +如果选择否,系统本次不再验证必填项是否已规范填写 +
+
    
+
+ + + \ No newline at end of file diff --git a/module/member/admin/template/message_edit.tpl.php b/module/member/admin/template/message_edit.tpl.php new file mode 100644 index 0000000..88b22b4 --- /dev/null +++ b/module/member/admin/template/message_edit.tpl.php @@ -0,0 +1,52 @@ + +
+ + + + + + + + + + + + + + + + + + + +
* 会员组
* 标题
* 内容 +
+
+
    
+
+ + + + \ No newline at end of file diff --git a/module/member/admin/template/message_mail.tpl.php b/module/member/admin/template/message_mail.tpl.php new file mode 100644 index 0000000..9fec636 --- /dev/null +++ b/module/member/admin/template/message_mail.tpl.php @@ -0,0 +1,37 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
* 温馨提示可以通过此功能将会员的未读站内信发送至其注册邮箱
* 时间范围 + 小时每封站内信只发送一次,已经发送过的不会重复发送');?> +
* 每轮发送邮件数
上次发送
+
+
+ + \ No newline at end of file diff --git a/module/member/admin/template/message_system.tpl.php b/module/member/admin/template/message_system.tpl.php new file mode 100644 index 0000000..8d51b92 --- /dev/null +++ b/module/member/admin/template/message_system.tpl.php @@ -0,0 +1,29 @@ + + + + + + + + + +$v) {?> + + + + + + + + +
ID标题会员组时间操作
  +  + +
+ +
+ \ No newline at end of file diff --git a/module/member/admin/template/news_edit.tpl.php b/module/member/admin/template/news_edit.tpl.php new file mode 100644 index 0000000..232eb6d --- /dev/null +++ b/module/member/admin/template/news_edit.tpl.php @@ -0,0 +1,79 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 审核提示该信息存在修改记录,点击查看 修改详情
* 会员名 [资料]
* 新闻标题
* 标题图片  [上传]  [预览]  [删除]
* 新闻内容 +
+
* 新闻状态 + id="status_3"/> + id="status_2"/> + onclick="if(this.checked) Dd('note').style.display='';" id="status_1"/> + id="status_0"/> +
* 拒绝理由
* 添加时间
+
    
+
+ + + + \ No newline at end of file diff --git a/module/member/admin/template/promo.tpl.php b/module/member/admin/template/promo.tpl.php new file mode 100644 index 0000000..e924877 --- /dev/null +++ b/module/member/admin/template/promo.tpl.php @@ -0,0 +1,91 @@ + + +
+ + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + +
优惠名称卖家优惠额度 最低消费 数量限制 领券人数 开始时间 结束时间 添加时间 备注操作
+  +  + +
+
+ +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/member/admin/template/promo_coupon.tpl.php b/module/member/admin/template/promo_coupon.tpl.php new file mode 100644 index 0000000..04ea8db --- /dev/null +++ b/module/member/admin/template/promo_coupon.tpl.php @@ -0,0 +1,93 @@ + + +
+ + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + +
优惠名称买家卖家优惠额度 最低消费 开始时间 结束时间 领取时间 订单ID状态备注
+ +已使用 + $DT_TIME) { ?> +未开始 + +已过期 + +待使用 + +
+
+ +
+
+'.$pages.'' : '';?> + + \ No newline at end of file diff --git a/module/member/admin/template/promo_edit.tpl.php b/module/member/admin/template/promo_edit.tpl.php new file mode 100644 index 0000000..70b4695 --- /dev/null +++ b/module/member/admin/template/promo_edit.tpl.php @@ -0,0 +1,87 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 会员名 [资料] 不填代表全站通用
* 优惠名称
* 优惠金额
* 最低消费 0.00代表不限制
* 数量限制
* 会员领取 +/> 是     +/> 否 +
* 有效时间
* 备注信息
+
    
+
+ + + \ No newline at end of file diff --git a/module/member/admin/template/promo_give.tpl.php b/module/member/admin/template/promo_give.tpl.php new file mode 100644 index 0000000..97ad1c6 --- /dev/null +++ b/module/member/admin/template/promo_give.tpl.php @@ -0,0 +1,60 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 会员名 [资料]
* 优惠名称
* 所属商家
* 优惠金额
* 最低消费
* 数量限制
* 有效时间
* 备注信息
+
    
+
+ + \ No newline at end of file diff --git a/module/member/admin/template/record.tpl.php b/module/member/admin/template/record.tpl.php new file mode 100644 index 0000000..db9d0fa --- /dev/null +++ b/module/member/admin/template/record.tpl.php @@ -0,0 +1,95 @@ + + +
+ + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + + +
流水号 收入 支出 余额 会员名称支付平台发生时间 操作人事由备注
0) echo '+'.$v['amount'];?>
小计+ 
+
+  + +
+
+'.$pages.'' : '';?> + +
+ \ No newline at end of file diff --git a/module/member/admin/template/sendmail_show.tpl.php b/module/member/admin/template/sendmail_show.tpl.php new file mode 100644 index 0000000..9d6d5df --- /dev/null +++ b/module/member/admin/template/sendmail_show.tpl.php @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
标题
收件人
发送时间
发送结果成功' : '失败';?>
内容
备注
+
+ + \ No newline at end of file diff --git a/module/member/admin/template/sendsms.tpl.php b/module/member/admin/template/sendsms.tpl.php new file mode 100644 index 0000000..d62e195 --- /dev/null +++ b/module/member/admin/template/sendsms.tpl.php @@ -0,0 +1,132 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 收信人 + />    + />    + /> +
* 接收号码
* 短信内容 + + + + + +
+- 当前已输入0字,签名0字,共0字,分0条短信 (约字/条)
+- 以上分条仅为系统估算,实际分条以运营商返回数据为准
+- 内容支持变量,会员资料保存于$user数组
+- 例 {$user[username]} 表示会员名
+- 例 {$user[company]} 表示公司名
+- 如果是给非会员发送短信,请不要使用变量
+ +- 注意:无法发送,未设置发送参数 点此设置
+ + +- 由于政策原因,并非所有内容都可以正常发送...了解详情
+- 发送任何违法信息,帐号会被禁用且不退款
+
+- 测试发送一条随机验证码短信
+ + +
+
* 短信签名
+
    
+
+ + + \ No newline at end of file diff --git a/module/member/admin/template/sendsms_list.tpl.php b/module/member/admin/template/sendsms_list.tpl.php new file mode 100644 index 0000000..3e72d1d --- /dev/null +++ b/module/member/admin/template/sendsms_list.tpl.php @@ -0,0 +1,35 @@ + + + + + + + + + +$v) {?> + + + + + + + + +
文件文件大小(Kb)记录数获取时间操作
   +  
+
+
+ + + + +  +
+
+ + \ No newline at end of file diff --git a/module/member/admin/template/setting.tpl.php b/module/member/admin/template/setting.tpl.php new file mode 100644 index 0000000..a5fddb3 --- /dev/null +++ b/module/member/admin/template/setting.tpl.php @@ -0,0 +1,984 @@ + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
新用户注册 +/> 开启     +/> 关闭 +
用户名长度 + +至 + +字符 +
用户名保留关键字多个保留关键字请用|隔开');?> +
保留关键字匹配模式 +/> 相同     +/> 包含选择相同时,当用户名和关键字相同时才禁止注册');?> +
用户密码长度 + +至 + +字符建议设置为6-20个字符之间,不要超过30位');?> +
用户密码强度 +/> 数字     +/> 小写字母     +/> 大写字母     +/> 标点符号     +
公司名保留关键字多个保留关键字请用|隔开');?> +
保留关键字匹配模式 +/> 相同     +/> 包含选择相同时,当公司名和关键字相同时才禁止注册');?> +
电子邮件禁止域名多个域名请用|隔开');?> +
新用户注册验证 +> 不验证     +> 人工审核     +> 邮件验证     +> 短信验证     +> 邮件或短信验证   +
注册发送欢迎站内信件 +/> 开启   +/> 关闭 +
注册发送欢迎电子邮件 +/> 开启   +/> 关闭 +
注册发送欢迎手机短信 +/> 开启   +/> 关闭 +
注册验证码 +/> 开启   +/> 关闭 +
注册验证问题 +/> 开启   +/> 关闭 +
注册赠送 + +
注册赠送 + +
注册赠送短信 + 条 +
禁止代理服务器注册 +/> 开启     +/> 关闭 +
注册客户端屏蔽例如某群发软件的客户端信息全部包含 .NET CLR 1.0.3705
可在此直接屏蔽含有此类特征码的客户端注册
多个特征码请用 | 分隔');?> +
IP注册间隔限制(小时) + +
会员便签默认值 +
会员资料修改需审核 + '形象图片', + 'areaid' => '所在地区', + 'type' => '公司类型', + 'business' => '经营范围', + 'regyear' => '成立年份', + 'capital' => '注册资本', + 'address' => '公司地址', + 'telephone' => '联系电话', + 'gzh' => '微信公众号', + 'gzhqr' => '公众号二维码', + 'content' => '公司介绍', +); +foreach($ECK as $k=>$v) { + echo ''; +} +?> +
用户名修改 +/> 禁止   +/> 一次   +/> 一年一次 +
昵称修改 +/> 禁止   +/> 一次   +/> 一年一次 +
登录失败次数限制 次登录失败后锁定登录 小时 +
用户登录启用验证码 +/> 开启   +/> 关闭 +
异地登录短信安全验证 +/> 开启   +/> 关闭 开启此设置请确保手机验证码登录已经开启,且只对已验证手机号的会员有效');?> +
用户登录有效期
手机验证码登录 +/> 开启   +/> 关闭   +/> 开启并自动注册 +
微信扫码登录 +/> 开启   +/> 关闭 +
手机APP扫码登录 +/> 开启   +/> 关闭 +
会员账号注销 +/> 开启   +/> 关闭 +
商户子账号 +/> 开启   +/> 关闭 +
站内短信同时最多发送至 + 位会员 +
发送站内短信启用验证码 +> 继承会员组设置        +> 全部启用        +> 全部关闭 +
修改资料启用验证码 +> 继承会员组设置        +> 全部启用        +> 全部关闭 +
修改商铺设置启用验证码 +> 继承会员组设置        +> 全部启用        +> 全部关闭 +
验证邮件/短信有效期 +如果是短信,则为对应的乘10分钟,例如设置3,代表30分钟内有效');?> +
贸易提醒模块ID + +
贸易提醒需审核 +> 继承会员组设置        +> 全部启用        +> 全部关闭 +
在线交谈内容长度限制 字符
在线交谈超时限制
在线交谈轮询时间
两次发言间隔时间
在线交谈发送文件 +/> 开启   +/> 关闭 +
在线交谈自动解析网址 +/> 开启   +/> 关闭 +
在线交谈解析图片地址 +/> 开启   +/> 关闭 +
会员资料认证 +checked onclick="Ds('dvm');"/> 开启   +checked onclick="Dh('dvm');"/> 关闭 +
邮件认证 +checked /> 开启   +checked /> 关闭 +
手机认证 +checked /> 开启   +checked /> 关闭 +
姓名认证 +checked /> 开启   +checked /> 关闭 +
银行帐号认证 +checked /> 开启   +checked /> 关闭 +
公司认证 +checked /> 开启   +checked /> 关闭 +
商铺认证 +checked /> 开启   +checked /> 关闭 +
认证专用传真号码 + +
编辑器工具按钮 + +
+
+ + + + + + + +
+     + +
+
+ + \ No newline at end of file diff --git a/module/member/admin/template/sms.tpl.php b/module/member/admin/template/sms.tpl.php new file mode 100644 index 0000000..8f0d80f --- /dev/null +++ b/module/member/admin/template/sms.tpl.php @@ -0,0 +1,85 @@ + + +
+ + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + + + +
流水号 增加 扣除 余额 会员名称发生时间 操作人事由备注
0) echo '+'.$v['amount'];?>
小计 
+
+  + +
+
+'.$pages.'' : '';?> + +
+ \ No newline at end of file diff --git a/module/member/admin/template/stock.tpl.php b/module/member/admin/template/stock.tpl.php new file mode 100644 index 0000000..7b2ce06 --- /dev/null +++ b/module/member/admin/template/stock.tpl.php @@ -0,0 +1,86 @@ + + +
+ + + + + + + + + + + + + + + + + + +$v) {?> + + + + + + + + + + + + + + + + + + +
图片商品库存 单位价格 品牌条形编码仓储货位会员添加时间 操作
  +  + +
+ +
+  +
+
+'.$pages.'' : '';?> +
+ + \ No newline at end of file diff --git a/module/member/admin/template/validate_member.tpl.php b/module/member/admin/template/validate_member.tpl.php new file mode 100644 index 0000000..48daab4 --- /dev/null +++ b/module/member/admin/template/validate_member.tpl.php @@ -0,0 +1,36 @@ + +
+ +
+ + + + + + +$v) {?> + + + + + + +
会员提交时间查看
+'.$pages.'' : '';?> + +
+ \ No newline at end of file diff --git a/module/member/admin/template/weixin_chat.tpl.php b/module/member/admin/template/weixin_chat.tpl.php new file mode 100644 index 0000000..03acf52 --- /dev/null +++ b/module/member/admin/template/weixin_chat.tpl.php @@ -0,0 +1,136 @@ + + + +
+
+ + + + + + + + + + + + + + +
+ +

来自
+
+ + + + + + + +
+
+ + \ No newline at end of file diff --git a/module/member/admin/template/weixin_setting.tpl.php b/module/member/admin/template/weixin_setting.tpl.php new file mode 100644 index 0000000..95a8235 --- /dev/null +++ b/module/member/admin/template/weixin_setting.tpl.php @@ -0,0 +1,65 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
APPID
APPSECRET
URLapi/weixin/index.php
TOKEN [随机]
EncodingAESKey
备注以上信息在微信公众平台获取或设置
公众微信号
用户关注欢迎信息 +
自动回复用户信息 +
绑定会员描述信息 +
每日签到赠送积分
+
+ +
+
+
+ + \ No newline at end of file diff --git a/module/member/admin/weixin.inc.php b/module/member/admin/weixin.inc.php new file mode 100644 index 0000000..4e58cfd --- /dev/null +++ b/module/member/admin/weixin.inc.php @@ -0,0 +1,531 @@ +get_one("SELECT * FROM {$DT_PRE}weixin_user WHERE username='$username'"); + $U or msg('用户未绑定微信帐号'); + $openid = $U['openid']; +} else if($openid) { + $U = $db->get_one("SELECT * FROM {$DT_PRE}weixin_user WHERE openid='$openid'"); + $U or msg('微信帐号不存在'); +} +if($openid) { + $U['headimgurl'] or $U['headimgurl'] = 'api/weixin/image/headimg.jpg'; + $menus = array ( + array('消息记录', '?moduleid='.$moduleid.'&file='.$file.'&openid='.$openid), + array('事件记录', '?moduleid='.$moduleid.'&file='.$file.'&openid='.$openid.'&action=event'), + array('微信交谈', '?moduleid='.$moduleid.'&file='.$file.'&openid='.$openid.'&action=chat'), + ); +} else { + $menus = array ( + array('消息记录', '?moduleid='.$moduleid.'&file='.$file), + array('事件记录', '?moduleid='.$moduleid.'&file='.$file.'&action=event'), + array('用户管理', '?moduleid='.$moduleid.'&file='.$file.'&action=user'), + array('自动回复', '?moduleid='.$moduleid.'&file='.$file.'&action=auto'), + array('菜单管理', '?moduleid='.$moduleid.'&file='.$file.'&action=menu'), + array('帐号设置', '?moduleid='.$moduleid.'&file='.$file.'&action=setting'), + array('公众平台', DT_PATH.'api/redirect.php?url=http://mp.weixin.qq.com/', 'target="_blank"'), + ); +} +switch($action) { + case 'unbind': + $itemid or msg('请选择记录'); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + $db->query("UPDATE {$DT_PRE}weixin_user SET username='' WHERE itemid IN ($itemids)"); + dmsg('解除成功', $forward); + break; + case 'clear': + $time = $DT_TODAY - 30*86400; + $db->query("DELETE FROM {$DT_PRE}weixin_chat WHERE addtime<$time"); + dmsg('清理成功', $forward); + break; + case 'delete': + $itemid or msg('请选择记录'); + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + $db->query("DELETE FROM {$DT_PRE}weixin_chat WHERE itemid IN ($itemids)"); + dmsg('删除成功', $forward); + break; + case 'edit': + $itemid or msg('请选择记录'); + $user = $db->get_one("SELECT * FROM {$DT_PRE}weixin_user WHERE itemid=$itemid"); + $user or msg('记录不存在'); + if($submit) { + if(check_name($name)) { + $name != $user['username'] or msg('会员名'.$name.'未修改'); + $u = userinfo($name); + $u or msg('会员'.$name.'不存在'); + $u['groupid'] > 4 or msg('会员'.$name.'所在组不可修改'); + $db->query("UPDATE {$DT_PRE}weixin_user SET username='' WHERE username='$name'"); + } + $db->query("UPDATE {$DT_PRE}weixin_user SET username='$name' WHERE itemid=$itemid"); + dmsg('修改成功', '?moduleid='.$moduleid.'&file='.$file.'&action=user'); + } else { + include tpl('weixin_edit', $module); + } + break; + case 'setting': + if($submit) { + $setting = array_map('trim', $setting); + $open = $setting['appid'] && $setting['appsecret'] && $setting['apptoken'] && $setting['weixin'] ? 1 : 0; + $db->query("UPDATE {$DT_PRE}setting SET item_value='$open' WHERE item_key='weixin' AND item='3'"); + cache_module(3); + update_setting('weixin', $setting); + cache_weixin(); + dmsg($open ? '微信已开启' : '微信已关闭', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action); + } else { + cache_weixin(); + extract(dhtmlspecialchars(cache_read('weixin.php'))); + include tpl('weixin_setting', $module); + } + break; + case 'sync': + require DT_ROOT.'/api/weixin/init.inc.php'; + isset($next_openid) or $next_openid = ''; + $num = isset($num) ? intval($num) : 0; + $url = 'https://api.weixin.qq.com/cgi-bin/user/get?access_token='.$access_token.'&next_openid='.$next_openid; + $arr = $wx->http_get($url); + isset($arr['total']) or msg('连接失败,请检查配置'); + if($arr['total'] == 0) dmsg('同步成功', '?moduleid='.$moduleid.'&file='.$file.'&action=user'); + foreach($arr['data']['openid'] as $v) { + $num++; + $user = weixin_user($v); + if(!$user) $db->query("INSERT INTO {$DT_PRE}weixin_user (openid) VALUES ('$v')"); + } + if($arr['next_openid'] == '' || $arr['next_openid'] == $next_openid) { + msg('会员同步成功,开始同步会员资料...', '?moduleid='.$moduleid.'&file='.$file.'&action=sync_user'); + } else { + msg('已同步 '.$num.' 位会员'.progress(1, $num, $arr['total']), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&num='.$num.'&next_openid='.$arr['next_openid']); + } + break; + case 'sync_user': + require DT_ROOT.'/api/weixin/init.inc.php'; + if(!isset($fid)) { + $r = $db->get_one("SELECT min(itemid) AS fid FROM {$DT_PRE}weixin_user"); + $fid = $r['fid'] ? $r['fid'] : 0; + } + isset($sid) or $sid = $fid; + if(!isset($tid)) { + $r = $db->get_one("SELECT max(itemid) AS tid FROM {$DT_PRE}weixin_user"); + $tid = $r['tid'] ? $r['tid'] : 0; + } + isset($num) or $num = 50; + if($fid <= $tid) { + $result = $db->query("SELECT * FROM {$DT_PRE}weixin_user WHERE itemid>=$fid ORDER BY itemid LIMIT 0,$num "); + if($db->affected_rows($result)) { + while($user = $db->fetch_array($result)) { + $itemid = $user['itemid']; + $info = $wx->get_user($user['openid']); + if($info) { + if($info['subscribe'] == 0) { + $sql = "subscribe=0,username='',edittime=$DT_TIME"; + } else { + $sql = "subscribe=1,addtime=".$info['subscribe_time'].",edittime=$DT_TIME"; + foreach(array('nickname', 'sex', 'city', 'province', 'country', 'language', 'headimgurl') as $v) { + if(isset($info[$v])) $sql .= ",".$v."='".addslashes($info[$v])."'"; + } + } + $db->query("UPDATE {$DT_PRE}weixin_user SET $sql WHERE itemid=$itemid"); + } + } + $itemid += 1; + } else { + $itemid = $fid + $num; + } + } else { + dmsg('同步成功', '?moduleid='.$moduleid.'&file='.$file.'&action=user'); + } + msg('ID从'.$fid.'至'.($itemid-1).'资料同步成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$itemid&tid=$tid&num=$num"); + break; + case 'chat': + include tpl('weixin_chat', $module); + break; + case 'send': + $openid or exit; + $word = trim(strip_tags($word)); + $word or dalert('发送内容不能为空', '', 'window.parent.chat_show();'); + require DT_ROOT.'/api/weixin/init.inc.php'; + $str = substr($word, 0, 4); + $ext = substr($word, -3); + $file = ''; + $type = 'text'; + if($str == 'http' && in_array($ext, array('jpg', 'amr', 'mp3', 'mp4'))) { + if(strpos($word, DT_PATH) === 0) { + $file = str_replace(DT_PATH, DT_ROOT.'/', $word); + } else { + if($DT['remote_url'] && strpos($word, $DT['remote_url']) === 0) { + $file = DT_ROOT.'/file/temp/'.date('YmdHis', $DT_TIME).mt_rand(10, 99).$_userid.'.'.$ext; + file_copy($word, $file); + } + } + if(strpos($file, '/file/') !== false && strpos($file, '..') === false && is_file($file)) { + $arr = $wx->http_upload($file); + if($arr[0]) { + file_del($file); + $word = $arr[0];//Media_ID + $type = $arr[1]; + } else { + dalert('上传失败 - '.$arr[1], '', 'window.parent.chat_show();'); + } + } + } + $arr = $wx->send($openid, $type, $word); + if($arr['errcode'] != 0) { + if($arr['errcode'] == 45015) dalert('回复时间超过限制[须48小时内回复]', '', 'window.parent.chat_hide(1);'); + dalert('发送失败 - '.$arr['errmsg'].'(errcode:'.$arr['errcode'].')', '', 'window.parent.chat_show();'); + } + $post = array(); + $post['content'] = $word; + $post['type'] = 'reply'; + $post['openid'] = $openid; + $post['editor'] = $_username; + $post['addtime'] = $DT_TIME; + $post['misc']['type'] = $type; + $post['misc'] = $post['misc'] ? serialize($post['misc']) : ''; + $post = daddslashes($post); + $sql = ''; + foreach($post as $k=>$v) { + $sql .= ",$k='$v'"; + } + $db->query("INSERT INTO {$DT_PRE}weixin_chat SET ".substr($sql, 1)); + dalert('', '', 'window.parent.chat_show(2);'); + break; + case 'load': + $openid or exit; + $chatlast = $_chatlast = intval($chatlast); + $josn = $debug = ''; + $i = $j = 0; + if($chatlast) { + $sql = "SELECT * FROM {$DT_PRE}weixin_chat WHERE openid='$openid' AND event=0 AND addtime>$chatlast ORDER BY addtime DESC"; + } else { + $sql = "SELECT * FROM {$DT_PRE}weixin_chat WHERE openid='$openid' AND event=0 ORDER BY addtime DESC LIMIT 20"; + } + $lists = array(); + $result = $db->query($sql); + while($r = $db->fetch_array($result)) { + if($r['type'] == 'reply' && $r['editor'] != $_username) continue; + $lists[] = $r; + } + $num = count($lists); + if($num) { + for($k = $num - 1; $k >= 0; $k--) { + $r = $lists[$k]; + $time = timetodate($r['addtime'], 'H:i:s'); + $date2 = timetodate($r['addtime'], 'Y-m-d'); + if($date2 == $date1) { + $date = ''; + } else { + $date = $date1 = $date2; + } + if($i == 0 && $chatlast) $date = ''; + $word = weixin_msg($r['type'], $r['content'], $r['misc']); + $word = str_replace('"', '\"', $word); + if($r['editor']) { + $name = '我'; + $self = 1; + } else { + $name = $U['nickname']; + $self = 0; + if($_chatlast) $j++; + } + $chatlast = $r['addtime']; + $josn .= ($i ? ',' : '').'{time:"'.$time.'",date:"'.$date.'",name:"'.$name.'",word:"'.$word.'",self:"'.$self.'"}'; + $i = 1; + } + } + $debug = timetodate($chatlast, 6).'-'.$j; + $josn = '{chat_msg:['.$josn.'],chat_new:"'.$j.'",chat_last:"'.$chatlast.'",chat_bug:"'.$debug.'"}'; + exit($josn); + break; + case 'user': + $SEX = array('未知', '男', '女'); + $SUBSCRIBE = array('已取消', '关注中', '未关注'); + $sfields = array('按条件', '会员名', '昵称', '城市', '省份', '国籍', '语言', 'OpenID'); + $dfields = array('username', 'username', 'nickname', 'city', 'province', 'country', 'language', 'openid'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = array('结果排序方式', '关注时间降序', '关注时间升序', '打开时间降序', '打开时间升序', '登录时间降序', '登录时间升序', '登录次数降序', '登录次数升序'); + $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'visittime DESC', 'visittime ASC', 'logintime DESC', 'logintime ASC', 'logintimes DESC', 'logintimes ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + isset($site) or $site = ''; + $thumb = isset($thumb) ? intval($thumb) : 0; + $sex = isset($sex) ? intval($sex) : -1; + $subscribe = isset($subscribe) ? intval($subscribe) : -1; + isset($datetype) && in_array($datetype, array('addtime', 'visittime', 'logintime')) 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; + + $fields_select = dselect($sfields, 'fields', '', $fields); + $order_select = dselect($sorder, 'order', '', $order); + + $condition = '1'; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($thumb) $condition .= " AND headimgurl<>''"; + if($sex > -1) $condition .= " AND sex='$sex'"; + if($subscribe > -1) $condition .= " AND subscribe='$subscribe'"; + if($fromtime) $condition .= " AND `$datetype`>=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; + #echo $condition;exit; + + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}weixin_user WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}weixin_user WHERE $condition ORDER BY $dorder[$order] LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['visitdate'] = $r['visittime'] ? timetodate($r['visittime'], 5) : 'N/A'; + $r['logindate'] = $r['logintime'] ? timetodate($r['logintime'], 5) : 'N/A'; + $r['gender'] = $SEX[$r['sex']]; + $r['status'] = $SUBSCRIBE[$r['subscribe']]; + $r['headimgurl'] or $r['headimgurl'] = 'api/weixin/image/headimg.jpg'; + $lists[] = $r; + } + include tpl('weixin_user', $module); + break; + case 'auto': + if($submit) { + foreach($post as $k=>$v) { + $k = intval($k); + if($k == 0) { + if($v['keyword'] && $v['reply']) { + $K = explode("\n", trim(strip_tags($v['keyword']))); + $R = explode("\n", trim(strip_tags($v['reply']))); + foreach($K as $i=>$W) { + $keyword = trim($W); + $reply = trim($R[$i]); + if($keyword && $reply) $db->query("INSERT INTO {$DT_PRE}weixin_auto SET keyword='$keyword',reply='$reply'"); + } + } + } else { + if(isset($v['delete'])) { + $db->query("DELETE FROM {$DT_PRE}weixin_auto WHERE itemid=$k"); + } else { + $keyword = trim(strip_tags($v['keyword'])); + $reply = trim(strip_tags($v['reply'])); + if($keyword && $reply) $db->query("UPDATE {$DT_PRE}weixin_auto SET keyword='$keyword',reply='$reply' WHERE itemid=$k"); + } + } + } + dmsg('保存成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action); + } else { + $condition = "1"; + if($kw) $condition .= " AND (keyword LIKE '%$keyword%' OR reply LIKE '%$keyword%')"; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}weixin_auto WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}weixin_auto WHERE $condition ORDER BY itemid LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $lists[] = $r; + } + include tpl('weixin_auto', $module); + } + break; + case 'menu': + #https://developers.weixin.qq.com/doc/offiaccount/Custom_Menus/Creating_Custom-Defined_Menu.html + if($submit) { + require DT_ROOT.'/api/weixin/init.inc.php'; + update_setting('weixin-menu', array('menu' => serialize($post))); + cache_weixin(); + $menu = $sub = $btn = array(); + for($i = 0; $i < 3; $i++) { + $sub[$i] = 0; + if($post[$i][1]['name'] && $post[$i][1]['key']) $sub[$i] = 1; + } + for($i = 0; $i < 3; $i++) { + if($post[$i][0]['name']) { + $menu[$i]['name'] = urlencode($post[$i][0]['name']); + if($sub[$i]) { + for($j = 1; $j < 6; $j++) { + if($post[$i][$j]['name'] && $post[$i][$j]['key']) { + $menu[$i]['sub_button'][$j-1]['name'] = urlencode($post[$i][$j]['name']); + if(substr($post[$i][$j]['key'], 0, 4) == 'http') { + $menu[$i]['sub_button'][$j-1]['type'] = 'view'; + $menu[$i]['sub_button'][$j-1]['url'] = $post[$i][$j]['key']; + } else if(strpos($post[$i][$j]['key'], '|') !== false) { + $tmp = explode('|', $post[$i][$j]['key']); + $menu[$i]['sub_button'][$j-1]['type'] = 'miniprogram'; + $menu[$i]['sub_button'][$j-1]['url'] = isset($tmp[2]) ? $tmp[2] : $EXT['mobile_url']; + $menu[$i]['sub_button'][$j-1]['appid'] = $tmp[0]; + $menu[$i]['sub_button'][$j-1]['pagepath'] = $tmp[1]; + } else { + $menu[$i]['sub_button'][$j-1]['type'] = 'click'; + $menu[$i]['sub_button'][$j-1]['key'] = $post[$i][$j]['key']; + } + } else { + break; + } + } + } else { + if($post[$i][0]['key']) { + if(substr($post[$i][0]['key'], 0, 4) == 'http') { + $menu[$i]['type'] = 'view'; + $menu[$i]['url'] = $post[$i][0]['key']; + } else if(strpos($post[$i][0]['key'], '|') !== false) { + $tmp = explode('|', $post[$i][0]['key']); + $menu[$i]['type'] = 'miniprogram'; + $menu[$i]['url'] = isset($tmp[2]) ? $tmp[2] : $EXT['mobile_url']; + $menu[$i]['appid'] = $tmp[0]; + $menu[$i]['pagepath'] = $tmp[1]; + } else { + $menu[$i]['type'] = 'click'; + $menu[$i]['key'] = $post[$i][0]['key']; + } + } else { + msg('菜单'.($i+1).' 地址/事件 不能为空'); + } + } + } + } + $btn['button'] = $menu; + $par = stripslashes(urldecode(json_encode($btn))); + $url = 'https://api.weixin.qq.com/cgi-bin/menu/create?access_token='.$access_token; + $arr = $wx->http_post($url, $par); + if($arr['errcode'] == 0) { + dmsg('同步成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action); + } else { + msg('同步失败 - '.$arr['errcode'].':'.$arr['errmsg']); + } + } else { + #print_r($wx->http_get('https://api.weixin.qq.com/cgi-bin/menu/get?access_token='.$access_token)); + cache_weixin(); + $menu = cache_read('weixin-menu.php'); + if(!is_array($menu) || count($menu) < 1 || count($menu) > 3) { + $menu = array(); + for($i = 0; $i < 3; $i++) { + for($j = 0; $j < 6; $j++) { + $menu[$i][$j]['name'] = ''; + $menu[$i][$j]['key'] = ''; + } + } + } + include tpl('weixin_menu', $module); + } + break; + default: + $sfields = array('按条件', '消息内容', '微信昵称', '会员名', '网站编辑'); + $dfields = array('c.content', 'c.content', 'u.nickname', 'u.username', 'c.editor'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + isset($type) or $type = ''; + $event = isset($event) ? intval($event) : -1; + (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 = 'u.openid=c.openid'; + if($action == 'event') { + $condition .= " AND c.event=1"; + $TYPE = array( + 'subscribe' => '用户订阅', + 'unsubscribe' => '取消订阅', + 'SCAN' => '扫描二维码', + 'LOCATION' => '地理位置', + 'CLICK' => '点击菜单', + 'VIEW' => '点击链接', + 'TEMPLATESENDJOBFINISH' => '模板消息', + ); + } else { + $condition .= " AND c.event=0"; + $TYPE = array( + 'text' => '文本消息', + 'image' => '图片消息', + 'voice' => '语音消息', + 'video' => '视频消息', + 'location' => '地理位置', + 'link' => '链接消息', + 'reply' => '网站回复', + 'push' => '网站推送', + 'unpush' => '推送失败', + 'template' => '模板消息', + 'untemplate' => '消息失败', + ); + } + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($type) $condition .= " AND c.type='$type'"; + if($openid) $condition .= " AND c.openid='$openid'"; + if($fromtime) $condition .= " AND c.addtime>=$fromtime"; + if($totime) $condition .= " AND c.addtime<=$totime"; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}weixin_chat c,{$DT_PRE}weixin_user u WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT u.username,u.nickname,u.sex,u.city,u.province,u.country,u.language,u.headimgurl,c.* FROM {$DT_PRE}weixin_chat c,{$DT_PRE}weixin_user u WHERE $condition ORDER BY c.itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 6); + $r['headimgurl'] or $r['headimgurl'] = 'api/weixin/image/headimg.jpg'; + $r['msg'] = weixin_msg($r['type'], $r['content'], $r['misc']); + $lists[] = $r; + } + include tpl('weixin', $module); + break; +} + +function weixin_msg($type, $content, $misc) { + $misc = $misc ? unserialize($misc) : array(); + switch($type) { + case 'image': + return ''; + break; + case 'voice': + return '  下载'; + break; + case 'video': + return '  下载'; + break; + case 'location': + return ' '.$content.''; + break; + case 'link': + return ''.$misc['Title'].''.($misc['Description'] ? '
'.$misc['Description'] : ''); + break; + case 'reply': + if($misc['type'] == 'image') { + return weixin_msg($misc['type'], 'api/weixin/down.php?mediaid='.$content, ''); + } else if($misc['type'] == 'voice' || $misc['type'] == 'video') { + return weixin_msg($misc['type'], '', serialize(array('MediaId'=>$content, ''))); + } + if(preg_match_all("/([http|https]+)\:\/\/([a-z0-9\/\-\_\.\,\?\&\#\=\%\+\;]{4,})/i", $content, $m)) { + foreach($m[0] as $u) { + if(preg_match("/^(jpg|jpeg|gif|png|bmp)$/i", file_ext($u)) && !preg_match("/([\?\&\=]{1,})/i", $u)) { + $content = str_replace($u, '', $content); + } else { + $content = str_replace($u, ''.$u.'', $content); + } + } + } + return $content; + break; + case 'CLICK': + $E = array( + 'V_member' => '绑定会员', + ); + return isset($E[$content]) ? $E[$content] : $content; + break; + case 'VIEW': + return '打开链接'; + break; + case 'LOCATION': + return ''; + break; + default: + return $content; + break; + } +} +?> \ No newline at end of file diff --git a/module/member/ask.inc.php b/module/member/ask.inc.php new file mode 100644 index 0000000..4929d67 --- /dev/null +++ b/module/member/ask.inc.php @@ -0,0 +1,162 @@ +get_one("SELECT support FROM {$DT_PRE}member WHERE userid=$_userid"); +$support = $r['support'] ? $r['support'] : ''; +switch($action) { + case 'add': + $a = array(); + if($itemid) { + $r = $db->get_one("SELECT * FROM {$DT_PRE}ask WHERE itemid=$itemid"); + if($r['username'] == $_username && $r['status'] > 1) $a = $r; + } + if($submit) { + $typeid = intval($typeid); + if(!$typeid || !isset($TYPE[$typeid])) message($L['pass_typeid']); + if(empty($title)) message($L['pass_title']); + if(empty($content)) message($L['pass_content']); + $fields = array( + 'typeid' => $typeid, + 'title' => $title, + ); + $fields = dhtmlspecialchars($fields); + $content = dsafe(addslashes(save_remote(save_local(stripslashes($content))))); + $fields['content'] = $content; + $fields['qid'] = $a ? $a['itemid'] : 0; + $fields['username'] = $_username; + $fields['addtime'] = $DT_TIME; + $sqlk = $sqlv = ''; + foreach($fields as $k=>$v) { + $sqlk .= ','.$k; $sqlv .= ",'$v'"; + } + $sqlk = substr($sqlk, 1); $sqlv = substr($sqlv, 1); + $db->query("INSERT INTO {$DT_PRE}ask ($sqlk) VALUES ($sqlv)"); + $itemid = $db->insert_id(); + clear_upload($content, $itemid, 'ask'); + dmsg($L['ask_add_success'], '?action=index'); + } else { + $typeid = isset($typeid) ? intval($typeid) : 0; + $title = ''; + $content = ''; + if($a) { + $typeid = $a['typeid']; + $title = $a['title']; + $content = $a['content']; + } + $type_select = type_select($TYPE, 1, 'typeid', $L['choose_type'], $typeid, 'id="typeid"'); + $head_title = $L['ask_title_add']; + } + break; + case 'edit': + $itemid or message(); + $r = $db->get_one("SELECT * FROM {$DT_PRE}ask WHERE itemid=$itemid"); + $r or message(); + $r['username'] == $_username or message(); + if($r['status'] > 0) message($L['ask_msg_edit']); + if($submit) { + $typeid = intval($typeid); + if(!$typeid || !isset($TYPE[$typeid])) message($L['pass_typeid']); + if(empty($title)) message($L['pass_title']); + if(empty($content)) message($L['pass_content']); + $content = dsafe(addslashes(save_remote(save_local(stripslashes($content))))); + $fields = array( + 'typeid' => $typeid, + 'title' => $title, + ); + $fields = dhtmlspecialchars($fields); + $fields['content'] = $content; + $sql = ''; + foreach($fields as $k=>$v) { + $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + $db->query("UPDATE {$DT_PRE}ask SET $sql WHERE itemid=$itemid"); + clear_upload($content, $itemid, 'ask'); + dmsg($L['op_edit_success'], $forward); + } else { + extract($r); + $type_select = type_select($TYPE, 1, 'typeid', $L['choose_type'], $typeid, 'id="typeid"'); + $head_title = $L['ask_title_edit']; + } + break; + case 'show': + $itemid or message(); + $r = $db->get_one("SELECT * FROM {$DT_PRE}ask WHERE itemid=$itemid"); + $r or message(); + $r['username'] == $_username or message(); + extract($r); + $addtime = timetodate($addtime, 5); + $edittime = $edittime ? timetodate($edittime, 5) : ''; + $stars = $L['ask_star_type']; + $head_title = $L['ask_title_show']; + break; + case 'star': + $itemid or message(); + $r = $db->get_one("SELECT * FROM {$DT_PRE}ask WHERE itemid=$itemid"); + $r or message(); + $r['username'] == $_username or message(); + $r['star'] == 0 or message(); + $star = isset($star) ? intval($star) : 3; + in_array($star, array(1, 2, 3)) or $star = 3; + $db->query("UPDATE {$DT_PRE}ask SET star=$star WHERE itemid=$itemid"); + dmsg($L['ask_star_success'], '?action=show&itemid='.$itemid); + break; + case 'delete': + $itemid or message(); + $r = $db->get_one("SELECT * FROM {$DT_PRE}ask WHERE itemid=$itemid"); + $r or message(); + $r['username'] == $_username or message(); + $r['status'] == 0 or message(); + $db->query("DELETE FROM {$DT_PRE}ask WHERE itemid=$itemid"); + dmsg($L['op_del_success'], $forward); + break; + case 'support': + $support or message($L['support_error_1']); + $user = userinfo($support); + $user or message($L['support_error_2']); + $head_title = $L['support_title']; + break; + default: + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $typeid = isset($typeid) ? ($typeid === '' ? -1 : intval($typeid)) : -1; + $type_select = type_select($TYPE, 1, 'typeid', $L['default_type'], $typeid, '', $L['all_type']); + $condition = "username='$_username'"; + if($keyword) $condition .= match_kw('title', $keyword); + if($typeid > -1) $condition .= " AND typeid=$typeid"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}ask WHERE $condition"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}ask WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = $r['edittime'] ? timetodate($r['edittime'], 5) : 'N/A'; + $r['dstatus'] = $dstatus[$r['status']]; + $r['dstar'] = $L['ask_star_type'][$r['star']]; + $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : $L['default_type']; + $lists[] = $r; + } + $head_title = $L['ask_title']; + break; +} +if($DT_PC) { + // +} else { + if(isset($lists)) { + $time = 'addtime'; + foreach($lists as $k=>$v) { + $lists[$k]['date'] = timetodate($v[$time], 5); + } + } + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : ''); + $head_name = $head_title; +} +include template('ask', $module); +?> \ No newline at end of file diff --git a/module/member/buy.inc.php b/module/member/buy.inc.php new file mode 100644 index 0000000..be07000 --- /dev/null +++ b/module/member/buy.inc.php @@ -0,0 +1,357 @@ +get(); + $ids = ''; + $success = 0; + if($post) { + $add = array_map('trim', $add); + $add_city = area_pos($add['areaid'], ''); + if($add_city && strpos($add['address'], $add_city) === false) $add['address'] = $add_city.$add['address']; + $add = dhtmlspecialchars($add); + $buyer_address = $add['address']; + if(strlen($buyer_address) < 10) message($L['msg_type_address']); + $buyer_postcode = $add['postcode']; + if(strlen($buyer_postcode) < 6) message($L['msg_type_postcode']); + $buyer_name = $add['truename']; + if(strlen($buyer_name) < 2) message($L['msg_type_truename']); + $buyer_mobile = $add['mobile']; + if(!is_mobile($buyer_mobile)) message($L['msg_type_mobile']); + $N = array(); + foreach($post as $k=>$v) { + $t1 = array_map('intval', explode('-', $k)); + $_mid = $t1[0]; + $itemid = $t1[1]; + $s1 = $t1[2]; + $s2 = $t1[3]; + $s3 = $t1[4]; + $t = $db->get_one("SELECT * FROM ".get_table($mid)." WHERE itemid=$itemid"); + if($t && $t['status'] == 3 && $t['username'] != $_username) { + $t['a1'] = 1; + if($MODULE[$_mid]['module'] == 'sell') { + $t['step'] = $t['stock'] = $t['prices'] = ''; + $t['cod'] = 0; + $t['express_1'] = $t['express_name_1'] = $t['fee_start_1'] = $t['fee_step_1'] = ''; + $t['express_2'] = $t['express_name_2'] = $t['fee_start_2'] = $t['fee_step_2'] = ''; + $t['express_3'] = $t['express_name_3'] = $t['fee_start_3'] = $t['fee_step_3'] = ''; + $t['a1'] = intval($t['minamount']); + } + if($t['step']) { + foreach(unserialize($t['step']) as $_k=>$_v) { + $t[$_k] = $_v; + } + } else { + $t['a2'] = $t['a3'] = 0; + $t['p1'] = $t['price']; + $t['p2'] = $t['p3'] = 0.00; + } + if($t['a1'] < 1) $t['a1'] = 1; + $number = intval($v['number']); + $t['s1'] = $s1; + $t['s2'] = $s2; + $t['s3'] = $s3; + if($t['stock']) { + foreach(get_stock($t) as $kk=>$vv) { + $t[$kk] = $vv; + } + } + $t['amount'] = get_amount($t); + if($number < $t['a1']) $number = $t['a1']; + if($number > $t['amount']) $number = $t['amount']; + if($number < 1) $number = 1; + $t['a'] = $number; + $price = get_price($t); + if($t['amount'] < 1 || $price < 0.01) continue; + $amount = $number*$price; + $note = ''; + $t['P1'] = get_nv($t['n1'], $t['v1']); + $t['P2'] = get_nv($t['n2'], $t['v2']); + $t['P3'] = get_nv($t['n3'], $t['v3']); + $t['m1'] = isset($t['P1'][$t['s1']]) ? $t['P1'][$t['s1']] : ''; + $t['m2'] = isset($t['P2'][$t['s2']]) ? $t['P2'][$t['s2']] : ''; + $t['m3'] = isset($t['P3'][$t['s3']]) ? $t['P3'][$t['s3']] : ''; + if($t['m1']) $note .= $t['n1'].':'.$t['m1'].' '; + if($t['m2']) $note .= $t['n2'].':'.$t['m2'].' '; + if($t['m3']) $note .= $t['n3'].':'.$t['m3'].' '; + $v['note'] = str_replace('|', '-', $v['note']); + $note = dhtmlspecialchars($v['note'].'|'.$note); + $title = addslashes($t['title']); + $MOD = cache_read('module-'.$_mid.'.php'); + $linkurl = $MOD['linkurl'].$t['linkurl']; + $status = $MOD['checkorder'] ? 0 : 1; + $cod = 0; + if($t['cod'] == 2) { + if(isset($v['cod'])) $cod = 1; + } else if($t['cod'] == 1) { + $cod = 1; + } + if($cod) $status = 7; + if($t['express_name_1'] == $L['post_free']) { + if($t['fee_start_1'] > 0) { + if($amount >= $t['fee_start_1']) $v['express'] = 0; + } else { + $v['express'] = 0; + } + } + $express = intval($v['express']); + if($express && in_array($express, array(1,2,3)) && $MOD['module'] == 'mall') { + $i = $express; + $fee_name = $t['express_name_'.$i]; + $fee = dround($t['fee_start_'.$i] + $t['fee_step_'.$i]*($number-1)); + $express_id = intval($t['express_'.$i]); + $area_id = $add['areaid']; + if($express_id && $area_id) { + $E = $db->get_one("SELECT * FROM {$DT_PRE}mall_express_{$_mid} WHERE itemid=$express_id"); + if($E && $E['items'] > 0) { + $AREA = cache_read('area.php'); + $aid = $area_id; + $ii = 0; + do { + $E = $db->get_one("SELECT * FROM {$DT_PRE}mall_express_{$_mid} WHERE parentid=$express_id AND areaid=$aid"); + if($E) { + $fee = dround($E['fee_start'] + $E['fee_step']*($number-1)); + break; + } else { + $aid = $AREA[$aid]['parentid']; + } + if($ii++ > 5) break;//safe + } while($aid > 0); + } + } + } else { + $fee_name = ''; + $fee = 0; + } + if(isset($N[$t['username']])) { + $pid = $N[$t['username']]; + $db->query("INSERT INTO {$DT_PRE}order (mid,mallid,pid,buyer,seller,title,thumb,skuid,price,number,amount,addtime,updatetime,note, buyer_postcode,buyer_address,buyer_name,buyer_mobile,status,fee_name,fee,cod) VALUES ('$moduleid','$itemid','$pid','$_username','$t[username]','$title','$t[thumb]','$t[skuid]','$price','$number','$amount','$DT_TIME','$DT_TIME','$note','$buyer_postcode','$buyer_address','$buyer_name','$buyer_mobile','$status','$fee_name','$fee','$cod')"); + $oid = $db->insert_id(); + $db->query("UPDATE {$DT_PRE}order SET `amount`=`amount`+$amount,`fee`=`fee`+$fee WHERE itemid=$pid"); + $db->query("INSERT INTO {$DT_PRE}order_log (oid,addtime,title,note) VALUES ('$oid','$DT_TIME','$L[log_buy]','')"); + if($fee_name) $db->query("UPDATE {$DT_PRE}order SET `fee_name`='$fee_name' WHERE itemid=$pid"); + } else { + $db->query("INSERT INTO {$DT_PRE}order (mid,mallid,buyer,seller,title,thumb,skuid,price,number,amount,addtime,updatetime,note, buyer_postcode,buyer_address,buyer_name,buyer_mobile,status,fee_name,fee,cod) VALUES ('$moduleid','$itemid','$_username','$t[username]','$title','$t[thumb]','$t[skuid]','$price','$number','$amount','$DT_TIME','$DT_TIME','$note','$buyer_postcode','$buyer_address','$buyer_name','$buyer_mobile','$status','$fee_name','$fee','$cod')"); + $pid = $oid = $db->insert_id(); + if($pid) $success = 1; + $db->query("INSERT INTO {$DT_PRE}order_log (oid,addtime,title,note) VALUES ('$oid','$DT_TIME','$L[log_buy]','')"); + if(!$cod) { + $N[$t['username']] = $pid; + $ids .= ','.$pid; + } + //send message + $touser = $t['username']; + $_title = $title; + $title = lang($L['trade_message_t6'], array($pid)); + $url = $MODULE[2]['linkurl'].'trade.php?itemid='.$pid; + $goods = ''.$_title.''; + $content = lang($L['trade_message_c6'], array(userurl($_username), $_username, timetodate($DT_TIME, 3), $goods, $pid, $amount, $url)); + $content = ob_template('messager', 'mail'); + send_message($touser, $title, $content); + } + if($MODULE[$_mid]['module'] == 'mall') { + $db->query("REPLACE INTO {$DT_PRE}mall_comment_{$_mid} (itemid,mallid,buyer,seller) VALUES ('$oid','$itemid','$_username','$t[username]')"); + $tmp = $db->get_one("SELECT mallid FROM {$DT_PRE}mall_stat_{$_mid} WHERE mallid=$itemid"); + if(!$tmp) $db->query("REPLACE INTO {$DT_PRE}mall_stat_{$_mid} (mallid,buyer,seller) VALUES ('$itemid','$_username','$t[username]')"); + } + unset($cart[$k]); + } + } + if($N && $coupon) { + foreach($N as $seller=>$oid) { + if(isset($coupon[$seller])) { + $cid = $coupon[$seller]; + $c = $db->get_one("SELECT * FROM {$DT_PRE}finance_coupon WHERE itemid=$cid"); + if($c && $c['username'] == $_username && ($c['seller'] == $seller || $c['seller'] == '') && $c['oid'] == 0 && $c['fromtime'] < $DT_TIME && $c['totime'] > $DT_TIME) { + $o = $db->get_one("SELECT * FROM {$DT_PRE}order WHERE itemid=$oid"); + if($o && $o['buyer'] == $_username && ($o['seller'] == $seller || $o['seller'] == '') && $o['cid'] == 0 && $o['discount'] < 0.01) { + $discount = $c['price']; + if($c['cost'] <= ($o['amount'] + $o['fee']) && $c['price'] < $o['amount']) { + $db->query("UPDATE {$DT_PRE}order SET `amount`=`amount`-$discount,discount=$discount,cid=$cid WHERE itemid=$oid"); + $db->query("UPDATE {$DT_PRE}finance_coupon SET oid=$oid WHERE itemid=$cid"); + } + } + } + } + } + } + } + $do->set($cart); + $forward = 'action=order'; + if(!$MOD['checkorder']) { + if($ids) { + $ids = substr($ids, 1); + if(is_numeric($ids)) { + $forward = 'action=update&step=pay&itemid='.$ids; + } else { + $forward = 'action=muti&ids='.$ids; + } + } + } + dheader('?action=show&success='.$success.'&auth='.encrypt($forward, DT_KEY.'TURL')); +} else { + $lists = $address = array(); + if($action == 'show') { + $forward = isset($auth) ? decrypt($auth, DT_KEY.'TURL') : ''; + $forward = 'order.php?'.($forward ? $forward : 'action=order'); + $success = isset($success) && $success ? 1 : 0; + } else { + isset($cart) or $cart = array(); + $lists = $tags = $data = $ids = array(); + $num = 0; + $itemids = ''; + if($itemid) { + if(is_array($itemid)) { + foreach($itemid as $id) { + $ids[$mid] = isset($ids[$mid]) ? $ids[$mid].','.$id : $id; + $k = $mid.'-'.$id.'-0-0-0'; + $r = array(); + $r['itemid'] = $id; + $r['s1'] = $r['s2'] = $r['s3'] = $r['a'] = 0; + $data[$k] = $r; + } + } else { + $s1 = isset($s1) ? intval($s1) : 0; + $s2 = isset($s2) ? intval($s2) : 0; + $s3 = isset($s3) ? intval($s3) : 0; + $a = isset($a) ? intval($a) : 1; + $ids[$mid] = isset($ids[$mid]) ? $ids[$mid].','.$itemid : $itemid; + $k = $mid.'-'.$itemid.'-'.$s1.'-'.$s2.'-'.$s3; + $r = array(); + $r['itemid'] = $itemid; + $r['s1'] = $s1; + $r['s2'] = $s2; + $r['s3'] = $s3; + $r['a'] = $a; + $data[$k] = $r; + } + } else if($cart) { + isset($amounts) or $amounts = array(); + foreach($cart as $v) { + $t = array_map('intval', explode('-', $v)); + $mid = $t[0]; + $ids[$mid] = isset($ids[$mid]) ? $ids[$mid].','.$t[1] : $t[1]; + $r = array(); + $r['itemid'] = $t[1]; + $r['s1'] = $t[2]; + $r['s2'] = $t[3]; + $r['s3'] = $t[4]; + $r['a'] = isset($amounts[$v]) ? $amounts[$v] : 1; + $data[$v] = $r; + } + } + if($ids) { + foreach($ids as $_mid=>$itemids) { + $result = $db->query("SELECT * FROM ".get_table($_mid)." WHERE itemid IN ($itemids)"); + while($r = $db->fetch_array($result)) { + if($r['username'] == $_username || $r['status'] != 3) continue; + $r['valid'] = 1; + $r['mid'] = $_mid; + $r['alt'] = $r['title']; + $r['title'] = dsubstr($r['title'], 40, '..'); + $r['mobile'] = $MODULE[$_mid]['mobile'].$r['linkurl']; + $r['linkurl'] = $MODULE[$_mid]['linkurl'].$r['linkurl']; + $r['P1'] = get_nv($r['n1'], $r['v1']); + $r['P2'] = get_nv($r['n2'], $r['v2']); + $r['P3'] = get_nv($r['n3'], $r['v3']); + $r['a1'] = 1; + if($MODULE[$_mid]['module'] == 'sell') { + $r['step'] = $r['stock'] = $r['prices'] = ''; + $r['cod'] = 0; + $r['express_1'] = $r['express_name_1'] = $r['fee_start_1'] = $r['fee_step_1'] = ''; + $r['express_2'] = $r['express_name_2'] = $r['fee_start_2'] = $r['fee_step_2'] = ''; + $r['express_3'] = $r['express_name_3'] = $r['fee_start_3'] = $r['fee_step_3'] = ''; + $r['a1'] = intval($r['minamount']); + } + if($r['step']) { + $s = unserialize($r['step']); + foreach(unserialize($r['step']) as $k=>$v) { + $r[$k] = $v; + } + } else { + $r['a2'] = $r['a3'] = 0; + $r['p1'] = $r['price']; + $r['p2'] = $r['p3'] = 0.00; + } + if($r['a1'] < 1) $r['a1'] = 1; + $tags[$r['itemid']] = $r; + } + } + if($tags) { + foreach($data as $k=>$v) { + if(isset($tags[$v['itemid']])) { + $r = $tags[$v['itemid']]; + $r['key'] = $k; + $r['s1'] = $v['s1']; + $r['s2'] = $v['s2']; + $r['s3'] = $v['s3']; + $r['a'] = $v['a']; + if($r['stock']) { + foreach(get_stock($r) as $kk=>$vv) { + $r[$kk] = $vv; + } + } + $r['amount'] = get_amount($r); + if($r['a'] > $r['amount']) $r['a'] = $r['amount']; + if($r['a'] < $r['a1']) $r['a'] = $r['a1']; + $r['price'] = $r['p1'] = get_price($r); + if($r['amount'] < 1 || $r['price'] < 0.01) $r['valid'] = 0; + $r['m1'] = isset($r['P1'][$r['s1']]) ? $r['P1'][$r['s1']] : ''; + $r['m2'] = isset($r['P2'][$r['s2']]) ? $r['P2'][$r['s2']] : ''; + $r['m3'] = isset($r['P3'][$r['s3']]) ? $r['P3'][$r['s3']] : ''; + $lists[$r['username']][] = $r; + $num++; + } + } + } + } + if($lists) { + $result = $db->query("SELECT * FROM {$DT_PRE}address WHERE username='$_username' ORDER BY listorder ASC,itemid ASC LIMIT 30"); + while($r = $db->fetch_array($result)) { + $r['street'] = $r['address']; + if($r['areaid']) $r['address'] = area_pos($r['areaid'], '').$r['address']; + $address[] = $r; + } + $user = userinfo($_username); + } + } +} +$CSS = array('cart'); +$head_title = $L['buy_title']; +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); +} else { + $head_name = $head_title; + if($sns_app) $seo_title = $site_name; +} +include template('buy', 'member'); +?> \ No newline at end of file diff --git a/module/member/charge.inc.php b/module/member/charge.inc.php new file mode 100644 index 0000000..73890ee --- /dev/null +++ b/module/member/charge.inc.php @@ -0,0 +1,335 @@ +=$fromtime"; + if($totime) $condition .= " AND sendtime<=$totime"; + if($minamount) $condition .= " AND amount>=$minamount"; + if($maxamount) $condition .= " AND amount<=$maxamount"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}finance_charge WHERE $condition"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = array(); + $amount = $fee = $money = $repay = 0; + $result = $db->query("SELECT * FROM {$DT_PRE}finance_charge WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['repay'] = ($r['status'] == 0 && $DT_TIME - $r['sendtime'] > 600) ? 1 : 0; + if($r['repay']) $repay = 1; + $r['sendtime'] = timetodate($r['sendtime'], 5); + $r['receivetime'] = $r['receivetime'] ? timetodate($r['receivetime'], 5) : '--'; + $r['dstatus'] = $_status[$r['status']]; + $amount += $r['amount']; + $fee += $r['fee']; + $money += $r['money']; + $lists[] = $r; + } + $head_title = $L['charge_title_record']; + break; + case 'card': + if($submit) { + if(!preg_match("/^[0-9a-zA-z]{6,}$/", $number)) message($L['charge_pass_card_number']); + if(!preg_match("/^[0-9]{6,}$/", $password)) message($L['charge_pass_card_password']); + $card = $db->get_one("SELECT * FROM {$DT_PRE}finance_card WHERE number='$number'"); + if($card) { + if($card['updatetime']) message($L['charge_pass_card_used']); + if($card['totime'] < $DT_TIME) message($L['charge_pass_card_expired']); + if($card['password'] != $password) message($L['charge_pass_card_error_password']); + $db->query("INSERT INTO {$DT_PRE}finance_charge (username,bank,amount,money,sendtime,receivetime,editor,status,note) VALUES ('$_username','card', '$card[amount]','$card[amount]','$DT_TIME','$DT_TIME','system','3','$number')"); + $db->query("UPDATE {$DT_PRE}finance_card SET username='$_username',updatetime='$DT_TIME',ip='$DT_IP' WHERE itemid='$card[itemid]'"); + money_add($_username, $card['amount']); + money_record($_username, $card['amount'], $L['charge_card_name'], 'system', $L['charge_card'], $L['charge_card_number'].':'.$number); + message($L['charge_msg_card_success'], '?action=record'); + } else { + message($L['charge_pass_card_error_number']); + } + } + $head_title = $L['charge_title_card']; + break; + case 'repay': + $itemid or dheader('?action=record'); + $r = $db->get_one("SELECT * FROM {$DT_PRE}finance_charge WHERE itemid=$itemid"); + ($r && $r['status'] == 0 && $DT_TIME - $r['sendtime'] > 600 && $_username == $r['username']) or dheader('?action=record'); + $amount = $r['amount']; + $fee = $r['fee']; + $charge = $fee + $amount; + $bank = $r['bank']; + $orderid = $itemid; + $receive_url = $MOD['linkurl'].'charge.php'; + $charge_title = get_reason($r['reason']); + set_cookie('pay_id', $orderid); + include DT_ROOT.'/api/pay/'.$bank.'/send.inc.php'; + exit; + break; + case 'confirm': + $price = isset($price) ? dround($price) : 0; + preg_match("/^[a-z0-9_\-\,\|]{3,}$/i", $reason) or $reason = ''; + if($price && $price > $amount) $amount = $price; + if($MOD['mincharge']) { + $amount >= intval($MOD['mincharge']) or message($L['charge_pass_amount_min'].$MOD['mincharge']); + } else { + $amount > 0 or message($L['charge_pass_type_amount']); + } + isset($PAY[$bank]) or message($L['charge_pass_bank']); + $PAY[$bank]['enable'] or message($L['charge_pass_bank_close']); + + if($reason) {//Stock verfiy + $ids = array(); + $arr = explode('|', $reason); + if($arr[0] == 'trade') { + $ids[] = $arr[1]; + } elseif($arr[0] == 'trades') { + $ids = explode(',', $arr[1]); + } + if($ids) { + foreach($ids as $oid) { + $oid = intval($oid); + if($oid < 1) continue; + $result = $db->query("SELECT * FROM {$DT_PRE}order WHERE itemid=$oid OR pid=$oid"); + while($r = $db->fetch_array($result)) { + if(!stock_check($r)) message($r['title'].' '.$L['charge_pass_stock'], 'order.php?nav=1', 5); + } + } + } + } + + $fee = $PAY[$bank]['percent'] ? dround($amount*$PAY[$bank]['percent']/100) : 0; + $charge = $fee + $amount; + $auto = isset($auto) ? $auto : 1;//debug? + if($fee == 0) $auto = 1; + if($auto) $goto = 1; + if(isset($goto)) { + $receive_url = ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).'charge.php'; + $charge_title = get_reason($reason); + $db->query("INSERT INTO {$DT_PRE}finance_charge (username,bank,amount,fee,sendtime,reason) VALUES ('$_username','$bank','$amount','$fee','$DT_TIME','$reason')"); + $orderid = $db->insert_id(); + set_cookie('pay_id', $orderid); + set_cookie('pay_bank', $bank); + include DT_ROOT.'/api/pay/'.$bank.'/send.inc.php'; + exit; + } else { + $head_title = $L['charge_title_confirm']; + } + break; + case 'pay': + $MOD['pay_online'] or dheader('?action=card'); + $auto = $amount ? 1 : 0; + $mincharge = $MOD['mincharge'] ? intval($MOD['mincharge']) : 0; + isset($reason) or $reason = ''; + (isset($bank) && isset($PAY[$bank]) && $PAY[$bank]['enable']) or $bank = ''; + $PAYLIST = get_paylist(); + $bank or $bank = $PAYLIST[0]['bank']; + $total = count($PAYLIST); + $head_title = $L['charge_title_pay']; + break; + default: + $_POST = $_DPOST; + $_GET = $_DGET; + $head_title = $L['charge_title']; + //$passed = true; + $charge_errcode = ''; + $charge_status = 0; + $charge_forward = ''; + /* + 0 fail + 1 success + 2 unknow + */ + $pay_id = intval(get_cookie('pay_id')); + if($pay_id) { + $r = $db->get_one("SELECT * FROM {$DT_PRE}finance_charge WHERE itemid=$pay_id"); + if($r && $r['username'] == $_username) { + // + } else { + $r = $db->get_one("SELECT * FROM {$DT_PRE}finance_charge WHERE username='$_username' ORDER BY itemid DESC"); + } + } else { + $r = $db->get_one("SELECT * FROM {$DT_PRE}finance_charge WHERE username='$_username' ORDER BY itemid DESC"); + } + if($r) { + $charge_orderid = $r['itemid']; + $charge_money = $r['amount'] + $r['fee']; + $charge_amount = $r['amount']; + if($r['status'] == 0) { + $receive_url = ''; + $bank = $r['bank']; + $editor = 'R'.$bank; + $note = ''; + include DT_ROOT.'/api/pay/'.$bank.'/receive.inc.php'; + if($charge_status == 1) { + $db->query("UPDATE {$DT_PRE}finance_charge SET status=3,money=$charge_money,receivetime='$DT_TIME',editor='$editor' WHERE itemid=$charge_orderid"); + money_add($r['username'], $r['amount']); + money_record($r['username'], $r['amount'], $PAY[$bank]['name'], 'system', $L['charge_online'], $L['charge_id'].':'.$charge_orderid); + if($MOD['credit_charge'] > 0) { + $credit = intval($r['amount']*$MOD['credit_charge']); + if($credit > 0) { + credit_add($r['username'], $credit); + credit_record($r['username'], $credit, 'system', $L['charge_reward'], $L['charge'].$r['amount'].$DT['money_unit']); + } + } + if($r['reason']) { + $url = get_reason_url($r); + if($url) $charge_forward = $url; + } + if($bank == 'tenpay') { + $show_url = $charge_forward ? $charge_forward : 'charge.php'; + if(strpos($show_url, '://') === false) $show_url = $MOD['linkurl'].$show_url; + $resHandler->doShow($show_url); + } + } else if($charge_status == 2) { + $db->query("UPDATE {$DT_PRE}finance_charge SET status=1,receivetime='$DT_TIME',editor='$editor',note='$note' WHERE itemid=$charge_orderid"); + } + } else if($r['status'] == 1) { + $charge_status = 2; + $charge_errcode = $L['charge_msg_order_fail'].$charge_orderid; + } else if($r['status'] == 2) { + $charge_status = 2; + $charge_errcode = $L['charge_msg_order_cancel'].$charge_orderid; + } else { + if($DT_TIME - $r['receivetime'] < 600) { + if($r['reason']) { + $url = get_reason_url($r); + if($url) $charge_forward = $url; + } + $charge_status = 1; + } else { + dheader('?action=record'); + } + } + } else { + $charge_status = 2; + $charge_errcode = $L['charge_msg_not_order']; + } + if($charge_forward) dheader($charge_forward); + break; +} +if($DT_PC) { + // +} else { + if((!$action || $action == 'index' || $action == 'record') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : ''); + $head_name = $head_title; +} +include template('charge', $module); +?> \ No newline at end of file diff --git a/module/member/child.class.php b/module/member/child.class.php new file mode 100644 index 0000000..0877721 --- /dev/null +++ b/module/member/child.class.php @@ -0,0 +1,174 @@ +table = DT_PRE.'member_child'; + $this->fields = array('parent','username','password','passsalt','nickname','gender','truename','mobile','department','role','addtime','edittime','loginip','logintime','status','permission'); + } + + function child() { + $this->__construct(); + } + + function is_username($username) { + global $MOD, $L; + if(!check_name($username)) return $this->_($L['member_username_match']); + $MOD['minusername'] or $MOD['minusername'] = 4; + $MOD['maxusername'] or $MOD['maxusername'] = 20; + if(strlen($username) < $MOD['minusername'] || strlen($username) > $MOD['maxusername']) return $this->_(lang($L['member_username_len'], array($MOD['minusername'], $MOD['maxusername']))); + if($MOD['banusername']) { + $tmp = explode('|', $MOD['banusername']); + foreach($tmp as $v) { + if($MOD['banmodeu']) { + if($username == $v) return $this->_($L['member_username_ban']); + } else { + if(strpos($username, $v) !== false) return $this->_($L['member_username_ban']); + } + } + } + return true; + } + + function is_password($password, $cpassword = '') { + global $MOD, $L; + if(!$password) return $this->_($L['member_password_null']); + if($cpassword && $password != $cpassword) return $this->_($L['member_password_match']); + if(!$MOD['minpassword']) $MOD['minpassword'] = 6; + if(!$MOD['maxpassword']) $MOD['maxpassword'] = 20; + if(strlen($password) < $MOD['minpassword'] || strlen($password) > $MOD['maxpassword']) return $this->_(lang($L['member_password_len'], array($MOD['minpassword'], $MOD['maxpassword']))); + if(strpos(','.$MOD['mixpassword'].',', ',1,') !== false && !preg_match("/[0-9]/", $password)) return $this->_($L['member_password_1']); + if(strpos(','.$MOD['mixpassword'].',', ',2,') !== false && !preg_match("/[a-z]/", $password)) return $this->_($L['member_password_2']); + if(strpos(','.$MOD['mixpassword'].',', ',3,') !== false && !preg_match("/[A-Z]/", $password)) return $this->_($L['member_password_3']); + if(strpos(','.$MOD['mixpassword'].',', ',4,') !== false && !preg_match("/[[:punct:]]/", $password)) return $this->_($L['member_password_4']); + return true; + } + + function username_exists($username) { + $condition = "username='{$username}'"; + if($this->itemid) $condition .= " AND itemid<>{$this->itemid}"; + return DB::get_one("SELECT itemid FROM {$this->table} WHERE {$condition}"); + } + + function nickname_exists($nickname) { + $condition = "parent='{$this->parent}' AND nickname='{$nickname}'"; + if($this->itemid) $condition .= " AND itemid<>{$this->itemid}"; + return DB::get_one("SELECT itemid FROM {$this->table} WHERE {$condition}"); + } + + function pass($post) { + global $L; + if(!is_array($post)) return false; + if(!$this->is_username($post['username'])) return false; + if($this->username_exists($post['username'])) return $this->_($L['member_username_reg']); + if($post['nickname'] && $this->nickname_exists($post['nickname'])) return $this->_($L['member_passport_reg']); + if($this->itemid) { + if($post['password'] && !$this->is_password($post['password'])) return false; + } else { + if(!$this->is_password($post['password'])) return false; + } + if(!is_array($post['permission'])) return false; + if(count($post['permission']) == 0) return $this->_($L['child_permission']); + return true; + } + + function set($post) { + if($post['password']) { + $post['passsalt'] = random(8); + $post['password'] = dpassword($post['password'], $post['passsalt']); + } else { + unset($post['password']); + } + $post['parent'] = $this->parent; + $post['permission'] = implode(',', $post['permission']); + $post['gender'] = $post['gender'] == 2 ? 2 : 1; + $post['status'] = $post['status'] == 3 ? 3 : 2; + if($this->itemid) { + $post['edittime'] = DT_TIME; + } else { + $post['addtime'] = DT_TIME; + } + $post = dhtmlspecialchars($post); + return array_map("trim", $post); + } + + function get_one($condition = '') { + return DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid $condition"); + } + + function get_list($condition, $order = 'itemid ASC') { + global $MOD, $pages, $page, $pagesize, $offset, $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['logindate'] = $r['logintime'] ? timetodate($r['logintime'], 5) : 'N/A'; + $r['loginip'] or $r['loginip'] = 'N/A'; + $lists[] = $r; + } + 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) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + return true; + } + + function password($post) { + if($this->is_password($post['npassword'], $post['cpassword'])) { + $passsalt = random(8); + $password = dpassword($post['npassword'], $passsalt); + DB::query("UPDATE {$this->table} SET password='$password',passsalt='$passsalt' WHERE itemid=$this->itemid"); + return true; + } else { + return false; + } + } + + function delete($itemid, $all = true) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->delete($v); } + } else { + $this->itemid = $itemid; + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + } + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/member/child.inc.php b/module/member/child.inc.php new file mode 100644 index 0000000..263ce42 --- /dev/null +++ b/module/member/child.inc.php @@ -0,0 +1,98 @@ +itemid = $_cid; + if($do->password($post)) { + dmsg($L['op_edit_success'], '?action=home'); + } else { + message($do->errmsg); + } + } + break; + default: + $action = 'home'; + extract($_child); + break; + } +} else { + $MG['child_limit'] > -1 or dheader(($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).'account.php?action=group&itemid=1'); + $menu_id = 2; + include DT_ROOT.'/file/config/child.inc.php'; + require DT_ROOT.'/module/'.$module.'/child.class.php'; + $do = new child(); + $do->itemid = $itemid; + $do->parent = $_username; + switch($action) { + case 'add': + if($MG['child_limit']) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}member_child WHERE parent='$_username'"); + if($r['num'] >= $MG['child_limit']) dalert(lang($L['limit_add'], array($MG['child_limit'], $r['num'])), 'goback'); + } + if($submit) { + if($do->pass($post)) { + $do->add($post); + dmsg($L['op_add_success'], '?action=index'); + } else { + message($do->errmsg); + } + } else { + foreach($do->fields as $v) { + $$v = ''; + } + $gender = 1; + $status = 3; + $permission = array(); + $head_title = $L['child_title_add']; + } + break; + case 'edit': + $itemid or message(); + $r = $do->get_one(); + if(!$r || $r['parent'] != $_username) message(); + if($submit) { + if($do->pass($post)) { + $do->edit($post); + dmsg($L['op_edit_success'], $forward); + } else { + message($do->errmsg); + } + } else { + extract($r); + $permission = explode(',', $permission); + $head_title = $L['child_title_edit']; + } + break; + case 'delete': + $itemid or message(); + $r = $do->get_one(); + if(!$r || $r['parent'] != $_username) message(); + $do->delete($itemid); + dmsg($L['op_del_success'], $forward); + break; + default: + $condition = "parent='$_username'"; + $lists = $do->get_list($condition); + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}member_child WHERE parent='$_username'"); + $limit_used = $r['num']; + $limit_free = $MG['child_limit'] && $MG['child_limit'] > $limit_used ? $MG['child_limit'] - $limit_used : 0; + $head_title = $L['child_title']; + break; + } +} +if($DT_PC) { + // +} else { + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'biz.php'); + if($pages) $pages = mobile_pages($items, $page, $pagesize); + $head_name = $head_title; +} +include template('child', $module); +?> \ No newline at end of file diff --git a/module/member/common.inc.php b/module/member/common.inc.php new file mode 100644 index 0000000..96d9f6a --- /dev/null +++ b/module/member/common.inc.php @@ -0,0 +1,45 @@ +$v) { + if(!isset($MODULE[$v])) unset($MYMODS[$k]); + } + } + $MENUMODS = $MYMODS; + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); + if($_cid) require DT_ROOT.'/include/child.inc.php'; +} +isset($admin_user) or $admin_user = false; +$table = $DT_PRE.'member'; +$table_company = $DT_PRE.'company'; +if($DT_PC) { + $menu_id = 0; +} else { + $foot = ''; + if($sns_app) $seo_title = $site_name; +} +?> \ No newline at end of file diff --git a/module/member/coupon.class.php b/module/member/coupon.class.php new file mode 100644 index 0000000..7a99196 --- /dev/null +++ b/module/member/coupon.class.php @@ -0,0 +1,55 @@ +table = DT_PRE.'finance_coupon'; + $this->table_promo = DT_PRE.'finance_promo'; + $this->fields = array('price','cost','amount','fromtime','totime','username','addtime','editor','edittime','note'); + } + + function coupon() { + $this->__construct(); + } + + function get_one($condition = '') { + return DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid $condition"); + } + + function get_list($condition, $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)) { + $lists[] = $r; + } + return $lists; + } + + function delete($itemid, $all = true) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->delete($v); } + } else { + $this->itemid = $itemid; + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + } + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/member/deal.inc.php b/module/member/deal.inc.php new file mode 100644 index 0000000..4b3dfe3 --- /dev/null +++ b/module/member/deal.inc.php @@ -0,0 +1,233 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + $td or message($L['group_msg_null']); + if($td['buyer'] != $_username) message($L['group_msg_deny']); + $td['adddate'] = timetodate($td['addtime'], 5); + $td['updatedate'] = timetodate($td['updatetime'], 5); + $td['total'] = $td['amount']; + $td['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$mid.'&itemid='.$td['gid']; + $td['fee_name'] = $td['fee'] = $td['par'] = ''; + $lists = array($td); + $gid = $td['gid']; + switch($step) { + case 'detail': + $logs = array(); + $result = $db->query("SELECT * FROM {$table_log} WHERE oid=$itemid ORDER BY itemid DESC"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $logs[] = $r; + } + $auth = encrypt('group|'.$td['send_type'].'|'.$td['send_no'].'|'.$td['send_status'].'|'.$td['buyer_mobile'].'|'.$td['itemid'], DT_KEY.'EXPRESS'); + $head_title = $L['group_detail_title']; + break; + case 'express': + ($td['send_type'] && $td['send_no']) or dheader('?action=update&step=detail&itemid='.$itemid); + $auth = encrypt('group|'.$td['send_type'].'|'.$td['send_no'].'|'.$td['send_status'].'|'.$td['buyer_mobile'].'|'.$td['itemid'], DT_KEY.'EXPRESS'); + $head_title = $L['group_express_title']; + break; + case 'used': + if($td['status'] != 2 || $td['logistic']) message(); + //交易成功 + $money = $td['amount']; + money_add($td['seller'], $money); + money_record($td['seller'], $money, $L['in_site'], 'system', $L['group_record_pay'], $L['group_order_id'].$itemid); + //网站服务费 + $G = $db->get_one("SELECT groupid FROM {$DT_PRE}member WHERE username='".$td['seller']."'"); + $SG = cache_read('group-'.$G['groupid'].'.php'); + if($SG['commission']) { + $fee = dround($money*$SG['commission']/100); + if($fee > 0) { + money_add($td['seller'], -$fee); + money_record($td['seller'], -$fee, $L['in_site'], 'system', $L['trade_fee'], $L['trade_order_id'].$itemid); + } + } + $db->query("UPDATE {$table} SET status=3,updatetime=$DT_TIME WHERE itemid=$itemid"); + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_success]','')"); + dmsg($L['group_success'], '?mid='.$mid.'&action=order&page='.$page); + break; + case 'receive': + if($td['status'] != 1 || !$td['logistic']) message(); + //交易成功 + $money = $td['amount']; + money_add($td['seller'], $money); + money_record($td['seller'], $money, $L['in_site'], 'system', $L['group_record_pay'], $L['group_order_id'].$itemid); + //网站服务费 + $G = $db->get_one("SELECT groupid FROM {$DT_PRE}member WHERE username='".$td['seller']."'"); + $SG = cache_read('group-'.$G['groupid'].'.php'); + if($SG['commission']) { + $fee = dround($money*$SG['commission']/100); + if($fee > 0) { + money_add($td['seller'], -$fee); + money_record($td['seller'], -$fee, $L['in_site'], 'system', $L['trade_fee'], $L['trade_order_id'].$itemid); + } + } + $db->query("UPDATE {$table} SET status=3,updatetime=$DT_TIME WHERE itemid=$itemid"); + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_get]','')"); + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_success]','')"); + dmsg($L['group_success'], '?mid='.$mid.'&action=order&page='.$page); + break; + case 'pay'://买家付款 + if($td['status'] == 0) dmsg($L['group_pay_order_success'], '?action=order&nav=0&itemid='.$itemid); + if($td['status'] != 6) message($L['group_msg_deny']); + $money = $td['amount']; + $money > 0 or message($L['group_msg_deny']); + $seller = userinfo($td['seller']); + $auto = 0; + $auth = isset($auth) ? decrypt($auth, DT_KEY.'CG') : ''; + if($auth && substr($auth, 0, 6) == 'group|') { + $_itemid = intval(substr($auth, 6)); + if($_itemid == $itemid) $auto = $submit = 1; + } + if($submit) { + $money <= $_money or message($L['money_not_enough']); + if($money <= $DT['quick_pay']) $auto = 1; + if(!$auto) { + is_payword($_username, $password) or message($L['error_payword']); + } + money_add($_username, -$money); + money_record($_username, -$money, $L['in_site'], 'system', $L['group_order_credit'], $L['trade_order_id'].$itemid); + $password = $td['logistic'] ? '' : random(6, '0-9'); + $db->query("UPDATE {$table} SET status=0,password='$password',updatetime=$DT_TIME WHERE itemid=$itemid"); + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_pay]','')"); + if($password) { + //send sms + if($DT['sms']) { + $message = lang('sms->ord_group', array($td['title'], $itemid, $password)); + $message = strip_sms($message); + send_sms($td['buyer_mobile'], $message); + } + //send sms + } + $db->query("UPDATE ".get_table($mid)." SET orders=orders+1,sales=sales+$td[number] WHERE itemid=$td[gid]"); + dmsg($L['group_pay_order_success'], '?mid='.$mid.'&action=order&nav=0&itemid='.$itemid); + } else { + $head_title = $L['group_pay_order_title']; + } + break; + case 'refund'://买家退款 + $gone = $DT_TIME - $td['updatetime']; + if(!in_array($td['status'], array(0, 1, 2))) message($L['group_msg_deny']); + if(in_array($td['status'], array(1, 2)) && $gone > ($MOD['trade_day']*86400 + $td['add_time']*3600)) message($L['group_msg_deny']); + $money = $td['amount']; + if($submit) { + $content or message($L['trade_refund_reason']); + clear_upload($content, $itemid, $table); + $content = dsafe(addslashes(save_remote(save_local(stripslashes($content))))); + is_payword($_username, $password) or message($L['error_payword']); + $db->query("UPDATE {$table} SET status=4,updatetime=$DT_TIME,buyer_reason='$content' WHERE itemid=$itemid"); + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_refund]','')"); + message($L['trade_refund_success'], $forward, 3); + } else { + $head_title = $L['trade_refund_title']; + } + break; + case 'remind'://买家提醒卖家发货 + if($td['status'] != 0 || !$td['logistic']) message($L['group_msg_deny']); + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_remind]','')"); + break; + } +} else if($action == 'express') {//我的快递 + $sfields = $L['express_sfields']; + $dfields = array('title', 'title', 'send_type ', 'send_no'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $status = isset($status) && isset($dsend_status[$status]) ? intval($status) : ''; + $fields_select = dselect($sfields, 'fields', '', $fields); + $status_select = dselect($dsend_status, 'status', $L['status'], $status, '', 1, '', 1); + $condition = "send_no<>'' AND buyer='$_username'"; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($status !== '') $condition .= " AND send_status='$status'"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['addtime'] = timetodate($r['addtime'], 5); + $r['updatetime'] = timetodate($r['updatetime'], 5); + $r['dstatus'] = $_send_status[$r['send_status']]; + $lists[] = $r; + } + $head_title = $L['express_title']; +} else { + $sfields = $L['group_order_sfields']; + $dfields = array('title', 'title ', 'amount', 'password', 'seller', 'send_type', 'send_no', 'note'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $gid = isset($gid) ? intval($gid) : 0; + $gid or $gid = ''; + $itemid or $itemid = ''; + (isset($seller) && check_name($seller)) or $seller = ''; + (isset($pass) && preg_match("/^[a-z0-9]{6}$/", $pass)) or $pass = ''; + (isset($fromdate) && is_time($fromdate)) or $fromdate = ''; + $fromtime = is_date($fromdate) ? datetotime($fromdate.' 0:0:0') : 0; + (isset($todate) && is_time($todate)) or $todate = ''; + $totime = is_date($todate) ? datetotime($todate.' 23:59:59') : 0; + $status = isset($status) && isset($dstatus[$status]) ? intval($status) : ''; + $nav = isset($nav) ? intval($nav) : -1; + $fields_select = dselect($sfields, 'fields', '', $fields); + $status_select = dselect($dstatus, 'status', $L['status'], $status, '', 1, '', 1); + $condition = "buyer='$_username'"; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($fromtime) $condition .= " AND addtime>=$fromtime"; + if($totime) $condition .= " AND addtime<=$totime"; + if($status !== '') $condition .= " AND status='$status'"; + if($itemid) $condition .= " AND itemid='$itemid'"; + if($gid) $condition .= " AND gid='$gid'"; + if($seller) $condition .= " AND seller='$seller'"; + if($pass) $condition .= " AND password='$pass'"; + if(in_array($nav, array(0,1,2,4,5,6))) $condition .= " AND status=$nav"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize"); + $amount = $fee = $money = 0; + while($r = $db->fetch_array($result)) { + $r['gone'] = $DT_TIME - $r['updatetime']; + if($r['status'] == 1 || $r['status'] == 2) { + if($r['gone'] > ($MOD['trade_day']*86400 + $r['add_time']*3600)) { + $r['lefttime'] = 0; + } else { + $r['lefttime'] = secondstodate($MOD['trade_day']*86400 + $r['add_time']*3600 - $r['gone']); + } + } + $r['addtime'] = str_replace(' ', '
', timetodate($r['addtime'], $DT_PC ? 5 : 3)); + $r['updatetime'] = str_replace(' ', '
', timetodate($r['updatetime'], 5)); + $r['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$mid.'&itemid='.$r['gid']; + $r['dstatus'] = $_status[$r['status']]; + $r['money'] = $r['amount']; + $r['money'] = number_format($r['money'], 2, '.', ''); + $amount += $r['amount']; + $lists[] = $r; + } + $money = $amount + $fee; + $money = number_format($money, 2, '.', ''); + $forward = urlencode($DT_URL); + $head_title = $L['group_title']; +} +if($DT_PC) { + // +} else { + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : ''); + $head_name = $head_title; +} +include template('deal', $module); +?> \ No newline at end of file diff --git a/module/member/favorite.inc.php b/module/member/favorite.inc.php new file mode 100644 index 0000000..c99aec4 --- /dev/null +++ b/module/member/favorite.inc.php @@ -0,0 +1,121 @@ + -1 or dheader(($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).'account.php?action=group&itemid=1'); +require DT_ROOT.'/include/post.func.php'; +$TYPE = get_type('favorite-'.$_userid); +require DT_ROOT.'/module/'.$module.'/favorite.class.php'; +$do = new favorite(); +switch($action) { + case 'add': + if($MG['favorite_limit']) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}favorite WHERE userid=$_userid"); + if($r['num'] >= $MG['favorite_limit']) dalert(lang($L['limit_add'], array($MG['favorite_limit'], $r['num'])), 'goback'); + } + if($mid > 4 && $itemid) { + $t = $db->get_one("SELECT * FROM ".get_table($mid)." WHERE itemid=$itemid"); + if($t && $t['status'] > 2) { + $f = $db->get_one("SELECT itemid FROM {$DT_PRE}favorite WHERE userid=$_userid AND mid=$mid AND tid=$itemid"); + if($f) { + $title = addslashes($t['title']); + $url = strpos($t['linkurl'], '://') === false ? $MODULE[$mid]['linkurl'].$t['linkurl'] : $t['linkurl']; + $url = addslashes($url); + $thumb = isset($t['thumb']) && is_url($t['thumb']) ? $t['thumb'] : ''; + $thumb = addslashes($thumb); + $db->query("UPDATE {$DT_PRE}favorite SET title='$title',url='$url',thumb='$thumb',addtime='$DT_TIME' WHERE itemid=$f[itemid]"); + dmsg($L['op_add_success'], '?action=index'); + } else { + $post = array(); + $post['mid'] = $mid; + $post['tid'] = $itemid; + $post['title'] = $t['title']; + $post['url'] = strpos($t['linkurl'], '://') === false ? $MODULE[$mid]['linkurl'].$t['linkurl'] : $t['linkurl']; + if(isset($t['thumb']) && is_url($t['thumb'])) $post['thumb'] = $t['thumb']; + $post['userid'] = $_userid; + $post['addtime'] = $DT_TIME; + $post = daddslashes($post); + $do->add($post); + dmsg($L['op_add_success'], '?action=index'); + } + } + } + if($submit) { + if($do->pass($post)) { + $post['mid'] = $post['tid'] = $post['thumb'] = ''; + $post['userid'] = $_userid; + $post['addtime'] = $DT_TIME; + $do->add($post); + dmsg($L['op_add_success'], '?action=index'); + } else { + message($do->errmsg); + } + } else { + $title = isset($title) ? trim($title) : ''; + $url = isset($url) ? trim($url) : ''; + $typeid = 0; + $type_select = type_select($TYPE, 0, 'post[typeid]', $L['default_type']); + $style = $listorder = $note = ''; + $head_title = $L['favorite_title_add']; + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $r = $do->get_one(); + if(!$r || $r['userid'] != $_userid) message(); + if($submit) { + $post['thumb'] = $r['thumb']; + $post['mid'] = $r['mid']; + $post['tid'] = $r['tid']; + if($do->pass($post)) { + $do->edit($post); + dmsg($L['op_edit_success'], $forward); + } else { + message($do->errmsg); + } + } else { + extract($r); + $type_select = type_select($TYPE, 0, 'post[typeid]', $L['default_type'], $typeid); + $head_title = $L['favorite_title_edit']; + } + break; + case 'delete': + $itemid or message($L['favorite_msg_choose']); + $itemids = is_array($itemid) ? $itemid : array($itemid); + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['userid'] != $_userid) message(); + $do->delete($itemid); + }; + dmsg($L['op_del_success'], $forward); + break; + default: + $sfields = $L['favorite_sfields']; + $dfields = array('title', 'title', 'url', 'note'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $typeid = isset($typeid) ? ($typeid === '' ? -1 : intval($typeid)) : -1; + $fields_select = dselect($sfields, 'fields', '', $fields); + $type_select = type_select($TYPE, 0, 'typeid', $L['default_type'], $typeid, '', $L['all_type']); + $condition = "userid=$_userid"; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($typeid > -1) $condition .= " AND typeid=$typeid"; + $lists = $do->get_list($condition, 'listorder DESC,addtime DESC'); + if($MG['favorite_limit']) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}favorite WHERE userid=$_userid"); + $limit_used = $r['num']; + $limit_free = $MG['favorite_limit'] > $limit_used ? $MG['favorite_limit'] - $limit_used : 0; + } + $head_title = $L['favorite_title']; + break; +} +if($DT_PC) { + // +} else { + if($pages) $pages = mobile_pages($items, $page, $pagesize); + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : ''); + $head_name = $head_title; +} +include template('favorite', $module); +?> \ No newline at end of file diff --git a/module/member/friend.class.php b/module/member/friend.class.php new file mode 100644 index 0000000..c5a26b0 --- /dev/null +++ b/module/member/friend.class.php @@ -0,0 +1,91 @@ +table = DT_PRE.'friend'; + $this->fields = array('listorder', 'userid','typeid','username','truename','style','company','career','telephone','mobile','homepage','email','qq','wx','ali','skype','note','addtime'); + } + + function friend() { + $this->__construct(); + } + + function pass($post) { + global $_userid, $L; + if(!is_array($post)) return false; + if(!$post['truename']) return $this->_($L['friend_pass_truename']); + return true; + } + + function set($post) { + if($post['email'] && !is_email($post['email'])) $post['email'] = ''; + if($post['qq'] && !is_qq($post['qq'])) $post['qq'] = ''; + if($post['wx'] && !is_wx($post['wx'])) $post['wx'] = ''; + $post = dhtmlspecialchars($post); + return array_map("trim", $post); + } + + function get_one($condition = '') { + return DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid $condition"); + } + + function get_list($condition = 'status=3', $order = 'itemid DESC') { + global $TYPE, $pages, $page, $pagesize, $offset, $L, $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); + $r['dcompany'] = set_style($r['company'], $r['style']); + $r['type'] = $r['typeid'] && isset($TYPE[$r['typeid']]) ? set_style($TYPE[$r['typeid']]['typename'], $TYPE[$r['typeid']]['style']) : $L['default_type']; + $lists[] = $r; + } + 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)"); + return $this->itemid; + } + + function edit($post) { + $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"); + return true; + } + + function delete($itemid) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("DELETE FROM {$this->table} WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/member/home.inc.php b/module/member/home.inc.php new file mode 100644 index 0000000..4b6e7f5 --- /dev/null +++ b/module/member/home.inc.php @@ -0,0 +1,214 @@ +query("DELETE FROM {$DT_PRE}company_setting WHERE userid=$_userid AND item_key='$v'"); + } + $tabs = array('menu'=>1, 'side'=>2, 'main'=>3); + dmsg($L['home_msg_reset'], '?tab='.$tabs[$item]); + } else { + delete_upload($setting['background'], $_userid); + delete_upload($setting['logo'], $_userid); + delete_upload($setting['video'], $_userid); + delete_upload($setting['banner'], $_userid); + delete_upload($setting['bannerf'], $_userid); + delete_upload($setting['banner1'], $_userid); + delete_upload($setting['banner2'], $_userid); + delete_upload($setting['banner3'], $_userid); + delete_upload($setting['banner4'], $_userid); + delete_upload($setting['banner5'], $_userid); + $db->query("DELETE FROM {$DT_PRE}company_setting WHERE userid=$_userid"); + dmsg($L['home_msg_reset'], '?tab='.$tab); + } + break; + default: + $need_captcha = $MOD['captcha_home'] == 2 ? $MG['captcha'] : $MOD['captcha_home']; + if($submit) { + captcha($captcha, $need_captcha); + foreach(array('background', 'logo', 'video', 'banner', 'bannerf', 'banner1', 'banner2', 'banner3', 'banner4', 'banner5', 'bannerlink1', 'bannerlink2', 'bannerlink3', 'bannerlink4', 'bannerlink5') as $v) { + is_url($setting[$v]) or $setting[$v] = ''; + } + foreach(array('css', 'announce', 'seo_title', 'seo_keywords', 'seo_description') as $v) { + $setting[$v] = banword($BANWORD, $setting[$v], true, 'goback'); + } + $HOME = get_company_setting($_userid); + if($HOME['background'] != $setting['background']) delete_upload($HOME['background'], $_userid); + if($HOME['logo'] != $setting['logo']) delete_upload($HOME['logo'], $_userid); + if($HOME['video'] != $setting['video']) delete_upload($HOME['video'], $_userid); + if($HOME['banner'] != $setting['banner']) delete_upload($HOME['banner'], $_userid); + if($HOME['bannerf'] != $setting['bannerf']) delete_upload($HOME['bannerf'], $_userid); + if($HOME['banner1'] != $setting['banner1']) delete_upload($HOME['banner1'], $_userid); + if($HOME['banner2'] != $setting['banner2']) delete_upload($HOME['banner2'], $_userid); + if($HOME['banner3'] != $setting['banner3']) delete_upload($HOME['banner3'], $_userid); + if($HOME['banner4'] != $setting['banner4']) delete_upload($HOME['banner4'], $_userid); + if($HOME['banner5'] != $setting['banner5']) delete_upload($HOME['banner5'], $_userid); + clear_upload($setting['background'].$setting['logo'].$setting['video'].$setting['banner'].$setting['bannerf'].$setting['banner1'].$setting['banner2'].$setting['banner3'].$setting['banner4'].$setting['banner5'], $_userid, 'company_setting'); + $announce = $setting['announce']; + unset($setting['announce']); + $setting['stats'] = $setting['stats_type'] ? $stats[$setting['stats_type']] : ''; + $setting['kf'] = $setting['kf_type'] ? $kf[$setting['kf_type']] : ''; + $setting = dhtmlspecialchars($setting); + $setting['announce'] = dsafe($announce); + update_company_setting($_userid, $setting); + dmsg($L['home_msg_save'], '?tab='.$tab); + } else { + $CS = cache_read('module-4.php'); + $api_map = $CS['map']; + $api_stats = $CS['stats'] ? explode(',', $CS['stats']) : array(); + $api_kf = $CS['kf'] ? explode(',', $CS['kf']) : array(); + $menu_f = ','; + foreach(explode(',' , $MG['menu_c']) as $v) { + $menu_f .= $MFILE[$v].','; + } + if($MG['menu_d']) { + $_menu_show = array(); + foreach($HMENU as $k=>$v) { + $_menu_show[$k] = strpos(','.$MG['menu_d'].',', ','.$k.',') !== false ? 1 : 0; + } + $_menu_show = implode(',', $_menu_show); + } else { + $_menu_show = '1,1,1,1,1,1,1,1,0,0,0,0,0,0,0'; + } + $_menu_order = '0,10,20,30,40,50,60,70,80,90,100,110,120,130,140'; + $_menu_num = '1,16,30,30,10,30,1,12,12,12,12,30,12,1,12'; + $_menu_file = implode(',' , $MFILE); + $_menu_name = implode(',' , $HMENU); + + $side_f = ','; + foreach(explode(',' , $MG['side_c']) as $v) { + $side_f .= $SFILE[$v].','; + } + if($MG['side_d']) { + $_side_show = array(); + foreach($HSIDE as $k=>$v) { + $_side_show[$k] = strpos(','.$MG['side_d'].',', ','.$k.',') !== false ? 1 : 0; + } + $_side_show = implode(',', $_side_show); + } else { + $_side_show = '1,1,1,0,1,0,1'; + } + $_side_order = '0,10,20,30,40,50,60'; + $_side_num = '1,5,10,1,1,5,5'; + $_side_file = implode(',' , $SFILE); + $_side_name = implode(',' , $HSIDE); + + $main_f = ','; + foreach(explode(',' , $MG['main_c']) as $v) { + $main_f .= $IFILE[$v].','; + } + if($MG['main_d']) { + $_main_show = array(); + foreach($HMAIN as $k=>$v) { + $_main_show[$k] = strpos(','.$MG['main_d'].',', ','.$k.',') !== false ? 1 : 0; + } + $_main_show = implode(',', $_main_show); + } else { + $_main_show = '1,1,1,0,0,0,0'; + } + $_main_order = '0,10,20,30,40,50,60,70'; + $_main_num = '10,1,10,5,3,4,4,5'; + $_main_file= implode(',' , $IFILE); + $_main_name = implode(',' , $HMAIN); + + $HOME = get_company_setting($_userid); + extract($HOME); + + $menu_show = explode(',', isset($HOME['menu_show']) ? $HOME['menu_show'] : $_menu_show); + $menu_order = explode(',', isset($HOME['menu_order']) ? $HOME['menu_order'] : $_menu_order); + $menu_num = explode(',', isset($HOME['menu_num']) ? $HOME['menu_num'] : $_menu_num); + $menu_file = explode(',', isset($HOME['menu_file']) ? $HOME['menu_file'] : $_menu_file); + $menu_name = explode(',', isset($HOME['menu_name']) ? $HOME['menu_name'] : $_menu_name); + + $_HMENU = array(); + asort($menu_order); + foreach($menu_order as $k=>$v) { + $_HMENU[$k] = $HMENU[$k]; + if($menu_num[$k] < 1 || $menu_num[$k] > 50) $menu_num[$k] = 10; + } + $HMENU = $_HMENU; + + $pageid = array_search('page', $menu_file); + + $main_show = explode(',', isset($HOME['main_show']) ? $HOME['main_show'] : $_main_show); + $main_order = explode(',', isset($HOME['main_order']) ? $HOME['main_order'] : $_main_order); + $main_num = explode(',', isset($HOME['main_num']) ? $HOME['main_num'] : $_main_num); + $main_file = explode(',', isset($HOME['main_file']) ? $HOME['main_file'] : $_main_file); + $main_name = explode(',', isset($HOME['main_name']) ? $HOME['main_name'] : $_main_name); + $_HMAIN = array(); + asort($main_order); + foreach($main_order as $k=>$v) { + $_HMAIN[$k] = $HMAIN[$k]; + if($main_num[$k] < 1 || $main_num[$k] > 50) $main_num[$k] = 10; + } + $HMAIN = $_HMAIN; + + $side_show = explode(',', isset($HOME['side_show']) ? $HOME['side_show'] : $_side_show); + $side_order = explode(',', isset($HOME['side_order']) ? $HOME['side_order'] : $_side_order); + $side_num = explode(',', isset($HOME['side_num']) ? $HOME['side_num'] : $_side_num); + $side_file = explode(',', isset($HOME['side_file']) ? $HOME['side_file'] : $_side_file); + $side_name = explode(',', isset($HOME['side_name']) ? $HOME['side_name'] : $_side_name); + $_HSIDE = array(); + asort($side_order); + foreach($side_order as $k=>$v) { + $_HSIDE[$k] = $HSIDE[$k]; + if($side_num[$k] < 1 || $side_num[$k] > 50) $side_num[$k] = 10; + } + $HSIDE = $_HSIDE; + + isset($HOME['side_pos']) or $side_pos = 0; + isset($HOME['side_width']) or $side_width = 200; + isset($HOME['show_stats']) or $show_stats = 1; + isset($HOME['intro_length']) or $intro_length = 1000; + isset($HOME['stats']) or $stats = ''; + isset($HOME['stats_type']) or $stats_type = ''; + isset($HOME['kf']) or $kf = ''; + isset($HOME['kf_type']) or $kf_type = ''; + isset($HOME['map']) or $map = ''; + isset($HOME['background']) or $background = ''; + isset($HOME['bgcolor']) or $bgcolor = ''; + isset($HOME['bannert']) or $bannert = 0; + isset($HOME['banner']) or $banner = ''; + isset($HOME['bannerf']) or $bannerf = ''; + isset($HOME['bannerw']) or $bannerw = 1200; + isset($HOME['bannerh']) or $bannerh = 300; + isset($HOME['banner1']) or $banner1 = ''; + isset($HOME['banner2']) or $banner2 = ''; + isset($HOME['banner3']) or $banner3 = ''; + isset($HOME['banner4']) or $banner4 = ''; + isset($HOME['banner5']) or $banner5 = ''; + isset($HOME['bannerlink1']) or $bannerlink1 = ''; + isset($HOME['bannerlink2']) or $bannerlink2 = ''; + isset($HOME['bannerlink3']) or $bannerlink3 = ''; + isset($HOME['bannerlink4']) or $bannerlink4 = ''; + isset($HOME['bannerlink5']) or $bannerlink5 = ''; + isset($HOME['logo']) or $logo = ''; + isset($HOME['video']) or $video = ''; + isset($HOME['css']) or $css = ''; + isset($HOME['announce']) or $announce = ''; + isset($HOME['seo_title']) or $seo_title = ''; + isset($HOME['seo_keywords']) or $seo_keywords = ''; + isset($HOME['seo_description']) or $seo_description = ''; + $head_title = $L['home_title']; + } + break; +} +if($DT_PC) { + // +} else { + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'biz.php'); + $js_pull = 0; + $head_name = $head_title; +} +include template('home', $module); +?> \ No newline at end of file diff --git a/module/member/honor.inc.php b/module/member/honor.inc.php new file mode 100644 index 0000000..48b329c --- /dev/null +++ b/module/member/honor.inc.php @@ -0,0 +1,119 @@ + -1) or dheader(($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).'account.php?action=group&itemid=1'); +if($MG['type'] && !$_edittime && $action == 'add') dheader($MODULE[2]['linkurl'].'edit.php?tab=2'); +require DT_ROOT.'/module/'.$module.'/common.inc.php'; +require DT_ROOT.'/include/post.func.php'; +include load('my.lang'); +require DT_ROOT.'/module/'.$module.'/honor.class.php'; +$do = new honor(); +switch($action) { + case 'add': + if($_credit < 0 && $MOD['credit_less']) dheader('credit.php?action=less'); + if($MG['hour_limit']) { + $today = $DT_TIME - 3600; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}honor WHERE username='$_username' AND addtime>$today"); + if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), '?action=index'); + } + if($MG['day_limit']) { + $today = $DT_TODAY - 86400; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}honor WHERE username='$_username' AND addtime>$today"); + if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), '?action=index'); + } + if($MG['honor_limit']) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}honor WHERE username='$_username' AND status>0"); + if($r['num'] >= $MG['honor_limit']) dalert(lang($L['limit_add'], array($MG['honor_limit'], $r['num'])), '?action=index'); + } + if($submit) { + if($do->pass($post)) { + $post['username'] = $_username; + $post['addtime'] = 0; + $need_check = $MOD['credit_check'] == 2 ? $MG['check'] : $MOD['credit_check']; + $post['status'] = get_status(3, $need_check); + $do->add($post); + dmsg($L['op_add_success'], '?status='.$post['status']); + } else { + message($do->errmsg); + } + } else { + foreach($do->fields as $v) { + $$v = ''; + } + $content = ''; + $today = timetodate($DT_TIME, 'Ymd'); + $head_title = $L['honor_title_add']; + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + if($submit) { + if($do->pass($post)) { + $post['username'] = $_username; + $need_check = $MOD['credit_check'] == 2 ? $MG['check'] : $MOD['credit_check']; + $post['status'] = get_status($item['status'], $need_check); + $post['addtime'] = timetodate($item['addtime']); + $do->edit($post); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, 'honor-'.$itemid, 'set', $item); + if($post['status'] == 2) dmsg($L['op_edit_check'], '?status='.$post['status']); + dmsg($L['op_edit_success'], $forward); + } else { + message($do->errmsg); + } + } else { + extract($item); + $addtime = timetodate($addtime); + $fromtime = timetodate($fromtime, 3); + $today = timetodate($totime, 'Ymd'); + $totime = $totime ? timetodate($totime, 3) : ''; + $head_title = $L['honor_title_edit']; + } + break; + case 'delete': + $itemid or message($L['honor_msg_choose']); + $itemids = is_array($itemid) ? $itemid : array($itemid); + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $do->get_one(); + if($item && $item['username'] == $_username) $do->recycle($itemid); + } + dmsg($L['op_del_success'], $forward); + break; + default: + $status = isset($status) ? intval($status) : 3; + in_array($status, array(1, 2, 3, 4)) or $status = 3; + if($status == 3) $do->expire("AND username='$_username'"); + $condition = "username='$_username'"; + $condition .= " AND status=$status"; + if($keyword) $condition .= match_kw('title', $keyword); + $lists = $do->get_list($condition); + $head_title = $L['honor_title']; + break; +} +$nums = array(); +$limit_used = 0; +for($i = 1; $i < 5; $i++) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}honor WHERE username='$_username' AND status=$i"); + $nums[$i] = $r['num']; + $limit_used += $r['num']; +} +$limit_free = $MG['honor_limit'] && $MG['honor_limit'] > $limit_used ? $MG['honor_limit'] - $limit_used : 0; +if($DT_PC) { + $menu_id = 2; +} else { + if(isset($lists)) { + $time = 'addtime'; + foreach($lists as $k=>$v) { + $lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); + $lists[$k]['date'] = timetodate($v[$time], 5); + } + } + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'biz.php'); + if($pages) $pages = mobile_pages($items, $page, $pagesize); + $head_name = $head_title; +} +include template('honor', $module); +?> \ No newline at end of file diff --git a/module/member/link.inc.php b/module/member/link.inc.php new file mode 100644 index 0000000..67d802f --- /dev/null +++ b/module/member/link.inc.php @@ -0,0 +1,110 @@ + -1) or dheader(($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).'account.php?action=group&itemid=1'); +if($MG['type'] && !$_edittime && $action == 'add') dheader('edit.php?tab=2'); +require DT_ROOT.'/include/post.func.php'; +include load('my.lang'); +require DT_ROOT.'/module/'.$module.'/link.class.php'; +$do = new dlink(); +switch($action) { + case 'add': + if($_credit < 0 && $MOD['credit_less']) dheader('credit.php?action=less'); + if($MG['hour_limit']) { + $today = $DT_TIME - 3600; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}link WHERE username='$_username' AND addtime>$today"); + if($r && $r['num'] >= $MG['hour_limit']) dalert(lang($L['hour_limit'], array($MG['hour_limit'])), '?action=index'); + } + if($MG['day_limit']) { + $today = $DT_TODAY - 86400; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}link WHERE username='$_username' AND addtime>$today"); + if($r && $r['num'] >= $MG['day_limit']) dalert(lang($L['day_limit'], array($MG['day_limit'])), '?action=index'); + } + if($MG['link_limit']) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}link WHERE username='$_username' AND status>0"); + if($r['num'] >= $MG['link_limit']) dalert(lang($L['limit_add'], array($MG['link_limit'], $r['num'])), '?action=index'); + } + if($submit) { + $post['username'] = $_username; + if($do->pass($post)) { + $need_check = $MOD['link_check'] == 2 ? $MG['check'] : $MOD['link_check']; + $post['status'] = get_status(3, $need_check); + $do->add($post); + dmsg($L['op_add_success'], '?status='.$post['status']); + } else { + message($do->errmsg); + } + } else { + foreach($do->fields as $v) { + $$v = ''; + } + $head_title = $L['link_title_add']; + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $r = $do->get_one(); + if(!$r || $r['username'] != $_username) message(); + if($submit) { + $post['username'] = $_username; + if($do->pass($post)) { + $need_check = $MOD['link_check'] == 2 ? $MG['check'] : $MOD['link_check']; + $post['status'] = get_status($r['status'], $need_check); + $do->edit($post); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, 'link-'.$itemid, 'set', $item); + if($post['status'] == 2) dmsg($L['op_edit_check'], '?status='.$post['status']); + dmsg($L['op_edit_success'], $forward); + } else { + message($do->errmsg); + } + } else { + extract($r); + $head_title = $L['link_title_edit']; + } + break; + case 'delete': + $itemid or message($L['link_msg_choose']); + $itemids = is_array($itemid) ? $itemid : array($itemid); + foreach($itemids as $itemid) { + $do->itemid = $itemid; + $item = $do->get_one(); + if($item && $item['username'] == $_username) $do->delete($itemid); + } + dmsg($L['op_del_success'], $forward); + break; + default: + $status = isset($status) ? intval($status) : 3; + in_array($status, array(2, 3)) or $status = 3; + $condition = "username='$_username'"; + $condition .= " AND status=$status"; + if($keyword) $condition .= match_kw('title', $keyword); + $lists = $do->get_list($condition); + $head_title = $L['link_title']; + break; +} +$nums = array(); +$limit_used = 0; +for($i = 2; $i < 4; $i++) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}link WHERE username='$_username' AND status=$i"); + $nums[$i] = $r['num']; + $limit_used += $r['num']; +} +$limit_free = $MG['link_limit'] && $MG['link_limit'] > $limit_used ? $MG['link_limit'] - $limit_used : 0; +if($DT_PC) { + $menu_id = 2; +} else { + if(isset($lists)) { + $time = 'addtime'; + foreach($lists as $k=>$v) { + $lists[$k]['linkurl'] = str_replace($MOD['linkurl'], $MOD['mobile'], $v['linkurl']); + $lists[$k]['date'] = timetodate($v[$time], 5); + } + } + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'biz.php'); + if($pages) $pages = mobile_pages($items, $page, $pagesize); + $head_name = $head_title; +} +include template('link', $module); +?> \ No newline at end of file diff --git a/module/member/mail.inc.php b/module/member/mail.inc.php new file mode 100644 index 0000000..83de2ef --- /dev/null +++ b/module/member/mail.inc.php @@ -0,0 +1,82 @@ +$v) { + $TYPE[$k]['typename'] = set_style($v['typename'], $v['style']); +} +$r = $db->get_one("SELECT * FROM {$DT_PRE}mail_list WHERE username='$_username'"); +switch($action) { + case 'cancel': + if($r) { + $db->query("DELETE FROM {$DT_PRE}mail_list WHERE username='$_username'"); + } else { + message($L['mail_msg_not_add']); + } + dmsg($L['mail_msg_cancel'], '?action=index'); + break; + case 'show': + $itemid or message(); + $r = $db->get_one("SELECT * FROM {$DT_PRE}mail WHERE itemid=$itemid"); + $r or message($L['mail_msg_not_item']); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['adddate'] = timetodate($r['addtime'], 5); + break; + case 'list': + $r or message($L['mail_msg_not_add']); + $typeids = substr($r['typeids'], 1, -1); + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}mail WHERE typeid IN ($typeids)"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}mail WHERE typeid IN ($typeids) ORDER BY itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $r['editdate'] = timetodate($r['edittime'], 5); + $r['adddate'] = timetodate($r['addtime'], 5); + $lists[] = $r; + } + $head_title = $L['mail_title_list']; + break; + default: + if($submit) { + (isset($typeids) && is_array($typeids) && $typeids) or message($L['mail_msg_choose'], '?action=index'); + $_typeids = ''; + foreach($typeids as $t) { + $_typeids .= intval($t).','; + } + $_typeids = ','.$_typeids; + if($r) { + $db->query("UPDATE {$DT_PRE}mail_list SET email='$_email',typeids='$_typeids',edittime='$DT_TIME' WHERE username='$_username'"); + } else { + $db->query("INSERT INTO {$DT_PRE}mail_list (username,email,typeids,addtime,edittime) VALUES ('$_username','$_email','$_typeids','$DT_TIME','$DT_TIME')"); + } + dmsg($L['mail_msg_update'], '?action=index'); + } else { + $mytypeids = array(); + if($r) { + $r['typeids'] = substr($r['typeids'], 1, -1); + $mytypeids = explode(',', $r['typeids']); + $addtime = timetodate($r['addtime'], 5); + $edittime = timetodate($r['edittime'], 5); + } + $_TYPE = $TYPE; + $TYPE = array(); + foreach($_TYPE as $v) { + $TYPE[] = $v; + } + $head_title = $L['mail_title']; + } + break; +} +if($DT_PC) { + $menu_id = 2; +} else { + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'biz.php'); + $head_name = $head_title; +} +include template('mail', $module); +?> \ No newline at end of file diff --git a/module/member/member.class.php b/module/member/member.class.php new file mode 100644 index 0000000..61e374a --- /dev/null +++ b/module/member/member.class.php @@ -0,0 +1,757 @@ +table_member = DT_PRE.'member'; + $this->table_member_misc = DT_PRE.'member_misc'; + $this->table_member_check = DT_PRE.'member_check'; + $this->table_company = DT_PRE.'company'; + $this->table_company_data = DT_PRE.'company_data'; + } + + function member() { + $this->__construct(); + } + + function is_username($username, $auto = 0) { + global $MOD, $L; + if(!check_name($username)) return $this->_($L['member_username_match']); + $MOD['minusername'] or $MOD['minusername'] = 4; + $MOD['maxusername'] or $MOD['maxusername'] = 20; + if(strlen($username) < $MOD['minusername'] || strlen($username) > $MOD['maxusername']) return $this->_(lang($L['member_username_len'], array($MOD['minusername'], $MOD['maxusername']))); + if($MOD['banusername'] && !$this->userid) { + $tmp = explode('|', $MOD['banusername']); + foreach($tmp as $v) { + if($MOD['banmodeu']) { + if($username == $v) return $this->_($L['member_username_ban']); + } else { + if(strpos($username, $v) !== false) return $this->_($L['member_username_ban']); + } + } + } + if(!$auto && substr($username, 0, 4) == 'uid-') return $this->_($L['member_username_ban']); + if($this->username_exists($username)) return $this->_($L['member_username_reg']); + return true; + } + + function is_company($company) { + global $MOD, $L; + $company = trim($company); + if(strlen($company) < 6) return $this->_($L['member_company_null']); + if(preg_match("/[0-9]+/", $company) || !$this->is_clean($company)) return $this->_($L['member_company_bad']); + if($MOD['bancompany'] && !$this->userid) { + $tmp = explode('|', $MOD['bancompany']); + foreach($tmp as $v) { + if($MOD['banmodec']) { + if($company == $v) return $this->_($L['member_company_ban']); + } else { + if(strpos($company, $v) !== false) return $this->_($L['member_company_ban']); + } + } + } + return true; + } + + function is_email($email) { + global $MOD, $L; + $email = trim($email); + if(!is_email($email)) return $this->_($L['member_email_null']); + if($MOD['banemail']) { + $domain = substr(strstr($email, '@'), 1); + $tmp = explode('|', $MOD['banemail']); + foreach($tmp as $v) { + if($domain == $v) return $this->_($L['member_email_ban']); + } + } + return true; + } + + function is_passport($passport, $auto = 0) { + global $MOD, $L; + $MOD['minusername'] or $MOD['minusername'] = 4; + $MOD['maxusername'] or $MOD['maxusername'] = 20; + if(strlen($passport) < $MOD['minusername'] || strlen($passport) > $MOD['maxusername']) return $this->_(lang($L['member_passport_len'], array($MOD['minusername'], $MOD['maxusername']))); + $badwords = array("$","\\",'&',' ',"'",'"','/','*',',','<','>',"\r","\t","\n","#"); + foreach($badwords as $v) { + if(strpos($passport, $v) !== false) return $this->_($L['member_passport_char']); + } + if($MOD['banusername'] && !$this->userid) { + $tmp = explode('|', $MOD['banusername']); + foreach($tmp as $v) { + if($MOD['banmodeu']) { + if($passport == $v) return $this->_($L['member_passport_ban']); + } else { + if(strpos($passport, $v) !== false) return $this->_($L['member_passport_ban']); + } + } + } + if(!$auto && substr($passport, 0, 4) == 'uid-') return $this->_($L['member_passport_ban']); + if($this->passport_exists($passport)) return $this->_($L['member_passport_reg']); + return true; + } + + function is_password($password, $cpassword = '') { + global $MOD, $L; + if(!$password) return $this->_($L['member_password_null']); + if($cpassword && $password != $cpassword) return $this->_($L['member_password_match']); + if(!$MOD['minpassword']) $MOD['minpassword'] = 6; + if(!$MOD['maxpassword']) $MOD['maxpassword'] = 20; + if(strlen($password) < $MOD['minpassword'] || strlen($password) > $MOD['maxpassword']) return $this->_(lang($L['member_password_len'], array($MOD['minpassword'], $MOD['maxpassword']))); + if(strpos(','.$MOD['mixpassword'].',', ',1,') !== false && !preg_match("/[0-9]/", $password)) return $this->_($L['member_password_1']); + if(strpos(','.$MOD['mixpassword'].',', ',2,') !== false && !preg_match("/[a-z]/", $password)) return $this->_($L['member_password_2']); + if(strpos(','.$MOD['mixpassword'].',', ',3,') !== false && !preg_match("/[A-Z]/", $password)) return $this->_($L['member_password_3']); + if(strpos(','.$MOD['mixpassword'].',', ',4,') !== false && !preg_match("/[[:punct:]]/", $password)) return $this->_($L['member_password_4']); + return true; + } + + function is_payword($password, $cpassword = '') { + global $MOD, $L; + if(!$password) return $this->_($L['member_payword_null']); + if($cpassword && $password != $cpassword) return $this->_($L['member_payword_match']); + if(!$MOD['minpassword']) $MOD['minpassword'] = 6; + if(!$MOD['maxpassword']) $MOD['maxpassword'] = 20; + if(strlen($password) < $MOD['minpassword'] || strlen($password) > $MOD['maxpassword']) return $this->_(lang($L['member_payword_len'], array($MOD['minpassword'], $MOD['maxpassword']))); + if(strpos(','.$MOD['mixpassword'].',', ',1,') !== false && !preg_match("/[0-9]/", $password)) return $this->_($L['member_password_1']); + if(strpos(','.$MOD['mixpassword'].',', ',2,') !== false && !preg_match("/[a-z]/", $password)) return $this->_($L['member_password_2']); + if(strpos(','.$MOD['mixpassword'].',', ',3,') !== false && !preg_match("/[A-Z]/", $password)) return $this->_($L['member_password_3']); + if(strpos(','.$MOD['mixpassword'].',', ',4,') !== false && !preg_match("/[[:punct:]]/", $password)) return $this->_($L['member_password_4']); + return true; + } + + function is_clean($string) { + $chars = array("\\", "'",'"','/','<','>',"\r","\t","\n"); + foreach($chars as $v) { + if(strpos($string, $v) !== false) return false; + } + return true; + } + + function email_exists($email) { + $condition = "email='$email'"; + if($this->userid) $condition .= " AND userid!=$this->userid"; + return DB::get_one("SELECT userid FROM {$this->table_member} WHERE {$condition}"); + } + + function mobile_exists($mobile) { + $condition = "mobile='$mobile'"; + if($this->userid) $condition .= " AND userid!=$this->userid"; + return DB::get_one("SELECT userid FROM {$this->table_member} WHERE {$condition}"); + } + + function username_exists($username) { + if(is_mobile($username)) return true; + $t = DB::get_one("SELECT userid FROM {$this->table_member} WHERE username='$username'"); + if($t) return true; + return DB::get_one("SELECT userid FROM {$this->table_member} WHERE passport='$username'"); + } + + function company_exists($company) { + $condition = "company='$company'"; + if($this->userid) $condition .= " AND userid!=$this->userid"; + return DB::get_one("SELECT userid FROM {$this->table_company} WHERE {$condition}"); + } + + function shop_exists($shop) { + $condition = "shop='$shop'"; + if($this->userid) $condition .= " AND userid!=$this->userid"; + return DB::get_one("SELECT userid FROM {$this->table_member} WHERE {$condition}"); + } + + function passport_exists($passport) { + $condition = "passport='$passport'"; + if($this->userid) $condition .= " AND userid!=$this->userid"; + $t = DB::get_one("SELECT userid FROM {$this->table_member} WHERE {$condition}"); + if($t) return true; + if(check_name($passport)) { + $condition = "username='$passport'"; + if($this->userid) $condition .= " AND userid!=$this->userid"; + return DB::get_one("SELECT userid FROM {$this->table_member} WHERE {$condition}"); + } + return false; + } + + function pass($member, $auto = 0) { + global $L, $AREA; + if(!is_array($member)) return false; + if(!$this->is_passport($member['passport'], $auto)) return false; + if(!$member['groupid']) return $this->_($L['member_groupid_null']); + if($member['email']) { + if(!is_email($member['email'])) return $this->_($L['member_email_null']); + if(!$this->is_email($member['email'])) return $this->_($this->errmsg); + if($this->email_exists($member['email'])) return $this->_($L['member_email_reg']); + } + if($member['mobile']) { + if(!is_mobile($member['mobile'])) return $this->_($L['member_mobile_null']); + if($this->mobile_exists($member['mobile'])) return $this->_($L['member_mobile_reg']); + } + $groupid = $this->userid ? $member['groupid'] : $member['regid']; + $GROUP = cache_read('group.php'); + if($GROUP[$groupid]['type']) { + if(!$this->is_company($member['company'])) return $this->_($this->errmsg); + if($this->company_exists($member['company'])) return $this->_($L['member_company_reg']); + } + if($this->userid) { + if($member['shop'] && $this->shop_exists($member['shop'])) return $this->_($L['member_shop_reg']); + if(strlen($member['truename']) < 2 || !$this->is_clean($member['truename'])) return $this->_($L['member_truename_null']); + $areaid = intval($member['areaid']); + if(!$areaid || !DB::get_one("SELECT areaid FROM ".DT_PRE."area WHERE areaid=$areaid")) return $this->_($L['member_areaid_null']); + if($member['password'] && !$this->is_password($member['password'], $member['cpassword'])) return false; + if($member['payword'] && !$this->is_payword($member['payword'], $member['cpayword'])) return false; + if($GROUP[$groupid]['type']) { + if(strlen($member['type']) < 2) return $this->_($L['member_type_null']); + if(!is_telephone($member['telephone'])) return $this->_($L['member_telephone_null']); + if(strlen($member['regyear']) != 4 || !is_numeric($member['regyear'])) return $this->_($L['member_regyear_null']); + if(empty($member['address'])) return $this->_($L['member_address_null']); + #if(word_count($member['content']) < 5) return $this->_($L['member_introduce_null']); + if(!$member['business']) return $this->_($L['member_business_null']); + if(strlen($member['catid']) < 2) return $this->_($L['member_catid_null']); + } + } else { + if(!$this->is_username($member['username'], $auto)) return false; + if($GROUP[$groupid]['type'] && !$this->is_company($member['company'])) return false; + if(!$this->is_password($member['password'], $member['cpassword'])) return false; + } + if(DT_MAX_LEN && strlen(clear_img($member['content'])) > DT_MAX_LEN) return $this->_(lang('message->pass_max')); + return true; + } + + function set($member) { + global $MOD; + $member['email'] = trim($member['email']); + $member['mail'] = isset($member['mail']) ? trim($member['mail']) : ''; + is_email($member['mail']) or $member['mail'] = ''; + $member['qq'] = isset($member['qq']) ? trim($member['qq']) : ''; + is_qq($member['qq']) or $member['qq'] = ''; + $member['wx'] = isset($member['wx']) ? trim($member['wx']) : ''; + is_wx($member['wx']) or $member['wx'] = ''; + $member['gzh'] = isset($member['gzh']) ? trim($member['gzh']) : ''; + is_gzh($member['gzh']) or $member['gzh'] = ''; + $member['thumb'] = isset($member['thumb']) ? trim($member['thumb']) : ''; + is_url($member['thumb']) or $member['thumb'] = ''; + $member['wxqr'] = isset($member['wxqr']) ? trim($member['wxqr']) : ''; + is_url($member['wxqr']) or $member['wxqr'] = ''; + $member['gzhqr'] = isset($member['gzhqr']) ? trim($member['gzhqr']) : ''; + is_url($member['gzhqr']) or $member['gzhqr'] = ''; + check_name($member['inviter']) or $member['inviter'] = ''; + ($member['inviter'] != $member['username']) or $member['inviter'] = ''; + $member['postcode'] = isset($member['postcode']) ? trim($member['postcode']) : ''; + is_numeric($member['postcode']) or $member['postcode'] = ''; + $member['ali'] = isset($member['ali']) ? trim($member['ali']) : ''; + if(!$this->is_clean($member['ali'])) $member['ali'] = ''; + $member['skype'] = isset($member['skype']) ? trim($member['skype']) : ''; + if(!$this->is_clean($member['skype'])) $member['skype'] = ''; + $member['address'] = isset($member['address']) ? trim($member['address']) : ''; + if(!$this->is_clean($member['address'])) $member['address'] = ''; + $member['mode'] = (isset($member['mode']) && is_array($member['mode']) && $member['mode']) ? implode(',', $member['mode']) : ''; + $member['keyword'] = $member['company']; + $member['homepage'] = isset($member['homepage']) ? fix_link($member['homepage']) : ''; + $member['capital'] = isset($member['capital']) ? dround($member['capital']) : ''; + $member['sound'] = isset($member['sound']) ? intval($member['sound']) : 0; + if($this->userid) { + $member['banktype'] = $member['banktype'] ? 1 : 0; + $member['keyword'] = $member['company'].addslashes(strip_tags(area_pos($member['areaid'], ','))).','.$member['business'].','.$member['sell'].','.$member['buy'].','.$member['mode']; + $new = $member['content']; + if($member['thumb']) $new .= ''; + if($member['wxqr']) $new .= ''; + if($member['gzhqr']) $new .= ''; + $content_table = content_table(4, $this->userid, is_file(DT_CACHE.'/4.part'), $this->table_company_data); + $r = DB::get_one("SELECT content FROM {$content_table} WHERE userid=$this->userid"); + $old = $r['content']; + $r = $this->get_one(); + if($r['thumb']) $old .= ''; + if($r['wxqr']) $old .= ''; + if($r['gzhqr']) $old .= ''; + delete_diff($new, $old); + } + $member['introduce'] = addslashes(get_intro($member['content'], $MOD['introduce_length'])); + if(!defined('DT_ADMIN')) { + $content = $member['content']; + unset($member['content']); + $member = dhtmlspecialchars($member); + $member['content'] = dsafe($content); + } + if($MOD['introduce_clear'] || $MOD['introduce_save']) { + $member['content'] = stripslashes($member['content']); + $member['content'] = save_local($member['content']); + if($MOD['introduce_clear']) $member['content'] = clear_link($member['content']); + if($MOD['introduce_save']) $member['content'] = save_remote($member['content']); + $member['content'] = addslashes($member['content']); + } + if($member['catid']) { + $catids = explode(',', substr($member['catid'], 1, -1)); + $cids = ''; + foreach($catids as $catid) { + $C = get_cat($catid); + if($C) { + $catid = $C['parentid'] ? $C['arrparentid'].','.$catid : $catid; + $cids .= $catid.','; + } + } + $cids = array_unique(explode(',', substr(str_replace(',0,', ',', ','.$cids), 1, -1))); + $member['catids'] = ','.implode(',', $cids).','; + } + return $member; + } + + function add($member) { + global $DT, $MOD, $L; + $member = $this->set($member); + $member['linkurl'] = userurl($member['username']); + $password = $member['password']; + $member['passsalt'] = random(8); + $member['paysalt'] = random(8); + $member['password'] = dpassword($password, $member['passsalt']); + $member['payword'] = dpassword($password, $member['paysalt']); + $member['sound'] = 1; + $member_fields = array('username','company','passport', 'password','payword','email','sound','gender','truename','mobile','qq','wx','wxqr','ali','skype','department','career','groupid','regid','areaid','edittime','inviter','passsalt', 'paysalt'); + $misc_fields = array('username','bank','banktype','branch','account','reply','black', 'send'); + $company_fields = array('username','groupid','company','type','catid','catids','areaid', 'mode','capital','regunit','size','regyear','sell','buy','business','telephone','fax','mail','gzh','gzhqr','address','postcode','homepage','introduce','thumb','keyword','linkurl'); + $member_sqlk = $member_sqlv = $misc_sqlk = $misc_sqlv = $company_sqlk = $company_sqlv = ''; + foreach($member as $k=>$v) { + if(in_array($k, $member_fields)) {$member_sqlk .= ','.$k; $member_sqlv .= ",'$v'";} + if(in_array($k, $company_fields)) {$company_sqlk .= ','.$k; $company_sqlv .= ",'$v'";} + if(in_array($k, $misc_fields)) {$misc_sqlk .= ','.$k; $misc_sqlv .= ",'$v'";} + } + $member_sqlk = substr($member_sqlk, 1); + $member_sqlv = substr($member_sqlv, 1); + $misc_sqlk = substr($misc_sqlk, 1); + $misc_sqlv = substr($misc_sqlv, 1); + $company_sqlk = substr($company_sqlk, 1); + $company_sqlv = substr($company_sqlv, 1); + DB::query("INSERT INTO {$this->table_member} ($member_sqlk,regip,regtime,loginip,logintime) VALUES ($member_sqlv,'".DT_IP."','".DT_TIME."','".DT_IP."','".DT_TIME."')"); + $this->userid = DB::insert_id(); + if(!$this->userid) return 0; + $member['userid'] = $this->userid; + $this->username = $member['username']; + DB::query("INSERT INTO {$this->table_member_misc} (userid, $misc_sqlk) VALUES ('$this->userid', $misc_sqlv)"); + DB::query("INSERT INTO {$this->table_company} (userid, $company_sqlk) VALUES ('$this->userid', $company_sqlv)"); + $content_table = content_table(4, $this->userid, is_file(DT_CACHE.'/4.part'), $this->table_company_data); + DB::query("INSERT INTO {$content_table} (userid, content) VALUES ('$this->userid', '$member[content]')"); + if($MOD['credit_register'] > 0) { + credit_add($this->username, $MOD['credit_register']); + credit_record($this->username, $MOD['credit_register'], 'system', $L['member_record_reg'], DT_IP); + } + if($MOD['money_register'] > 0) { + money_add($this->username, $MOD['money_register']); + money_record($this->username, $MOD['money_register'], $L['in_site'], 'system', $L['member_record_reg'], DT_IP); + } + if($MOD['sms_register'] > 0) { + sms_add($this->username, $MOD['sms_register']); + sms_record($this->username, $MOD['sms_register'], 'system', $L['member_record_reg'], DT_IP); + } + $this->bind($member['username'], DT_TIME); + clear_upload($member['thumb'].$member['wxqr'].$member['gzhqr'].$member['content'], $this->userid, 'company'); + return $this->userid; + } + + function edit($member) { + $member = $this->set($member); + $r = $this->get_one(); + $member_fields = array('company','shop','passport','sound','email','qq','wx','wxqr','ali','skype','gender','truename','mobile','department','career','groupid','areaid', 'edittime','vemail','vmobile','vbank','vtruename','vcompany','vshop','support','inviter'); + $misc_fields = array('username','bank','banktype','branch','account','reply','black', 'send'); + $company_fields = array('company','type','areaid', 'catid','catids','business','mode','regyear','regunit','capital','size','address','postcode','telephone','fax','mail','gzh','gzhqr','homepage','sell','buy','introduce','thumb','keyword','linkurl','groupid','domain','icp','validated','validator','validtime'); + $member_sql = $misc_sql = $company_sql = ''; + foreach($member as $k=>$v) { + if(in_array($k, $member_fields)) $member_sql .= ",$k='$v'"; + if(in_array($k, $misc_fields)) $misc_sql .= ",$k='$v'"; + if(in_array($k, $company_fields)) $company_sql .= ",$k='$v'"; + } + if($member['password']) { + $passsalt = random(8); + $password = dpassword($member['password'], $passsalt); + $member_sql .= ",password='$password',passsalt='$passsalt'"; + } + if($member['payword']) { + $paysalt = random(8); + $payword = dpassword($member['payword'], $paysalt); + $member_sql .= ",payword='$payword',paysalt='$paysalt'"; + } + $member_sql = substr($member_sql, 1); + $misc_sql = substr($misc_sql, 1); + $company_sql = substr($company_sql, 1); + DB::query("UPDATE {$this->table_member} SET $member_sql WHERE userid=$this->userid"); + DB::query("UPDATE {$this->table_member_misc} SET $misc_sql WHERE userid=$this->userid"); + DB::query("UPDATE {$this->table_company} SET $company_sql WHERE userid=$this->userid"); + $content_table = content_table(4, $this->userid, is_file(DT_CACHE.'/4.part'), $this->table_company_data); + DB::query("UPDATE {$content_table} SET content='$member[content]' WHERE userid=$this->userid"); + $member['userid'] = $this->userid; + $member['vip'] = $r['vip']; + userclean($member['username']); + clear_upload($member['thumb'].$member['wxqr'].$member['gzhqr'].$member['content'], $this->userid, 'company'); + return true; + } + + function get_one($username = '') { + $condition = $username ? "username='$username'" : "userid=$this->userid"; + $r1 = DB::get_one("SELECT * FROM {$this->table_member} WHERE $condition"); + if(!$r1) return array(); + $r2 = DB::get_one("SELECT * FROM {$this->table_member_misc} WHERE $condition"); + $r3 = DB::get_one("SELECT * FROM {$this->table_company} WHERE $condition"); + return array_merge($r1, $r2, $r3); + } + + function get_list($condition, $order = 'userid DESC') { + global $pages, $page, $pagesize, $offset, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table_member} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + if($items < 1) return array(); + $members = array(); + $result = DB::query("SELECT * FROM {$this->table_member} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['logindate'] = timetodate($r['logintime'], 5); + $r['regdate'] = timetodate($r['regtime'], 5); + $members[] = $r; + } + return $members; + } + + function login($login_username, $login_password, $login_cookietime = 0, $reason = '', $child = 0) { + global $MOD, $MODULE, $L; + if(!check_name($login_username)) return $this->_($L['member_login_username_bad']); + if(!$MOD || !isset($MOD['login_times'])) $MOD = cache_read('module-2.php'); + $login_lock = ($MOD['login_times'] && $MOD['lock_hour']) ? true : false; + $LOCK = array(); + if($login_lock) { + $LOCK = cache_read(DT_IP.'.php', 'ban'); + if($LOCK) { + if(DT_TIME - $LOCK['time'] < $MOD['lock_hour']*3600) { + if($LOCK['times'] >= $MOD['login_times']) return $this->_(lang($L['member_login_ban'], array($MOD['login_times'], $MOD['lock_hour']))); + } else { + $LOCK = array(); + cache_delete(DT_IP.'.php', 'ban'); + } + } + } + $user = userinfo($login_username, 0); + if(!$user) { + $this->lock($login_lock, $LOCK); + return $this->_($L['member_login_not_member']); + } + if(!$reason) { + if($user['password'] != dpassword($login_password, $user['passsalt'])) { + $this->lock($login_lock, $LOCK); + return $this->_($L['member_login_password_bad']); + } + } + if($user['groupid'] == 2) return $this->_($L['member_login_member_ban']); + $userid = $user['userid']; + if($MOD['credit_login'] > 0 && timetodate(DT_TIME, 3) != timetodate($user['logintime'], 3)) { + credit_add($login_username, $MOD['credit_login']); + credit_record($login_username, $MOD['credit_login'], 'system', $L['member_record_login'], DT_IP); + } + $child = intval($child); + $cookietime = DT_TIME + ($login_cookietime ? intval($login_cookietime) : 86400*7); + $auth = encrypt($user['userid'].'|'.$user['password'].'|'.$child, DT_KEY.'USER'); + set_cookie('auth', $auth, $cookietime); + set_cookie('username', $user['username'], DT_TIME + 30*86400); + DB::query("UPDATE {$this->table_member} SET loginip='".DT_IP."',logintime=".DT_TIME.",logintimes=logintimes+1 WHERE userid=$userid"); + if($child) DB::query("UPDATE {$this->table_member}_child SET loginip='".DT_IP."',logintime=".DT_TIME.",logintimes=logintimes+1 WHERE itemid=$child"); + $this->cart($userid); + $this->bind($user['username'], DT_TIME); + return $user; + } + + function cart($userid) {//SYNC + $r = DB::get_one("SELECT data FROM ".DT_PRE."cart WHERE userid=$userid"); + if($r && $r['data']) { + $cart = unserialize($r['data']); + set_cookie('cart', count($cart), DT_TIME + 30*86400); + } + } + + function bind($username, $addtime) { + $auth = get_cookie('bind'); + if($auth) { + set_cookie('bind', ''); + $auth = decrypt($auth, DT_KEY.'BIND'); + if(strpos($auth, '|') !== false) { + $t = explode('|', $auth); + $itemid = intval($t[0]); + $site = check_name($t[1]) ? $t[1] : ''; + if($itemid && $site) { + DB::query("UPDATE ".DT_PRE."oauth SET username='' WHERE username='$username' AND site='$site'"); + DB::query("UPDATE ".DT_PRE."oauth SET username='$username',addtime='$addtime' WHERE itemid=$itemid"); + } + } + } + $auth = get_cookie('weixin_openid'); + if($auth) { + set_cookie('weixin_openid', ''); + $openid = decrypt($auth, DT_KEY.'WXID'); + if(is_openid($openid)) { + DB::query("UPDATE ".DT_PRE."weixin_user SET username='' WHERE username='$username'"); + DB::query("UPDATE ".DT_PRE."weixin_user SET username='$username',edittime='$addtime' WHERE openid='$openid'"); + } + } + } + + function lock($login_lock, $LOCK) { + if($login_lock) { + $LOCK['time'] = DT_TIME; + $LOCK['times'] = isset($LOCK['times']) ? $LOCK['times'] + 1 : 1; + cache_write(DT_IP.'.php', $LOCK, 'ban'); + } + } + + function logout() { + global $_userid; + DB::query("DELETE FROM ".DT_PRE."online WHERE userid=$_userid"); + set_cookie('auth', ''); + set_cookie('userid', ''); + set_cookie('username', ''); + return true; + } + + function delete($userid) { + global $dc, $CFG, $MODULE, $L; + if(!$userid) return false; + if(is_array($userid)) { + foreach($userid as $uid) { + if($uid == 1 || is_founder($uid)) return $this->_($L['member_founder_del']); + } + $userids = implode(',', $userid); + } else { + if($userid == 1 || is_founder($userid)) return $this->_($L['member_founder_del']); + $userids = intval($userid); + } + $result = DB::query("SELECT username,userid FROM {$this->table_member} WHERE userid IN ($userids)"); + while($r = DB::fetch_array($result)) { + $userid = $r['userid']; + $username = $r['username']; + if(!$userid || !$username) continue; + $content_table = content_table(4, $userid, is_file(DT_CACHE.'/4.part'), $this->table_company_data); + $content_table = str_replace(DT_PRE, '', $content_table); + foreach(array('address', 'admin_log', 'alert', 'ask', 'comment', 'honor', 'gift_order', 'guestbook', 'link', 'login', 'mail_list', 'spread', 'member_upgrade', 'oauth', 'poll_record', 'vote_record', 'weixin_bind', 'weixin_user') as $v) { + $this->deluser($v, $username, true); + } + foreach(array('news', 'page') as $v) { + $this->deluser($v, $username, true, true); + } + foreach($MODULE as $m) { + if($m['islink'] || $m['moduleid'] < 5) continue; + $this->deluser($m['module'].'_'.$m['moduleid'], $username, true, true, $m['moduleid']); + } + foreach(array('member', 'member_misc', 'member_check', 'company', $content_table, 'company_setting', 'admin', 'favorite', 'friend') as $v) { + $this->deluser($v, $userid, false); + } + DB::query("DELETE FROM ".DT_PRE."cart WHERE userid='$userid'"); + DB::query("DELETE FROM ".DT_PRE."type WHERE item='friend-".$userid."'"); + DB::query("DELETE FROM ".DT_PRE."type WHERE item='favorite-".$userid."'"); + DB::query("DELETE FROM ".DT_PRE."type WHERE item='sell-5-".$userid."'"); + DB::query("DELETE FROM ".DT_PRE."type WHERE item='news-".$userid."'"); + DB::query("DELETE FROM ".DT_PRE."type WHERE item='mall-16-".$userid."'"); + userclean($username); + $this->delupload($username, $userid); + } + return true; + } + + function deluser($table, $user, $name = true, $data = false, $moduleid = 0) { + global $MODULE; + if(!$user) return; + $fields = $name ? 'username' : 'userid'; + $module = $moduleid ? $MODULE[$moduleid]['module'] : ''; + if($data) { + $result = DB::query("SELECT * FROM ".DT_PRE."{$table} WHERE `$fields`='$user'"); + while($r = DB::fetch_array($result)) { + $itemid = $r['itemid']; + DB::query("DELETE FROM ".DT_PRE."{$table} WHERE itemid='$itemid'"); + $table_data = strpos($table, '_') === false ? $table.'_data' : str_replace('_', '_data_', $table); + $table_data = DT_PRE.$table_data; + if($moduleid) $table_data = content_table($moduleid, $itemid, is_file(DT_CACHE.'/'.$moduleid.'.part'), $table_data); + DB::query("DELETE FROM {$table_data} WHERE itemid='$itemid'"); + if($module == 'sell') { + DB::query("DELETE FROM ".DT_PRE."sell_search_{$moduleid} WHERE itemid=$itemid"); + } + if($moduleid && $r['linkurl'] && strpos($r['linkurl'], '://') === false && strpos($r['linkurl'], '.php') === false && strpos($r['linkurl'], 'show-') === false) { + $html = DT_ROOT.'/'.$MODULE[$moduleid]['moduledir'].'/'.$r['linkurl']; + if(is_file($html)) file_del($html); + } + } + } else { + DB::query("DELETE FROM ".DT_PRE."{$table} WHERE `$fields`='$user'"); + } + } + + function delupload($username, $userid) { + if(!$userid || !$username) return; + $result = DB::query("SELECT fileurl FROM ".DT_PRE."upload_".($userid%10)." WHERE username='$username'"); + while($r = DB::fetch_array($result)) { + delete_upload($r['fileurl'], $userid); + } + } + + function rename($cusername, $nusername) { + global $MODULE, $L, $_username; + $cusername = trim($cusername); + $nusername = trim($nusername); + if($cusername == $nusername) return false; + if(!$this->username_exists($cusername)) return $this->_($L['member_rename_not_member']); + if(!$this->is_username($nusername)) return false; + $tables = array('address', 'alert', 'ask', 'chat_data_0', 'chat_data_1', 'chat_data_2', 'chat_data_3', 'chat_data_4', 'chat_data_5', 'chat_data_6', 'chat_data_7', 'chat_data_8', 'chat_data_9','comment', 'finance_award', 'finance_card', 'finance_cash', 'finance_charge', 'finance_coupon', 'finance_pay', 'finance_promo', 'finance_deposit', 'finance_record', 'finance_sms', 'form_answer', 'form_record', 'guestbook', 'honor', 'link', 'admin_log', 'login', 'mail_list', 'spread', 'news', 'page', 'oauth', 'vote_record', 'gift_order', 'poll_record', 'weixin_bind', 'weixin_user', 'member', 'member_misc', 'member_check', 'member_upgrade', 'company'); + foreach($MODULE as $m) { + if($m['islink'] || $m['moduleid'] < 5) continue; + $tables[] = $m['module'].'_'.$m['moduleid']; + if($m['module'] == 'mall') { + $tables[] = $m['module'].'_express_'.$m['moduleid']; + $tables[] = $m['module'].'_view_'.$m['moduleid']; + DB::query("UPDATE ".DT_PRE."mall_view_".$m['moduleid']." SET seller='$nusername' WHERE seller='$cusername'"); + DB::query("UPDATE ".DT_PRE."mall_stat_".$m['moduleid']." SET buyer='$nusername' WHERE buyer='$cusername'"); + DB::query("UPDATE ".DT_PRE."mall_stat_".$m['moduleid']." SET seller='$nusername' WHERE seller='$cusername'"); + DB::query("UPDATE ".DT_PRE."mall_comment_".$m['moduleid']." SET buyer='$nusername' WHERE buyer='$cusername'"); + DB::query("UPDATE ".DT_PRE."mall_comment_".$m['moduleid']." SET seller='$nusername' WHERE seller='$cusername'"); + } + if($m['module'] == 'club') { + $tables[] = $m['module'].'_fans_'.$m['moduleid']; + $tables[] = $m['module'].'_group_'.$m['moduleid']; + $tables[] = $m['module'].'_manage_'.$m['moduleid']; + $tables[] = $m['module'].'_reply_'.$m['moduleid']; + } + if($m['module'] == 'job') { + $tables[] = $m['module'].'_resume_'.$m['moduleid']; + $tables[] = $m['module'].'_talent_'.$m['moduleid']; + DB::query("UPDATE ".DT_PRE."job_apply_".$m['moduleid']." SET apply_username='$nusername' WHERE apply_username='$cusername'"); + } + if($m['module'] == 'know') { + $tables[] = $m['module'].'_answer_'.$m['moduleid']; + $tables[] = $m['module'].'_expert_'.$m['moduleid']; + $tables[] = $m['module'].'_vote_'.$m['moduleid']; + } + if($m['module'] == 'quote') { + $tables[] = $m['module'].'_price_'.$m['moduleid']; + } + if($m['module'] == 'exhibit') { + $tables[] = $m['module'].'_sign_'.$m['moduleid']; + } + if($m['module'] == 'special') { + $tables[] = $m['module'].'_item_'.$m['moduleid']; + } + if($m['module'] == 'group') { + DB::query("UPDATE ".DT_PRE."group_order_".$m['moduleid']." SET buyer='$nusername' WHERE buyer='$cusername'"); + DB::query("UPDATE ".DT_PRE."group_order_".$m['moduleid']." SET seller='$nusername' WHERE seller='$cusername'"); + } + } + foreach($tables as $table) { + DB::query("UPDATE ".DT_PRE."{$table} SET username='$nusername' WHERE username='$cusername'"); + } + DB::query("UPDATE ".DT_PRE."chat SET fromuser='$nusername' WHERE fromuser='$cusername'"); + DB::query("UPDATE ".DT_PRE."chat SET touser='$nusername' WHERE touser='$cusername'"); + DB::query("UPDATE ".DT_PRE."order SET buyer='$nusername' WHERE buyer='$cusername'"); + DB::query("UPDATE ".DT_PRE."order SET seller='$nusername' WHERE seller='$cusername'"); + DB::query("UPDATE ".DT_PRE."message SET fromuser='$nusername' WHERE fromuser='$cusername'"); + DB::query("UPDATE ".DT_PRE."message SET touser='$nusername' WHERE touser='$cusername'"); + DB::query("INSERT INTO ".DT_PRE."validate (title,history,type,username,ip,addtime,status,editor,edittime) VALUES ('$nusername','$cusername','username','$nusername','".DT_IP."','".DT_TIME."','3','$_username','".DT_TIME."')"); + userclean($cusername); + return true; + } + + function rename_passport($cpassport, $npassport, $username) { + global $MODULE, $_username; + if($cpassport == $npassport) return false; + if(!$this->is_passport($npassport)) return false; + DB::query("UPDATE ".DT_PRE."member SET passport='$npassport' WHERE passport='$cpassport'"); + DB::query("UPDATE ".DT_PRE."comment SET passport='$npassport' WHERE passport='$cpassport'"); + foreach($MODULE as $m) { + if($m['islink'] || $m['moduleid'] < 5) continue; + if($m['module'] == 'club') { + DB::query("UPDATE ".DT_PRE."club_".$m['moduleid']." SET passport='$npassport' WHERE passport='$cpassport'"); + DB::query("UPDATE ".DT_PRE."club_fans_".$m['moduleid']." SET passport='$npassport' WHERE passport='$cpassport'"); + DB::query("UPDATE ".DT_PRE."club_group_".$m['moduleid']." SET passport='$npassport' WHERE passport='$cpassport'"); + DB::query("UPDATE ".DT_PRE."club_reply_".$m['moduleid']." SET passport='$npassport' WHERE passport='$cpassport'"); + DB::query("UPDATE ".DT_PRE."club_".$m['moduleid']." SET replyer='$npassport' WHERE replyer='$cpassport'"); + } + if($m['module'] == 'know') { + DB::query("UPDATE ".DT_PRE."know_".$m['moduleid']." SET passport='$npassport' WHERE passport='$cpassport'"); + DB::query("UPDATE ".DT_PRE."know_answer_".$m['moduleid']." SET passport='$npassport' WHERE passport='$cpassport'"); + DB::query("UPDATE ".DT_PRE."know_expert_".$m['moduleid']." SET passport='$npassport' WHERE passport='$cpassport'"); + DB::query("UPDATE ".DT_PRE."know_vote_".$m['moduleid']." SET passport='$npassport' WHERE passport='$cpassport'"); + } + } + DB::query("INSERT INTO ".DT_PRE."validate (title,history,type,username,ip,addtime,status,editor,edittime) VALUES ('$npassport','$cpassport','passport','$username','".DT_IP."','".DT_TIME."','3','$_username','".DT_TIME."')"); + userclean($username); + return true; + } + + function move($userid, $groupid) { + global $CFG, $L; + if(is_array($userid)) { + foreach($userid as $v) { $this->move($v, $groupid); } + } else { + $userid = intval($userid); + if($userid == 1 || is_founder($userid)) return $this->_($L['member_founder_move']); + $this->userid = $userid; + $user = $this->get_one(); + if($user) { + DB::query("UPDATE {$this->table_member} SET groupid='$groupid' WHERE userid=$userid"); + DB::query("UPDATE {$this->table_company} SET groupid='$groupid' WHERE userid=$userid"); + userclean($user['username']); + } + + } + return true; + } + + function check($userid) { + if(is_array($userid)) { + foreach($userid as $v) { $this->check($v); } + } else { + $this->userid = $userid; + $user = $this->get_one(); + if($user) { + $groupid = $user['regid'] ? $user['regid'] : 6; + DB::query("UPDATE {$this->table_member} SET groupid=$groupid WHERE userid=$userid"); + DB::query("UPDATE {$this->table_company} SET groupid=$groupid WHERE userid=$userid"); + userclean($user['username']); + } + return true; + } + } + + function login_log($username, $password, $salt, $admin = 0, $message = '') { + global $L; + $password = dpassword($password, $salt); + $port = isset($_SERVER['REMOTE_PORT']) ? intval($_SERVER['REMOTE_PORT']) : ''; + $agent = addslashes(dhtmlspecialchars(strip_sql(strip_tags(DT_UA)))); + $message or $message = $L['member_login_ok']; + if($message == $L['member_login_ok']) cache_delete(DT_IP.'.php', 'ban'); + DB::query("INSERT INTO ".DT_PRE."login (username,password,passsalt,admin,loginip,loginport,logintime,message,agent) VALUES ('$username','$password','$salt','$admin','".DT_IP."','$port','".DT_TIME."','$message','$agent')"); + } + + function check_get() { + $r = DB::get_one("SELECT content FROM {$this->table_member_check} WHERE userid=$this->userid"); + return $r['content'] ? dstripslashes(unserialize($r['content'])) : array(); + } + + function check_add($post) { + if(isset($post['content'])) { + $content = dsafe($post['content']); + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = $content; + } else { + $post = dhtmlspecialchars($post); + } + $content = addslashes(serialize($post)); + DB::query("REPLACE INTO {$this->table_member_check} (userid,username,content,addtime) VALUES ('$this->userid','$this->username','$content','".DT_TIME."')"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/member/message.inc.php b/module/member/message.inc.php new file mode 100644 index 0000000..8ede155 --- /dev/null +++ b/module/member/message.inc.php @@ -0,0 +1,269 @@ + -1) $condition .= " AND typeid=$typeid"; +if($keyword) $condition .= $fields == 'content' ? match_kw('content', $keyword) : match_kw('title', $keyword); +if($style) $condition .= " AND style='$style'"; +$head_title = $L['message_title']; +if($_userid) { + $do = new message; + $MG['inbox_limit'] > -1 or $action = 'close'; + $lists = array(); +} else { + $action = 'guest'; +} +switch($action) { + case 'close': + break; + case 'guest': + break; + case 'send': + $MG['message_limit'] > -1 or dheader(($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).'account.php?action=group&itemid=1'); + $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 dalert(lang($L['message_limit'], array($MG['message_limit'], $limit_used)), 'goback'); + $limit_free = $MG['message_limit'] > $limit_used ? $MG['message_limit'] - $limit_used : 0; + } + + $need_captcha = $MOD['captcha_sendmessage'] == 2 ? $MG['captcha'] : $MOD['captcha_sendmessage']; + if($submit) { + captcha($captcha, $need_captcha); + $post['typeid'] = $typeid; + if($do->send($post)) { + if($forward && strpos($forward, 'message.php') !== false) $forward = '?action=send'; + dmsg(isset($post['save']) ? $L['message_msg_save_draft'] : $L['message_msg_send'], $forward); + } else { + message($do->errmsg); + } + } else { + $touser = isset($touser) ? trim($touser) : ''; + $title = isset($title) ? stripslashes($title) : ''; + $content = isset($content) ? stripslashes($content) : ''; + } + break; + case 'edit': + $itemid or message($L['message_msg_choose']); + $do->itemid = $itemid; + if($submit) { + if($do->edit($message)) { + dmsg(isset($message['send']) ? $L['message_msg_send'] : $L['message_msg_edit_draft'], '?action=draft'); + } else { + message($do->errmsg); + } + } else { + $message = $do->get_one(); + if(!$message || $message['status'] != 1 || $message['fromuser'] != $_username) message($L['message_msg_deny']); + $touser = $message['touser']; + $title = $message['title']; + $content = $message['content']; + $menuid = 'draft'; + } + break; + case 'clear': + $status or message(); + $message = $do->clear($status); + dmsg($L['message_msg_clear'], $forward); + break; + case 'delete': + $itemid or message($L['message_msg_choose']); + $recycle = isset($recycle) ? 0 : 1; + $do->itemid = $itemid; + $do->delete($recycle); + dmsg($L['op_del_success'], $forward); + break; + case 'mark': + $itemid or message($L['message_msg_choose']); + $do->itemid = $itemid; + $do->mark(); + dmsg($L['message_msg_mark'], $forward); + break; + case 'markall': + $message = $do->markall(); + dmsg($L['message_msg_mark'], $forward); + break; + case 'restore': + $itemid or message($L['message_msg_choose']); + $do->itemid = $itemid; + $do->restore(); + dmsg($L['message_msg_restore'], $forward); + break; + case 'color': + $itemid or message(); + $do->itemid = $itemid; + $do->color($style); + dmsg($L['op_set_success'], $forward); + break; + case 'show': + $itemid or message(); + $do->itemid = $itemid; + $message = $do->get_one(); + if(!$message) message($L['message_msg_deny']); + $fback = isset($feedback) ? 1 : 0; + extract($message); + if($status == 4 || $status == 3) { + if($touser != $_username) message($L['message_msg_deny']); + if(!$isread) { + $do->read(); + --$_message; + if($fback && $feedback) $do->feedback($message); + } + } else if($status == 2 || $status == 1) { + if($fromuser != $_username) message($L['message_msg_deny']); + } + require DT_ROOT.'/include/content.class.php'; + $content = DC::format($content, $DT_PC); + $addtime = timetodate($addtime, 5); + if($status == 1) { + $menuid = 'draft'; + } else if($status == 2) { + $menuid = 'outbox'; + } else if($status == 4) { + $menuid = 'recycle'; + } else { + $menuid = 'inbox'; + } + break; + case 'export': + if($submit) { + $do->export($message) or message($do->errmsg); + } else { + $fromdate = timetodate(datetotime('-1 month'), 3); + $todate = timetodate($DT_TIME, 3); + } + break; + case 'empty': + if($submit) { + $message['username'] = $_username; + if($do->_clear($message)) { + dmsg($L['message_msg_empty'], $forward); + } else { + message($do->errmsg); + } + } else { + $fromdate = ''; + $todate = timetodate(datetotime('-1 month'), 3); + } + break; + case 'refuse': + if(!$username) message($L['message_black_username']); + if(!$do->is_member($username)) message($L['message_black_not_member']); + $black = $db->get_one("SELECT black FROM {$DT_PRE}member_misc WHERE userid=$_userid"); + $black = $black['black']; + if($black) { + $tmp = explode(' ', trim($black)); + if(in_array($username, $tmp)) { + message($L['message_black_exist']); + } else { + $black = $black.' '.$username; + } + } else { + $black = $username; + } + $db->query("UPDATE {$DT_PRE}member_misc SET black='$black' WHERE userid=$_userid"); + userclean($_username); + dmsg($L['message_black_update'], '?action=setting'); + break; + case 'setting': + if($submit) { + if($black) { + $blacks = array(); + $tmp = explode(' ', trim($black)); + foreach($tmp as $v) { + if(($do->is_member($v) || $v == 'Guest') && !in_array($v, $blacks)) $blacks[] = $v; + } + $black = $blacks ? implode(' ', $blacks) : ''; + } else { + $black = ''; + } + $send = $send ? 1 : 0; + $db->query("UPDATE {$DT_PRE}member_misc SET black='$black',send='$send' WHERE userid=$_userid"); + userclean($_username); + dmsg($L['op_update_success'], '?action=setting'); + } else { + $head_title = $L['message_title_black'].$DT['seo_delimiter'].$head_title; + $user = $db->get_one("SELECT black,send FROM {$DT_PRE}member_misc WHERE userid=$_userid"); + $could_send = false; + if($DT['message_email'] && $DT['mail_type'] != 'close') { + if(check_group($_groupid, $DT['message_group'])) $could_send = true; + } + } + break; + case 'outbox': + $status = 2; + $name = $L['message_title_outbox']; + $condition = "fromuser='$_username' AND status=$status ".$condition; + $lists = $do->get_list($condition); + break; + case 'draft': + $status = 1; + $name = $L['message_title_draft']; + $condition = "fromuser='$_username' AND status=$status ".$condition; + $lists = $do->get_list($condition); + break; + case 'recycle': + $status = 4; + $name = $L['message_title_recycle']; + $condition = "touser='$_username' AND status=$status ".$condition; + $lists = $do->get_list($condition); + break; + case 'last': + if($_message) { + $item = $db->get_one("SELECT itemid,feedback FROM {$DT_PRE}message WHERE touser='$_username' AND status=3 AND isread=0 ORDER BY itemid DESC"); + if($item) dheader('?action=show&itemid='.$item['itemid'].($item['feedback'] ? '&feedback=1' : '')); + } + dheader('?action=index'); + break; + default: + if($MG['inbox_limit']) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}message WHERE touser='$_username' AND status=3"); + $limit_used = $r['num']; + $limit_free = $MG['inbox_limit'] > $limit_used ? $MG['inbox_limit'] - $limit_used : 0; + if($limit_used >= $MG['inbox_limit']) dalert($L['message_msg_inbox_limit'], '?action=empty'); + } + $status = 3; + $name = $L['message_title_inbox']; + if($_message) $do->fix_message(); + $condition = "touser='$_username' AND status=$status ".$condition; + $lists = $do->get_list($condition); + $systems = $do->get_sys(); + $color_select = ''; + foreach($COLORS as $v) { + $color_select .= ''; + } + break; +} +if($DT_PC) { + // +} else { + $foot = 'message'; + if($action == 'guest' || $action == 'close') { + // + } else if($action == 'send' || $action == 'edit') { + // + } else if($action == 'show') { + // + } else { + if(isset($items)) { + $pages = mobile_pages($items, $page, $pagesize); + if($items) $js_load = '?action='.$action.'&kw='.$kw.'&job=ajax'; + } + } + if($sns_app) $seo_title = ''; +} +include template('message', $module); +?> \ No newline at end of file diff --git a/module/member/news.class.php b/module/member/news.class.php new file mode 100644 index 0000000..1c6e974 --- /dev/null +++ b/module/member/news.class.php @@ -0,0 +1,207 @@ +table = DT_PRE.'news'; + $this->table_data = DT_PRE.'news_data'; + $this->fields = array('title','typeid','level','style','thumb','status','username','addtime','editor','edittime','linkurl','note'); + } + + function news() { + $this->__construct(); + } + + function pass($post) { + global $L; + if(!is_array($post)) return false; + if(!$post['title']) return $this->_($L['pass_title']); + if(!$post['content']) return $this->_($L['pass_content']); + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $_username, $_userid, $_cname; + is_url($post['thumb']) or $post['thumb'] = ''; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + if($this->itemid) { + $new = $post['content']; + if($post['thumb']) $new .= ''; + $r = $this->get_one(); + $old = $r['content']; + if($r['thumb']) $old .= ''; + delete_diff($new, $old); + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = dsafe($content); + if($MOD['news_clear'] || $MOD['news_save']) { + $post['content'] = stripslashes($post['content']); + $post['content'] = save_local($post['content']); + if($MOD['news_clear']) $post['content'] = clear_link($post['content']); + if($MOD['news_save']) $post['content'] = save_remote($post['content']); + $post['content'] = addslashes($post['content']); + } + return array_map("trim", $post); + } + + function get_one($condition = '') { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $t = DB::get_one("SELECT content FROM {$this->table_data} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'addtime DESC') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition"); + $items = $r['num']; + } + $pages = pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['title'] = set_style($r['title'], $r['style']); + $lists[] = $r; + } + return $lists; + } + + function add($post) { + global $MOD, $L; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + DB::query("REPLACE INTO {$this->table_data} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['username'] && $MOD['credit_add_news']) { + credit_add($post['username'], $MOD['credit_add_news']); + credit_record($post['username'], $MOD['credit_add_news'], 'system', $L['news_record_add'], 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'], $this->itemid, $this->table); + return $this->itemid; + } + + function edit($post) { + $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"); + DB::query("REPLACE INTO {$this->table_data} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'], $this->itemid, $this->table); + if($post['status'] > 2) history(2, 'news-'.$this->itemid, 'del'); + return true; + } + + function update($itemid) { + $r = DB::get_one("SELECT username FROM {$this->table} WHERE itemid=$itemid"); + $linkurl = userurl($r['username'], 'file=news&itemid='.$itemid); + return DB::query("UPDATE {$this->table} SET linkurl='$linkurl' 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"); + return true; + } + } + + function restore($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD, $L; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->delete($v); } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + $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"); + DB::query("DELETE FROM {$this->table_data} WHERE itemid=$itemid"); + if($r['username'] && $MOD['credit_del_news']) { + credit_add($r['username'], -$MOD['credit_del_news']); + credit_record($r['username'], -$MOD['credit_del_news'], 'system', $L['news_record_del'], 'ID:'.$this->itemid); + } + history(2, 'news-'.$itemid, 'del'); + } + } + + function check($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid"); + history(2, 'news-'.$itemid, 'del'); + 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',edittime=".DT_TIME." WHERE itemid=$itemid"); + return true; + } + } + + function clear() { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE status=0"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/member/oauth.inc.php b/module/member/oauth.inc.php new file mode 100644 index 0000000..f18c7af --- /dev/null +++ b/module/member/oauth.inc.php @@ -0,0 +1,78 @@ +get_one("SELECT * FROM {$DT_PRE}oauth WHERE itemid=$itemid"); + if(!$U || $U['username'] != $_username) message(); + $db->query("DELETE FROM {$DT_PRE}oauth WHERE itemid=$itemid"); + dmsg($L['oauth_quit'], '?action=index'); + break; + case 'bind': + $avatar = ''; + if(!$_userid) { + $auth = decrypt(get_cookie('bind'), DT_KEY.'BIND'); + $openid = decrypt(get_cookie('weixin_openid'), DT_KEY.'WXID'); + if(is_openid($openid) && in_array($DT_MBS, array('weixin', 'wxxcx'))) { + $U = $db->get_one("SELECT * FROM {$DT_PRE}weixin_user WHERE openid='$openid'"); + if($U) { + $OAUTH = cache_read('oauth.php'); + $nohead = DT_PATH.'api/weixin/image/headimg.jpg'; + $avatar = $U['headimgurl'] ? $U['headimgurl'] : $nohead; + $nickname = $U['nickname'] ? $U['nickname'] : 'USER'; + $site = $OAUTH['wechat']['name']; + $connect = DT_MOB.'api/weixin.php?action=connect'; + } + } else if(strpos($auth, '|') !== false) { + $t = explode('|', $auth); + $itemid = intval($t[0]); + $U = $db->get_one("SELECT * FROM {$DT_PRE}oauth WHERE itemid=$itemid"); + if($U && $U['site'] = $t[1]) { + $OAUTH = cache_read('oauth.php'); + $nohead = DT_PATH.'api/oauth/avatar.png'; + $avatar = $U['avatar'] ? $U['avatar'] : $nohead; + $nickname = $U['nickname'] ? $U['nickname'] : 'USER'; + $site = $OAUTH[$U['site']]['name']; + $connect = DT_PATH.'api/oauth/'.$U['site'].'/connect.php'; + } + } + } + $avatar or dheader($DT_PC ? 'index.php' : DT_MOB.'my.php'); + $head_title = $L['oauth_bind']; + break; + default: + login(); + $MOD['oauth'] or dheader('index.php'); + $lists = $tags = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}oauth WHERE username='$_username' ORDER BY logintime DESC"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['logindate'] = timetodate($r['logintime'], 5); + $r['nickname'] or $r['nickname'] = '-'; + $tags[$r['site']][] = $r; + } + foreach($tags as $kk=>$vv) { + foreach($vv as $k=>$v) { + if($k) { + $db->query("UPDATE {$DT_PRE}oauth SET username='' WHERE itemid=$v[itemid]"); + } else { + $lists[$kk] = $v; + } + } + } + $OAUTH = cache_read('oauth.php'); + $head_title = $L['oauth_title']; + break; +} +if($DT_PC) { + // +} else { + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : ''); + $head_name = $head_title; +} +include template('oauth', $module); +?> \ No newline at end of file diff --git a/module/member/order.inc.php b/module/member/order.inc.php new file mode 100644 index 0000000..c0b8997 --- /dev/null +++ b/module/member/order.inc.php @@ -0,0 +1,502 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); + $td or message($L['trade_msg_null']); + if($td['buyer'] != $_username || $td['pid'] > 0) message($L['trade_msg_deny']); + $td['total'] = $td['amount'] + $td['fee']; + $td['total'] = number_format($td['total'], 2, '.', ''); + $td['money'] = $td['amount'] + $td['discount']; + $td['money'] = number_format($td['money'], 2, '.', ''); + $td['adddate'] = timetodate($td['addtime'], 5); + $td['updatedate'] = timetodate($td['updatetime'], 5); + $td['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$td['mid'].'&itemid='.$td['mallid']; + $td['par'] = ''; + if(strpos($td['note'], '|') !== false) list($td['note'], $td['par']) = explode('|', $td['note']); + $lists = array($td); + if(($td['amount'] + $td['discount']) > $td['price']*$td['number']) { + $result = $db->query("SELECT * FROM {$table} WHERE pid=$itemid ORDER BY itemid DESC"); + while($r = $db->fetch_array($result)) { + $r['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$r['mid'].'&itemid='.$r['mallid']; + $r['par'] = ''; + if(strpos($r['note'], '|') !== false) list($r['note'], $r['par']) = explode('|', $r['note']); + $lists[] = $r; + } + } + $mallid = $td['mallid']; + switch($step) { + case 'detail'://订单详情 + $logs = array(); + $result = $db->query("SELECT * FROM {$table_log} WHERE oid=$itemid ORDER BY itemid DESC"); + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $logs[] = $r; + } + $auth = encrypt('mall|'.$td['send_type'].'|'.$td['send_no'].'|'.$td['send_status'].'|'.$td['buyer_mobile'].'|'.$td['itemid'], DT_KEY.'EXPRESS'); + $head_title = $L['trade_detail_title']; + break; + case 'express'://快递追踪 + ($td['send_type'] && $td['send_no']) or dheader('?action=update&step=detail&itemid='.$itemid); + $auth = encrypt('mall|'.$td['send_type'].'|'.$td['send_no'].'|'.$td['send_status'].'|'.$td['buyer_mobile'].'|'.$td['itemid'], DT_KEY.'EXPRESS'); + $head_title = $L['trade_exprss_title']; + break; + case 'pay'://买家付款 + if($td['status'] == 2) dmsg($L['trade_pay_order_success'], '?nav=2&itemid='.$itemid); + if($td['status'] == 0) message($L['trade_msg_confirm'], '?action=update&step=detail&itemid='.$itemid); + if($td['status'] != 1) message($L['trade_msg_deny']); + $money = $td['amount'] + $td['fee']; + $money > 0 or message($L['trade_msg_deny']); + $seller = userinfo($td['seller']); + $auto = 0; + $auth = isset($auth) ? decrypt($auth, DT_KEY.'CG') : ''; + if($auth && substr($auth, 0, 6) == 'trade|') { + $_itemid = intval(substr($auth, 6)); + if($_itemid == $itemid) $auto = $submit = 1; + } + $could_pay = 1; + foreach($lists as $k=>$v) { + if(!stock_check($v)) { + $could_pay = $submit = 0; + break; + } + } + if($submit) { + $money <= $_money or message($L['money_not_enough']); + if($money <= $DT['quick_pay']) $auto = 1; + if(!$auto) { + is_payword($_username, $password) or message($L['error_payword']); + } + money_add($_username, -$money); + money_record($_username, -$money, $L['in_site'], 'system', $L['trade_pay_order_title'], $L['trade_order_id'].$itemid); + foreach($lists as $k=>$v) { + $db->query("UPDATE {$table} SET status=2,updatetime=$DT_TIME WHERE itemid=$v[itemid]"); + } + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_pay]','')"); + $touser = $td['seller']; + $title = lang($L['trade_message_t2'], array($itemid)); + $url = $memberurl.'trade.php?itemid='.$itemid; + $content = lang($L['trade_message_c2'], array($myurl, $_username, $timenow, $url)); + $content = ob_template('messager', 'mail'); + send_message($touser, $title, $content); + //send sms + if($DT['sms'] && $_sms && $touser && isset($sendsms)) { + $touser = userinfo($touser); + if($touser['mobile']) { + $message = lang('sms->ord_pay', array($itemid, $money)); + $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['trade_sms_pay'], $itemid); + } + } + } + } + //send sms + //更新商品数据 + foreach($lists as $k=>$v) { + $sql = "orders=orders+1"; + if(is_skuid($v['skuid'])) { + stock_update(0, $v['skuid'], $v['seller'], -$v['number'], $v['buyer'], $L['stock_pay'], $L['stock_no'].$itemid); + } else { + $sql .= ",amount=amount-$v[number]"; + } + if($MODULE[$v['mid']]['module'] == 'mall') $sql .= ",sales=sales+$v[number]"; + $db->query("UPDATE ".get_table($v['mid'])." SET {$sql} WHERE itemid=$v[mallid]"); + } + dmsg($L['trade_pay_order_success'], '?nav=2&itemid='.$itemid); + } else { + $head_title = $L['trade_pay_order_title']; + } + break; + case 'refund'://买家退款 + $gone = $DT_TIME - $td['updatetime']; + if(!in_array($td['status'], array(2, 3))) message($L['trade_msg_deny']); + if($td['status'] == 3 && $gone > ($MOD['trade_day']*86400 + $td['add_time']*3600)) message($L['trade_msg_deny']); + $money = $td['amount'] + $td['fee']; + if($submit) { + $content or message($L['trade_refund_reason']); + clear_upload($content, $itemid, $table); + $content = dsafe(addslashes(save_remote(save_local(stripslashes($content))))); + is_payword($_username, $password) or message($L['error_payword']); + foreach($lists as $k=>$v) { + $db->query("UPDATE {$table} SET status=5,updatetime=$DT_TIME,buyer_reason='$content' WHERE itemid=$v[itemid]"); + } + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_refund]','')"); + message($L['trade_refund_success'], $forward, 3); + } else { + $head_title = $L['trade_refund_title']; + } + break; + case 'remind'://买家提醒卖家发货 + if($td['status'] != 2) message($L['trade_msg_deny']); + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_remind]','')"); + break; + case 'receive_goods'://确认收货 + $gone = $DT_TIME - $td['updatetime']; + if($td['status'] != 3 || $gone > ($MOD['trade_day']*86400 + $td['add_time']*3600)) message($L['trade_msg_deny']); + //交易成功 + $money = $td['amount'] + $td['fee']; + money_add($td['seller'], $money); + money_record($td['seller'], $money, $L['in_site'], 'system', $L['trade_record_pay'], $L['trade_order_id'].$itemid); + //网站服务费 + $G = $db->get_one("SELECT groupid FROM {$DT_PRE}member WHERE username='".$td['seller']."'"); + $SG = cache_read('group-'.$G['groupid'].'.php'); + if($SG['commission']) { + $fee = dround($money*$SG['commission']/100); + if($fee > 0) { + money_add($td['seller'], -$fee); + money_record($td['seller'], -$fee, $L['in_site'], 'system', $L['trade_fee'], $L['trade_order_id'].$itemid); + } + } + foreach($lists as $k=>$v) { + $db->query("UPDATE {$table} SET status=4,updatetime=$DT_TIME WHERE itemid=$v[itemid]"); + } + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_get]','')"); + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_success]','')"); + $touser = $td['seller']; + $title = lang($L['trade_message_t4'], array($itemid)); + $url = $memberurl.'trade.php?itemid='.$itemid; + $content = lang($L['trade_message_c4'], array($myurl, $_username, $timenow, $url)); + $content = ob_template('messager', 'mail'); + send_message($touser, $title, $content); + + message($L['trade_success'], $forward, 3); + break; + case 'comment'://交易评价 + if($MODULE[$td['mid']]['module'] != 'mall') message($L['trade_msg_deny_comment']); + if($submit) { + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_buyer_coment]','')"); + $uploads = ''; + foreach($lists as $k=>$v) { + $mid = $v['mid']; + $itemid = $v['itemid']; + $mallid = $v['mallid']; + $star = intval($stars[$itemid]); + in_array($star, array(1, 2, 3, 4, 5)) or $star = 5; + $star_express = intval($stars_express[$itemid]); + in_array($star_express, array(1, 2, 3, 4, 5)) or $star_express = 5; + $star_service = intval($stars_service[$itemid]); + in_array($star_service, array(1, 2, 3, 4, 5)) or $star_service = 5; + $thumb = ''; + foreach($thumbs[$itemid] as $v) { + if(is_url($v)) $thumb .= '|'.$v; + } + if($thumb) { + $uploads .= $thumb; + $thumb = substr($thumb, 1); + } + $video = is_url($videos[$itemid]) ? $videos[$itemid] : ''; + if($video) $uploads .= $video; + $hidden = isset($hiddens[$itemid]) ? 1 : 0; + $content = dhtmlspecialchars(banword($BANWORD, $contents[$itemid], false)); + $db->query("UPDATE ".get_table($mid)." SET comments=comments+1 WHERE itemid=$mallid"); + $db->query("UPDATE {$table} SET seller_star=$star WHERE itemid=$itemid"); + $s = 's'.$star; + $db->query("UPDATE {$DT_PRE}mall_comment_".$mid." SET seller_star=$star,seller_star_express=$star_express,seller_star_service=$star_service,seller_comment='$content',seller_thumbs='$thumb',seller_video='$video',seller_ctime=$DT_TIME,buyer_hidden=$hidden WHERE itemid=$itemid"); + $db->query("UPDATE {$DT_PRE}mall_stat_".$mid." SET scomment=scomment+1,`$s`=`$s`+1 WHERE mallid=$mallid"); + } + clear_upload($uploads, $itemid); + message($L['trade_msg_comment_success'], $forward); + } + $head_title = $L['trade_comment_title']; + break; + case 'comment_detail'://评价详情 + if($MODULE[$td['mid']]['module'] != 'mall') message($L['trade_msg_deny_comment']); + $comments = $O = $C = array(); + foreach($lists as $k=>$v) { + $id = $v['itemid']; + $c = $db->get_one("SELECT * FROM {$DT_PRE}mall_comment_$v[mid] WHERE itemid=$id"); + $c['seller_thumbs'] = $c['seller_thumbs'] ? explode('|', $c['seller_thumbs']) : array(); + $comments[$k] = $c; + $O[$id] = $v; + $C[$id] = $c; + } + if($submit) { + $oid = intval($oid); + if(isset($C[$oid])) { + $content = dhtmlspecialchars(banword($BANWORD, $content, false)); + $content or message($L['trade_msg_empty_explain']); + if($C[$oid]['seller_reply']) message($L['trade_msg_explain_again']); + $db->query("UPDATE {$DT_PRE}mall_comment_".$O[$oid]['mid']." SET seller_reply='$content',seller_rtime=$DT_TIME WHERE itemid=$oid"); + dmsg($L['trade_msg_explain_success'], '?action='.$action.'&step='.$step.'&itemid='.$itemid); + } + } + $head_title = $L['trade_comment_show_title']; + break; + case 'close'://关闭交易 + if($td['status'] == 0) { + foreach($lists as $k=>$v) { + $db->query("UPDATE {$table} SET status=8,updatetime=$DT_TIME WHERE itemid=$v[itemid]"); + } + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_buyer_close]','')"); + dmsg($L['trade_close_success'], $forward); + } else if($td['status'] == 1) { + foreach($lists as $k=>$v) { + $db->query("UPDATE {$table} SET status=8,updatetime=$DT_TIME WHERE itemid=$v[itemid]"); + } + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_buyer_close]','')"); + dmsg($L['trade_close_success'], $forward); + } else if($td['status'] == 9) { + foreach($lists as $k=>$v) { + $db->query("DELETE FROM {$table} WHERE itemid=$v[itemid]"); + if($MODULE[$v['mid']]['module'] == 'mall') $db->query("DELETE FROM {$DT_PRE}mall_comment_{$v[mid]} WHERE itemid=$v[itemid]"); + } + $db->query("DELETE FROM {$table_log} WHERE oid=$itemid"); + dmsg($L['trade_delete_success'], $forward); + } else { + message($L['trade_msg_deny']); + } + break; + } +} else if($action == 'muti') {//批量付款 + $auto = 0; + $auth = isset($auth) ? decrypt($auth, DT_KEY.'CG') : ''; + if($auth && substr($auth, 0, 7) == 'trades|') { + $auto = $submit = 1; + $itemid = explode(',', substr($auth, 7)); + } + if($submit) { + ($itemid && is_array($itemid)) or message($L['trade_msg_muti_choose']); + $itemids = implode(',', $itemid); + $condition = "pid=0 AND buyer='$_username' AND status=1 AND itemid IN ($itemids)"; + $tds = array(); + $money = 0; + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY itemid DESC LIMIT 50"); + while($r = $db->fetch_array($result)) { + $money += ($r['amount'] + $r['fee']); + $tds[] = $r; + } + $money <= $_money or message($L['money_not_enough']); + if($money <= $DT['quick_pay']) $auto = 1; + if(!$auto) { + is_payword($_username, $password) or message($L['error_payword']); + } + foreach($tds as $td) { + $itemid = $td['itemid']; + $mallid = $td['mallid']; + $money = $td['amount'] + $td['fee']; + $seller = userinfo($td['seller']); + $lists = get_orders($itemid); + foreach($lists as $k=>$v) { + if(!stock_check($v)) message($v['title'].$L['stock_less']); + } + money_add($_username, -$money); + money_record($_username, -$money, $L['in_site'], 'system', $L['trade_pay_order_title'], $L['trade_order_id'].$itemid); + foreach($lists as $k=>$v) { + $db->query("UPDATE {$table} SET status=2,updatetime=$DT_TIME WHERE itemid=$v[itemid]"); + } + $db->query("INSERT INTO {$table_log} (oid,addtime,title,note) VALUES ('$itemid','$DT_TIME','$L[log_pay]','')"); + $touser = $td['seller']; + $title = lang($L['trade_message_t2'], array($itemid)); + $url = $memberurl.'trade.php?itemid='.$itemid; + $content = lang($L['trade_message_c2'], array($myurl, $_username, $timenow, $url)); + $content = ob_template('messager', 'mail'); + send_message($touser, $title, $content); + //send sms + if($DT['sms'] && $_sms && $touser && isset($sendsms)) { + $touser = userinfo($touser); + if($touser['mobile']) { + $message = lang('sms->ord_pay', array($itemid, $money)); + $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['trade_sms_pay'], $itemid); + } + } + } + } + //send sms + //更新商品数据 + foreach($lists as $k=>$v) { + $sql = "orders=orders+1"; + if(is_skuid($v['skuid'])) { + stock_update(0, $v['skuid'], $v['seller'], -$v['number'], $v['buyer'], $L['stock_pay'], $L['stock_no'].$itemid); + } else { + $sql .= ",amount=amount-$v[number]"; + } + if($MODULE[$v['mid']]['module'] == 'mall') $sql .= ",sales=sales+$v[number]"; + $db->query("UPDATE ".get_table($v['mid'])." SET {$sql} WHERE itemid=$v[mallid]"); + } + } + dmsg($L['trade_pay_order_success'], '?nav=2'); + } else { + $ids = isset($ids) ? explode(',', $ids) : array(); + if($ids) $ids = array_map('intval', $ids); + $condition = "pid=0 AND buyer='$_username' AND status=1"; + if($ids) $condition .= " AND itemid IN (".implode(',', $ids).")"; + $lists = $pids = array(); + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY itemid DESC LIMIT 50"); + while($r = $db->fetch_array($result)) { + if(!stock_check($r)) continue; + if($r['amount'] > $r['price']*$r['number']) $pids[] = $r['itemid']; + $r['addtime'] = timetodate($r['addtime'], 5); + $r['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$r['mid'].'&itemid='.$r['mallid']; + $r['par'] = ''; + if(strpos($r['note'], '|') !== false) list($r['note'], $r['par']) = explode('|', $r['note']); + $r['dstatus'] = $_status[$r['status']]; + $r['money'] = $r['amount'] + $r['fee']; + $r['money'] = number_format($r['money'], 2, '.', ''); + $lists[$r['itemid']] = $r; + } + if($pids) { + $result = $db->query("SELECT * FROM {$table} WHERE pid IN (".implode(',', $pids).") ORDER BY itemid DESC"); + while($r = $db->fetch_array($result)) { + if(!stock_check($r)) { + unset($lists[$r['pid']]); + continue; + } + $r['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$r['mid'].'&itemid='.$r['mallid']; + $r['par'] = ''; + if(strpos($r['note'], '|') !== false) list($r['note'], $r['par']) = explode('|', $r['note']); + $tags[$r['pid']][] = $r; + } + } + if(!$lists) { + if($ids) dmsg($L['trade_pay_order_success'], '?nav=2'); + message($L['trade_msg_muti_empty'], '?nav=1', 5); + } + $itemids = ''; + foreach($lists as $k=>$v) { + $itemids .= ','.$k; + } + if($itemids) $itemids = substr($itemids, 1); + $head_title = $L['trade_muti_title']; + } +} else if($action == 'express') {//我的快递 + $sfields = $L['express_sfields']; + $dfields = array('title', 'title', 'send_type ', 'send_no'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $status = isset($status) && isset($dsend_status[$status]) ? intval($status) : ''; + $fields_select = dselect($sfields, 'fields', '', $fields); + $status_select = dselect($dsend_status, 'status', $L['status'], $status, '', 1, '', 1); + $condition = "pid=0 AND send_no<>'' AND buyer='$_username'"; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($status !== '') $condition .= " AND send_status='$status'"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = $pids = array(); + $result = $db->query("SELECT * FROM {$table} WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + if($r['amount'] > $r['price']*$r['number']) $pids[] = $r['itemid']; + $r['addtime'] = timetodate($r['addtime'], 5); + $r['updatetime'] = timetodate($r['updatetime'], 5); + $r['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$r['mid'].'&itemid='.$r['mallid']; + $r['dstatus'] = $_send_status[$r['send_status']]; + $lists[] = $r; + } + $head_title = $L['express_title']; +} else { + $sfields = $L['trade_order_sfields']; + $dfields = array('title', 'title ', 'amount', 'fee', 'fee_name', 'seller', 'send_type', 'send_no', 'note'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $mallid = isset($mallid) ? intval($mallid) : 0; + $mallid or $mallid = ''; + $itemid or $itemid = ''; + $cod = isset($cod) ? intval($cod) : 0; + $nav = isset($nav) ? intval($nav) : -1; + (isset($seller) && check_name($seller)) or $seller = ''; + (isset($fromdate) && is_time($fromdate)) or $fromdate = ''; + $fromtime = is_date($fromdate) ? datetotime($fromdate.' 0:0:0') : 0; + (isset($todate) && is_time($todate)) or $todate = ''; + $totime = is_date($todate) ? datetotime($todate.' 23:59:59') : 0; + $status = isset($status) && isset($dstatus[$status]) ? intval($status) : ''; + $condition = "buyer='$_username'"; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($fromtime) $condition .= " AND addtime>=$fromtime"; + if($totime) $condition .= " AND addtime<=$totime"; + if($status !== '') $condition .= " AND status='$status'"; + if($itemid) $condition .= " AND itemid='$itemid'"; + if($mallid) $condition .= " AND mallid=$mallid"; + if($seller) $condition .= " AND seller='$seller'"; + if($cod) $condition .= " AND cod=1"; + if(in_array($nav, array(0,1,2,3,5,6))) { + $condition .= " AND status=$nav"; + $status = $nav; + } else if($nav == 4) { + $condition .= " AND status=$nav AND seller_star=0"; + $status = $nav; + } + $fields_select = dselect($sfields, 'fields', '', $fields); + $status_select = dselect($dstatus, 'status', $L['status'], $status, '', 1, '', 1); + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE $condition"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = $tags = $pids = array(); + $amount = $fee = $money = 0; + $result = $db->query("SELECT pid,itemid FROM {$table} WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + $pid = $r['pid'] ? $r['pid'] : $r['itemid']; + $pids[$pid] = $pid; + } + if($pids) { + $result = $db->query("SELECT * FROM {$table} WHERE itemid IN (".implode(',', $pids).") ORDER BY itemid DESC"); + while($r = $db->fetch_array($result)) { + $r['gone'] = $DT_TIME - $r['updatetime']; + if($r['status'] == 3) { + if($r['gone'] > ($MOD['trade_day']*86400 + $r['add_time']*3600)) { + $r['lefttime'] = 0; + } else { + $r['lefttime'] = secondstodate($MOD['trade_day']*86400 + $r['add_time']*3600 - $r['gone']); + } + } + $r['par'] = ''; + if(strpos($r['note'], '|') !== false) list($r['note'], $r['par']) = explode('|', $r['note']); + $r['addtime'] = timetodate($r['addtime'], $DT_PC ? 5 : 3); + $r['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$r['mid'].'&itemid='.$r['mallid']; + $r['dstatus'] = $_status[$r['status']]; + $r['money'] = $r['amount'] + $r['fee']; + $r['money'] = number_format($r['money'], 2, '.', ''); + $amount += $r['amount']; + $fee += $r['fee']; + $lists[] = $r; + } + $result = $db->query("SELECT * FROM {$table} WHERE pid IN (".implode(',', $pids).") ORDER BY itemid DESC"); + while($r = $db->fetch_array($result)) { + $r['par'] = ''; + if(strpos($r['note'], '|') !== false) list($r['note'], $r['par']) = explode('|', $r['note']); + $r['linkurl'] = ($DT_PC ? DT_PATH : DT_MOB).'api/redirect.php?mid='.$r['mid'].'&itemid='.$r['mallid']; + $tags[$r['pid']][] = $r; + } + } + $money = $amount + $fee; + $money = number_format($money, 2, '.', ''); + $head_title = $L['trade_order_title']; +} +if($DT_PC) { + // +} else { + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : ''); + $head_name = $head_title; +} +include template('order', $module); +?> \ No newline at end of file diff --git a/module/member/pay.inc.php b/module/member/pay.inc.php new file mode 100644 index 0000000..fd7944d --- /dev/null +++ b/module/member/pay.inc.php @@ -0,0 +1,85 @@ + 4 && isset($MODULE[$mid]) && !$MODULE[$mid]['islink']) or dheader($DT_PC ? DT_PATH : DT_MOB); +$moduleid = $mid; +$MOD = cache_read('module-'.$mid.'.php'); +$itemid or dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); +$table = $MOD['module'] == 'job' ? $DT_PRE.'job_resume_'.$mid : get_table($mid); +$item = $db->get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3) dheader($DT_PC ? $MOD['linkurl'] : $MOD['mobile']); +$title = $item['title']; +$username = $item['username']; +if($MOD['module'] == 'know') { + $aid = intval($item['aid']); + $best = $aid ? $db->get_one("SELECT * FROM {$DT_PRE}know_answer_{$mid} WHERE itemid=$aid") : array(); + if($best && $best['username']) $username = $best['username']; +} +if($_username == $username) message($L['pay_msg_self']); + +$fee = DC::fee($item['fee'], $MOD['fee_view']); +$currency = $MOD['fee_currency']; +$unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; +$name = $currency == 'money' ? $DT['money_name'] : $DT['credit_name']; +$fee_back = min(abs(dround($MOD['fee_back'])), 100); +$fee_back = $currency == 'money' ? dround($fee*$fee_back/100) : ceil($fee*$fee_back/100); +$forward = strpos($item['linkurl'], '://') === false ? ($DT_PC ? $MOD['linkurl'] : $MOD['mobile']).$item['linkurl'] : $item['linkurl']; +$note = $MOD['name'].($MOD['module'] == 'job' ? $L['resume_name'] : '').':'.$itemid; +($fee && !check_pay($mid, $itemid)) or dheader($forward); +if($currency == 'credit') { + $fee = intval($fee); + if($_credit >= $fee) { + $db->query("INSERT INTO {$DT_PRE}finance_pay (mid,tid,username,fee,currency,paytime,ip,title) VALUES ('$mid','$itemid','$_username','$fee','$currency','$DT_TIME','$DT_IP','".addslashes($title)."')"); + credit_add($_username, -$fee); + credit_record($_username, -$fee, 'system', $L['pay_record_view'], $note); + if($username && $fee_back) { + credit_add($username, $fee_back); + credit_record($username, $fee_back, 'system', $L['pay_record_back'], $note); + } + message($L['pay_msg_success'], $forward); + } else { + dheader('credit.php?action=buy'); + } +} +$discount = $MG['discount'] > 0 && $MG['discount'] < 100 ? $MG['discount'] : 100; +$discount = dround($discount/100); +$auto = 0; +$auth = isset($auth) ? decrypt($auth, DT_KEY.'CG') : ''; +if($auth && $auth == 'pay|'.$mid.'|'.$itemid) { + $auto = $submit = 1; +} +if($submit) { + $fee = dround($fee*$discount); + $fee > 0 or message($L['pay_msg_fee']); + $fee <= $_money or message($L['money_not_enough']); + if($fee <= $DT['quick_pay']) $auto = 1; + if(!$auto) { + is_payword($_username, $password) or message($L['error_payword']); + } + money_add($_username, -$fee); + money_record($_username, -$fee, $L['in_site'], 'system', $L['pay_record_view'], $note); + if($username && $fee_back) { + if($MOD['module'] == 'know') { + $aid = intval($item['aid']); + $best = $aid ? $db->get_one("SELECT * FROM {$DT_PRE}know_answer_{$mid} WHERE itemid=$aid") : array(); + if($best && $best['username']) $username = $best['username']; + } + money_add($username, $fee_back); + money_record($username, $fee_back, $L['in_site'], 'system', $L['pay_record_back'], $note); + } + $db->query("INSERT INTO {$DT_PRE}finance_pay (mid,tid,username,fee,currency,paytime,ip,title) VALUES ('$mid','$itemid','$_username','$fee','$currency','$DT_TIME','$DT_IP','".addslashes($title)."')"); + message($L['pay_msg_success'], $forward); +} else { + $head_title = $L['pay_title']; + if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MODULE[2]['linkurl'], $MODULE[2]['mobile'], $DT_URL); + } else { + $head_name = $head_title; + } + $member_fee = dround($fee*$discount); + include template('pay', $module); +} +?> \ No newline at end of file diff --git a/module/member/profile.inc.php b/module/member/profile.inc.php new file mode 100644 index 0000000..78d832c --- /dev/null +++ b/module/member/profile.inc.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/module/member/spread.inc.php b/module/member/spread.inc.php new file mode 100644 index 0000000..b9deb77 --- /dev/null +++ b/module/member/spread.inc.php @@ -0,0 +1,137 @@ + 3 && isset($MODULE[$mid]) && !$MODULE[$mid]['islink']) { + $word = dhtmlspecialchars(trim($word)); + $this_month = date('n', $DT_TIME); + $this_year = date('Y', $DT_TIME); + $next_month = $this_month == 12 ? 1 : $this_month + 1; + $next_year = $this_month == 12 ? $this_year + 1 : $this_year; + $next_time = datetotime($next_year.'-'.$next_month.'-1'); + $spread_max = $EXT['spread_max'] ? $EXT['spread_max'] : 10; + $currency = $EXT['spread_currency']; + $unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; + $r = $db->get_one("SELECT * FROM {$DT_PRE}spread WHERE username='$_username' AND mid=$mid AND word='$word' AND fromtime>=$next_time"); + if($r) message($L['spread_msg_buy'], $DT_PC ? $EXT['spread_url'] : $EXT['spread_mob']); + $mid or $mid = 5; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}spread WHERE mid=$mid AND status=3 AND word='$word' AND fromtime>=$next_time"); + if($r['num'] > $spread_max) message(lang($L['spread_msg_over'], array($word)), $DT_PC ? $EXT['spread_url'] : $EXT['spread_mob']); + + $price = dround($EXT['spread_price']); + $p1 = $db->get_one("SELECT * FROM {$DT_PRE}spread_price WHERE mid=$mid AND word='$word' ORDER BY edittime DESC"); + if($p1) { + $price = $p1['price']; + } else { + $p2 = $db->get_one("SELECT * FROM {$DT_PRE}spread_price WHERE mid=$mid AND word='' ORDER BY edittime DESC"); + if($p2) $price = $p2['price']; + } + $step = intval($EXT['spread_step']); + $month = intval($EXT['spread_month']); + $month > 0 or $month = 1; + $auto = 0; + $auth = isset($auth) ? decrypt($auth, DT_KEY.'CG') : ''; + if($auth && substr($auth, 0, 7) == 'spread|') { + $auto = $submit = 1; + $tmp = explode('|', $auth); + $buy_price = dround($tmp[3]); + $buy_month = intval($tmp[4]); + $buy_tid = intval($tmp[5]); + } + if($submit) { + $buy_price = dround($buy_price); + if($buy_price < $price) message($L['spread_msg_price_min']); + if($step > 0 && ($buy_price - $price)%$step != 0) message($L['spread_msg_step']); + $buy_month = intval($buy_month); + if($buy_month < 1 || $buy_month > $month) message($L['spread_msg_month']); + $amount = $buy_price*$buy_month; + if($currency == 'money') { + $amount <= $_money or message($L['money_not_enough']); + if($amount <= $DT['quick_pay']) $auto = 1; + if(!$auto) { + is_payword($_username, $password) or message($L['error_payword']); + } + } else { + $amount <= $_credit or message($L['credit_not_enough'], 'credit.php?action=buy&amount='.($amount-$_credit)); + } + $buy_tid = $mid == 4 ? $_userid : intval($buy_tid); + if(!$buy_tid) message($L['spread_msg_itemid']); + if($mid == 5 || $mid == 6 || $mid == 16) { + $table = get_table($mid); + $item = $db->get_one("SELECT itemid FROM {$table} WHERE itemid='$buy_tid' AND status=3 AND username='$_username'"); + if(!$item) message($L['spread_msg_yours']); + } + $months = $next_month + $buy_month; + $year = floor($months/12); + if($months%12 == 0) { + $to_month = 12; + $to_year = $next_year + $year - 1; + } else { + $to_month = $months%12; + $to_year = $next_year + $year; + } + $totime = datetotime($to_year.'-'.$to_month.'-1'); + $status = $EXT['spread_check'] ? 2 : 3; + if($currency == 'money') { + money_add($_username, -$amount); + money_record($_username, -$amount, $L['in_site'], 'system', $MODULE[$mid]['name'].$L['spread_title'], $word.'('.$L['spread_infoid'].$buy_tid.')'); + } else { + credit_add($_username, -$amount); + credit_record($_username, -$amount, 'system', $MODULE[$mid]['name'].$L['spread_title'], $word.'(ID:'.$buy_tid.')'); + } + $db->query("INSERT INTO {$DT_PRE}spread (mid,tid,word,price,currency,company,username,addtime,fromtime,totime,status) VALUES ('$mid','$buy_tid','$word','$buy_price','$currency','$_company','$_username','$DT_TIME','$next_time','$totime','$status')"); + dmsg($L['spread_msg_success'], '?status='.$status); + } else { + // + } + } else { + dheader('?action=list&mid='.$mid); + } +} else if($action == 'list') { +} else { + $status = isset($status) ? intval($status) : 3; + in_array($status, array(2, 3)) or $status = 3; + $condition = "username='$_username' AND status=$status"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}spread WHERE $condition"); + $items = $r['num']; + $pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); + $lists = array(); + $result = $db->query("SELECT * FROM {$DT_PRE}spread WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize"); + while($r = $db->fetch_array($result)) { + if($r['totime'] < $DT_TIME) { + $r['process'] = $L['status_expired']; + } else if($r['fromtime'] > $DT_TIME) { + $r['process'] = $L['status_not_start']; + } else { + $r['process'] = $L['status_displaying']; + } + $r['days'] = $r['totime'] > $DT_TIME ? intval(($r['totime']-$DT_TIME)/86400) : 0; + $lists[] = $r; + } +} +$head_title = $L['spread_title']; +$nums = array(); +for($i = 2; $i < 4; $i++) { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}spread WHERE username='$_username' AND status=$i"); + $nums[$i] = $r['num']; +} +if($DT_PC) { + // +} else { + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'biz.php'); + $head_name = $head_title; +} +include template('spread', $module); +?> \ No newline at end of file diff --git a/module/member/style.inc.php b/module/member/style.inc.php new file mode 100644 index 0000000..cea75f9 --- /dev/null +++ b/module/member/style.inc.php @@ -0,0 +1,189 @@ +itemid = $itemid; + $r = $do->get_one(); + $r or message($L['style_msg_not_exist']); + if($r['groupid']) { + $groupids = explode(',', $r['groupid']); + if(!in_array($_groupid, $groupids)) message($L['style_msg_group']); + } + if(!$r['fee'] || $itemid == $MG['styleid']) { + $styleid = $itemid == $MG['styleid'] ? 0 : $itemid; + $db->query("UPDATE {$table} SET hits=hits+1 WHERE itemid=$itemid"); + $db->query("UPDATE {$DT_PRE}company SET styletime=0,styleid=$styleid WHERE userid=$_userid"); + userclean($_username); + dmsg($L['style_msg_use_success'], '?action=order'); + } + $currency = $r['currency']; + $months = array(1, 2, 3, 6, 12, 24, 36, 48, 60); + $unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; + $auto = 0; + $auth = isset($auth) ? decrypt($auth, DT_KEY.'CG') : ''; + if($auth && substr($auth, 0, 6) == 'style|') { + $auto = $submit = 1; + $tmp = explode('|', $auth); + $month = intval($tmp[2]); + } + if($submit) { + in_array($month, $months) or message($L['style_msg_month']); + $amount = $r['fee']*$month; + if($currency == 'money') { + $amount <= $_money or message($L['money_not_enough']); + if($amount <= $DT['quick_pay']) $auto = 1; + if(!$auto) { + is_payword($_username, $password) or message($L['error_payword']); + } + money_add($_username, -$amount); + money_record($_username, -$amount, $L['in_site'], 'system', $L['style_title_buy'], lang($L['style_record_buy'], array($r['title'].'('.$r['itemid'].')', $month))); + $fd = 'money'; + } else { + $amount <= $_credit or message($L['credit_not_enough'], 'credit.php?action=buy&amount='.($amount-$_credit)); + credit_add($_username, -$amount); + credit_record($_username, -$amount, 'system', lang($L['style_record_buy'], array($r['title'].'('.$r['itemid'].')', $month))); + $fd = 'credit'; + } + $t = $db->get_one("SELECT * FROM {$table}_order WHERE username='$_username' AND styleid=$itemid ORDER BY totime DESC"); + $styletime = (($t && $t['totime'] > $DT_TIME) ? $t['totime'] : $DT_TIME) + 86400*30*$month; + $title = addslashes($r['title']); + $db->query("INSERT INTO {$table}_order (styleid,title,skin,fee,amount,currency,number,username,addtime,totime) VALUES ('$itemid','$title','$r[skin]','$r[fee]','$amount','$fd','$month','$_username','$DT_TIME','$styletime')"); + $db->query("UPDATE {$table} SET hits=hits+1,orders=orders+1,`$fd`=`$fd`+$amount WHERE itemid=$itemid"); + $db->query("UPDATE {$DT_PRE}company SET styletime=$styletime,styleid=$itemid WHERE userid=$_userid"); + userclean($_username); + dmsg($L['style_msg_buy_success'], '?action=order'); + } else { + $r['thumb'] = is_file(DT_ROOT.'/'.$MODULE[4]['moduledir'].'/skin/'.$r['skin'].'/thumb.gif') ? $MODULE[4]['linkurl'].'skin/'.$r['skin'].'/thumb.gif' : $MODULE[4]['linkurl'].'image/nothumb.gif'; + extract($r); + $head_title = $L['style_title_buy']; + } + break; + case 'choose': + $itemid or message(); + $r = $db->get_one("SELECT * FROM {$table}_order WHERE itemid=$itemid"); + $r or message($L['style_msg_not_exist']); + $r['username'] == $_username or message($L['style_msg_not_exist']); + $r['totime'] > $DT_TIME or message($L['style_msg_expired'], '?action=buy&itemid='.$r['styleid']); + $db->query("UPDATE {$DT_PRE}company SET styletime='$r[totime]',styleid='$r[styleid]' WHERE userid=$_userid"); + userclean($_username); + dmsg($L['style_msg_use_success'], '?action=order'); + case 'clear': + $db->query("UPDATE {$DT_PRE}company SET styletime=0,styleid=0 WHERE userid=$_userid"); + userclean($_username); + dmsg($L['style_msg_use_success'], '?action=order'); + case 'order': + $styletime = $user['styletime']; + $styleid = $user['styleid']; + $gsid = intval($MG['styleid']); + $c = array(); + $c['skin'] = 'default'; + $c['title'] = $c['fee'] = $c['currency'] = ''; + $c['number'] = $c['amount'] = $c['adddate'] = 'N/A'; + if($styleid) { + $t = $db->get_one("SELECT * FROM {$table} WHERE itemid=$styleid"); + if($t) { + $c['skin'] = $t['skin']; + $c['title'] = $t['title']; + $c['fee'] = $t['fee']; + $c['currency'] = $t['currency']; + } + $t = $db->get_one("SELECT * FROM {$table}_order WHERE username='$_username' AND styleid=$styleid AND totime=$styletime"); + if($t) { + $c['skin'] = $t['skin']; + $c['title'] = $t['title']; + $c['fee'] = $t['fee']; + $c['currency'] = $t['currency']; + $c['number'] = $t['number']; + $c['amount'] = $t['amount']; + $c['adddate'] = timetodate($t['addtime'], 5); + } + } else if($gsid) { + $t = $db->get_one("SELECT * FROM {$table} WHERE itemid=$gsid"); + if($t) { + $c['skin'] = $t['skin']; + $c['title'] = $t['title']; + $c['fee'] = 0; + $c['currency'] = $t['currency']; + } + } + $c['thumb'] = is_file(DT_ROOT.'/'.$MODULE[4]['moduledir'].'/skin/'.$c['skin'].'/thumb.gif') ? $MODULE[4]['linkurl'].'skin/'.$c['skin'].'/thumb.gif' : $MODULE[4]['linkurl'].'image/nothumb.gif'; + $c['days'] = $styletime ? ($styletime > $DT_TIME ? ceil(($user['styletime']-$DT_TIME)/86400) : 0) : 'N/A'; + $c['todate'] = $styletime ? timetodate($styletime, 5) : 'N/A'; + + $dfields = array('title', 'title', 'skin', 'template'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $dorder = array('itemid desc', 'fee DESC', 'fee ASC', 'number DESC', 'number ASC', 'amount DESC', 'amount ASC', 'addtime DESC', 'addtime ASC', 'totime DESC', 'totime ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + isset($currency) && in_array($currency, array('money', 'credit')) or $currency = ''; + + $condition = "username='$_username'"; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($currency) $condition .= " AND currency='$currency'"; + $lists = $do->get_order($condition, $dorder[$order]); + $head_title = $L['style_title_order']; + break; + default: + $TYPE = get_type('style', 1); + $sfields = $L['style_sfields']; + $dfields = array('title', 'title', 'author'); + isset($fields) && isset($dfields[$fields]) or $fields = 0; + $sorder = $L['style_sorder']; + $dorder = array('listorder desc,addtime desc', 'fee DESC', 'fee ASC', 'hits DESC', 'hits ASC'); + isset($order) && isset($dorder[$order]) or $order = 0; + + $all = isset($all) ? intval($all) : 1; + $typeid = isset($typeid) ? intval($typeid) : 0; + isset($currency) or $currency = ''; + $minfee = isset($minfee) ? dround($minfee) : ''; + $minfee or $minfee = ''; + $maxfee = isset($maxfee) ? dround($maxfee) : ''; + $maxfee or $maxfee = ''; + isset($currency) && in_array($currency, array('free', 'money', 'credit')) or $currency = ''; + $gsid = intval($MG['styleid']); + + $fields_select = dselect($sfields, 'fields', '', $fields); + $order_select = dselect($sorder, 'order', '', $order); + $type_select = type_select($TYPE, 1, 'typeid', $L['choose_type'], $typeid); + + $condition = "1"; + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if(!$all) $condition .= " AND groupid LIKE '%,$_groupid,%'"; + if($typeid) $condition .= " AND typeid=$typeid"; + if($minfee) $condition .= " AND fee>=$minfee"; + if($maxfee) $condition .= " AND fee<=$maxfee"; + if($currency) { + if($gsid) { + $condition .= $currency == 'free' ? " AND (fee=0 OR itemid=$gsid)" : " AND currency='$currency' AND fee>0 AND itemid<>$gsid"; + } else { + $condition .= $currency == 'free' ? " AND fee=0" : " AND currency='$currency' AND fee>0"; + } + } + $num0 = $db->count($table, $gsid ? "fee=0 OR itemid=$gsid" : "fee=0", $CFG['db_expires']); + $num1 = $db->count($table, $gsid ? "currency='money' AND fee>0 AND itemid<>$gsid" : "currency='money' AND fee>0", $CFG['db_expires']); + $num2 = $db->count($table, $gsid ? "currency='credit' AND fee>0 AND itemid<>$gsid" : "currency='credit' AND fee>0", $CFG['db_expires']); + + $lists = $do->get_list($condition, $dorder[$order]); + $head_title = $L['style_title']; + break; +} +if($DT_PC) { + // +} else { + if((!$action || $action == 'index') && !$kw) $back_link = $MODULE[2]['mobile'].($_cid ? 'child.php' : 'biz.php'); + if($pages) $pages = mobile_pages($items, $page, $pagesize); + $head_name = $head_title; +} +include template('style', $module); +?> \ No newline at end of file diff --git a/module/photo/admin/index.html b/module/photo/admin/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/photo/admin/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/photo/admin/remkdir.inc.php b/module/photo/admin/remkdir.inc.php new file mode 100644 index 0000000..4289c46 --- /dev/null +++ b/module/photo/admin/remkdir.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/module/photo/admin/setting.inc.php b/module/photo/admin/setting.inc.php new file mode 100644 index 0000000..c0d7609 --- /dev/null +++ b/module/photo/admin/setting.inc.php @@ -0,0 +1,50 @@ +$v) { + if(strpos($k, 'seo_') === false) continue; + seo_check($v) or msg('SEO信息包含非法字符'); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) { + $_MOD = $MOD; + $MOD = $setting; + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + while($r = $db->fetch_array($result)) { + update_category($r); + } + cache_category($moduleid); + $MOD = $_MOD; + } + if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + $r = $db->get_one("SELECT MAX(itemid) AS maxid FROM {$table}"); + $maxid = $r['maxid']; + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/photo/admin/template/index.html b/module/photo/admin/template/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/photo/admin/template/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/photo/admin/template/item.tpl.php b/module/photo/admin/template/item.tpl.php new file mode 100644 index 0000000..98e8046 --- /dev/null +++ b/module/photo/admin/template/item.tpl.php @@ -0,0 +1,174 @@ + +
管理图片
+
+ + + + + + + + + + +
+$v) { ?> +
+ + + + + + + + + + + + + + +
+   + +
+
+ + +
+ + + + + + + + + + + + + + +
+ +
+
+ +
+
    
+
+'.$pages.'' : '';?> +
方法二、批量上传图片
+ + + + + + + + + + +
批量上传 +
+ +
提示信息 按Ctrl键或拖动鼠标可多选图片
+
方法三、上传zip压缩文件
+
+ + + + + + + + + + + + + + + + +
选择文件
提示信息 如果同时上传多张图片,可以将图片压缩为zip格式上传,目录结构不限
+
+
方法四、FTP上传目录或者zip压缩包
+
+ + + + + + + + + + + + + + + + +
请选择 +   +[刷新] +
提示信息 可以创建目录存放图片,并FTP上传目录至 file/temp/ 目录,或者直接打包为zip格式上传至 file/temp/ 目录
+
+ + \ No newline at end of file diff --git a/module/photo/index.html b/module/photo/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/photo/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/photo/list.inc.php b/module/photo/list.inc.php new file mode 100644 index 0000000..323ccb5 --- /dev/null +++ b/module/photo/list.inc.php @@ -0,0 +1,91 @@ +0'; + $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 = 3; + $target = '_blank'; + $width = 168; + $height = 124; + 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 AND open=3 AND items>0'; + $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); +?> \ No newline at end of file diff --git a/module/photo/my.inc.php b/module/photo/my.inc.php new file mode 100644 index 0000000..2939ea9 --- /dev/null +++ b/module/photo/my.inc.php @@ -0,0 +1,278 @@ +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(!$_userid) { + if(strlen($post['company']) < 4) dalert($L['type_company']); + if($AREA) { + if(!isset($AREA[$post['areaid']])) dalert($L['type_area']); + } else { + if(!$post['areaid']) dalert($L['type_area']); + } + if(strlen($post['truename']) < 4) dalert($L['type_truename']); + if(strlen($post['mobile']) < 7) dalert($L['type_mobile']); + } + + if($MG['add_limit']) { + $last = $db->get_one("SELECT addtime FROM {$table} WHERE $sql ORDER BY itemid DESC"); + if($last && $DT_TIME - $last['addtime'] < $MG['add_limit']) dalert(lang($L['add_limit'], array($MG['add_limit']))); + } + $msg = captcha($captcha, $need_captcha, true); + if($msg) dalert($msg); + $msg = question($answer, $need_question, true); + if($msg) dalert($msg); + if($do->pass($post)) { + $CAT = get_cat($post['catid']); + if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); + $post['addtime'] = $post['level'] = $post['fee'] = 0; + $post['style'] = $post['template'] = $post['note'] = $post['filepath'] = ''; + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status(3, $need_check); + $post['hits'] = 0; + $post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0; + $post['username'] = $_username; + $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']; + $forward = '?mid='.$mid.'&action=item&itemid='.$do->itemid; + $msg = ''; + } else { + $forward = '?mid='.$mid.'&action=add'; + } + $js .= 'window.onload=function(){parent.window.location="'.$forward.'";}'; + dalert($msg, '', $js); + } else { + dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '').($need_question ? reload_question() : '')); + } + } else { + if($itemid) { + $MG['copy'] && $_userid or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); + + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + extract($item); + $thumb = ''; + $totime = $totime > $DT_TIME ? timetodate($totime, 3) : ''; + } else { + $_catid = $catid; + foreach($do->fields as $v) { + $$v = ''; + } + $open = 3; + $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($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['style'] = addslashes($item['style']); + $post['template'] = addslashes($item['template']); + $post['filepath'] = addslashes($item['filepath']); + $post['note'] = addslashes($item['note']); + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status($item['status'], $need_check); + $post['hits'] = $item['hits']; + $post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); + set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); + dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); + } else { + dalert($do->errmsg); + } + } else { + extract($item); + } + break; + case 'item': + $itemid or message(); + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + if(isset($update)) { + $thumb = ''; + if($muti_upload) { + foreach(explode('|', $muti_upload) as $v) { + if(is_url($v)) { + $thumb .= $v; + $db->query("INSERT INTO {$table_item} (item,thumb) VALUES ('$itemid', '$v')"); + } + } + } + $do->item_update($post); + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $status = get_status($item['status'], $need_check); + if($status != $item['status']) $db->query("UPDATE {$table} SET status=$status WHERE itemid=$itemid"); + $session = new dsession(); + $_SESSION['uploads'] = array(); + if($MOD['show_html']) tohtml('show', $module); + dmsg($L['success_update'], '?mid='.$mid.'&action='.$action.'&itemid='.$itemid); + } else { + $lists = $do->item_list("item=$itemid"); + if($items != $item['items']) $db->query("UPDATE {$table} SET items=$items WHERE itemid=$itemid"); + } + break; + case 'item_delete': + if(isset($itemids) && is_array($itemids)) { + // + } else { + $itemids = array($itemid); + } + foreach($itemids as $itemid) { + $item = $db->get_one("SELECT p.username FROM {$table} p,{$table_item} i WHERE p.itemid=i.item AND i.itemid=$itemid"); + if(!$item || $item['username'] != $_username) continue; + $do->item_delete($itemid); + } + dmsg($L['success_delete'], $forward); + 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, 4)) or $status = 3; + $condition = "username='$_username'"; + $condition .= " AND status=$status"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + $timetype = strpos($MOD['order'], 'add') !== false ? 'add' : ''; + $lists = $do->get_list($condition, $MOD['order']); + break; +} +if($_userid) { + $nums = array(); + for($i = 1; $i < 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' || $action == 'item') { + // + } 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'); +?> \ No newline at end of file diff --git a/module/photo/private.inc.php b/module/photo/private.inc.php new file mode 100644 index 0000000..6918ecd --- /dev/null +++ b/module/photo/private.inc.php @@ -0,0 +1,41 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +$item or dheader($modurl); +$item['status'] == 3 or dheader($modurl); +if($item['open'] == 3) dheader($modurl.$item['linkurl']); +extract($item); +$pass = false; +$_key = $open == 2 ? $password : $answer; +$error = ''; +if($submit) { + if(isset($key) && $key == $_key) { + $pass = true; + set_cookie('photo_'.$itemid, md5(md5(DT_IP.$open.$_key.DT_KEY.'PHOTO')), $DT_TIME + 86400); + } else { + $error = $open == 2 ? $L['error_password'] : $L['error_answer']; + } +} else { + $str = get_cookie('photo_'.$itemid); + if($str && $str == md5(md5(DT_IP.$open.$_key.DT_KEY.'PHOTO'))) $pass = true; + if($_username && $_username == $username) $pass = true; +} +if($pass == true) dheader($modurl.'show.php?itemid='.$itemid.'&page='.$page.'#p'); +$CAT = get_cat($catid); +$seo_file = 'show'; +include DT_ROOT.'/include/seo.inc.php'; +$seo_title = $L['private_title'].$seo_delimiter.$seo_title; +$template = $MOD['template_private'] ? $MOD['template_private'] : 'private'; +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + $head_name = $L['private_title']; + if($sns_app) $seo_title = $MOD['name']; + $foot = ''; +} +include template($template, $module); +?> \ No newline at end of file diff --git a/module/photo/search.inc.php b/module/photo/search.inc.php new file mode 100644 index 0000000..8bca52a --- /dev/null +++ b/module/photo/search.inc.php @@ -0,0 +1,158 @@ + $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 = ''; + $condition .= ' AND open=3 AND items>0'; + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($dfields[$fields] == 'content') { + if($keyword && $MOD['fulltext'] == 1) $condition .= match_kw($dfields[$fields], $keyword); + $condition = str_replace('AND ', 'AND i.', $condition); + $condition = str_replace('i.content', 'd.content', $condition); + $condition = "i.status=3 AND i.itemid=d.itemid".$condition; + if($keyword && $MOD['fulltext'] == 2) $condition .= " AND MATCH(`content`) AGAINST('$kw'".(preg_match("/[+-<>()~*]/", $kw) ? ' IN BOOLEAN MODE' : '').")"; + $table = $table.' i,'.$table_data.' d'; + $fds = 'i.'.str_replace(',', ',i.', $fds); + } else { + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($pptsql) $condition .= $pptsql;//PPT + $condition = "status=3".$condition; + } + $pagesize = $MOD['pagesize']; + $offset = ($page-1)*$pagesize; + $items = $db->count($table, $condition, $DT['cache_search']); + $pages = pages($items, $page, $pagesize); + if($items) { + $order = $dorder[$order] ? " ORDER BY $dorder[$order]" : ''; + $result = $db->query("SELECT {$fds} FROM {$table} WHERE {$condition}{$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + if($kw) { + $replacef = explode(' ', $kw); + $replacet = array_map('highlight', $replacef); + } + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = dsubstr($r['title'], 20); + $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 = 3; + $target = '_blank'; + $width = 168; + $height = 124; + $seo_file = 'search'; + 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('ditems', 'dhits', 'dcomments'))) or $orderby = ''; + $tags = array(); + if($DT_QST) { + $condition = 'status=3 AND open=3 AND items>0'; + 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); + $tags = array(); + if($items) { + $order = $MOD['order']; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + if($kw) $r['title'] = str_replace($kw, ''.$kw.'', $r['title']); + $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); +?> \ No newline at end of file diff --git a/module/photo/show.htm.php b/module/photo/show.htm.php new file mode 100644 index 0000000..98ca9e1 --- /dev/null +++ b/module/photo/show.htm.php @@ -0,0 +1,110 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3) return false; +require_once DT_ROOT.'/include/content.class.php'; +$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; +extract($item); +$CAT = get_cat($catid); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_content = $t['content']; +if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, 1); +} +$CP = $MOD['cat_property'] && $CAT['property']; +if($CP) { + require_once DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); +} +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$fileurl = $linkurl; +$linkurl = $MOD['linkurl'].$linkurl; +$fee = DC::fee($item['fee'], $MOD['fee_view']); +if($fee) { + $description = ''; + $user_status = 4; +} else { + $user_status = 3; +} +$pass = $open == 3 ? true : false; +$T = array(); +$result = $db->query("SELECT itemid,thumb,introduce FROM {$table_item} WHERE item=$itemid ORDER BY listorder ASC,itemid ASC"); +while($r = $db->fetch_array($result)) { + $r['middle'] = str_replace('.thumb.', '.middle.', $r['thumb']); + $r['big'] = str_replace('.thumb.'.file_ext($r['thumb']), '', $r['thumb']); + $T[] = $r; +} +if(!$T) return false; +$demo_url = $MOD['linkurl'].itemurl($item, '{destoon_page}'); +$total = $items = count($T); +$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')); +$total = $items; +for(; $page <= $total; $page++) { + $next_photo = $items > 1 ? next_photo($page, $items, $demo_url) : $linkurl; + $prev_photo = $items > 1 ? prev_photo($page, $items, $demo_url) : $linkurl; + if($T) { + $S = side_photo($T, $page, $demo_url); + } else { + $S = array(); + $T[0]['thumb'] = DT_SKIN.'image/spacer.gif'; + $T[0]['introduce'] = $L['no_picture']; + } + $P = $T[$page-1]; + $P['src'] = str_replace('.thumb.'.file_ext($P['thumb']), '', $P['thumb']); + $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid&page=$page"; + if($EXT['mobile_enable']) { + $head_mobile = $MOD['mobile'].($page > 1 ? itemurl($item, $page) : $item['linkurl']); + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + } + $filename = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, $page); + $DT_PC = $GLOBALS['DT_PC'] = 1; + if($pass) { + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + } else { + $data = ''; + } + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = $linkurl; + $js_item = $js_album = 1; + $head_title = $head_name = $CAT['catname']; + $foot = ''; + if($total > 1) $pages = mobile_pages($total, $page, 1, $MOD['mobile'].itemurl($item, '{destoon_page}')); + if($_content) { + $content = $_content; + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); + $content = DC::format($content, 0); + } + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + if($pass) { + ob_start(); + include template('show', $module); + $data = ob_get_contents(); + ob_clean(); + } else { + $data = ''; + } + file_put($filename, $data); + if($page == 1 && $total > 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/photo/show.inc.php b/module/photo/show.inc.php new file mode 100644 index 0000000..3822eb0 --- /dev/null +++ b/module/photo/show.inc.php @@ -0,0 +1,99 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if($item && $item['status'] > 2) { + if($MOD['show_html'] && $item['open'] == 3 && is_file(DT_ROOT.'/'.$MOD['moduledir'].'/'.$item['linkurl'])) d301($modurl.$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'); +if($open < 3) { + $_key = $open == 2 ? $password : $answer; + $str = get_cookie('photo_'.$itemid); + $pass = $str == md5(md5(DT_IP.$open.$_key.DT_KEY.'PHOTO')); + if($_username && $_username == $username) $pass = true; +} else { + $pass = true; +} +if($page > $items) $page = 1; +$pass or dheader($modurl.'private.php?itemid='.$itemid.'&page='.$page); +$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']; +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$T = array(); +$result = $db->query("SELECT itemid,thumb,introduce FROM {$table_item} WHERE item=$itemid ORDER BY listorder ASC,itemid ASC"); +while($r = $db->fetch_array($result)) { + $r['middle'] = str_replace('.thumb.', '.middle.', $r['thumb']); + $r['big'] = str_replace('.thumb.'.file_ext($r['thumb']), '', $r['thumb']); + $T[] = $r; +} +if(!$T) include load('404.inc'); +$demo_url = $modurl.itemurl($item, '{destoon_page}'); +$next_photo = $items > 1 ? next_photo($page, $items, $demo_url) : $linkurl; +$prev_photo = $items > 1 ? prev_photo($page, $items, $demo_url) : $linkurl; +$P = $T[$page-1]; +$P['src'] = str_replace('.thumb.'.file_ext($P['thumb']), '', $P['thumb']); +if($DT_PC) { + 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); + } + $linkurl = $MOD['linkurl'].$linkurl; + if($T) { + $S = side_photo($T, $page, $demo_url); + } else { + $S = array(); + $T[0]['thumb'] = DT_SKIN.'image/spacer.gif'; + $T[0]['introduce'] = $L['no_picture']; + } + $user_status = 3; + $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 = ''; + } else { + $user_status = 3; + } + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); +} else { + $description = ''; + $user_status = 3; + $fee = DC::fee($item['fee'], $MOD['fee_view']); + if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); + if($share_icon) $share_icon = DC::icon($thumb, $content); + if($user_status == 2) $description = DC::description($content, $MOD['pre_view']); + DC::format($content, $DT_PC); + } + include DT_ROOT.'/mobile/api/content.inc.php'; + $item['template'] = $CAT['show_template'] = ''; + $update = ''; + $head_title = $head_name = $CAT['catname']; + $js_item = $js_album = 1; + $foot = ''; +} +if(!$DT_BOT) include DT_ROOT.'/include/update.inc.php'; +$seo_file = 'show'; +include DT_ROOT.'/include/seo.inc.php'; +$template = $item['template'] ? $item['template'] : ($CAT['show_template'] ? $CAT['show_template'] : ($MOD['template_show'] ? $MOD['template_show'] : 'show')); +include template($template, $module); +?> \ No newline at end of file diff --git a/module/quote/admin/html.inc.php b/module/quote/admin/html.inc.php new file mode 100644 index 0000000..437d6d7 --- /dev/null +++ b/module/quote/admin/html.inc.php @@ -0,0 +1,119 @@ +get_one("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid AND catid>$catids ORDER BY catid"); + if($CAT) { + $bcatid = $catid = $CAT['catid']; + $total = max(ceil($CAT['item']/$MOD['pagesize']), 1); + $num = 50; + $bfid = $fid; + isset($fpage) or $fpage = 1; + if($fpage <= $total) { + $fid = $fpage; + tohtml('list', $module); + $fid = $bfid; + msg($MOD['name'].' ['.$CAT['catname'].'] 第'.$fpage.'页至第'.($fpage+$num-1).'页生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catids.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one.'&fpage='.($fpage+$num), 0); + } + $fid++; + msg($MOD['name'].' ['.$CAT['catname'].'] 生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catid.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one); + } else { + $all ? msg($MOD['name'].'列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg($MOD['name'].'列表生成成功', $this_forward); + } + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + $tid = $r['num']; + msg('', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids=0&fid=1&&tid='.$tid.'&all='.$all.'&one='.$one); + } + break; + case 'show': + $update = (isset($update) && $update) ? 1 : 0; + if(!$update && !$MOD['show_html']) { + if($one) dheader( '?file=html&action=back&mid='.$moduleid); + $all ? msg($MOD['name'].'生成成功', $this_forward) : dmsg($MOD['name'].'生成成功', $this_forward); + } + $catid = isset($catid) ? intval($catid) : ''; + $sql = $catid ? " AND catid=$catid" : ''; + if(!isset($fid)) { + $r = $db->get_one("SELECT min(itemid) AS fid FROM {$table} WHERE status=3 {$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=3 {$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=3 AND itemid>=$fid {$sql} ORDER BY itemid LIMIT 0,$num"); + if($db->affected_rows($result)) { + while($r = $db->fetch_array($result)) { + $itemid = $r['itemid']; + $update ? $do->update($itemid) : tohtml('show', $module); + } + $itemid += 1; + } else { + $itemid = $fid + $num; + } + } else { + if($update) { + $all ? msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=index&all=1&one='.$one) : dmsg('更新成功', $this_forward); + } else { + if($one) dheader( '?file=html&action=back&mid='.$moduleid); + $all ? msg($MOD['name'].'生成成功', $this_forward) : dmsg($MOD['name'].'生成成功', $this_forward); + } + } + msg('ID从'.$fid.'至'.($itemid-1).$MOD['name'].($update ? '更新' : '生成').'成功'.progress($sid, $fid, $tid), "?moduleid=$moduleid&file=$file&action=$action&sid=$sid&fid=$itemid&tid=$tid&num=$num&update=$update&all=$all&one=$one", 0); + break; + case 'cate': + $catid or msg('请选择分类'); + isset($num) or $num = 50; + isset($fid) or $fid = 1; + $total = max(ceil($CAT['item']/$MOD['pagesize']), 1); + if($fpage && $tpage) { + $fid = $fpage; + $num = $tpage - $fpage + 1; + tohtml('list', $module); + dmsg('生成成功', $this_forward); + } + if($fid <= $total) { + tohtml('list', $module); + msg('第'.$fid.'页至第'.($fid+$num-1).'页生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catid='.$catid.'&fid='.($fid+$num).'&num='.$num.'&fpage='.$fpage.'&tpage='.$tpage, 0); + } else { + dmsg('生成成功', $this_forward); + } + break; + case 'item': + $catid or msg('请选择分类'); + msg('', '?moduleid='.$moduleid.'&file='.$file.'&action=show&catid='.$catid.'&num='.$num); + break; + default: + $r = $db->get_one("SELECT min(itemid) AS fid,max(itemid) AS tid FROM {$table} WHERE status=3"); + $fid = $r['fid'] ? $r['fid'] : 0; + $tid = $r['tid'] ? $r['tid'] : 0; + include tpl('html', $module); + break; +} +?> \ No newline at end of file diff --git a/module/quote/admin/index.html b/module/quote/admin/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/quote/admin/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/quote/admin/index.inc.php b/module/quote/admin/index.inc.php new file mode 100644 index 0000000..9bec720 --- /dev/null +++ b/module/quote/admin/index.inc.php @@ -0,0 +1,221 @@ + 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($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); + } + $history = 0; + include tpl('edit', $module); + } + break; + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + $item = $do->get_one(); + extract($item); + $history = history($moduleid, $itemid); + $addtime = timetodate($addtime); + $menuon = array('4', '3', '2', '1'); + $menuid = $menuon[$status]; + include tpl($action, $module); + } + break; + case 'move': + if($submit) { + $fromids or msg('请填写来源ID'); + if($tocatid) { + $db->query("UPDATE {$table} SET catid=$tocatid WHERE `{$fromtype}` IN ($fromids)"); + dmsg('移动成功', $forward); + } else { + msg('请选择目标分类'); + } + } else { + $itemid = $itemid ? implode(',', $itemid) : ''; + $menuid = 5; + include tpl($action); + } + break; + case 'update': + is_array($itemid) or msg('请选择'.$MOD['name']); + foreach($itemid as $v) { + $do->update($v); + } + dmsg('更新成功', $forward); + break; + case 'tohtml': + is_array($itemid) or msg('请选择'.$MOD['name']); + $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 = 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; + case 'price': + $tag or exit; + $P = $db->get_one("SELECT * FROM {$table_product} WHERE title LIKE '%$tag%'"); + $P or exit; + $pid = $P['itemid']; + $condition = "pid=$pid AND status=3"; + if($day && is_date($day)) $condition .= " AND addtime>=".datetotime($day.' 00:00:00'); + $lists = array(); + $result = $db->query("SELECT * FROM {$table_price} WHERE $condition ORDER BY addtime DESC LIMIT 50"); + while($r = $db->fetch_array($result)) { + $lists[] = $r; + } + if($lists) { + echo count($lists).'|*|'; + include template('quote', 'chip'); + } + break; + default: + $lists = $do->get_list('status=3'.$condition, $dorder[$order]); + $menuid = 1; + include tpl('index', $module); + break; +} +?> \ No newline at end of file diff --git a/module/quote/admin/menu.inc.php b/module/quote/admin/menu.inc.php new file mode 100644 index 0000000..a773645 --- /dev/null +++ b/module/quote/admin/menu.inc.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/module/quote/admin/setting.inc.php b/module/quote/admin/setting.inc.php new file mode 100644 index 0000000..c0d7609 --- /dev/null +++ b/module/quote/admin/setting.inc.php @@ -0,0 +1,50 @@ +$v) { + if(strpos($k, 'seo_') === false) continue; + seo_check($v) or msg('SEO信息包含非法字符'); + } + update_setting($moduleid, $setting); + cache_module($moduleid); + if($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) { + $_MOD = $MOD; + $MOD = $setting; + $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + while($r = $db->fetch_array($result)) { + update_category($r); + } + cache_category($moduleid); + $MOD = $_MOD; + } + if($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) { + msg('设置保存成功,开始更新地址', '?moduleid='.$moduleid.'&file=html&action=show&update=1&num=1000'); + } + dmsg('设置保存成功', '?moduleid='.$moduleid.'&file='.$file.'&tab='.$tab); +} else { + $GROUP = cache_read('group.php'); + $r = $db->get_one("SELECT MAX(itemid) AS maxid FROM {$table}"); + $maxid = $r['maxid']; + extract(dhtmlspecialchars($MOD)); + if($kw) { + $all = 1; + ob_start(); + } + include tpl('setting', $module); + if($kw) { + $data = $content = ob_get_contents(); + ob_clean(); + $data = preg_replace('\'(?!((<.*?)|(]*?)>)|([^>]*?)|([^>]*?))\'si', ''.$kw.'', $data); + $data = preg_replace('//', '', $data, 1); + echo $data ? $data : $content; + } +} +?> \ No newline at end of file diff --git a/module/quote/global.func.php b/module/quote/global.func.php new file mode 100644 index 0000000..4f5625f --- /dev/null +++ b/module/quote/global.func.php @@ -0,0 +1,35 @@ + 0) { + $n++; + $s += $v['price']; + } + } + return $n ? dround($s/$n) : 0; +} + +function get_all($date, $lists) { + $n = $s = 0; + foreach($lists as $v) { + if($v['date'] == $date) { + $n++; + $s += $v['price']; + } + } + return $n ? dround($s/$n) : get_avg($lists); +} + +function get_mkt($date, $market, $lists) { + $n = $s = 0; + foreach($lists as $v) { + if($v['date'] == $date && $v['market'] == $market) { + $n++; + $s += $v['price']; + } + } + return $n ? dround($s/$n) : get_avg($lists); +} +?> \ No newline at end of file diff --git a/module/quote/index.htm.php b/module/quote/index.htm.php new file mode 100644 index 0000000..6c0d8e1 --- /dev/null +++ b/module/quote/index.htm.php @@ -0,0 +1,45 @@ +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; +?> \ No newline at end of file diff --git a/module/quote/index.inc.php b/module/quote/index.inc.php new file mode 100644 index 0000000..1982e28 --- /dev/null +++ b/module/quote/index.inc.php @@ -0,0 +1,40 @@ + 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); +?> \ No newline at end of file diff --git a/module/quote/list.htm.php b/module/quote/list.htm.php new file mode 100644 index 0000000..a764f8c --- /dev/null +++ b/module/quote/list.htm.php @@ -0,0 +1,90 @@ +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; +?> \ No newline at end of file diff --git a/module/quote/price.class.php b/module/quote/price.class.php new file mode 100644 index 0000000..9fc4985 --- /dev/null +++ b/module/quote/price.class.php @@ -0,0 +1,163 @@ +table = $table_price; + $this->table_product = $table_product; + $this->fields = array('pid','price','market','username','areaid','company','telephone','qq','wx','ip','addtime','status','editor','edittime','note'); + } + + function price() { + $this->__construct(); + } + + function pass($post) { + global $P, $L; + if(!is_array($post) || !$P) return false; + if(!$post['price']) return $this->_($L['msg_price']); + if(!$post['username'] && !$post['company']) return $this->_($L['msg_company']); + if(!$post['username'] && !$post['areaid']) return $this->_($L['msg_area']); + if(($P['minprice'] && $post['price'] < $P['minprice']) || ($P['maxprice'] && $post['price'] > $P['maxprice'])) return $this->_($L['msg_bad']); + return true; + } + + function set($post) { + global $MOD, $_username, $_cname; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['price'] = dround($post['price']); + if($this->itemid) { + // + } else { + $post['ip'] = DT_IP; + } + $post = dhtmlspecialchars($post); + return array_map("trim", $post); + } + + function get_one($condition = '') { + return DB::get_one("SELECT * FROM {$this->table} WHERE itemid='$this->itemid' $condition"); + } + + function get_list($condition = '1', $order = 'addtime DESC') { + global $pages, $page, $pagesize, $offset, $pagesize, $MOD, $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 = $pids = $P = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize"); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['linkurl'] = $MOD['linkurl'].rewrite('price.php?itemid='.$r['pid']); + $pids[$r['pid']] = $r['pid']; + $lists[] = $r; + } + if($pids) { + $result = DB::query("SELECT * FROM {$this->table_product} WHERE itemid IN (".implode(',', $pids).")"); + while($r = DB::fetch_array($result)) { + $P[$r['itemid']] = $r; + } + if($P) { + foreach($lists as $k=>$v) { + $lists[$k]['unit'] = $P[$v['pid']]['unit']; + $lists[$k]['alt'] = $P[$v['pid']]['title']; + $lists[$k]['title'] = set_style($P[$v['pid']]['title'], $P[$v['pid']]['style']); + } + } + } + return $lists; + } + + function add($post) { + global $MOD, $L; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $this->update($this->itemid, $post); + $this->product($this->itemid, $post['pid']); + return $this->itemid; + } + + function edit($post) { + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $this->update($this->itemid, $post); + $this->product($this->itemid, $post['pid']); + return true; + } + + function update($itemid, $item = array()) { + $item or $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $sql = ''; + if($item['username']) { + $m = daddslashes(userinfo($item['username'])); + if($m) $sql = "company='$m[company]',telephone='$m[telephone]',qq='$m[qq]',wx='$m[wx]',areaid='$m[areaid]'"; + } + if($sql) DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$itemid"); + } + + function check($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid"); + $this->product($itemid); + return true; + } + } + + function delete($itemid) { + global $MOD, $L; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->delete($v); } + } else { + $this->itemid = $itemid; + $t = $this->get_one(); + $pid = $t['pid']; + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $this->product($itemid, $pid); + } + } + + function product($itemid, $pid = 0) { + if(!$pid) { + $this->itemid = $itemid; + $t = $this->get_one(); + $pid = $t['pid']; + } + if(!$pid) return false; + $t = DB::get_one("SELECT price FROM {$this->table} WHERE status=3 AND pid=$pid ORDER BY addtime DESC"); + $price = $t['price']; + if($price) DB::query("UPDATE {$this->table_product} SET price='$price',edittime=".DT_TIME." WHERE itemid=$pid"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/quote/product.inc.php b/module/quote/product.inc.php new file mode 100644 index 0000000..682d70d --- /dev/null +++ b/module/quote/product.inc.php @@ -0,0 +1,33 @@ +count($table_product, $condition, $DT['cache_search']); +$pages = $DT_PC ? pages($items, $page, $pagesize) : mobile_pages($items, $page, $pagesize); +$lists = array(); +$result = $db->query("SELECT * FROM {$table_product} WHERE $condition ORDER BY addtime DESC LIMIT $offset,$pagesize", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); +while($r = $db->fetch_array($result)) { + $r['mobile'] = $MOD['mobile'].rewrite('price.php?itemid='.$r['itemid']); + $r['linkurl'] = $MOD['linkurl'].rewrite('price.php?itemid='.$r['itemid']); + $lists[] = $r; +} +$head_title = $L['product_title'].$DT['seo_delimiter'].$MOD['name']; +if($catid) $head_title = $CAT['catname'].$DT['seo_delimiter'].$head_title; +if($kw) $head_title = $kw.$DT['seo_delimiter'].$head_title; +if($DT_PC) { + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + $tags = $lists; + if($job == 'ajax') { + if($tags) include template('list-quote-product', 'tag'); + exit; + } + $js_load = $MOD['mobile'].'product.php?job=ajax'; + $head_name = $L['product_title']; + if($sns_app) $seo_title = $MOD['name']; +} +include template($MOD['template_product'] ? $MOD['template_product'] : 'product', $module); +?> \ No newline at end of file diff --git a/module/quote/quote.class.php b/module/quote/quote.class.php new file mode 100644 index 0000000..cd6c61b --- /dev/null +++ b/module/quote/quote.class.php @@ -0,0 +1,285 @@ +moduleid = $moduleid; + $this->table = $table; + $this->table_data = $table_data; + $this->split = $MOD['split']; + $this->fields = array('catid','areaid','level','title','style','fee','introduce','thumb','tag','status','hits','username','addtime','adddate', 'editor','edittime','ip','template', 'linkurl','filepath','note'); + } + + function quote($moduleid) { + $this->__construct($moduleid); + } + + function pass($post) { + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_catid')); + if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); + if(!$post['content']) return $this->_(lang('message->pass_content')); + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $_username, $_userid, $_cname; + is_url($post['thumb']) or $post['thumb'] = ''; + $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['adddate'] = timetodate($post['addtime'], 3); + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['fee'] = dround($post['fee']); + $post['content'] = stripslashes($post['content']); + $post['content'] = save_local($post['content']); + if($post['content'] && isset($post['clear_link']) && $post['clear_link']) $post['content'] = clear_link($post['content']); + if($post['content'] && isset($post['save_remotepic']) && $post['save_remotepic']) $post['content'] = save_remote($post['content']); + if($post['content'] && $post['thumb_no'] && !$post['thumb']) $post['thumb'] = save_thumb($post['content'], $post['thumb_no'], $MOD['thumb_width'], $MOD['thumb_height']); + if(strpos($post['content'], 'de-pagebreak') !== false) { + $post['content'] = str_replace('"de-pagebreak" /', '"de-pagebreak"/', $post['content']); + $post['content'] = str_replace(array('

', '


', '
', '

'), array('


', '

', '


', '
'), $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 .= ''; + $r = $this->get_one(); + $old = $r['content']; + if($r['thumb']) $old .= ''; + delete_diff($new, $old); + } else { + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) { + credit_add($post['username'], $MOD['credit_add']); + credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'], $this->itemid); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.($item['tag'] ? str_replace(' ', ',', trim($item['tag'])).',' : '').strip_tags(cat_pos(get_cat($item['catid']), ',')); + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $item['itemid'] = $itemid; + $linkurl = itemurl($item); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + $i = 1; + while($i) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($r, $i); + if(is_file($_file)) { + html_del($_file); + $i++; + } else { + break; + } + } + } + if($all) { + $userid = get_user($r['username']); + if($r['thumb']) delete_upload($r['thumb'], $userid); + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + } + } + } + + function check($itemid) { + global $_username, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + $this->itemid = $itemid; + $item = $this->get_one(); + if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { + credit_add($item['username'], $MOD['credit_add']); + credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid"); + history($this->moduleid, $itemid, 'del'); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/quote/search.inc.php b/module/quote/search.inc.php new file mode 100644 index 0000000..a4e13f8 --- /dev/null +++ b/module/quote/search.inc.php @@ -0,0 +1,162 @@ + $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($pid) $condition .= " AND pid=$pid"; + 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; + $target = '_blank'; + $cols = 5; + $class = ''; + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + if($kw) { + check_group($_groupid, $MOD['group_search']) or message($L['msg_no_search']); + } else if($catid) { + $CAT or message($L['msg_not_cate']); + if(!check_group($_groupid, $MOD['group_list']) || !check_group($_groupid, $CAT['group_list'])) message($L['msg_no_right']); + } else { + check_group($_groupid, $MOD['group_index']) or message($L['msg_no_right']); + } + $head_title = $MOD['name'].$DT['seo_delimiter'].$head_title; + if($kw) $head_title = $kw.$DT['seo_delimiter'].$head_title; + if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) { + $areaid = $cityid; + $ARE = get_area($areaid); + } + $elite = isset($elite) ? intval($elite) : 0; + (isset($orderby) && in_array($orderby, array('dlikes', 'dhits', 'dcomments'))) or $orderby = ''; + $tags = array(); + if($DT_QST) { + $condition = "status=3"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= $CAT['child'] ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($elite) $condition .= " AND level>0"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize); + if($items) { + $order = $MOD['order']; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + if($kw) $r['title'] = str_replace($kw, ''.$kw.'', $r['title']); + $r['linkurl'] = $MOD['mobile'].$r['linkurl']; + $tags[] = $r; + } + $db->free_result($result); + $js_load = preg_replace("/(.*)([&?]page=[0-9]*)(.*)/i", "\\1\\3", rewrite($DT_URL, 1)).'&job=ajax'; + } + if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); + } + if($job == 'ajax') { + if($tags) include template('list-'.$module, 'tag'); + exit; + } + $head_title = $MOD['name'].$L['search']; +} +$seo_file = 'search'; +include DT_ROOT.'/include/seo.inc.php'; +include template($MOD['template_search'] ? $MOD['template_search'] : 'search', $module); +?> \ No newline at end of file diff --git a/module/quote/show.htm.php b/module/quote/show.htm.php new file mode 100644 index 0000000..11af4c7 --- /dev/null +++ b/module/quote/show.htm.php @@ -0,0 +1,89 @@ +get_one("SELECT * FROM {$table} WHERE itemid=$itemid"); +if(!$item || $item['status'] < 3) return false; +require_once DT_ROOT.'/include/content.class.php'; +$could_comment = in_array($moduleid, explode(',', $EXT['comment_module'])) ? 1 : 0; +extract($item); +$CAT = get_cat($catid); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $_content = $t['content']; +if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid); + if($lazy) $content = DC::lazy($content); + $content = DC::format($content, 1); +} +$CP = $MOD['cat_property'] && $CAT['property']; +if($CP) { + require_once DT_ROOT.'/include/property.func.php'; + $options = property_option($catid); + $values = property_value($moduleid, $itemid); +} +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +$fileurl = $linkurl; +$linkurl = $MOD['linkurl'].$linkurl; +$fee = DC::fee($item['fee'], $MOD['fee_view']); +if($fee) { + $description = DC::description($content, $MOD['pre_view']); + $user_status = 4; +} else { + $user_status = 3; +} +$pages = ''; +$total = 1; +if(strpos($content, 'pagebreak') !== false) { + $contents = DC::pagebreak($content); + if($contents) $total = count($contents); +} +$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')); +for(; $page <= $total; $page++) { + $destoon_task = "moduleid=$moduleid&html=show&itemid=$itemid&page=$page"; + if($EXT['mobile_enable']) $head_mobile = $MOD['mobile'].($page > 1 ? itemurl($item, $page) : $item['linkurl']); + $filename = $total == 1 ? DT_ROOT.'/'.$MOD['moduledir'].'/'.$fileurl : DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, $page); + if($total > 1) { + $pages = pages($total, $page, 1, $MOD['linkurl'].itemurl($item, '{destoon_page}')); + if($pages) $pages = substr($pages, 0, strpos($pages, '')); + $content = $contents[$page-1]; + } + if($MOD['keylink']) $content = DC::keylink($content, $moduleid); + $content = DC::format($content, 1); + $DT_PC = $GLOBALS['DT_PC'] = 1; + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + if($DT['pcharset']) $filename = convert($filename, DT_CHARSET, $DT['pcharset']); + file_put($filename, $data); + if($page == 1 && $total > 1) { + $indexname = DT_ROOT.'/'.$MOD['moduledir'].'/'.itemurl($item, 0); + if($DT['pcharset']) $indexname = convert($indexname, DT_CHARSET, $DT['pcharset']); + file_copy($filename, $indexname); + } + if($EXT['mobile_enable']) { + include DT_ROOT.'/include/mobile.htm.php'; + $head_pc = str_replace($MOD['mobile'], $MOD['linkurl'], $head_mobile); + $head_title = $head_name = $CAT['catname']; + $js_item = 1; + $foot = ''; + if($total > 1) $pages = mobile_pages($total, $page, 1, $MOD['mobile'].itemurl($item, '{destoon_page}')); + if($_content) { + $content = $_content; + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, 0); + $content = DC::format($content, 0); + } + $filename = str_replace(DT_ROOT, DT_ROOT.'/mobile', $filename); + ob_start(); + include template($template, $module); + $data = ob_get_contents(); + ob_clean(); + file_put($filename, $data); + if($page == 1 && $total > 1) file_copy($filename, str_replace(DT_ROOT, DT_ROOT.'/mobile', $indexname)); + } +} +return true; +?> \ No newline at end of file diff --git a/module/sell/admin/html.inc.php b/module/sell/admin/html.inc.php new file mode 100644 index 0000000..e60e6ea --- /dev/null +++ b/module/sell/admin/html.inc.php @@ -0,0 +1,119 @@ +get_one("SELECT * FROM {$DT_PRE}category WHERE moduleid=$moduleid AND catid>$catids ORDER BY catid"); + if($CAT) { + $bcatid = $catid = $CAT['catid']; + $total = max(ceil($CAT['item']/$MOD['pagesize']), 1); + $num = 50; + $bfid = $fid; + isset($fpage) or $fpage = 1; + if($fpage <= $total) { + $fid = $fpage; + tohtml('list', $module); + $fid = $bfid; + msg($MOD['name'].' ['.$CAT['catname'].'] 第'.$fpage.'页至第'.($fpage+$num-1).'页生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catids.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one.'&fpage='.($fpage+$num), 0); + } + $fid++; + msg($MOD['name'].' ['.$CAT['catname'].'] 生成成功'.progress(0, $fid, $tid), '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids='.$catid.'&fid='.$fid.'&tid='.$tid.'&all='.$all.'&one='.$one); + } else { + $all ? msg($MOD['name'].'列表生成成功', '?moduleid='.$moduleid.'&file='.$file.'&action=show&all='.$all.'&one='.$one) : msg($MOD['name'].'列表生成成功', $this_forward); + } + } else { + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}category WHERE moduleid=$moduleid"); + $tid = $r['num']; + msg('', '?moduleid='.$moduleid.'&file='.$file.'&action='.$action.'&catids=0&fid=1&&tid='.$tid.'&all='.$all.'&one='.$one); + } + break; + case 'show': + $update = (isset($update) && $update) ? 1 : 0; + if(!$update && !$MOD['show_html']) { + if($one) dheader( '?file=html&action=back&mid='.$moduleid); + $all ? msg($MOD['name'].'生成成功', $this_forward) : dmsg($MOD['name'].'生成成功', $this_forward); + } + $catid = isset($catid) ? intval($catid) : ''; + $sql = $catid ? " AND catid=$catid" : ''; + if(!isset($fid)) { + $r = $db->get_one("SELECT min(itemid) AS fid FROM {$table} WHERE status>2 {$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; +} +?> \ No newline at end of file diff --git a/module/sell/admin/index.inc.php b/module/sell/admin/index.inc.php new file mode 100644 index 0000000..24f7bca --- /dev/null +++ b/module/sell/admin/index.inc.php @@ -0,0 +1,276 @@ +=0) $condition .= " AND typeid=$typeid"; + if($level) $condition .= $level > 9 ? " AND level>0" : " AND level=$level"; + if($thumb) $condition .= " AND thumb<>''"; + if($guest) $condition .= " AND username=''"; + if($elite) $condition .= " AND elite>0"; + if($vip) $condition .= " AND vip>0"; + if($price) $condition .= " AND price>0"; + if($minprice) $condition .= " AND price>=$minprice"; + if($maxprice) $condition .= " AND price<=$maxprice"; + if($minamount) $condition .= " AND amount>=$minamount"; + if($maxamount) $condition .= " AND amount<=$maxamount"; + if($minminamount) $condition .= " AND minamount>=$minminamount"; + if($maxminamount) $condition .= " AND minamount<=$maxminamount"; + if($minvip) $condition .= " AND vip>=$minvip"; + if($maxvip) $condition .= " AND vip<=$maxvip"; + if($fromtime) $condition .= " AND `$datetype`>=$fromtime"; + if($totime) $condition .= " AND `$datetype`<=$totime"; + 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(); + $history = history($moduleid, $itemid); + extract($item); + $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)"); + $db->query("UPDATE {$table_search} 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; +} +?> \ No newline at end of file diff --git a/module/sell/admin/install.inc.php b/module/sell/admin/install.inc.php new file mode 100644 index 0000000..4165a80 --- /dev/null +++ b/module/sell/admin/install.inc.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/module/sell/admin/menu.inc.php b/module/sell/admin/menu.inc.php new file mode 100644 index 0000000..8939716 --- /dev/null +++ b/module/sell/admin/menu.inc.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/module/sell/admin/template/edit.tpl.php b/module/sell/admin/template/edit.tpl.php new file mode 100644 index 0000000..8609565 --- /dev/null +++ b/module/sell/admin/template/edit.tpl.php @@ -0,0 +1,458 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +', ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
* 审核提示该信息存在修改记录,点击查看 修改详情
* 信息类型 +$v) {?> + id="typeid_"/>   + +
* 信息标题
* 行业分类
  搜索分类
* 产品品牌
', $item) : '';?> +
* 产品图片 +
+ $v) { ?> +
+ +
+

+
+ +
+
+
+ +
+

+
+
+
+
+

批量上传

+
+ + + +
* 宣传视频  [上传]  [预览]  [删除]   + +
* 主要参数 + + + + + + + + + + + + + + + + + + + + + +
参数名称参数值
例如:规格例如:10cm*20cm
+
* 交易条件 + + + + + + + + + + + + + + + +
计量单位产品单价起订量库存发货期限
/ 天内
+
* 详细说明 +
+
* 过期时间  +  + 不选表示长期有效
* 会员信息 + onclick="Dh('d_guest');Ds('d_member');Dd('username').value='';" id="ismember_1"/>    + onclick="Dh('d_member');Ds('d_guest');Dd('username').value='';" id="ismember_0"/> +
* 会员名 [资料]
* 会员推荐产品 +/> 是    +/> 否 +
* 公司名称 个人请填姓名 例如:张三
* 所在地区
* 联系人
* 联系手机
* 电子邮件
* 联系电话
* 联系地址
* QQ
* 微信
* 阿里旺旺
* Skype
* 信息状态 +/> 通过 +/> 待审 + onclick="if(this.checked) Dd('note').style.display='';"/> 拒绝 +/> 过期 +/> 删除 +
* 拒绝理由
* 添加时间
* 浏览次数
* 内容收费大于0的数字表示具体收费价格');?> +
* 内容模板系统会自动继承分类或模块设置');?>
* 自定义文件路径  请确保目录和文件名合法且可写入,否则可能生成失败');?> 
+
    
+
+ + +
+ + + +
单页采编
+ + + + + +
* 目标网址    
+
+ + + + \ No newline at end of file diff --git a/module/sell/admin/template/index.html b/module/sell/admin/template/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/sell/admin/template/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/sell/index.html b/module/sell/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/sell/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/sell/search.inc.php b/module/sell/search.inc.php new file mode 100644 index 0000000..82c8ecf --- /dev/null +++ b/module/sell/search.inc.php @@ -0,0 +1,188 @@ + $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($price) $condition .= " AND price>0 AND unit<>''"; + if($minprice) $condition .= " AND price>=$minprice"; + if($maxprice) $condition .= " AND price<=$maxprice"; + 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']); + } + if($MOD['sphinx']) exit(include DT_ROOT.'/module/'.$module.'/sphinx.inc.php'); + $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); + } + $minprice = isset($minprice) ? dround($minprice) : ''; + $minprice or $minprice = ''; + $maxprice = isset($maxprice) ? dround($maxprice) : ''; + $maxprice or $maxprice = ''; + $elite = isset($elite) ? intval($elite) : 0; + (isset($orderby) && in_array($orderby, array('dmessages', 'dorders', 'dprice', 'aprice'))) 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"; + if($minprice) $condition .= " AND price>=$minprice"; + if($maxprice) $condition .= " AND price<=$maxprice"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize); + if($items) { + $order = $MOD['order']; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + if($kw) $r['title'] = str_replace($kw, ''.$kw.'', $r['title']); + $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); +?> \ No newline at end of file diff --git a/module/special/admin/config.inc.php b/module/special/admin/config.inc.php new file mode 100644 index 0000000..1ac7a6e --- /dev/null +++ b/module/special/admin/config.inc.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/module/special/admin/remkdir.inc.php b/module/special/admin/remkdir.inc.php new file mode 100644 index 0000000..fee27d3 --- /dev/null +++ b/module/special/admin/remkdir.inc.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/module/special/admin/template/item.tpl.php b/module/special/admin/template/item.tpl.php new file mode 100644 index 0000000..b8d7389 --- /dev/null +++ b/module/special/admin/template/item.tpl.php @@ -0,0 +1,79 @@ + +
+ +
+
+ + + + + + + + + + + +$v) {?> + + + + + + + + + + + + +
分类图片标题会员添加时间 操作
+ + + +未分类 + + + + + + + + + +  + +
+
+  +
+
+'.$pages.'
' : '';?> + + \ No newline at end of file diff --git a/module/special/admin/uninstall.inc.php b/module/special/admin/uninstall.inc.php new file mode 100644 index 0000000..ff2e6d7 --- /dev/null +++ b/module/special/admin/uninstall.inc.php @@ -0,0 +1,6 @@ +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."_item_".$moduleid."`"); +?> \ No newline at end of file diff --git a/module/special/index.inc.php b/module/special/index.inc.php new file mode 100644 index 0000000..7c00d22 --- /dev/null +++ b/module/special/index.inc.php @@ -0,0 +1,40 @@ +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); +?> \ No newline at end of file diff --git a/module/special/list.inc.php b/module/special/list.inc.php new file mode 100644 index 0000000..b8124ef --- /dev/null +++ b/module/special/list.inc.php @@ -0,0 +1,92 @@ +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; + $target = '_blank'; + $width = 168; + $height = 124; + 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); +?> \ No newline at end of file diff --git a/module/special/search.inc.php b/module/special/search.inc.php new file mode 100644 index 0000000..5a47e3d --- /dev/null +++ b/module/special/search.inc.php @@ -0,0 +1,155 @@ + $DT['max_kw']) message(lang($L['word_limit'], array($DT['min_kw'], $DT['max_kw'])), $MOD['linkurl'].'search.php'); + if($DT['search_limit'] && $page == 1) { + if(($DT_TIME - $DT['search_limit']) < get_cookie('last_search')) message(lang($L['time_limit'], array($DT['search_limit'])), $MOD['linkurl'].'search.php'); + set_cookie('last_search', $DT_TIME); + } + } + + $pptsql = ''; + if($CP) { + require DT_ROOT.'/include/property.func.php'; + $PPT = property_condition($catid); + foreach($PPT as $k=>$v) { + $PPT[$k]['select'] = ''; + $oid = $v['oid']; + $tmp = 'ppt_'.$oid; + if(isset($$tmp)) { + $PPT[$k]['select'] = $tmp = strip_kw($$tmp); + if($tmp && in_array($tmp, $v['options'])) { + $tmp = 'O'.$oid.':'.$tmp.';'; + $pptsql .= match_kw('pptword', $tmp); + } + } + } + } + $fds = $MOD['fields']; + $condition = ''; + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($dfields[$fields] == 'content') { + if($keyword && $MOD['fulltext'] == 1) $condition .= match_kw($dfields[$fields], $keyword); + $condition = str_replace('AND ', 'AND i.', $condition); + $condition = str_replace('i.content', 'd.content', $condition); + $condition = "i.status=3 AND i.itemid=d.itemid".$condition; + if($keyword && $MOD['fulltext'] == 2) $condition .= " AND MATCH(`content`) AGAINST('$kw'".(preg_match("/[+-<>()~*]/", $kw) ? ' IN BOOLEAN MODE' : '').")"; + $table = $table.' i,'.$table_data.' d'; + $fds = 'i.'.str_replace(',', ',i.', $fds); + } else { + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($pptsql) $condition .= $pptsql;//PPT + $condition = "status=3".$condition; + } + $pagesize = $MOD['pagesize']; + $offset = ($page-1)*$pagesize; + $items = $db->count($table, $condition, $DT['cache_search']); + $pages = pages($items, $page, $pagesize); + if($items) { + $order = $dorder[$order] ? " ORDER BY $dorder[$order]" : ''; + $result = $db->query("SELECT {$fds} FROM {$table} WHERE {$condition}{$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + if($kw) { + $replacef = explode(' ', $kw); + $replacet = array_map('highlight', $replacef); + } + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if($kw) $r['title'] = str_replace($replacef, $replacet, $r['title']); + if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $tags[] = $r; + } + $db->free_result($result); + } + } + if($page == 1 && $kw && $DT['search_kw']) keyword($DT['search_kw'], $_username, $kw, $items, $moduleid); + $showpage = 1; + $datetype = 3; + $target = '_blank'; + $width = 168; + $height = 124; + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + if($kw) { + check_group($_groupid, $MOD['group_search']) or message($L['msg_no_search']); + } else if($catid) { + $CAT or message($L['msg_not_cate']); + if(!check_group($_groupid, $MOD['group_list']) || !check_group($_groupid, $CAT['group_list'])) message($L['msg_no_right']); + } else { + check_group($_groupid, $MOD['group_index']) or message($L['msg_no_right']); + } + $head_title = $MOD['name'].$DT['seo_delimiter'].$head_title; + if($kw) $head_title = $kw.$DT['seo_delimiter'].$head_title; + if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) { + $areaid = $cityid; + $ARE = get_area($areaid); + } + $elite = isset($elite) ? intval($elite) : 0; + (isset($orderby) && in_array($orderby, array('dlikes', 'dhits', 'dcomments'))) or $orderby = ''; + $tags = array(); + if($DT_QST) { + $condition = "status=3"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= $CAT['child'] ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($elite) $condition .= " AND level>0"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize); + $tags = array(); + if($items) { + $order = $MOD['order']; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + if($kw) $r['title'] = str_replace($kw, ''.$kw.'', $r['title']); + if(!$r['islink']) $r['linkurl'] = $MOD['mobile'].$r['linkurl']; + $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); +?> \ No newline at end of file diff --git a/module/special/special.class.php b/module/special/special.class.php new file mode 100644 index 0000000..1a7ed46 --- /dev/null +++ b/module/special/special.class.php @@ -0,0 +1,278 @@ +moduleid = $moduleid; + $this->table = $table; + $this->table_data = $table_data; + $this->split = $MOD['split']; + $this->fields = array('catid','areaid','level','title','style','introduce','thumb','banner','cfg_photo','cfg_video','cfg_type','seo_title','seo_keywords','seo_description','tag','status','hits','username','addtime', 'editor','edittime','ip','template','islink','linkurl','filepath','domain','note'); + } + + function special($moduleid) { + $this->__construct($moduleid); + } + + function pass($post) { + if(!is_array($post)) return false; + if(!$post['catid']) return $this->_(lang('message->pass_catid')); + if(strlen($post['title']) < 3) return $this->_(lang('message->pass_title')); + if(!is_url($post['thumb'])) return $this->_(lang('message->pass_thumb')); + if(isset($post['islink']) && !$post['linkurl']) return $this->_(lang('message->pass_linkurl')); + if(DT_MAX_LEN && strlen(clear_img($post['content'])) > DT_MAX_LEN) $this->_(lang('message->pass_max')); + return true; + } + + function set($post) { + global $MOD, $_username, $_userid, $_cname; + is_url($post['banner']) or $post['banner'] = ''; + $post['filepath'] = (isset($post['filepath']) && is_filepath($post['filepath'])) ? file_vname($post['filepath']) : ''; + $post['islink'] = isset($post['islink']) ? 1 : 0; + $post['addtime'] = (isset($post['addtime']) && is_time($post['addtime'])) ? datetotime($post['addtime']) : DT_TIME; + $post['editor'] = $_cname ? $_cname : $_username; + $post['edittime'] = DT_TIME; + $post['cfg_photo'] = intval($post['cfg_photo']); + $post['cfg_video'] = intval($post['cfg_video']); + $post['cfg_type'] = intval($post['cfg_type']); + $post['content'] = stripslashes($post['content']); + $post['content'] = save_local($post['content']); + if($post['content'] && isset($post['clear_link']) && $post['clear_link']) $post['content'] = clear_link($post['content']); + if($post['content'] && isset($post['save_remotepic']) && $post['save_remotepic']) $post['content'] = save_remote($post['content']); + if($MOD['introduce_length']) $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); + if($this->itemid) { + $new = $post['content']; + if($post['thumb']) $new .= ''; + if($post['banner']) $new .= ''; + $r = $this->get_one(); + $old = $r['content']; + if($r['thumb']) $old .= ''; + if($r['banner']) $old .= ''; + delete_diff($new, $old); + } else { + $post['ip'] = DT_IP; + } + $content = $post['content']; + unset($post['content']); + $post = dhtmlspecialchars($post); + $post['content'] = addslashes(dsafe($content)); + return array_map("trim", $post); + } + + function get_one() { + $r = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$this->itemid"); + if($r) { + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + $t = DB::get_one("SELECT content FROM {$content_table} WHERE itemid=$this->itemid"); + $r['content'] = $t ? $t['content'] : ''; + return $r; + } else { + return array(); + } + } + + function get_list($condition = 'status=3', $order = 'addtime DESC', $cache = '') { + global $MOD, $pages, $page, $pagesize, $offset, $items, $sum; + if($page > 1 && $sum) { + $items = $sum; + } else { + $r = DB::get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE $condition", $cache); + $items = $r['num']; + } + $pages = defined('CATID') ? listpages(1, CATID, $items, $page, $pagesize, 10, $MOD['linkurl']) : pages($items, $page, $pagesize); + if($items < 1) return array(); + $lists = $catids = $CATS = array(); + $result = DB::query("SELECT * FROM {$this->table} WHERE $condition ORDER BY $order LIMIT $offset,$pagesize", $cache); + while($r = DB::fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + $r['alt'] = $r['title']; + $r['title'] = set_style($r['title'], $r['style']); + if(!$r['islink']) $r['linkurl'] = $MOD['linkurl'].$r['linkurl']; + $catids[$r['catid']] = $r['catid']; + $lists[] = $r; + } + if($catids) { + $result = DB::query("SELECT catid,catname,linkurl FROM ".DT_PRE."category WHERE catid IN (".implode(',', $catids).")"); + while($r = DB::fetch_array($result)) { + $CATS[$r['catid']] = $r; + } + if($CATS) { + foreach($lists as $k=>$v) { + $lists[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; + $lists[$k]['caturl'] = $v['catid'] ? $MOD['linkurl'].$CATS[$v['catid']]['linkurl'] : ''; + } + } + } + return $lists; + } + + function add($post) { + global $MOD; + $post = $this->set($post); + $sqlk = $sqlv = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) { $sqlk .= ','.$k; $sqlv .= ",'$v'"; } + } + $sqlk = substr($sqlk, 1); + $sqlv = substr($sqlv, 1); + DB::query("INSERT INTO {$this->table} ($sqlk) VALUES ($sqlv)"); + $this->itemid = DB::insert_id(); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) { + credit_add($post['username'], $MOD['credit_add']); + credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + clear_upload($post['content'].$post['thumb'].$post['banner'], $this->itemid); + return $this->itemid; + } + + function edit($post) { + $this->delete($this->itemid, false); + $post = $this->set($post); + $sql = ''; + foreach($post as $k=>$v) { + if(in_array($k, $this->fields)) $sql .= ",$k='$v'"; + } + $sql = substr($sql, 1); + DB::query("UPDATE {$this->table} SET $sql WHERE itemid=$this->itemid"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$this->itemid', '$post[content]')"); + $this->update($this->itemid); + clear_upload($post['content'].$post['thumb'].$post['banner'], $this->itemid); + if($post['status'] > 2) { + history($this->moduleid, $this->itemid, 'del'); + $this->tohtml($this->itemid, $post['catid']); + } + return true; + } + + function tohtml($itemid = 0, $catid = 0) { + global $module, $MOD; + if($MOD['show_html'] && $itemid) tohtml('show', $module, "itemid=$itemid"); + } + + function update($itemid) { + $item = DB::get_one("SELECT * FROM {$this->table} WHERE itemid=$itemid"); + $update = ''; + $keyword = $item['title'].','.strip_tags(cat_pos(get_cat($item['catid']), ',')); + if($keyword != $item['keyword']) { + $keyword = str_replace("//", '', addslashes($keyword)); + $update .= ",keyword='$keyword'"; + } + $item['itemid'] = $itemid; + $linkurl = (isset($item['domain']) && $item['domain']) ? $item['domain'] : ($item['islink'] ? $item['linkurl'] : itemurl($item)); + if($linkurl != $item['linkurl']) $update .= ",linkurl='$linkurl'"; + if($update) DB::query("UPDATE {$this->table} SET ".(substr($update, 1))." WHERE itemid=$itemid"); + } + + function recycle($itemid) { + if(is_array($itemid)) { + foreach($itemid as $v) { $this->recycle($v); } + } else { + DB::query("UPDATE {$this->table} SET status=0 WHERE itemid=$itemid"); + $this->delete($itemid, false); + return true; + } + } + + function restore($itemid) { + global $module, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->restore($v); } + } else { + DB::query("UPDATE {$this->table} SET status=3 WHERE itemid=$itemid"); + if($MOD['show_html']) tohtml('show', $module, "itemid=$itemid"); + return true; + } + } + + function delete($itemid, $all = true) { + global $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { + $this->delete($v, $all); + } + } else { + $this->itemid = $itemid; + $r = $this->get_one(); + if($MOD['show_html'] && !$r['islink']) { + $_file = DT_ROOT.'/'.$MOD['moduledir'].'/'.$r['linkurl']; + html_del($_file); + } + if($all) { + $userid = get_user($r['username']); + if($r['thumb']) delete_upload($r['thumb'], $userid); + if($r['banner']) delete_upload($r['banner'], $userid); + if($r['content']) delete_local($r['content'], $userid); + DB::query("DELETE FROM {$this->table} WHERE itemid=$itemid"); + DB::query("DELETE FROM ".DT_PRE."special_item_".$this->moduleid." WHERE specialid=$itemid"); + DB::query("DELETE FROM ".DT_PRE."type WHERE item='special-".$itemid."'"); + $content_table = content_table($this->moduleid, $this->itemid, $this->split, $this->table_data); + DB::query("DELETE FROM {$content_table} WHERE itemid=$itemid"); + if($MOD['cat_property']) DB::query("DELETE FROM ".DT_PRE."category_value WHERE moduleid=$this->moduleid AND itemid=$itemid"); + if($r['username'] && $MOD['credit_del']) { + credit_add($r['username'], -$MOD['credit_del']); + credit_record($r['username'], -$MOD['credit_del'], 'system', lang('my->credit_record_del', array($MOD['name'])), 'ID:'.$this->itemid); + } + history($this->moduleid, $itemid, 'del'); + } + } + } + + function check($itemid) { + global $_username, $MOD; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->check($v); } + } else { + $this->itemid = $itemid; + $item = $this->get_one(); + if($MOD['credit_add'] && $item['username'] && $item['hits'] < 1) { + credit_add($item['username'], $MOD['credit_add']); + credit_record($item['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid); + } + DB::query("UPDATE {$this->table} SET status=3,editor='$_username',edittime=".DT_TIME." WHERE itemid=$itemid"); + history($this->moduleid, $itemid, 'del'); + $this->tohtml($itemid); + return true; + } + } + + function reject($itemid) { + global $_username; + if(is_array($itemid)) { + foreach($itemid as $v) { $this->reject($v); } + } else { + DB::query("UPDATE {$this->table} SET status=1,editor='$_username' WHERE itemid=$itemid"); + return true; + } + } + + function clear($condition = 'status=0') { + $result = DB::query("SELECT itemid FROM {$this->table} WHERE $condition"); + while($r = DB::fetch_array($result)) { + $this->delete($r['itemid']); + } + } + + function level($itemid, $level) { + $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid; + DB::query("UPDATE {$this->table} SET level=$level WHERE itemid IN ($itemids)"); + } + + function _($e) { + $this->errmsg = $e; + return false; + } +} +?> \ No newline at end of file diff --git a/module/video/admin/config.inc.php b/module/video/admin/config.inc.php new file mode 100644 index 0000000..323c3d2 --- /dev/null +++ b/module/video/admin/config.inc.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/module/video/admin/index.inc.php b/module/video/admin/index.inc.php new file mode 100644 index 0000000..a995115 --- /dev/null +++ b/module/video/admin/index.inc.php @@ -0,0 +1,207 @@ + 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($ip) $condition .= " AND ip='$ip'"; + if($username) $condition .= " AND username='$username'"; + if($itemid) $condition .= " AND itemid=$itemid"; + + $timetype = strpos($dorder[$order], 'add') !== false ? 'add' : ''; +} +switch($action) { + case 'add': + if($submit) { + if($do->pass($post)) { + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + $do->add($post); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + if($MOD['show_html'] && $post['status'] > 2) $do->tohtml($do->itemid); + dmsg('添加成功', '?moduleid='.$moduleid.'&action='.$action.'&catid='.$post['catid']); + } else { + msg($do->errmsg); + } + } else { + foreach($do->fields as $v) { + isset($$v) or $$v = ''; + } + $content = ''; + $status = 3; + $addtime = timetodate($DT_TIME); + $totime = ''; + $username = $_username; + $width = $MOD['video_width']; + $height = $MOD['video_height']; + $item = array(); + $menuid = 0; + isset($url) or $url = ''; + if($url) { + $tmp = fetch_url($url); + if($tmp) extract($tmp); + } + $history = 0; + include tpl('edit', $module); + } + break; + case 'edit': + $itemid or msg(); + $do->itemid = $itemid; + if($submit) { + if($do->pass($post)) { + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + dmsg('修改成功', $forward); + } else { + msg($do->errmsg); + } + } else { + $item = $do->get_one(); + extract($item); + $history = history($moduleid, $itemid); + $addtime = timetodate($addtime); + $menuon = array('4', '3', '2', '1'); + $menuid = $menuon[$status]; + include tpl($action, $module); + } + break; + case 'move': + if($submit) { + $fromids or msg('请填写来源ID'); + if($tocatid) { + $db->query("UPDATE {$table} SET catid=$tocatid WHERE `{$fromtype}` IN ($fromids)"); + dmsg('移动成功', $forward); + } else { + msg('请选择目标分类'); + } + } else { + $itemid = $itemid ? implode(',', $itemid) : ''; + $menuid = 5; + include tpl($action); + } + break; + case 'update': + is_array($itemid) or msg('请选择'.$MOD['name']); + foreach($itemid as $v) { + $do->update($v); + } + dmsg('更新成功', $forward); + break; + case 'tohtml': + is_array($itemid) or msg('请选择'.$MOD['name']); + foreach($itemid as $itemid) { + tohtml('show', $module); + } + dmsg('生成成功', $forward); + break; + case 'delete': + $itemid or msg('请选择'.$MOD['name']); + isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid); + dmsg('删除成功', $forward); + break; + case 'restore': + $itemid or msg('请选择'.$MOD['name']); + $do->restore($itemid); + dmsg('还原成功', $forward); + break; + case 'clear': + $do->clear(); + dmsg('清空成功', $forward); + break; + case 'level': + $itemid or msg('请选择'.$MOD['name']); + $level = intval($level); + $do->level($itemid, $level); + dmsg('级别设置成功', $forward); + break; + case 'recycle': + $lists = $do->get_list('status=0'.$condition, $dorder[$order]); + $menuid = 4; + include tpl('index', $module); + break; + case 'reject': + if($itemid && !$psize) { + $do->reject($itemid); + dmsg('拒绝成功', $forward); + } else { + $lists = $do->get_list('status=1'.$condition, $dorder[$order]); + $menuid = 3; + include tpl('index', $module); + } + break; + case 'check': + if($itemid && !$psize) { + $do->check($itemid); + dmsg('审核成功', $forward); + } else { + $lists = $do->get_list('status=2'.$condition, $dorder[$order]); + $menuid = 2; + include tpl('index', $module); + } + break; + default: + $lists = $do->get_list('status=3'.$condition, $dorder[$order]); + $menuid = 1; + include tpl('index', $module); + break; +} +?> \ No newline at end of file diff --git a/module/video/admin/template/index.html b/module/video/admin/template/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/module/video/admin/template/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/video/admin/uninstall.inc.php b/module/video/admin/uninstall.inc.php new file mode 100644 index 0000000..7c6acf7 --- /dev/null +++ b/module/video/admin/uninstall.inc.php @@ -0,0 +1,5 @@ +query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_".$moduleid."`"); +$db->query("DROP TABLE IF EXISTS `".$DT_PRE.$module."_data_".$moduleid."`"); +?> \ No newline at end of file diff --git a/module/video/list.inc.php b/module/video/list.inc.php new file mode 100644 index 0000000..4ae2fd5 --- /dev/null +++ b/module/video/list.inc.php @@ -0,0 +1,91 @@ +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 = 3; + $target = '_blank'; + $width = 168; + $height = 124; + 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); +?> \ No newline at end of file diff --git a/module/video/my.inc.php b/module/video/my.inc.php new file mode 100644 index 0000000..1d2d237 --- /dev/null +++ b/module/video/my.inc.php @@ -0,0 +1,228 @@ +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; +} +$MOD['upload'] = implode('|', array_intersect(explode('|', $MOD['upload']), explode('|', $MG['uploadtype'] ? $MG['uploadtype'] : $DT['uploadtype']))); +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($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['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0; + $post['username'] = $_username; + $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 { + if($itemid) { + $MG['copy'] && $_userid or dheader(($DT_PC ? $MODULE[2]['linkurl'] : $MODULE[2]['mobile']).'account.php?action=group&itemid=1'); + + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + extract($item); + $thumb = ''; + $totime = $totime > $DT_TIME ? timetodate($totime, 3) : ''; + } else { + $_catid = $catid; + foreach($do->fields as $v) { + $$v = ''; + } + $content = ''; + $catid = $_catid; + $areaid = $cityid; + $width = $MOD['video_width']; + $height = $MOD['video_height']; + } + $item = array(); + } + break; + case 'edit': + $itemid or message(); + $do->itemid = $itemid; + $item = $do->get_one(); + if(!$item || $item['username'] != $_username) message(); + + if($MG['edit_limit'] < 0) message($L['edit_refuse']); + if($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit']*86400) message(lang($L['edit_limit'], array($MG['edit_limit']))); + + if($submit) { + if($do->pass($post)) { + $CAT = get_cat($post['catid']); + if(!$CAT || !check_group($_groupid, $CAT['group_add'])) dalert(lang($L['group_add'], array($CAT['catname']))); + $post['addtime'] = timetodate($item['addtime']); + $post['level'] = $item['level']; + $post['fee'] = $item['fee']; + $post['style'] = addslashes($item['style']); + $post['template'] = addslashes($item['template']); + $post['filepath'] = addslashes($item['filepath']); + $post['note'] = addslashes($item['note']); + $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; + $post['status'] = get_status($item['status'], $need_check); + $post['hits'] = $item['hits']; + $post['save_remotepic'] = $MOD['save_remotepic'] ? 1 : 0; + $post['username'] = $_username; + if($FD) fields_check($post_fields); + if($CP) property_check($post_ppt); + if($FD) fields_update($post_fields, $table, $do->itemid); + if($CP) property_update($post_ppt, $moduleid, $post['catid'], $do->itemid); + $do->edit($post); + if($post['status'] < 3 && $item['status'] > 2) history($moduleid, $itemid, 'set', $item); + set_cookie('dmsg', $post['status'] == 2 ? $L['success_edit_check'] : $L['success_edit']); + dalert('', '', 'parent.window.location="'.($post['status'] == 2 ? '?mid='.$moduleid.'&status=2' : $forward).'"'); + } else { + dalert($do->errmsg); + } + } else { + extract($item); + } + 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, 4)) or $status = 3; + $condition = "username='$_username'"; + $condition .= " AND status=$status"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + $timetype = strpos($MOD['order'], 'add') !== false ? 'add' : ''; + $lists = $do->get_list($condition, $MOD['order']); + break; +} +if($_userid) { + $nums = array(); + for($i = 1; $i < 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'); +?> \ No newline at end of file diff --git a/module/video/search.inc.php b/module/video/search.inc.php new file mode 100644 index 0000000..954db8a --- /dev/null +++ b/module/video/search.inc.php @@ -0,0 +1,156 @@ + $DT['max_kw']) message(lang($L['word_limit'], array($DT['min_kw'], $DT['max_kw'])), $MOD['linkurl'].'search.php'); + if($DT['search_limit'] && $page == 1) { + if(($DT_TIME - $DT['search_limit']) < get_cookie('last_search')) message(lang($L['time_limit'], array($DT['search_limit'])), $MOD['linkurl'].'search.php'); + set_cookie('last_search', $DT_TIME); + } + } + + $pptsql = ''; + if($CP) { + require DT_ROOT.'/include/property.func.php'; + $PPT = property_condition($catid); + foreach($PPT as $k=>$v) { + $PPT[$k]['select'] = ''; + $oid = $v['oid']; + $tmp = 'ppt_'.$oid; + if(isset($$tmp)) { + $PPT[$k]['select'] = $tmp = strip_kw($$tmp); + if($tmp && in_array($tmp, $v['options'])) { + $tmp = 'O'.$oid.':'.$tmp.';'; + $pptsql .= match_kw('pptword', $tmp); + } + } + } + } + $fds = $MOD['fields']; + $condition = ''; + if($catid) $condition .= ($CAT['child']) ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($dfields[$fields] == 'content') { + if($keyword && $MOD['fulltext'] == 1) $condition .= match_kw($dfields[$fields], $keyword); + $condition = str_replace('AND ', 'AND i.', $condition); + $condition = str_replace('i.content', 'd.content', $condition); + $condition = "i.status=3 AND i.itemid=d.itemid".$condition; + if($keyword && $MOD['fulltext'] == 2) $condition .= " AND MATCH(`content`) AGAINST('$kw'".(preg_match("/[+-<>()~*]/", $kw) ? ' IN BOOLEAN MODE' : '').")"; + $table = $table.' i,'.$table_data.' d'; + $fds = 'i.'.str_replace(',', ',i.', $fds); + } else { + if($keyword) $condition .= match_kw($dfields[$fields], $keyword); + if($pptsql) $condition .= $pptsql;//PPT + $condition = "status=3".$condition; + } + $pagesize = $MOD['pagesize']; + $offset = ($page-1)*$pagesize; + $items = $db->count($table, $condition, $DT['cache_search']); + $pages = pages($items, $page, $pagesize); + if($items) { + $order = $dorder[$order] ? " ORDER BY $dorder[$order]" : ''; + $result = $db->query("SELECT {$fds} FROM {$table} WHERE {$condition}{$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + if($kw) { + $replacef = explode(' ', $kw); + $replacet = array_map('highlight', $replacef); + } + while($r = $db->fetch_array($result)) { + $r['adddate'] = timetodate($r['addtime'], 5); + $r['editdate'] = timetodate($r['edittime'], 5); + if($lazy && isset($r['thumb']) && $r['thumb']) $r['thumb'] = DT_SKIN.'image/lazy.gif" original="'.$r['thumb']; + $r['alt'] = $r['title']; + $r['title'] = dsubstr($r['title'], 20); + $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 = 3; + $target = '_blank'; + $width = 168; + $height = 124; + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $DT_URL); +} else { + if($kw) { + check_group($_groupid, $MOD['group_search']) or message($L['msg_no_search']); + } else if($catid) { + $CAT or message($L['msg_not_cate']); + if(!check_group($_groupid, $MOD['group_list']) || !check_group($_groupid, $CAT['group_list'])) message($L['msg_no_right']); + } else { + check_group($_groupid, $MOD['group_index']) or message($L['msg_no_right']); + } + $head_title = $MOD['name'].$DT['seo_delimiter'].$head_title; + if($kw) $head_title = $kw.$DT['seo_delimiter'].$head_title; + if(!$areaid && $cityid && strpos($DT_URL, 'areaid') === false) { + $areaid = $cityid; + $ARE = get_area($areaid); + } + $elite = isset($elite) ? intval($elite) : 0; + (isset($orderby) && in_array($orderby, array('dlikes', 'dhits', 'dcomments'))) or $orderby = ''; + $tags = array(); + if($DT_QST) { + $condition = "status=3"; + if($keyword) $condition .= match_kw('keyword', $keyword); + if($catid) $condition .= $CAT['child'] ? " AND catid IN (".$CAT['arrchildid'].")" : " AND catid=$catid"; + if($areaid) $condition .= $ARE['child'] ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid"; + if($elite) $condition .= " AND level>0"; + $r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE'); + $items = $r['num']; + $pages = mobile_pages($items, $page, $pagesize); + $tags = array(); + if($items) { + $order = $MOD['order']; + if($orderby) $order = substr($orderby, 0, 1) == 'd' ? substr($orderby, 1).' DESC' : substr($orderby, 1).' ASC'; + $time = strpos($MOD['order'], 'add') !== false ? 'addtime' : 'edittime'; + $result = $db->query("SELECT ".$MOD['fields']." FROM {$table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); + while($r = $db->fetch_array($result)) { + if($kw) $r['title'] = str_replace($kw, ''.$kw.'', $r['title']); + $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); +?> \ No newline at end of file diff --git a/module/video/show.inc.php b/module/video/show.inc.php new file mode 100644 index 0000000..585caf3 --- /dev/null +++ b/module/video/show.inc.php @@ -0,0 +1,69 @@ +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($modurl.$item['linkurl']); + extract($item); +} else { + include load('404.inc'); +} +$CAT = get_cat($catid); +if(!check_group($_groupid, $CAT['group_show'])) include load('403.inc'); +$content_table = content_table($moduleid, $itemid, $MOD['split'], $table_data); +$t = $db->get_one("SELECT content FROM {$content_table} WHERE itemid=$itemid"); +$content = $t['content']; +$adddate = timetodate($addtime, 3); +$editdate = timetodate($edittime, 3); +if($DT_PC) { + 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); + } + $linkurl = $MOD['linkurl'].$linkurl; + $maincat = get_maincat(0, $moduleid); + $keytags = $tag ? explode(' ', $tag) : array(); + $player = DC::player($video, $width, $height, $MOD['autostart']); + $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 = ''; + } else { + $user_status = 3; + } + if($EXT['mobile_enable']) $head_mobile = str_replace($MOD['linkurl'], $MOD['mobile'], $linkurl); +} else { + $member = array(); + $fee = DC::fee($item['fee'], $MOD['fee_view']); + include DT_ROOT.'/mobile/api/content.inc.php'; + if($content) { + if($MOD['keylink']) $content = DC::keylink($content, $moduleid, $DT_PC); + if($share_icon) $share_icon = DC::icon($thumb, $content); + DC::format($content, $DT_PC); + } + $player = DC::player($video, '100%', '100%', $MOD['autostart'], 0, ' playsinline -webkit-playsinline webkit-playsinline'); + $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); +?> \ No newline at end of file diff --git a/skin/default/archiver.css b/skin/default/archiver.css new file mode 100644 index 0000000..d18ab86 --- /dev/null +++ b/skin/default/archiver.css @@ -0,0 +1,29 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +body {font-size:16px;margin:0;font-family:"Microsoft Yahei",Tahoma,Verdana,Arial} +form {margin:0px;} +a:link,a:visited,a:active {color:#007AFF;text-decoration:none;} +a:hover {color:#FF5500;} +img {border:0;margin:5px;} +li {line-height:32px;list-style-type:circle;color:#666666;} +em {font-size:12px;color:#666666;font-style:normal;float:right;} +#nav {background:#007AFF;line-height:44px;display:table;width:100%;letter-spacing:1px;} +#nav div {padding:0 16px;float:left;} +#nav span {color:#FFFFFF;} +#nav .on {background:#0072C6;} +#title {background:#EEEEEE;line-height:44px;padding:0 16px;} +#title strong {font-weight:normal;} +#content {padding:0 16px 16px 16px;} + +.pages {padding:24px 0;text-align:center;font-size:12px;color:#666666;} +.pages a:link,.pages a:visited,.pages a:active {background:#FFFFFF;border:#EEEEEE 1px solid;padding:6px;text-decoration:none;} +.pages a:hover {background:#258CFF;border:#258CFF 1px solid;color:#FFFFFF;padding:6px;text-decoration:none;} +.pages strong {background:#258CFF;padding:6px;border:#258CFF 1px solid;color:#FFFFFF;} +.pages_inp {width:32px;border:#EEEEEE 1px solid;color:#666666;padding:4px;text-align:center;} +.pages_btn {width:32px;border:#FF6600 1px solid;color:#FFFFFF;padding:4px 6px;background:#FF6600;font-weight:bold;font-size:11px;} +.pages label {background:#FFFFFF;border:#EEEEEE 1px solid;color:#666666;padding:6px 6px;} +.pages label em {color:red;font-weight:bold;font-style:normal;} +.pages label span {font-weight:bold;} +.pages cite {font-style:normal;} \ No newline at end of file diff --git a/skin/default/article.css b/skin/default/article.css new file mode 100644 index 0000000..a49aa4f --- /dev/null +++ b/skin/default/article.css @@ -0,0 +1,23 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +/* article && quote*/ +.top-l {width:430px;float:left;margin-right:20px;} +.top-r {width:430px;float:right;} +.headline h2 {text-align:center;font-size:24px;margin:16px 20px 10px 0;height:48px;line-height:48px;overflow:hidden;} +.subline {padding:0 16px;} +.subline li {height:32px;line-height:32px;overflow:hidden;font-size:16px;} +.subline .f_r {font-size:12px;color:#666666;padding-left:16px;font-style:normal;float:right;} +.keytags {font-size:14px;padding:16px 24px;} +/* catlist */ +.childlist {padding:10px;line-height:24px;} +.childlist li {font-size:14px;height:28px;line-height:28px;background:url('image/li_dot.gif') no-repeat 4px 12px;padding:0 10px 0 12px;overflow:hidden;} + +.catlist {padding-bottom:16px;line-height:32px;margin:16px;} +.catlist li {font-size:14px;height:32px;line-height:32px;background:url('image/li_dot.gif') no-repeat 6px center;padding:0 16px;overflow:hidden;} +.catlist i {font-style:normal;float:right;font-size:12px;color:#666666;} +.catlist .sp {background:#FFFFFF url('image/dot.gif') repeat-x 0 center;} + +.subtitle {padding:10px 16px;margin:20px 0;line-height:32px;font-size:14px;border:#EEEEEE 1px solid;background:#FAFAFA;overflow:hidden;} +.subtitle li {width:50%;height:32px;overflow:hidden;float:left;} diff --git a/skin/default/buy.css b/skin/default/buy.css new file mode 100644 index 0000000..62cdb86 --- /dev/null +++ b/skin/default/buy.css @@ -0,0 +1,4 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ \ No newline at end of file diff --git a/skin/default/cart.css b/skin/default/cart.css new file mode 100644 index 0000000..5c80082 --- /dev/null +++ b/skin/default/cart.css @@ -0,0 +1,19 @@ +.cart-foot {height:48px;line-height:48px;color:#666666;margin-top:20px;padding-left:20px;} +.cart-foot p {height:48px;text-align:right;margin:0 20px 0 0;} +.cart-foot input {width:96px;height:48px;line-height:48px;border:none;background:#FF6600;color:#FFFFFF;font-size:20px;text-align:center;padding:0;letter-spacing:2px;cursor:pointer;} +.cart-foot input:hover {background:#F22D00;} + +.cart-msg {padding:96px;text-align:center;font-size:16px;} +.cart-promo {line-height:22px;background:#FFDEDF;text-align:center;color:#DF3033;border-left:#DF3033 1px dotted;border-right:#DF3033 1px dotted;border-top:#DF3033 1px solid;border-bottom:#DF3033 1px solid;} +.cart-promo:hover {background:#FFFFFF;} + +.cart-step {padding:20px 10px;} +.cart-step div {font-size:14px;font-weight:bold;line-height:20px;} +.cart-step span {float:right;} +.cart-step b {display:inline-block;width:20px;height:20px;text-align:center;border-radius:50%;background:#FF6600;color:#FFFFFF;margin-right:10px;} + +#cart_tip {width:350px;z-index:1000;position:absolute;margin:-40px 0 0 -15px;background:#FFFFFF;border:#A0BCCA 1px solid;padding:0 0 15px 0;} +#cart_tip p {margin:0;background:#D2EDFF;padding:6px 4px 4px 6px;font-size:13px;font-weight:bold;} +#cart_tip div {background:url('image/okay.gif') no-repeat 15px 10px;padding:15px 20px 10px 50px;font-size:13px;} +#cart_tip span {color:#FF6600;font-weight:bold;} +#cart_tip img {float:right;cursor:pointer;} \ No newline at end of file diff --git a/skin/default/comment.css b/skin/default/comment.css new file mode 100644 index 0000000..ef904d5 --- /dev/null +++ b/skin/default/comment.css @@ -0,0 +1,54 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +/* global */ +.comment {padding:16px 0;margin:0 16px;border-top:#EEEEEE 1px solid;} +.comment table {width:100%;border-collapse:collapse;border-spacing:0;} +.comment_l {width:54px;padding:6px 0 0 0;} +.comment_l img {border-radius:50%;} +.comment_content {color:#333333;font-size:14px;line-height:180%;clear:both;padding:6px;} +.comment_title {height:26px;line-height:26px;color:#1B4C7A;padding:0 6px;} +.comment_floor {float:right;} +.comment_top {float:right;display:inline-block;padding:0 6px;background:#FDAA00;color:#FFFFFF;border-radius:2px;} +.comment_info {padding:6px 0 6px 6px;} +.comment_vote {float:right;color:#666666;padding:2px 0;} +.comment_form {background:#FAFAFA;border-radius:10px;padding:10px;margin:0 16px;} +.comment_area {width:99%;height:70px;border:#7D96C4 1px solid;} +.comment_input {color:#1B4C7A;} +.comment_input span {color:red;} +.comment_input input {border:#EEEEEE 1px solid;padding:6px;} +.comment_time {font-size:11px;color:#666666;} +.comment_close {padding:16px 0 0 16px;font-size:14px;color:#666666;} +.comment_reply {padding:6px 10px;margin:0 6px;line-height:180%;border-left:#FF6600 2px solid;font-size:14px;} +.quote{border:1px solid #EEEEEE;background:#FFFFFF;padding:10px;margin-bottom:10px;} +.quote_title {font-size:12px;color:#1B4C7A;} +.quote_time {font-size:11px;color:#666666;} +.quote_floor {float:right;font-size:10px;} +.quote_content {clear:both;} +.stat {padding:20px 0;} +.stat_p {height:10px;line-height:10px;background:#F2F2F2;font-size:1px;} +.stat_p div {height:10px;line-height:10px;background:#FFA40D;border-left:#FFA40D 2px solid;float:left;} +.c_p {cursor:pointer;} +#face {z-index:1000;width:400px;position:absolute;margin:-300px 0 0 0;background:#FFFFFF;border:#CCCCCC 1px solid;cursor:pointer;} +#face td {width:40px;height:40px;text-align:center;} +#face td:hover {background:#D8E8F9;} +#face span {float:right;} +#face div {background:#EEEEEE;padding:0 10px;line-height:32px;} +.face {width:26px;height:16px;cursor:pointer;} +.face:hover {padding-left:1px;} +.sc {text-align:right;color:#555555;font-size:16px;font-family:Verdana;font-weight:100;cursor:pointer;} +.sc:hover {color:#FF0000;} +.stars {width:80px;height:16px;background:url('image/star5.png') no-repeat;float:right;} +.stars span {width:16px;height:16px;display:inline-block;float:left;cursor:pointer;} +/* pages */ +.pages {padding:24px 0;text-align:center;font-size:12px;color:#666666;} +.pages a:link,.pages a:visited,.pages a:active {background:#FFFFFF;border:#EEEEEE 1px solid;padding:6px;text-decoration:none;} +.pages a:hover {background:#258CFF;border:#258CFF 1px solid;color:#FFFFFF;padding:6px;text-decoration:none;} +.pages strong {background:#258CFF;padding:6px;border:#258CFF 1px solid;color:#FFFFFF;} +.pages_inp {width:32px;border:#EEEEEE 1px solid;color:#666666;padding:4px;text-align:center;} +.pages_btn {width:32px;border:#FF6600 1px solid;color:#FFFFFF;padding:4px 6px;background:#FF6600;font-weight:bold;font-size:11px;} +.pages label {background:#FFFFFF;border:#EEEEEE 1px solid;color:#666666;padding:6px 6px;} +.pages label em {color:red;font-weight:bold;font-style:normal;} +.pages label span {font-weight:bold;} +.pages cite {font-style:normal;} \ No newline at end of file diff --git a/skin/default/company.css b/skin/default/company.css new file mode 100644 index 0000000..62cdb86 --- /dev/null +++ b/skin/default/company.css @@ -0,0 +1,4 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ \ No newline at end of file diff --git a/skin/default/extend.css b/skin/default/extend.css new file mode 100644 index 0000000..30b90cf --- /dev/null +++ b/skin/default/extend.css @@ -0,0 +1,69 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +.submit_success {background:#F1FBE8 url('image/okay.gif') no-repeat 20px center;padding:20px 20px 20px 60px;font-size:14px;margin-bottom:20px;} +.submit_btn {background:#258CFF;color:#FFFFFF;font-size:14px;padding:5px 15px 5px 15px;border:none;} +/* gift */ +.g_info {padding:24px;} +.g_info li {padding:12px 6px;border-bottom:#EEEEEE 1px dotted;} +.g_img {padding:2px;border:#EEEEEE 1px solid;} +/* poll */ +.poll_show {padding:0 16px;text-align:center;} +.poll_show li {height:20px;line-height:20px;overflow:hidden;padding:6px 0;} +.poll_show td:hover {background:#F2F2F2;} +.poll_img {border:#CCCCCC 1px solid;margin:0 0 5px 0;} +.poll_verify {width:400px;height:120px;background:#FAFAFA;overflow:hidden;z-index:1;position:absolute;left:50%;margin:100px 0 100px -200px;display:none;} +/* vote */ +.vote_show {padding:0 20px 20px 20px;} +.vote_show_n {width:18px;height:18px;line-height:18px;font-size:11px;background:#258CFF;color:#FFFFFF;text-align:center;} +.vote_show_p {height:11px;line-height:11px;background:#EDEDED;font-size:1px;} +.vote_show_p div {height:11px;line-height:11px;float:left;} +.vote_show_1 {background:#EA7211 url('image/vote_bg.gif') repeat-x 0 0;border-left:#EA7211 1px solid;border-right:#EA7211 1px solid;} +.vote_show_2 {background:#AABF00 url('image/vote_bg.gif') repeat-x 0 -11px;border-left:#AABF00 1px solid;border-right:#AABF00 1px solid;} +.vote_show_3 {background:#8B2A00 url('image/vote_bg.gif') repeat-x 0 -22px;border-left:#8B2A00 1px solid;border-right:#8B2A00 1px solid;} +.vote_show_4 {background:#BF844A url('image/vote_bg.gif') repeat-x 0 -33px;border-left:#BF844A 1px solid;border-right:#BF844A 1px solid;} +.vote_show_5 {background:#3A8938 url('image/vote_bg.gif') repeat-x 0 -44px;border-left:#3A8938 1px solid;border-right:#3A8938 1px solid;} +.vote_show_6 {background:#486193 url('image/vote_bg.gif') repeat-x 0 -55px;border-left:#486193 1px solid;border-right:#486193 1px solid;} +.vote_show_7 {background:#7DA3AE url('image/vote_bg.gif') repeat-x 0 -66px;border-left:#7DA3AE 1px solid;border-right:#7DA3AE 1px solid;} +.vote_show_8 {background:#AE1486 url('image/vote_bg.gif') repeat-x 0 -77px;border-left:#AE1486 1px solid;border-right:#AE1486 1px solid;} +.vote_show_9 {background:#5AB502 url('image/vote_bg.gif') repeat-x 0 -88px;border-left:#5AB502 1px solid;border-right:#5AB502 1px solid;} +.vote_show_10 {background:#BF2146 url('image/vote_bg.gif') repeat-x 0 -99px;border-left:#BF2146 1px solid;border-right:#BF2146 1px solid;} +/* from */ +.form {margin:10px 30px 0 30px;border:#EEEEEE 1px solid;border-bottom:none;} +.form .f_0 {display:none;} +.form .f_1 {width:150px;background:#F4F4F4;border-bottom:#EEEEEE 1px solid;} +.form .f_2 {border-left:#EEEEEE 1px solid;border-bottom:#EEEEEE 1px solid;} +.form .f_3 {float:left;padding:5px 20px 5px 0;} +.survey {margin:10px 30px 0 30px;} +.survey .f_0 {} +.survey .f_1 {font-weight:bold;} +.survey .f_2 {border-bottom:#EEEEEE 1px dotted;padding-left:30px;} +.survey .f_3 {padding:5px 0 5px 0;} +/* spread */ +.btn-spread {font-size:16px;font-weight:bold;letter-spacing:1px;width:136px;height:42px;line-height:42px;text-align:center;cursor:pointer;padding:0;-webkit-appearance:none;margin:6px 10px 0 0;background:#DC182B;border:#E11111 2px solid;border-radius:24px;color:#FFFFFF;} +.btn-spread:hover {background:#C5000C;} +.sp_input {width:360px;padding:8px;font-size:16px;border:#E11111 2px solid;color:#666666;} +.rank_box {padding:16px 0;} +.rank_head {padding:0 0 0 5px;height:32px;line-height:32px;overflow:hidden;border-bottom:#CCCCCC 1px dotted;font-weight:bold;font-size:14px;margin:0 0 8px 0;} +.new_head {padding:0 0 0 10px;height:22px;line-height:22px;font-weight:bold;font-size:13px;color:#FFFFFF;background:#F8B003;} +.new_body {padding:8px 16px;background:#FFFFFF;border:#F8B003 1px solid;} +.new_body li {height:25px;line-height:25px;overflow:hidden;background:url('image/spread_li.gif') no-repeat 0 5px;padding:0 0 0 18px;} +.new_body li a {font-size:13px;} +.new_price {color:#F43111;font-weight:bold;} +.body_n {padding:5px 5px 0 5px;} +.head_n {background:#F43111;line-height:22px;height:22px;font-weight:bold;padding:0 0 0 10px;color:#FFFFFF;} +.h_box {padding:0 15px 10px 15px;} +.head_h {background:#F3B200;line-height:22px;height:22px;padding:2px 10px 0 10px;color:#FFFFFF;} +.body_h {padding:5px 5px 0 5px;} +.body_h li {height:22px;line-height:22px;overflow:hidden;} +.norecord {padding:20px 0 20px 0;text-align:center;color:#666666;} +.buy_head {margin:15px 0 0 0;padding:0 0 0 10px;height:24px;line-height:24px;font-weight:bold;font-size:13px;color:#FFFFFF;background:#F8B003;} +.buy_body {padding:8px 15px 8px 15px;background:#FFFFFF;border:#F8B003 1px solid;} +.buy_submit {background:#006699;color:#FFFFFF;padding:2px;font-size:13px;font-weight:bold;} +.buy_login {padding:30px 0 50px 20px;font-size:13px;} +.list_tb {background:#F8F9FB;} +.list_tb h1 {padding:20px 0;font-size:16px;text-align:center;} +.list_tb table {background:#FFFFFF;width:100%;} +.list_tb th {background:#F1F1F1;} +.list_dl {background:url('image/dot.gif') repeat-x 0 center;} \ No newline at end of file diff --git a/skin/default/group.css b/skin/default/group.css new file mode 100644 index 0000000..a6c5479 --- /dev/null +++ b/skin/default/group.css @@ -0,0 +1,28 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +.g_deal {width:330px;height:95px;background:url('image/group_deal.gif') no-repeat;cursor:pointer;} +.g_deal div {color:#FFFFFF;font-size:24px;font-weight:bold;padding:22px 0 0 36px;} +.g_price {width:330px;height:80px;overflow:hidden;background:#CFEEF6;font-size:14px;font-weight:bold;} +.g_price div {width:110px;float:left;padding:16px 0;text-align:center;line-height:24px;font-size:16px;} +.g_price span {text-decoration:line-through;} +.g_price strong {color:#FF3300;} +.g_timer {text-align:center;padding:10px 10px 10px 40px;line-height:25px;border:#FBD686 1px solid;background:#FFF8E8 url('image/group_timer.gif') no-repeat 20px center;font-size:14px;letter-spacing:1px;} +.g_timer span {font-weight:bold;color:#FF5500;} +.g_info {text-align:center;margin:10px 12px;padding:10px;line-height:32px;border-radius:16px;background:#FFF8E8;font-size:14px;} +.g_info div {font-weight:bold;font-size:16px;color:#FF6600;font-family:\9ED1\4F53;} +.g_info span {color:#FF6600;} + +.group-list {} +.group-list img {-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;} +.group-list img:hover {-webkit-transform:scale(1.02);-moz-transform:scale(1.02);-ms-transform:scale(1.02);-o-transform:scale(1.02);transform:scale(1.02);} +.group-list-box {width:280px;margin-left:20px;float:left;} +.group-list-price {width:248px;height:32px;padding:6px 16px;line-height:32px;background:#F5F5F5;} +.group-list-join {width:270px;height:50px;padding-left:10px;line-height:50px;color:#FFFFFF;font-size:18px;background:url('image/group_join.gif') no-repeat;cursor:pointer;} +.group-list-title {width:280px;height:48px;overflow:hidden;padding:10px 0 20px 0;line-height:24px;font-size:14px;} +.group-list-s1 {text-decoration:line-through;} +.group-list-s2 {color:#C51800;} +.group-list-s3 {color:#C51800;font-size:16px;} + +.sort-v {width:1110px;} \ No newline at end of file diff --git a/skin/default/image/ab-hide-on.png b/skin/default/image/ab-hide-on.png new file mode 100644 index 0000000..c305335 Binary files /dev/null and b/skin/default/image/ab-hide-on.png differ diff --git a/skin/default/image/ab-next-1.png b/skin/default/image/ab-next-1.png new file mode 100644 index 0000000..9877ac3 Binary files /dev/null and b/skin/default/image/ab-next-1.png differ diff --git a/skin/default/image/addcart.gif b/skin/default/image/addcart.gif new file mode 100644 index 0000000..32c1514 Binary files /dev/null and b/skin/default/image/addcart.gif differ diff --git a/skin/default/image/addpic.gif b/skin/default/image/addpic.gif new file mode 100644 index 0000000..1c956df Binary files /dev/null and b/skin/default/image/addpic.gif differ diff --git a/skin/default/image/arrow.gif b/skin/default/image/arrow.gif new file mode 100644 index 0000000..21faa0a Binary files /dev/null and b/skin/default/image/arrow.gif differ diff --git a/skin/default/image/arrow_down.gif b/skin/default/image/arrow_down.gif new file mode 100644 index 0000000..7f5a342 Binary files /dev/null and b/skin/default/image/arrow_down.gif differ diff --git a/skin/default/image/btn_1.gif b/skin/default/image/btn_1.gif new file mode 100644 index 0000000..5a7509d Binary files /dev/null and b/skin/default/image/btn_1.gif differ diff --git a/skin/default/image/cart_empty.png b/skin/default/image/cart_empty.png new file mode 100644 index 0000000..c37a524 Binary files /dev/null and b/skin/default/image/cart_empty.png differ diff --git a/skin/default/image/catalog_close.gif b/skin/default/image/catalog_close.gif new file mode 100644 index 0000000..326f046 Binary files /dev/null and b/skin/default/image/catalog_close.gif differ diff --git a/skin/default/image/catalog_li.gif b/skin/default/image/catalog_li.gif new file mode 100644 index 0000000..2679547 Binary files /dev/null and b/skin/default/image/catalog_li.gif differ diff --git a/skin/default/image/cate-0-on.png b/skin/default/image/cate-0-on.png new file mode 100644 index 0000000..cd3b462 Binary files /dev/null and b/skin/default/image/cate-0-on.png differ diff --git a/skin/default/image/cate-10.png b/skin/default/image/cate-10.png new file mode 100644 index 0000000..e47250c Binary files /dev/null and b/skin/default/image/cate-10.png differ diff --git a/skin/default/image/cate-11-on.png b/skin/default/image/cate-11-on.png new file mode 100644 index 0000000..442efd5 Binary files /dev/null and b/skin/default/image/cate-11-on.png differ diff --git a/skin/default/image/cate-13.png b/skin/default/image/cate-13.png new file mode 100644 index 0000000..9f4ef04 Binary files /dev/null and b/skin/default/image/cate-13.png differ diff --git a/skin/default/image/cate-14-on.png b/skin/default/image/cate-14-on.png new file mode 100644 index 0000000..2c8c429 Binary files /dev/null and b/skin/default/image/cate-14-on.png differ diff --git a/skin/default/image/cate-15.png b/skin/default/image/cate-15.png new file mode 100644 index 0000000..3ce6d8f Binary files /dev/null and b/skin/default/image/cate-15.png differ diff --git a/skin/default/image/cate-2-on.png b/skin/default/image/cate-2-on.png new file mode 100644 index 0000000..10b7698 Binary files /dev/null and b/skin/default/image/cate-2-on.png differ diff --git a/skin/default/image/cate-2.png b/skin/default/image/cate-2.png new file mode 100644 index 0000000..7e5730a Binary files /dev/null and b/skin/default/image/cate-2.png differ diff --git a/skin/default/image/cate-5.png b/skin/default/image/cate-5.png new file mode 100644 index 0000000..2884d32 Binary files /dev/null and b/skin/default/image/cate-5.png differ diff --git a/skin/default/image/cate-7-on.png b/skin/default/image/cate-7-on.png new file mode 100644 index 0000000..ae7220f Binary files /dev/null and b/skin/default/image/cate-7-on.png differ diff --git a/skin/default/image/cate-icons.png b/skin/default/image/cate-icons.png new file mode 100644 index 0000000..a29818e Binary files /dev/null and b/skin/default/image/cate-icons.png differ diff --git a/skin/default/image/club_level_3.gif b/skin/default/image/club_level_3.gif new file mode 100644 index 0000000..1263aaa Binary files /dev/null and b/skin/default/image/club_level_3.gif differ diff --git a/skin/default/image/club_quote_b.gif b/skin/default/image/club_quote_b.gif new file mode 100644 index 0000000..8d7abf4 Binary files /dev/null and b/skin/default/image/club_quote_b.gif differ diff --git a/skin/default/image/club_thumb.gif b/skin/default/image/club_thumb.gif new file mode 100644 index 0000000..83824b6 Binary files /dev/null and b/skin/default/image/club_thumb.gif differ diff --git a/skin/default/image/club_video.gif b/skin/default/image/club_video.gif new file mode 100644 index 0000000..40d0927 Binary files /dev/null and b/skin/default/image/club_video.gif differ diff --git a/skin/default/image/company.jpg b/skin/default/image/company.jpg new file mode 100644 index 0000000..8165b96 Binary files /dev/null and b/skin/default/image/company.jpg differ diff --git a/skin/default/image/dot.gif b/skin/default/image/dot.gif new file mode 100644 index 0000000..e50078b Binary files /dev/null and b/skin/default/image/dot.gif differ diff --git a/skin/default/image/email.gif b/skin/default/image/email.gif new file mode 100644 index 0000000..117c834 Binary files /dev/null and b/skin/default/image/email.gif differ diff --git a/skin/default/image/grid-cart.png b/skin/default/image/grid-cart.png new file mode 100644 index 0000000..e5e30c0 Binary files /dev/null and b/skin/default/image/grid-cart.png differ diff --git a/skin/default/image/grid-gift.png b/skin/default/image/grid-gift.png new file mode 100644 index 0000000..b7212f8 Binary files /dev/null and b/skin/default/image/grid-gift.png differ diff --git a/skin/default/image/group_deal.gif b/skin/default/image/group_deal.gif new file mode 100644 index 0000000..1b599ca Binary files /dev/null and b/skin/default/image/group_deal.gif differ diff --git a/skin/default/image/group_join.gif b/skin/default/image/group_join.gif new file mode 100644 index 0000000..221133a Binary files /dev/null and b/skin/default/image/group_join.gif differ diff --git a/skin/default/image/head_search.png b/skin/default/image/head_search.png new file mode 100644 index 0000000..40433fc Binary files /dev/null and b/skin/default/image/head_search.png differ diff --git a/skin/default/image/ico-club-chat.png b/skin/default/image/ico-club-chat.png new file mode 100644 index 0000000..c4994ba Binary files /dev/null and b/skin/default/image/ico-club-chat.png differ diff --git a/skin/default/image/ico-club-reply.png b/skin/default/image/ico-club-reply.png new file mode 100644 index 0000000..ff8074c Binary files /dev/null and b/skin/default/image/ico-club-reply.png differ diff --git a/skin/default/image/ico-comm-on.png b/skin/default/image/ico-comm-on.png new file mode 100644 index 0000000..cb9d329 Binary files /dev/null and b/skin/default/image/ico-comm-on.png differ diff --git a/skin/default/image/ico-comm.png b/skin/default/image/ico-comm.png new file mode 100644 index 0000000..29151d5 Binary files /dev/null and b/skin/default/image/ico-comm.png differ diff --git a/skin/default/image/ico-delete-on.png b/skin/default/image/ico-delete-on.png new file mode 100644 index 0000000..c50ba3c Binary files /dev/null and b/skin/default/image/ico-delete-on.png differ diff --git a/skin/default/image/ico-fav.png b/skin/default/image/ico-fav.png new file mode 100644 index 0000000..5b0ed99 Binary files /dev/null and b/skin/default/image/ico-fav.png differ diff --git a/skin/default/image/ico-hits.png b/skin/default/image/ico-hits.png new file mode 100644 index 0000000..e976116 Binary files /dev/null and b/skin/default/image/ico-hits.png differ diff --git a/skin/default/image/ico-like.png b/skin/default/image/ico-like.png new file mode 100644 index 0000000..c039cb9 Binary files /dev/null and b/skin/default/image/ico-like.png differ diff --git a/skin/default/image/ico-location.png b/skin/default/image/ico-location.png new file mode 100644 index 0000000..6463594 Binary files /dev/null and b/skin/default/image/ico-location.png differ diff --git a/skin/default/image/ico-pics.png b/skin/default/image/ico-pics.png new file mode 100644 index 0000000..cf8d5ac Binary files /dev/null and b/skin/default/image/ico-pics.png differ diff --git a/skin/default/image/ico-play.png b/skin/default/image/ico-play.png new file mode 100644 index 0000000..13851e2 Binary files /dev/null and b/skin/default/image/ico-play.png differ diff --git a/skin/default/image/ico-qrcode.png b/skin/default/image/ico-qrcode.png new file mode 100644 index 0000000..10c1d7c Binary files /dev/null and b/skin/default/image/ico-qrcode.png differ diff --git a/skin/default/image/ico-quote.png b/skin/default/image/ico-quote.png new file mode 100644 index 0000000..e890b78 Binary files /dev/null and b/skin/default/image/ico-quote.png differ diff --git a/skin/default/image/ico-zoomin.png b/skin/default/image/ico-zoomin.png new file mode 100644 index 0000000..76f8f1e Binary files /dev/null and b/skin/default/image/ico-zoomin.png differ diff --git a/skin/default/image/ico_reward.gif b/skin/default/image/ico_reward.gif new file mode 100644 index 0000000..e238e5a Binary files /dev/null and b/skin/default/image/ico_reward.gif differ diff --git a/skin/default/image/index.html b/skin/default/image/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/skin/default/image/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/skin/default/image/input-captcha.png b/skin/default/image/input-captcha.png new file mode 100644 index 0000000..479c8fd Binary files /dev/null and b/skin/default/image/input-captcha.png differ diff --git a/skin/default/image/input-question.png b/skin/default/image/input-question.png new file mode 100644 index 0000000..39d56ce Binary files /dev/null and b/skin/default/image/input-question.png differ diff --git a/skin/default/image/input-text.png b/skin/default/image/input-text.png new file mode 100644 index 0000000..34beb8c Binary files /dev/null and b/skin/default/image/input-text.png differ diff --git a/skin/default/image/input-username.png b/skin/default/image/input-username.png new file mode 100644 index 0000000..4f4b5ee Binary files /dev/null and b/skin/default/image/input-username.png differ diff --git a/skin/default/image/know_0.gif b/skin/default/image/know_0.gif new file mode 100644 index 0000000..7102dbe Binary files /dev/null and b/skin/default/image/know_0.gif differ diff --git a/skin/default/image/list_img_on.gif b/skin/default/image/list_img_on.gif new file mode 100644 index 0000000..4898192 Binary files /dev/null and b/skin/default/image/list_img_on.gif differ diff --git a/skin/default/image/list_mix.gif b/skin/default/image/list_mix.gif new file mode 100644 index 0000000..4aa701a Binary files /dev/null and b/skin/default/image/list_mix.gif differ diff --git a/skin/default/image/list_mix_on.gif b/skin/default/image/list_mix_on.gif new file mode 100644 index 0000000..3c50dde Binary files /dev/null and b/skin/default/image/list_mix_on.gif differ diff --git a/skin/default/image/list_txt_on.gif b/skin/default/image/list_txt_on.gif new file mode 100644 index 0000000..ea50d91 Binary files /dev/null and b/skin/default/image/list_txt_on.gif differ diff --git a/skin/default/image/loading.gif b/skin/default/image/loading.gif new file mode 100644 index 0000000..085ccae Binary files /dev/null and b/skin/default/image/loading.gif differ diff --git a/skin/default/image/logo.gif b/skin/default/image/logo.gif new file mode 100644 index 0000000..8a83085 Binary files /dev/null and b/skin/default/image/logo.gif differ diff --git a/skin/default/image/nopic.png b/skin/default/image/nopic.png new file mode 100644 index 0000000..5d131d3 Binary files /dev/null and b/skin/default/image/nopic.png differ diff --git a/skin/default/image/nopic160.gif b/skin/default/image/nopic160.gif new file mode 100644 index 0000000..b239f11 Binary files /dev/null and b/skin/default/image/nopic160.gif differ diff --git a/skin/default/image/okay.gif b/skin/default/image/okay.gif new file mode 100644 index 0000000..86a4e29 Binary files /dev/null and b/skin/default/image/okay.gif differ diff --git a/skin/default/image/relate_on.gif b/skin/default/image/relate_on.gif new file mode 100644 index 0000000..96b6ff5 Binary files /dev/null and b/skin/default/image/relate_on.gif differ diff --git a/skin/default/image/sell_tip.gif b/skin/default/image/sell_tip.gif new file mode 100644 index 0000000..4065cd4 Binary files /dev/null and b/skin/default/image/sell_tip.gif differ diff --git a/skin/default/image/spread-banner.png b/skin/default/image/spread-banner.png new file mode 100644 index 0000000..e4c4c8a Binary files /dev/null and b/skin/default/image/spread-banner.png differ diff --git a/skin/default/image/spread_li.gif b/skin/default/image/spread_li.gif new file mode 100644 index 0000000..44d11f4 Binary files /dev/null and b/skin/default/image/spread_li.gif differ diff --git a/skin/default/image/star2.png b/skin/default/image/star2.png new file mode 100644 index 0000000..c0b3661 Binary files /dev/null and b/skin/default/image/star2.png differ diff --git a/skin/default/image/tab_2_1.gif b/skin/default/image/tab_2_1.gif new file mode 100644 index 0000000..1909b69 Binary files /dev/null and b/skin/default/image/tab_2_1.gif differ diff --git a/skin/default/image/tips_top.gif b/skin/default/image/tips_top.gif new file mode 100644 index 0000000..c518e22 Binary files /dev/null and b/skin/default/image/tips_top.gif differ diff --git a/skin/default/image/tool-award-on.png b/skin/default/image/tool-award-on.png new file mode 100644 index 0000000..0cd43ce Binary files /dev/null and b/skin/default/image/tool-award-on.png differ diff --git a/skin/default/image/tool-award.png b/skin/default/image/tool-award.png new file mode 100644 index 0000000..6182c89 Binary files /dev/null and b/skin/default/image/tool-award.png differ diff --git a/skin/default/image/tool-comment-on.png b/skin/default/image/tool-comment-on.png new file mode 100644 index 0000000..eb872f5 Binary files /dev/null and b/skin/default/image/tool-comment-on.png differ diff --git a/skin/default/image/tool-like.png b/skin/default/image/tool-like.png new file mode 100644 index 0000000..632f9e9 Binary files /dev/null and b/skin/default/image/tool-like.png differ diff --git a/skin/default/image/vip_0.gif b/skin/default/image/vip_0.gif new file mode 100644 index 0000000..80f143f Binary files /dev/null and b/skin/default/image/vip_0.gif differ diff --git a/skin/default/image/vip_5.gif b/skin/default/image/vip_5.gif new file mode 100644 index 0000000..177fa79 Binary files /dev/null and b/skin/default/image/vip_5.gif differ diff --git a/skin/default/image/vip_8.gif b/skin/default/image/vip_8.gif new file mode 100644 index 0000000..efbef6d Binary files /dev/null and b/skin/default/image/vip_8.gif differ diff --git a/skin/default/index.html b/skin/default/index.html new file mode 100644 index 0000000..c1e1f00 --- /dev/null +++ b/skin/default/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/skin/default/job.css b/skin/default/job.css new file mode 100644 index 0000000..2ae3314 --- /dev/null +++ b/skin/default/job.css @@ -0,0 +1,16 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ + +.job-stats {height:64px;margin:20px 0;} +.job-stats li {width:110px;float:left;font-size:16px;height:64px;line-height:32px;text-align:center;} +.job-stats div {height:64px;border-left:#EEEEEE 1px solid;border-right:#EEEEEE 1px solid;} +.job-stats i {font-style:normal;display:block;font-size:14px;} + +.job-tb {padding:0 20px;} +.job-tb div {height:32px;line-height:32px;overflow:hidden;color:#666666;} +.job-tb .jt-title {font-size:14px;background:url('image/li_dot.gif') no-repeat 6px center;padding-left:16px;} +.job-tb .jt-salary {width:160px;} +.job-tb .jt-company {width:240px;} +.job-tb .jt-area {width:60px;text-align:center;} diff --git a/skin/default/jquery.slide.css b/skin/default/jquery.slide.css new file mode 100644 index 0000000..4672916 --- /dev/null +++ b/skin/default/jquery.slide.css @@ -0,0 +1,20 @@ +.jqslide{background:#000000;color:#FFFFFF;padding-top:30px;} +.jqslide .pic{text-align:center;position:relative;z-index:5;width:1220px;margin:0 auto;} +.jqslide .pic .big{text-align:center;vertical-align:center;position:relative;width:1220px;min-height:600px;} +.jqslide .pic .prev,.jqslide .pic .next {background:url('image/spacer.gif');cursor:pointer;height:100%;position:absolute;top:0;width:50%;z-index:5;} +.jqslide .pic .prev{left:0;} +.jqslide .pic .next{right:0;} +.jqslide .pic .prevbtn {cursor:url('image/prev.cur'),auto;display:block;height:100%;outline:none;width:100%;} +.jqslide .pic .nextbtn {cursor:url('image/next.cur'),auto;display:block;height:100%;outline:none;width:100%;} +.jqslide .plist{height:150px;position:relative;} +.jqslide .plist li img{border:1px solid #BFBFBF;} +.jqslide .plist li a:hover img{background:#FF6600; border:1px solid #FF6600;} +.jqslide .plist ul{height:79px;overflow:hidden;margin:0 auto;-moz-user-select:none;-khtml-user-select:none;user-select:none;} +.jqslide .plist ul li{padding:2px 12px;width:104px;float:left;} +.jqslide .plist ul li span{display:none;color:#FFFFFF;padding:2px;background:#000000;position:absolute;margin:1px;font-size:10px;opacity:0.7;filter:alpha(opacity=70);} +.jqslide ul li p{margin:0; line-height:21px;} +.jqslide .scd{width:896px;height:79px;overflow:hidden;margin:0 auto;} +.jqslide .scl,.jqslide .scr{background:url('image/jquery.slide.sc.png') no-repeat 0 0;display:block;width:20px;height:65px;position:absolute;top:7px;left:120px;} +.jqslide .scr{left:1058px;background-position:0 -95px;} +.jqslide .scb {background:url('image/jquery.slide.sc.png') no-repeat 0 -190px;height:13px;left:150px;position:absolute;top:100px;width:360px;cursor:e-resize;} +#pload{background:url('image/jquery.slide.pload.gif') no-repeat;position:absolute;width:37px;height:37px;z-index:5;display:none;left:50%;top:50%;} \ No newline at end of file diff --git a/skin/default/know.css b/skin/default/know.css new file mode 100644 index 0000000..b310cf5 --- /dev/null +++ b/skin/default/know.css @@ -0,0 +1,70 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +a.konw_a:link,a.konw_a:active,a.konw_a:visited {color:#225588;text-decoration:none;} +a.konw_a:hover {color:#FF6600;text-decoration:none;} +.know_sch {line-height:180%;} +.know_sch_inp {width:260px;padding:3px;margin:5px;font-size:14px;} +.know_sch_btn {padding:3px 0 8px 6px;} +.know_sch_item {padding:0 0 0 8px;color:green;} +.know_box {padding:0 10px 10px 10px;} + +.know-stats {height:64px;margin:20px 0;} +.know-stats li {width:110px;float:left;font-size:16px;height:64px;line-height:32px;text-align:center;} +.know-stats div {height:64px;border-left:#EEEEEE 1px solid;border-right:#EEEEEE 1px solid;} +.know-stats i {font-style:normal;display:block;font-size:14px;} + +.know-list {padding:0 16px;} +.know-list .kl-avatar {width:32px;height:32px;text-align:center;} +.know-list .kl-avatar img {width:20px;height:20px;border-radius:50%;} +.know-list .kl-title {font-size:14px;} +.know-list .kl-title div {height:32px;line-height:32px;overflow:hidden;} +.know-list .kl-title span {background:url('image/ico_reward.gif') no-repeat;font-size:12px;color:#666666;padding:0 2px 0 14px;} +.know-list .kl-answer {width:60px;text-align:right;} +.know-list .kl-process {width:60px;text-align:right;} +.know-list .kl-date {width:120px;text-align:right;} + +.know-cate {padding:10px 20px;} +.know-cate p {margin:6px;} +.know-cate div {padding:0 6px 10px 6px;line-height:24px;font-size:14px;} +.know-cate strong {color:#007AFF;font-size:16px;} +.know-cate em {font-style:normal;color:#666666;} +.know-cate i {font-style:normal;color:#EEEEEE;padding:0 10px;} + +.know-expert {padding:10px 0 0 20px;overflow:hidden;} +.know-expert div {width:214px;height:98px;float:left;overflow:hidden;color:#666666;} +.know-expert img {float:left;border:#EEEEEE 1px solid;border-radius:50%;padding:2px;margin:0 16px 0 0;width:64px;height:64px;} +.know-expert strong {font-size:16px;} +.know-expert ul {width:128px;float:left;} +.know-expert li {height:32px;line-height:32px;padding-right:16px;overflow:hidden;} +.know-expert span {display:block;width:48px;height:22px;line-height:22px;text-align:center;float:left;border:#EEEEEE 1px solid;border-radius:6px;margin-top:6px;} +.know-expert span:hover {border:#007BFF 1px solid;background:#007AFF;color:#FFFFFF;} + +.know_addition {border-top:#F5F5F5 1px solid;padding:10px 32px;line-height:180%;font-size:14px;} +.know_comment {border-top:#F5F5F5 1px solid;padding:10px 32px;line-height:180%;font-size:14px;} +.know_asker {border-top:#F5F5F5 1px solid;padding:10px 32px;padding:10px;} + +.know_show {} +.know_show table {width:100%;border-collapse:collapse;border-spacing:0;} +.know_show_l {width:200px;border-right:#F5F5F5 1px solid;} +.know_show_l li {padding:16px 0 0 0;text-align:center;} +.know_info {padding:10px 0 10px 10px;border-bottom:#F5F5F5 1px solid;} +.know_avatar {width:120px;height:120px;} + +.know_show_btn {position:absolute;margin:2px 0 0 1108px;} +.know-btn {background:#F06C00 url('image/ico-know-post.png') no-repeat 10px center;display:inline-block;line-height:32px;padding:0 16px 0 32px;color:#FFFFFF;letter-spacing:2px;font-size:14px;font-weight:normal;} +.know-btn:hover {background:#E75000 url('image/ico-know-post.png') no-repeat 10px center;} + +.answer_best,.answer_expert {position:absolute;z-index:1;margin:38px 0 0 1140px;width:80px;height:24px;line-height:24px;text-align:center;color:#FFFFFF;border-radius:0 0 0 8px;} +.answer_best {background:#1AAD19;} +.answer_expert {background:#FF6600;} + +.answer_body {padding:10px;margin:0 6px;line-height:180%;font-size:14px;} +.answer_foot {border-bottom:#EEEEEE 1px solid;padding:0 10px 8px 10px;margin:0 6px;color:#666666;} +.answer_head {border-bottom:#EEEEEE 1px solid;border-top:#F5F5F5 10px solid;padding:10px 16px;font-size:16px;} +.answer_box {} +.answer_box table {margin:16px 0;} +.question_op {padding:16px 20px 10px 20px;line-height:24px;} +.vote_s {height:10px;line-height:10px;font-size:1px;background:#FFA40D;} +.vote_b {width:100%;height:10px;line-height:10px;font-size:1px;background:#FFF7D2;} \ No newline at end of file diff --git a/skin/default/message.css b/skin/default/message.css new file mode 100644 index 0000000..fdc0249 --- /dev/null +++ b/skin/default/message.css @@ -0,0 +1,14 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +/* global */ +* {word-break:break-all;font-family:Verdana,Arial;} +body {margin:0px;font-size:12px;color:#333333;background:#FFFFFF;} +input,select,textarea {font-size:12px;} +form {margin:0;} +a:link,a:visited,a:active {color:#1B4C7A;text-decoration:none;} +a:hover {color:#FF6600;} +.f_red {color:red;} +.f_gray {color:#666666;} +.f_b {font-weight:bold;} \ No newline at end of file diff --git a/skin/default/photo.css b/skin/default/photo.css new file mode 100644 index 0000000..08e1764 --- /dev/null +++ b/skin/default/photo.css @@ -0,0 +1,23 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +.photo_info {color:#F1F1F1;padding:0 24px;background:#666666;} +.photo_info h1 {text-align:left;margin:0;} +.photo_info_r {float:right;padding:24px 6px 0 0;} +.photo_info_i {padding:0 0 24px 16px;} +.photo_intro {color:#FFFFFF;padding:16px;line-height:150%;text-indent:2em;} +.photo_l {background:#333333;} +.photo_r {background:#000000;width:140px;text-align:center;} +.photo_f {position:absolute;z-index:2000;width:460px;height:260px;background:#000000;margin:200px 0 0 300px;color:#FAFAFA;text-align:center;border:#FAFAFA 1px solid;border-radius:24px;opacity:0.8;filter:alpha(opacity=80);display:none;} +.photo_f p {margin:44px 0;font-size:30px;} +.photo_f div {width:100px;height:32px;line-height:32px;margin:20px auto 0 auto;border:#FAFAFA 1px solid;border-radius:6px;font-size:14px;cursor:pointer;} +.photo_f div:hover {border:#FF6600 1px solid;color:#FF6600;} +.thumb_a {border:#666666 1px solid;padding:2px;margin-top:10px;} +.thumb_a:hover,.thumb_b {border:#FF6600 1px solid;padding:2px;margin-top:10px;} +.count_a {font-size:20px;color:#FF6600;} +.count_b {font-size:20px;} +.photo_all {padding:10px;} +.photo_all div {color:#F1F1F1;padding:6px 20px 20px 20px;text-align:left;} +#cursor_a {position:absolute;z-index:1000;width:510px;height:510px;cursor:url('image/prev.cur'),default;} +#cursor_b {position:absolute;z-index:1000;width:510px;height:510px;cursor:url('image/next.cur'),default;margin-left:510px;} \ No newline at end of file diff --git a/skin/default/style.css b/skin/default/style.css new file mode 100644 index 0000000..775a2a8 --- /dev/null +++ b/skin/default/style.css @@ -0,0 +1,445 @@ +/* + [DESTOON] Copyright (c) 2008-2021 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +/* global */ +* {word-break:break-all;font-family:"Microsoft Yahei",Tahoma,Verdana,Arial;-webkit-text-size-adjust:none;} +body {margin:0;font-size:12px;color:#333333;background:#F5F5F5;}/*F5F5F5*/ +form,input,select,textarea,td,th {font-size:12px;} +input,textarea,select {padding:6px;} +img {border:none;} +ul li {list-style-type:none;} +ol li {list-style-type:decimal;} +ul,form {margin:0px;padding:0px;} +a:link,a:visited,a:active {color:#333333;text-decoration:none;} +a:hover {color:#FF3300;} +/* links */ +a.w:link,a.w:visited,a.w:active {color:#FFFFFF;text-decoration:none;} +a.w:hover {color:#F4F3F2;} +a.b:link,a.b:visited,a.b:active {color:#007AFF;text-decoration:none;} +a.b:hover {color:#FF3300;} +a.g:link,a.g:visited,a.g:active {color:#666666;text-decoration:none;} +a.g:hover {color:#FF6600;} +/* common */ +.m {margin:auto;width:1220px;background:#FFFFFF;clear:both;overflow:hidden;} + +.m0 {width:100%;min-width:1220px;background:#F5F5F5;overflow:hidden;} +.m0 .m {background:#F5F5F5;} + +.m1 {background:#FFFFFF url('image/bg-line.png') repeat-y 960px 0;overflow:hidden;} +.m1l {width:960px;float:left;} +.m1r {width:250px;float:right;} + +.m2 {background:#FFFFFF url('image/bg-line.png') repeat-y 960px 0;overflow:hidden;} +.m2l {width:960px;float:left;} +.m2r {width:250px;float:right;} + +.m3 {background:#FFFFFF url('image/bg-line.png') repeat-y 880px 0;overflow:hidden;} +.m3l {width:880px;float:left;} +.m3r {width:330px;float:right;} + +.head {background:#F8F8F8;width:100%;height:36px;border-bottom:#E5E5E5 1px solid;position:fixed;z-index:9;left:0;} +.head_m {margin:auto;width:1220px;padding:9px 0 0 0;color:#666666;} +.head_s {height:31px;} +.head_t strong{color:#FF0000;font-weight:normal;} +.head_l li {float:left;margin:0 10px 0 0;} +.head_r {float:right;} +.head_r img {position:relative;margin:-2px 6px 0 0;} +.h_location {background:url('image/ico-location.png') no-repeat 0 center;padding:0 6px 0 20px;} +.h_fav {background:url('image/ico-fav.png') no-repeat 0 center;padding:0 6px 0 20px;} +.h_mobile {background:url('image/ico-mobile.png') no-repeat 0 center;padding:0 6px 0 20px;} +.h_cart {background:url('image/ico-cart.png') no-repeat 0 center;padding:0 6px 0 20px;} +.h_qrcode {background:url('image/ico-qrcode.png') no-repeat 0 center;padding:0 6px 0 20px;} + +.logo {width:230px;height:80px;overflow:hidden;float:left;} +.logo img {margin:12px 0 0 10px;height:60px;} +.head_search_kw {width:455px;margin:32px 0 0 16px;height:20px;line-height:20px;overflow:hidden;float:left;} +.head_search {float:left;width:510px;height:32px;background:url('image/head_search.png') no-repeat;margin-top:26px;} +.head_search:hover {background:url('image/head_search.png') no-repeat 0 -32px;} +.head_search div {clear:both;padding:4px 0 0 25px;} +.search_i {width:320px;font-size:14px;height:20px;line-height:20px;padding:2px 0 0 0;color:#666666;background:url('image/spacer.gif');border:none;} +.search_m {width:60px;cursor:default;padding:2px 25px 0 10px;font-size:14px;height:20px;line-height:20px;color:#666666;background:url('image/spacer.gif');border:none;} +.search_s {width:70px;height:25px;background:url('image/spacer.gif');border:none;padding:0;margin:0;cursor:pointer;} +.search_i:focus,.search_s:focus{outline:none;} +#search_module {z-index:1000;position:absolute;width:95px;overflow:hidden;margin:56px 0 0 575px;font-size:14px;line-height:26px;color:#666666;background:#FFFFFF;border:#CCCCCC 1px solid;border-top:none;cursor:pointer;} +#search_module li {padding:0 10px;color:#666666;} +#search_module li:hover {color:#FF6600;background:#F5F5F5;} +#search_tips {z-index:1000;position:absolute;width:340px;overflow:hidden;cursor:pointer;margin:56px 0 0 230px;font-size:13px;line-height:20px;color:#666666;background:#FFFFFF;border:#444444 1px solid;} +#search_tips div {height:24px;padding:0 10px;clear:both;overflow:hidden;color:#333333;} +#search_tips div span {float:right;font-size:12px;color:#008000;} +#search_tips div:hover {background:#3366CC;color:#FFFFFF;} +#search_tips div:hover span {color:#FFFFFF;} +#search_tips label {display:block;width:100%;background:#FAFAFA;font-size:12px;color:#0000CC;text-align:right;} +/* menu */ +.menu {height:42px;line-height:42px;background:#2587F4;letter-spacing:1px;font-size:16px;overflow:hidden;} +.menu li {float:left;} +.menu .menuon {background:#0072C6;margin-left:-2px;} +.menu a:link,.menu a:visited,.menu a:active {display:block;height:42px;color:#FFFFFF;padding:0 12px;} +.menu a:hover {background:#0072C6;} + +.foot {color:#666666;text-align:center;line-height:32px;padding:0 16px 16px 16px;} +.foot_page {padding:16px 16px 0 16px;text-align:center;height:32px;line-height:32px;overflow:hidden;color:#666666;} +#powered {padding:6px 0 24px 0;} +/* layout */ +.m_l {width:884px;} +.m_r {width:300px;} +.m_n {width:16px;} +.m_l_1 {width:1004px;} +.m_r_1 {width:180px;} +/* left */ +.left_box {border:#EEEEEE 1px solid;} +.left_head {border-bottom:#EEEEEE 1px solid;height:44px;line-height:44px;overflow:hidden;padding:0 10px;} +.left_head strong {font-size:16px;} +.left_head em {font-style:normal;color:#666666;} + +/* box */ +.box_head {border-bottom:#F5F5F5 1px solid;height:44px;line-height:44px;overflow:hidden;padding:0 16px;} +.box_head strong {font-size:16px;display:block;} +.box_head em {font-style:normal;color:#666666;} + +.box_body {padding:10px;} +.box_body li {height:32px;line-height:32px;overflow:hidden;} + +.tab_head {border:#EEEEEE 1px solid;border-bottom:none;height:31px;line-height:31px;font-size:14px;overflow:hidden;background:#EEEEEE;font-weight:bold;} +.tab_1 {float:left;padding:0 15px 0 15px;border-right:#EEEEEE 1px solid;cursor:pointer;font-weight:normal;} +.tab_2 {float:left;padding:0 15px 0 15px;border-right:#EEEEEE 1px solid;cursor:pointer;background:#FFFFFF;} +.tab_1_1 {border-bottom:#EEEEEE 1px solid;cursor:pointer;} +.tab_1_2 {border:#EEEEEE 1px solid;border-bottom:none;cursor:pointer;font-weight:bold;} + +.tab_head_2 {height:27px;background:#EEEEEE;border-left:#EEEEEE 1px solid;border-right:#EEEEEE 1px solid;text-align:center;padding-left:12px;} +.tab_2_1 {float:left;width:80px;height:27px;line-height:31px;overflow:hidden;background:url('image/tab_2_1.gif') no-repeat 6px right;cursor:pointer;} +.tab_2_1 span {color:#333333;} +.tab_body_2 {border:#EEEEEE 1px solid;border-top:none;} + +.li_dot li {background:url('image/li_dot.gif') no-repeat 5px 10px;padding:0 10px 0 12px;} +/* pages */ +.pages {padding:24px 0;text-align:center;font-size:12px;color:#666666;clear:both;} +.pages a:link,.pages a:visited,.pages a:active {background:#FFFFFF;border:#EEEEEE 1px solid;padding:6px;text-decoration:none;margin-right:6px;} +.pages a:hover {background:#258CFF;border:#258CFF 1px solid;color:#FFFFFF;padding:6px;text-decoration:none;} +.pages strong {background:#258CFF;padding:6px;border:#258CFF 1px solid;color:#FFFFFF;margin-right:6px;} +.pages_inp {width:32px;border:#EEEEEE 1px solid;color:#666666;padding:4px;text-align:center;} +.pages_btn {width:32px;border:#FF6600 1px solid;color:#FFFFFF;padding:4px 6px;background:#FF6600;font-weight:bold;font-size:11px;} +.pages label {background:#FFFFFF;border:#EEEEEE 1px solid;color:#666666;padding:6px 6px;} +.pages label em {color:red;font-weight:bold;font-style:normal;} +.pages label span {font-weight:bold;} +.pages cite {font-style:normal;} +/* table */ +.tb {width:100%;} +.tb th {background:#EEEEEE;} +.tb td {border-bottom:#F5F5F5 1px solid;} +.tb tr:hover {background:#F2F2F2;} + +.tf {width:100%;} +.tf td {border-top:#F0F0F0 1px solid;} +.tf tr:hover {background:#F4F4F4;} +.tf .tl {width:100px;text-align:right;} +.btns {padding:20px 20px 20px 150px;} +.thumb {padding:6px 0;} +.thumb img {border:#EEEEEE 1px solid;padding:2px;} +.thumb li {height:22px;line-height:22px;overflow:hidden;} +.thumbml ul {margin:10px 0 15px 0;} +.imb img {border:#EEEEEE 1px solid;padding:3px;} +/* album */ +#mid_pos {position:absolute;} +#mid_div {width:400px;height:300px;cursor:crosshair;border:#EEEEEE 1px solid;background:#F2F2F2;} +#zoomer {width:160px;height:120px;background:#FFFFFF url('image/ab-zoom-bg.gif');position:absolute;z-index:6;opacity:0.5;filter:alpha(opacity=50);} +#big_div {width:560px;height:420px;border:#EEEEEE 1px solid;background:#FFFFFF;position:absolute;overflow:hidden;} +#big_pic {position:absolute;} +.tbs {width:414px;height:56px;margin:20px 0;} +.tbs img {cursor:pointer;} +.tbsl {width:32px;height:56px;float:left;} +.tbsr {width:20px;height:56px;float:left;} +.tbsm {width:350px;height:56px;float:left;overflow:hidden;} +.ab_zoom {width:30px;height:30px;background:url('image/ab-zoom.png') no-repeat center center;position:absolute;z-index:5;margin:270px 0 0 -30px;} +.ab_play {width:48px;height:48px;border-radius:50%;background:#FFFFFF url('image/ab-play.png') no-repeat center center;position:absolute;z-index:7;margin:-150px 0 0 176px;} +.ab_play:hover {background:#FFFFFF url('image/ab-play-on.png') no-repeat center center;cursor:pointer;} +.ab_hide {width:30px;height:30px;background:url('image/ab-hide.png') no-repeat center center;position:absolute;z-index:12;margin:-300px 0 0 370px;display:none;} +.ab_hide:hover {background:url('image/ab-hide-on.png') no-repeat center center;cursor:pointer;} +.ab_video {width:400px;height:300px;border:#000000 1px solid;background:#000000;position:absolute;z-index:10;margin:-302px 0 0 0;display:none;} +.ab_im {padding:2px;margin:0 14px 0 0;border:#C0C0C0 1px solid;float:left;width:50px;height:50px;} +.ab_on {padding:2px;margin:0 14px 0 0;border:#FF6600 1px solid;float:left;width:50px;height:50px;background:#FF6600;} +/* ads */ +.adword table {background:url('image/adword_bg.gif') repeat-x 0 bottom;} +.adword_tip {color:#FF1100;border-bottom:#F5F5F5 1px solid;padding:8px 10px 8px 28px;background:url('image/arrow_up.gif') no-repeat 10px 8px;} +.sponsor {} +/* basic */ +.f_l {float:left;} +.f_r {float:right;} +.t_l {text-align:left;} +.t_r {text-align:right;} +.t_c {text-align:center;} +.f_b {font-weight:bold;} +.f_n {font-weight:normal;} +.f_white {color:white;} +.f_gray {color:#666666;} +.f_orange {color:#FF6600;} +.f_red {color:#FF0000;} +.f_blue {color:#003EAA;} +.f_green {color:#2BA245;} +.f_dblue {color:#007AFF;} +.f_price {font-weight:bold;font-family:Arial;color:#E4393C;} +.px12 {font-size:12px;} +.px14 {font-size:14px;} +.px16 {font-size:16px;} +.px18 {font-size:18px;} +.bd-t {border-top:#F5F5F5 1px solid;} +.bd-b {border-bottom:#F5F5F5 1px solid;} +.b10 {height:10px;} +.b16 {height:16px;} +.b20 {height:20px;} +.b24 {height:24px;} +.b32 {height:32px;} +.pd3 {padding:3px;} +.pd5 {padding:5px;} +.pd10 {padding:10px;} +.pd15 {padding:15px;} +.pd20 {padding:20px;} +.lh18 {line-height:180%;} +.ls1 {letter-spacing:1px;} +.c_p {cursor:pointer;} +.c_b {clear:both;} +.o_h {overflow:hidden;} +.dsn {display:none;} +.absm {vertical-align:middle;} + +.btn_s {background:#2388FA;color:#FFFFFF;border:none;padding:2px;letter-spacing:1px;} +.btn_r {background:#D7D7D7;color:#666666;border:none;padding:2px;letter-spacing:1px;} +.bd {border:#CAD9EA 1px solid;} +.highlight {color:red;} +.jt {color:#003278;cursor:pointer;} +.np {padding:20px 30px 20px 50px;line-height:25px;} +.lazy {background:#FAFAFA url('image/loading.gif') no-repeat center center;} +.slide {background:#FAFAFA;overflow:hidden;} + +.btn,.btn-green,.btn-blue,.btn-red {color:#FFFFFF;font-size:14px;width:100px;line-height:32px;border:none;border-radius:4px;text-align:center;cursor:pointer;padding:0;-webkit-appearance:none;} +.btn{background:#FFFFFF;border:#EEEEEE 1px solid;color:#333333;} +.btn:hover{background:#D9D9D9;border:#CDCDCD 1px solid;} +.btn-green{background:#1AAD19;border:#18A117 1px solid;color:#FFFFFF;} +.btn-green:hover{background:#179B16;border:#159014 1px solid;} +.btn-blue{background:#007AFF;border:#1E74D0 1px solid;color:#FFFFFF;} +.btn-blue:hover{background:#0569D5;} +.btn-red{background:#F8F8F8;border:#C6C6C6 1px solid;} +.btn-red:hover{background:#CE3C39;border:#BF3835 1px solid;color:#FFFFFF;} + +.btn-act {font-size:16px;width:148px;height:36px;line-height:36px;text-align:center;cursor:pointer;padding:0;-webkit-appearance:none;margin:6px 10px 0 0;background:#FF6600;border:#FF2200 1px solid;color:#FFFFFF;} +.btn-act:hover {background:#F22D00;} + +/* position */ +.pos {padding:10px 10px 10px 32px;height:24px;line-height:24px;background:#FFFFFF url('image/ico-nav.png') no-repeat 10px 13px;font-size:12px;} +.nav {padding:10px 10px 10px 32px;height:24px;line-height:24px;background:#F5F5F5 url('image/ico-nav.png') no-repeat 10px 13px;font-size:12px;} +.nav div {float:right;} +.nav i {font-style:normal;font-weight:bold;color:#444444;padding:0 6px;font-family:simsun;} +.nav em {font-style:normal;color:#999999;padding:0 10px;font-size:12px;} +.nav-b {background:#FFFFFF url('image/ico-nav.png') no-repeat 10px 13px;} +/* show */ +.title {line-height:48px;text-align:center;font-weight:bold;font-size:22px;padding:16px;margin:0;} +.title_trade {font-weight:bold;font-size:22px;margin:0 0 20px 0;padding:16px;border-bottom:#EEEEEE 1px solid;} +.info {padding:16px;background:#F5F5F5;margin:0 16px;} +.introduce {margin:16px;padding:16px;line-height:180%;font-size:16px;background:#F5F5F5;border-left:#EEEEEE 2px solid;} +.content {font-size:16px;line-height:200%;padding:16px 32px;} +.content p {text-indent:2em;} +.content a:link,.content a:visited,.content a:active {color:#225588;text-decoration:underline;} +.content a:hover {color:#FF6600;text-decoration:none;} +.property {border:#EEEEEE 1px solid;background:#F5F5F5;padding:10px;margin:0 16px;overflow:hidden;} +.property li {float:left;width:30%;height:32px;line-height:32px;overflow:hidden;} +.detail {background:url('image/arrow.gif') no-repeat 0 9px;border-bottom:#C0C0C0 1px dotted;padding:8px 0 8px 20px;margin:0 15px 0 15px;} +.related {padding:10px 16px;line-height:32px;} +.related a {font-size:14px;} +.keylink {font-weight:normal;padding:0 3px 0 3px;} +#comment_main div {height:100px;background:url('image/loading.gif') no-repeat center center;} + +.tool {padding:24px 0;text-align:center;border-top:#F5F5F5 1px solid;} +.tool i {font-style:normal;font-size:14px;color:#555555;display:inline-block;height:24px;line-height:24px;padding:0 28px;cursor:pointer;} +.tool b {font-weight:normal;font-size:12px;} +.tool .like {background:url('image/tool-like.png') no-repeat 0 center;} +.tool .like:hover {background:url('image/tool-like-on.png') no-repeat 0 center;color:#FF6600;} +.tool .hate {background:url('image/tool-hate.png') no-repeat 0 center;} +.tool .hate:hover {background:url('image/tool-hate-on.png') no-repeat 0 center;color:#FF6600;} +.tool .report {background:url('image/tool-report.png') no-repeat 0 center;} +.tool .report:hover {background:url('image/tool-report-on.png') no-repeat 0 center;color:#FF6600;} +.tool .favorite {background:url('image/tool-favorite.png') no-repeat 0 center;} +.tool .favorite:hover {background:url('image/tool-favorite-on.png') no-repeat 0 center;color:#FF6600;} +.tool .comment {background:url('image/tool-comment.png') no-repeat 0 center;} +.tool .comment:hover {background:url('image/tool-comment-on.png') no-repeat 0 center;color:#FF6600;} +.tool .award {background:url('image/tool-award.png') no-repeat 0 center;} +.tool .award:hover {background:url('image/tool-award-on.png') no-repeat 0 center;color:#FF6600;} +.tool .share {background:url('image/tool-share.png') no-repeat 0 center;} +.tool .share:hover {background:url('image/tool-share-on.png') no-repeat 0 center;color:#FF6600;} + +/* search */ +.fsearch {padding:5px 0 10px 15px;margin:1px 1px 0 1px;background:#F5FAFE url('image/fsearch_bg.gif') repeat-x;} +.sch {padding:15px 20px 5px 20px;margin-bottom:10px;} +.sch p {padding:10px 10px 10px 10px;font-size:13px;margin:0;} +.sch_find {border-top:#EEEEEE 1px solid;border-bottom:#EEEEEE 1px solid;margin:5px 0 5px 0;padding:5px 0 5px 5px;font-weight:bold;} +.sch_site li {background:url('image/ico_search.gif') no-repeat 3px 3px;height:23px;line-height:23px;overflow:hidden;padding:0 5px 0 25px;color:#666666;} +.sch_relate li {background:url('image/arrow_up.gif') no-repeat 3px 3px;height:23px;line-height:23px;overflow:hidden;padding:0 5px 0 25px;color:#666666;} +.rank_list {background:url('image/rank_list.gif') no-repeat;} +.rank_list li {height:23px;line-height:23px;overflow:hidden;padding:0 5px 0 35px;} +.ppt {padding:1px 15px 1px 35px;line-height:25px;} +.ppt_l {width:60px;font-weight:bold;} +.ppt_r {color:#DFDFDF;} +.ppt span {padding:1px;background:#2E6AB1;border:#1D589E 1px solid;color:#FFFFFF;} +/* sell && buy && company */ +.category {padding:10px 20px 5px 15px;} +.category p {padding:5px 0 5px 0;margin:0;} +.category div {padding:0 20px 0 20px;} + +.about {border:#2786C6 1px solid;background:#F2F2F2;padding:8px;margin:15px 15px 0 15px;} +.about li {padding:5px 0 5px 5px;} +.about li span {display:block;width:100px;float:left;color:#1B4C7A;} + +.contact_head {height:36px;line-height:36px;border:#EEEEEE 1px solid;border-bottom:none;background:#F5F5F5;padding:2px 16px;font-weight:bold;font-size:16px;margin:10px 10px 0 0;} +.contact_body {padding:10px;border:#EEEEEE 1px solid;border-top:none;margin:0 10px 0 0;} +.contact_body li {line-height:24px;padding:6px 10px;} +.contact_body li span {color:#666666;padding:0 8px 0 0;} + +.type {height:31px;line-height:31px;overflow:hidden;border-top:#EEEEEE 1px solid;background:#EEEEEE;padding-left:35px;} +a.type_1:link,a.type_1:visited,a.type_1:active,a.type_1:hover {float:left;display:block;padding:0 15px 0 15px;background:#FFFFFF;color:#000000;font-weight:bold;} +a.type_2:link,a.type_2:visited,a.type_2:active {float:left;display:block;padding:0 15px 0 15px;border-right:#E2F0FB 1px solid;} +a.type_2:hover {background:#258CFF;color:#FFFFFF;} +.img_tip {width:200px;z-index:1000;position:absolute;padding:5px;border:#EEEEEE 1px solid;background:#FFFFFF;} +.vote {padding:10px;} +.vote div {font-weight:bold;} +.vote li {padding:3px 0 3px 0;} +.vote p {margin:5px 0 5px 0;} + +.sort {line-height:48px;border-bottom:#EEEEEE 1px solid;font-size:14px;overflow:hidden;} +.sort-k {width:80px;padding-left:16px;font-weight:bold;float:left;overflow:hidden;} +.sort-v {width:850px;float:left;overflow:hidden;} +.sort-v li {float:left;padding:0 10px;} +.sort-v .on {background:#EEEEEE;} +.sort-v i {font-style:normal;padding-left:2px;color:#999999;font-size:12px;} +.sort-v b {padding:0 20px;} +.sort-v input, .sort-v select {padding:4px;} +.sort-v .btn-blue, .sort-v .btn {padding:0;line-height:28px;width:80px;margin-right:20px;} + +.list {line-height:180%;} +.list:hover {background:#F2F2F2;} +.list div img {border:#EEEEEE 1px solid;} +.list table {width:100%;border-bottom:#EEEEEE 1px solid;} +.list td {padding:10px 0 10px 0;} +.list h3 {font-size:14px;margin:0px;height:22px;overflow:hidden;} + +.user-info {height:64px;padding:16px;background:#EEEEEE;border-radius:0 0 10px 10px;} +.user-info img {width:64px;height:64px;border-radius:50%;float:left;margin-right:20px;} +.user-info ul {float:right;width:195px;margin-top:4px;} +.user-info li {height:28px;line-height:28px;overflow:hidden;} +.user-info strong {font-size:16px;} +.user-info em {font-size:12px;font-style:normal;float:right;padding-right:20px;} +.user-info i {font-style:normal;color:#999999;padding:0 6px;} + +.head-txt {padding:10px 16px;line-height:28px;border-bottom:#F5F5F5 1px solid;margin-bottom:10px;clear:both;} +.head-txt strong {font-size:18px;} +.head-txt span {float:right;font-size:14px;color:#999999;} +.head-txt i {font-style:normal;font-weight:bold;padding:0 2px;font-family:simsun;} + +.head-sub {padding:10px 16px;line-height:28px;border-bottom:#F2F2F2 1px solid;margin-bottom:10px;clear:both;} +.head-sub strong {font-size:16px;} +.head-sub span {float:right;font-size:14px;color:#999999;} +.head-sub i {font-style:normal;font-weight:bold;padding:0 2px;font-family:simsun;} + +.list-thumb {padding:10px;overflow:hidden;} +.list-thumb img {border:#EEEEEE 1px solid;padding:2px;} +.list-thumb li {height:48px;line-height:24px;overflow:hidden;padding:10px;text-align:left;} +.list-thumb td {text-align:center;} +.list-thumb td:hover {background:#F5F5F5;} + +.list-img {overflow:hidden;padding:10px 0 0 20px;} +.list-img ul {margin:10px 24px 16px 6px;} +.list-img li {height:48px;line-height:24px;overflow:hidden;font-size:14px;} +.list-img p {margin:10px 10px 0 6px;} + +.list0 {overflow:hidden;} +.list0 div {width:200px;float:left;} +.list0 img:hover {border-left:#FFFFFF 1px solid;} + +.list1 {overflow:hidden;padding-top:20px;} +.list1 div {width:188px;float:left;} +.list1 img:hover {border-left:#FFFFFF 1px solid;} + +.list-txt {padding:0 16px;} +.list-txt li {height:32px;line-height:32px;overflow:hidden;font-size:14px;background:url('image/li_dot.gif') no-repeat 4px center;padding-left:16px;} +.list-txt em {font-size:12px;color:#666666;padding-left:16px;font-style:normal;float:right;} +.list-txt .f_r {font-size:12px;color:#666666;padding-left:16px;} + +.list-rank {padding:0 16px;} +.list-rank li {height:32px;line-height:32px;font-size:14px;padding:0 6px;overflow:hidden;} +.list-rank .f_r {float:right;font-size:12px;color:#666666;padding-left:16px;} +.list-rank em {font-size:26px;font-style:normal;color:#F34540;padding-right:10px;font-family:Georgia;} +.list-rank i {font-size:18px;font-style:normal;color:#999999;padding-right:14px;font-family:Georgia;} + +.list-cate {padding:10px 20px;} +.list-cate:after {content:"";display:block;clear:both;} +.list-cate td {width:400px;font-size:14px;padding:10px 10px 20px 10px;} +.list-cate td:hover {background:#F5F5F5;border-radius:10px;} +.list-cate p {margin:0 0 10px 0;} +.list-cate li {float:left;line-height:32px;} +.list-cate em {font-style:normal;color:#EEEEEE;padding:0 10px;} +.list-cate i {font-style:normal;color:#EEEEEE;padding:0 10px;} + +.list-cate2 {padding:0 10px;overflow:hidden;} +.list-cate2 li {width:116px;padding:0 16px;float:left;height:32px;line-height:32px;font-size:14px;overflow:hidden;} +.list-cate2 li:hover {background:#F5F5F5;border-radius:6px;} +.list-cate2 i {font-size:12px;font-style:normal;color:#666666;padding-left:6px;} + +.list-area {width:860px;padding:10px 0 10px 20px;overflow:hidden;} +.list-area li {width:100px;float:left;height:32px;line-height:32px;font-size:14px;overflow:hidden;text-align:center;border:#EEEEEE 1px solid;margin:0 20px 20px 0;border-radius:6px;} +.list-area li:hover {border:#FF6600 1px solid;} + +.list-area4 {padding:0 10px;overflow:hidden;} +.list-area4 li {width:25%;float:left;height:32px;line-height:32px;font-size:14px;overflow:hidden;text-align:center;} +.list-area4 li:hover {background:#F5F5F5;border-radius:6px;} + +.tab-head {} +.tab-head ul {border-bottom:#F5F5F5 1px solid;height:32px;padding-left:16px;} +.tab-head li {border-bottom:#F5F5F5 1px solid;display:inline-block;height:32px;line-height:32px;margin-right:16px;float:left;font-size:14px;} +.tab-head .on {border-bottom:#007AFF 3px solid;height:30px;line-height:32px;} +.tab-head .on span {color:#007AFF;} + +/* side */ +.side ul {margin:10px;} +.side em {font-size:12px;font-style:normal;color:#999999;} +.side a {width:90%;display:block;font-size:16px;} +.side input {width:140px;border:#EEEEEE 1px solid;border-radius:8px;padding:8px 8px 8px 26px;font-size:14px;background:#FFFFFF url('image/icon-search16.png') no-repeat 6px center;outline:none;margin:16px 16px 16px 32px;} +.side input:hover {width:180px;} +.side_li {line-height:48px;height:48px;padding-left:32px;overflow:hidden;} +.side_li:hover {background:#F2F2F2;border-radius:10px;} +.side_on {line-height:48px;height:48px;background:#F5F5F5;padding-left:32px;overflow:hidden;border-radius:10px;} + +.warn {padding:30px 100px 30px 200px;} +.warn div {padding:5px 0 0 60px;background:url('image/warn.gif') no-repeat;font-size:14px;line-height:200%;} +.warn h1 {font-size:16px;margin:0;} +.guest_warn {padding:2px 0 2px 0;text-align:center;margin:0 130px 15px 130px;background:#FFF5D8;border:#FF7300 1px solid;} +.back2top {width:58px;height:58px;position:fixed;_position:absolute;left:50%;margin-left:620px;bottom:100px;_bottom:auto;cursor:pointer;display:none;} +.back2top a {display:block;width:100%;height:100%;background:url('image/back2top.png') no-repeat;} +.back2top a:hover {background:url('image/back2top.png') no-repeat -58px 0;} + +.ui-ico-time,.ui-ico-hits,.ui-ico-info,.ui-ico-play,.ui-ico-pics,.ui-ico-down,.ui-ico-comm,.ui-ico-area,.ui-ico-user,.ui-ico-none,.ui-ico-sort,.ui-ico-like,.ui-ico-hate,.ui-ico-delete,.ui-ico-quote,.ui-ico-report,.ui-ico-price {font-style:normal;font-weight:normal;font-size:12px;color:#999999;display:inline-block;height:16px;line-height:16px;padding:0 10px 0 20px;} +.ui-ico-time {background:url('image/ico-time.png') no-repeat 0 center;} +.ui-ico-hits {background:url('image/ico-hits.png') no-repeat 0 center;} +.ui-ico-info {background:url('image/ico-info.png') no-repeat 0 center;} +.ui-ico-play {background:url('image/ico-play.png') no-repeat 0 center;} +.ui-ico-pics {background:url('image/ico-pics.png') no-repeat 0 center;} +.ui-ico-down {background:url('image/ico-down.png') no-repeat 0 center;} +.ui-ico-area {background:url('image/ico-area.png') no-repeat 0 center;} +.ui-ico-user {background:url('image/ico-user.png') no-repeat 0 center;} + + +.ui-ico-comm {background:url('image/ico-comm.png') no-repeat 0 center;cursor:pointer;} +.ui-ico-comm:hover {background:url('image/ico-comm-on.png') no-repeat 0 center;color:#FF6600;} +.ui-ico-like {background:url('image/ico-like.png') no-repeat 0 center;cursor:pointer;} +.ui-ico-like:hover {background:url('image/ico-like-on.png') no-repeat 0 center;color:#FF6600;} +.ui-ico-hate {background:url('image/ico-hate.png') no-repeat 0 center;cursor:pointer;} +.ui-ico-hate:hover {background:url('image/ico-hate-on.png') no-repeat 0 center;color:#FF6600;} +.ui-ico-sort {background:url('image/ico-sort.png') no-repeat 0 center;cursor:pointer;} +.ui-ico-sort:hover {background:url('image/ico-sort-on.png') no-repeat 0 center;color:#FF6600;} +.ui-ico-delete {background:url('image/ico-delete.png') no-repeat 0 center;cursor:pointer;} +.ui-ico-delete:hover {background:url('image/ico-delete-on.png') no-repeat 0 center;color:#FF6600;} +.ui-ico-quote {background:url('image/ico-quote.png') no-repeat 0 center;cursor:pointer;} +.ui-ico-quote:hover {background:url('image/ico-quote-on.png') no-repeat 0 center;color:#FF6600;} +.ui-ico-report {background:url('image/ico-report.png') no-repeat 0 center;cursor:pointer;} +.ui-ico-report:hover {background:url('image/ico-report-on.png') no-repeat 0 center;color:#FF6600;} + +.ui-ico-price {color:#FF0000;padding:0;font-size:14px;} +.ui-fr {float:right;} +.ui-toast {height:48px;line-height:48px;overflow:hidden;display:inline-block;padding:0 16px;background:#000000;opacity:0.8;filter:alpha(opacity=80);color:#FFFFFF;border-radius:6px;position:fixed;z-index:99;top:40%;left:48%;font-size:16px;} \ No newline at end of file diff --git a/skin/m15dt8blue/ad/01F.jpg b/skin/m15dt8blue/ad/01F.jpg new file mode 100644 index 0000000..71bdf02 Binary files /dev/null and b/skin/m15dt8blue/ad/01F.jpg differ diff --git a/skin/m15dt8blue/ad/03F.jpg b/skin/m15dt8blue/ad/03F.jpg new file mode 100644 index 0000000..02bf360 Binary files /dev/null and b/skin/m15dt8blue/ad/03F.jpg differ diff --git a/skin/m15dt8blue/ad/05F.jpg b/skin/m15dt8blue/ad/05F.jpg new file mode 100644 index 0000000..03e6820 Binary files /dev/null and b/skin/m15dt8blue/ad/05F.jpg differ diff --git a/skin/m15dt8blue/ad/10f-001.png b/skin/m15dt8blue/ad/10f-001.png new file mode 100644 index 0000000..b7289df Binary files /dev/null and b/skin/m15dt8blue/ad/10f-001.png differ diff --git a/skin/m15dt8blue/ad/144852351.jpg b/skin/m15dt8blue/ad/144852351.jpg new file mode 100644 index 0000000..e26b6e5 Binary files /dev/null and b/skin/m15dt8blue/ad/144852351.jpg differ diff --git a/skin/m15dt8blue/ad/2020631457.jpg b/skin/m15dt8blue/ad/2020631457.jpg new file mode 100644 index 0000000..1adc6f3 Binary files /dev/null and b/skin/m15dt8blue/ad/2020631457.jpg differ diff --git a/skin/m15dt8blue/ad/4f-001.png b/skin/m15dt8blue/ad/4f-001.png new file mode 100644 index 0000000..a1afc20 Binary files /dev/null and b/skin/m15dt8blue/ad/4f-001.png differ diff --git a/skin/m15dt8blue/ad/5F.png b/skin/m15dt8blue/ad/5F.png new file mode 100644 index 0000000..9bd81ba Binary files /dev/null and b/skin/m15dt8blue/ad/5F.png differ diff --git a/skin/m15dt8blue/ad/6F.png b/skin/m15dt8blue/ad/6F.png new file mode 100644 index 0000000..8546b9b Binary files /dev/null and b/skin/m15dt8blue/ad/6F.png differ diff --git a/skin/m15dt8blue/ad/9f-001.png b/skin/m15dt8blue/ad/9f-001.png new file mode 100644 index 0000000..97dcd59 Binary files /dev/null and b/skin/m15dt8blue/ad/9f-001.png differ diff --git a/skin/m15dt8blue/ad/l3.jpg b/skin/m15dt8blue/ad/l3.jpg new file mode 100644 index 0000000..8725a2f Binary files /dev/null and b/skin/m15dt8blue/ad/l3.jpg differ diff --git a/skin/m15dt8blue/ad/l5.jpg b/skin/m15dt8blue/ad/l5.jpg new file mode 100644 index 0000000..e4c0c7f Binary files /dev/null and b/skin/m15dt8blue/ad/l5.jpg differ diff --git a/skin/m15dt8blue/ad/mall-4F.jpg b/skin/m15dt8blue/ad/mall-4F.jpg new file mode 100644 index 0000000..acd60aa Binary files /dev/null and b/skin/m15dt8blue/ad/mall-4F.jpg differ diff --git a/skin/m15dt8blue/ad/mall-5F.jpg b/skin/m15dt8blue/ad/mall-5F.jpg new file mode 100644 index 0000000..9d97fed Binary files /dev/null and b/skin/m15dt8blue/ad/mall-5F.jpg differ diff --git a/skin/m15dt8blue/ad/mall-ad-02.png b/skin/m15dt8blue/ad/mall-ad-02.png new file mode 100644 index 0000000..aa35fe2 Binary files /dev/null and b/skin/m15dt8blue/ad/mall-ad-02.png differ diff --git a/skin/m15dt8blue/ad/menu_AD-002.jpg b/skin/m15dt8blue/ad/menu_AD-002.jpg new file mode 100644 index 0000000..3deca6b Binary files /dev/null and b/skin/m15dt8blue/ad/menu_AD-002.jpg differ diff --git a/skin/m15dt8blue/ad/menu_AD-003.png b/skin/m15dt8blue/ad/menu_AD-003.png new file mode 100644 index 0000000..82e733a Binary files /dev/null and b/skin/m15dt8blue/ad/menu_AD-003.png differ diff --git a/skin/m15dt8blue/ad/sell_ad_1f.png b/skin/m15dt8blue/ad/sell_ad_1f.png new file mode 100644 index 0000000..3e45034 Binary files /dev/null and b/skin/m15dt8blue/ad/sell_ad_1f.png differ diff --git a/skin/m15dt8blue/ad/sell_ad_2f.png b/skin/m15dt8blue/ad/sell_ad_2f.png new file mode 100644 index 0000000..0362c98 Binary files /dev/null and b/skin/m15dt8blue/ad/sell_ad_2f.png differ diff --git a/skin/m15dt8blue/ad/sell_ad_4f.png b/skin/m15dt8blue/ad/sell_ad_4f.png new file mode 100644 index 0000000..171379c Binary files /dev/null and b/skin/m15dt8blue/ad/sell_ad_4f.png differ diff --git a/skin/m15dt8blue/archiver.css b/skin/m15dt8blue/archiver.css new file mode 100644 index 0000000..23a7fc5 --- /dev/null +++ b/skin/m15dt8blue/archiver.css @@ -0,0 +1,29 @@ +/* + [DESTOON B2B System] Copyright (c) 2008-2020 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +body {font-size:16px;margin:0;font-family:"Microsoft Yahei",Tahoma,Verdana,Arial} +form {margin:0px;} +a:link,a:visited,a:active {color:#007AFF;text-decoration:none;} +a:hover {color:#FF5500;} +img {border:0;margin:5px;} +li {line-height:32px;list-style-type:circle;color:#666666;} +em {font-size:12px;color:#666666;font-style:normal;float:right;} +#nav {background:#007AFF;line-height:44px;display:table;width:100%;letter-spacing:1px;} +#nav div {padding:0 16px;float:left;} +#nav span {color:#FFFFFF;} +#nav .on {background:#0072C6;} +#title {background:#EEEEEE;line-height:44px;padding:0 16px;} +#title strong {font-weight:normal;} +#content {padding:0 16px 16px 16px;} + +.pages {padding:24px 0;text-align:center;font-size:12px;color:#666666;} +.pages a:link,.pages a:visited,.pages a:active {background:#FFFFFF;border:#EEEEEE 1px solid;padding:6px;text-decoration:none;} +.pages a:hover {background:#258CFF;border:#258CFF 1px solid;color:#FFFFFF;padding:6px;text-decoration:none;} +.pages strong {background:#258CFF;padding:6px;border:#258CFF 1px solid;color:#FFFFFF;} +.pages_inp {width:32px;border:#EEEEEE 1px solid;color:#666666;padding:4px;text-align:center;} +.pages_btn {width:32px;border:#FF6600 1px solid;color:#FFFFFF;padding:4px 6px;background:#FF6600;font-weight:bold;font-size:11px;} +.pages label {background:#FFFFFF;border:#EEEEEE 1px solid;color:#666666;padding:6px 6px;} +.pages label em {color:red;font-weight:bold;font-style:normal;} +.pages label span {font-weight:bold;} +.pages cite {font-style:normal;} \ No newline at end of file diff --git a/skin/m15dt8blue/fonts/iconfont.js b/skin/m15dt8blue/fonts/iconfont.js new file mode 100644 index 0000000..c721394 --- /dev/null +++ b/skin/m15dt8blue/fonts/iconfont.js @@ -0,0 +1 @@ +!function(c){var l,h,a,z,v,i,t,o='',p=(l=document.getElementsByTagName("script"))[l.length-1].getAttribute("data-injectcss");if(p&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function M(){i||(i=!0,z())}h=function(){var c,l,h,a,z,v=document.createElement("div");v.innerHTML=o,o=null,(c=v.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",l=c,(h=document.body).firstChild?(a=l,(z=h.firstChild).parentNode.insertBefore(a,z)):h.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),h()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(z=h,v=c.document,i=!1,(t=function(){try{v.documentElement.doScroll("left")}catch(c){return void setTimeout(t,50)}M()})(),v.onreadystatechange=function(){"complete"==v.readyState&&(v.onreadystatechange=null,M())})}(window); \ No newline at end of file diff --git a/skin/m15dt8blue/fonts/iconfont.ttf b/skin/m15dt8blue/fonts/iconfont.ttf new file mode 100644 index 0000000..6e93862 Binary files /dev/null and b/skin/m15dt8blue/fonts/iconfont.ttf differ diff --git a/skin/m15dt8blue/fonts/iconfont.woff2 b/skin/m15dt8blue/fonts/iconfont.woff2 new file mode 100644 index 0000000..caa9b3d Binary files /dev/null and b/skin/m15dt8blue/fonts/iconfont.woff2 differ diff --git a/skin/m15dt8blue/group.css b/skin/m15dt8blue/group.css new file mode 100644 index 0000000..87a8c32 --- /dev/null +++ b/skin/m15dt8blue/group.css @@ -0,0 +1,28 @@ +/* + [DESTOON B2B System] Copyright (c) 2008-2020 www.destoon.com + This is NOT a freeware, use is subject to license.txt +*/ +.g_deal {width:330px;height:95px;background:url('image/group_deal.gif') no-repeat;cursor:pointer;} +.g_deal div {color:#FFFFFF;font-size:24px;font-weight:bold;padding:22px 0 0 36px;} +.g_price {width:330px;height:80px;overflow:hidden;background:#CFEEF6;font-size:14px;font-weight:bold;} +.g_price div {width:110px;float:left;padding:16px 0;text-align:center;line-height:24px;font-size:16px;} +.g_price span {text-decoration:line-through;} +.g_price strong {color:#FF3300;} +.g_timer {text-align:center;padding:10px 10px 10px 40px;line-height:25px;border:#FBD686 1px solid;background:#FFF8E8 url('image/group_timer.gif') no-repeat 20px center;font-size:14px;letter-spacing:1px;} +.g_timer span {font-weight:bold;color:#FF5500;} +.g_info {text-align:center;margin:10px 12px;padding:10px;line-height:32px;border-radius:16px;background:#FFF8E8;font-size:14px;} +.g_info div {font-weight:bold;font-size:16px;color:#FF6600;font-family:\9ED1\4F53;} +.g_info span {color:#FF6600;} + +.group-list {} +.group-list img {-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;} +.group-list img:hover {-webkit-transform:scale(1.02);-moz-transform:scale(1.02);-ms-transform:scale(1.02);-o-transform:scale(1.02);transform:scale(1.02);} +.group-list-box {width:280px;margin-left:20px;float:left;} +.group-list-price {width:248px;height:32px;padding:6px 16px;line-height:32px;background:#F5F5F5;} +.group-list-join {width:270px;height:50px;padding-left:10px;line-height:50px;color:#FFFFFF;font-size:18px;background:url('image/group_join.gif') no-repeat;cursor:pointer;} +.group-list-title {width:280px;height:48px;overflow:hidden;padding:10px 0 20px 0;line-height:24px;font-size:14px;} +.group-list-s1 {text-decoration:line-through;} +.group-list-s2 {color:#C51800;} +.group-list-s3 {color:#C51800;font-size:16px;} + +.sort-v {width:1110px;} \ No newline at end of file diff --git a/skin/m15dt8blue/icon/copyright.png b/skin/m15dt8blue/icon/copyright.png new file mode 100644 index 0000000..3027430 Binary files /dev/null and b/skin/m15dt8blue/icon/copyright.png differ diff --git a/skin/m15dt8blue/icon/seller-tag.png b/skin/m15dt8blue/icon/seller-tag.png new file mode 100644 index 0000000..59627c3 Binary files /dev/null and b/skin/m15dt8blue/icon/seller-tag.png differ diff --git a/skin/m15dt8blue/icon/sprite_global.png b/skin/m15dt8blue/icon/sprite_global.png new file mode 100644 index 0000000..36900ad Binary files /dev/null and b/skin/m15dt8blue/icon/sprite_global.png differ diff --git a/skin/m15dt8blue/image/ab-hide-on.png b/skin/m15dt8blue/image/ab-hide-on.png new file mode 100644 index 0000000..c305335 Binary files /dev/null and b/skin/m15dt8blue/image/ab-hide-on.png differ diff --git a/skin/m15dt8blue/image/ab-next-1.png b/skin/m15dt8blue/image/ab-next-1.png new file mode 100644 index 0000000..9877ac3 Binary files /dev/null and b/skin/m15dt8blue/image/ab-next-1.png differ diff --git a/skin/m15dt8blue/image/ab-play.png b/skin/m15dt8blue/image/ab-play.png new file mode 100644 index 0000000..ffecf9a Binary files /dev/null and b/skin/m15dt8blue/image/ab-play.png differ diff --git a/skin/m15dt8blue/image/ad1.jpg b/skin/m15dt8blue/image/ad1.jpg new file mode 100644 index 0000000..6b118a9 Binary files /dev/null and b/skin/m15dt8blue/image/ad1.jpg differ diff --git a/skin/m15dt8blue/image/add16.png b/skin/m15dt8blue/image/add16.png new file mode 100644 index 0000000..dae575b Binary files /dev/null and b/skin/m15dt8blue/image/add16.png differ diff --git a/skin/m15dt8blue/image/addpic.gif b/skin/m15dt8blue/image/addpic.gif new file mode 100644 index 0000000..1c956df Binary files /dev/null and b/skin/m15dt8blue/image/addpic.gif differ diff --git a/skin/m15dt8blue/image/arrow_r.gif b/skin/m15dt8blue/image/arrow_r.gif new file mode 100644 index 0000000..13fdd9e Binary files /dev/null and b/skin/m15dt8blue/image/arrow_r.gif differ diff --git a/skin/m15dt8blue/image/b.png b/skin/m15dt8blue/image/b.png new file mode 100644 index 0000000..5123252 Binary files /dev/null and b/skin/m15dt8blue/image/b.png differ diff --git a/skin/m15dt8blue/image/bg-line.png b/skin/m15dt8blue/image/bg-line.png new file mode 100644 index 0000000..b156513 Binary files /dev/null and b/skin/m15dt8blue/image/bg-line.png differ diff --git a/skin/m15dt8blue/image/btn.gif b/skin/m15dt8blue/image/btn.gif new file mode 100644 index 0000000..abb41ad Binary files /dev/null and b/skin/m15dt8blue/image/btn.gif differ diff --git a/skin/m15dt8blue/image/btn_add.gif b/skin/m15dt8blue/image/btn_add.gif new file mode 100644 index 0000000..e82517a Binary files /dev/null and b/skin/m15dt8blue/image/btn_add.gif differ diff --git a/skin/m15dt8blue/image/btn_addcart.gif b/skin/m15dt8blue/image/btn_addcart.gif new file mode 100644 index 0000000..a7a4b98 Binary files /dev/null and b/skin/m15dt8blue/image/btn_addcart.gif differ diff --git a/skin/m15dt8blue/image/btn_ask.gif b/skin/m15dt8blue/image/btn_ask.gif new file mode 100644 index 0000000..1d20b08 Binary files /dev/null and b/skin/m15dt8blue/image/btn_ask.gif differ diff --git a/skin/m15dt8blue/image/btn_gift.gif b/skin/m15dt8blue/image/btn_gift.gif new file mode 100644 index 0000000..adbfaf4 Binary files /dev/null and b/skin/m15dt8blue/image/btn_gift.gif differ diff --git a/skin/m15dt8blue/image/btn_poll_1.gif b/skin/m15dt8blue/image/btn_poll_1.gif new file mode 100644 index 0000000..79dd624 Binary files /dev/null and b/skin/m15dt8blue/image/btn_poll_1.gif differ diff --git a/skin/m15dt8blue/image/btn_reset_search.gif b/skin/m15dt8blue/image/btn_reset_search.gif new file mode 100644 index 0000000..670466d Binary files /dev/null and b/skin/m15dt8blue/image/btn_reset_search.gif differ diff --git a/skin/m15dt8blue/image/btn_search.gif b/skin/m15dt8blue/image/btn_search.gif new file mode 100644 index 0000000..a5f72e9 Binary files /dev/null and b/skin/m15dt8blue/image/btn_search.gif differ diff --git a/skin/m15dt8blue/image/btn_sign.gif b/skin/m15dt8blue/image/btn_sign.gif new file mode 100644 index 0000000..ccf8c88 Binary files /dev/null and b/skin/m15dt8blue/image/btn_sign.gif differ diff --git a/skin/m15dt8blue/image/btn_spread.gif b/skin/m15dt8blue/image/btn_spread.gif new file mode 100644 index 0000000..2810860 Binary files /dev/null and b/skin/m15dt8blue/image/btn_spread.gif differ diff --git a/skin/m15dt8blue/image/btn_tobuy.gif b/skin/m15dt8blue/image/btn_tobuy.gif new file mode 100644 index 0000000..ec67011 Binary files /dev/null and b/skin/m15dt8blue/image/btn_tobuy.gif differ diff --git a/skin/m15dt8blue/image/buy_1.gif b/skin/m15dt8blue/image/buy_1.gif new file mode 100644 index 0000000..7a43ca0 Binary files /dev/null and b/skin/m15dt8blue/image/buy_1.gif differ diff --git a/skin/m15dt8blue/image/buy_2.gif b/skin/m15dt8blue/image/buy_2.gif new file mode 100644 index 0000000..1efa36a Binary files /dev/null and b/skin/m15dt8blue/image/buy_2.gif differ diff --git a/skin/m15dt8blue/image/cart_empty.png b/skin/m15dt8blue/image/cart_empty.png new file mode 100644 index 0000000..c37a524 Binary files /dev/null and b/skin/m15dt8blue/image/cart_empty.png differ diff --git a/skin/m15dt8blue/image/cart_info.gif b/skin/m15dt8blue/image/cart_info.gif new file mode 100644 index 0000000..50e64b3 Binary files /dev/null and b/skin/m15dt8blue/image/cart_info.gif differ diff --git a/skin/m15dt8blue/image/cate-0-on.png b/skin/m15dt8blue/image/cate-0-on.png new file mode 100644 index 0000000..cd3b462 Binary files /dev/null and b/skin/m15dt8blue/image/cate-0-on.png differ diff --git a/skin/m15dt8blue/image/cate-1.png b/skin/m15dt8blue/image/cate-1.png new file mode 100644 index 0000000..4a271b4 Binary files /dev/null and b/skin/m15dt8blue/image/cate-1.png differ diff --git a/skin/m15dt8blue/image/cate-11-on.png b/skin/m15dt8blue/image/cate-11-on.png new file mode 100644 index 0000000..442efd5 Binary files /dev/null and b/skin/m15dt8blue/image/cate-11-on.png differ diff --git a/skin/m15dt8blue/image/cate-11.png b/skin/m15dt8blue/image/cate-11.png new file mode 100644 index 0000000..dc26f64 Binary files /dev/null and b/skin/m15dt8blue/image/cate-11.png differ diff --git a/skin/m15dt8blue/image/cate-13-on.png b/skin/m15dt8blue/image/cate-13-on.png new file mode 100644 index 0000000..034b67b Binary files /dev/null and b/skin/m15dt8blue/image/cate-13-on.png differ diff --git a/skin/m15dt8blue/image/cate-14-on.png b/skin/m15dt8blue/image/cate-14-on.png new file mode 100644 index 0000000..2c8c429 Binary files /dev/null and b/skin/m15dt8blue/image/cate-14-on.png differ diff --git a/skin/m15dt8blue/image/cate-15-on.png b/skin/m15dt8blue/image/cate-15-on.png new file mode 100644 index 0000000..030329d Binary files /dev/null and b/skin/m15dt8blue/image/cate-15-on.png differ diff --git a/skin/m15dt8blue/image/cate-2-on.png b/skin/m15dt8blue/image/cate-2-on.png new file mode 100644 index 0000000..10b7698 Binary files /dev/null and b/skin/m15dt8blue/image/cate-2-on.png differ diff --git a/skin/m15dt8blue/image/cate-4.png b/skin/m15dt8blue/image/cate-4.png new file mode 100644 index 0000000..e22932e Binary files /dev/null and b/skin/m15dt8blue/image/cate-4.png differ diff --git a/skin/m15dt8blue/image/cate-5-on.png b/skin/m15dt8blue/image/cate-5-on.png new file mode 100644 index 0000000..9bbd440 Binary files /dev/null and b/skin/m15dt8blue/image/cate-5-on.png differ diff --git a/skin/m15dt8blue/image/cate-6.png b/skin/m15dt8blue/image/cate-6.png new file mode 100644 index 0000000..cbbff04 Binary files /dev/null and b/skin/m15dt8blue/image/cate-6.png differ diff --git a/skin/m15dt8blue/image/cate-7.png b/skin/m15dt8blue/image/cate-7.png new file mode 100644 index 0000000..9c74b2f Binary files /dev/null and b/skin/m15dt8blue/image/cate-7.png differ diff --git a/skin/m15dt8blue/image/cate-icons.png b/skin/m15dt8blue/image/cate-icons.png new file mode 100644 index 0000000..a29818e Binary files /dev/null and b/skin/m15dt8blue/image/cate-icons.png differ diff --git a/skin/m15dt8blue/image/club_level_1.gif b/skin/m15dt8blue/image/club_level_1.gif new file mode 100644 index 0000000..13f245b Binary files /dev/null and b/skin/m15dt8blue/image/club_level_1.gif differ diff --git a/skin/m15dt8blue/image/club_ontop_1.gif b/skin/m15dt8blue/image/club_ontop_1.gif new file mode 100644 index 0000000..a6971fe Binary files /dev/null and b/skin/m15dt8blue/image/club_ontop_1.gif differ diff --git a/skin/m15dt8blue/image/club_thumb.gif b/skin/m15dt8blue/image/club_thumb.gif new file mode 100644 index 0000000..83824b6 Binary files /dev/null and b/skin/m15dt8blue/image/club_thumb.gif differ diff --git a/skin/m15dt8blue/image/dp-icon.png b/skin/m15dt8blue/image/dp-icon.png new file mode 100644 index 0000000..91d3a9c Binary files /dev/null and b/skin/m15dt8blue/image/dp-icon.png differ diff --git a/skin/m15dt8blue/image/fl-icon.png b/skin/m15dt8blue/image/fl-icon.png new file mode 100644 index 0000000..b6174ef Binary files /dev/null and b/skin/m15dt8blue/image/fl-icon.png differ diff --git a/skin/m15dt8blue/image/grid-ad.png b/skin/m15dt8blue/image/grid-ad.png new file mode 100644 index 0000000..a40d87e Binary files /dev/null and b/skin/m15dt8blue/image/grid-ad.png differ diff --git a/skin/m15dt8blue/image/grid-cart.png b/skin/m15dt8blue/image/grid-cart.png new file mode 100644 index 0000000..e5e30c0 Binary files /dev/null and b/skin/m15dt8blue/image/grid-cart.png differ diff --git a/skin/m15dt8blue/image/grid-order.png b/skin/m15dt8blue/image/grid-order.png new file mode 100644 index 0000000..3ca7eea Binary files /dev/null and b/skin/m15dt8blue/image/grid-order.png differ diff --git a/skin/m15dt8blue/image/grid-spread.png b/skin/m15dt8blue/image/grid-spread.png new file mode 100644 index 0000000..af5dc69 Binary files /dev/null and b/skin/m15dt8blue/image/grid-spread.png differ diff --git a/skin/m15dt8blue/image/group_deal.gif b/skin/m15dt8blue/image/group_deal.gif new file mode 100644 index 0000000..f2ce1f9 Binary files /dev/null and b/skin/m15dt8blue/image/group_deal.gif differ diff --git a/skin/m15dt8blue/image/head_search.png b/skin/m15dt8blue/image/head_search.png new file mode 100644 index 0000000..40433fc Binary files /dev/null and b/skin/m15dt8blue/image/head_search.png differ diff --git a/skin/m15dt8blue/image/ico-area.png b/skin/m15dt8blue/image/ico-area.png new file mode 100644 index 0000000..6b3a177 Binary files /dev/null and b/skin/m15dt8blue/image/ico-area.png differ diff --git a/skin/m15dt8blue/image/ico-comm-on.png b/skin/m15dt8blue/image/ico-comm-on.png new file mode 100644 index 0000000..cb9d329 Binary files /dev/null and b/skin/m15dt8blue/image/ico-comm-on.png differ diff --git a/skin/m15dt8blue/image/ico-hate-on.png b/skin/m15dt8blue/image/ico-hate-on.png new file mode 100644 index 0000000..8116596 Binary files /dev/null and b/skin/m15dt8blue/image/ico-hate-on.png differ diff --git a/skin/m15dt8blue/image/ico-hate.png b/skin/m15dt8blue/image/ico-hate.png new file mode 100644 index 0000000..3e4d677 Binary files /dev/null and b/skin/m15dt8blue/image/ico-hate.png differ diff --git a/skin/m15dt8blue/image/ico-hits.png b/skin/m15dt8blue/image/ico-hits.png new file mode 100644 index 0000000..e976116 Binary files /dev/null and b/skin/m15dt8blue/image/ico-hits.png differ diff --git a/skin/m15dt8blue/image/ico-info.png b/skin/m15dt8blue/image/ico-info.png new file mode 100644 index 0000000..9ec10d5 Binary files /dev/null and b/skin/m15dt8blue/image/ico-info.png differ diff --git a/skin/m15dt8blue/image/ico-play.png b/skin/m15dt8blue/image/ico-play.png new file mode 100644 index 0000000..13851e2 Binary files /dev/null and b/skin/m15dt8blue/image/ico-play.png differ diff --git a/skin/m15dt8blue/image/ico-share.png b/skin/m15dt8blue/image/ico-share.png new file mode 100644 index 0000000..c95d52d Binary files /dev/null and b/skin/m15dt8blue/image/ico-share.png differ diff --git a/skin/m15dt8blue/image/ico-sort.png b/skin/m15dt8blue/image/ico-sort.png new file mode 100644 index 0000000..54b7ab1 Binary files /dev/null and b/skin/m15dt8blue/image/ico-sort.png differ diff --git a/skin/m15dt8blue/image/ico-zoomin.png b/skin/m15dt8blue/image/ico-zoomin.png new file mode 100644 index 0000000..76f8f1e Binary files /dev/null and b/skin/m15dt8blue/image/ico-zoomin.png differ diff --git a/skin/m15dt8blue/image/ico_open.gif b/skin/m15dt8blue/image/ico_open.gif new file mode 100644 index 0000000..dbf8d4e Binary files /dev/null and b/skin/m15dt8blue/image/ico_open.gif differ diff --git a/skin/m15dt8blue/image/ico_reward.gif b/skin/m15dt8blue/image/ico_reward.gif new file mode 100644 index 0000000..e238e5a Binary files /dev/null and b/skin/m15dt8blue/image/ico_reward.gif differ diff --git a/skin/m15dt8blue/image/icon-search16.png b/skin/m15dt8blue/image/icon-search16.png new file mode 100644 index 0000000..7e68b82 Binary files /dev/null and b/skin/m15dt8blue/image/icon-search16.png differ diff --git a/skin/m15dt8blue/image/input-text.png b/skin/m15dt8blue/image/input-text.png new file mode 100644 index 0000000..34beb8c Binary files /dev/null and b/skin/m15dt8blue/image/input-text.png differ diff --git a/skin/m15dt8blue/image/inquiry.gif b/skin/m15dt8blue/image/inquiry.gif new file mode 100644 index 0000000..f003f52 Binary files /dev/null and b/skin/m15dt8blue/image/inquiry.gif differ diff --git a/skin/m15dt8blue/image/jquery.slide.sc.png b/skin/m15dt8blue/image/jquery.slide.sc.png new file mode 100644 index 0000000..d4c12d4 Binary files /dev/null and b/skin/m15dt8blue/image/jquery.slide.sc.png differ diff --git a/skin/m15dt8blue/image/know_2.gif b/skin/m15dt8blue/image/know_2.gif new file mode 100644 index 0000000..240d944 Binary files /dev/null and b/skin/m15dt8blue/image/know_2.gif differ diff --git a/skin/m15dt8blue/image/know_btn_2.gif b/skin/m15dt8blue/image/know_btn_2.gif new file mode 100644 index 0000000..4ded30b Binary files /dev/null and b/skin/m15dt8blue/image/know_btn_2.gif differ diff --git a/skin/m15dt8blue/image/li_dot.gif b/skin/m15dt8blue/image/li_dot.gif new file mode 100644 index 0000000..a2c22d0 Binary files /dev/null and b/skin/m15dt8blue/image/li_dot.gif differ diff --git a/skin/m15dt8blue/image/list_mix.gif b/skin/m15dt8blue/image/list_mix.gif new file mode 100644 index 0000000..4aa701a Binary files /dev/null and b/skin/m15dt8blue/image/list_mix.gif differ diff --git a/skin/m15dt8blue/image/loading.gif b/skin/m15dt8blue/image/loading.gif new file mode 100644 index 0000000..085ccae Binary files /dev/null and b/skin/m15dt8blue/image/loading.gif differ diff --git a/skin/m15dt8blue/image/logo.gif b/skin/m15dt8blue/image/logo.gif new file mode 100644 index 0000000..008219c Binary files /dev/null and b/skin/m15dt8blue/image/logo.gif differ diff --git a/skin/m15dt8blue/image/mobile.gif b/skin/m15dt8blue/image/mobile.gif new file mode 100644 index 0000000..34155ad Binary files /dev/null and b/skin/m15dt8blue/image/mobile.gif differ diff --git a/skin/m15dt8blue/image/msg.gif b/skin/m15dt8blue/image/msg.gif new file mode 100644 index 0000000..10c3ef9 Binary files /dev/null and b/skin/m15dt8blue/image/msg.gif differ diff --git a/skin/m15dt8blue/image/nav-bg.png b/skin/m15dt8blue/image/nav-bg.png new file mode 100644 index 0000000..f7f0e5a Binary files /dev/null and b/skin/m15dt8blue/image/nav-bg.png differ diff --git a/skin/m15dt8blue/image/next.cur b/skin/m15dt8blue/image/next.cur new file mode 100644 index 0000000..80ba41e Binary files /dev/null and b/skin/m15dt8blue/image/next.cur differ diff --git a/skin/m15dt8blue/image/nohead.gif b/skin/m15dt8blue/image/nohead.gif new file mode 100644 index 0000000..974578a Binary files /dev/null and b/skin/m15dt8blue/image/nohead.gif differ diff --git a/skin/m15dt8blue/image/nopic100.gif b/skin/m15dt8blue/image/nopic100.gif new file mode 100644 index 0000000..33ceb26 Binary files /dev/null and b/skin/m15dt8blue/image/nopic100.gif differ diff --git a/skin/m15dt8blue/image/nopic200.gif b/skin/m15dt8blue/image/nopic200.gif new file mode 100644 index 0000000..dd10d50 Binary files /dev/null and b/skin/m15dt8blue/image/nopic200.gif differ diff --git a/skin/m15dt8blue/image/nopic50.png b/skin/m15dt8blue/image/nopic50.png new file mode 100644 index 0000000..49b7968 Binary files /dev/null and b/skin/m15dt8blue/image/nopic50.png differ diff --git a/skin/m15dt8blue/image/nopic60.gif b/skin/m15dt8blue/image/nopic60.gif new file mode 100644 index 0000000..21313ac Binary files /dev/null and b/skin/m15dt8blue/image/nopic60.gif differ diff --git a/skin/m15dt8blue/image/okay.gif b/skin/m15dt8blue/image/okay.gif new file mode 100644 index 0000000..86a4e29 Binary files /dev/null and b/skin/m15dt8blue/image/okay.gif differ diff --git a/skin/m15dt8blue/image/page_arrow.png b/skin/m15dt8blue/image/page_arrow.png new file mode 100644 index 0000000..5696d4f Binary files /dev/null and b/skin/m15dt8blue/image/page_arrow.png differ diff --git a/skin/m15dt8blue/image/photo_prev.gif b/skin/m15dt8blue/image/photo_prev.gif new file mode 100644 index 0000000..6913503 Binary files /dev/null and b/skin/m15dt8blue/image/photo_prev.gif differ diff --git a/skin/m15dt8blue/image/relate_on.gif b/skin/m15dt8blue/image/relate_on.gif new file mode 100644 index 0000000..96b6ff5 Binary files /dev/null and b/skin/m15dt8blue/image/relate_on.gif differ diff --git a/skin/m15dt8blue/image/s-ico1.png b/skin/m15dt8blue/image/s-ico1.png new file mode 100644 index 0000000..2c72425 Binary files /dev/null and b/skin/m15dt8blue/image/s-ico1.png differ diff --git a/skin/m15dt8blue/image/spread_li.gif b/skin/m15dt8blue/image/spread_li.gif new file mode 100644 index 0000000..44d11f4 Binary files /dev/null and b/skin/m15dt8blue/image/spread_li.gif differ diff --git a/skin/m15dt8blue/image/star0.gif b/skin/m15dt8blue/image/star0.gif new file mode 100644 index 0000000..164d51b Binary files /dev/null and b/skin/m15dt8blue/image/star0.gif differ diff --git a/skin/m15dt8blue/image/star1.png b/skin/m15dt8blue/image/star1.png new file mode 100644 index 0000000..28f8ddd Binary files /dev/null and b/skin/m15dt8blue/image/star1.png differ diff --git a/skin/m15dt8blue/image/star3.png b/skin/m15dt8blue/image/star3.png new file mode 100644 index 0000000..cf79429 Binary files /dev/null and b/skin/m15dt8blue/image/star3.png differ diff --git a/skin/m15dt8blue/image/tab_head_bg.png b/skin/m15dt8blue/image/tab_head_bg.png new file mode 100644 index 0000000..10a79b5 Binary files /dev/null and b/skin/m15dt8blue/image/tab_head_bg.png differ diff --git a/skin/m15dt8blue/image/tb1zz6fuhyak1rjszfnxxa80pxa-460-800.png b/skin/m15dt8blue/image/tb1zz6fuhyak1rjszfnxxa80pxa-460-800.png new file mode 100644 index 0000000..2dcd7e5 Binary files /dev/null and b/skin/m15dt8blue/image/tb1zz6fuhyak1rjszfnxxa80pxa-460-800.png differ diff --git a/skin/m15dt8blue/image/tips_bg.gif b/skin/m15dt8blue/image/tips_bg.gif new file mode 100644 index 0000000..4244675 Binary files /dev/null and b/skin/m15dt8blue/image/tips_bg.gif differ diff --git a/skin/m15dt8blue/image/tool-award-on.png b/skin/m15dt8blue/image/tool-award-on.png new file mode 100644 index 0000000..0cd43ce Binary files /dev/null and b/skin/m15dt8blue/image/tool-award-on.png differ diff --git a/skin/m15dt8blue/image/tool-award.png b/skin/m15dt8blue/image/tool-award.png new file mode 100644 index 0000000..6182c89 Binary files /dev/null and b/skin/m15dt8blue/image/tool-award.png differ diff --git a/skin/m15dt8blue/image/tool-hate-on.png b/skin/m15dt8blue/image/tool-hate-on.png new file mode 100644 index 0000000..f31a522 Binary files /dev/null and b/skin/m15dt8blue/image/tool-hate-on.png differ diff --git a/skin/m15dt8blue/image/tool-like-on.png b/skin/m15dt8blue/image/tool-like-on.png new file mode 100644 index 0000000..fe73a10 Binary files /dev/null and b/skin/m15dt8blue/image/tool-like-on.png differ diff --git a/skin/m15dt8blue/image/tool-share-on.png b/skin/m15dt8blue/image/tool-share-on.png new file mode 100644 index 0000000..458bbe3 Binary files /dev/null and b/skin/m15dt8blue/image/tool-share-on.png differ diff --git a/skin/m15dt8blue/image/vip.gif b/skin/m15dt8blue/image/vip.gif new file mode 100644 index 0000000..93b991d Binary files /dev/null and b/skin/m15dt8blue/image/vip.gif differ diff --git a/skin/m15dt8blue/image/vip_1.gif b/skin/m15dt8blue/image/vip_1.gif new file mode 100644 index 0000000..ba005b4 Binary files /dev/null and b/skin/m15dt8blue/image/vip_1.gif differ diff --git a/skin/m15dt8blue/image/vip_3.gif b/skin/m15dt8blue/image/vip_3.gif new file mode 100644 index 0000000..06a2f35 Binary files /dev/null and b/skin/m15dt8blue/image/vip_3.gif differ diff --git a/skin/m15dt8blue/image/vip_9.gif b/skin/m15dt8blue/image/vip_9.gif new file mode 100644 index 0000000..9d0d846 Binary files /dev/null and b/skin/m15dt8blue/image/vip_9.gif differ diff --git a/skin/m15dt8blue/image/vippic.gif b/skin/m15dt8blue/image/vippic.gif new file mode 100644 index 0000000..9d1c227 Binary files /dev/null and b/skin/m15dt8blue/image/vippic.gif differ diff --git a/skin/m15dt8blue/image/zoomout.gif b/skin/m15dt8blue/image/zoomout.gif new file mode 100644 index 0000000..91718be Binary files /dev/null and b/skin/m15dt8blue/image/zoomout.gif differ diff --git a/skin/m15dt8blue/images/photo/tk1.jpg b/skin/m15dt8blue/images/photo/tk1.jpg new file mode 100644 index 0000000..91af82d Binary files /dev/null and b/skin/m15dt8blue/images/photo/tk1.jpg differ diff --git a/skin/m15dt8blue/images/photo/tk4.jpg b/skin/m15dt8blue/images/photo/tk4.jpg new file mode 100644 index 0000000..f148ced Binary files /dev/null and b/skin/m15dt8blue/images/photo/tk4.jpg differ diff --git a/skin/m15dt8blue/images/photo/tk6.jpg b/skin/m15dt8blue/images/photo/tk6.jpg new file mode 100644 index 0000000..a893404 Binary files /dev/null and b/skin/m15dt8blue/images/photo/tk6.jpg differ diff --git a/skin/m15dt8blue/images/photo/tk7.jpg b/skin/m15dt8blue/images/photo/tk7.jpg new file mode 100644 index 0000000..50603a7 Binary files /dev/null and b/skin/m15dt8blue/images/photo/tk7.jpg differ diff --git a/skin/m15dt8blue/images/sell_ad_4f.png b/skin/m15dt8blue/images/sell_ad_4f.png new file mode 100644 index 0000000..171379c Binary files /dev/null and b/skin/m15dt8blue/images/sell_ad_4f.png differ diff --git a/skin/m15dt8blue/images/sell_ad_5f.png b/skin/m15dt8blue/images/sell_ad_5f.png new file mode 100644 index 0000000..2cfb0d8 Binary files /dev/null and b/skin/m15dt8blue/images/sell_ad_5f.png differ diff --git a/skin/m15dt8blue/images/sell_ad_6f.png b/skin/m15dt8blue/images/sell_ad_6f.png new file mode 100644 index 0000000..da3651b Binary files /dev/null and b/skin/m15dt8blue/images/sell_ad_6f.png differ diff --git a/skin/m15dt8blue/images/tk2-2.jpg b/skin/m15dt8blue/images/tk2-2.jpg new file mode 100644 index 0000000..02a4779 Binary files /dev/null and b/skin/m15dt8blue/images/tk2-2.jpg differ diff --git a/skin/m15dt8blue/images/tk2.jpg b/skin/m15dt8blue/images/tk2.jpg new file mode 100644 index 0000000..55b2fd9 Binary files /dev/null and b/skin/m15dt8blue/images/tk2.jpg differ diff --git a/skin/m15dt8blue/images/tk4-4.jpg b/skin/m15dt8blue/images/tk4-4.jpg new file mode 100644 index 0000000..c3f62e9 Binary files /dev/null and b/skin/m15dt8blue/images/tk4-4.jpg differ diff --git a/skin/m15dt8blue/images/tk6-6.jpg b/skin/m15dt8blue/images/tk6-6.jpg new file mode 100644 index 0000000..5a3d3d7 Binary files /dev/null and b/skin/m15dt8blue/images/tk6-6.jpg differ diff --git a/skin/m15dt8blue/images/tk7-7.jpg b/skin/m15dt8blue/images/tk7-7.jpg new file mode 100644 index 0000000..635ba65 Binary files /dev/null and b/skin/m15dt8blue/images/tk7-7.jpg differ diff --git a/skin/m15dt8blue/img/01f.jpg b/skin/m15dt8blue/img/01f.jpg new file mode 100644 index 0000000..71bdf02 Binary files /dev/null and b/skin/m15dt8blue/img/01f.jpg differ diff --git a/skin/m15dt8blue/img/0ea3fa225a0c0305fa95bea4816de8de.gif b/skin/m15dt8blue/img/0ea3fa225a0c0305fa95bea4816de8de.gif new file mode 100644 index 0000000..e892b65 Binary files /dev/null and b/skin/m15dt8blue/img/0ea3fa225a0c0305fa95bea4816de8de.gif differ diff --git a/skin/m15dt8blue/img/103.jpg b/skin/m15dt8blue/img/103.jpg new file mode 100644 index 0000000..f16072b Binary files /dev/null and b/skin/m15dt8blue/img/103.jpg differ diff --git a/skin/m15dt8blue/img/14-46-11-84-1218032.jpg b/skin/m15dt8blue/img/14-46-11-84-1218032.jpg new file mode 100644 index 0000000..6aa363a Binary files /dev/null and b/skin/m15dt8blue/img/14-46-11-84-1218032.jpg differ diff --git a/skin/m15dt8blue/img/1447242413373.gif b/skin/m15dt8blue/img/1447242413373.gif new file mode 100644 index 0000000..a7703ed Binary files /dev/null and b/skin/m15dt8blue/img/1447242413373.gif differ diff --git a/skin/m15dt8blue/img/1F.png b/skin/m15dt8blue/img/1F.png new file mode 100644 index 0000000..b101e89 Binary files /dev/null and b/skin/m15dt8blue/img/1F.png differ diff --git a/skin/m15dt8blue/img/1Fad01.jpg b/skin/m15dt8blue/img/1Fad01.jpg new file mode 100644 index 0000000..b021119 Binary files /dev/null and b/skin/m15dt8blue/img/1Fad01.jpg differ diff --git a/skin/m15dt8blue/img/20170814150506128.gif b/skin/m15dt8blue/img/20170814150506128.gif new file mode 100644 index 0000000..5c44c71 Binary files /dev/null and b/skin/m15dt8blue/img/20170814150506128.gif differ diff --git a/skin/m15dt8blue/img/20171201165655254.gif b/skin/m15dt8blue/img/20171201165655254.gif new file mode 100644 index 0000000..6d975fc Binary files /dev/null and b/skin/m15dt8blue/img/20171201165655254.gif differ diff --git a/skin/m15dt8blue/img/20180315160314-2fe43faf.jpg b/skin/m15dt8blue/img/20180315160314-2fe43faf.jpg new file mode 100644 index 0000000..516b886 Binary files /dev/null and b/skin/m15dt8blue/img/20180315160314-2fe43faf.jpg differ diff --git a/skin/m15dt8blue/img/20190313152319563.jpg b/skin/m15dt8blue/img/20190313152319563.jpg new file mode 100644 index 0000000..13b3cfc Binary files /dev/null and b/skin/m15dt8blue/img/20190313152319563.jpg differ diff --git a/skin/m15dt8blue/img/20190313161646369.jpg b/skin/m15dt8blue/img/20190313161646369.jpg new file mode 100644 index 0000000..c03423f Binary files /dev/null and b/skin/m15dt8blue/img/20190313161646369.jpg differ diff --git a/skin/m15dt8blue/img/20208141554.jpg b/skin/m15dt8blue/img/20208141554.jpg new file mode 100644 index 0000000..016b6f6 Binary files /dev/null and b/skin/m15dt8blue/img/20208141554.jpg differ diff --git a/skin/m15dt8blue/img/2113011.jpg b/skin/m15dt8blue/img/2113011.jpg new file mode 100644 index 0000000..74b1907 Binary files /dev/null and b/skin/m15dt8blue/img/2113011.jpg differ diff --git a/skin/m15dt8blue/img/2117399.jpg b/skin/m15dt8blue/img/2117399.jpg new file mode 100644 index 0000000..277545d Binary files /dev/null and b/skin/m15dt8blue/img/2117399.jpg differ diff --git a/skin/m15dt8blue/img/2120734.jpg b/skin/m15dt8blue/img/2120734.jpg new file mode 100644 index 0000000..60f4e2c Binary files /dev/null and b/skin/m15dt8blue/img/2120734.jpg differ diff --git a/skin/m15dt8blue/img/2122136.jpg b/skin/m15dt8blue/img/2122136.jpg new file mode 100644 index 0000000..3aefd6e Binary files /dev/null and b/skin/m15dt8blue/img/2122136.jpg differ diff --git a/skin/m15dt8blue/img/220.png b/skin/m15dt8blue/img/220.png new file mode 100644 index 0000000..d2bdaf3 Binary files /dev/null and b/skin/m15dt8blue/img/220.png differ diff --git a/skin/m15dt8blue/img/24c961128c02acb901b7c88e0f58679a.jpg b/skin/m15dt8blue/img/24c961128c02acb901b7c88e0f58679a.jpg new file mode 100644 index 0000000..e0d1884 Binary files /dev/null and b/skin/m15dt8blue/img/24c961128c02acb901b7c88e0f58679a.jpg differ diff --git a/skin/m15dt8blue/img/2Fad02.jpg b/skin/m15dt8blue/img/2Fad02.jpg new file mode 100644 index 0000000..5c5ff2b Binary files /dev/null and b/skin/m15dt8blue/img/2Fad02.jpg differ diff --git a/skin/m15dt8blue/img/3Fad01.jpg b/skin/m15dt8blue/img/3Fad01.jpg new file mode 100644 index 0000000..d26fbde Binary files /dev/null and b/skin/m15dt8blue/img/3Fad01.jpg differ diff --git a/skin/m15dt8blue/img/4793023641962849201_pic1.png b/skin/m15dt8blue/img/4793023641962849201_pic1.png new file mode 100644 index 0000000..dbc20f0 Binary files /dev/null and b/skin/m15dt8blue/img/4793023641962849201_pic1.png differ diff --git a/skin/m15dt8blue/img/47dfe1c8b1d9bc8d9f5354b0d58e1162.jpg b/skin/m15dt8blue/img/47dfe1c8b1d9bc8d9f5354b0d58e1162.jpg new file mode 100644 index 0000000..721b692 Binary files /dev/null and b/skin/m15dt8blue/img/47dfe1c8b1d9bc8d9f5354b0d58e1162.jpg differ diff --git a/skin/m15dt8blue/img/58tjh20190315.gif b/skin/m15dt8blue/img/58tjh20190315.gif new file mode 100644 index 0000000..08e4f34 Binary files /dev/null and b/skin/m15dt8blue/img/58tjh20190315.gif differ diff --git a/skin/m15dt8blue/img/5Fad01.jpg b/skin/m15dt8blue/img/5Fad01.jpg new file mode 100644 index 0000000..a001494 Binary files /dev/null and b/skin/m15dt8blue/img/5Fad01.jpg differ diff --git a/skin/m15dt8blue/img/5b3c7a52Ncc7715b9.jpg b/skin/m15dt8blue/img/5b3c7a52Ncc7715b9.jpg new file mode 100644 index 0000000..6158805 Binary files /dev/null and b/skin/m15dt8blue/img/5b3c7a52Ncc7715b9.jpg differ diff --git a/skin/m15dt8blue/img/6Fad03.jpg b/skin/m15dt8blue/img/6Fad03.jpg new file mode 100644 index 0000000..ee7cfe3 Binary files /dev/null and b/skin/m15dt8blue/img/6Fad03.jpg differ diff --git a/skin/m15dt8blue/img/JNMSirRdhnBEdRDSDfyW5QYDRMxQmZbf.jpg b/skin/m15dt8blue/img/JNMSirRdhnBEdRDSDfyW5QYDRMxQmZbf.jpg new file mode 100644 index 0000000..4773615 Binary files /dev/null and b/skin/m15dt8blue/img/JNMSirRdhnBEdRDSDfyW5QYDRMxQmZbf.jpg differ diff --git a/skin/m15dt8blue/img/O1CN01GlddLf1dXFpQQojR7_!!610783745-2-wxb1688.png b/skin/m15dt8blue/img/O1CN01GlddLf1dXFpQQojR7_!!610783745-2-wxb1688.png new file mode 100644 index 0000000..6eca9a9 Binary files /dev/null and b/skin/m15dt8blue/img/O1CN01GlddLf1dXFpQQojR7_!!610783745-2-wxb1688.png differ diff --git a/skin/m15dt8blue/img/TB1.3XVn9rqK1RjSZK9XXXyypXa-20-25.jpg b/skin/m15dt8blue/img/TB1.3XVn9rqK1RjSZK9XXXyypXa-20-25.jpg new file mode 100644 index 0000000..eeb765c Binary files /dev/null and b/skin/m15dt8blue/img/TB1.3XVn9rqK1RjSZK9XXXyypXa-20-25.jpg differ diff --git a/skin/m15dt8blue/img/TB1AlF6n5rpK1RjSZFhXXXSdXXa-20-25.jpg b/skin/m15dt8blue/img/TB1AlF6n5rpK1RjSZFhXXXSdXXa-20-25.jpg new file mode 100644 index 0000000..0b8d189 Binary files /dev/null and b/skin/m15dt8blue/img/TB1AlF6n5rpK1RjSZFhXXXSdXXa-20-25.jpg differ diff --git a/skin/m15dt8blue/img/TB1Umh_n4TpK1RjSZFMXXbG_VXa-5-9.jpg b/skin/m15dt8blue/img/TB1Umh_n4TpK1RjSZFMXXbG_VXa-5-9.jpg new file mode 100644 index 0000000..51ee4f1 Binary files /dev/null and b/skin/m15dt8blue/img/TB1Umh_n4TpK1RjSZFMXXbG_VXa-5-9.jpg differ diff --git a/skin/m15dt8blue/img/TB1YNt5n3HqK1RjSZFPXXcwapXa-49-49.jpg b/skin/m15dt8blue/img/TB1YNt5n3HqK1RjSZFPXXcwapXa-49-49.jpg new file mode 100644 index 0000000..e65cd02 Binary files /dev/null and b/skin/m15dt8blue/img/TB1YNt5n3HqK1RjSZFPXXcwapXa-49-49.jpg differ diff --git a/skin/m15dt8blue/img/TB1Yrx7n7PoK1RjSZKbXXX1IXXa-49-49.jpg b/skin/m15dt8blue/img/TB1Yrx7n7PoK1RjSZKbXXX1IXXa-49-49.jpg new file mode 100644 index 0000000..9dab1a9 Binary files /dev/null and b/skin/m15dt8blue/img/TB1Yrx7n7PoK1RjSZKbXXX1IXXa-49-49.jpg differ diff --git a/skin/m15dt8blue/img/TB1_PWIdlr0gK0jSZFnXXbRRXXa-258-280.gif b/skin/m15dt8blue/img/TB1_PWIdlr0gK0jSZFnXXbRRXXa-258-280.gif new file mode 100644 index 0000000..d71c211 Binary files /dev/null and b/skin/m15dt8blue/img/TB1_PWIdlr0gK0jSZFnXXbRRXXa-258-280.gif differ diff --git a/skin/m15dt8blue/img/TB1ffJ9n7voK1RjSZFwXXciCFXa-15-15.png b/skin/m15dt8blue/img/TB1ffJ9n7voK1RjSZFwXXciCFXa-15-15.png new file mode 100644 index 0000000..f256ef7 Binary files /dev/null and b/skin/m15dt8blue/img/TB1ffJ9n7voK1RjSZFwXXciCFXa-15-15.png differ diff --git a/skin/m15dt8blue/img/TB1gVkqhET1gK0jSZFhXXaAtVXa-908-454.jpg b/skin/m15dt8blue/img/TB1gVkqhET1gK0jSZFhXXaAtVXa-908-454.jpg new file mode 100644 index 0000000..d6fc5f0 Binary files /dev/null and b/skin/m15dt8blue/img/TB1gVkqhET1gK0jSZFhXXaAtVXa-908-454.jpg differ diff --git a/skin/m15dt8blue/img/TB1jRLMpXuWBuNjSspnXXX1NVXa-320-350.png b/skin/m15dt8blue/img/TB1jRLMpXuWBuNjSspnXXX1NVXa-320-350.png new file mode 100644 index 0000000..402fc69 Binary files /dev/null and b/skin/m15dt8blue/img/TB1jRLMpXuWBuNjSspnXXX1NVXa-320-350.png differ diff --git a/skin/m15dt8blue/img/TB1udYyXNSYBuNjSsphXXbGvVXa-1800-574.png b/skin/m15dt8blue/img/TB1udYyXNSYBuNjSsphXXbGvVXa-1800-574.png new file mode 100644 index 0000000..bd8e2a8 Binary files /dev/null and b/skin/m15dt8blue/img/TB1udYyXNSYBuNjSsphXXbGvVXa-1800-574.png differ diff --git a/skin/m15dt8blue/img/TB1ziYWXSCWBuNjy0FhXXb6EVXa-30-34.png b/skin/m15dt8blue/img/TB1ziYWXSCWBuNjy0FhXXb6EVXa-30-34.png new file mode 100644 index 0000000..bff13d1 Binary files /dev/null and b/skin/m15dt8blue/img/TB1ziYWXSCWBuNjy0FhXXb6EVXa-30-34.png differ diff --git a/skin/m15dt8blue/img/a.png b/skin/m15dt8blue/img/a.png new file mode 100644 index 0000000..532ccf7 Binary files /dev/null and b/skin/m15dt8blue/img/a.png differ diff --git a/skin/m15dt8blue/img/ab-hide.png b/skin/m15dt8blue/img/ab-hide.png new file mode 100644 index 0000000..7193715 Binary files /dev/null and b/skin/m15dt8blue/img/ab-hide.png differ diff --git a/skin/m15dt8blue/img/ad1.jpg b/skin/m15dt8blue/img/ad1.jpg new file mode 100644 index 0000000..0ac9849 Binary files /dev/null and b/skin/m15dt8blue/img/ad1.jpg differ diff --git a/skin/m15dt8blue/img/ad6.jpg b/skin/m15dt8blue/img/ad6.jpg new file mode 100644 index 0000000..815cda0 Binary files /dev/null and b/skin/m15dt8blue/img/ad6.jpg differ diff --git a/skin/m15dt8blue/img/add.png b/skin/m15dt8blue/img/add.png new file mode 100644 index 0000000..e9f5fa5 Binary files /dev/null and b/skin/m15dt8blue/img/add.png differ diff --git a/skin/m15dt8blue/img/afterMarket.png b/skin/m15dt8blue/img/afterMarket.png new file mode 100644 index 0000000..2a9374b Binary files /dev/null and b/skin/m15dt8blue/img/afterMarket.png differ diff --git a/skin/m15dt8blue/img/arr-r.png b/skin/m15dt8blue/img/arr-r.png new file mode 100644 index 0000000..f6c3e5d Binary files /dev/null and b/skin/m15dt8blue/img/arr-r.png differ diff --git a/skin/m15dt8blue/img/arrowIcoNew.png b/skin/m15dt8blue/img/arrowIcoNew.png new file mode 100644 index 0000000..18c209d Binary files /dev/null and b/skin/m15dt8blue/img/arrowIcoNew.png differ diff --git a/skin/m15dt8blue/img/arrrow-back.png b/skin/m15dt8blue/img/arrrow-back.png new file mode 100644 index 0000000..5c803c9 Binary files /dev/null and b/skin/m15dt8blue/img/arrrow-back.png differ diff --git a/skin/m15dt8blue/img/b-bg.jpg b/skin/m15dt8blue/img/b-bg.jpg new file mode 100644 index 0000000..0f72e87 Binary files /dev/null and b/skin/m15dt8blue/img/b-bg.jpg differ diff --git a/skin/m15dt8blue/img/b9b17a9ff7cff57c2f175cb35b7a2a6f.jpg b/skin/m15dt8blue/img/b9b17a9ff7cff57c2f175cb35b7a2a6f.jpg new file mode 100644 index 0000000..21fcb60 Binary files /dev/null and b/skin/m15dt8blue/img/b9b17a9ff7cff57c2f175cb35b7a2a6f.jpg differ diff --git a/skin/m15dt8blue/img/back2top.png b/skin/m15dt8blue/img/back2top.png new file mode 100644 index 0000000..43d79d4 Binary files /dev/null and b/skin/m15dt8blue/img/back2top.png differ diff --git a/skin/m15dt8blue/img/banner111.jpg b/skin/m15dt8blue/img/banner111.jpg new file mode 100644 index 0000000..9630d72 Binary files /dev/null and b/skin/m15dt8blue/img/banner111.jpg differ diff --git a/skin/m15dt8blue/img/banner_1.png b/skin/m15dt8blue/img/banner_1.png new file mode 100644 index 0000000..b156c22 Binary files /dev/null and b/skin/m15dt8blue/img/banner_1.png differ diff --git a/skin/m15dt8blue/img/banner_s.jpg b/skin/m15dt8blue/img/banner_s.jpg new file mode 100644 index 0000000..69df6bb Binary files /dev/null and b/skin/m15dt8blue/img/banner_s.jpg differ diff --git a/skin/m15dt8blue/img/bao.png b/skin/m15dt8blue/img/bao.png new file mode 100644 index 0000000..073b32d Binary files /dev/null and b/skin/m15dt8blue/img/bao.png differ diff --git a/skin/m15dt8blue/img/bar_green.png b/skin/m15dt8blue/img/bar_green.png new file mode 100644 index 0000000..e39e273 Binary files /dev/null and b/skin/m15dt8blue/img/bar_green.png differ diff --git a/skin/m15dt8blue/img/bj2.png b/skin/m15dt8blue/img/bj2.png new file mode 100644 index 0000000..e862e09 Binary files /dev/null and b/skin/m15dt8blue/img/bj2.png differ diff --git a/skin/m15dt8blue/img/brand.png b/skin/m15dt8blue/img/brand.png new file mode 100644 index 0000000..7b81077 Binary files /dev/null and b/skin/m15dt8blue/img/brand.png differ diff --git a/skin/m15dt8blue/img/buy-bot.jpg b/skin/m15dt8blue/img/buy-bot.jpg new file mode 100644 index 0000000..180918a Binary files /dev/null and b/skin/m15dt8blue/img/buy-bot.jpg differ diff --git a/skin/m15dt8blue/img/cdx-mobile.png b/skin/m15dt8blue/img/cdx-mobile.png new file mode 100644 index 0000000..3227cac Binary files /dev/null and b/skin/m15dt8blue/img/cdx-mobile.png differ diff --git a/skin/m15dt8blue/img/cdx-vip-002.jpg b/skin/m15dt8blue/img/cdx-vip-002.jpg new file mode 100644 index 0000000..4c20a1c Binary files /dev/null and b/skin/m15dt8blue/img/cdx-vip-002.jpg differ diff --git a/skin/m15dt8blue/img/cdx-vip-01.jpg b/skin/m15dt8blue/img/cdx-vip-01.jpg new file mode 100644 index 0000000..2fea8ac Binary files /dev/null and b/skin/m15dt8blue/img/cdx-vip-01.jpg differ diff --git a/skin/m15dt8blue/img/cdx-vip-icon-0001.png b/skin/m15dt8blue/img/cdx-vip-icon-0001.png new file mode 100644 index 0000000..a32a7ef Binary files /dev/null and b/skin/m15dt8blue/img/cdx-vip-icon-0001.png differ diff --git a/skin/m15dt8blue/img/cdx019-001.jpg b/skin/m15dt8blue/img/cdx019-001.jpg new file mode 100644 index 0000000..2d2a398 Binary files /dev/null and b/skin/m15dt8blue/img/cdx019-001.jpg differ diff --git a/skin/m15dt8blue/img/cdxhf0001.jpg b/skin/m15dt8blue/img/cdxhf0001.jpg new file mode 100644 index 0000000..ea5b6fb Binary files /dev/null and b/skin/m15dt8blue/img/cdxhf0001.jpg differ diff --git a/skin/m15dt8blue/img/cdxhf0002.jpg b/skin/m15dt8blue/img/cdxhf0002.jpg new file mode 100644 index 0000000..1ceb3d2 Binary files /dev/null and b/skin/m15dt8blue/img/cdxhf0002.jpg differ diff --git a/skin/m15dt8blue/img/cdxmallad001.jpg b/skin/m15dt8blue/img/cdxmallad001.jpg new file mode 100644 index 0000000..57d0acb Binary files /dev/null and b/skin/m15dt8blue/img/cdxmallad001.jpg differ diff --git a/skin/m15dt8blue/img/cooperation_entrance.f884437.jpg b/skin/m15dt8blue/img/cooperation_entrance.f884437.jpg new file mode 100644 index 0000000..edcedfd Binary files /dev/null and b/skin/m15dt8blue/img/cooperation_entrance.f884437.jpg differ diff --git a/skin/m15dt8blue/img/copyright.png b/skin/m15dt8blue/img/copyright.png new file mode 100644 index 0000000..3027430 Binary files /dev/null and b/skin/m15dt8blue/img/copyright.png differ diff --git a/skin/m15dt8blue/img/cpxq_35.jpg b/skin/m15dt8blue/img/cpxq_35.jpg new file mode 100644 index 0000000..ea962b0 Binary files /dev/null and b/skin/m15dt8blue/img/cpxq_35.jpg differ diff --git a/skin/m15dt8blue/img/d3.png b/skin/m15dt8blue/img/d3.png new file mode 100644 index 0000000..fb16b35 Binary files /dev/null and b/skin/m15dt8blue/img/d3.png differ diff --git a/skin/m15dt8blue/img/dh.png b/skin/m15dt8blue/img/dh.png new file mode 100644 index 0000000..556efb5 Binary files /dev/null and b/skin/m15dt8blue/img/dh.png differ diff --git a/skin/m15dt8blue/img/dianhua.png b/skin/m15dt8blue/img/dianhua.png new file mode 100644 index 0000000..1931f2f Binary files /dev/null and b/skin/m15dt8blue/img/dianhua.png differ diff --git a/skin/m15dt8blue/img/dlbtn.gif b/skin/m15dt8blue/img/dlbtn.gif new file mode 100644 index 0000000..9a36c40 Binary files /dev/null and b/skin/m15dt8blue/img/dlbtn.gif differ diff --git a/skin/m15dt8blue/img/drop.gif b/skin/m15dt8blue/img/drop.gif new file mode 100644 index 0000000..818f838 Binary files /dev/null and b/skin/m15dt8blue/img/drop.gif differ diff --git a/skin/m15dt8blue/img/ds.jpg b/skin/m15dt8blue/img/ds.jpg new file mode 100644 index 0000000..dca7725 Binary files /dev/null and b/skin/m15dt8blue/img/ds.jpg differ diff --git a/skin/m15dt8blue/img/dz-icon.png b/skin/m15dt8blue/img/dz-icon.png new file mode 100644 index 0000000..b5b319b Binary files /dev/null and b/skin/m15dt8blue/img/dz-icon.png differ diff --git a/skin/m15dt8blue/img/f1.jpg b/skin/m15dt8blue/img/f1.jpg new file mode 100644 index 0000000..3978b9e Binary files /dev/null and b/skin/m15dt8blue/img/f1.jpg differ diff --git a/skin/m15dt8blue/img/f4.jpg b/skin/m15dt8blue/img/f4.jpg new file mode 100644 index 0000000..8cbf8ca Binary files /dev/null and b/skin/m15dt8blue/img/f4.jpg differ diff --git a/skin/m15dt8blue/img/f_002.png b/skin/m15dt8blue/img/f_002.png new file mode 100644 index 0000000..63aecc7 Binary files /dev/null and b/skin/m15dt8blue/img/f_002.png differ diff --git a/skin/m15dt8blue/img/f_005.png b/skin/m15dt8blue/img/f_005.png new file mode 100644 index 0000000..a0198bf Binary files /dev/null and b/skin/m15dt8blue/img/f_005.png differ diff --git a/skin/m15dt8blue/img/footer-img.jpg b/skin/m15dt8blue/img/footer-img.jpg new file mode 100644 index 0000000..e529774 Binary files /dev/null and b/skin/m15dt8blue/img/footer-img.jpg differ diff --git a/skin/m15dt8blue/img/footicon.png b/skin/m15dt8blue/img/footicon.png new file mode 100644 index 0000000..346952f Binary files /dev/null and b/skin/m15dt8blue/img/footicon.png differ diff --git a/skin/m15dt8blue/img/foottipsbg.gif b/skin/m15dt8blue/img/foottipsbg.gif new file mode 100644 index 0000000..e96a5d2 Binary files /dev/null and b/skin/m15dt8blue/img/foottipsbg.gif differ diff --git a/skin/m15dt8blue/img/grid-cart.png b/skin/m15dt8blue/img/grid-cart.png new file mode 100644 index 0000000..f88d59b Binary files /dev/null and b/skin/m15dt8blue/img/grid-cart.png differ diff --git a/skin/m15dt8blue/img/hg.png b/skin/m15dt8blue/img/hg.png new file mode 100644 index 0000000..43137a1 Binary files /dev/null and b/skin/m15dt8blue/img/hg.png differ diff --git a/skin/m15dt8blue/img/hot2.png b/skin/m15dt8blue/img/hot2.png new file mode 100644 index 0000000..70c655e Binary files /dev/null and b/skin/m15dt8blue/img/hot2.png differ diff --git a/skin/m15dt8blue/img/i1.png b/skin/m15dt8blue/img/i1.png new file mode 100644 index 0000000..2e18b0c Binary files /dev/null and b/skin/m15dt8blue/img/i1.png differ diff --git a/skin/m15dt8blue/img/ico-fav.png b/skin/m15dt8blue/img/ico-fav.png new file mode 100644 index 0000000..5b0ed99 Binary files /dev/null and b/skin/m15dt8blue/img/ico-fav.png differ diff --git a/skin/m15dt8blue/img/ico-like.png b/skin/m15dt8blue/img/ico-like.png new file mode 100644 index 0000000..f3c671c Binary files /dev/null and b/skin/m15dt8blue/img/ico-like.png differ diff --git a/skin/m15dt8blue/img/ico-qrcode.png b/skin/m15dt8blue/img/ico-qrcode.png new file mode 100644 index 0000000..10c1d7c Binary files /dev/null and b/skin/m15dt8blue/img/ico-qrcode.png differ diff --git a/skin/m15dt8blue/img/ico-share.png b/skin/m15dt8blue/img/ico-share.png new file mode 100644 index 0000000..3d2cb9a Binary files /dev/null and b/skin/m15dt8blue/img/ico-share.png differ diff --git a/skin/m15dt8blue/img/ico22 (1).png b/skin/m15dt8blue/img/ico22 (1).png new file mode 100644 index 0000000..6fc65a1 Binary files /dev/null and b/skin/m15dt8blue/img/ico22 (1).png differ diff --git a/skin/m15dt8blue/img/icon (1).png b/skin/m15dt8blue/img/icon (1).png new file mode 100644 index 0000000..c9d4319 Binary files /dev/null and b/skin/m15dt8blue/img/icon (1).png differ diff --git a/skin/m15dt8blue/img/icon-aflow-2.png b/skin/m15dt8blue/img/icon-aflow-2.png new file mode 100644 index 0000000..7864615 Binary files /dev/null and b/skin/m15dt8blue/img/icon-aflow-2.png differ diff --git a/skin/m15dt8blue/img/icon-aflow-3.png b/skin/m15dt8blue/img/icon-aflow-3.png new file mode 100644 index 0000000..e34aee3 Binary files /dev/null and b/skin/m15dt8blue/img/icon-aflow-3.png differ diff --git a/skin/m15dt8blue/img/icon-aflow.png b/skin/m15dt8blue/img/icon-aflow.png new file mode 100644 index 0000000..e5e5d3d Binary files /dev/null and b/skin/m15dt8blue/img/icon-aflow.png differ diff --git a/skin/m15dt8blue/img/icon-entry.png b/skin/m15dt8blue/img/icon-entry.png new file mode 100644 index 0000000..d75c026 Binary files /dev/null and b/skin/m15dt8blue/img/icon-entry.png differ diff --git a/skin/m15dt8blue/img/icon.png b/skin/m15dt8blue/img/icon.png new file mode 100644 index 0000000..13cfc69 Binary files /dev/null and b/skin/m15dt8blue/img/icon.png differ diff --git a/skin/m15dt8blue/img/icon0.png b/skin/m15dt8blue/img/icon0.png new file mode 100644 index 0000000..e1a9f5e Binary files /dev/null and b/skin/m15dt8blue/img/icon0.png differ diff --git a/skin/m15dt8blue/img/icons.png b/skin/m15dt8blue/img/icons.png new file mode 100644 index 0000000..a8cfde0 Binary files /dev/null and b/skin/m15dt8blue/img/icons.png differ diff --git a/skin/m15dt8blue/img/ilan_ico01.png b/skin/m15dt8blue/img/ilan_ico01.png new file mode 100644 index 0000000..2c34c33 Binary files /dev/null and b/skin/m15dt8blue/img/ilan_ico01.png differ diff --git a/skin/m15dt8blue/img/index_02_24.png b/skin/m15dt8blue/img/index_02_24.png new file mode 100644 index 0000000..75595f2 Binary files /dev/null and b/skin/m15dt8blue/img/index_02_24.png differ diff --git a/skin/m15dt8blue/img/index_full_collomn.png b/skin/m15dt8blue/img/index_full_collomn.png new file mode 100644 index 0000000..d8ffae7 Binary files /dev/null and b/skin/m15dt8blue/img/index_full_collomn.png differ diff --git a/skin/m15dt8blue/img/inews_jton.png b/skin/m15dt8blue/img/inews_jton.png new file mode 100644 index 0000000..38691c6 Binary files /dev/null and b/skin/m15dt8blue/img/inews_jton.png differ diff --git a/skin/m15dt8blue/img/iplay.png b/skin/m15dt8blue/img/iplay.png new file mode 100644 index 0000000..5e92744 Binary files /dev/null and b/skin/m15dt8blue/img/iplay.png differ diff --git a/skin/m15dt8blue/img/leftright.png b/skin/m15dt8blue/img/leftright.png new file mode 100644 index 0000000..79be484 Binary files /dev/null and b/skin/m15dt8blue/img/leftright.png differ diff --git a/skin/m15dt8blue/img/linyi.jpg b/skin/m15dt8blue/img/linyi.jpg new file mode 100644 index 0000000..92f512c Binary files /dev/null and b/skin/m15dt8blue/img/linyi.jpg differ diff --git a/skin/m15dt8blue/img/loading.gif b/skin/m15dt8blue/img/loading.gif new file mode 100644 index 0000000..085ccae Binary files /dev/null and b/skin/m15dt8blue/img/loading.gif differ diff --git a/skin/m15dt8blue/img/login.jpg b/skin/m15dt8blue/img/login.jpg new file mode 100644 index 0000000..e6a831f Binary files /dev/null and b/skin/m15dt8blue/img/login.jpg differ diff --git a/skin/m15dt8blue/img/loginbtn.gif b/skin/m15dt8blue/img/loginbtn.gif new file mode 100644 index 0000000..ace88b3 Binary files /dev/null and b/skin/m15dt8blue/img/loginbtn.gif differ diff --git a/skin/m15dt8blue/img/logo.gif b/skin/m15dt8blue/img/logo.gif new file mode 100644 index 0000000..008219c Binary files /dev/null and b/skin/m15dt8blue/img/logo.gif differ diff --git a/skin/m15dt8blue/img/maph1.gif b/skin/m15dt8blue/img/maph1.gif new file mode 100644 index 0000000..6babb0f Binary files /dev/null and b/skin/m15dt8blue/img/maph1.gif differ diff --git a/skin/m15dt8blue/img/mcatarrow.gif b/skin/m15dt8blue/img/mcatarrow.gif new file mode 100644 index 0000000..5eee203 Binary files /dev/null and b/skin/m15dt8blue/img/mcatarrow.gif differ diff --git a/skin/m15dt8blue/img/mm2.png b/skin/m15dt8blue/img/mm2.png new file mode 100644 index 0000000..7fd9c49 Binary files /dev/null and b/skin/m15dt8blue/img/mm2.png differ diff --git a/skin/m15dt8blue/img/moren.png b/skin/m15dt8blue/img/moren.png new file mode 100644 index 0000000..2023ec6 Binary files /dev/null and b/skin/m15dt8blue/img/moren.png differ diff --git a/skin/m15dt8blue/img/news-hot.png b/skin/m15dt8blue/img/news-hot.png new file mode 100644 index 0000000..e631a2a Binary files /dev/null and b/skin/m15dt8blue/img/news-hot.png differ diff --git a/skin/m15dt8blue/img/news-title.png b/skin/m15dt8blue/img/news-title.png new file mode 100644 index 0000000..5327ab8 Binary files /dev/null and b/skin/m15dt8blue/img/news-title.png differ diff --git a/skin/m15dt8blue/img/news.jpg b/skin/m15dt8blue/img/news.jpg new file mode 100644 index 0000000..8c76bd6 Binary files /dev/null and b/skin/m15dt8blue/img/news.jpg differ diff --git a/skin/m15dt8blue/img/off.png b/skin/m15dt8blue/img/off.png new file mode 100644 index 0000000..fb40a0f Binary files /dev/null and b/skin/m15dt8blue/img/off.png differ diff --git a/skin/m15dt8blue/img/person.gif b/skin/m15dt8blue/img/person.gif new file mode 100644 index 0000000..a7bfd52 Binary files /dev/null and b/skin/m15dt8blue/img/person.gif differ diff --git a/skin/m15dt8blue/img/pic1.png b/skin/m15dt8blue/img/pic1.png new file mode 100644 index 0000000..eb270c0 Binary files /dev/null and b/skin/m15dt8blue/img/pic1.png differ diff --git a/skin/m15dt8blue/img/pic3.jpg b/skin/m15dt8blue/img/pic3.jpg new file mode 100644 index 0000000..3555942 Binary files /dev/null and b/skin/m15dt8blue/img/pic3.jpg differ diff --git a/skin/m15dt8blue/img/pic5.jpg b/skin/m15dt8blue/img/pic5.jpg new file mode 100644 index 0000000..35effe8 Binary files /dev/null and b/skin/m15dt8blue/img/pic5.jpg differ diff --git a/skin/m15dt8blue/img/pop_user_bg.png b/skin/m15dt8blue/img/pop_user_bg.png new file mode 100644 index 0000000..8c9e5bb Binary files /dev/null and b/skin/m15dt8blue/img/pop_user_bg.png differ diff --git a/skin/m15dt8blue/img/post-icon (1).png b/skin/m15dt8blue/img/post-icon (1).png new file mode 100644 index 0000000..a3953fd Binary files /dev/null and b/skin/m15dt8blue/img/post-icon (1).png differ diff --git a/skin/m15dt8blue/img/post-icon.png b/skin/m15dt8blue/img/post-icon.png new file mode 100644 index 0000000..a3953fd Binary files /dev/null and b/skin/m15dt8blue/img/post-icon.png differ diff --git a/skin/m15dt8blue/img/pro-2.png b/skin/m15dt8blue/img/pro-2.png new file mode 100644 index 0000000..581ec4b Binary files /dev/null and b/skin/m15dt8blue/img/pro-2.png differ diff --git a/skin/m15dt8blue/img/reddot.gif b/skin/m15dt8blue/img/reddot.gif new file mode 100644 index 0000000..e9090db Binary files /dev/null and b/skin/m15dt8blue/img/reddot.gif differ diff --git a/skin/m15dt8blue/img/s-ico1.png b/skin/m15dt8blue/img/s-ico1.png new file mode 100644 index 0000000..2c72425 Binary files /dev/null and b/skin/m15dt8blue/img/s-ico1.png differ diff --git a/skin/m15dt8blue/img/sp_mdetail_new.png b/skin/m15dt8blue/img/sp_mdetail_new.png new file mode 100644 index 0000000..b814abe Binary files /dev/null and b/skin/m15dt8blue/img/sp_mdetail_new.png differ diff --git a/skin/m15dt8blue/img/spacer.gif b/skin/m15dt8blue/img/spacer.gif new file mode 100644 index 0000000..c95709f Binary files /dev/null and b/skin/m15dt8blue/img/spacer.gif differ diff --git a/skin/m15dt8blue/img/special3.png b/skin/m15dt8blue/img/special3.png new file mode 100644 index 0000000..06850bd Binary files /dev/null and b/skin/m15dt8blue/img/special3.png differ diff --git a/skin/m15dt8blue/img/sprite.png b/skin/m15dt8blue/img/sprite.png new file mode 100644 index 0000000..30a9afa Binary files /dev/null and b/skin/m15dt8blue/img/sprite.png differ diff --git a/skin/m15dt8blue/img/st.png b/skin/m15dt8blue/img/st.png new file mode 100644 index 0000000..70f8cf4 Binary files /dev/null and b/skin/m15dt8blue/img/st.png differ diff --git a/skin/m15dt8blue/img/subject_ico.png b/skin/m15dt8blue/img/subject_ico.png new file mode 100644 index 0000000..cf06bd9 Binary files /dev/null and b/skin/m15dt8blue/img/subject_ico.png differ diff --git a/skin/m15dt8blue/img/swiper.css b/skin/m15dt8blue/img/swiper.css new file mode 100644 index 0000000..a3b0d63 --- /dev/null +++ b/skin/m15dt8blue/img/swiper.css @@ -0,0 +1,531 @@ +/** + * Swiper 3.3.1 + * Most modern mobile touch slider and framework with hardware accelerated transitions + * + * http://www.idangero.us/swiper/ + * + * Copyright 2016, Vladimir Kharlampidi + * The iDangero.us + * http://www.idangero.us/ + * + * Licensed under MIT + * + * Released on: February 7, 2016 + */ +.swiper-container { + margin: 0 auto; + position: relative; + overflow: hidden; + /* Fix of Webkit flickering */ + z-index: 1; +} +.swiper-container-no-flexbox .swiper-slide { + float: left; +} +.swiper-container-vertical > .swiper-wrapper { + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-flex-direction: column; + -webkit-flex-direction: column; + flex-direction: column; +} +.swiper-wrapper { + position: relative; + width: 100%; + height: 100%; + z-index: 1; + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-transition-property: -webkit-transform; + -moz-transition-property: -moz-transform; + -o-transition-property: -o-transform; + -ms-transition-property: -ms-transform; + transition-property: transform; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.swiper-container-android .swiper-slide, +.swiper-wrapper { + -webkit-transform: translate3d(0px, 0, 0); + -moz-transform: translate3d(0px, 0, 0); + -o-transform: translate(0px, 0px); + -ms-transform: translate3d(0px, 0, 0); + transform: translate3d(0px, 0, 0); +} +.swiper-container-multirow > .swiper-wrapper { + -webkit-box-lines: multiple; + -moz-box-lines: multiple; + -ms-flex-wrap: wrap; + -webkit-flex-wrap: wrap; + flex-wrap: wrap; +} +.swiper-container-free-mode > .swiper-wrapper { + -webkit-transition-timing-function: ease-out; + -moz-transition-timing-function: ease-out; + -ms-transition-timing-function: ease-out; + -o-transition-timing-function: ease-out; + transition-timing-function: ease-out; + margin: 0 auto; +} +.swiper-slide { + -webkit-flex-shrink: 0; + -ms-flex: 0 0 auto; + flex-shrink: 0; + width: 100%; + height: 100%; + position: relative; +} +/* Auto Height */ +.swiper-container-autoheight, +.swiper-container-autoheight .swiper-slide { + height: auto; +} +.swiper-container-autoheight .swiper-wrapper { + -webkit-box-align: start; + -ms-flex-align: start; + -webkit-align-items: flex-start; + align-items: flex-start; + -webkit-transition-property: -webkit-transform, height; + -moz-transition-property: -moz-transform; + -o-transition-property: -o-transform; + -ms-transition-property: -ms-transform; + transition-property: transform, height; +} +/* a11y */ +.swiper-container .swiper-notification { + position: absolute; + left: 0; + top: 0; + pointer-events: none; + opacity: 0; + z-index: -1000; +} +/* IE10 Windows Phone 8 Fixes */ +.swiper-wp8-horizontal { + -ms-touch-action: pan-y; + touch-action: pan-y; +} +.swiper-wp8-vertical { + -ms-touch-action: pan-x; + touch-action: pan-x; +} +/* Arrows */ +.swiper-button-prev, +.swiper-button-next { + position: absolute; + top: 50%; + width: 27px; + height: 44px; + margin-top: -22px; + z-index: 10; + cursor: pointer; + -moz-background-size: 27px 44px; + -webkit-background-size: 27px 44px; + background-size: 27px 44px; + background-position: center; + background-repeat: no-repeat; +} +.swiper-button-prev.swiper-button-disabled, +.swiper-button-next.swiper-button-disabled { + opacity: 0.35; + cursor: auto; + pointer-events: none; +} +.swiper-button-prev, +.swiper-container-rtl .swiper-button-next { + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E"); + left: 10px; + right: auto; +} +.swiper-button-prev.swiper-button-black, +.swiper-container-rtl .swiper-button-next.swiper-button-black { + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E"); +} +.swiper-button-prev.swiper-button-white, +.swiper-container-rtl .swiper-button-next.swiper-button-white { + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E"); +} +.swiper-button-next, +.swiper-container-rtl .swiper-button-prev { + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E"); + right: 10px; + left: auto; +} +.swiper-button-next.swiper-button-black, +.swiper-container-rtl .swiper-button-prev.swiper-button-black { + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E"); +} +.swiper-button-next.swiper-button-white, +.swiper-container-rtl .swiper-button-prev.swiper-button-white { + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E"); +} +/* Pagination Styles */ +.swiper-pagination { + position: absolute; + text-align: center; + -webkit-transition: 300ms; + -moz-transition: 300ms; + -o-transition: 300ms; + transition: 300ms; + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + -o-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + z-index: 10; +} +.swiper-pagination.swiper-pagination-hidden { + opacity: 0; +} +/* Common Styles */ +.swiper-pagination-fraction, +.swiper-pagination-custom, +.swiper-container-horizontal > .swiper-pagination-bullets { + bottom: 35px; + left: 0; + width: 100%; +} +/* Bullets */ +.swiper-pagination-bullet { + display: inline-block; + border-radius: 100%; +} +button.swiper-pagination-bullet { + border: none; + margin: 0; + padding: 0; + box-shadow: none; + -moz-appearance: none; + -ms-appearance: none; + -webkit-appearance: none; + appearance: none; +} +.swiper-pagination-clickable .swiper-pagination-bullet { + cursor: pointer; +} +.swiper-pagination-white .swiper-pagination-bullet { + background: #fff; +} +.swiper-pagination-bullet-active { + opacity: 1; + background: #007aff; +} +.swiper-pagination-white .swiper-pagination-bullet-active { + background: #fff; +} +.swiper-pagination-black .swiper-pagination-bullet-active { + background: #000; +} +.swiper-container-vertical > .swiper-pagination-bullets { + right: 10px; + top: 50%; + -webkit-transform: translate3d(0px, -50%, 0); + -moz-transform: translate3d(0px, -50%, 0); + -o-transform: translate(0px, -50%); + -ms-transform: translate3d(0px, -50%, 0); + transform: translate3d(0px, -50%, 0); +} +.swiper-container-vertical > .swiper-pagination-bullets .swiper-pagination-bullet { + margin: 5px 0; + display: block; +} +.swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet { + margin: 0 5px; +} +/* Progress */ +.swiper-pagination-progress { + background: rgba(0, 0, 0, 0.25); + position: absolute; +} +.swiper-pagination-progress .swiper-pagination-progressbar { + background: #007aff; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + -webkit-transform: scale(0); + -ms-transform: scale(0); + -o-transform: scale(0); + transform: scale(0); + -webkit-transform-origin: left top; + -moz-transform-origin: left top; + -ms-transform-origin: left top; + -o-transform-origin: left top; + transform-origin: left top; +} +.swiper-container-rtl .swiper-pagination-progress .swiper-pagination-progressbar { + -webkit-transform-origin: right top; + -moz-transform-origin: right top; + -ms-transform-origin: right top; + -o-transform-origin: right top; + transform-origin: right top; +} +.swiper-container-horizontal > .swiper-pagination-progress { + width: 100%; + height: 4px; + left: 0; + top: 0; +} +.swiper-container-vertical > .swiper-pagination-progress { + width: 4px; + height: 100%; + left: 0; + top: 0; +} +.swiper-pagination-progress.swiper-pagination-white { + background: rgba(255, 255, 255, 0.5); +} +.swiper-pagination-progress.swiper-pagination-white .swiper-pagination-progressbar { + background: #fff; +} +.swiper-pagination-progress.swiper-pagination-black .swiper-pagination-progressbar { + background: #000; +} +/* 3D Container */ +.swiper-container-3d { + -webkit-perspective: 1200px; + -moz-perspective: 1200px; + -o-perspective: 1200px; + perspective: 1200px; +} +.swiper-container-3d .swiper-wrapper, +.swiper-container-3d .swiper-slide, +.swiper-container-3d .swiper-slide-shadow-left, +.swiper-container-3d .swiper-slide-shadow-right, +.swiper-container-3d .swiper-slide-shadow-top, +.swiper-container-3d .swiper-slide-shadow-bottom, +.swiper-container-3d .swiper-cube-shadow { + -webkit-transform-style: preserve-3d; + -moz-transform-style: preserve-3d; + -ms-transform-style: preserve-3d; + transform-style: preserve-3d; +} +.swiper-container-3d .swiper-slide-shadow-left, +.swiper-container-3d .swiper-slide-shadow-right, +.swiper-container-3d .swiper-slide-shadow-top, +.swiper-container-3d .swiper-slide-shadow-bottom { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + pointer-events: none; + z-index: 10; +} +.swiper-container-3d .swiper-slide-shadow-left { + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); + /* Safari 4+, Chrome */ + background-image: -webkit-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Chrome 10+, Safari 5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Firefox 3.6-15 */ + background-image: -o-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Opera 11.10-12.00 */ + background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Firefox 16+, IE10, Opera 12.50+ */ +} +.swiper-container-3d .swiper-slide-shadow-right { + background-image: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); + /* Safari 4+, Chrome */ + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Chrome 10+, Safari 5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Firefox 3.6-15 */ + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Opera 11.10-12.00 */ + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Firefox 16+, IE10, Opera 12.50+ */ +} +.swiper-container-3d .swiper-slide-shadow-top { + background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); + /* Safari 4+, Chrome */ + background-image: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Chrome 10+, Safari 5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Firefox 3.6-15 */ + background-image: -o-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Opera 11.10-12.00 */ + background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Firefox 16+, IE10, Opera 12.50+ */ +} +.swiper-container-3d .swiper-slide-shadow-bottom { + background-image: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); + /* Safari 4+, Chrome */ + background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Chrome 10+, Safari 5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Firefox 3.6-15 */ + background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Opera 11.10-12.00 */ + background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); + /* Firefox 16+, IE10, Opera 12.50+ */ +} +/* Coverflow */ +.swiper-container-coverflow .swiper-wrapper, +.swiper-container-flip .swiper-wrapper { + /* Windows 8 IE 10 fix */ + -ms-perspective: 1200px; +} +/* Cube + Flip */ +.swiper-container-cube, +.swiper-container-flip { + overflow: visible; +} +.swiper-container-cube .swiper-slide, +.swiper-container-flip .swiper-slide { + pointer-events: none; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + z-index: 1; +} +.swiper-container-cube .swiper-slide .swiper-slide, +.swiper-container-flip .swiper-slide .swiper-slide { + pointer-events: none; +} +.swiper-container-cube .swiper-slide-active, +.swiper-container-flip .swiper-slide-active, +.swiper-container-cube .swiper-slide-active .swiper-slide-active, +.swiper-container-flip .swiper-slide-active .swiper-slide-active { + pointer-events: auto; +} +.swiper-container-cube .swiper-slide-shadow-top, +.swiper-container-flip .swiper-slide-shadow-top, +.swiper-container-cube .swiper-slide-shadow-bottom, +.swiper-container-flip .swiper-slide-shadow-bottom, +.swiper-container-cube .swiper-slide-shadow-left, +.swiper-container-flip .swiper-slide-shadow-left, +.swiper-container-cube .swiper-slide-shadow-right, +.swiper-container-flip .swiper-slide-shadow-right { + z-index: 0; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; +} +/* Cube */ +.swiper-container-cube .swiper-slide { + visibility: hidden; + -webkit-transform-origin: 0 0; + -moz-transform-origin: 0 0; + -ms-transform-origin: 0 0; + transform-origin: 0 0; + width: 100%; + height: 100%; +} +.swiper-container-cube.swiper-container-rtl .swiper-slide { + -webkit-transform-origin: 100% 0; + -moz-transform-origin: 100% 0; + -ms-transform-origin: 100% 0; + transform-origin: 100% 0; +} +.swiper-container-cube .swiper-slide-active, +.swiper-container-cube .swiper-slide-next, +.swiper-container-cube .swiper-slide-prev, +.swiper-container-cube .swiper-slide-next + .swiper-slide { + pointer-events: auto; + visibility: visible; +} +.swiper-container-cube .swiper-cube-shadow { + position: absolute; + left: 0; + bottom: 0px; + width: 100%; + height: 100%; + background: #000; + opacity: 0.6; + -webkit-filter: blur(50px); + filter: blur(50px); + z-index: 0; +} +/* Fade */ +.swiper-container-fade.swiper-container-free-mode .swiper-slide { + -webkit-transition-timing-function: ease-out; + -moz-transition-timing-function: ease-out; + -ms-transition-timing-function: ease-out; + -o-transition-timing-function: ease-out; + transition-timing-function: ease-out; +} +.swiper-container-fade .swiper-slide { + pointer-events: none; + -webkit-transition-property: opacity; + -moz-transition-property: opacity; + -o-transition-property: opacity; + transition-property: opacity; +} +.swiper-container-fade .swiper-slide .swiper-slide { + pointer-events: none; +} +.swiper-container-fade .swiper-slide-active, +.swiper-container-fade .swiper-slide-active .swiper-slide-active { + pointer-events: auto; +} +/* Scrollbar */ +.swiper-scrollbar { + border-radius: 10px; + position: relative; + -ms-touch-action: none; + background: rgba(0, 0, 0, 0.1); +} +.swiper-container-horizontal > .swiper-scrollbar { + position: absolute; + left: 1%; + bottom: 3px; + z-index: 50; + height: 5px; + width: 98%; +} +.swiper-container-vertical > .swiper-scrollbar { + position: absolute; + right: 3px; + top: 1%; + z-index: 50; + width: 5px; + height: 98%; +} +.swiper-scrollbar-drag { + height: 100%; + width: 100%; + position: relative; + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; + left: 0; + top: 0; +} +.swiper-scrollbar-cursor-drag { + cursor: move; +} +/* Preloader */ +.swiper-lazy-preloader img{ + width:100%; + display:block; +} +/*.swiper-lazy-preloader:after { + display: block; + content: ""; + width: 100%; + height: 100%; + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); + background-position: 50%; + -webkit-background-size: 100%; + background-size: 100%; + background-repeat: no-repeat; +} +.swiper-lazy-preloader-white:after { + background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); +}*/ +@-webkit-keyframes swiper-preloader-spin { + 100% { + -webkit-transform: rotate(360deg); + } +} +@keyframes swiper-preloader-spin { + 100% { + transform: rotate(360deg); + } +} diff --git a/skin/m15dt8blue/img/tool-tel.png b/skin/m15dt8blue/img/tool-tel.png new file mode 100644 index 0000000..67666a7 Binary files /dev/null and b/skin/m15dt8blue/img/tool-tel.png differ diff --git a/skin/m15dt8blue/img/top-back-black.png b/skin/m15dt8blue/img/top-back-black.png new file mode 100644 index 0000000..b52628b Binary files /dev/null and b/skin/m15dt8blue/img/top-back-black.png differ diff --git a/skin/m15dt8blue/img/wxkf.png b/skin/m15dt8blue/img/wxkf.png new file mode 100644 index 0000000..be0d33f Binary files /dev/null and b/skin/m15dt8blue/img/wxkf.png differ diff --git a/skin/m15dt8blue/img/wxkf20200000.png b/skin/m15dt8blue/img/wxkf20200000.png new file mode 100644 index 0000000..be0d33f Binary files /dev/null and b/skin/m15dt8blue/img/wxkf20200000.png differ diff --git a/skin/m15dt8blue/img/xcx.jpg b/skin/m15dt8blue/img/xcx.jpg new file mode 100644 index 0000000..5852af3 Binary files /dev/null and b/skin/m15dt8blue/img/xcx.jpg differ diff --git a/skin/m15dt8blue/img/xiaolaba.png b/skin/m15dt8blue/img/xiaolaba.png new file mode 100644 index 0000000..3c3ecf2 Binary files /dev/null and b/skin/m15dt8blue/img/xiaolaba.png differ diff --git a/skin/m15dt8blue/img/zhengzai.png b/skin/m15dt8blue/img/zhengzai.png new file mode 100644 index 0000000..b23f73d Binary files /dev/null and b/skin/m15dt8blue/img/zhengzai.png differ diff --git a/skin/m15dt8blue/jquery.slide.css b/skin/m15dt8blue/jquery.slide.css new file mode 100644 index 0000000..55f592e --- /dev/null +++ b/skin/m15dt8blue/jquery.slide.css @@ -0,0 +1,20 @@ +.jqslide{background:#000000;color:#FFFFFF;padding-top:30px;} +.jqslide .pic{text-align:center;position:relative;z-index:5;width:1200px;margin:0 auto;} +.jqslide .pic .big{text-align:center;vertical-align:center;position:relative;width:1200px;min-height:600px;} +.jqslide .pic .prev,.jqslide .pic .next {background:url('image/spacer.gif');cursor:pointer;height:100%;position:absolute;top:0;width:50%;z-index:5;} +.jqslide .pic .prev{left:0;} +.jqslide .pic .next{right:0;} +.jqslide .pic .prevbtn {cursor:url('image/prev.cur'),auto;display:block;height:100%;outline:none;width:100%;} +.jqslide .pic .nextbtn {cursor:url('image/next.cur'),auto;display:block;height:100%;outline:none;width:100%;} +.jqslide .plist{height:150px;position:relative;} +.jqslide .plist li img{border:1px solid #BFBFBF;} +.jqslide .plist li a:hover img{background:#FF6600; border:1px solid #FF6600;} +.jqslide .plist ul{height:79px;overflow:hidden;margin:0 auto;-moz-user-select:none;-khtml-user-select:none;user-select:none;} +.jqslide .plist ul li{padding:2px 12px;width:104px;float:left;} +.jqslide .plist ul li span{display:none;color:#FFFFFF;padding:2px;background:#000000;position:absolute;margin:1px;font-size:10px;opacity:0.7;filter:alpha(opacity=70);} +.jqslide ul li p{margin:0; line-height:21px;} +.jqslide .scd{width:896px;height:79px;overflow:hidden;margin:0 auto;} +.jqslide .scl,.jqslide .scr{background:url('image/jquery.slide.sc.png') no-repeat 0 0;display:block;width:20px;height:65px;position:absolute;top:7px;left:120px;} +.jqslide .scr{left:1058px;background-position:0 -95px;} +.jqslide .scb {background:url('image/jquery.slide.sc.png') no-repeat 0 -190px;height:13px;left:150px;position:absolute;top:100px;width:360px;cursor:e-resize;} +#pload{background:url('image/jquery.slide.pload.gif') no-repeat;position:absolute;width:37px;height:37px;z-index:5;display:none;left:50%;top:50%;} \ No newline at end of file diff --git a/skin/m15dt8blue/js/jquery.imgSlider.js b/skin/m15dt8blue/js/jquery.imgSlider.js new file mode 100644 index 0000000..ef1781c --- /dev/null +++ b/skin/m15dt8blue/js/jquery.imgSlider.js @@ -0,0 +1,173 @@ +var img = { + + imageNum: 5 , + imageNumWidth:163, + num:0, + count:document.getElementById("imagebg").getElementsByTagName("li").length, + + current:document.getElementById("current"), + imagebg:document.getElementById("imagebg"), + imagebg_li:document.getElementById("imagebg").getElementsByTagName("li"), + small_pic:document.getElementById("small_pic"), + + imageShow:document.getElementById("imageShow"), + scrollbg:document.getElementById("scrollbg"), + + left_img_btn:document.getElementById("left_img_btn"), + right_img_btn:document.getElementById("right_img_btn"), + + small_pic_html:[], + + animate:null, + autoplay:null, + + init:function(){ + img.imagebg.innerHTML = img.imagebg.innerHTML+img.imagebg.innerHTML+img.imagebg.innerHTML; + for(var i=0;i"); + img.imagebg.getElementsByTagName("li")[i].style.display ="none"; + }else{ + img.small_pic_html.push("
  • "); + } + //console.log(img.small_pic_html); + } + //console.log(img.small_pic_html) + + img.small_pic.innerHTML = img.small_pic_html.join(""); + img.current.style.left = "77px"; + img.small_pic.style.left = "0px"; + img.imagebg_li[0].style.filter = "alpha(opacity=100)"; + img.imagebg_li[0].style.opacity = 1; + + img.left_img_btn.onclick = function(){img.play(img.num-1);} + img.right_img_btn.onclick = function(){img.play(img.num+1)}; + + img.autoplay= setInterval(function(){img.play(img.num+1)},5000); + + img.imageShow.onmouseover = function(){clearInterval(img.autoplay);} + img.imageShow.onmouseout = function(){img.autoplay= setInterval(function(){img.play(img.num+1)},5000); } + + }, + + play:function(i){ + var small_pic_left = parseInt(img.small_pic.style.left); + var current_left = parseInt(img.current.style.left); + var op = 0; + + if(i == img.num|| img.animate!=null || i>img.count*3 || i<-1){return;} + + + + for(var x=0;x(img.count*3-1)){ + i-=img.count; + img.num -=img.count; + + img.small_pic.style.left = small_pic_left + img.imageNumWidth*(i-img.count) +"px" ; + img.small_pic.getElementsByTagName("li")[i].className="currently"; + + small_pic_left = parseInt(img.small_pic.style.left); + current_left = parseInt(img.current.style.left); + + }else if(i<0){ + i+=img.count; + img.num +=img.count; + + img.small_pic.style.left = small_pic_left - img.imageNumWidth*img.count +"px" ; + img.small_pic.getElementsByTagName("li")[i].className="currently"; + + small_pic_left = parseInt(img.small_pic.style.left); + current_left = parseInt(img.current.style.left); + } + + if(i>img.num){ + //如果比当前大; + img.imagebg_li[i].style.display = "block"; + if(parseInt(img.current.style.left)>700){ + //如果活动框到了最右边--完成 + //小图片向左 + img.animate = setInterval(function(){ + if(parseInt(img.small_pic.style.left)>(small_pic_left- img.imageNumWidth*(i-img.num)+img.imageNumWidth*(i-img.num)/10)){ + img.small_pic.style.left = parseInt(img.small_pic.style.left) - img.imageNumWidth*(i-img.num)/10 +"px" ; + img.imagebg_li[i].style.filter = "alpha(opacity="+(++op)*11+")"; + img.imagebg_li[i].style.opacity = op/9; + }else{ + img.small_pic.style.left = small_pic_left - img.imageNumWidth*(i-img.num) +"px" ; + img.small_pic.getElementsByTagName("li")[i].className="currently"; + clearInterval(img.animate); + img.num = i; + img.animate = null; + } + },30); + }else{ + //活动框向右--完成 + img.animate = setInterval(function(){ + if(parseInt(img.current.style.left)<(current_left + img.imageNumWidth*(i-img.num)-img.imageNumWidth*(i-img.num)/10)){ + img.current.style.left = parseInt(img.current.style.left) + img.imageNumWidth*(i-img.num)/10 +"px" ; + //为了IE联盟 + + img.imagebg_li[i].style.filter = "alpha(opacity="+(++op)*11+")"; //"alpha(opacity=100)"; + + //为了火狐部落 + img.imagebg_li[i].style.opacity = op/9; + }else{ + img.current.style.left = current_left + img.imageNumWidth*(i-img.num) +"px" ; + img.small_pic.getElementsByTagName("li")[i].className="currently"; + clearInterval(img.animate); + img.num = i; + img.animate = null; + } + },30); + } + + }else if(i(current_left - img.imageNumWidth*(img.num-i)+img.imageNumWidth*(img.num-i)/10)){ + img.current.style.left = parseInt(img.current.style.left) - img.imageNumWidth*(img.num-i)/10 +"px" ; + img.imagebg_li[i].style.filter = "alpha(opacity="+(++op)*11+")"; + img.imagebg_li[i].style.opacity = op/9; + }else{ + img.current.style.left = current_left - img.imageNumWidth*(img.num-i) +"px" ; + img.small_pic.getElementsByTagName("li")[i].className="currently"; + clearInterval(img.animate); + img.num = i; + img.animate = null; + } + },30); + } + } + } + + +} \ No newline at end of file diff --git a/skin/m15dt8blue/js/jquery.mcustomscrollbar.min.js b/skin/m15dt8blue/js/jquery.mcustomscrollbar.min.js new file mode 100644 index 0000000..0b49727 --- /dev/null +++ b/skin/m15dt8blue/js/jquery.mcustomscrollbar.min.js @@ -0,0 +1 @@ +(function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("
    ").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));var g=m.children(".mCustomScrollBox");if(e.horizontalScroll){g.addClass("mCSB_horizontal").wrapInner("
    ");var k=g.children(".mCSB_h_wrapper");k.wrapInner("
    ").children(".mCSB_container").css({width:k.children().outerWidth(),position:"relative"}).unwrap()}else{g.wrapInner("
    ")}var o=g.children(".mCSB_container");if(c.support.touch){o.addClass("mCS_touch")}o.after("
    ");var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");if(e.horizontalScroll){q.data("minDraggerWidth",q.width())}else{q.data("minDraggerHeight",q.height())}if(e.scrollButtons.enable){if(e.horizontalScroll){l.prepend("").append("")}else{l.prepend("").append("")}}g.bind("scroll",function(){if(!m.is(".mCS_disabled")){g.scrollTop(0).scrollLeft(0)}});m.data({mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false});if(e.horizontalScroll){if(m.css("max-width")!=="none"){if(!e.advanced.updateOnContentResize){e.advanced.updateOnContentResize=true}}}else{if(m.css("max-height")!=="none"){var s=false,r=parseInt(m.css("max-height"));if(m.css("max-height").indexOf("%")>=0){s=r,r=m.parent().height()*s/100}m.css("overflow","hidden");g.css("max-height",r)}}m.mCustomScrollbar("update");if(e.advanced.updateOnBrowserResize){var i,j=c(window).width(),u=c(window).height();c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){if(i){clearTimeout(i)}i=setTimeout(function(){if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){var w=c(window).width(),v=c(window).height();if(j!==w||u!==v){if(m.css("max-height")!=="none"&&s){g.css("max-height",m.parent().height()*s/100)}m.mCustomScrollbar("update");j=w;u=v}}},150)})}if(e.advanced.updateOnContentResize){var p;if(e.horizontalScroll){var n=o.outerWidth()}else{var n=o.outerHeight()}p=setInterval(function(){if(e.horizontalScroll){if(e.advanced.autoExpandHorizontalScroll){o.css({position:"absolute",width:"auto"}).wrap("
    ").css({width:o.outerWidth(),position:"relative"}).unwrap()}var v=o.outerWidth()}else{var v=o.outerHeight()}if(v!=n){m.mCustomScrollbar("update");n=v}},300)}})},update:function(){var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");q.removeClass("mCS_no_scrollbar");n.removeClass("mCS_disabled mCS_destroyed");k.scrollTop(0).scrollLeft(0);var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");if(n.data("horizontalScroll")){var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();if(n.data("autoExpandHorizontalScroll")){q.css({position:"absolute",width:"auto"}).wrap("
    ").css({width:q.outerWidth(),position:"relative"}).unwrap()}var z=q.outerWidth()}else{var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}if(i>r&&!n.data("horizontalScroll")){y.css("display","block");var s=o.height();if(n.data("autoDraggerLength")){var u=Math.round(r/i*s),l=m.data("minDraggerHeight");if(u<=l){m.css({height:l})}else{if(u>=s-10){var p=s-10;m.css({height:p})}else{m.css({height:u})}}m.children(".mCSB_dragger_bar").css({"line-height":m.height()+"px"})}var B=m.height(),x=(i-r)/(s-B);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().top);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{if(z>f&&n.data("horizontalScroll")){y.css("display","block");var h=o.width();if(n.data("autoDraggerLength")){var j=Math.round(f/z*h),C=m.data("minDraggerWidth");if(j<=C){m.css({width:C})}else{if(j>=h-10){var e=h-10;m.css({width:e})}else{m.css({width:j})}}}var v=m.width(),x=(z-f)/(h-v);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().left);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{k.unbind("mousewheel focusin");if(n.data("horizontalScroll")){m.add(q).css("left",0)}else{m.add(q).css("top",0)}y.css("display","none");q.addClass("mCS_no_scrollbar");n.data({bindEvent_mousewheel:false,bindEvent_focusin:false})}}},scrolling:function(h,p,m,j,w,e,A,v){var k=c(this);if(!k.data("bindEvent_scrollbar_drag")){var n,o;if(c.support.msPointer){j.bind("MSPointerDown",function(H){H.preventDefault();k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");var G=c(this),J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;if(F0&&I0){n=I;o=F}});c(document).bind("MSPointerMove."+k.data("mCustomScrollbarIndex"),function(H){H.preventDefault();if(k.data("on_drag")){var G=j,J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;D(n,o,I,F)}}).bind("MSPointerUp."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}else{j.bind("mousedown touchstart",function(H){H.preventDefault();H.stopImmediatePropagation();var G=c(this),K=G.offset(),F,J;if(H.type==="touchstart"){var I=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0];F=I.pageX-K.left;J=I.pageY-K.top}else{k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");F=H.pageX-K.left;J=H.pageY-K.top}if(F0&&J0){n=J;o=F}}).bind("touchmove",function(H){H.preventDefault();H.stopImmediatePropagation();var K=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0],G=c(this),J=G.offset(),F=K.pageX-J.left,I=K.pageY-J.top;D(n,o,I,F)});c(document).bind("mousemove."+k.data("mCustomScrollbarIndex"),function(H){if(k.data("on_drag")){var G=j,J=G.offset(),F=H.pageX-J.left,I=H.pageY-J.top;D(n,o,I,F)}}).bind("mouseup."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}k.data({bindEvent_scrollbar_drag:true})}function D(G,H,I,F){if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",(j.position().left-(H))+F,{moveDragger:true,trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",(j.position().top-(G))+I,{moveDragger:true,trigger:"internal"})}}if(c.support.touch&&k.data("contentTouchScroll")){if(!k.data("bindEvent_content_touch")){var l,B,r,s,u,C,E;p.bind("touchstart",function(x){x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this);r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;C=s;E=u});p.bind("touchmove",function(x){x.preventDefault();x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this).parent();r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",E-u,{trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",C-s,{trigger:"internal"})}})}}if(!k.data("bindEvent_scrollbar_click")){m.bind("click",function(F){var x=(F.pageY-m.offset().top)*k.data("scrollAmount"),y=c(F.target);if(k.data("horizontalScroll")){x=(F.pageX-m.offset().left)*k.data("scrollAmount")}if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){k.mCustomScrollbar("scrollTo",x,{trigger:"internal",scrollEasing:"draggerRailEase"})}});k.data({bindEvent_scrollbar_click:true})}if(k.data("mouseWheel")){if(!k.data("bindEvent_mousewheel")){h.bind("mousewheel",function(H,J){var G,F=k.data("mouseWheelPixels"),x=Math.abs(p.position().top),I=j.position().top,y=m.height()-j.height();if(k.data("normalizeMouseWheelDelta")){if(J<0){J=-1}else{J=1}}if(F==="auto"){F=100+Math.round(k.data("scrollAmount")/2)}if(k.data("horizontalScroll")){I=j.position().left;y=m.width()-j.width();x=Math.abs(p.position().left)}if((J>0&&I!==0)||(J<0&&I!==y)){H.preventDefault();H.stopImmediatePropagation()}G=x-(J*F);k.mCustomScrollbar("scrollTo",G,{trigger:"internal"})});k.data({bindEvent_mousewheel:true})}}if(k.data("scrollButtons_enable")){if(k.data("scrollButtons_scrollType")==="pixels"){if(k.data("horizontalScroll")){v.add(A).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_x:false});if(!k.data("bindEvent_buttonsPixels_x")){v.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)+k.data("scrollButtons_scrollAmount"))});A.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_x:true})}}else{e.add(w).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_y:false});if(!k.data("bindEvent_buttonsPixels_y")){e.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)+k.data("scrollButtons_scrollAmount"))});w.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_y:true})}}function q(x){if(!j.data("preventAction")){j.data("preventAction",true);k.mCustomScrollbar("scrollTo",x,{trigger:"internal"})}}}else{if(k.data("horizontalScroll")){v.add(A).unbind("click");k.data({bindEvent_buttonsPixels_x:false});if(!k.data("bindEvent_buttonsContinuous_x")){v.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollRight:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var i=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollRight"))};v.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",i);A.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollLeft:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var g=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollLeft"))};A.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",g);k.data({bindEvent_buttonsContinuous_x:true})}}else{e.add(w).unbind("click");k.data({bindEvent_buttonsPixels_y:false});if(!k.data("bindEvent_buttonsContinuous_y")){e.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollDown:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var t=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollDown"))};e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",t);w.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollUp:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var f=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollUp"))};w.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",f);k.data({bindEvent_buttonsContinuous_y:true})}}function z(){var x=k.data("scrollButtons_scrollSpeed");if(k.data("scrollButtons_scrollSpeed")==="auto"){x=Math.round((k.data("scrollInertia")+100)/40)}return x}}}if(k.data("autoScrollOnFocus")){if(!k.data("bindEvent_focusin")){h.bind("focusin",function(){h.scrollTop(0).scrollLeft(0);var x=c(document.activeElement);if(x.is("input,textarea,select,button,a[tabindex],area,object")){var G=p.position().top,y=x.position().top,F=h.height()-x.outerHeight();if(k.data("horizontalScroll")){G=p.position().left;y=x.position().left;F=h.width()-x.outerWidth()}if(G+y<0||G+y>F){k.mCustomScrollbar("scrollTo",y,{trigger:"internal"})}}});k.data({bindEvent_focusin:true})}}if(k.data("autoHideScrollbar")){if(!k.data("bindEvent_autoHideScrollbar")){h.bind("mouseenter",function(x){h.addClass("mCS-mouse-over");d.showScrollbar.call(h.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(x){h.removeClass("mCS-mouse-over");if(x.type==="mouseleave"){d.hideScrollbar.call(h.children(".mCSB_scrollTools"))}});k.data({bindEvent_autoHideScrollbar:true})}}},scrollTo:function(e,f){var i=c(this),o={moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;if(!k.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:f.trigger});if(i.data("mCS_Init")){f.callbacks=false}if(e||e===0){if(typeof(e)==="number"){if(f.moveDragger){p=e;if(i.data("horizontalScroll")){e=h.position().left*i.data("scrollAmount")}else{e=h.position().top*i.data("scrollAmount")}draggerSpeed=0}else{p=e/i.data("scrollAmount")}}else{if(typeof(e)==="string"){var v;if(e==="top"){v=0}else{if(e==="bottom"&&!i.data("horizontalScroll")){v=k.outerHeight()-g.height()}else{if(e==="left"){v=0}else{if(e==="right"&&i.data("horizontalScroll")){v=k.outerWidth()-g.width()}else{if(e==="first"){v=i.find(".mCSB_container").find(":first")}else{if(e==="last"){v=i.find(".mCSB_container").find(":last")}else{v=i.find(e)}}}}}}if(v.length===1){if(i.data("horizontalScroll")){e=v.position().left}else{e=v.position().top}p=e/i.data("scrollAmount")}else{p=e=v}}}if(i.data("horizontalScroll")){if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollLeft"));if(!s){q=true}}else{if(p>=j.width()-h.width()){p=j.width()-h.width();e=g.width()-k.outerWidth();clearInterval(i.data("mCSB_buttonScrollRight"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().left>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().left<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}else{if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollUp"));if(!s){q=true}}else{if(p>=j.height()-h.height()){p=j.height()-h.height();e=g.height()-k.outerHeight();clearInterval(i.data("mCSB_buttonScrollDown"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().top>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().top<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}if(i.data("mCS_Init")){i.data({mCS_Init:false})}}}function u(w){this.mcs={top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))};switch(w){case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);break}}},stop:function(){var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");d.mTweenAxisStop.call(this,e[0]);d.mTweenAxisStop.call(this,f[0])},disable:function(e){var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");f.unbind("mousewheel focusin mouseenter mouseleave touchend");h.unbind("touchstart touchmove");if(e){if(j.data("horizontalScroll")){i.add(h).css("left",0)}else{i.add(h).css("top",0)}}g.css("display","none");h.addClass("mCS_no_scrollbar");j.data({bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}).addClass("mCS_disabled")},destroy:function(){var e=c(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},d={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(g,i,h,f,o,y){var y=y||{},v=y.onStart||function(){},p=y.onUpdate||function(){},w=y.onComplete||function(){};var n=t(),l,j=0,r=g.offsetTop,s=g.style;if(i==="left"){r=g.offsetLeft}var m=h-r;q();e();function t(){if(window.performance&&window.performance.now){return window.performance.now()}else{if(window.performance&&window.performance.webkitNow){return window.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}}function x(){if(!j){v.call()}j=t()-n;u();if(j>=g._time){g._time=(j>g._time)?j+l-(j-g._time):j+l-1;if(g._time0){g.currVal=k(g._time,r,m,f,o);s[i]=Math.round(g.currVal)+"px"}else{s[i]=h+"px"}p.call()}function e(){l=1000/60;g._time=j+l;_request=(!window.requestAnimationFrame)?function(z){u();return setTimeout(z,0.01)}:window.requestAnimationFrame;g._id=_request(x)}function q(){if(g._id==null){return}if(!window.requestAnimationFrame){clearTimeout(g._id)}else{window.cancelAnimationFrame(g._id)}g._id=null}function k(B,A,F,E,C){switch(C){case"linear":return F*B/E+A;break;case"easeOutQuad":B/=E;return -F*B*(B-2)+A;break;case"easeInOutQuad":B/=E/2;if(B<1){return F/2*B*B+A}B--;return -F/2*(B*(B-2)-1)+A;break;case"easeOutCubic":B/=E;B--;return F*(B*B*B+1)+A;break;case"easeOutQuart":B/=E;B--;return -F*(B*B*B*B-1)+A;break;case"easeOutQuint":B/=E;B--;return F*(B*B*B*B*B+1)+A;break;case"easeOutCirc":B/=E;B--;return F*Math.sqrt(1-B*B)+A;break;case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;break;case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;break;case"mcsEaseOut":var D=(B/=E)*B,z=D*B;return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);break;case"draggerRailEase":B/=E/2;if(B<1){return F/2*B*B*B+A}B-=2;return F/2*(B*B*B+2)+A;break}}},mTweenAxisStop:function(e){if(e._id==null){return}if(!window.requestAnimationFrame){clearTimeout(e._id)}else{window.cancelAnimationFrame(e._id)}e._id=null},rafPolyfill:function(){var f=["ms","moz","webkit","o"],e=f.length;while(--e>-1&&!window.requestAnimationFrame){window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}}};d.rafPolyfill.call();c.support.touch=!!("ontouchstart" in window);c.support.msPointer=window.navigator.msPointerEnabled;var a=("https:"==document.location.protocol)?"https:":"http:";c.event.special.mousewheel||document.write('