示例#1
0
 function getCacheTypes()
 {
     if (!isset($_PB_CACHE['newstype'])) {
         $_PB_CACHE['newstype'] = cache_read("type", "newstype");
     }
     return $_PB_CACHE['newstype'];
 }
示例#2
0
 function Search($firstcount, $displaypg)
 {
     global $cache_types;
     uses("space", "industry", "area");
     $space = new Space();
     $area = new Areas();
     $industry = new Industries();
     $cache_options = cache_read('typeoption');
     $area_s = $space->array_multi2single($area->getCacheArea());
     $industry_s = $space->array_multi2single($industry->getIndustry());
     $result = $this->findAll("*,name AS title,description AS digest", null, null, $this->orderby, $firstcount, $displaypg);
     if (!isset($_PB_CACHE['membergroup'])) {
         require CACHE_PATH . "cache_membergroup.php";
     }
     while (list($keys, $values) = each($result)) {
         $r = array();
         $result[$keys]['pubdate'] = df($values['created']);
         $result[$keys]['typename'] = $cache_options['manage_type'][$values['manage_type']];
         $result[$keys]['thumb'] = $result[$keys]['logo'] = pb_get_attachmenturl($values['picture'], '', 'small');
         $result[$keys]['gradeimg'] = URL . 'images/group/' . $_PB_CACHE['membergroup'][$result[$keys]['cache_membergroupid']]['avatar'];
         $result[$keys]['gradename'] = $_PB_CACHE['membergroup'][$result[$keys]['cache_membergroupid']]['name'];
         if (!empty($result[$keys]['area_id'])) {
             $r[] = $area_s[$result[$keys]['area_id']];
         }
         if (!empty($result[$keys]['industry_id'])) {
             $r[] = $industry_s[$result[$keys]['industry_id']];
         }
         $r[] = L("integrity_index", "tpl") . "(" . $result[$keys]['cache_credits'] . ")";
         if (!empty($r)) {
             $result[$keys]['extra'] = implode(" - ", $r);
         }
         $result[$keys]['url'] = $space->rewrite($values['member_id'], $values['id']);
     }
     return $result;
 }
示例#3
0
 function index()
 {
     global $viewhelper;
     $conditions = array();
     $viewhelper->setTitle(L("announce", "tpl"));
     $types = cache_read("type");
     $viewhelper->setPosition(L("announce", "tpl"), "index.php?do=announce");
     if (!empty($_GET['typeid'])) {
         $conditions[] = "announcetype_id=" . intval($_GET['typeid']);
     }
     $result = $this->announcement->findAll("*", null, $conditions, "display_order ASC,id DESC");
     if (!empty($result)) {
         for ($i = 0; $i < count($result); $i++) {
             if (!empty($result[$i]['created'])) {
                 $result[$i]['pubdate'] = date("Y-m-d", $result[$i]['created']);
                 $result[$i]['title'] = pb_lang_split($result[$i]['subject']);
                 $result[$i]['typename'] = $types['announcementtype'][$result[$i]['announcetype_id']];
                 $result[$i]['type_id'] = $result[$i]['announcetype_id'];
             }
         }
         setvar("module", "announce");
         setvar("items", $result);
     }
     render("list.default", true);
 }
示例#4
0
 function detail()
 {
     require CACHE_COMMON_PATH . "cache_type.php";
     $_PB_CACHE['area'] = cache_read("area");
     $_PB_CACHE['industry'] = cache_read("industry");
     if (isset($_GET['title'])) {
         $title = trim($_GET['title']);
         $res = $this->expo->findByName($title);
         $id = $res['id'];
     }
     if (isset($_GET['id'])) {
         $id = intval($_GET['id']);
     }
     if (!$this->expo->checkExist($id, true)) {
         flash("data_not_exists");
     }
     $info = $this->expo->info;
     $this->view_helper->setPosition(L("fair", "tpl"));
     if (!empty($info)) {
         $info['typename'] = $_PB_CACHE['expotype'][$info['expotype_id']];
         $this->view_helper->setTitle($info['typename']);
         $this->view_helper->setPosition($info['typename'], 'index.php?do=fair&action=lists&typeid=' . $info['expotype_id']);
         $this->view_helper->setTitle($info['name']);
         $this->view_helper->setPosition($info['name']);
         $result = $this->expo->dbstuff->GetArray("SELECT c.name,c.id,c.cache_spacename AS userid FROM {$this->expo->table_prefix}expomembers em LEFT JOIN {$this->expo->table_prefix}companies c ON c.id=em.company_id WHERE c.status=1");
         $result = pb_lang_split_recursive($result);
         $info = pb_lang_split_recursive($info);
         if (!empty($result)) {
             setvar("Items", $result);
         }
         setvar("item", $info);
     }
     render("fair/detail");
 }
