//
// 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
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; }
?>
";
if (!$OS) {$OS="all";}
if (!$category) {$categoryname="All"; } else {$categoryname = $category;}
echo"
";
$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";
echo"
".ucwords("$application $typename » $categoryname ")."";
echo"".ucwords("$typename")." $startitem - $enditem of $totalresults";
// Modify List Form
echo"
";
echo"";
echo"
";
echo"
\n";
//---------------------------------
// Begin List
//---------------------------------
//Get Author Data and Create $authorarray and $authorids
$sql = "SELECT TM.Name, TU.UserName, TU.UserID, TU.UserEmail FROM `t_main` TM
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
ORDER BY `Type` , `Name` ASC "; // TM.Type = 'E'
$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 `t_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 = $row["Description"];
$rating = $row["Rating"];
$authors = $authorarray[$name];
$osname = $row["OSName"];
$appname = $row["AppName"];
$downloadcount = $row["TotalDownloads"];
//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, TP.PreviewURI FROM `t_version` TV
//LEFT JOIN t_previews TP ON TV.vID = TP.vID
//WHERE TV.vID = '$row[MAXvID]' LIMIT 1";
$sql2 = "SELECT TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.DateAdded AS VerDateAdded, TV.DateUpdated AS VerDateUpdated, TV.URI, TV.Notes, TP.PreviewURI FROM `t_version` TV
LEFT JOIN t_previews TP ON TV.vID = TP.vID
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
INNER JOIN t_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);
$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"];
$previewuri = $row["PreviewURI"];
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 .= "\n";
//echo"
"; //Not sure why this is here, it caused text to flood out of the box though.
if ($previewuri) {
list($width, $height, $imagetype, $attr) = getimagesize("$websitepath"."$previewuri");
echo"

";
}
//Upper-Right Side Box
echo"
\n";
echo"
";
//Description & Version Notes
echo"
";
echo"$description
";
if ($notes) {echo"$notes"; }
echo"\n";
echo"
";
//echo"
";
//Icon Bar Modules
echo"
";
echo"
";
if ($appname=="Thunderbird") {
echo"
More Info";
} else {
//Make Theme Install work again, Bug 246754
//echo"
";
echo"";
echo"
Install";
}
echo"
Size: $filesize kb";
if ($homepage) {echo"
";}
echo"
."_icon.png\")
Works with:
$minappver - $maxappver
";
if ($osname !=="ALL") {
echo"
."_icon.png\")
OS:
$osname
";
}
echo"
";
echo"
Updated: $dateupdated | Total Downloads: $downloadcount
\n";
echo"
\n";
} //End While Loop
if ($totalresults=="0") {
echo"\n";
echo"No themes found in this category for ".ucwords($application).".\n";
echo"
\n";
}
?>
";
echo"";
$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: ";
$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++;
}
}
echo"
\n";
echo"