Ejemplo n.º 1
0
/**
 * Upgrade the version table to 1.5beta
 *
 */
function UpgradeTo15beta($prefix, $newversion)
{
    global $lang_created, $lang_updated, $lang_create_update_to, $lang_create_addons;
    $create_status[null] = null;
    if (!is_field_exists('moderate_comments', 'config')) {
        // add moterate_comments field to config table
        mysql_query("ALTER TABLE `{$prefix}config` ADD `moderate_comments` VARCHAR(3) DEFAULT 'no' NOT NULL ") or die("MySQL Error: " . mysql_error());
        // add publish field to comments table
        mysql_query("ALTER TABLE {$prefix}comments ADD `publish` VARCHAR(3) DEFAULT 'yes' NOT NULL") or die("MySQL Error: " . mysql_error());
    }
    // Create addons table if necessary
    if (!is_table_created('addons')) {
        mysql_query("CREATE TABLE `{$prefix}addons` (\n\t\t\t\t\t `id` INT(11) NOT NULL auto_increment,\n\t\t\t\t\t `addon_name` VARCHAR(66) NOT NULL DEFAULT '',\t\t\n\t\t\t\t\t `status` VARCHAR(3) NOT NULL DEFAULT 'on',\t\t\n\t\t\t\t\t `type` VARCHAR(15) NOT NULL DEFAULT 'normal',\n\t\t\t\t\t PRIMARY KEY (`id`))") or die("MySQL Error: " . mysql_error());
        refresh_addons_table('../addons/');
        $create_status[$lang_create_addons] = $lang_created;
    }
    if (!is_field_exists('timestamp', 'config')) {
        // Timestamp
        mysql_query("ALTER TABLE `{$prefix}config` ADD `timestamp` VARCHAR(4) DEFAULT 'yes' NOT NULL") or die("MySQL Error: " . mysql_error());
    }
    if (!is_field_exists('visitorbooking', 'config')) {
        // Visitor booking ON/OFF switch
        mysql_query("ALTER TABLE `{$prefix}config` ADD `visitorbooking` VARCHAR(4) DEFAULT 'yes' NOT NULL") or die("MySQL Error: " . mysql_error());
        // Update version
        mysql_query("INSERT INTO `{$prefix}version` (`version`) VALUES (" . $newversion . ")") or die("MySQL Error: " . mysql_error());
        $create_status[$lang_create_update_to . " " . $newversion . " β"] = $lang_updated;
    }
    return $create_status;
}
    $upload_dir = $cfgrow['imagepath'];
} else {
    die_logout('ERROR: Can\'t load config');
}
/**
 * Make the script believe we are actually logged in into the adminpanel
 */
$_POST['user'] = $cfgrow['admin'];
$_SESSION["pixelpost_admin"] = $cfgrow['password'];
$_GET["_SESSION"]["pixelpost_admin"] = '';
$_POST["_SESSION"]["pixelpost_admin"] = '';
$login = "******";
/**
 * Start enabling the addons for the adminpanel
 */
refresh_addons_table("../addons/");
$addon_admin_functions = array(0 => array('function_name' => '', 'workspace' => '', 'menu_name' => '', 'submenu_name' => ''));
create_admin_addon_array();
if (!isset($_SESSION["pixelpost_admin"]) || $cfgrow['password'] != $_SESSION["pixelpost_admin"] || $_GET["_SESSION"]["pixelpost_admin"] == $_SESSION["pixelpost_admin"] || $_POST["_SESSION"]["pixelpost_admin"] == $_SESSION["pixelpost_admin"] || $_COOKIE["_SESSION"]["pixelpost_admin"] == $_SESSION["pixelpost_admin"]) {
    die_logout("ERROR: Automatic login has failed");
}
/**
 * Start saving a new post
 */
$headline = clean($_POST['headline']);
$body = clean($_POST['body']);
//----------------------------------------------------------------------------------------------------------------------------------------
// Lightroom only supports one headline in one language... what to do with the ALT_language? Perhaps an option to fill it with the same data
// as the standard set?
if (isset($_POST['alt_headline'])) {
    //Obviously we would like to use the alternative language
Ejemplo n.º 3
0
}
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
setcookie("lastvisit", "expires in 60 minutes", time() + 60 * 60);
// save user info if requested
if (isset($_POST['vcookie'])) {
    $vcookiename = clean($_POST['name']);
    $vcookieurl = clean($_POST['url']);
    $vcookieemail = clean($_POST['email']);
 $_GET["_SESSION"]["pixelpost_admin"] = '';
 $_POST["_SESSION"]["pixelpost_admin"] = '';
 if (!isset($_SESSION["pixelpost_admin"])) {
     // cookie is not set, send them to a form
     $login = "******";
 } else {
     // cookie exists, check for validity
     if ($cfgrow['password'] != $_SESSION["pixelpost_admin"]) {
         $login = "******";
     }
 }
 /************************ END OF LOGIN STUFF ************************/
 //------------- addons in admin panel begins
 // refresh the addons table
 $dir = "../addons/";
 refresh_addons_table($dir);
 $addon_admin_functions = array(0 => array('function_name' => '', 'workspace' => '', 'menu_name' => '', 'submenu_name' => ''));
 create_admin_addon_array();
 if ($cfgrow['crop'] == "12c" && isset($_SESSION["pixelpost_admin"])) {
     require "../includes/12cropimageinc.php";
 }
 eval_addon_admin_workspace_menu('admin_html_head');
 eval_addon_admin_workspace_menu('admin_main_menu');
 if (!isset($_SESSION["pixelpost_admin"]) || $cfgrow['password'] != $_SESSION["pixelpost_admin"] || $_GET["_SESSION"]["pixelpost_admin"] == $_SESSION["pixelpost_admin"] || $_POST["_SESSION"]["pixelpost_admin"] == $_SESSION["pixelpost_admin"] || $_COOKIE["_SESSION"]["pixelpost_admin"] == $_SESSION["pixelpost_admin"]) {
     die("Try another day!!");
 }
 $show_image_after_upload = true;
 // For default behavior this is set to 'True' you can change this to false in your addons in the new image page
 // save new post
 if ($_GET['x'] == "save") {
     $headline = clean($_POST['headline']);