diff --git a/webtools/addons/public/htdocs/extensions.php b/webtools/addons/public/htdocs/extensions.php index 90dc846bcd4..7f884c30df6 100644 --- a/webtools/addons/public/htdocs/extensions.php +++ b/webtools/addons/public/htdocs/extensions.php @@ -12,21 +12,7 @@ startProcessing('extensions.tpl', 'extensions', $compileId); require_once('includes.php'); // If app is not set or empty, set it to null for our switch. -$_GET['app'] = (!empty($_GET['app'])) ? $_GET['app'] : null; - -// Determine our application. -switch( $_GET['app'] ) { - case 'mozilla': - $clean['app'] = 'Mozilla'; - break; - case 'thunderbird': - $clean['app'] = 'Thunderbird'; - break; - case 'firefox': - default: - $clean['app'] = 'Firefox'; - break; -} +$clean['app'] = (!empty($_GET['app']) && ctype_alpha($_GET['app'])) ? $_GET['app'] : null; // $sql['app'] can equal $clean['app'] since it was assigned in a switch(). // We have to ucfirst() it because the DB has caps. diff --git a/webtools/addons/public/htdocs/rss.php b/webtools/addons/public/htdocs/rss.php index a72701c68b9..a245723990d 100644 --- a/webtools/addons/public/htdocs/rss.php +++ b/webtools/addons/public/htdocs/rss.php @@ -11,20 +11,7 @@ startProcessing('rss.tpl',$memcacheId,$compileId,'xml'); /** * Pull our input params. */ -$rssapp = (!empty($_GET['app']) && ctype_alpha($_GET['app'])) ? $_GET['app'] : null; -switch (strtolower($rssapp)) { - case 'mozilla': - $clean['app'] = 'mozilla'; - break; - case 'thunderbird': - $clean['app'] = 'thunderbird'; - break; - case 'firefox': - default: - $clean['app'] = 'firefox'; - break; -} - +$clean['app']= (!empty($_GET['app']) && ctype_alpha($_GET['app'])) ? $_GET['app'] : null; $rsstype = !empty($_GET['type']) && ctype_alpha($_GET['type']) ? $_GET['type'] : null; switch (strtolower($rsstype)) { case 'themes': @@ -44,7 +31,7 @@ switch (strtolower($rsslist)) { $rssOrderBy = 'm.downloadcount desc, m.totaldownloads desc, m.rating desc, m.dateupdated desc, m.name asc'; break; case 'updated': - $rssOrderBy = 'm.dateupdated desc, m.name asc'; + $rssOrderBy = 'v.dateupdated desc, m.name asc'; break; case 'rated': $rssOrderBy = 'm.rating desc, m.downloadcount desc, m.name asc'; @@ -54,7 +41,7 @@ switch (strtolower($rsslist)) { /** * @TODO change this to dateapproved once the db has this in it. */ - $rssOrderBy = 'm.dateupdateddesc, m.name asc'; + $rssOrderBy = 'v.dateupdated desc, m.name asc'; break; } @@ -83,13 +70,17 @@ $_rssSql = " a.appname FROM main m - INNER JOIN version v ON v.id = m.id + INNER JOIN version v ON m.id = v.id + INNER JOIN ( + SELECT v.id, v.appid, v.osid, max(v.vid) as mxvid + FROM version v + WHERE approved = 'YES' group by v.id, v.appid, v.osid) as vv + ON vv.mxvid = v.vid AND vv.id = v.id INNER JOIN applications a ON a.appid = v.appid WHERE v.approved = 'yes' AND a.appname = '{$sql['app']}' AND - m.type = '{$sql['type']}' AND - v.vid = (SELECT max(vid) FROM version WHERE id=m.id AND approved='YES') + m.type = '{$sql['type']}' ORDER BY {$rssOrderBy} LIMIT 0,10 diff --git a/webtools/addons/public/tpl/extensions.tpl b/webtools/addons/public/tpl/extensions.tpl index dbfae4b8bc4..113d4ad00b6 100644 --- a/webtools/addons/public/tpl/extensions.tpl +++ b/webtools/addons/public/tpl/extensions.tpl @@ -6,14 +6,14 @@ button to a completely new feature. They allow the application to be customized to fit the personal needs of each user if they need additional features, while minimizing the size of the application itself.

-

Fresh from the Oven

+

Recently Updated

-

Hot this Week

+

Top Extensions