} else {
        @touch($lock_file);
        echo "<font style='font-size:20px;'>The upgrade is completed</font>.<br>Original short message form (" . UC_DBTABLEPRE . "pms Table) No longer in use, we recommend that you test the function of short message and data is no problem, delete the table.<br>Will advanced/uc_client The file overwrite your uc_client Client.";
    }
    showfooter();
} elseif ($action == 'pmstats') {
    showheader();
    echo "<h4>Processing Other short message data</h4>";
    $db = new ucserver_db();
    $db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCHARSET);
    $total = getgpc('total');
    $start = getgpc('start') ? getgpc('start') : 0;
    $limit = 1000;
    $next = 0;
    if (!$total) {
        $total = $db->result_first("SELECT MAX(plid) FROM " . UC_DBTABLEPRE . "pm_lists");
    }
    if ($total) {
        $query = $db->query("SELECT * FROM " . UC_DBTABLEPRE . "pm_lists WHERE plid>'{$start}' ORDER BY plid LIMIT {$limit}");
        while ($data = $db->fetch_array($query)) {
            $next = $data['plid'];
            $users = explode('_', $data['min_max']);
            $pmsarr = $db->fetch_first("SELECT * FROM " . UC_DBTABLEPRE . "pms WHERE msgfromid IN ('{$users['0']}','{$users['1']}') AND msgtoid IN ('{$users['0']}', '{$users['1']}') ORDER BY dateline DESC LIMIT 1");
            $pmsarr['msgfrom'] = addslashes($pmsarr['msgfrom']);
            $pmsarr['subject'] = addslashes($pmsarr['subject']);
            $pmsarr['message'] = addslashes($pmsarr['message']);
            if ($pmsarr['subject'] && strcmp($pmsarr['subject'], $pmsarr['message'])) {
                $pmsarr['message'] = $pmsarr['subject'] . "\r\n" . $pmsarr['message'];
            }
            if ($users[0] == $data['authorid']) {
                $touid = $users[1];
Beispiel #2
0
	header("Location: upgrade_1.0.0_1.5.0.php?action=pm&forward=".urlencode($forward));

} elseif($action == 'pm') {

	showheader();

	echo "<h4>处理短消息数据</h4>";

	$db = new ucserver_db();
	$db->connect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCHARSET);

	$total = getgpc('total');
	$start = intval(getgpc('start'));
	$limit = 1000;
	if(!$total) {
		$total = $db->result_first("SELECT COUNT(*) FROM ".UC_DBTABLEPRE."pms WHERE related=0");
	}

	if(!$total || $total <= $start) {
		$db->query("REPLACE INTO ".UC_DBTABLEPRE."settings (k, v) VALUES('version', '1.5.0')");//note 记录数据库版本
		@touch($lock_file);
		if($forward) {
			echo "<br /><br /><br /><a href=\"$forward\">浏览器会自动跳转页面,无需人工干预。除非当您的浏览器长时间没有自动跳转时,请点击这里</a>";
			echo "<script>setTimeout(\"redirect('$forward');\", 1250);</script>";
		} else {
			echo "升级完成。";
		}
	} else {
		$query = $db->query("SELECT * FROM ".UC_DBTABLEPRE."pms WHERE related=0 LIMIT $start, $limit");
		while($data = $db->fetch_array($query)) {
			$data['msgfrom'] = addslashes($data['msgfrom']);