".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"
\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"
$name $version
"; if ($previewuri) { echo"\n"; list($width, $height, $attr) = getimagesize("$websitepath"."$previewuri"); echo"\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"
No themes found in this category for ".ucwords($application).".
\n"; 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++; } } } ?>