コード例 #1
0
ファイル: import_db.php プロジェクト: noikiy/zays
<?php
require 'db_import.class.php';
session_start();
set_time_limit(0);
header("content-type:text/html;charset=utf-8");

if (isset($_REQUEST['submit'])){
	//记录时间
	if (!isset($_SESSION['exec_time']))$_SESSION['exec_time'] = time();
	$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; 
	if (isset($_REQUEST['xml_file'])) $_SESSION['xmlfile'] = serialize($_REQUEST['xml_file']);
	$xml = isset($_REQUEST['xml_file']) ? $_REQUEST['xml_file'] : unserialize($_SESSION['xmlfile']);
	foreach ($xml as $x){
		if (isset($_REQUEST['curr_file']) && ($x != $_REQUEST['curr_file'])) continue;
		//$x = $_REQUEST['curr_file'];
		$i = isset($_REQUEST['i']) ? $_REQUEST['i'] : 1;
		if (!fopen($x,'r'))exit('文件不可读');
		
		$import = new db_import($x,$start,$i);
		$import->shellMain();
	}
	
}





		
//
コード例 #2
0
    require_once dirname(dirname(__FILE__)) . '/web/CMS/siteinfo.php';
    $site = new siteinfo();
}
if (!isset($connection)) {
    $connection = $site->connect_to_db();
}
$randomkey_name = 'randomkey_user';
$viewerid = intval(getUserID());
if ($viewerid < 1) {
    echo '<p class="first_p">You need to be logged in to update the old bbcode entries.</p>';
    $site->dieAndEndPage();
}
if (!isset($_SESSION['IsAdmin']) || !$_SESSION['IsAdmin']) {
    $site->dieAndEndPage('User with id ' . sqlSafeStringQuotes($viewerid) . ' tried to run the bbcode library updater script without permissions.');
}
$db_from = new db_import();
$db_to_be_imported = $db_from->db_import_name();
// this script will update all entries in the database that are including any fields that could be created by using a bbcode library
// it does not detect if the old entries were created by using raw (X)HTML, instead it will just output these entries using the bbcode lib
// the strong recommendation is to always use a bbcode library
// players
function update_players()
{
    global $site;
    global $connection;
    $query = 'SELECT `id`, `raw_user_comment`, `raw_admin_comments` from `players_profile`';
    if (!($result = @$site->execute_query('players_profile', $query, $connection))) {
        // query was bad, error message was already given in $site->execute_query(...)
        $site->dieAndEndPage('');
    }
    while ($row = mysql_fetch_array($result)) {
コード例 #3
0
ファイル: create_sql.php プロジェクト: noikiy/zays
<?php
require 'db_import.class.php';
session_start();
set_time_limit(0);
header("content-type:text/html;charset=utf-8");

//if (isset($_REQUEST['submit'])){
	//记录时间
	$start = isset($argv[1]) ? $argv[1] : exit('start is no define');
	$curr_file = isset($argv[2]) ? $argv[2] : exit('curr_file is no define'); 
	$i = isset($argv[3]) ? $argv[3] : exit('i is no define');
	if (!fopen($curr_file,'r')) exit($curr_file . '文件不可读');
		
	$import = new db_import($curr_file,$start,$i);
	$import->insertMain();
	
//}





		
//