コード例 #1
0
ファイル: expert.class.php プロジェクト: hiproz/zhaotaoci.cc
 function get_list($condition = '1', $order = 'addtime DESC')
 {
     global $MOD, $pages, $page, $pagesize, $offset, $sum;
     if ($page > 1 && $sum) {
         $items = $sum;
     } else {
         $r = $this->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 = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
     while ($r = $this->db->fetch_array($result)) {
         $r['adddate'] = timetodate($r['addtime'], 5);
         $r['editdate'] = timetodate($r['edittime'], 5);
         $r['title'] = set_style($r['title'], $r['style']);
         $r['linkurl'] = $MOD['linkurl'] . rewrite('expert.php?itemid=' . $r['itemid']);
         $r['rate'] = $r['answer'] && $r['best'] < $r['answer'] ? dround($r['best'] * 100 / $r['answer'], 2, true) . '%' : '100%';
         $lists[] = $r;
     }
     return $lists;
 }
コード例 #2
0
ファイル: sell.class.php プロジェクト: hcd2008/destoon
 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid;
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['adddate'] = timetodate($post['addtime'], 3);
     $post['edittime'] = $DT_TIME;
     $post['editdate'] = timetodate($post['edittime'], 3);
     $post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0;
     $post['fee'] = dround($post['fee']);
     $post['price'] = dround($post['price']);
     $post['minamount'] = dround($post['minamount']);
     $post['amount'] = dround($post['amount']);
     $post['mycatid'] = intval($post['mycatid']);
     $post['days'] = intval($post['days']);
     $post['elite'] = $post['elite'] ? 1 : 0;
     $post['title'] = trim($post['title']);
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($MOD['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($MOD['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '">';
         }
         if ($post['thumb1']) {
             $new .= '<img src="' . $post['thumb1'] . '">';
         }
         if ($post['thumb2']) {
             $new .= '<img src="' . $post['thumb2'] . '">';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '">';
         }
         if ($r['thumb1']) {
             $old .= '<img src="' . $r['thumb1'] . '">';
         }
         if ($r['thumb2']) {
             $old .= '<img src="' . $r['thumb2'] . '">';
         }
         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);
 }
コード例 #3
0
ファイル: style.class.php プロジェクト: hcd2008/destoon
 function set($post)
 {
     global $MOD, $DT_TIME, $_username, $_userid;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['editor'] = $_username;
     $post['groupid'] = isset($post['groupid']) && $post['groupid'] ? ',' . implode(',', $post['groupid']) . ',' : '';
     $post['fee'] = dround($post['fee']);
     return array_map("trim", $post);
 }
コード例 #4
0
ファイル: global.func.php プロジェクト: hiproz/zhaotaoci.cc
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);
}
コード例 #5
0
ファイル: resume.class.php プロジェクト: hiproz/zhaotaoci.cc
 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid, $GENDER, $MARRIAGE, $EDUCATION;
     is_url($post['thumb']) or $post['thumb'] = '';
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['fee'] = dround($post['fee']);
     $post['birthday'] = intval($post['byear']) . '-' . intval($post['bmonth']) . '-' . intval($post['bday']);
     $post['age'] = date('Y', $DT_TIME) - intval($post['byear']);
     $post['minsalary'] = intval($post['minsalary']);
     $post['maxsalary'] = intval($post['maxsalary']);
     $post['type'] = intval($post['type']);
     $post['marriage'] = intval($post['marriage']);
     $post['height'] = intval($post['height']);
     $post['height'] = intval($post['height']);
     $post['gender'] = intval($post['gender']);
     $post['education'] = intval($post['education']);
     $post['experience'] = intval($post['experience']);
     $post['situation'] = intval($post['situation']);
     $post['status'] = intval($post['status']);
     $post['open'] = intval($post['open']);
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($MOD['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($MOD['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '"/>';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '"/>';
         }
         delete_diff($new, $old);
     } else {
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
コード例 #6
0
ファイル: global.func.php プロジェクト: hiproz/zhaotaoci.cc
function progress($sid, $fid, $tid)
{
    if ($tid > $sid && $fid < $tid) {
        $p = dround(($fid - $sid) * 100 / ($tid - $sid), 0, true);
        if ($p > 100) {
            $p = 100;
        }
        $p = $p . '%';
    } else {
        $p = '100%';
    }
    return '<table cellpadding="0" cellspacing="0" width="100%" style="margin:0"><tr><td><div class="progress"><div style="width:' . $p . ';">&nbsp;</div></div></td><td style="color:#666666;font-size:10px;width:40px;text-align:center;">' . $p . '</td></tr></table>';
}
コード例 #7
0
ファイル: price.class.php プロジェクト: hiproz/zhaotaoci.cc
 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['editor'] = $_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);
 }
