//sort threads. If sort is set to bump nothing will change because that is the default order returned by fetchThreadListif(isset($_POST['sort_by'])) { switch($_POST['sort_by']) { case 'bump': $plist = $PIO->fetchThreadList($this->PAGE_DEF * $page, $this->PAGE_DEF); //thread list break; case 'time': rsort($plist); break; //add more conditions here }}