Ejemplo n.º 1
0
        $prev_picture = $this_picture;
    }
}
if ($next_picture) {
    $next_picture['url'] = "show_picture.php?picture_id=" . $next_picture['picture_id'];
    $next_picture['picture_url'] = "picture.php?picture_id=" . $next_picture['picture_id'];
    $next_picture['tn_url'] = "picture.php?tn=true&picture_id=" . $next_picture['picture_id'];
}
if ($prev_picture) {
    $prev_picture['url'] = "show_picture.php?picture_id=" . $prev_picture['picture_id'];
    $prev_picture['picture_url'] = "picture.php?picture_id=" . $prev_picture['picture_id'];
    $prev_picture['tn_url'] = "picture.php?tn=true&picture_id=" . $prev_picture['picture_id'];
}
$this_picture['url'] = "show_picture.php?picture_id=" . $picture_id;
$this_picture['picture_url'] = "picture.php?picture_id=" . $picture_id;
$this_picture['tn_url'] = "picture.php?tn=true&picture_id=" . $picture_id;
# Get the list of comments
$comments = get_comments_by_picture_id($picture_id, $db);
$new_comments = array();
while ($current_result = array_shift($comments)) {
    # Get information on the poster
    $current_result['comment_poster'] = get_user_by_user_id($current_result['user_id'], $db);
    array_push($new_comments, $current_result);
}
template_display_picture($me, $user, $category, $picture, $next_picture, $prev_picture, $new_comments, $max_height, $max_width);
?>
	
	
	

Ejemplo n.º 2
0
header('Pragma: no-cache');
require 'shared.php';
$db = get_db_read();
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
if (isset($_GET['category_id']) == false || is_numeric($_GET['category_id']) == false) {
    show_error_redirect_back("No category_id specified");
}
$category_id = $_GET['category_id'];
$category_information = get_category_by_category_id($category_id, $db);
if (!$category_information || !$me && $category_information['private'] != 0) {
    show_error_redirect_back("invalid category_id");
}
$user_information = get_user_by_user_id($category_information['user_id'], $db);
# Check if the category is private
$pictures = get_pictures_by_category_id($category_id, $db);
# Display the table of pictures
$new_pictures = array();
foreach ($pictures as $picture) {
    $picture['url'] = "show_picture.php?picture_id=" . $picture['picture_id'];
    $picture['picture_url'] = "picture.php?picture_id=" . $picture['picture_id'];
    $picture['tn_url'] = "picture.php?tn=true&picture_id=" . $picture['picture_id'];
    $picture['num_comments'] = count(get_comments_by_picture_id($picture['picture_id'], $db));
    array_push($new_pictures, $picture);
}
template_display_picture_list($me, $user_information, $category_information, $new_pictures, $thumbnail_height, $thumbnail_width);
?>