зеркало из https://github.com/mozilla/gecko-dev.git
Finished extensions / themes and mofidied the search to work with the updated amo.class.php, which doesn't set class vars but instead was updated so the gets actually just return data instead of setting things. Makes sense, no?
This commit is contained in:
Родитель
e531090e22
Коммит
65182984f8
|
@ -8,7 +8,7 @@
|
|||
|
||||
$currentTab = 'extensions';
|
||||
|
||||
startProcessing('extensions.tpl', null, $compileId, 'nonav');
|
||||
startProcessing('extensions.tpl', null, $compileId);
|
||||
require_once('includes.php');
|
||||
|
||||
// If app is not set or empty, set it to null for our switch.
|
||||
|
@ -32,35 +32,16 @@ switch( $_GET['app'] ) {
|
|||
// We have to ucfirst() it because the DB has caps.
|
||||
$sql['app'] = $clean['app'];
|
||||
|
||||
// Get most popular extensions based on application.
|
||||
$db->query("
|
||||
SELECT DISTINCT
|
||||
TM.ID ID,
|
||||
TM.Name name,
|
||||
TM.downloadcount dc
|
||||
FROM
|
||||
main TM
|
||||
INNER JOIN version TV ON TM.ID = TV.ID
|
||||
INNER JOIN applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN os TOS ON TV.OSID = TOS.OSID
|
||||
WHERE
|
||||
AppName = '{$sql['app']}' AND
|
||||
downloadcount > '0' AND
|
||||
approved = 'YES' AND
|
||||
Type = 'E'
|
||||
ORDER BY
|
||||
downloadcount DESC
|
||||
LIMIT
|
||||
5
|
||||
", SQL_ALL, SQL_ASSOC);
|
||||
|
||||
$popularExtensions = $db->record;
|
||||
|
||||
$amo = new AMO_Object();
|
||||
|
||||
// Assign template variables.
|
||||
$tpl->assign(
|
||||
array( 'popularExtensions' => $popularExtensions,
|
||||
array( 'newestExtensions' => $amo->getNewestAddons($sql['app'],'E',10),
|
||||
'popularExtensions' => $amo->getPopularAddons($sql['app'],'E',10),
|
||||
'title' => $clean['app'].' Addons',
|
||||
'currentTab' => $currentTab)
|
||||
'currentTab' => $currentTab,
|
||||
'content' => 'extensions.tpl',
|
||||
'sidebar' => 'inc/category-sidebar.tpl',
|
||||
'cats' => $amo->getCats('E'))
|
||||
);
|
||||
?>
|
||||
|
|
|
@ -92,9 +92,6 @@ foreach ($clean as $key=>$val) {
|
|||
// Instantiate AMO_Object so we can get our categories and platforms.
|
||||
$amo = new AMO_Object();
|
||||
|
||||
$amo->getCats();
|
||||
$amo->getPlatforms();
|
||||
|
||||
$dates = array(
|
||||
'day' => 'Today',
|
||||
'week' => 'This Week',
|
||||
|
@ -270,8 +267,8 @@ $tpl->assign(
|
|||
'page' => $page,
|
||||
'results' => $results,
|
||||
'clean' => $clean,
|
||||
'cats' => $amo->Cats,
|
||||
'platforms' => $amo->Platforms,
|
||||
'cats' => $amo->getCats(),
|
||||
'platforms' => $amo->getPlatforms(),
|
||||
'apps' => $apps,
|
||||
'dates' => $dates,
|
||||
'sort' => $sort,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
$currentTab = 'themes';
|
||||
|
||||
startProcessing('themes.tpl', null, $compileId, 'nonav');
|
||||
startProcessing('themes.tpl', null, $compileId);
|
||||
require_once('includes.php');
|
||||
|
||||
// If app is not set or empty, set it to null for our switch.
|
||||
|
@ -32,35 +32,16 @@ switch( $_GET['app'] ) {
|
|||
// We have to ucfirst() it because the DB has caps.
|
||||
$sql['app'] = $clean['app'];
|
||||
|
||||
// Get most popular extensions based on application.
|
||||
$db->query("
|
||||
SELECT DISTINCT
|
||||
TM.ID ID,
|
||||
TM.Name name,
|
||||
TM.downloadcount dc
|
||||
FROM
|
||||
main TM
|
||||
INNER JOIN version TV ON TM.ID = TV.ID
|
||||
INNER JOIN applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN os TOS ON TV.OSID = TOS.OSID
|
||||
WHERE
|
||||
AppName = '{$sql['app']}' AND
|
||||
downloadcount > '0' AND
|
||||
approved = 'YES' AND
|
||||
Type = 'E'
|
||||
ORDER BY
|
||||
downloadcount DESC
|
||||
LIMIT
|
||||
5
|
||||
", SQL_ALL, SQL_ASSOC);
|
||||
|
||||
$popularExtensions = $db->record;
|
||||
|
||||
$amo = new AMO_Object();
|
||||
|
||||
// Assign template variables.
|
||||
$tpl->assign(
|
||||
array( 'popularExtensions' => $popularExtensions,
|
||||
array( 'newestThemes' => $amo->getNewestAddons($sql['app'],'T',10),
|
||||
'popularThemes' => $amo->getPopularAddons($sql['app'],'T',10),
|
||||
'title' => $clean['app'].' Addons',
|
||||
'currentTab' => $currentTab)
|
||||
'currentTab' => $currentTab,
|
||||
'content' => 'themes.tpl',
|
||||
'sidebar' => 'inc/category-sidebar.tpl',
|
||||
'cats' => $amo->getCats('T'))
|
||||
);
|
||||
?>
|
||||
|
|
Загрузка…
Ссылка в новой задаче