0){ $rowset = cpg_db_fetch_rowset($result); foreach ($rowset as $alb){ $ALBUM_LIST[]=array($alb['aid'], $alb['title']); } } } function albumselect($id = "album") { // frogfoot re-wrote this function to present the list in categorized, sorted and nicely formatted order global $CONFIG, $lang_picmgr_php, $aid, $lang_errors, $cpg_udb; static $select = ""; // Reset counter $list_count = 0; if ($select == "") { // albums in root category if (GALLERY_ADMIN_MODE) { $result = cpg_db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = 0"); while ($row = mysql_fetch_array($result)) { // Add to multi-dim array for later sorting $listArray[$list_count]['cat'] = $lang_search_new_php['albums_no_category']; $listArray[$list_count]['aid'] = $row['aid']; $listArray[$list_count]['title'] = $row['title']; $list_count++; } mysql_free_result($result); } // albums in public categories if (GALLERY_ADMIN_MODE) { $result = cpg_db_query("SELECT DISTINCT a.aid AS aid, a.title AS title, c.name AS cname FROM {$CONFIG['TABLE_ALBUMS']} AS a, {$CONFIG['TABLE_CATEGORIES']} AS c WHERE a.category = c.cid AND a.category < '" . FIRST_USER_CAT . "'"); while ($row = mysql_fetch_array($result)) { // Add to multi-dim array for later sorting $listArray[$list_count]['cat'] = $row['cname']; $listArray[$list_count]['aid'] = $row['aid']; $listArray[$list_count]['title'] = $row['title']; $list_count++; } mysql_free_result($result); } // albums in user's personal galleries // if (defined('UDB_INTEGRATION')) { //if (GALLERY_ADMIN_MODE) { // $sql = $cpg_udb->get_admin_album_list(); /*} else { $sql = "SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = ".(FIRST_USER_CAT + USER_ID); }*/ // } else { if (GALLERY_ADMIN_MODE) { // $sql = "SELECT aid, CONCAT('(', user_name, ') ', title) AS title " . "FROM {$CONFIG['TABLE_ALBUMS']} AS a " . "INNER JOIN {$CONFIG['TABLE_USERS']} AS u ON category = (" . FIRST_USER_CAT . " + user_id)"; $sql = $cpg_udb->get_admin_album_list(); //it's always bridged so we no longer need to check. } else { $sql = "SELECT aid, title AS title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = " . (FIRST_USER_CAT + USER_ID); } // } $result = cpg_db_query($sql); while ($row = mysql_fetch_array($result)) { // Add to multi-dim array for later sorting $listArray[$list_count]['cat'] = $lang_search_new_php['personal_albums']; $listArray[$list_count]['aid'] = $row['aid']; $listArray[$list_count]['title'] = $row['title']; $list_count++; } mysql_free_result($result); if (!$aid) { $select = '\n"; } // Sort the pulldown options by category and album name $listArray = array_csort($listArray,'cat','title'); // Create the nicely sorted and formatted drop down list $alb_cat = ''; foreach ($listArray as $val) { if ($val['cat'] != $alb_cat) { if ($alb_cat) $select .= "\n"; $select .= '\n"; } return "\n\n"; } pageheader($lang_picmgr_php['pic_mgr']); ?>
'; pagefooter(); ob_end_flush(); ?>