// // 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 ***** ?> "Extensions","T"=>"Themes","U"=>"Updates"); $typename = $types["$type"]; //RSS Autodiscovery Link Stuff switch ($_SESSION["category"]) { case "Newest": $rsslist = "newest"; break; case "Popular": $rsslist = "popular"; break; case "Top Rated": $rsslist = "rated"; break; } $rssfeed = "rss/?application=" . $application . "&type=" . $type . "&list=" . $rsslist; if (!$category) {$categoryname = "All $typename"; } else {$categoryname = $category; } ?> Mozilla Update :: Themes - List - <?php echo"$categoryname"; if ($pageid) {echo" - Page $pageid"; } ?> "; } ?>
= '".strtolower($app_version)."' ";} if ($OS) { $sql .=" AND (TOS.OSName = '$OS' OR TOS.OSName = 'All') "; } if ($catname == "Popular") { $sql .=" AND TM.downloadcount > '5'"; } $sql .="GROUP BY `Name` "; if ($orderby) { $sql .="ORDER BY $orderby"; } else { $sql .="ORDER BY `Name` , `Version` DESC "; } $resultsquery = $sql; unset($sql); //Get Total Results from Result Query & Populate Page Control Vars. $sql_result = mysql_query($resultsquery, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $totalresults = mysql_num_rows($sql_result); $num_pages = ceil($totalresults/$items_per_page); //Total # of Pages if ($pageid>$num_pages) {$pageid=$num_pages;} //Check PageId for Validity $startpoint = ($pageid-1)*$items_per_page; if ($startpoint<0) {$startpoint=0; $startitem=0;} $startitem = $startpoint+1; $enditem = $startpoint+$items_per_page; if ($totalresults=="0") {$startitem = "0"; } if ($enditem>$totalresults) {$enditem=$totalresults;} //Verify EndItem if ($_GET[nextnum]) {$startpoint = escape_string($_GET["nextnum"]); } //$resultsquery = str_replace("GROUP BY `Name` ", "", $resultsquery); $resultsquery .= " LIMIT $startpoint , $items_per_page"; //Append LIMIT clause to result query if ($category=="%") {$category = $catname; unset($catname); } //Now Showing Box if (!$category) {$categoryname="All"; } else {$categoryname = $category;} echo"

".ucwords("$application $typename » $categoryname ")."

