示例#1
0
        }
        if (file_exists($tpldir . 'error.tpl')) {
            $filename = 'error.tpl';
            $tpl->display($tpldir . $filename);
        } else {
            echo "<html><head><title>{$page_error}</title></head><body><h1>{$page_error}</h1></body></html>";
        }
        exit;
    }
}
// *****************************************************************************
// Work out sql query for current image
if (!isset($_GET['image'])) {
    $query = "SELECT * FROM {$db_prefix}entry ORDER BY date desc LIMIT 1";
} else {
    $query = "SELECT * FROM {$db_prefix}entry WHERE ID='" . CleanInput($_GET['image']) . "'";
}
$current_image_array = GetImageFromQuery($query);
if (count($current_image_array) < 1) {
    // redirect to admin login
    //Redirect("admin/index.php");
    exit;
}
$current_image = $current_image_array[0];
SetImage($tpl, $current_image, 'image');
$tpl->set('c_image_tag', '<img src="' . $current_image['url'] . '" width="' . $current_image['width'] . '" height="' . $current_image['height'] . '" />');
$tpl->set('c_image_permalink', '<a href="' . $current_image['permalink'] . '">Permalink</a>');
if ($current_image != null) {
    // Look up previous and next
    $query = "SELECT * FROM {$db_prefix}entry WHERE date<'" . $current_image['date'] . "' ORDER BY date desc LIMIT 1";
    $previous_image = GetImageFromQuery($query);
示例#2
0
<?php

$firstname = $lastname = $email = $password = $confpass = $errormsg = "";
$passerrormsg = $regusererrormsg = $regsuccessmsg = "";
$fieldspassed = TRUE;
$errorcount = 0;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST["firstname"])) {
        $errorcount++;
    } else {
        $firstname = CleanInput($_POST["firstname"]);
    }
    if (empty($_POST["lastname"])) {
        $errorcount++;
    } else {
        $lastname = CleanInput($_POST["lastname"]);
    }
    if (empty($_POST["email"])) {
        $errorcount++;
    } else {
        $email = $_POST["email"];
    }
    if (empty($_POST["password"])) {
        $errorcount++;
    } else {
        $password = $_POST["password"];
    }
    if (empty($_POST["confpass"])) {
        $errorcount++;
    } else {
        $confpass = $_POST["confpass"];