'date', 'author' => 'author', 'title' => 'title', ); $which_order = array( 'asc' => '', 'desc' => 'z-a', ); $options = array(); foreach ($which_sort as $sort_key=>$sort_value) { foreach ($which_order as $order_key=>$order_value) { if ($sort_key == 'date') $order_value = ($order_key == 'asc') ? '' : 'descending' ; $display = '' . $sort_value; $display .= $order_value ? " " . $order_value : ""; $display .= ''; if ($sort == $sort_key && $order == $order_key) { array_push($options, $display); } else { $href = ''.$display.''; array_push($options, $href); } } } $string = '
Sort by: ' . implode(' | ', $options) . '
'."\n"; return $string; } function get_pager() { global $editable; $queue = get_queue(); $search = get_search_args(); $sort = get_sort_arg(); $order = get_order(); $start = get_start_num(); $show = get_show_num(); $prev = $start+$show; $next = $start-$show; // If next is less than 0, make sure we can see the next stories if ($next < 0) $next = 0; $link = $editable ? "" : "/article"; $queue_url = $queue ? 1 : 0; $string = '
'; $nw = class_exists('Numbers_Words') ? new Numbers_Words() : NULL; // Are there later stories? Go backwards to them $string .= ''; if ($start > 0) { $string .= "\n".'toWords((int)$show) : (int)$show)." articles"; $string .= '">« Next '.$articles.''; } $string .= "\n"; // Are there earlier stories? Go forwards to them $string .= "\n".''; if ($prev < get_count()) { $string .= "\n".'toWords((int)$show) : (int)$show)." articles"; $string .= '">Previous '.$articles.' »'; } $string .= "\n"; $string .= "
\n"; return $string; }