Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     global $mobile_cfg;
     if ($mobile_cfg == null) {
         $mobile_cfg = (require_once APP_ROOT_PATH . "system/mobile_cfg/" . APP_TYPE . "/webnav_cfg.php");
     }
     check_install();
     //重新处理后台的语言加载机制,后台语言环境配置于后台config.php文件
     $langSet = conf('DEFAULT_LANG');
     // 定义当前语言
     define('LANG_SET', strtolower($langSet));
     // 读取项目公共语言包
     if (is_file(LANG_PATH . $langSet . '/common.php')) {
         L(include LANG_PATH . $langSet . '/common.php');
         $this->lang_pack = (require LANG_PATH . $langSet . '/common.php');
         if (!file_exists(APP_ROOT_PATH . "public/runtime/admin/lang.js")) {
             $str = "var LANG = {";
             foreach ($this->lang_pack as $k => $lang) {
                 $str .= "\"" . $k . "\":\"" . $lang . "\",";
             }
             $str = substr($str, 0, -1);
             $str .= "};";
             file_put_contents(APP_ROOT_PATH . "public/runtime/admin/lang.js", $str);
         }
     }
     es_session::close();
 }
Exemplo n.º 2
0
 public function clear_image()
 {
     set_time_limit(0);
     es_session::close();
     $path = APP_ROOT_PATH . "public/attachment/";
     $this->clear_image_file($path);
     $path = APP_ROOT_PATH . "public/images/";
     $this->clear_image_file($path);
     $qrcode_path = APP_ROOT_PATH . "public/images/qrcode/";
     $this->clear_qrcode($qrcode_path);
     clear_dir_file(get_real_path() . "public/runtime/app/tpl_caches/");
     clear_dir_file(get_real_path() . "public/runtime/app/tpl_compiled/");
     header("Content-Type:text/html; charset=utf-8");
     exit("<div style='line-height:50px; text-align:center; color:#f30;'>" . L('CLEAR_SUCCESS') . "</div><div style='text-align:center;'><input type='button' onclick='\$.weeboxs.close();' class='button' value='关闭' /></div>");
 }
 public function restore()
 {
     set_time_limit(0);
     es_session::close();
     $groupname = $_REQUEST['file'];
     $vol = intval($_REQUEST['vol']);
     $db_back_dir = get_real_path() . "public/db_backup/" . $groupname . "/";
     $sql_list = $this->dirFileInfo($db_back_dir, ".sql");
     $sql_list = $sql_list[$groupname];
     $fileItem = $sql_list[$vol];
     $sql = file_get_contents($db_back_dir . $fileItem['filename']);
     $sql = $this->remove_comment($sql);
     $sql = trim($sql);
     $sql = str_replace("\r", '', $sql);
     $segmentSql = explode(";\n", $sql);
     foreach ($segmentSql as $itemSql) {
         if ($itemSql != '') {
             $itemSql = str_replace("%DB_PREFIX%", conf('DB_PREFIX'), $itemSql);
             $this->db->query($itemSql);
         }
     }
     if ($vol == count($sql_list)) {
         $result['done'] = 1;
         $result['status'] = 1;
     } else {
         $vol++;
         $result['filename'] = $groupname;
         $result['vol'] = $vol;
         $result['status'] = 1;
     }
     ajax_return($result);
 }
Exemplo n.º 4
0
<?php

