authenticate("U_TimeOffset,U_TimeFormat"); if (!isset($user['U_TimeOffset'])) { $user['U_TimeOffset'] = ""; } !isset($user['U_TimeFormat']) && $user['U_TimeFormat'] = $theme['timeformat']; if (($config['userlist'] == 1) && (!$user['U_Username'])) { exit; } // -------------------- // Set the default sort $andlike = ""; if (empty($sb)) { $sb = 1; }; if ($like != "") { $like_q = addslashes($like); $andlike = "AND U_Username LIKE '$like_q%'"; } // -------------------------------------------------- // Grab the total number of users out of the database $query = " SELECT COUNT(*) FROM {$config['tbprefix']}Users WHERE U_Approved='yes' AND U_Banned <> '1' AND (U_CoppaUser = '0' OR U_CoppaUser IS NULL) $andlike "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); list($totalusers) = $dbh -> fetch_array($sth); $dbh -> finish_sth($sth); // ---------------------------------------- // Get ready to show how it is being sorted $sortuser = 1; $sortstatus = 3; $sorthome = 5; $sorttotal = 7; $sorticq = 9; $sortreged = 11; $sortpic = 13; // --------------------------------------------------------------------- // A multi-dimensional array to show the sort order and set the sql sort $Sorting = array( 0 => array(0=>"blah", 1=>"blah"), 1 => array(0=>"\"\"", 1=> "U_Username ASC"), 2 => array(0=>"\"\"", 1=> "U_Username DESC"), 3 => array(0=>"\"\"", 1=> "U_Status ASC"), 4 => array(0=>"\"\"", 1=> "U_Status DESC"), 5 => array(0=>"\"\"", 1=> "U_Homepage ASC"), 6 => array(0=>"\"\"", 1=> "U_Homepage DESC"), 7 => array(0=>"\"\"", 1=> "U_TotalPosts ASC"), 8 => array(0=>"\"\"", 1=> "U_TotalPosts DESC"), 9 => array(0=>"\"\"", 1=> "U_Extra1 ASC"), 10 => array(0=>"\"\"", 1=> "U_Extra1 DESC"), 11 => array(0=>"\"\"", 1=> "U_Registered ASC"), 12 => array(0=>"\"\"", 1=> "U_Registered DESC"), 13 => array(0=>"\"\"", 1=> "U_Picture ASC"), 14 => array(0=>"\"\"", 1=> "U_Picture DESC") ); // ------------------------------------------ // Get ready to show how this is being sorted switch($sb) { case 1: $UserS = $Sorting['1']['0']; $sortuser = 2; break; case 2: $UserS = $Sorting['2']['0']; $sortuser = 1; break; case 3: $StatusS = $Sorting['3']['0']; $sortstatus = 4; break; case 4: $StatusS = $Sorting['4']['0']; $sortstatus = 3; break; case 5: $HomepageS = $Sorting['5']['0']; $sorthome = 6; break; case 6: $HomepageS = $Sorting['6']['0']; $sorthome = 5; break; case 7: $TotalS = $Sorting['7']['0']; $sorttotal = 8; break; case 8: $TotalS = $Sorting['8']['0']; $sorttotal = 7; break; case 9: $ICQS = $Sorting['9']['0']; $sorticq = 10; break; case 10: $ICQS = $Sorting['10']['0']; $sorticq = 9; break; case 11: $RegedS = $Sorting['11']['0']; $sortreged = 12; break; case 12: $RegedS = $Sorting['12']['0']; $sortreged = 11; break; case 13: $PictureS = $Sorting['13']['0']; $sortpic = 14; break; case 14: $PictureS = $Sorting['14']['0']; $sortpic= 13; break; } // ------------------------------- // Lets give the start of the page $html = new html; $html -> send_header($config['title'],$Cat,0,$user); // ------------------------------------- // Here we grab the users for this page if($page == 1) { $Totalgrab = 25; }else{ $Startat = (($page-1) * 25); $Totalgrab = "$Startat, 25"; } $limitit = "LIMIT $Totalgrab"; $query = " SELECT U_Username,U_Registered,U_Extra1,U_Homepage,U_TotalPosts,U_Status,U_Number,U_Picture,U_PicWidth,U_PicHeight FROM {$config['tbprefix']}Users WHERE U_Approved = 'yes' AND U_Number <> 1 AND U_Banned = '0' AND (U_CoppaUser <> '1' OR U_CoppaUser IS NULL) $andlike ORDER BY " .$Sorting[$sb]['1']. " $limitit "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); $total = $dbh -> total_rows($sth); $newpage = 0; // ----------------------- // Set the first row color $color = "lighttable"; // ---------------------------------------------------------------- // Cycle through the users for($i=0;$i<$total;$i++){ list ($Username,$Reged,$ICQ,$Home,$Posts,$Status,$Uid,$Picture,$picwidth,$picheight) = $dbh -> fetch_array($sth); if (!$picwidth) { $picwidth = $theme['PictureWidth']; } if (!$picheight) { $picheight = $theme['PictureHeight']; } if (!$Picture || $Picture == "http://" || $Picture == "http:///") { $Picture = "{$config['images']}/blank.gif"; $picwidth="0"; $picheight="0"; } if ($Home && ($Home != "http://")) { $Home = "http://$Home"; $Home = preg_replace("/^http:\/\/http:\/\//","http://",$Home); $Home = "\"*\""; } if ( (preg_match("/^\d+$/",$ICQ)) && ($config['ICQ_Status']) ){ $ICQ = ""; } $Reged = $html -> convert_time($Reged,$user['U_TimeOffset'],$user['U_TimeFormat']); $EUsername = rawurlencode($Username); if ($Status == "Administrator") { $Status = $ubbt_lang['USER_ADMIN']; } elseif ($Status == "Moderator") { $Status = $ubbt_lang['USER_MOD']; } elseif ($Status == "User") { $Status = $ubbt_lang['USER_USER']; } $userrow[$i]['color'] = $color; $userrow[$i]['EUsername'] = $Uid; $userrow[$i]['Username'] = $Username; $userrow[$i]['Status'] = $Status; $userrow[$i]['Home'] = $Home; $userrow[$i]['Posts'] = $Posts; $userrow[$i]['ICQ'] = $ICQ; $userrow[$i]['Reged'] = $Reged; $userrow[$i]['Picture'] = $Picture; $userrow[$i]['picwidth'] = $picwidth; $userrow[$i]['picheight'] = $picheight; $color = $html -> switch_colors($color); } $dbh -> finish_sth($sth); // --------------------------------------- // Print out the page jumper at the bottom $TotalP = ceil($totalusers / 25); $Startpage = $page - 10; $Endpage = $page + 10; if ($Startpage < 0) { $Endpage = $Endpage - $Startpage; $Startpage = 0; } if ($Endpage > $TotalP) { $Endpage = $TotalP; $Startpage = $Endpage - 20; } if ($Startpage < 1) { $Startpage = 1; } if ($Startpage > 1) { $prev = $page -1; $pages .= "<<"; } if ($totalusers > 25) { for ($i=$Startpage; $i<= $Endpage; $i++) { if ($i == $page) { $pages .= "$i "; } else { $pages .= "$i "; } } } if ($Endpage < $TotalP) { $next = $page + 1; $pages .= ">>"; } $userrowsize = 0; if (isset($userrow)) { $userrowsize = sizeof($userrow); } // --------------------- // Grab the tablewrapper list($tbopen,$tbclose) = $html -> table_wrapper(); // -------------------------- // Setup the usersort options $letters = split(",",$ubbt_lang['USER_SORT']); $size = sizeof($letters); $sortlinks = ""; for ($i=0; $i<$size; $i++) { if ($letters[$i] == $like) { $sortlinks .= " {$letters[$i]}"; } else { $sortlinks .= " {$letters[$i]}"; } } $sortlinks .= "   "; for ($i=0; $i<10; $i++) { if ($i == $like && (preg_match("/[0-9]/",$like))) { $sortlinks .= " $i"; } else { $sortlinks .= " $i"; } } $sortlinks .= "   "; if ($like < 0) { $sortlinks .= " {$ubbt_lang['SHOW_ALL']}"; } else { $sortlinks .= " {$ubbt_lang['SHOW_ALL']}"; } if (!$debug) { include("$thispath/templates/$tempstyle/showmembers.tmpl"); } $html -> send_footer();