示例#1
0
文件: config.php 项目: LockGit/emlog
function DownloadMe_Ret($Inc = false)
{
    if ($Inc == "SQL") {
        return DownloadMe_Up($Inc);
    } elseif ($Inc === false) {
        $cachefile = EMLOG_ROOT . "/content/cache/" . DOWNLOAD_CACHE_NAME . ".php";
        # 缓存不存在自动更新生成缓存
        if (!is_file($cachefile) || @filesize($cachefile) <= 0 || DownloadMe_Radio() === true) {
            DownloadMe_Up();
        }
    } else {
        $cachefile = EMLOG_ROOT . "/content/cache/" . DOWNLOAD_CACHE_NAME . "_" . $Inc . ".php";
    }
    # 打开缓存
    if ($fp = @fopen($cachefile, 'rb')) {
        $Data = @fread($fp, @filesize($cachefile));
        @fclose($fp);
        $Data = unserialize(str_replace("<?php exit;//", '', $Data));
        return $Data;
    }
    return false;
}
示例#2
0
Author URL: http://www.2baby.me
*/
!defined('EMLOG_ROOT') && exit('access deined!');
require_once EMLOG_ROOT . "/content/plugins/download/config.php";
# 如果存在附件操作则自动更新附件缓存
if (isset($_GET['action'])) {
    $actionPost = addslashes($_GET['action']);
    if ($actionPost == 'del_attach' || $actionPost == 'upload' || $actionPost == 'upload_multi') {
        DownloadMe_Up();
    }
}
# 前台下载反映
if (isset($_GET['downloadMe'])) {
    $Gid = addslashes($_GET['downloadMe']);
    session_start();
    DownloadMe_Radio();
    $ifQuery = DownloadMe_DownLog($Gid);
    $DownData = DownloadMe_Ret();
    $DownInc = DownloadMe_Ret("Inc");
    $Data = $DownData['File'][$Gid];
    $Set = $Data['download'] ? unserialize($Data['download']) : array("statis" => 0, "hide" => false, "web" => false);
    $Path = EMLOG_ROOT . str_replace(array('..', 'thum-'), array(''), $Data['filepath']);
    if ($DownInc["rob"] == true && empty($_SESSION['DownloadMe'])) {
        $Echo_data = 'rob';
        $Url = BLOG_URL . "?post=" . $Data['blogid'];
        include_once EMLOG_ROOT . "/content/plugins/download/download_echo.php";
        exit;
    } else {
        if ($DownInc["key"] == true) {
            if (!isset($_POST['download_key']) || strcasecmp($_SESSION['code'], $_POST['download_key']) != 0) {
                $Echo_data = 'key';