Files
Testing/tagged_photos.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

71 lines
2.5 KiB
PHP

<?php
/* $Id: user_album_update.php 293 2010-01-21 01:16:21Z phil $ */
$page = "tagged_photos";
include "header.php";
$rand=rand(1, 2000000);
if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }
if(isset($_GET['album_id'])) { $album_id = $_GET['album_id']; } elseif(isset($_POST['album_id'])) { $album_id = $_POST['album_id']; } else { $album_id = 0; }
if(isset($_GET['media_id'])) { $media_id = $_GET['media_id']; } elseif(isset($_POST['media_id'])) { $media_id = $_POST['media_id']; } else { $media_id = 0; }
if(isset($_POST['p'])) { $p = $_POST['p']; } elseif(isset($_GET['p'])) { $p = $_GET['p']; } else { $p = 1; }
if(isset($_POST['cpp'])) { $cpp = $_POST['cpp']; } elseif(isset($_GET['cpp'])) { $cpp = $_GET['cpp']; } else { $cpp = 40; }
// ENSURE ALBUMS ARE ENABLED FOR THIS USER
if($user->level_info[level_album_allow] == 0) { header("Location: home.php"); exit(); }
// BE SURE ALBUM BELONGS TO THIS USER
$album = $database->database_query("SELECT * FROM se_albums WHERE album_id='$album_id' AND album_user_id='".$user->user_info[user_id]."'");
//if($database->database_num_rows($album) != 1) { header("Location: user_album.php"); exit(); }
$album_info = $database->database_fetch_assoc($album);
// SET VARS
$result = 0;
$album = new se_album($user->user_info[user_id]);
// SHOW FILES IN THIS ALBUM
$total_files = $album->album_tagged_files($album_info[album_id]);
$page_vars = make_page($total_files, $cpp, $p);
$file_array = $album->album_tagged_media_list($page_vars[0], $cpp, "media_order ASC", "(media_album_id='$album_info[album_id]')");
// GET LIST OF OTHER ALBUMS
$total_albums = $album->album_total("album_id<>'$album_info[album_id]'");
$album_array = $album->album_list(0, $total_albums, "album_order ASC", "album_id<>'$album_info[album_id]'");
for($x=$page_vars[1]; $x<=$page_vars[2]; $x++)
{
if(($page_vars[1]+10)==$x)
{break;}
$for[$y]=$x;
$y++;
}
$rand=rand(1, 200000);
$smarty->assign('rand', $rand);
$smarty->assign('for', $for);
// ASSIGN VARIABLES AND SHOW UDPATE ALBUMS PAGE
$smarty->assign('result', $result);
$smarty->assign('files', $file_array);
$smarty->assign('files_total', $total_files);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('maxpage', $page_vars[2]);
$smarty->assign('p_start', $page_vars[0]+1);
$smarty->assign('p_end', $page_vars[0]+count($file_array));
$smarty->assign('album_info', $album_info);
$smarty->assign('albums', $album_array);
$smarty->assign('albums_total', $total_albums);
$smarty->assign('rand', $rand);
include "footer.php";
?>