Browse Source

! Oops, $context['show_by'] wasn't actually being honoured for setting up the conditions. Let's fix that, and make the code nicer.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 years ago
parent
commit
efe4130a4f
1 changed files with 3 additions and 7 deletions
  1. 3 7
      Sources/Who.php

+ 3 - 7
Sources/Who.php

@@ -105,18 +105,14 @@ function Who()
 		$_REQUEST['show'] = $_REQUEST['show_top'];
 	// Does the user wish to apply a filter?
 	if (isset($_REQUEST['show']) && isset($show_methods[$_REQUEST['show']]))
-	{
 		$context['show_by'] = $_SESSION['who_online_filter'] = $_REQUEST['show'];
-		$conditions[] = $show_methods[$_REQUEST['show']];
-	}
 	// Perhaps we saved a filter earlier in the session?
 	elseif (isset($_SESSION['who_online_filter']))
-	{
 		$context['show_by'] = $_SESSION['who_online_filter'];
-		$conditions[] = $show_methods[$_SESSION['who_online_filter']];
-	}
 	else
-		$context['show_by'] = $_SESSION['who_online_filter'] = 'members';
+		$context['show_by'] = 'members';
+
+	$conditions[] = $show_methods[$context['show_by']];
 
 	// Get the total amount of members online.
 	$request = $smcFunc['db_query']('', '