コード例 #1
0
ファイル: index.php プロジェクト: RoseySoft/pixelpost
 */
define('PHP_SELF', 'index.php');
define('ADDON_DIR', 'addons/');
define('ADMIN_DIR', 'admin/');
if (file_exists("includes/pixelpost.php")) {
    require_once "includes/pixelpost.php";
}
start_mysql('includes/pixelpost.php', 'front');
/**
 * Load the $cfgrow configuration variable and set the upload directory
 *
 */
if ($cfgrow = sql_array("SELECT * FROM `" . $pixelpost_db_prefix . "config`")) {
    //$upload_dir = $cfgrow['imagepath'];
} else {
    show_splash('Coming Soon. Not Installed Yet. Cause #1', 'templates');
}
/**
 * Begin frontpage addons
 *
 */
refresh_addons_table(ADDON_DIR);
$addon_front_functions = array(0 => array('function_name' => '', 'workspace' => '', 'menu_name' => '', 'submenu_name' => ''));
$addon_admin_functions = array(0 => array('function_name' => '', 'workspace' => '', 'menu_name' => '', 'submenu_name' => ''));
create_front_addon_array();
session_start();
// Initialize the workspace
eval_addon_front_workspace('frontpage_init');
// Fix proposed by tomyeah on the forum
header('Content-Type: text/html; charset=utf-8');
// Set a cookie for the visitor counter, re-count a person after 60 mins
コード例 #2
0
ファイル: functions.php プロジェクト: RoseySoft/pixelpost
/**
 * Start the database connection
 *
 */
function start_mysql($config_file = 'includes/pixelpost.php', $request_uri = 'front')
{
    global $pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass, $pixelpost_db_pixelpost;
    $dir = 'templates';
    if (!file_exists($dir . "/splash_page.html")) {
        $dir = '../templates';
    }
    if (!file_exists($config_file)) {
        show_splash("Connect DB Error: " . mysql_error() . " Cause #1", $dir);
    }
    if (!mysql_connect($pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass)) {
        if ($request_uri == 'admin') {
            header("Location: install.php?view=db_fix");
            exit;
        } else {
            show_splash("Connect DB Error: " . mysql_error() . " Cause #2", $dir);
        }
    }
    if (!mysql_select_db($pixelpost_db_pixelpost)) {
        if ($request_uri == 'admin') {
            header("Location: install.php?view=db_fix");
            exit;
        } else {
            show_splash("Select DB Error: " . mysql_error() . " Cause #2", $dir);
        }
    }
}