コード例 #1
0
ファイル: index.php プロジェクト: dalinhuang/shopexts
<?php

define('ROOT', dirname(__FILE__));
define('PLUGINSDIR', ROOT . "/plugins");
define('VARDIR', ROOT . "/var");
include ROOT . "/functions.php";
if (!isallowed()) {
    die('您不允许使用该工具');
}
#base on shopex 48
$configfile = ROOT . "/../config/config.php";
if (file_exists($configfile)) {
    define('SHOPEXVER', 48);
    include $configfile;
} else {
    $configfile = ROOT . "/../include/mall_config.php";
    #convert to shopex48 format
    if (file_exists($configfile)) {
        define('SHOPEXVER', 47);
        include $configfile;
        define('DB_USER', $dbUser);
        define('DB_PASSWORD', $dbPass);
        define('DB_NAME', $dbName);
        define('DB_HOST', $dbHost);
        define('DB_PREFIX', $_tbpre);
        define('DB_CHARSET', MYSQL_CHARSET_NAME);
    } else {
        msg("找不到数据库配置文件");
        die;
    }
}
コード例 #2
0
ファイル: programs.php プロジェクト: shanhaiying/OES
				Started on: <span style="color:blue"><?php 
    echo date("l, jS \\of F Y h:i A", strtotime($row[7]));
    ?>
</span>,
				Expired on: <span style="color:blue"><?php 
    echo date("l, jS \\of F Y h:i A", strtotime($row[6]));
    ?>
</span>
			</div>
			<div>
				<a class="viewporg" prgid="<?php 
    echo $prgindx + $row[0];
    ?>
">View Details</a>
				<?php 
    if (isallowed($row[0], $loginfo->getUserId())) {
        ?>
				<a class="taketest" prgid="<?php 
        echo $prgindx + $row[0];
        ?>
">Take Test</a>
				<?php 
    }
    ?>
			</div>
			</p>
		</div>
	<?php 
}
mysql_free_result($res);
?>
コード例 #3
0
/**
 * shows the image in filename depending on servers disabled functions.
 * requires filetype
 *
 * @param string filename  
 */
function myreadfile($filepath, $filetype = "image/gif")
{
    if (isallowed("readfile")) {
        Header("Content-type: {$filetype}");
        @readfile($filepath);
    } else {
        if (isallowed("fpassthru")) {
            $fp = fopen($filepath, 'rb');
            Header("Content-type: {$filetype}");
            Header("Content-Length: " . filesize($filepath));
            fpassthru($fp);
            fclose($fp);
        } else {
            Header("Location: {$filepath}");
        }
    }
}