From ccaef20f8a24a66bc31598995f6d37e17fc12dd4 Mon Sep 17 00:00:00 2001 From: "mike.morgan%oregonstate.edu" Date: Mon, 18 Jul 2005 08:26:54 +0000 Subject: [PATCH] added overview page, serves as overview for a specific application --- webtools/addons/css/base/template.css | 37 +++++++ webtools/addons/inc/finish.php | 6 +- webtools/addons/index.php | 6 ++ webtools/addons/list.php | 0 webtools/addons/overview.php | 138 ++++++++++++++++++++++++++ webtools/addons/tpl/inc/header.tpl | 12 +-- webtools/addons/tpl/overview.tpl | 41 ++++++++ 7 files changed, 233 insertions(+), 7 deletions(-) delete mode 100644 webtools/addons/list.php create mode 100644 webtools/addons/overview.php create mode 100644 webtools/addons/tpl/overview.tpl diff --git a/webtools/addons/css/base/template.css b/webtools/addons/css/base/template.css index 8f69b528d805..2633bb7e41a7 100755 --- a/webtools/addons/css/base/template.css +++ b/webtools/addons/css/base/template.css @@ -128,3 +128,40 @@ p.security-update { #nav ul li span,#nav ul li a { padding: 4px 8px 4px 20px; } + +.tabs { + height: 2em; + margin: .5em 0; + padding: 0; +} + +.tabs ul { + font: 11px verdana, arial, sans-serif; + list-style-type: none; + padding: 0 0 24px 7px; + border-bottom: 1px solid #000; + margin: 0; +} +.tabs ul li { + float: left; + margin: 0; + padding: 0; +} +.tabs a.active-tab { + border-bottom: 1px solid #fff; + background-color: #fff; + font-weight:bold; +} +.tabs a { + float: left; + display: inline; + border: 1px solid #000; + background-color: #69c; + color: #333; + text-decoration: none; + margin: 0 5px; + padding: 5px 7px; +} +.tabs a:hover { + background: #fff; +} diff --git a/webtools/addons/inc/finish.php b/webtools/addons/inc/finish.php index ae5e8abd718c..a57f317a8bbc 100644 --- a/webtools/addons/inc/finish.php +++ b/webtools/addons/inc/finish.php @@ -1,13 +1,17 @@ disconnect(); // Set our wrapper if it has not been set. -$wrapper = (!isset($wrapper)) ? 'inc/wrappers/nonav.tpl' : $wrapper; +$wrapper = (!isset($wrapper)) ? 'inc/wrappers/default.tpl' : $wrapper; // Display output. $tpl->display($wrapper); +?> diff --git a/webtools/addons/index.php b/webtools/addons/index.php index 1d51168ae423..ec5d895c63dc 100644 --- a/webtools/addons/index.php +++ b/webtools/addons/index.php @@ -9,6 +9,7 @@ $db->query(" SELECT DISTINCT TM.ID id, TM.Name name, + TM.Rating, TM.downloadcount dc FROM main TM @@ -30,6 +31,7 @@ $popularExtensions = $db->record; $db->query(" SELECT DISTINCT TM.ID id, + TM.Rating, TM.Name name, TM.downloadcount dc FROM @@ -54,6 +56,7 @@ $db->query(" TM.ID, TM.Type, TM.Name, + TM.Rating, MAX(TV.Version) Version, MAX(TV.DateAdded) DateAdded FROM @@ -80,4 +83,7 @@ $tpl->assign( 'newest' => $newest, 'content' => 'index.tpl') ); + +// Set custom wrapper for main page. +$wrapper = 'inc/wrappers/nonav.tpl'; ?> diff --git a/webtools/addons/list.php b/webtools/addons/list.php deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/webtools/addons/overview.php b/webtools/addons/overview.php new file mode 100644 index 000000000000..ab576f519a74 --- /dev/null +++ b/webtools/addons/overview.php @@ -0,0 +1,138 @@ +query(" + SELECT DISTINCT + TM.ID id, + TM.Name name, + TM.Rating, + LEFT(TM.Description,255) as Description, + 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 + 7 +", SQL_ALL, SQL_ASSOC); + +$popularExtensions = $db->record; + +// Get most popular themes based on application. +$db->query(" + SELECT DISTINCT + TM.ID id, + TM.Name name, + TM.Rating, + 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 = 'T' + ORDER BY + downloadcount DESC + LIMIT + 7 +", SQL_ALL, SQL_ASSOC); + +$popularThemes = $db->record; + +// Get newest addons based on application. +$db->query(" + SELECT + TM.ID, + TM.Type, + TM.Name, + TM.Rating, + LEFT(TM.Description,255) as Description, + MAX(TV.Version) Version, + MAX(TV.DateAdded) DateAdded + 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 + `approved` = 'YES' + GROUP BY + TM.ID + ORDER BY + DateAdded DESC + LIMIT + 7 +", SQL_ALL, SQL_ASSOC); + +$newest = $db->record; + +$tabs = array( + array( + 'app' => 'Firefox' + ), + array( + 'app' => 'Thunderbird' + ), + array( + 'app' => 'Mozilla' + ) +); + +// Assign template variables. +$tpl->assign( + array( 'popularExtensions' => $popularExtensions, + 'popularThemes' => $popularThemes, + 'newest' => $newest, + 'app' => ucfirst($clean['app']), + 'tabs' => $tabs, + 'content' => 'overview.tpl') +); + +$wrapper = 'inc/wrappers/nonav.tpl'; +?> diff --git a/webtools/addons/tpl/inc/header.tpl b/webtools/addons/tpl/inc/header.tpl index acb57b60b01f..c4b410014291 100644 --- a/webtools/addons/tpl/inc/header.tpl +++ b/webtools/addons/tpl/inc/header.tpl @@ -54,18 +54,18 @@
 
diff --git a/webtools/addons/tpl/overview.tpl b/webtools/addons/tpl/overview.tpl new file mode 100644 index 000000000000..cc7ae012eaf3 --- /dev/null +++ b/webtools/addons/tpl/overview.tpl @@ -0,0 +1,41 @@ + +
+ +
+ +

Newest {$app} Addons

+
    +{section name=new loop=$newest} +
  1. +{$newest[new].Name} {$newest[new].Version} ({$newest[new].DateAdded|date_format}) - {$newest[new].Description} ... +
  2. +{/section} +
+

More ...

+ +

Popular {$app} Extensions

+
    +{section name=pe loop=$popularExtensions} +
  1. +{$popularExtensions[pe].name} ({$popularExtensions[pe].Rating} rating, {$popularExtensions[pe].dc} downloads) - {$popularExtensions[pe].Description} ... +
  2. +{/section} +
+

More ...

+ +

Popular {$app} Themes

+
    +{section name=pt loop=$popularThemes} +
  1. {$popularThemes[pt].name} ({$popularThemes[pt].Rating} rating, {$popularThemes[pt].dc} downloads)
  2. +{/section} +
+

More ...

+