$check_update = false; } } else { $check_update = true; } //需要更新 if ($check_update) { //输入update.php运行 if (preg_match("/update.php/is", $_SERVER['PHP_SELF'])) { include_once "include/config.php"; include_once "include/db.php"; include_once "include/cache.php"; //连接mysql $DMC = new F2MysqlClass($DBHost, $DBUser, $DBPass, $DBName, $DBNewlink); $SQL = "select `settValue` from `{$DBPrefix}setting` where `settName`='closeReason' limit 0,1"; list($strCloseReason) = $DMC->fetchArray($DMC->query($SQL), MYSQL_NUM); $SQL = "update `{$DBPrefix}setting` set `settValue`='blog is update system now,plesase wait..' where `settName`='closeReason' "; $DMC->query($SQL); $SQL = "update `{$DBPrefix}setting` set `settValue`='1' where `settName`='status' "; $DMC->query($SQL); echo "Start update F2Cont, please wait ... <hr>"; update_data(true, $DMC); echo "<hr>\n"; echo "Update Success. please delete this update.php <br />\n"; echo "<a href=index.php>Return Homepage</a>"; $SQL = "update `{$DBPrefix}setting` set `settValue`='" . $strCloseReason . "' where `settName`='closeReason'"; $DMC->query($SQL); $SQL = "update `{$DBPrefix}setting` set `settValue`='0' where `settName`='status'"; $DMC->query($SQL); } else { //是在common.php中检测运行
<?php @error_reporting(E_ERROR | E_WARNING | E_PARSE); include_once "../../include/config.php"; include_once "../../include/db.php"; $count = $_POST['count']; // Á¬½áÊý¾Ý¿â $DMF = new F2MysqlClass($DBHost, $DBUser, $DBPass, $DBName, $DBNewlink); //$count=7; $sql = "select visitDate,visits from " . $DBPrefix . "dailystatistics order by visitDate desc limit {$count}"; $result = $DMF->query($sql); $i = $count; while ($data = $DMF->fetchArray($result)) { echo "&count{$i}=" . $data[visits]; echo "&date{$i}=" . str_replace("-", "", $data[visitDate]); echo $i--; } for ($j = $i; $j > 0; $j--) { echo "&count{$j}=0"; echo "&date{$j}=" . date("Ymd", time() - ($i - $j + 1) * 86400); echo $j; }