Ejemplo n.º 1
0
}
// ADD CRITERIA FOR FILTER
$where_clause = array();
if ($f_owner != "") {
    $where_clause[] = "(se_users.user_username LIKE '%{$f_owner}%' OR CONCAT(se_users.user_fname, ' ', se_users.user_lname) LIKE '%{$f_owner}%')";
}
if ($f_title != "") {
    $where_clause[] = " se_albums.album_title LIKE '%{$f_title}%'";
}
if (count($where_clause) != 0) {
    $where = "(" . implode(" AND ", $where_clause) . ")";
}
// DELETE NECESSARY ALBUMS
$start = ($p - 1) * $albums_per_page;
if ($task == "delete") {
    $album->album_delete_selected($start, $albums_per_page, $sort, $where);
}
// GET TOTAL ALBUMS
$total_albums = $album->album_total($where);
// MAKE ALBUM PAGES
$page_vars = make_page($total_albums, $albums_per_page, $p);
$page_array = array();
for ($x = 0; $x <= $page_vars[2] - 1; $x++) {
    if ($x + 1 == $page_vars[1]) {
        $link = "1";
    } else {
        $link = "0";
    }
    $page_array[$x] = array('page' => $x + 1, 'link' => $link);
}
// GET ALBUM ARRAY