From 1dc0a2d8dcae33f705d73b38821a6bc175ffc752 Mon Sep 17 00:00:00 2001 From: "mike.morgan%oregonstate.edu" Date: Mon, 30 Jan 2006 08:44:02 +0000 Subject: [PATCH] Added rotating features to the front page. These will be controlled using the "reviews manager" of the existing developer tools. The rotating feature on the front page assumes that: a) there is already a feature that exists -- it barfs when there are zero features in the database for a given application b) the main preview (preview='yes' in previews): i) exists ii) is a reasonable size Some additions to the reviews manager would be: a) adding the "feature" screenshot along with the review so admins have control over what the actual feature looks like b) possibly requireing screenshots marked as "preview" to be a certain dimension so we can actually rely on the pixel width assumption --- webtools/addons/public/htdocs/index.php | 28 ++----------- webtools/addons/public/tpl/index.tpl | 8 ++-- webtools/addons/public/tpl/recommended.tpl | 2 +- webtools/addons/shared/lib/amo.class.php | 49 +++++++++++++++++++++- 4 files changed, 56 insertions(+), 31 deletions(-) diff --git a/webtools/addons/public/htdocs/index.php b/webtools/addons/public/htdocs/index.php index 5a63fb8dce96..bdbf031d0fc6 100644 --- a/webtools/addons/public/htdocs/index.php +++ b/webtools/addons/public/htdocs/index.php @@ -35,34 +35,12 @@ 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( 'popularExtensions' => $amo->getPopularAddons($sql['app'],'E',5), + 'feature' => $amo->getFeature($sql['app']), 'title' => $clean['app'].' Addons', 'currentTab' => $currentTab) ); diff --git a/webtools/addons/public/tpl/index.tpl b/webtools/addons/public/tpl/index.tpl index 2fb11f77920b..68b3ad095639 100644 --- a/webtools/addons/public/tpl/index.tpl +++ b/webtools/addons/public/tpl/index.tpl @@ -3,13 +3,13 @@

Featured Extension

-

del.icio.us

-

Harness the power of social bookmarking right in your browser with the del.icio.us Firefox extension! The del.icio.us extension for Firefox offers everything you need to seamlessly integrate the del.icio.us service with your Firefox browser. Learn more...

+

{$feature.name}

+

{$feature.body|nl2br} Learn more...

We Recommend: See some of our favorite extensions to get you started. diff --git a/webtools/addons/public/tpl/recommended.tpl b/webtools/addons/public/tpl/recommended.tpl index afa89e42d10e..b09efddeba70 100644 --- a/webtools/addons/public/tpl/recommended.tpl +++ b/webtools/addons/public/tpl/recommended.tpl @@ -1,7 +1,7 @@

Getting Started with Extensions

-

With over 300 extensions available for Firefox, there's something for everyone. To get you started, here's a list of some of our recommended extensions that make use of popular online services.

+

With over thousands of extensions available, there's something for everyone. To get you started, here's a list of some of our recommended extensions that make use of popular online services.

{section name=re loop=$recommendedExtensions step=1 start=0}