コード例 #8
0
ファイル: article.class.php プロジェクト: hiproz/zhaotaoci.cc
 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     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']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $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'], 'pagebreak') !== false) {
         $post['content'] = str_replace(array('<hr class="de-pagebreak" /></p>', '<p><hr class="de-pagebreak" />', '<hr class="de-pagebreak" /></div>', '<div><hr class="de-pagebreak" />'), array('</p><hr class="de-pagebreak" />', '<hr class="de-pagebreak" /><p>', '</div><hr class="de-pagebreak" />', '<hr class="de-pagebreak" /><div>'), $post['content']);
     }
     if ($post['content'] && !$post['introduce'] && $post['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $post['introduce_length']));
     }
     if ($this->itemid) {
         $post['editor'] = $_username;
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '"/>';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '"/>';
         }
         delete_diff($new, $old);
     } else {
         $post['username'] = $post['editor'] = $_username;
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
コード例 #9
0
ファイル: exhibit.class.php プロジェクト: hiproz/zhaotaoci.cc
 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $AREA, $_username, $_userid;
     $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'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['fromtime'] = strtotime($post['fromtime'] . ' 0:0:0');
     $post['totime'] = strtotime($post['totime'] . ' 23:59:59');
     $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) {
         $post['editor'] = $_username;
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '"/>';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '"/>';
         }
         delete_diff($new, $old);
     } else {
         $post['username'] = $post['editor'] = $_username;
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
コード例 #10
0
ファイル: init.inc.php プロジェクト: hiproz/zhaotaoci.cc
 function http_upload($file)
 {
     $ext = file_ext($file);
     $size = dround(filesize($file) / 1024);
     if ($size < 1) {
         return array('', 'invalid media file');
     }
     if ($ext == 'mp3' || $ext == 'amr') {
         if ($size > 256) {
             return array('', 'media file too large');
         }
         $type = 'voice';
     } else {
         if ($ext == 'mp4') {
             if ($size > 1024) {
                 return array('', 'media file too large');
             }
             $type = 'video';
         } else {
             if ($ext == 'jpg') {
                 if ($size > 128) {
                     return array('', 'media file too large');
                 }
                 $type = 'image';
             } else {
                 return array('', 'invalid media type');
             }
         }
     }
     $par = array();
     $par['access_token'] = $this->access_token;
     $par['type'] = $type;
     $par['media'] = '@' . $file;
     #$par = 'access_token='.$this->access_token.'&type='.$type.'&media=@'.$file;
     $cur = curl_init('http://file.api.weixin.qq.com/cgi-bin/media/upload');
     curl_setopt($cur, CURLOPT_POST, 1);
     curl_setopt($cur, CURLOPT_POSTFIELDS, $par);
     curl_setopt($cur, CURLOPT_FOLLOWLOCATION, 1);
     curl_setopt($cur, CURLOPT_HEADER, 0);
     curl_setopt($cur, CURLOPT_SSL_VERIFYPEER, 0);
     curl_setopt($cur, CURLOPT_RETURNTRANSFER, 1);
     #curl_setopt($cur, CURLOPT_HTTPHEADER, array('Expect: '));
     $rec = curl_exec($cur);
     curl_close($cur);
     $arr = json_decode($rec, true);
     return isset($arr['media_id']) ? array($arr['media_id'], $type) : array('', $arr['errmsg']);
 }
コード例 #11
0
ファイル: down.class.php プロジェクト: hiproz/zhaotaoci.cc
 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     is_url($post['thumb']) or $post['thumb'] = '';
     $post['filepath'] = isset($post['filepath']) && is_filepath($post['filepath']) ? file_vname($post['filepath']) : '';
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     is_url($post['thumb']) or $post['thumb'] = '';
     $post['fee'] = dround($post['fee']);
     $post['down'] = fix_link($post['down']);
     $post['down_width'] = intval($post['down_width']);
     $post['down_height'] = intval($post['down_height']);
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($MOD['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($MOD['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '"/>';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '"/>';
         }
         delete_diff($new, $old);
         if ($r['fileurl'] != $post['fileurl']) {
             delete_upload($r['fileurl'], match_userid($r['fileurl']));
         }
     } else {
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
コード例 #12
0
ファイル: job.class.php プロジェクト: hcd2008/destoon
 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid;
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['adddate'] = timetodate($post['addtime'], 3);
     $post['edittime'] = $DT_TIME;
     $post['editdate'] = timetodate($post['edittime'], 3);
     $post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0;
     $post['fee'] = dround($post['fee']);
     $post['total'] = intval($post['total']);
     $post['email'] = trim($post['email']);
     $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['title'] = trim($post['title']);
     $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);
 }