// +----------------------------------------------------------------------
// | Fanwe 方维o2o商业系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011 http://www.fanwe.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 云淡风轻(88522820@qq.com)
// +----------------------------------------------------------------------
//用于队列的发送
require './system/common.php';
require './app/Lib/common.php';
es_session::close();
set_time_limit(0);
if ($_REQUEST['act'] == 'deal_msg_list') {
    //业务队列的群发
    $GLOBALS['db']->query("update " . DB_PREFIX . "conf set `value` = 1 where name = 'DEAL_MSG_LOCK' and `value` = 0");
    $rs = $GLOBALS['db']->affected_rows();
    if ($rs) {
        //业务队列中处理返利发放
        $rid = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "referrals where " . get_gmtime() . "-create_time > " . intval(app_conf('REFERRALS_DELAY')) * 60 . " and pay_time = 0");
        if ($rid) {
            pay_referrals(intval($rid));
        }
        $msg_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_msg_list where is_send = 0 order by id asc limit 1");
        if ($msg_item) {
            //优先改变发送状态,不论有没有发送成功
            $GLOBALS['db']->query("update " . DB_PREFIX . "deal_msg_list set is_send = 1,send_time='" . get_gmtime() . "' where id =" . intval($msg_item['id']));
            if ($msg_item['send_type'] == 0) {
                //短信
                require_once APP_ROOT_PATH . "system/utils/es_sms.php";
Exemplo n.º 5
0
 public function syn_to_weibo()
 {
     set_time_limit(0);
     $topic_id = intval($_REQUEST['topic_id']);
     $user_id = intval($GLOBALS['user_info']['id']);
     $api_class_name = addslashes(htmlspecialchars(trim($_REQUEST['class_name'])));
     es_session::close();
     $topic = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic where id = " . $topic_id);
     if ($topic['topic_group'] != "share") {
         $group = $topic['topic_group'];
         if (file_exists(APP_ROOT_PATH . "system/fetch_topic/" . $group . "_fetch_topic.php")) {
             require_once APP_ROOT_PATH . "system/fetch_topic/" . $group . "_fetch_topic.php";
             $class_name = $group . "_fetch_topic";
             if (class_exists($class_name)) {
                 $fetch_obj = new $class_name();
                 $data = $fetch_obj->decode_weibo($topic);
             }
         }
     } else {
         $data['content'] = $topic['content'];
         //图片
         $topic_image = $GLOBALS['db']->getRow("select o_path from " . DB_PREFIX . "topic_image where topic_id = " . $topic['id']);
         if ($topic_image) {
             $data['img'] = SITE_DOMAIN . APP_ROOT . "/" . $topic_image['o_path'];
         }
     }
     $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id);
     $api = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "api_login where is_weibo = 1 and class_name = '" . $api_class_name . "'");
     if ($user_info["is_syn_" . strtolower($api['class_name'])] == 1) {
         //发送本微博
         require_once APP_ROOT_PATH . "system/api_login/" . $api_class_name . "_api.php";
         $api_class = $api_class_name . "_api";
         $api_obj = new $api_class($api);
         $api_obj->send_message($data);
     }
 }
 public function clear_all()
 {
     set_time_limit(0);
     es_session::close();
     $this->clear_admin_file();
     $this->clear_parse_file_fun();
     $this->clear_data_file();
     $this->clear_image_file_fun();
     $this->updateRegionJS();
     header("Content-Type:text/html; charset=utf-8");
     exit("<div style='line-height:50px; text-align:center; color:#f30;'>" . L('CLEAR_SUCCESS') . "</div><div style='text-align:center;'><input type='button' onclick='\$.weeboxs.close();' class='button' value='关闭' /></div>");
 }
Exemplo n.º 7
0
 public function clear_image()
 {
     set_time_limit(0);
     es_session::close();
     $path = APP_ROOT_PATH . "public/attachment/";
     $this->clear_image_file($path);
     $path = APP_ROOT_PATH . "public/images/";
     $this->clear_image_file($path);
     $path = APP_ROOT_PATH . "public/comment/";
     $this->clear_image_file($path);
     $qrcode_path = APP_ROOT_PATH . "public/images/qrcode/";
     $this->clear_qrcode($qrcode_path);
     $GLOBALS['db']->query("update " . DB_PREFIX . "topic set is_cached = 0");
     $GLOBALS['db']->query("update " . DB_PREFIX . "supplier_location set dp_group_point = '',tuan_youhui_cache = ''");
     $GLOBALS['db']->query("update " . DB_PREFIX . "msg_box set data = ''");
     $GLOBALS['cache']->clear();
     clear_dir_file(APP_ROOT_PATH . "public/runtime/admin/");
     clear_dir_file(APP_ROOT_PATH . "public/runtime/app/");
     clear_dir_file(APP_ROOT_PATH . "public/runtime/data/");
     clear_dir_file(APP_ROOT_PATH . "public/runtime/iwap/");
     clear_dir_file(APP_ROOT_PATH . "public/runtime/wap/");
     clear_dir_file(APP_ROOT_PATH . "public/runtime/statics/");
     header("Content-Type:text/html; charset=utf-8");
     exit("<div style='line-height:50px; text-align:center; color:#f30;'>" . L('CLEAR_SUCCESS') . "</div><div style='text-align:center;'><input type='button' onclick='\$.weeboxs.close();' class='button' value='关闭' /></div>");
 }
Exemplo n.º 8
0
/**
 * 同步发微博
 * @param unknown $topic_id
 * @param unknown $class_name 首字母大写如: Sina ,Qqv2 ,Tencent
 */
function syn_to_weibo($topic_id, $api_class_name)
{
    $user_info = $GLOBALS['user_info'];
    set_time_limit(0);
    $user_id = $user_info['id'];
    es_session::close();
    $topic = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic where id = " . $topic_id);
    if ($topic['topic_group'] != "share") {
        $group = $topic['topic_group'];
        if (file_exists(APP_ROOT_PATH . "system/fetch_topic/" . $group . "_fetch_topic.php")) {
            require_once APP_ROOT_PATH . "system/fetch_topic/" . $group . "_fetch_topic.php";
            $class_name = $group . "_fetch_topic";
            if (class_exists($class_name)) {
                $fetch_obj = new $class_name();
                $data = $fetch_obj->decode_weibo($topic);
            }
        }
    } else {
        $data['content'] = msubstr($topic['content'], 0, 140);
        //图片
        $topic_image = $GLOBALS['db']->getRow("select o_path from " . DB_PREFIX . "topic_image where topic_id = " . $topic['id']);
        if ($topic_image) {
            $data['img'] = APP_ROOT_PATH . $topic_image['o_path'];
        }
    }
    $api = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "api_login where is_weibo = 1 and class_name = '" . $api_class_name . "'");
    if ($user_info["is_syn_" . strtolower($api['class_name'])] == 1) {
        //发送本微博
        require_once APP_ROOT_PATH . "system/api_login/" . $api_class_name . "_api.php";
        $api_class = $api_class_name . "_api";
        $api_obj = new $api_class($api);
        $api_obj->send_message($data);
    }
}