예제 #1
0
파일: update.php 프로젝트: jechiy/ChenBBS
    $ym = explodes('<link>', '</link>', $ym);
    return $ym;
}
//获取更新内容
function newcontent($url)
{
    $ym = file_get_contents($url);
    $ym = explodes('<content>', '</content>', $ym);
    return $ym;
}
$xxdz = $_SERVER['PHP_SELF'];
$act = isset($_GET['act']) ? htmlspecialchars($_GET['act']) : '';
switch ($act) {
    default:
        $newv = newversion($url);
        $newlink = newlink($url);
        $newcontent = newcontent($url);
        if ($v === $newv) {
            echo '程序是最新版本!';
        } else {
            echo '发现新版本!<br>版本号:' . $newv . '<br>';
            echo '更新内容:<br>' . $newcontent . '<br>';
            echo '<a href="?act=update&url=' . $newlink . '">点击更新</a>';
        }
        break;
    case 'update':
        $RemoteFile = rawurldecode($_GET["url"]);
        $ZipFile = "Archive.zip";
        $Dir = "./";
        copy($RemoteFile, $ZipFile) or die("无法下载更新包文件!" . '<a href="' . $xxdz . '">返回上级</a>');
        if (zipExtract($ZipFile, $Dir)) {
예제 #2
0
     break;
     //mod
 //mod
 case "movedown":
     movelink('down');
     break;
 case "moveup":
     movelink('up');
     break;
 case "fixsequence":
     fixsequence();
     break;
     //add link
 //add link
 case "newlink":
     newlink();
     break;
 case "inslink":
     inslink();
     break;
     //mod link
 //mod link
 case "modlink":
     modlink();
     break;
 case "uplink":
     uplink();
     break;
     //del link
 //del link
 case "dellink":