コード例 #13
0
ファイル: group.class.php プロジェクト: hiproz/zhaotaoci.cc
 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     $post['filepath'] = isset($post['filepath']) && is_filepath($post['filepath']) ? file_vname($post['filepath']) : '';
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0;
     $post['discount'] = dround($post['price'] * 10 / $post['marketprice'], 1);
     $post['savemoney'] = dround($post['marketprice'] - $post['price']);
     $post['fee'] = dround($post['fee']);
     $post['price'] = dround($post['price']);
     $post['marketprice'] = dround($post['marketprice']);
     $post['minamount'] = dround($post['minamount']);
     $post['amount'] = dround($post['amount']);
     $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 ($post['content'] && !$post['introduce'] && $post['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '"/>';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '"/>';
         }
         delete_diff($new, $old);
     } else {
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
コード例 #14
0
ファイル: task.inc.php プロジェクト: hiproz/zhaotaoci.cc
 $unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit'];
 $name = $currency == 'money' ? $DT['money_name'] : $DT['credit_name'];
 $member = array();
 if (check_group($_groupid, $MOD['group_contact'])) {
     if ($fee) {
         if ($MG['fee_mode'] && $MOD['fee_mode']) {
             $user_status = 3;
         } else {
             $mid = $moduleid;
             if ($_userid) {
                 if (check_pay($mid, $itemid)) {
                     $user_status = 3;
                 } else {
                     $user_status = 2;
                     $linkurl = $MOD['linkurl'] . $linkurl;
                     $fee_back = $currency == 'money' ? dround($fee * intval($MOD['fee_back']) / 100) : ceil($fee * intval($MOD['fee_back']) / 100);
                     $pay_url = $MODULE[2]['linkurl'] . 'pay.php?mid=' . $mid . '&itemid=' . $itemid . '&username='******'&fee_back=' . $fee_back . '&fee=' . $fee . '&currency=' . $currency . '&sign=' . crypt_sign($_username . $mid . $itemid . $username . $fee . $fee_back . $currency . $linkurl . $title) . '&title=' . rawurlencode($title) . '&forward=' . urlencode($linkurl);
                 }
             } else {
                 $user_status = 0;
             }
         }
     } else {
         $user_status = 3;
     }
 } else {
     $user_status = $_userid ? 1 : 0;
 }
 if ($_username && $_username == $item['username']) {
     $user_status = 3;
 }
コード例 #15
0
ファイル: list.inc.php プロジェクト: hcd2008/destoon
$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;
$width = 250;
$height = 180;
$cols = 3;
$percent = dround(100 / $cols) . '%';
$seo_file = 'list';
include DT_ROOT . '/include/seo.inc.php';
if ($EXT['wap_enable']) {
    $head_mobile = $EXT['wap_url'] . 'index.php?moduleid=' . $moduleid . '&catid=' . $catid . ($page > 1 ? '&page=' . $page : '');
}
$template = $CAT['template'] ? $CAT['template'] : 'list';
include template($template, $module);
コード例 #16
0
ファイル: style.inc.php プロジェクト: hiproz/zhaotaoci.cc
     $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';
 } else {
     $TYPE = get_type('style', 1);
     $pagesize = 12;
     $offset = ($page - 1) * $pagesize;
     $sfields = $L['style_sfields'];
     $dfields = array('title', 'title', 'author');
     $sorder = $L['style_sorder'];
     $dorder = array('listorder desc,addtime desc', 'addtime DESC', 'addtime ASC', 'hits DESC', 'hits ASC');
     isset($fields) && isset($dfields[$fields]) or $fields = 0;
     isset($order) && isset($dorder[$order]) or $order = 0;
     $all = isset($all) ? intval($all) : 0;
     $typeid = isset($typeid) ? intval($typeid) : 0;
     isset($currency) or $currency = '';
     $minfee = isset($minfee) ? dround($minfee) : '';
     $maxfee = isset($maxfee) ? dround($maxfee) : '';
     $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 .= " AND {$dfields[$fields]} LIKE '%{$keyword}%'";
     }
     if (!$all) {
         $condition .= " AND groupid LIKE '%,{$_groupid},%'";
     }
     if ($typeid) {
         $condition .= " AND typeid={$typeid}";
     }
     if ($currency) {
         $condition .= $currency == 'free' ? " AND fee=0" : " AND currency='{$currency}'";
コード例 #17
0
ファイル: upload.inc.php プロジェクト: hcd2008/destoon
        }
        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}");
        while ($r = $db->fetch_array($result)) {
            $r['ext'] = file_ext($r['fileurl']);
            is_file(DT_ROOT . '/file/ext/' . $r['ext'] . '.gif') or $r['ext'] = 'oth';
            if ($r['filesize'] > 1024 * 1024 * 1024) {
                $r['size'] = dround($r['filesize'] / 1024 / 1024 / 1024, 2) . 'G';
            } else {
                if ($r['filesize'] > 1024 * 1024) {
                    $r['size'] = dround($r['filesize'] / 1024 / 1024, 2) . 'M';
                } else {
                    $r['size'] = dround($r['filesize'] / 1024, 2) . 'K';
                }
            }
            $r['addtime'] = timetodate($r['addtime'], 6);
            $r['image'] = is_image($r['fileurl']) ? 1 : 0;
            $r['fileurl'] = str_replace('.thumb.' . $r['ext'], '', $r['fileurl']);
            $r['img_w'] = $r['width'] > 100 ? 100 : $r['width'];
            $lists[] = $r;
        }
        include tpl('upload');
        break;
}
コード例 #18
0
?>
<div class="tt">文件列表</div>
<table cellpadding="2" cellspacing="1" class="tb">
<tr>
<th>文件</th>
<th width="150">大小</th>
<th width="150">修改时间</th>
</tr>
<?php 
foreach ($lists as $v) {
    ?>
<tr align="center">
<td align="left" class="f_fd">&nbsp;<?php 
    echo str_replace(DT_ROOT . '/file/patch/' . $fid . '/', '', $v);
    ?>
</td>
<td class="px11"><?php 
    echo dround(filesize($v) / 1024);
    ?>
 Kb</td>
<td class="px11"><?php 
    echo timetodate(filemtime($v), 6);
    ?>
</td>
</tr>
<?php 
}
?>
</table>
<?php 
include tpl('footer');
コード例 #19
0
ファイル: buy.inc.php プロジェクト: hiproz/zhaotaoci.cc
 if ($express && in_array($express, array(1, 2, 3))) {
     $i = $express;
     $fee_name = $t['express_name_' . $i];
     $fee = dround($t['fee_start_' . $i] + $t['fee_step_' . $i] * ($number - 1));
     $express_id = $t['express_' . $i];
     $area_id = $add['areaid'];
     if ($express_id && $area_id) {
         $E = $db->get_one("SELECT * FROM {$DT_PRE}mall_express 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 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;
 }
コード例 #20
0
ファイル: upload.php プロジェクト: hcd2008/destoon
            if ($from == 'editor') {
                $js .= 'window.parent.SetUrl("' . $saveto . '");';
                $js .= 'window.parent.GetE("frmUpload").reset();';
            } else {
                if ($from == 'attach') {
                    $js .= 'window.parent.GetE("txtUrl").value="' . $saveto . '";';
                    $js .= 'window.parent.window.parent.Ok();';
                } else {
                    if ($from == 'file') {
                        if ($moduleid == 2 && $fid == 'chat') {
                            $js .= $pr . '("word").value="' . $saveto . '";';
                            $js .= 'window.parent.chat_send();';
                        } else {
                            $js .= $pr . '("' . $fid . '").value="' . $saveto . '";';
                            if ($module == 'down') {
                                $js .= 'window.parent.initd(' . dround($do->file_size / 1024 / 1024, 2) . ');';
                            }
                        }
                        $js .= 'window.parent.cDialog();';
                    }
                }
            }
        }
    }
    dalert('', '', $js);
} else {
    $errmsg = 'Error(9)' . $do->errmsg;
    if ($swfupload) {
        exit(convert($errmsg, DT_CHARSET, 'UTF-8'));
    }
    dalert($errmsg, '', $errjs);
コード例 #21
0
ファイル: my.inc.php プロジェクト: hcd2008/destoon
    $limit_free = $MG['article_limit'] > $limit_used ? $MG['article_limit'] - $limit_used : 0;
}
switch ($action) {
    case 'add':
        if ($MG['article_limit'] && $limit_used >= $MG['article_limit']) {
            dalert(lang($L['info_limit'], array($MG[$MOD['module'] . '_limit'], $limit_used)), $_userid ? $MODULE[2]['linkurl'] . $DT['file_my'] . '?mid=' . $mid : $MODULE[2]['linkurl'] . $DT['file_my']);
        }
        if ($MG['day_limit']) {
            $today = $today_endtime - 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 ? $MODULE[2]['linkurl'] . $DT['file_my'] . '?mid=' . $mid : $MODULE[2]['linkurl'] . $DT['file_my']);
            }
        }
        if ($MG['article_free_limit'] >= 0) {
            $fee_add = $MOD['fee_add'] && (!$MOD['fee_mode'] || !$MG['fee_mode']) && $limit_used >= $MG['article_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';
        $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']);
コード例 #22
0
ファイル: index.inc.php プロジェクト: hiproz/zhaotaoci.cc
 $totime = $todate ? strtotime($todate . ' 23:59:59') : 0;
 $minprice = isset($minprice) ? dround($minprice) : '';
 $minprice or $minprice = '';
 $maxprice = isset($maxprice) ? dround($maxprice) : '';
 $maxprice or $maxprice = '';
 $minmarketprice = isset($minmarketprice) ? dround($minmarketprice) : '';
 $minmarketprice or $minmarketprice = '';
 $maxmarketprice = isset($maxmarketprice) ? dround($maxmarketprice) : '';
 $maxmarketprice or $maxmarketprice = '';
 $minamount = isset($minamount) ? dround($minamount) : '';
 $minamount or $minamount = '';
 $maxamount = isset($maxamount) ? dround($maxamount) : '';
 $maxamount or $maxamount = '';
 $minminamount = isset($minminamount) ? dround($minminamount) : '';
 $minminamount or $minminamount = '';
 $maxminamount = isset($maxminamount) ? dround($maxminamount) : '';
 $maxminamount or $maxminamount = '';
 $mindiscount = isset($mindiscount) ? intval($mindiscount) : '';
 $mindiscount or $mindiscount = '';
 $maxdiscount = isset($maxdiscount) ? intval($maxdiscount) : '';
 $maxdiscount or $maxdiscount = '';
 $logistic = isset($logistic) ? intval($logistic) : '-1';
 $process = isset($process) ? intval($process) : '-1';
 $itemid or $itemid = '';
 $fields_select = dselect($sfields, 'fields', '', $fields);
 $level_select = level_select('level', '级别', $level, 'all');
 $order_select = dselect($sorder, 'order', '', $order);
 $condition = '';
 if ($_childs) {
     $condition .= " AND catid IN (" . $_childs . ")";
 }
コード例 #23
0
ファイル: index.inc.php プロジェクト: hiproz/zhaotaoci.cc
 $level = isset($level) ? intval($level) : 0;
 isset($fields) && isset($dfields[$fields]) or $fields = 0;
 isset($order) && isset($dorder[$order]) or $order = 0;
 $elite = isset($elite) ? intval($elite) : 0;
 $cod = isset($cod) ? intval($cod) : 0;
 $mp = isset($mp) ? intval($mp) : 0;
 $rl = isset($rl) ? intval($rl) : 0;
 $price = isset($price) ? intval($price) : 0;
 isset($datetype) && in_array($datetype, array('edittime', 'addtime')) or $datetype = 'edittime';
 $fromdate = isset($fromdate) && is_date($fromdate) ? $fromdate : '';
 $fromtime = $fromdate ? strtotime($fromdate . ' 0:0:0') : 0;
 $todate = isset($todate) && is_date($todate) ? $todate : '';
 $totime = $todate ? strtotime($todate . ' 23:59:59') : 0;
 $minprice = isset($minprice) ? dround($minprice) : '';
 $minprice or $minprice = '';
 $maxprice = isset($maxprice) ? dround($maxprice) : '';
 $maxprice or $maxprice = '';
 $minorders = isset($minorders) ? intval($minorders) : '';
 $minorders or $minorders = '';
 $maxorders = isset($maxorders) ? intval($maxorders) : '';
 $maxorders or $maxorders = '';
 $minsales = isset($minsales) ? intval($minsales) : '';
 $minsales or $minsales = '';
 $maxsales = isset($maxsales) ? intval($maxsales) : '';
 $maxsales or $maxsales = '';
 $minamount = isset($minamount) ? intval($minamount) : '';
 $minamount or $minamount = '';
 $maxamount = isset($maxamount) ? intval($maxamount) : '';
 $maxamount or $maxamount = '';
 $mincomments = isset($mincomments) ? intval($mincomments) : '';
 $mincomments or $mincomments = '';
コード例 #24
0
ファイル: md5.tpl.php プロジェクト: hcd2008/destoon
<tr>
<td>&nbsp;镜像文件</td>
<td>&nbsp;<select name="mirror" id="mirror">
<option value="">系统默认</option>
<?php 
    foreach ($mfiles as $f) {
        $n = basename($f, '.php');
        if (strlen($n) < 16) {
            continue;
        }
        ?>
<option value="<?php 
        echo $n;
        ?>
"><?php 
        echo $n . ' ' . dround(filesize($f) / 1024, 2);
        ?>
 K</option>
<?php 
    }
    ?>
</select>
&nbsp;<input type="submit" name="submit" value="开始校验" class="btn" onclick="this.form.action='?file=<?php 
    echo $file;
    ?>
';this.value='校验中..';this.blur();this.className='btn f_gray';"/>
&nbsp;<input type="submit" name="submit" value="删除镜像" class="btn" onclick="if(Dd('mirror').value==''){alert('请选择需要删除的镜像文件');Dd('mirror').focus();return false;}if(confirm('确定要删除吗?此操作将不可恢复')){this.form.action='?file=<?php 
    echo $file;
    ?>
&action=delete';}else{return false;}"/>
</td>
コード例 #25
0
ファイル: charge.inc.php プロジェクト: hiproz/zhaotaoci.cc
     exit;
     break;
 case 'confirm':
     $amount = dround($amount);
     if ($MOD['mincharge']) {
         if (strpos($MOD['mincharge'], '|') !== false) {
             in_array($amount, explode('|', $MOD['mincharge'])) or message($L['charge_pass_choose_amount']);
         } else {
             $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;
     preg_match("/^[a-z0-9\\-\\,\\|]{3,}\$/i", $reason) or $reason = '';
     $auto = isset($auto) ? $auto : 1;
     //debug?
     if ($fee == 0) {
         $auto = 1;
     }
     if ($auto) {
         $goto = 1;
     }
     if (isset($goto)) {
         $receive_url = $MOD['linkurl'] . '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();
コード例 #26
0
ファイル: charge.inc.php プロジェクト: hcd2008/destoon
             $F = strtotime($year . '-' . $i . '-01 00:00:00');
             $T = strtotime($year . '-' . $i . '-' . date('t', $F) . ' 23:59:59');
             $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE sendtime>={$F} AND sendtime<={$T} AND status>2");
             $num = $t['num'] ? dround($t['num']) : 0;
             $chart_data .= ';' . $num;
             $T1 += $num;
             $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE sendtime>={$F} AND sendtime<={$T} AND status=0");
             $num = $t['num'] ? dround($t['num']) : 0;
             $chart_data .= ';' . $num;
             $T2 += $num;
             $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE sendtime>={$F} AND sendtime<={$T} AND status=1");
             $num = $t['num'] ? dround($t['num']) : 0;
             $chart_data .= ';' . $num;
             $T3 += $num;
             $t = $db->get_one("SELECT SUM(`amount`) AS num FROM {$table} WHERE sendtime>={$F} AND sendtime<={$T} AND status=2");
             $num = $t['num'] ? dround($t['num']) : 0;
             $chart_data .= ';' . $num;
             $T4 += $num;
         }
         $title = $year . '年会员充值统计报表';
     }
     include tpl('charge_stats', $module);
     break;
 case 'check':
     $itemid or msg('请选择记录');
     $itemid = implode(',', $itemid);
     $result = $db->query("SELECT * FROM {$table} WHERE itemid IN ({$itemid}) AND status<2");
     $i = 0;
     while ($r = $db->fetch_array($result)) {
         $money = $r['amount'] + $r['fee'];
         money_add($r['username'], $r['amount']);
コード例 #27
0
ファイル: spread.inc.php プロジェクト: hcd2008/destoon
     $price = $p['company_price'] ? $p['company_price'] : $EXT['spread_company_price'];
 } else {
     if ($mid == 5) {
         $price = $p['sell_price'] ? $p['sell_price'] : $EXT['spread_sell_price'];
     } else {
         if ($mid == 6) {
             $price = $p['buy_price'] ? $p['buy_price'] : $EXT['spread_buy_price'];
         } else {
             dheader($EXT['spread_url']);
         }
     }
 }
 $step = $EXT['spread_step'];
 $month = $EXT['spread_month'] ? $EXT['spread_month'] : 1;
 if ($submit) {
     $buy_price = dround($buy_price);
     if ($buy_price < $price) {
         message($L['spread_msg_price_min']);
     }
     if (($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') {
         if ($amount > $_money) {
             message($L['money_not_enough'], $MODULE[2]['linkurl'] . 'charge.php?action=pay&amount=' . ($amount - $_money));
         }
コード例 #28
0
ファイル: cash.inc.php プロジェクト: hcd2008/destoon
 if ($MOD['cash_min'] && $amount < $MOD['cash_min']) {
     message($L['cash_pass_amount_min'] . $MOD['cash_min']);
 }
 if ($MOD['cash_max'] && $amount > $MOD['cash_max']) {
     message($L['cash_pass_amount_max'] . $MOD['cash_max']);
 }
 if ($MOD['cash_times']) {
     $r = $db->get_one("SELECT COUNT(*) as num FROM {$DT_PRE}finance_cash WHERE username='******' AND addtime>{$DT_TIME}-3600*24");
     if ($r['num'] >= $MOD['cash_times']) {
         message(lang($L['cash_pass_amount_day'], array($MOD['cash_times'])), $MOD['linkurl'] . 'record.php?action=cash', 6);
     }
 }
 $amount = dround($amount);
 $fee = 0;
 if ($MOD['cash_fee']) {
     $fee = dround($amount * $MOD['cash_fee'] / 100);
     if ($MOD['cash_fee_min'] && $fee < $MOD['cash_fee_min']) {
         $fee = $MOD['cash_fee_min'];
     }
     if ($MOD['cash_fee_max'] && $fee > $MOD['cash_fee_max']) {
         $fee = $MOD['cash_fee_max'];
     }
 }
 $money = $amount + $fee;
 if ($submit) {
     if ($money > $_money) {
         message($L['cash_pass_amount_large']);
     }
     is_payword($_username, $password) or message($L['error_payword']);
     $db->query("INSERT INTO {$DT_PRE}finance_cash (username,bank,account,truename,amount,fee,addtime,ip) VALUES ('{$_username}','{$member['bank']}','{$member['account']}','{$member['truename']}','{$amount}','{$fee}','{$DT_TIME}','{$DT_IP}')");
     $db->query("UPDATE {$DT_PRE}member SET money=money-{$money},locking=locking+{$money} WHERE username='******'");
コード例 #29
0
ファイル: index.inc.php プロジェクト: hcd2008/destoon
     dmsg('级别设置成功', $forward);
     break;
 default:
     $sfields = array('按条件', '公司名', '会员名', '公司类型', '公司规模', '销售', '采购', '主营行业', '经营模式', '电话', '传真', 'Email', '地址', '邮编', '主页', '风格目录', '模板目录', '顶级域名');
     $dfields = array('keyword', 'company', 'username', 'type', 'size', 'sell', 'buy', 'business', 'mode', 'telephone', 'fax', 'mail', 'address', 'postcode', 'homepage', 'skin', 'template', 'domain');
     $sorder = array('结果排序方式', VIP . '指数降序', VIP . '指数升序', '注册年份降序', '注册年份升序', '注册资本降序', '注册资本升序', '服务开始降序', '服务开始升序', '服务结束降序', '服务结束升序', '浏览人气降序', '浏览人气升序');
     $dorder = array('userid DESC', 'vip DESC', 'vip ASC', 'regyear DESC', 'regyear ASC', 'capital DESC', 'capital ASC', 'fromtime DESC', 'fromtime ASC', 'totime DESC', 'totime ASC', 'hits DESC', 'hits ASC');
     $svalid = array('认证', '已通过', '未通过');
     $MS = cache_read('module-2.php');
     $modes = explode('|', '经营模式|' . $MS['com_mode']);
     $types = explode('|', '公司类型|' . $MS['com_type']);
     $sizes = explode('|', '公司规模|' . $MS['com_size']);
     $thumb = isset($thumb) ? intval($thumb) : 0;
     $mincapital = isset($mincapital) ? dround($mincapital) : '';
     $mincapital or $mincapital = '';
     $maxcapital = isset($maxcapital) ? dround($maxcapital) : '';
     $maxcapital or $maxcapital = '';
     $areaid = isset($areaid) ? intval($areaid) : 0;
     isset($mode) && isset($modes[$mode]) or $mode = 0;
     isset($type) && isset($types[$type]) or $type = 0;
     isset($size) && isset($sizes[$size]) or $size = 0;
     $vip = isset($vip) ? $vip === '' ? -1 : intval($vip) : -1;
     isset($fields) && isset($dfields[$fields]) or $fields = 0;
     isset($order) && isset($dorder[$order]) or $order = 0;
     $groupid = isset($groupid) ? intval($groupid) : 0;
     $valid = isset($valid) ? intval($valid) : 0;
     $level = isset($level) ? intval($level) : 0;
     $uid = isset($uid) ? intval($uid) : '';
     $username = isset($username) ? trim($username) : '';
     isset($fromtime) or $fromtime = '';
     isset($totime) or $totime = '';
コード例 #30
0
ファイル: tag.func.php プロジェクト: hiproz/zhaotaoci.cc
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('&amp;', '%'), 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('"', '&quot;', 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);
    }
}