function callback_init() { $Path = EMLOG_ROOT . "/content/plugins/download/"; $InstallFile = $Path . 'install.php'; if (is_file($InstallFile) === true) { include_once $InstallFile; $Check = DownloadMe_Install_Check(); if ($Check === true) { #"安装成功!"; @rename($InstallFile, $InstallFile . '.Download'); if (is_file($Path . DOWNLOAD_CACHE_NAME . "_Inc.php") === true) { @rename($Path . DOWNLOAD_CACHE_NAME . "_Inc.php", EMLOG_ROOT . "/content/cache/" . DOWNLOAD_CACHE_NAME . "_Inc.php"); } if (is_file($Path . DOWNLOAD_CACHE_NAME . "_Gip.php") === true) { @rename($Path . DOWNLOAD_CACHE_NAME . "_Gip.php", EMLOG_ROOT . "/content/cache/" . DOWNLOAD_CACHE_NAME . "_Gip.php"); } if (is_file($Path . "Version.php") === true) { @unlink($Path . "Version.php"); } } } elseif (is_file($InstallFile . '.Download') === true) { @rename($InstallFile . '.Download', $InstallFile); callback_init(); } else { emMsg('安装文件 ( /content/plugins/download/install.php ) 缺失,请重新下载插件安装包'); } DownloadMe_Up(); # 写入缓存 }
function DownloadMe_NewUp($Gid, $Da = false) { $DB = MySql::getInstance(); $DownData = DownloadMe_Ret(); $Data = $DownData['File'][$Gid]; if (!empty($Data)) { $Aid = $Data['aid']; $Lid = $Data['blogid']; $Edit = unserialize($Data['download']); $Edit['statis'] = intval($Edit['statis']) + 1; $editIF = $DB->query("UPDATE " . DB_PREFIX . "attachment SET download='" . serialize($Edit) . "' WHERE aid={$Aid} AND blogid={$Lid}"); DownloadMe_Up(); if ($Da === false) { return true; } global $CACHE; $Da[$Gid][] = getIp() . '#' . time(); $CACHE->cacheWrite(serialize($Da), DOWNLOAD_CACHE_NAME . "_Gip"); } return false; }
return null; } else { return null; } } $Gid = DownloadMe_rEdit($expGid[0], false); $Data = $DownData['File'][$Gid]; $Aid = $Data['aid']; $Lid = $Data['blogid']; $Return = array('error' => "远程获取失败!"); $addSize = getFileSize($Data['filepath']); if ($addSize) { $editIF = $DB->query("UPDATE " . DB_PREFIX . "attachment SET filesize='{$addSize}' WHERE aid={$Aid} AND blogid={$Lid}"); $Return = array('error' => "数据更新失败"); if ($editIF) { DownloadMe_Up(); $Return = array('succ' => "数据修改成功", 'data' => changeFileSize($addSize)); } } } } $DMsg = json_encode(array_unique($Return)); echo $downJsonRet . '(' . $DMsg, ')'; exit; } if (isset($_GET['plugin']) && addslashes($_GET['plugin']) == "download") { function DownloadMe_AppCss() { $Stat_Version_Install = true; echo ' <link href="../content/plugins/download/style/main.css" rel="stylesheet" type="text/css" />