function dsubstr($string, $length, $suffix = '', $start = 0) { if ($start) { $tmp = dsubstr($string, $start); $string = substr($string, strlen($tmp)); } $strlen = strlen($string); if ($strlen <= $length) { return $string; } $string = str_replace(array('"', '<', '>'), array('"', '<', '>'), $string); $length = $length - strlen($suffix); $str = ''; if (strtolower(DT_CHARSET) == 'utf-8') { $n = $tn = $noc = 0; while ($n < $strlen) { $t = ord($string[$n]); if ($t == 9 || $t == 10 || 32 <= $t && $t <= 126) { $tn = 1; $n++; $noc++; } elseif (194 <= $t && $t <= 223) { $tn = 2; $n += 2; $noc += 2; } elseif (224 <= $t && $t <= 239) { $tn = 3; $n += 3; $noc += 2; } elseif (240 <= $t && $t <= 247) { $tn = 4; $n += 4; $noc += 2; } elseif (248 <= $t && $t <= 251) { $tn = 5; $n += 5; $noc += 2; } elseif ($t == 252 || $t == 253) { $tn = 6; $n += 6; $noc += 2; } else { $n++; } if ($noc >= $length) { break; } } if ($noc > $length) { $n -= $tn; } $str = substr($string, 0, $n); } else { for ($i = 0; $i < $length; $i++) { $str .= ord($string[$i]) > 127 ? $string[$i] . $string[++$i] : $string[$i]; } } $str = str_replace(array('"', '<', '>'), array('"', '<', '>'), $str); return $str == $string ? $str : $str . $suffix; }
function set($post) { global $DT_TIME, $_username, $DT_IP, $TYPE; $post['content'] = strip_tags($post['content']); $post['title'] = in_array($post['type'], $TYPE) ? '[' . $post['type'] . ']' : ''; $post['title'] .= dsubstr($post['content'], 30); $post['title'] = daddslashes($post['title']); $post['hidden'] = isset($post['hidden']) ? 1 : 0; if ($this->itemid) { $post['status'] = $post['status'] == 2 ? 2 : 3; $post['editor'] = $_username; $post['edittime'] = $DT_TIME; } else { $post['username'] = $_username; $post['addtime'] = $DT_TIME; $post['ip'] = $DT_IP; $post['edittime'] = 0; $post['reply'] = ''; $post['status'] = 2; } $post = dhtmlspecialchars($post); return array_map("trim", $post); }
<?php defined('IN_DESTOON') or exit('Access Denied'); $content_table = content_table(4, $userid, is_file(DT_CACHE . '/4.part'), $DT_PRE . 'company_data'); $r = $db->get_one("SELECT content FROM {$content_table} WHERE userid={$userid}"); $COM['content'] = $r['content']; $intro_length = isset($HOME['intro_length']) && $HOME['intro_length'] ? intval($HOME['intro_length']) : 1000; $COM['intro'] = nl2br(dsubstr(trim(strip_tags($r['content'])), $intro_length, '...')); $COM['thumb'] = $COM['thumb'] ? $COM['thumb'] : DT_SKIN . 'image/company.jpg'; if ($COMGROUP['main_d']) { $_main_show = array(); foreach ($HMAIN as $k => $v) { $_main_show[$k] = strpos(',' . $COMGROUP['main_d'] . ',', ',' . $k . ',') !== false ? 1 : 0; } $_main_show = implode(',', $_main_show); } else { $_main_show = '1,1,1,0,0,0,0'; } $_main_order = '0,10,20,30,40,50,60,70'; $_main_num = '10,1,10,5,3,4,4,10'; $_main_file = implode(',', $IFILE); $_main_name = implode(',', $HMAIN); $main_show = explode(',', isset($HOME['main_show']) ? $HOME['main_show'] : $_main_show); $main_order = explode(',', isset($HOME['main_order']) ? $HOME['main_order'] : $_main_order); $main_num = explode(',', isset($HOME['main_num']) ? $HOME['main_num'] : $_main_num); $main_file = explode(',', isset($HOME['main_file']) ? $HOME['main_file'] : $_main_file); $main_name = explode(',', isset($HOME['main_name']) ? $HOME['main_name'] : $_main_name); $_HMAIN = array(); asort($main_order); foreach ($main_order as $k => $v) { if ($main_show[$k] && in_array($main_file[$k], $IFILE)) {
<?php defined('IN_DESTOON') or exit('Access Denied'); if ($DT_BOT) { dhttp(403); } require DT_ROOT . '/module/' . $module . '/common.inc.php'; check_group($_groupid, $MOD['group_compare']) or dalert(lang('message->without_permission'), 'goback'); $DT_URL = $DT_REF; $itemid && is_array($itemid) or dalert($L['compare_choose'], 'goback'); $itemid = array_unique($itemid); $item_nums = count($itemid); $item_nums < 9 or dalert($L['compare_max'], 'goback'); $item_nums > 1 or dalert($L['compare_min'], 'goback'); $itemid = implode(',', $itemid); $tags = array(); $result = $db->query("SELECT * FROM {$table} WHERE itemid IN ({$itemid}) ORDER BY addtime DESC"); while ($r = $db->fetch_array($result)) { if ($r['status'] != 3) { continue; } $r['editdate'] = timetodate($r['edittime'], 3); $r['adddate'] = timetodate($r['addtime'], 3); $r['stitle'] = dsubstr($r['title'], 30); $r['stitle'] = set_style($r['stitle'], $r['style']); $r['userurl'] = userurl($r['username']); $r['linkurl'] = $MOD['linkurl'] . $r['linkurl']; $tags[] = $r; } $head_title = $L['compare_title'] . $DT['seo_delimiter'] . $MOD['name']; include template($MOD['template_compare'] ? $MOD['template_compare'] : 'compare', $module);
$t2['itemid'] = $t1[0]; $t2['s1'] = $t1[1]; $t2['s2'] = $t1[2]; $t2['s3'] = $t1[3]; $datas[$v1] = $t2; } } if ($_ids) { $itemids = implode(',', $_ids); $result = $db->query("SELECT * FROM {$table} WHERE itemid IN ({$itemids})"); while ($r = $db->fetch_array($result)) { if ($r['username'] == $_username || $r['status'] != 3) { continue; } $r['alt'] = $r['title']; $r['title'] = dsubstr($r['title'], 40, '..'); $r['linkurl'] = $MOD['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']); $price += $r['price']; $total++; $_tags[$r['itemid']] = $r; } foreach ($datas as $k => $v) { if (isset($_tags[$v['itemid']])) { $t = $_tags[$v['itemid']]; $t['key'] = $k; $t['s1'] = $v['s1']; $t['s2'] = $v['s2']; $t['s3'] = $v['s3'];
$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(dsubstr($r['title'], 20, '..'), $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['wap_enable']) { $head_mobile = $EXT['wap_url'] . 'index.php?moduleid=' . $moduleid . '&catid=' . $catid . ($page > 1 ? '&page=' . $page : ''); } $filename = DT_ROOT . '/' . $MOD['moduledir'] . '/' . listurl($CAT, $page); ob_start(); include template($template, $module); $data = ob_get_contents(); ob_clean(); if ($DT['pcharset']) {
function tag($parameter, $expires = 0) { global $DT, $CFG, $MODULE, $DT_TIME, $db; if ($expires > 0) { $tag_expires = $expires; } else { if ($expires == -2) { $tag_expires = $CFG['db_expires']; } else { if ($expires == -1) { $tag_expires = 0; } else { $tag_expires = $CFG['tag_expires']; } } } $tag_cache = false; $db_cache = $expires == -2 || defined('TOHTML') ? 'CACHE' : ''; if ($tag_expires && $db_cache != 'CACHE' && strpos($parameter, '&page=') === false) { $tag_cache = true; $TCF = DT_CACHE . '/tag/' . md5($parameter) . '.htm'; if (is_file($TCF) && $DT_TIME - filemtime($TCF) < $tag_expires) { echo substr(file_get($TCF), 17); return; } } $parameter = str_replace(array('&', '%'), array('', '##'), $parameter); $parameter = strip_sql($parameter); parse_str($parameter, $par); if (!is_array($par)) { return ''; } $par = dstripslashes($par); extract($par, EXTR_SKIP); isset($prefix) or $prefix = $db->pre; isset($moduleid) or $moduleid = 1; if (!isset($MODULE[$moduleid])) { return ''; } isset($fields) or $fields = '*'; isset($catid) or $catid = 0; isset($child) or $child = 1; isset($areaid) or $areaid = 0; isset($areachild) or $areachild = 1; isset($dir) && check_name($dir) or $dir = 'tag'; isset($template) && check_name($template) or $template = 'list'; isset($condition) or $condition = '1'; isset($group) or $group = ''; isset($page) or $page = 1; isset($offset) or $offset = 0; isset($pagesize) or $pagesize = 10; isset($order) or $order = ''; isset($showpage) or $showpage = 0; isset($showcat) or $showcat = 0; isset($datetype) or $datetype = 0; isset($target) or $target = ''; isset($class) or $class = ''; isset($length) or $length = 0; isset($introduce) or $introduce = 0; isset($debug) or $debug = 0; isset($lazy) or $lazy = 0; isset($cols) && $cols or $cols = 1; if ($catid) { if ($moduleid > 4) { if (is_numeric($catid)) { $CAT = $db->get_one("SELECT child,arrchildid,moduleid FROM {$db->pre}category WHERE catid={$catid}"); $condition .= $child && $CAT['child'] && $CAT['moduleid'] == $moduleid ? " AND catid IN (" . $CAT['arrchildid'] . ")" : " AND catid={$catid}"; } else { if ($child) { $catids = ''; $result = $db->query("SELECT arrchildid FROM {$db->pre}category WHERE catid IN ({$catid})"); while ($r = $db->fetch_array($result)) { $catids .= ',' . $r['arrchildid']; } if ($catids) { $catid = substr($catids, 1); } } $condition .= " AND catid IN ({$catid})"; } } else { if ($moduleid == 4) { $condition .= " AND catids LIKE '%,{$catid},%'"; } } } if ($areaid) { if (is_numeric($areaid)) { $ARE = $db->get_one("SELECT child,arrchildid FROM {$db->pre}area WHERE areaid={$areaid}"); $condition .= $areachild && $ARE['child'] ? " AND areaid IN (" . $ARE['arrchildid'] . ")" : " AND areaid={$areaid}"; } else { if ($areachild) { $areaids = ''; $result = $db->query("SELECT arrchildid FROM {$db->pre}area WHERE areaid IN ({$areaid})"); while ($r = $db->fetch_array($result)) { $areaids .= ',' . $r['arrchildid']; } if ($areaids) { $areaid = substr($areaids, 1); } } $condition .= " AND areaid IN ({$areaid})"; } } $table = isset($table) ? $prefix . $table : get_table($moduleid); $offset or $offset = ($page - 1) * $pagesize; $percent = dround(100 / $cols) . '%'; $num = 0; $order = $order ? ' ORDER BY ' . $order : ''; $condition = stripslashes($condition); $condition = str_replace('##', '%', $condition); if ($showpage) { $num = $db->count($table, $condition, $tag_expires ? $tag_expires : $CFG['db_expires']); $pages = $catid ? listpages(get_cat($catid), $num, $page, $pagesize) : pages($num, $page, $pagesize); } else { if ($group) { $condition .= ' GROUP BY ' . $group; } } if ($page < 2 && strpos($parameter, '&page=') !== false) { $db_cache = 'CACHE'; $tag_expires = $CFG['tag_expires']; } if ($template == 'null') { $db_cache = 'CACHE'; } $query = "SELECT " . $fields . " FROM " . $table . " WHERE " . $condition . $order . " LIMIT " . $offset . "," . $pagesize; if ($debug) { echo $parameter . '<br/>' . $query . '<br/>'; } $tags = $catids = $CATS = array(); $result = $db->query($query, $db_cache, $tag_expires); while ($r = $db->fetch_array($result)) { if ($moduleid == 4 && isset($r['company'])) { $r['alt'] = $r['companyname'] = $r['company']; if ($length) { $r['company'] = dsubstr($r['company'], $length); } } if (isset($r['title'])) { $r['title'] = str_replace('"', '"', trim($r['title'])); $r['alt'] = $r['title']; if ($length) { $r['title'] = dsubstr($r['title'], $length); } if (isset($r['style']) && $r['style']) { $r['title'] = set_style($r['title'], $r['style']); } } if ($lazy && isset($r['thumb']) && $r['thumb']) { $r['thumb'] = DT_SKIN . 'image/lazy.gif" class="lazy" original="' . $r['thumb']; } if (isset($r['introduce']) && $introduce) { $r['introduce'] = dsubstr($r['introduce'], $introduce); } if (isset($r['linkurl']) && $r['linkurl'] && $moduleid > 4 && strpos($r['linkurl'], '://') === false) { $r['linkurl'] = $MODULE[$moduleid]['linkurl'] . $r['linkurl']; } if ($showcat && $moduleid > 4 && isset($r['catid'])) { $catids[$r['catid']] = $r['catid']; } $tags[] = $r; } $db->free_result($result); if ($showcat && $moduleid > 4 && $catids) { $result = $db->query("SELECT catid,catname,linkurl FROM {$db->pre}category WHERE catid IN (" . implode(',', $catids) . ")"); while ($r = $db->fetch_array($result)) { $CATS[$r['catid']] = $r; } if ($CATS) { foreach ($tags as $k => $v) { $tags[$k]['catname'] = $v['catid'] ? $CATS[$v['catid']]['catname'] : ''; $tags[$k]['caturl'] = $v['catid'] ? $MODULE[$moduleid]['linkurl'] . $CATS[$v['catid']]['linkurl'] : ''; } } } if ($template == 'null') { return $tags; } if ($tag_cache) { ob_start(); include template($template, $dir); $contents = ob_get_contents(); ob_clean(); file_put($TCF, '<!--' . ($DT_TIME + $tag_expires) . '-->' . $contents); echo $contents; } else { include template($template, $dir); } }
$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) { keyword($kw, $items, $moduleid); } } } $showpage = 1; $datetype = 3;
$item['username'] or message($L['com_not_member']); $_username != $item['username'] or message($L['send_self']); $app = $db->get_one("SELECT * FROM {$DT_PRE}job_apply WHERE jobid={$itemid} AND apply_username='******'"); if ($app) { message($L['apply_again']); } $linkurl = $MOD['linkurl'] . $item['linkurl']; if ($submit) { $resumeid = intval($resumeid); $resumeid or dheader($linkurl); $resume = $db->get_one("SELECT * FROM {$DT_PRE}resume WHERE itemid={$resumeid} AND status=3 AND open=3 AND username='******'"); $resume or message($L['not_resume'], $linkurl); $db->query("INSERT INTO {$DT_PRE}job_apply (jobid,resumeid,job_username,apply_username,applytime,status) VALUES ('{$itemid}','{$resumeid}','{$item['username']}','{$_username}','{$DT_TIME}','1')"); $db->query("UPDATE {$DT_PRE}job SET apply=apply+1 WHERE itemid={$itemid}"); $resumeurl = $MOD['linkurl'] . $resume['linkurl']; send_message($item['username'], lang($L['apply_msg_title'], array(dsubstr($item['title'], 20, '...'))), lang($L['apply_msg_content'], array($resumeurl))); message($L['apply_success'], $linkurl); } else { $lists = array(); $result = $db->query("SELECT * FROM {$DT_PRE}resume WHERE username='******' AND status=3 AND open=3 ORDER BY edittime DESC"); while ($r = $db->fetch_array($result)) { $r['linkurl'] = $MOD['linkurl'] . $r['linkurl']; $lists[] = $r; } if ($lists) { $head_title = $L['apply_title'] . $DT['seo_delimiter'] . $item['title'] . $DT['seo_delimiter'] . $MOD['name']; include template('apply', $module); } else { message($L['make_resume'], $MODULE[2]['linkurl'] . $DT['file_my'] . '?resume=1&action=add&mid=' . $moduleid); } }
$content .= '如果您对此操作有异议,请及时与网站联系。<br/>'; $user = userinfo($td['buyer']); 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); } $result = $status == 5 ? '已经退款给买家' : '未退款给买家,交易成功'; $subject = '您的[团购订单]' . dsubstr($td['title'], 30, '...') . '(单号:' . $td['itemid'] . ')' . $result; $content = '尊敬的会员:<br/>您的[团购订单]' . $td['title'] . '(单号:' . $td['itemid'] . ')' . $result . '!<br/>'; if ($reason) { $content .= '操作原因:<br/>' . $reason . '<br/>'; } $content .= '请点击下面的链接查看订单详情:<br/>'; $content .= '<a href="' . $linkurl . '" target="_blank">' . $linkurl . '</a><br/>'; $content .= '如果您对此操作有异议,请及时与网站联系。<br/>'; $user = userinfo($td['seller']); if ($msg) { send_message($user['username'], $subject, $content); } if ($eml) { send_mail($user['email'], $subject, $content); } if ($sms) {
$items = $db->count($table . '_group', $condition, $DT['cache_search']); $pages = pages($items, $page, $pagesize); if ($items) { $result = $db->query("SELECT * FROM {$table}_group WHERE {$condition} ORDER BY itemid DESC LIMIT {$offset},{$pagesize}", $DT['cache_search'] && $page == 1 ? 'CACHE' : '', $DT['cache_search']); while ($r = $db->fetch_array($result)) { $r['adddate'] = timetodate($r['addtime'], 5); if ($lazy && isset($r['thumb']) && $r['thumb']) { $r['thumb'] = DT_SKIN . 'image/lazy.gif" original="' . $r['thumb']; } $r['alt'] = $r['title']; $r['title'] = set_style($r['title'], $r['style']); if ($kw) { $r['title'] = str_replace($replacef, $replacet, $r['title']); } $r['linkurl'] = $MOD['linkurl'] . $r['linkurl']; $r['introduce'] = dsubstr(dtrim($r['content']), 60, '...'); $r['managers'] = $r['manager'] ? explode('|', $r['manager']) : array(); $tags[] = $r; } $db->free_result($result); } } else { if ($action == 'reply') { $condition = 'status=3'; if ($keyword) { $condition .= " AND content LIKE '%{$keyword}%'"; } if ($username) { $condition .= " AND passport='{$username}'"; } if ($fromtime) {
$level = isset($level) ? intval($level) : 0; in_array($level, array(0, 1, 2, 3)) or message($L['my_manage_not_level']); $content = $level; if ($reason == $L['my_manage_reason']) { $reason = ''; } $reason = dhtmlspecialchars($reason); $message = isset($message) ? 1 : 0; foreach ($itemid as $tid) { $T = $db->get_one("SELECT * FROM {$table} WHERE itemid={$tid}"); if (!$T || $T['status'] != 3 || $T['gid'] != $gid || $T['level'] == $level) { continue; } $db->query("UPDATE {$table} SET level={$level} WHERE itemid={$tid}"); if ($message) { send_message($T['username'], lang($L['manage_msg_title'], array($L['my_manage_type_post'], dsubstr($T['title'], 20, '...'), $level ? $L['my_manage_type_level'] : $L['my_manage_type_level_cancel'])), lang($L['manage_msg_content'], array($MOD['linkurl'] . $T['linkurl'], nl2br($reason), $_username))); } $title = addslashes($T['title']); $db->query("INSERT INTO {$table}_manage (gid,tid,username,addtime,typeid,title,content,reason,message) VALUES ('{$gid}','{$tid}','{$_username}','{$DT_TIME}','3','{$title}','{$content}','{$reason}','{$message}')"); if ($MOD['show_html']) { tohtml('show', $module, "itemid={$tid}"); } } dmsg($level ? $L['post_success_level'] : $L['post_cancel_level'], $forward); break; case 'post': require MD_ROOT . '/club.class.php'; $do = new club($moduleid); $sfields = $L['my_fields_post']; $dfields = array('keyword', 'title', 'username'); isset($fields) && isset($dfields[$fields]) or $fields = 0;
$db->query("INSERT INTO {$table}_answer (qid,linkurl,content,username,expert,addtime,ip,status,hidden) VALUES ('{$itemid}','{$url}','{$content}','{$_username}','{$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='******' 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 { $head_title = $L['answer_title']; include template('my_' . $module, 'member'); } exit; } $MG['know_limit'] > -1 or dalert(lang('message->without_permission_and_upgrade'), 'goback'); include load($module . '.lang'); include load('my.lang'); require MD_ROOT . '/know.class.php'; $do = new know($moduleid); if (in_array($action, array('add', 'edit'))) { $FD = cache_read('fields-' . substr($table, strlen($DT_PRE)) . '.php');
function response($openid, $from, $type, $content, $misc = array()) { $xml = '<xml>'; $xml .= '<ToUserName><![CDATA[' . $openid . ']]></ToUserName>'; $xml .= '<FromUserName><![CDATA[' . $from . ']]></FromUserName>'; $xml .= '<CreateTime>' . $this->time . '</CreateTime>'; $xml .= '<MsgType><![CDATA[' . $type . ']]></MsgType>'; switch ($type) { case 'text': $xml .= '<Content><![CDATA[' . $content . ']]></Content>'; break; case 'image': $xml .= '<Image>'; $xml .= '<MediaId><![CDATA[' . $content . ']]></MediaId>'; $xml .= '</Image>'; break; case 'voice': $xml .= '<Voice>'; $xml .= '<MediaId><![CDATA[' . $content . ']]></MediaId>'; $xml .= '</Voice>'; break; case 'video': $xml .= '<Video>'; $xml .= '<MediaId><![CDATA[' . $content . ']]></MediaId>'; $xml .= '<Title><![CDATA[' . (isset($misc['title']) ? $misc['title'] : '') . ']]></Title>'; $xml .= '<Description><![CDATA[' . (isset($misc['description']) ? $misc['description'] : '') . ']]></Description>'; $xml .= '</Video>'; break; case 'music': $xml .= '<Music>'; $xml .= '<MediaId><![CDATA[' . $content . ']]></MediaId>'; $xml .= '<Title><![CDATA[' . (isset($misc['title']) ? $misc['title'] : '') . ']]></Title>'; $xml .= '<Description><![CDATA[' . (isset($misc['description']) ? $misc['description'] : '') . ']]></Description>'; $xml .= '<MusicUrl><![CDATA[' . (isset($misc['musicurl']) ? $misc['musicurl'] : '') . ']]></MusicUrl>'; $xml .= '<HQMusicUrl><![CDATA[' . (isset($misc['hqmusicurl']) ? $misc['hqmusicurl'] : '') . ']]></HQMusicUrl>'; $xml .= '<ThumbMediaId><![CDATA[' . (isset($misc['thumb_media_id']) ? $misc['thumb_media_id'] : '') . ']]></ThumbMediaId>'; $xml .= '</Music>'; break; case 'news': if ($misc && count($misc) < 11) { $xml .= '<ArticleCount>' . count($misc) . '</ArticleCount>'; $xml .= '<Articles>'; foreach ($misc as $k => $v) { $v['title'] = dsubstr($v['title'], 48); $xml .= '<item>'; $xml .= '<Title><![CDATA[' . $v['title'] . ']]></Title>'; $xml .= '<Description><![CDATA[' . $v['description'] . ']]></Description>'; $xml .= '<PicUrl><![CDATA[' . $v['picurl'] . ']]></PicUrl>'; $xml .= '<Url><![CDATA[' . $v['url'] . ']]></Url>'; $xml .= '</item>'; } $xml .= '</Articles>'; } else { return false; } break; default: return false; break; } $xml .= '</xml>'; echo convert($xml, DT_CHARSET, 'UTF-8'); }
} if ($totime) { $condition .= " AND addtime<{$totime}"; } if ($ip) { $condition .= " AND ip='{$ip}'"; } if ($robot) { $condition .= " AND robot='{$robot}'"; } if ($username) { $condition .= " AND username='******'"; } if ($page > 1 && $sum) { $items = $sum; } else { $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}404 WHERE {$condition}"); $items = $r['num']; } $pages = pages($items, $page, $pagesize); $lists = array(); $result = $db->query("SELECT * FROM {$DT_PRE}404 WHERE {$condition} ORDER BY itemid DESC LIMIT {$offset},{$pagesize}"); while ($r = $db->fetch_array($result)) { $tmp = parse_url($r['url']); $r['durl'] = dsubstr(basename($r['url']), 30, '...'); $r['addtime'] = timetodate($r['addtime'], 6); $lists[] = $r; } include tpl('404'); break; }
if ($pass) { require DT_ROOT . '/module/' . $module . '/global.func.php'; $view = isset($view) ? 1 : 0; if ($view) { $pagesize = 30; $offset = ($page - 1) * $pagesize; $demo_url = userurl($username, 'file=' . $file . '&itemid=' . $itemid . '&view=1&page={destoon_page}', $domain) . '#p'; $pages = home_pages($items, $pagesize, $demo_url, $page); $T = array(); $i = 1; $result = $db->query("SELECT itemid,thumb,introduce FROM {$table_item} WHERE item={$itemid} ORDER BY listorder ASC,itemid ASC LIMIT {$offset},{$pagesize}"); while ($r = $db->fetch_array($result)) { $r['number'] = $offset + $i++; $r['linkurl'] = userurl($username, 'file=' . $file . '&itemid=' . $itemid . '&page=' . $r['number'], $domain) . '#p'; $r['thumb'] = str_replace('.thumb.', '.middle.', $r['thumb']); $r['title'] = $r['introduce'] ? dsubstr($r['introduce'], 46, '..') : ' '; $T[] = $r; } } else { if ($page > $items) { $page = 1; } $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)) { $T[] = $r; } $demo_url = userurl($username, "file={$file}&itemid={$itemid}&page=" . '{destoon_page}', $domain); $next_photo = $items > 1 ? next_photo($page, $items, $demo_url) : $linkurl; $prev_photo = $items > 1 ? prev_photo($page, $items, $demo_url) : $linkurl; if ($T) {
send_notice($T['username'], lang($L['manage_msg_title'], array('帖子', dsubstr($T['title'], 20, '...'), $ontop ? '置顶' : '取消置顶')), lang($L['manage_msg_content'], array($MOD['linkurl'] . $T['linkurl'], nl2br($reason), $_username))); } } dmsg($ontop ? '置顶设置成功' : '置顶取消成功', $forward); break; case 'style': $itemid or msg('请选择帖子'); $style = isset($COLOR[$style]) ? '#' . $style : ''; foreach ($itemid as $tid) { $db->query("UPDATE {$table} SET style='{$style}' WHERE itemid={$tid}"); } if (need_notice()) { foreach ($itemid as $tid) { $T = $db->get_one("SELECT title,linkurl,username FROM {$table} WHERE itemid={$tid}"); $body = lang($L['manage_msg_content'], array($MOD['linkurl'] . $T['linkurl'], nl2br($reason), $_username)); send_notice($T['username'], lang($L['manage_msg_title'], array('帖子', dsubstr($T['title'], 20, '...'), $style ? '高亮' : '取消高亮')), lang($L['manage_msg_content'], array($MOD['linkurl'] . $T['linkurl'], nl2br($reason), $_username))); } } dmsg($style ? '高亮设置成功' : '高亮取消成功', $forward); break; case 'recycle': $lists = $do->get_list('status=0' . $condition, $dorder[$order]); $menuid = 4; include tpl('index', $module); break; case 'reject': if ($itemid && !$psize) { $do->reject($itemid); dmsg('拒绝成功', $forward); } else { $lists = $do->get_list('status=1' . $condition, $dorder[$order]);
$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}");
$AREA or $AREA = cache_read('area.php'); $TYPE = explode('|', trim($MOD['type'])); $GENDER = explode('|', trim($MOD['gender'])); $MARRIAGE = explode('|', trim($MOD['marriage'])); $EDUCATION = explode('|', trim($MOD['education'])); $SITUATION = explode('|', trim($MOD['situation'])); $parentid = $CATEGORY[$catid]['parentid'] ? $CATEGORY[$catid]['parentid'] : $catid; $expired = $totime && $totime < $DT_TIME ? true : false; $linkurl = $MOD['linkurl'] . $linkurl; if (!$DT_BOT) { $db->query("UPDATE LOW_PRIORITY {$table} SET hits=hits+1 WHERE itemid={$itemid}", 'UNBUFFERED'); } $head_canonical = $linkurl; $head_title = $title . $DT['seo_delimiter'] . $head_title; $head_keywords = $title . ',' . $COM['company']; $head_description = dsubstr(strip_tags($content), 200, '...'); if ($EXT['mobile_enable']) { $head_mobile = $EXT['mobile_url'] . mobileurl($moduleid, 0, $itemid, $page); } } else { $url = "file={$file}"; $condition = "username='******' AND status=3"; if ($kw) { $condition .= " AND keyword LIKE '%{$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 = 30;
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 = '尊敬的会员:<br/>您的[问题]' . $a['title'] . '(流水号:' . $a['itemid'] . ')已经回复!<br/>'; $content .= '请点击下面的链接查看详情:<br/>'; $content .= '<a href="' . $linkurl . '" target="_blank">' . $linkurl . '</a><br/>'; $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);
function get_description($content, $length) { if ($length) { $content = str_replace(array(' ', '[pagebreak]'), array('', ''), $content); return nl2br(dsubstr(trim(strip_tags($content)), $length, '...')); } else { return ''; } }
function get_list($cart) { global $MOD, $table, $_username; $lists = $tags = $data = $_cart = array(); $itemids = ''; foreach ($cart as $k => $v) { $t = array_map('intval', explode('-', $k)); $itemids .= ',' . $t[0]; $r = array(); $r['itemid'] = $t[0]; $r['s1'] = $t[1]; $r['s2'] = $t[2]; $r['s3'] = $t[3]; $r['a'] = $v; $data[$k] = $r; } if ($itemids) { $itemids = substr($itemids, 1); $result = $this->db->query("SELECT * FROM {$table} WHERE itemid IN ({$itemids})"); while ($r = $this->db->fetch_array($result)) { if ($r['username'] == $_username || $r['status'] != 3) { continue; } $r['alt'] = $r['title']; $r['title'] = dsubstr($r['title'], 40, '..'); $r['linkurl'] = $MOD['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']); if ($r['step']) { $s = unserialize($r['step']); foreach (unserialize($r['step']) as $k => $v) { $r[$k] = $v; } } else { $r['a1'] = 1; $r['p1'] = $r['price']; $r['a2'] = $r['a3'] = 0; $r['p2'] = $r['p3'] = 0.0; } $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['a'] > $r['amount']) { $r['a'] = $r['amount']; } if ($r['a'] < $r['a1']) { $r['a'] = $r['a1']; } $r['price'] = get_price($r['a'], $r['price'], $r['step']); $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']] : ''; $_cart[$k] = $r['a']; $lists[] = $r; } } } } if (count($_cart) != count($cart) || count($_cart) != get_cookie('cart')) { $this->set($_cart); } return $lists; }
if ($catid) { $condition .= $CAT ? " AND catid IN (" . $CAT['arrchildid'] . ")" : " AND catid={$catid}"; } if ($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 = wap_pages($items, $page, $pagesize); $lists = 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['stitle'] = dsubstr($r['title'], $len); $r['date'] = timetodate($r[$time], 5); $lists[] = $r; } $db->free_result($result); } if ($TP == 'touch') { if ($catid) { $head_link = 'index.php?moduleid=' . $moduleid . '&catid=' . $catid; $head_name = $CAT['catname']; $back_link = $CAT['parentid'] ? 'index.php?moduleid=' . $moduleid . '&catid=' . $CAT['parentid'] : 'index.php?moduleid=' . $moduleid; } else { $head_link = 'index.php?moduleid=' . $moduleid; $head_name = $MOD['name']; $back_link = 'index.php'; }
$result = $db->query("SELECT " . $MOD['fields'] . " FROM {$table} WHERE {$condition} ORDER BY " . $MOD['order'] . " LIMIT {$offset},{$pagesize}", $CFG['db_expires'] && $page == 1 ? 'CACHE' : '', $CFG['db_expires']); while ($r = $db->fetch_array($result)) { if ($r['ontop']) { continue; } $r['adddate'] = timetodate($r['addtime'], 5); $r['editdate'] = timetodate($r['edittime'], 5); if ($lazy && isset($r['thumb']) && $r['thumb']) { $r['thumb'] = DT_SKIN . 'image/lazy.gif" original="' . $r['thumb']; } $r['alt'] = $r['title']; $r['title'] = set_style($r['title'], $r['style']); $r['linkurl'] = $MOD['linkurl'] . $r['linkurl']; if (!$r['username']) { $r['username'] = '******'; } $tags[] = $r; } $db->free_result($result); } $showpage = 1; $datetype = 5; include DT_ROOT . '/include/seo.inc.php'; $seo_title = ($typeid ? $TYPE[$typeid] . $seo_delimiter : '') . $GRP['title'] . $MOD['seo_name'] . $seo_delimiter . $seo_page . $seo_modulename . $seo_delimiter . $seo_sitename; $head_keywords = $GRP['title'] . $MOD['seo_name'] . ',' . $MOD['name']; $head_description = dsubstr(dtrim($GRP['content']), 200); if ($EXT['mobile_enable']) { $head_mobile = $EXT['mobile_url'] . mobileurl($moduleid, $catid, 0, $page); } $template = $GRP['template'] ? $GRP['template'] : 'group'; include template($template, $module);
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='******' AND addtime>{$DT_TIME}-86400 AND reason='" . $L['answer'] . "'"); 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'], 'ID:' . $itemid . '(' . $L['know_by_mobile'] . ')'); } } if ($MOD['answer_message'] && $item['username']) { $linkurl = $MOD['linkurl'] . $item['linkurl']; $message = lang($L['answer_message'], array(dsubstr($item['title'], 20, '...'), $item['title'], nl2br($content), $linkurl)); send_message($item['username'], dsubstr($message, 60, '...'), $message); } exit($status == 3 ? 'ok' : 'check'); } $head_title = $L['know_title'] . $DT['seo_delimiter'] . $head_title; $foot = ''; include template('know_answer', 'mobile'); if (DT_CHARSET != 'UTF-8') { toutf8(); } break; default: dheader(mobileurl($moduleid)); break; }
$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']); $fee = $PAY[$bank]['percent'] ? dround($amount * $PAY[$bank]['percent'] / 100) : 0; $charge = $fee + $amount; if (isset($goto)) { $receive_url = $MOD['linkurl'] . 'charge.php'; $charge_title = ''; if ($tradeid) { $td = $db->get_one("SELECT * FROM {$DT_PRE}mall_order WHERE itemid={$tradeid}"); if ($td['status'] == 1 && $td['buyer'] == $_username && $td['amount'] + $td['fee'] == $_money + $amount) { $charge_title = dsubstr($td['title'], 40, '...'); } else { $tradeid = 0; set_cookie('tradeid', '0'); } } $db->query("INSERT INTO {$DT_PRE}finance_charge (username,bank,amount,fee,sendtime) VALUES ('{$_username}','{$bank}','{$amount}','{$fee}','{$DT_TIME}')"); $orderid = $db->insert_id(); include DT_ROOT . '/api/pay/' . $bank . '/send.inc.php'; exit; } else { $auto = isset($auto) ? $auto : 1; $head_title = $L['charge_title_confirm']; } break; case 'pay':
if ($fromuser != $_username) { wap_msg($L['msg_no_right']); } } } if ($TP == 'touch') { $head_link = 'index.php?moduleid=' . $moduleid . '&action=message'; $back_link = 'javascript:Dback(\'' . $head_link . '\');'; $pages = ''; } else { $content = strip_tags($content); $content = preg_replace("/\\&([^;]+);/i", '', $content); $contentlength = strlen($content); if ($contentlength > $maxlength) { $start = ($page - 1) * $maxlength; $content = dsubstr($content, $maxlength, '', $start); $pages = wap_pages($contentlength, $page, $maxlength); } $content = nl2br($content); } $adddate = timetodate($addtime, 5); $head_title = $title . $DT['seo_delimiter'] . $L['message_title'] . $DT['seo_delimiter'] . $head_title; } else { $TYPE = $L['message_type']; $head_title = $L['message_title'] . $DT['seo_delimiter'] . $head_title; $typeid = isset($typeid) ? intval($typeid) : -1; $condition = "touser='******' AND status=3"; if ($typeid != -1) { $condition .= " AND typeid={$typeid}"; } if ($keyword) {
?> </td> <td align="left"><a href="?moduleid=<?php echo $moduleid; ?> &file=<?php echo $file; ?> &action=show&itemid=<?php echo $v['itemid']; ?> " title="<?php echo $v['title']; ?> "> <?php echo dsubstr($v['title'], 50, '...'); ?> </a></td> <td><a href="javascript:_user('<?php echo $v['touser']; ?> ');"><?php echo $v['touser']; ?> </a></td> <td><a href="javascript:_user('<?php echo $v['fromuser']; ?> ');"><?php echo $v['fromuser']; ?>
function feedback($r) { global $DT_TIME, $L; $r or $r = $this->get_one(); $message = array(); $message['typeid'] = 0; $message['touser'] = $r['fromuser']; $message['title'] = lang($L['message_feedback_title'], array(dsubstr($r['title'], 20, '...'))); $message['content'] = lang($L['message_feedback_content'], array($this->username, timetodate($DT_TIME, 5), $r['title'], timetodate($r['addtime'], 5), $r['content'])); $this->send($message); }
if ($MOD['chat_maxlen'] && strlen($word) > $MOD['chat_maxlen'] * 3) { exit('max'); } $word = convert($word, 'UTF-8', DT_CHARSET); $word = stripslashes(trim($word)); $word = strip_tags($word); $word = dsafe($word); $word = nl2br($word); $word = strip_nr($word); $word = str_replace('|', ' ', $word); if ($MOD['chat_file'] && $MG['upload']) { clear_upload($word); } $chat = $db->get_one("SELECT * FROM {$table} WHERE chatid='{$chatid}'"); if ($chat) { $lastmsg = addslashes(dsubstr($word, 50)); if ($chat['touser'] == $_username) { $sql = "fgettime={$DT_TIME},lasttime={$DT_TIME},lastmsg='{$lastmsg}'"; if ($DT_TIME - $chat['freadtime'] > $chat_poll) { $db->query("UPDATE {$DT_PRE}member SET chat=chat+1 WHERE username='******'fromuser']}'"); $sql .= ",fnew=fnew+1"; } $db->query("UPDATE {$table} SET {$sql} WHERE chatid='{$chatid}'"); } else { if ($chat['fromuser'] == $_username) { $sql = "tgettime={$DT_TIME},lasttime={$DT_TIME},lastmsg='{$lastmsg}'"; if ($DT_TIME - $chat['treadtime'] > $chat_poll) { $db->query("UPDATE {$DT_PRE}member SET chat=chat+1 WHERE username='******'touser']}'"); $sql .= ",tnew=tnew+1"; } $db->query("UPDATE {$table} SET {$sql} WHERE chatid='{$chatid}'");