\n"; if (!$OS) {$OS="all";} if (!$category) {$categoryname="All"; } else {$categoryname = $category;} echo"".ucwords("$typename")." $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 »"; } echo"
\n"; $sql = "SELECT `CatDesc` FROM `categories` WHERE `CatName`='$category' and `CatType`='$type' LIMIT 1"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $row = mysql_fetch_array($sql_result); $categorydescription = $row["CatDesc"]; if ($category=="All") {$categorydescription="All listed themes for $application";} if ($categorydescription) {echo"$categorydescription
\n";} // Modify List Form echo"
"; echo"
\n"; echo"
"; echo"\n"; echo"\n"; //Items-Per-Page echo"Show/Page: "; $perpage = array("5","10","20","50"); echo"\n"; // Operating Systems echo" OS: "; echo"\n"; //Versions of Application echo"Versions: "; echo"\n"; echo""; echo"
"; echo"
\n"; echo" 
\n"; //--------------------------------- // Begin List //--------------------------------- //Get Author Data and Create $authorarray and $authorids $sql = "SELECT TM.Name, TU.UserName, TU.UserID, TU.UserEmail FROM `main` TM LEFT JOIN authorxref TAX ON TM.ID = TAX.ID INNER JOIN userprofiles TU ON TAX.UserID = TU.UserID ORDER BY `Type` , `Name` ASC "; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); while ($row = mysql_fetch_array($sql_result)) { $authorarray[$row[Name]][] = $row["UserName"]; $authorids[$row[UserName]] = $row["UserID"]; } //Assemble a display application version array $sql = "SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `applications` WHERE `AppName`='$application' ORDER BY `major`,`minor`"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); while ($row = mysql_fetch_array($sql_result)) { $version = $row["Version"]; $subver = $row["SubVer"]; $release = "$row[major].$row[minor]"; if ($row["release"]) {$release = ".$release$row[release]";} if ($subver !=="final") {$release="$release$subver";} $appvernames[$release] = $version; } //Query to Generate List.. $sql = "$resultsquery"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); while ($row = mysql_fetch_array($sql_result)) { $id = $row["ID"]; $type = $row["Type"]; $name = $row["Name"]; $dateadded = $row["DateAdded"]; $dateupdated = $row["DateUpdated"]; $homepage = $row["Homepage"]; $description = nl2br($row["Description"]); $rating = $row["Rating"]; $authors = $authorarray[$name]; $osname = $row["OSName"]; $appname = $row["AppName"]; $downloadcount = $row["TotalDownloads"]; $populardownloads = $row["downloadcount"]; //Get Version Record for Referenced MAXvID from list query $sql2 = "SELECT TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.DateAdded AS VerDateAdded, TV.DateUpdated AS VerDateUpdated, TV.URI, TV.Notes FROM `version` TV INNER JOIN applications TA ON TV.AppID = TA.AppID INNER JOIN os TOS ON TV.OSID = TOS.OSID WHERE TV.ID = '$id' AND TV.Version = '$row[Version]' AND TA.AppName = '$appname' AND TOS.OSName = '$osname' LIMIT 1"; $sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $vid = $row[MAXvID]; $row = mysql_fetch_array($sql_result2); $vid = $row["vID"]; if ($appvernames[$row["MinAppVer"]]) {$minappver = $appvernames[$row["MinAppVer"]]; } else { $minappver = $row["MinAppVer"]; } if ($appvernames[$row["MaxAppVer"]]) {$maxappver = $appvernames[$row["MaxAppVer"]]; } else { $maxappver = $row["MaxAppVer"]; } $VerDateAdded = $row["VerDateAdded"]; $VerDateUpdated = $row["VerDateUpdated"]; $filesize = $row["Size"]; $notes = $row["Notes"]; $version = $row["Version"]; $uri = $row["URI"]; $filename = basename($uri); $sql3 = "SELECT `PreviewURI`, `caption` from `previews` WHERE `ID` = '$id' AND `preview`='YES' LIMIT 1"; $sql_result3 = mysql_query($sql3, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE); $row3 = mysql_fetch_array($sql_result3); $previewuri = $row3["PreviewURI"]; $caption = $row3["caption"]; if ($VerDateAdded > $dateadded) {$dateadded = $VerDateAdded; } if ($VerDateUpdated > $dateupdated) {$dateupdated = $VerDateUpdated; } //Turn Authors Array into readable string... $authorcount = count($authors); foreach ($authors as $author) { $userid = $authorids[$author]; $n++; $authorstring .= "$author"; if ($authorcount != $n) {$authorstring .=", "; } } $authors = $authorstring; unset($authorstring, $n); // Clear used Vars.. if ($dateupdated > $dateadded) { $timestamp = $dateupdated; $datetitle = "Last Update: "; } else { $timestamp = $dateadded; $datetitle = "Added on: "; } $date = date("F d, Y g:i:sa", strtotime("$timestamp")); $datestring = "$datetitle $date"; echo"
\n"; if ($rating != NULL) { echo"
Rating: "; for ($i = 1; $i <= floor($rating); $i++) { echo"\"";"; } if ($rating>floor($rating)) { $val = ($rating-floor($rating))*10; echo"\"\""; $i++; } for ($i = $i; $i <= 5; $i++) { echo"\"";"; } echo"
\n"; } echo"

$name $version

"; if ($previewuri) { echo"

\n"; list($width, $height, $attr) = getimagesize("$websitepath"."$previewuri"); echo"\"$name\n"; echo"

\n"; $preview_minheight=$height-50; } echo"

By $authors

"; //Description & Version Notes if ($previewuri AND $preview_minheight) { echo"

"; } else { echo"

"; } echo"$description
"; if ($notes) {echo"
$notes"; } echo"

"; //Icon Bar Modules echo"
"; echo"
"; if ($appname=="Thunderbird") { echo"\"\"More Info"; } else { echo"\"\"Install"; } echo"
  $filesize kb
"; echo"
\"\" For $appname:
  $minappver - $maxappver
"; if($osname !=="ALL") { echo"
\"\"For $osname
only
"; } //if ($homepage) {echo"";} echo"
"; echo"
$datestring"; if ($populardownloads > 5 ) {echo" | Downloads Last 7 Days: $populardownloads";} if ($downloadcount) { echo" | Total Downloads: $downloadcount"; } echo"
\n"; echo"
\n"; } //End While Loop if ($totalresults=="0") { echo"
\n"; echo"

No themes found in this category for ".ucwords($application).".

\n"; echo"
\n"; } ?> ".ucwords("$application $typename » $categoryname ").""; echo"".ucwords("$typename")." $startitem - $enditem of $totalresults"; echo"  |  "; // Begin Code for Dynamic Navbars if ($pageid <=$num_pages) { $previd=$pageid-1; if ($previd >"0") { echo"« Previous • "; } echo"Page $pageid of $num_pages"; $nextid=$pageid+1; if ($pageid <$num_pages) { echo" • Next »"; } echo"
\n"; //Skip to Page... if ($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++; } } } ?>