// Chris "CTho" Thomas // Alan "alanjstr" Starr // Ted "luser" Mielczarek // // Alternatively, the contents of this file may be used under the terms of // either the GNU General Public License Version 2 or later (the "GPL"), or // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), // in which case the provisions of the GPL or the LGPL are applicable instead // of those above. If you wish to allow use of your version of this file only // under the terms of either the GPL or the LGPL, and not to allow others to // use your version of this file under the terms of the MPL, indicate your // decision by deleting the provisions above and replace them with the notice // and other provisions required by the GPL or the LGPL. If you do not delete // the provisions above, a recipient may use your version of this file under // the terms of any one of the MPL, the GPL or the LGPL. // // ***** END LICENSE BLOCK ***** ?> Results\n"; echo "$startitem - $enditem of $totalresults  |  "; $previd=$pageid-1; if ($previd >"0") { echo"« Previous • "; } echo "Page $pageid of $num_pages"; $nextid=$pageid+1; if ($pageid <$num_pages) { echo" • Next »"; } } //---------------------------- //Global General $_GET variables //---------------------------- //Detection Override $didSearch = 0; if ($_GET["q"] || $_GET["pageid"]) $didSearch = 1; $items_per_page="10"; //Default Num per Page is 10 //Default PageID is 1 if (!$_GET["pageid"]) {$pageid="1"; } else { $pageid = $_GET["pageid"]; } // grab query string if ($_GET["q"]) { $searchStr = escape_string($_GET["q"]); $section = escape_string($_GET["section"]); } ?> Mozilla Update :: Search<?php if ($didSearch) {echo " - Results - Page $pageid"; } ?> $totalresults) { $enditem = $totalresults; } // now build the query to get the item details // only $items_per_page number results, // starting at $startpoint $resultsquery = "SELECT TM.ID, TM.Name, TM.Description, TM.Type, TV.Version " . $sql ." GROUP BY TM.Name ORDER BY TM.Name LIMIT $startpoint , $items_per_page"; print_page_list($startitem, $enditem, $totalresults, $num_pages, $pageid); echo"

\n"; //--------------------------------- // Begin List //--------------------------------- // Query for items (if there are any) if($totalresults > 0) { $sql_result = mysql_query($resultsquery, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); while ($row = mysql_fetch_array($sql_result)) { $id = $row["ID"]; $name = $row["Name"]; $description = $row["Description"]; $itemtype = $row["Type"]; $version = $row["Version"]; echo "
\n"; //XXX this absolutely sucks. can't we have a function // to get the info URL for an item given its id? $typedirs = array("E"=>"extensions","T"=>"themes","U"=>"update"); $typedir = $typedirs[$itemtype]; echo "
$name $version"; echo "
"; // Description echo substr($description,0,250); echo"
\n"; } //End While Loop } else { ?>
No items found matching "".
Search For:
\n"; // Skip to Page... if ($pageid <= $num_pages && $num_pages > 1) { echo "Jump to Page: "; $pagesperpage = 9; // Plus 1 by default.. $i = 01; //Dynamic Starting Point if ($pageid > 11) { $nextpage = $pageid - 10; } $i = $nextpage; // Dynamic Ending Point $maxpagesonpage = $pageid + $pagesperpage; // Page #s while ($i <= $maxpagesonpage && $i <= $num_pages) { if ($i==$pageid) { echo"$i "; } else { echo"$i "; } $i++; } } } ?>