コード例 #1
0
<?php

require_once './includes/dbcon.php';
require_once './includes/Images/Images.php';
$status = false;
$dbImages = new Images($conn);
$list = $dbImages->imageList();
for ($i = count($list) - 1; $i >= 0; $i--) {
    if ($dbImages->getImage($list[$i][0])[7] == 1) {
        echo "<article>\n            <p>" . htmlspecialchars($list[$i][2]) . "</p>\n            <figure class='img'>\n                <a href='browse.php?img={$list[$i][0]}'><img src='./img/thumbs/thumb_{$list[$i][1]}'></a>\n            </figure>\n            <div class='fadeout'></div>\n        </article>\n        ";
    }
}
コード例 #2
0
            $_SESSION['upload'] = $loader->getNameList();
        }
        header("Location: review.php");
        die;
    }
}
if (isset($validUpdate)) {
    $dbUsers = new Users($conn);
    $dbUsers->updateUser($_SESSION['userID'], $_SESSION['first_name'], $_SESSION['last_name'], $email, $username, $password);
    $_SESSION['username'] = $username;
    $_SESSION['user_email'] = $email;
}
//Gets all images user can delete.
//Replace with database
$dbImages = new Images($conn);
$filenames = $dbImages->imageList($_SESSION['userID']);
if (isset($_POST['delete'])) {
    //delete Code (rember to check if user has permission to delete image)
}
include './includes/title.php';
?>
<!DOCTYPE html>
<?php 
require "./includes/head.php";
?>
<body>
    <?php 
include "./includes/header.php";
?>
    <?php 
include "./includes/menu.php";
コード例 #3
0
<?php

$currentPage = basename($_SERVER['SCRIPT_FILENAME']);
require_once './includes/dbcon.php';
require_once './includes/Images/Images.php';
$dbImages = new Images($conn);
if (count($dbImages->imageList()) > 0) {
    $latestImage = array_reverse($dbImages->imageList())[0][0];
} else {
    $latestImage = 0;
}
?>

<nav>
	<ul>
		<li <?php 
if ($currentPage == "index.php") {
    echo "class=\"current\"";
}
?>
>
			<a href="index.php">Heim</a>
		</li>
		<li <?php 
if ($currentPage == "ummig.php") {
    echo "class=\"current\"";
}
?>
>
			<a href="ummig.php">Um mig</a>
		</li>