示例#5
0
 function Search($firstcount, $displaypg)
 {
     global $cache_types;
     uses("space", "industry", "area");
     $space = new Space();
     $area = new Areas();
     $industry = new Industries();
     $cache_options = cache_read('typeoption');
     $area_s = $space->array_multi2single($area->getCacheArea());
     $industry_s = $space->array_multi2single($area->getCacheArea());
     $result = $this->findAll("*,name AS title,content AS digest", null, null, $this->orderby, $firstcount, $displaypg);
     while (list($keys, $values) = each($result)) {
         $result[$keys]['typename'] = $cache_types['productsort'][$values['sort_id']];
         $result[$keys]['thumb'] = pb_get_attachmenturl($values['picture'], '', 'small');
         $result[$keys]['pubdate'] = df($values['begin_time']);
         if (!empty($result[$keys]['area_id'])) {
             $r1 = $area_s[$result[$keys]['area_id']];
         }
         if (!empty($result[$keys]['cache_companyname'])) {
             $r2 = "<a href='" . $space->rewrite($result[$keys]['cache_companyname'], $result[$keys]['company_id']) . "'>" . $result[$keys]['cache_companyname'] . "</a>";
         }
         if (!empty($r1) || !empty($r2)) {
             $result[$keys]['extra'] = implode(" - ", array($r1, $r2));
         }
         $result[$keys]['url'] = $this->getPermaLink($values['id']);
     }
     return $result;
 }
/**
 * 读取缓存,并将缓存加载至 $_W 全局变量中
 * @param string $key 缓存键名,如果键名以:结束,则做为分组名称读取所有缓存
 *
 */
function cache_load($key, $unserialize = false)
{
    global $_W;
    if (substr($key, -1) == ':') {
        $data = cache_search($key);
        foreach ($data as $k => $v) {
            $tmp =& cache_global($k);
            $tmp = $unserialize ? iunserializer($v) : $v;
        }
        return cache_global($key);
    } else {
        $data = cache_read($key);
        if ($key == 'setting') {
            $_W['setting'] = $data;
            return $_W['setting'];
        } elseif ($key == 'modules') {
            $_W['modules'] = $data;
            return $_W['modules'];
        } else {
            $tmp =& cache_global($key);
            $tmp = $unserialize ? iunserializer($data) : $data;
            return $unserialize ? iunserializer($data) : $data;
        }
    }
}
示例#7
0
文件: form.php 项目: reboxhost/phpb2b
 function getAttributes($attribute_ids = 0, $form_id = 1)
 {
     $_PB_CACHE['form'] = cache_read("form");
     $result = $data = array();
     $condition = null;
     $data = $_PB_CACHE['form'][$form_id];
     if (!empty($attribute_ids)) {
         if (is_array($attribute_ids)) {
             $tmp = implode(",", $attribute_ids);
             $tmp = "id IN (" . $tmp . ")";
         } else {
             $tmp = "id=" . intval($attribute_ids);
         }
         $condition = " WHERE " . $tmp;
         $sql = "SELECT id,form_id,formitem_id,attribute FROM {$this->table_prefix}formattributes{$condition}";
         $result = $this->dbstuff->GetArray($sql);
     }
     if (!empty($result)) {
         foreach ($result as $key => $val) {
             $tmp_result[$val['formitem_id']] = $val['attribute'];
         }
         foreach ($data as $key => $val) {
             if (!empty($tmp_result[$key])) {
                 $data[$key]['value'] = $tmp_result[$key];
             }
         }
     }
     return $data;
 }
