Beispiel #1
0
/**
 * 快递模块
 * 
 * @access public
 * @param string $str
 * @return string
 */
function is_express($str)
{
    if (is_numeric($str)) {
        $postid = strlen($str);
        switch ($postid) {
            case 10:
                $type = "yuantong";
                break;
            case 12:
                $type = "shunfeng";
                break;
            case 13:
                $type = "yunda";
                break;
        }
        if (isset($type)) {
            $data = obj_to_array(json_decode(express($type, $str)));
            return get_express_data($data);
        }
    }
}
/**
 * 显示页面
 * @param string $cache_file 缓存路径
 * @param bool $is_session 是否更新session
 * @param bool $is_return 是否返回页面内容
 * @return mixed
 */
function display($cache_file, $is_session = true, $is_return = false)
{
    global $_FANWE;
    $content = NULL;
    if (!empty($cache_file) && !file_exists($cache_file) && diskfreespace(PUBLIC_ROOT . './data/tpl/caches') > 1000000) {
        if (makeDir(preg_replace("/^(.*)\\/.*?\\.htm\$/is", "\\1", $cache_file))) {
            $css_script_php = '';
            if (isset($_FANWE['page_parses'])) {
                $css_script_php = "<?php\n" . '$_FANWE[\'CACHE_CSS_SCRIPT_PHP\']' . " = " . var_export($_FANWE['page_parses'], true) . ";\n?>";
            }
            $content = ob_get_contents();
            express($content);
            writeFile($cache_file, $css_script_php . $content);
        }
    }
    require_once fimport('dynamic/common');
    $module_dynamic = '';
    if (defined('MODULE_NAME') && MODULE_NAME != '') {
        $module_dynamic = fimport('dynamic/' . MODULE_NAME);
    }
    if (!empty($module_dynamic) && file_exists($module_dynamic)) {
        require_once $module_dynamic;
    }
    if ($content === NULL) {
        $content = ob_get_contents();
        express($content);
    }
    ob_end_clean();
    $content = preg_replace('/<!--dynamic\\s+(.+?)(?:|\\sargs=(.*?))-->/ies', "\\1('\\2');", $content);
    if (isset($_FANWE['CACHE_CSS_SCRIPT_PHP'])) {
        if (isset($_FANWE['CACHE_CSS_SCRIPT_PHP']['css'])) {
            foreach ($_FANWE['CACHE_CSS_SCRIPT_PHP']['css'] as $url) {
                cssParse($url);
            }
        }
        if (isset($_FANWE['CACHE_CSS_SCRIPT_PHP']['script'])) {
            foreach ($_FANWE['CACHE_CSS_SCRIPT_PHP']['script'] as $url) {
                scriptParse($url);
            }
        }
    }
    //格式化会员关注
    formatUserFollowTags($content);
    contentParse($content);
    if ($is_session) {
        updateSession();
    }
    if ($is_return) {
        return $content;
    }
    $_FANWE['gzip_compress'] ? ob_start('ob_gzhandler') : ob_start();
    echo $content;
}
Beispiel #3
0
<?php

$mlid = intval($_FANWE['request']['lid']);
$message = trim($_FANWE['request']['message']);
if (empty($mlid) || empty($message)) {
    exit;
}
$message = cutStr($message, 200);
$result['status'] = FS('Message')->replyMsg($mlid, $_FANWE['uid'], $_FANWE['user_name'], $message);
if ($result['status'] > 0) {
    $result['time'] = getBeforeTimelag(TIME_UTC);
    express($message);
    $result['message'] = nl2br($message);
}
outputJson($result);
     break;
 case 'radio90':
     echo "teraz: " . radio90() . "\r\n";
     break;
 case 'akedra':
     foreach (akadera() as $key => $info) {
         echo $key . ": " . $info . "\r\n";
     }
     break;
 case 'bielsko':
     foreach (bielsko() as $key => $info) {
         echo $key . ": " . $info . "\r\n";
     }
     break;
 case 'express':
     echo "teraz: " . express() . "\r\n";
     break;
 case 'famakielce':
     foreach (FaMaKielce() as $key => $info) {
         echo $key . ": " . $info . "\r\n";
     }
     break;
 case 'famatomaszow':
     foreach (FaMaTomaszow() as $key => $info) {
         echo $key . ": " . $info . "\r\n";
     }
     break;
 case 'plus':
     echo "teraz: " . plus() . "\r\n";
     break;
 case 'plusfm':