Exemplo n.º 1
0
    }
    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];
            } else {
                $touid = $users[0];
            }
Exemplo n.º 2
0
require dirname(__FILE__).'/data/config.inc.php';
require dirname(__FILE__).'/lib/db.class.php';

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

$nomatch = true;

$applist = $db->fetch_all("SELECT appid, name FROM ".UC_DBTABLEPRE."applications");
$table_columns = loadtable('notelist');
foreach($applist as $app) {
	$appid = $app['appid'];
	if(empty($appid)) continue;
	if(!isset($table_columns['app'.$appid])) {
		$nomatch = false;
		if($db->query("ALTER TABLE ".UC_DBTABLEPRE."notelist ADD COLUMN app$appid tinyint NOT NULL")) {
			echo "补充notelist表字段成功: $appid <br />";
		} else {
			echo "补充notelist表字段失败,请刷新重试<br />";
		}
		
	}
}

if($nomatch) {
	echo '没有需要补充的字段<br />';
}

if(!unlink(__FILE__)) {
	echo '请立即登陆服务器删除此文件<br />';
}
Exemplo n.º 3
0
        $db->query("UPDATE " . UC_DBTABLEPRE . "applications SET authkey='{$authkey}' WHERE appid='{$appid}'");
    }
    header("Location: upgrade_1.0.0_1.5.0.php?action=pm&forward=" . urlencode($forward));
} elseif ($action == 'pm') {
    showheader();
    echo "<h4>Short message data processing</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 Record database version
        @touch($lock_file);
        if ($forward) {
            echo "<br /><br /><br /><a href=\"{$forward}\">Browser will automatically redirected, without human intervention. Unless a long time when your browser does not support frames, please click here</a>";
            echo "<script>setTimeout(\"redirect('{$forward}');\", 1250);</script>";
        } else {
            echo "The upgrade is completed.";
        }
    } 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']);
            $data['subject'] = addslashes($data['subject']);
            $data['message'] = addslashes($data['message']);
            $db->query("REPLACE INTO " . UC_DBTABLEPRE . "pms SET msgfrom='{$data['msgfrom']}',\r\n\t\t\t\tmsgfromid='{$data['msgfromid']}',msgtoid='{$data['msgtoid']}',folder='{$data['folder']}',new='{$data['new']}',subject='{$data['subject']}',\r\n\t\t\t\tdateline='{$data['dateline']}',message='{$data['message']}',delstatus='{$data['delstatus']}',related='" . time() . "'", 'SILENT');
Exemplo n.º 4
0
	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']);
			$data['subject'] = addslashes($data['subject']);
			$data['message'] = addslashes($data['message']);
			$db->query("REPLACE INTO ".UC_DBTABLEPRE."pms SET msgfrom='$data[msgfrom]',
				msgfromid='$data[msgfromid]',msgtoid='$data[msgtoid]',folder='$data[folder]',new='$data[new]',subject='$data[subject]',
Exemplo n.º 5
0
	showheader();

	echo "<h4>处理短消息其它数据</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];
			} else {
				$touid = $users[0];
			}