示例#8
0
 function get_list($condition = '1', $order = 'listorder DESC, itemid DESC')
 {
     global $MODULE, $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);
     $GROUP = cache_read('group.php');
     $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['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';
         $groupid = explode(',', substr($r['groupid'], 1, -1));
         $group = array();
         foreach ($groupid as $gid) {
             $group[] = $GROUP[$gid]['groupname'];
         }
         $r['group'] = implode('<br/>', $group);
         $lists[] = $r;
     }
     return $lists;
 }
示例#9
0
 function setNames()
 {
     if (func_num_args() < 1) {
         return;
     }
     $return = array();
     $_PB_CACHE['industry'] = cache_read("industry");
     $args = func_get_args();
     foreach ($args as $key => $val) {
         $return[] = isset($_PB_CACHE['industry'][$val]) ? $_PB_CACHE['industry'][$val] : '';
     }
     $this->names = $return;
 }
示例#10
0
function cache_load($key, $unserialize = false)
{
    global $_W;
    $data = $_W['cache'][$key] = cache_read($key);
    if ($key == 'setting') {
        $_W['setting'] = $data;
        return $_W['setting'];
    } elseif ($key == 'modules') {
        $_W['modules'] = $data;
        return $_W['modules'];
    } else {
        return $unserialize ? iunserializer($data) : $data;
    }
}
示例#11
0
 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);
 }
示例#12
0
 private function getJsApiTicket()
 {
     $ticket = cache_read("js_api_ticket");
     if (empty($ticket) || $ticket["time"] <= time()) {
         $token = $this->getWxAccessToken();
         if (!empty($token)) {
             $url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={$token}&type=jsapi";
             $js_token = ihttp_request($url);
             if (!empty($js_token)) {
                 $content = @json_decode($js_token['content'], true);
                 $ticket = array("ticket" => $content["ticket"], "time" => TIMESTAMP + $content["expires_in"]);
                 cache_write("js_api_ticket", $ticket);
             }
         }
     }
     return $ticket["ticket"];
 }
示例#13
0
 function getUsergroups($type = 'all')
 {
     //system,special,define
     $return = array();
     $G['membergroup'] = cache_read("membergroup");
     $typeid = strval($type);
     foreach ($G['membergroup'] as $key => $val) {
         if ($typeid == 'all') {
             $return[$key] = $val['name'];
         } else {
             if ($typeid == $val['type']) {
                 $return[$key] = $val['name'];
             }
         }
     }
     ksort($return);
     return $return;
 }
示例#14
0
 function getInfoById($member_id)
 {
     $tmp_img = null;
     $G['membergroup'] = cache_read("membergroup");
     $G['trusttype'] = cache_read("trusttype");
     $result = array();
     $sql = "SELECT m.*,mf.* FROM {$this->table_prefix}members m LEFT JOIN {$this->table_prefix}memberfields mf ON mf.member_id=m.id WHERE m.id='{$member_id}'";
     $result = $this->dbstuff->GetRow($sql);
     if (!empty($result)) {
         if (isset($result['link_man'])) {
             $result['link_people'] = $result['link_man'];
         }
         $result['groupname'] = $G['membergroup'][$result['membergroup_id']]['name'];
         $result['groupimage'] = STATICURL . "images/group/" . $G['membergroup'][$result['membergroup_id']]['avatar'];
         if (!empty($result['trusttype_ids'])) {
             $tmp_str = explode(",", $result['trusttype_ids']);
             foreach ($tmp_str as $key => $val) {
                 $tmp_img .= "<img src=\"" . STATICURL . "images/icon/" . $G['trusttype'][$val]['avatar'] . "\" alt=\"" . $G['trusttype'][$val]['name'] . "\" />";
             }
             $result['trust_image'] = $tmp_img;
         }
     }
     return $result;
 }
示例#15
0
 /**
  * open(host, port);
  * @return: true if connection was successful, false otherwise
  */
 function open($host, $port)
 {
     $conn_status = 1;
     if (function_exists("cache_assign_key")) {
         // checkig if we had a successful connection with the same server and the same port
         // whithin the last GEKKO_REMOTE_TIMEOUT seconds
         $key = cache_assign_key($host, $port);
         if (($life = cache_check_life($key)) !== false && time() - $life < GEKKO_REMOTE_CONN_CACHE_LIFE) {
             // if we had a successful connection we put a 1 in a cached file, this is for
             // avoiding wasting time trying to connect to a specific server when it is not
             // responding, we can check it later
             cache_read($key, $conn_status);
         }
     }
     // trying to connect if the last try was successful of if this is the first
     if ($conn_status) {
         $this->socket = @fsockopen($host, $port, $this->errno, $this->errstr, GEKKO_REMOTE_CONN_TIMEOUT);
     }
     // saving connection status
     if (function_exists("cache_save") && $conn_status != $this->status()) {
         cache_save($key, intval($this->status()));
     }
     return $conn_status ? $this->status() : false;
 }
