include_once("include/auth.php"); $page = "photo"; // Remembers users last archive view // $returnLink = ""; if(isset($_SESSION["SortBy"]) && $_SESSION["SortBy"] != "") $returnLink .= "SortBy=" . $_SESSION["SortBy"] . "&"; if(isset($_SESSION["Offset"]) && $_SESSION["Offset"] != "") $returnLink .= "Offset=" . $_SESSION["Offset"] . "&"; if(isset($_SESSION["Author"]) && $_SESSION["Author"] != "") $returnLink .= "Author=" . $_SESSION["Author"] . "&"; if(isset($_SESSION["Key"]) && $_SESSION["Key"] != "") $returnLink .= "Key=" . $_SESSION["Key"] . "&"; if(strlen($returnLink) > 0) //(substr($returnLink, (strlen($returnLink) - 1), 1) == "&") { $returnLink = substr($returnLink, 0, (strlen($returnLink) - 1)); $returnLink = "archive.php?" . $returnLink; } else { $returnLink = "archive.php"; } // --------------------------------- // if(isset($_REQUEST["ImageID"]) && is_numeric($_REQUEST["ImageID"])) // Is ImageID not blank and numeric? { if(isset($_POST["Hist"]) && $_POST["Hist"]) { $histcount = $_POST["Hist"] + 1; } else { $histcount = 1; } /*if(isset($_POST["ChangeCaption"]) && $_POST["ChangeCaption"] == "True") { if($_POST["Caption"]) { $sql = "UPDATE imagelog SET Caption = '" . $_POST["Caption"] . "', TimeInsert = TimeInsert WHERE ImageID = " . $_POST['ImageID'] . ";"; $db_object->query($sql); } }*/ if(isset($_POST["AddComment"]) && $_POST["AddComment"] == "True") { if($_POST["Comment"]) { $convcomment = str_replace("<", htmlentities("<"), $_POST["Comment"]); // Replace HTML tags $sql = "INSERT INTO comments (ImageID, UserID, Comment) VALUES (" . $_POST['ImageID'] . ", " . $UserID . ", '" . $convcomment ."');"; $db_object->query($sql); $sql = "SELECT COUNT(*) FROM comments WHERE ImageID = " . $_POST['ImageID'] . ";"; $db_object->query($sql); $row = $db_object->fetch_array(); $sql = "UPDATE imagelog SET Num_comments = " . $row[0] . ", TimeInsert = TimeInsert WHERE ImageID = " . $_POST['ImageID'] . ";"; $db_object->query($sql); } } // If user who created image does no longer exist, image will not be displayed, i.e. user will be redirected // to archive.php!!! $sql = "SELECT imagelog.*, user.Screen_name, keys.Key_name FROM imagelog, user, `keys` WHERE imagelog.ImageID = " . $_REQUEST["ImageID"] . " AND imagelog.UserID = user.UserID AND imagelog.KeyID = keys.KeyID AND Screened = 1"; $db_object->query($sql); if( !($row = $db_object->fetch_array()) ) // Does photo with ImageID exist? { echo "1"; //header("Location: archive.php"); // Redirect to archive page exit; } } else { header("Location: archive.php"); // Redirect to archive page exit; } ?> $year = substr($row['TimeInsert'], 0, 4); $month = substr($row['TimeInsert'], 4, 2); $day = substr($row['TimeInsert'], 6, 2); $hour = substr($row['TimeInsert'], 8, 2); $min = substr($row['TimeInsert'], 10, 2); $sec = substr($row['TimeInsert'], 12, 2); include_once("include/header.php"); //include_once("include/msg.php"); ?>
$db_object2 = new db(); // Open db connection if(isset($_SESSION["Author"]) && $_SESSION["Author"] != "") { $sql = "SELECT MAX(ImageID) AS PrevID FROM imagelog WHERE ImageID < " . $row["ImageID"] . " AND Screened = 1 AND UserID = '" . $_SESSION['Author'] . "';"; } else { $sql = "SELECT MAX(ImageID) AS PrevID FROM imagelog WHERE ImageID < " . $row["ImageID"] . " AND Screened = 1;"; } $db_object2->query($sql); $row2 = $db_object2->fetch_array(); if($row2["PrevID"] == "") { ?> } else { ?> } ?> |
/*$db_object2 = new db(); // Open db connection
$sql = "SELECT Key_name FROM `keys` WHERE KeyID = " . $row["KeyID"] . ";";
$db_object2->query($sql);
$row2 = $db_object2->fetch_array();*/
// javascript:history.go(-<*=$histcount*>)
?>
Notice: Undefined variable: row in /var/www/demonstrate.berkeley.edu/html/photo.php on line 160 : Notice: Undefined variable: row in /var/www/demonstrate.berkeley.edu/html/photo.php on line 160 if($row["Suspended"]) { ?> } else { ?> } ?> |
if(isset($_SESSION["Author"]) && $_SESSION["Author"] != "") { $sql = "SELECT MIN(ImageID) AS NextID FROM imagelog WHERE ImageID > " . $row["ImageID"] . " AND Screened = 1 AND UserID = '" . $_SESSION['Author'] . "';"; } else { $sql = "SELECT MIN(ImageID) AS NextID FROM imagelog WHERE ImageID > " . $row["ImageID"] . " AND Screened = 1;"; } $db_object2->query($sql); $row2 = $db_object2->fetch_array(); if($row2["NextID"] == "") { ?> } else { ?> } ?> | |||||||||||||||
|