''._AM_USERMGR_UONPAGE.''."\n", 'tab_header' => '', 'tab_trailer' => '', 'active_tab' => ''."\n".'%d', 'inactive_tab' => ''."\n".'%d'."\n" ); $result=$xoopsDB->query("SELECT COUNT(DISTINCT owner_id) as owners FROM ".$xoopsDB->prefix("xcgal_pictures")." "); $nbEnr = $xoopsDB->fetchArray($result); $user_count = $nbEnr['owners']; $xoopsDB->freeRecordSet($result); $byte = _AM_GRPMGR_KB; if (!$user_count) redirect_header('index.php',2,_AM_USERMGR_NOUSER); $user_per_page = 25; $page = isset($HTTP_GET_VARS['page']) ? (int)$HTTP_GET_VARS['page'] : 1; $lower_limit = ($page-1) * $user_per_page; $total_pages = ceil($user_count / $user_per_page); $sql = "SELECT owner_id, COUNT(pid) as pic_count, ". "ROUND(SUM(total_filesize)/1024) as disk_usage ". "FROM ". //"LEFT JOIN ".$xoopsDB->prefix("xcgal_albums")." AS a ON category = ".FIRST_USER_CAT." + uid ". "".$xoopsDB->prefix("xcgal_pictures")." ". "GROUP BY owner_id ". "LIMIT $lower_limit, $user_per_page"; $sql2= "SELECT category, COUNT(aid) as alb FROM ". "".$xoopsDB->prefix("xcgal_albums")." WHERE category > ".FIRST_USER_CAT." ". "GROUP BY category "; $result = $xoopsDB->query($sql); $result2 = $xoopsDB->query($sql2); $albs= db_fetch_rowset($result2); $tabs = create_tabs($user_count, $page, $total_pages, $tab_tmpl); //starttable('100%'); echo ""; echo ""; $tdstyle ="even"; $user_handler =& xoops_gethandler('member'); while($user = $xoopsDB->fetchArray($result)){ $pic_owner =& $user_handler->getUser($user['owner_id']); if ($user['pic_count'] && is_object ($pic_owner)) { $usr_link_start = ''; $usr_link_end = ''; $ulink = ""; $ulink_end = ""; $user['uname']= $pic_owner->uname(); } else { $usr_link_start = ''; $usr_link_end = ''; $ulink=""; $ulink_end=""; $user['uname']= $xoopsConfig['anonymous']; } if ($tdstyle== "even") $tdstyle = "odd"; else $tdstyle = "even"; echo <<< EOT EOT; } // while $xoopsDB->freeRecordSet($result); echo <<
"._AM_USERMGR_ULIST."
"._AM_USERMGR_USER.""._AM_USERMGR_ALBUMS.""._AM_USERMGR_PICS.""._AM_USERMGR_QUOTA."
{$ulink}{$user['uname']}{$ulink_end} EOT; foreach($albs as $alb){ if ($user['owner_id'] == $alb['category']-FIRST_USER_CAT) echo $usr_link_start.$alb['alb'].$usr_link_end; } echo <<< EOT {$user['pic_count']} {$user['disk_usage']} {$byte}
$tabs
EOT; //endtable(); } function list_deleted_users(){ global $PHP_SELF, $HTTP_GET_VARS, $xoopsDB; global $CAT_LIST,$member_handler; get_subcat_data(0); $box= cat_list_box(); $sql= "SELECT aid, title, category, pic_count ". "FROM ".$xoopsDB->prefix("xcgal_albums")." WHERE category > ".FIRST_USER_CAT.""; //"GROUP BY category"; $result = $xoopsDB->query($sql); if (!$result) return; echo "
"; echo ""; echo ""; $tdstyle ="even"; while($deluser = $xoopsDB->fetchArray($result)){ $deleted =& $member_handler->getUser(($deluser['category'] - FIRST_USER_CAT)); if (!is_object($deleted)){ if ($tdstyle== "even") $tdstyle = "odd"; else $tdstyle = "even"; $delid=$deluser['category'] - FIRST_USER_CAT; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo ""; echo "
"._AM_USERMGR_ULIST."
"._AM_USERMGR_ALB.""._AM_USERMGR_DELUID.""._AM_USERMGR_OPT."
{$deluser['title']}{$delid}"._AM_USERMGR_DEL.""._AM_USERMGR_PROPS.""._AM_USERMGR_EDITP."{$box}
"; } function movealb(){ global $HTTP_POST_VARS, $xoopsDB; if (!isset($HTTP_POST_VARS['album']) || !is_array($HTTP_POST_VARS['album'])) return; $album_array = &$HTTP_POST_VARS['album']; foreach($album_array as $key => $value){ $album_array[$key] = array(); $album_array[$key][] = $value; $album_array[$key][] = $HTTP_POST_VARS['move'][$key]; } foreach($album_array as $alb){ if($alb[1] != -1) { $query = "UPDATE ".$xoopsDB->prefix("xcgal_albums")." SET category='".$alb[1]."' WHERE aid='".$alb[0]."' LIMIT 1"; $update = $xoopsDB->query($query); } } } function get_subcat_data($parent, $ident='') { global $CAT_LIST, $xoopsDB; $sql = "SELECT cid, name, description ". "FROM ".$xoopsDB->prefix("xcgal_categories")." ". "WHERE parent = '$parent' ". "ORDER BY pos"; $result = $xoopsDB->query($sql); if (($cat_count = $xoopsDB->getRowsNum($result)) > 0){ $rowset = db_fetch_rowset($result); $pos=0; foreach ($rowset as $subcat){ if($pos>0){ $CAT_LIST[]=array( 'cid' => $subcat['cid'], 'parent' => $parent, 'pos' => $pos++, 'prev' => $prev_cid, 'cat_count' => $cat_count, 'name' => $ident.$subcat['name']); $CAT_LIST[$last_index]['next'] = $subcat['cid']; } else { $CAT_LIST[]=array( 'cid' => $subcat['cid'], 'parent' => $parent, 'pos' => $pos++, 'cat_count' => $cat_count, 'name' => $ident.$subcat['name']); } $prev_cid = $subcat['cid']; $last_index = count($CAT_LIST) -1; get_subcat_data($subcat['cid'], $ident.'   '); } } } function cat_list_box() { global $CAT_LIST, $PHP_SELF; $lb = <<< EOT