示例#16
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2258 $
 */
require "../libraries/common.inc.php";
require "session_cp.inc.php";
uses("member", "membergroup", "typeoption");
require LIB_PATH . 'time.class.php';
require PHPB2B_ROOT . 'libraries/page.class.php';
require CACHE_COMMON_PATH . "cache_type.php";
$G['membergroup'] = cache_read("membergroup");
$G['trusttype'] = cache_read("trusttype");
$typeoption = new Typeoption();
$membergroup = new Membergroup();
$member = new Members();
$page = new Pages();
$tpl_file = "member";
$conditions = array();
setvar("MembergroupOptions", $membergroup->getUsergroups());
setvar("Membergroups", $member_groups = $G['membergroup']);
setvar("Membertypes", $member_types = $_PB_CACHE['membertype']);
$genders = $typeoption->get_cache_type("gender");
foreach ($G['trusttype'] as $key => $val) {
    $tmp_trusttypes[$key] = $val['name'];
}
setvar("Trusttypes", $tmp_trusttypes);
if (isset($_POST)) {
示例#17
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
$moduleid = 16;
$module = 'mall';
$MOD = cache_read('module-' . $moduleid . '.php');
$table = $DT_PRE . 'mall';
$table_data = $DT_PRE . 'mall_data';
if ($itemid) {
    $item = $db->get_one("SELECT * FROM {$table} WHERE itemid={$itemid}");
    if (!$item || $item['status'] < 3 || $item['username'] != $username) {
        dheader($MENU[$menuid]['linkurl']);
    }
    unset($item['template']);
    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'];
    $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) {
示例#18
0
function area_pos($areaid, $str = ' &raquo; ', $deep = 0)
{
    if ($areaid) {
        global $AREA;
    } else {
        global $L;
        return $L['allcity'];
    }
    $AREA or $AREA = cache_read('area.php');
    $arrparentid = $AREA[$areaid]['arrparentid'] ? explode(',', $AREA[$areaid]['arrparentid']) : array();
    $arrparentid[] = $areaid;
    $pos = '';
    if ($deep) {
        $i = 1;
    }
    foreach ($arrparentid as $areaid) {
        if (!$areaid || !isset($AREA[$areaid])) {
            continue;
        }
        if ($deep) {
            if ($i > $deep) {
                continue;
            }
            $i++;
        }
        $pos .= $AREA[$areaid]['areaname'] . $str;
    }
    $_len = strlen($str);
    if ($str && substr($pos, -$_len, $_len) === $str) {
        $pos = substr($pos, 0, strlen($pos) - $_len);
    }
    return $pos;
}
示例#19
0
 function detail()
 {
     global $viewhelper;
     using("tag", "meta");
     $tag = new Tags();
     $meta = new Metas();
     $conditions = array();
     $viewhelper->setTitle(L("info", "tpl"));
     $viewhelper->setPosition(L("info", "tpl"), "index.php?do=news");
     if (isset($_GET['title'])) {
         $title = trim($_GET['title']);
         $res = $this->news->findByTitle($title);
         $id = $res['id'];
     }
     if (isset($_GET['id'])) {
         $id = intval($_GET['id']);
     }
     if (!empty($id)) {
         $_PB_CACHE['newstype'] = cache_read("type", "newstype");
         $this->news->clicked($id);
         $info = $this->news->read("*", $id);
         if (empty($info) or !$info) {
             flash("data_not_exists", '', 0);
         }
         if (!empty($info['tag_ids'])) {
             $the_tags = $tag->getTagsByIds($info['tag_ids'], true);
             $tmp = null;
             $info['tag'] = $tag->tag;
             foreach ($the_tags as $key => $val) {
                 $tmp .= "<a href='" . $this->url(array("module" => "search", "do" => "news", "q" => urlencode($val))) . "'>" . $val . "</a> ";
             }
             $info['tag_link'] = $tmp;
         }
         if (!empty($info['picture'])) {
             $info['image'] = pb_get_attachmenturl($info['picture'], '', 'small');
         }
         $info['pubdate'] = df($info['created']);
         $info['typename'] = $_PB_CACHE['newstype'][$info['type_id']];
         $viewhelper->setTitle($info['typename']);
         $viewhelper->setPosition($info['typename'], $this->url(array("module" => "search", "do" => "news", "typeid" => $info['type_id'])));
         //seo info
         $meta_info = $meta->getSEOById($id, 'news', false);
         empty($meta_info['title']) ? $viewhelper->setTitle($info['title']) : $viewhelper->setTitle($meta_info['title']);
         empty($meta_info['description']) ? $viewhelper->setMetaDescription($info['content']) : $viewhelper->setMetaDescription($meta_info['description']);
         if (isset($meta_info['keyword'])) {
             $viewhelper->setMetaKeyword($meta_info['keyword']);
         }
         $viewhelper->setPosition($info['title']);
         if (!empty($info['require_membertype'])) {
             $require_ids = explode(",", $info['require_membertype']);
             if (!empty($pb_userinfo['pb_userid'])) {
                 $membertype_id = $this->news->dbstuff->GetOne("SELECT membertype_id FROM {$tb_prefix}members WHERE id='" . $pb_user['pb_userid'] . "'");
                 if (!in_array($membertype_id, $require_ids)) {
                     $info['content'] = L("news_membertype_not_allowed", "tpl");
                 }
             } else {
                 $info['content'] = L("news_membertype_not_allowed", "tpl");
             }
         }
         if ($info['type'] == 1) {
             $info['source'] = L("company_news", "tpl");
             $info['content'] = "<a href='" . $info['content'] . "'>" . $info['content'] . "</a>";
         }
         if (!empty($info['picture'])) {
             $info['image_url'] = pb_get_attachmenturl($info['picture']);
         }
         $neighbour_info = $this->news->getNeighbour($id, "id,title");
         if (!empty($neighbour_info['prev'])) {
             $title = pb_lang_split($neighbour_info['prev']['title']);
             $info['prev_link'] = "<a href='" . $this->url(array("module" => "news", "id" => $neighbour_info['prev']['id'])) . "'>" . $title . "</a>";
             $info['prev_title'] = $title;
         } else {
             $info['prev_link'] = L("nothing", "tpl");
         }
         if (!empty($neighbour_info['next'])) {
             $title = pb_lang_split($neighbour_info['next']['title']);
             $info['next_link'] = "<a href='" . $this->url(array("module" => "news", "id" => $neighbour_info['next']['id'])) . "'>" . $title . "</a>";
             $info['next_title'] = $title;
         } else {
             $info['next_link'] = L("nothing", "tpl");
         }
         setvar("item", pb_lang_split_recursive($info));
     } else {
         flash();
     }
     setvar("Newstypes", $_PB_CACHE['newstype']);
     render("detail.default");
 }
示例#20
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
login();
require DT_ROOT . '/module/' . $module . '/common.inc.php';
require DT_ROOT . '/include/post.func.php';
$PAY = cache_read('pay.php');
$amount = isset($amount) ? dround($amount) : '';
function get_reason_url($reason)
{
    $url = '';
    $arr = explode('|', $reason);
    switch ($arr[0]) {
        case 'deposit':
            $url = 'deposit.php?action=add&sum=' . intval($arr[1]);
            break;
        case 'credit':
            $url = 'credit.php?action=buy&sum=' . intval($arr[1]);
            break;
        case 'vip':
            $url = 'vip.php?action=renew&sum=' . intval($arr[1]);
            break;
        case 'pay':
            if (is_numeric($arr[1]) && is_numeric($arr[2])) {
                $url = DT_PATH . 'api/redirect.php?mid=' . intval($arr[1]) . '&itemid=' . intval($arr[2]) . '&sum=1';
            }
            break;
        case 'trade':
            if (is_numeric($arr[1])) {
                $url = 'trade.php?action=update&step=pay&itemid=' . intval($arr[1]);
            }
示例#21
0
<?php

/*
	[Destoon B2B System] Copyright (c) 2008-2013 Destoon.COM
	This is NOT a freeware, use is subject to license.txt
*/
defined('IN_DESTOON') or exit('Access Denied');
$menus = array(array('地区添加', '?file=' . $file . '&action=add'), array('地区管理', '?file=' . $file), array('导入省市', '?file=' . $file . '&action=import', 'onclick="return confirm(\'确定导入中国省市数据吗? 当前数据将被覆盖 \');"'), array('更新缓存', '?file=' . $file . '&action=cache'));
$AREA = cache_read('area.php');
$areaid = isset($areaid) ? intval($areaid) : 0;
$do = new area($areaid);
$parentid = isset($parentid) ? intval($parentid) : 0;
$table = $DT_PRE . 'area';
$this_forward = '?file=' . $file . '&parentid=' . $parentid;
switch ($action) {
    case 'add':
        if ($submit) {
            if (!$area['areaname']) {
                msg('地区名不能为空');
            }
            $area['areaname'] = trim($area['areaname']);
            if (strpos($area['areaname'], "\n") === false) {
                $do->add($area);
            } else {
                $areanames = explode("\n", $area['areaname']);
                foreach ($areanames as $areaname) {
                    $areaname = trim($areaname);
                    if (!$areaname) {
                        continue;
                    }
                    $area['areaname'] = $areaname;
示例#22
0
 //注意判断返回金额
 $total_fee = ($total_fee + $discount) / 100;
 $out_trade_no = intval($out_trade_no);
 $r = $db->get_one("SELECT * FROM {$DT_PRE}finance_charge WHERE itemid='{$out_trade_no}'");
 if ($r) {
     if ($r['status'] == 0) {
         $charge_orderid = $r['itemid'];
         $charge_money = $r['amount'] + $r['fee'];
         $charge_amount = $r['amount'];
         $editor = 'N' . $bank;
         if ($total_fee == $charge_money) {
             $db->query("UPDATE {$DT_PRE}finance_charge SET status=3,money={$charge_money},receivetime='{$DT_TIME}',editor='{$editor}' WHERE itemid={$charge_orderid}");
             require DT_ROOT . '/include/module.func.php';
             money_add($r['username'], $r['amount']);
             money_record($r['username'], $r['amount'], $PAY[$bank]['name'], 'system', '在线充值', '订单ID:' . $charge_orderid);
             $MOD = cache_read('module-2.php');
             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', '充值奖励', '充值' . $r['amount'] . $DT['money_unit']);
                 }
             }
             exit('success');
         } else {
             $note = '充值金额不匹配S:' . $charge_money . 'R:' . $total_fee;
             $db->query("UPDATE {$DT_PRE}finance_charge SET status=1,receivetime='{$DT_TIME}',editor='{$editor}',note='{$note}' WHERE itemid={$charge_orderid}");
             //支付失败
             #log_result($note);
             exit('fail');
         }
示例#23
0
            message('您的交易币不足以支付此次升级费用。', url('extension/module'), 'error');
            break;
        case '2':
            message('您已经购买过此升级版本,系统将直接跳转至升级界面。', url('cloud/process', array('m' => $auth['name'], 'is_upgrade' => 1, 'is_buy' => 1)), 'success');
            break;
        case '1':
            message('购买模块升级版本成功,系统将直接跳转至升级界面。', url('cloud/process', array('m' => $auth['name'], 'is_upgrade' => 1, 'is_buy' => 1)), 'success');
            exit;
            break;
    }
    message($response['message']['message']);
}
if ($do == 'callback') {
    $secret = $_GPC['token'];
    if (strlen($secret) == 32) {
        $cache = cache_read('cloud:auth:transfer');
        cache_delete('cloud:auth:transfer');
        if (!empty($cache) && $cache['secret'] == $secret) {
            $site = array_elements(array('key', 'token'), $cache);
            setting_save($site, 'site');
            $auth['key'] = $site['key'];
            $auth['password'] = md5($site['key'] . $site['token']);
            $auth['forward'] = 'profile';
            header('location: ' . __to($auth));
            exit;
        }
    }
    message('访问错误.');
}
template('cloud/frame');
function __to($auth)
示例#24
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
require MD_ROOT . '/down.class.php';
$do = new down($moduleid);
$menus = array(array('添加' . $MOD['name'], '?moduleid=' . $moduleid . '&action=add'), array($MOD['name'] . '列表', '?moduleid=' . $moduleid), array('审核' . $MOD['name'], '?moduleid=' . $moduleid . '&action=check'), array('未通过' . $MOD['name'], '?moduleid=' . $moduleid . '&action=reject'), array('回收站', '?moduleid=' . $moduleid . '&action=recycle'), array('移动分类', '?moduleid=' . $moduleid . '&action=move'));
if (in_array($action, array('add', 'edit'))) {
    $FD = cache_read('fields-' . substr($table, strlen($DT_PRE)) . '.php');
    if ($FD) {
        require DT_ROOT . '/include/fields.func.php';
    }
    isset($post_fields) or $post_fields = array();
    $CP = $MOD['cat_property'];
    if ($CP) {
        require DT_ROOT . '/include/property.func.php';
    }
    isset($post_ppt) or $post_ppt = array();
}
if ($_catids || $_areaids) {
    require DT_ROOT . '/admin/admin_check.inc.php';
}
if (in_array($action, array('', 'check', 'reject', 'recycle'))) {
    $sfields = array('模糊', '标题', '文件地址', '下载系列', '简介', '会员名', '编辑', 'IP', '文件路径', '内容模板');
    $dfields = array('keyword', 'title', 'fileurl', 'tag', 'introduce', 'username', 'editor', 'ip', 'filepath', 'template');
    $sorder = array('结果排序方式', '更新时间降序', '更新时间升序', '添加时间降序', '添加时间升序', '浏览次数降序', '浏览次数升序', '下载次数降序', '下载次数升序', '下载ID降序', '下载ID升序');
    $dorder = array($MOD['order'], 'edittime DESC', 'edittime ASC', 'addtime DESC', 'addtime ASC', 'hits DESC', 'hits ASC', 'download DESC', 'download ASC', 'itemid DESC', 'itemid ASC');
    $level = isset($level) ? intval($level) : 0;
    isset($fields) && isset($dfields[$fields]) or $fields = 0;
    isset($order) && isset($dorder[$order]) or $order = 0;
    isset($datetype) && in_array($datetype, array('edittime', 'addtime')) or $datetype = 'addtime';
    $fromdate = isset($fromdate) && is_date($fromdate) ? $fromdate : '';
示例#25
0
         $r['addtime'] = timetodate($r['addtime'], 5);
         $r['edittime'] = timetodate($r['edittime'], 5);
         $typeids = explode(',', substr($r['typeids'], 1, -1));
         $r['type'] = '<select>';
         foreach ($typeids as $t) {
             $r['type'] .= '<option' . ($t == $typeid ? ' selected' : '') . '>' . $TYPE[$t]['typename'] . '</option>';
         }
         $r['type'] .= '</select>';
         $lists[] = $r;
     }
     include tpl('mail_list', $module);
     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++;
     }
示例#26
0
     $do->itemid = $itemid;
     if ($submit) {
         if ($do->edit($post)) {
             dmsg('操作成功', $forward);
         } else {
             msg($do->errmsg);
         }
     } else {
         extract($do->get_one());
         $user = $username ? userinfo($username) : array();
         $addtime = timetodate($addtime);
         $edittime = timetodate($edittime);
         $fromtime = timetodate($DT_TIME, 3);
         $days = $promo_amount && $promo_type == 1 ? $promo_amount : 365;
         $totime = timetodate($DT_TIME + 86400 * $days);
         $UG = cache_read('group-' . $groupid . '.php');
         $fee = $UG['fee'];
         $pay = $fee - $amount;
         if ($promo_amount) {
             $pay = $promo_type == 1 ? 0 : $pay - $promo_amount;
         }
         include tpl('grade_edit', $module);
     }
     break;
 case 'delete':
     $itemid or msg('请选择记录');
     $do->delete($itemid);
     dmsg('删除成功', $forward);
     break;
 case 'reject':
     $status = 1;
示例#27
0
         include tpl($action, $module);
     }
     break;
 case 'level':
     $userid or msg('请选择' . $MOD['name']);
     $level = intval($level);
     $do->level($userid, $level);
     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;
示例#28
0
    if ($oauth['sina']['enable'] && $oauth['sina']['sync']) {
        $ext_oauth .= ',sina';
    }
    if ($oauth['qq']['enable'] && $oauth['qq']['sync']) {
        $ext_oauth .= ',qq';
    }
    $db->query("UPDATE {$DT_PRE}setting SET item_value='{$ext_oauth}' WHERE item_key='oauth' AND item='3'");
    cache_module(3);
    dmsg('更新成功', '?moduleid=' . $moduleid . '&file=' . $file . '&tab=' . $tab);
} else {
    extract(dhtmlspecialchars($MOD));
    cache_pay();
    $P = cache_read('pay.php');
    extract($P);
    cache_oauth();
    $O = cache_read('oauth.php');
    extract($O);
    $tenpay['keycode'] = pass_encode($tenpay['keycode']);
    $weixin['keycode'] = pass_encode($weixin['keycode']);
    $alipay['keycode'] = pass_encode($alipay['keycode']);
    $chinabank['keycode'] = pass_encode($chinabank['keycode']);
    $yeepay['keycode'] = pass_encode($yeepay['keycode']);
    $paypal['keycode'] = pass_encode($paypal['keycode']);
    $uc_dbpwd = pass_encode($uc_dbpwd);
    $ex_pass = pass_encode($ex_pass);
    #$sso_auth = pass_encode($sso_auth);
    if ($kw) {
        $all = 1;
        ob_start();
    }
    include tpl('setting', $module);
示例#29
0
             }
             if (ver_compare($templates[$k]['version'], $v['version']) == -1) {
                 $upgrade[] = $k;
             }
         }
     } else {
         message('从云平台获取模板信息失败,请稍后重试', referer(), 'error');
     }
     if (empty($upgrade)) {
         message('您的模板已经是最新版本', referer(), 'success');
     }
     $upgrade_str = iserializer($upgrade);
     cache_write('upgrade:template', $upgrade_str);
 }
 if ($batch == 1) {
     $wait_upgrade = (array) iunserializer(cache_read('upgrade:template'));
     if (empty($wait_upgrade)) {
         isetcookie('batch', 0, -10000);
         message('您的模板已经是最新版本', url('extension/theme'), 'success');
     }
     $id = array_shift($wait_upgrade);
 } else {
     $id = $_GPC['templateid'];
 }
 $theme = pdo_fetch("SELECT id, name, title FROM " . tablename('site_templates') . " WHERE name = :name", array(':name' => $id));
 if (empty($theme)) {
     if ($batch == 1) {
         cache_write('upgrade:template', iserializer($wait_upgrade));
         message($theme['title'] . ' 模板已经被卸载或是不存在。系统将进入下一个模板的更新。<br>请勿关闭浏览器', url('extension/theme/upgrade', array('batch' => 1)), 'success');
     }
     message('模板已经被卸载或是不存在!', '', 'error');
示例#30
0
文件: tools.ctrl.php 项目: 7demo/we7
 if ($op == 'view') {
     $file = authcode(trim($_GPC['file'], 'DECODE'));
     $file_tmp = $file;
     if (empty($file) || strexists($file, './') || strexists($file, '../') || $file == 'data/config.php') {
         message('文件不存在', referer(), 'error');
     }
     $file_arr = explode('/', $file);
     $ignore = array('payment');
     if (is_array($file_arr) && in_array($file_arr[0], $ignore)) {
         message('系统不允许查看当前文件', referer(), 'error');
     }
     $file = IA_ROOT . '/' . $file;
     if (!is_file($file)) {
         message('文件不存在', referer(), 'error');
     }
     $badfiles = iunserializer(cache_read('scan:badfile'));
     $info = $badfiles[$file_tmp];
     unset($badfiles);
     if (!empty($info)) {
         $info['func_count'] = 0;
         if (isset($info['func'])) {
             $info['func_count'] = count($info['func']);
             foreach ($info['func'] as $k1 => $v1) {
                 $d[$k1] = strtolower($v1[1]);
             }
             $d = array_unique($d);
             $info['func_str'] = implode(', ', $d);
         }
         $info['code_count'] = 0;
         if (isset($info['code'])) {
             $info['code_count'] = count($info['code']);