added overview page, serves as overview for a specific application

This commit is contained in:
mike.morgan%oregonstate.edu 2005-07-18 08:26:54 +00:00
Родитель e89e906af5
Коммит 28921d1a64
7 изменённых файлов: 233 добавлений и 7 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -1,13 +1,17 @@
<?php
/**
* Finish script.
*
* @package amo
* @subpackage inc
*/
// Disconnect from our database.
$db->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);
?>

Просмотреть файл

@ -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';
?>

Просмотреть файл

Просмотреть файл

@ -0,0 +1,138 @@
<?php
/**
* Overview provides an inside look at what is going on for an application.
*
* @package amo
* @subpackage docs
*/
// Arrays to store clean inputs.
$clean = array(); // General array for verified inputs.
$sql = array(); // Trusted for SQL.
// 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 'SeaMonkey':
$clean['app'] = 'SeaMonkey';
break;
case 'Firefox':
default:
$clean['app'] = 'Firefox';
break;
}
// $sql['app'] can equal $clean['app'] since it was assigned in a switch().
$sql['app'] =& $clean['app'];
// Get most popular extensions based on application.
$db->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';
?>

Просмотреть файл

@ -54,18 +54,18 @@
<div id="key-menu">
<dl id="menu-firefox">
<dt>Firefox:</dt>
<dd><a href="{$config.webpath}/overview.php?app=firefox&amp;type=E" title="Get Extensions for the Firefox Browser">Extensions</a>, <a href="{$config.webpath}/overview.php?app=firefox&amp;type=T" title="Get Themes for the Firefox Browser">Themes</a>, <a href="https://pfs.mozilla.org/plugins/" title="Get Plugins for Firefox">Plugins</a></dd>
<dt><a href="./overview.php?app=Firefox">Firefox</a>:</dt>
<dd><a href="{$config.webpath}/search.php?app=firefox&amp;type=E" title="Get Extensions for the Firefox Browser">Extensions</a>, <a href="{$config.webpath}/search.php?app=firefox&amp;type=T" title="Get Themes for the Firefox Browser">Themes</a>, <a href="https://pfs.mozilla.org/plugins/" title="Get Plugins for Firefox">Plugins</a></dd>
</dl>
<dl id="menu-thunderbird">
<dt>Thunderbird:</dt>
<dd><a href="{$config.webpath}/overview.php?app=thunderbird&amp;type=T" title="Get Extensions for Thunderbird Email">Extensions</a>, <a href="{$config.webpath}/overview.php?app=thunderbird&type=T" title="Get Themes for Thunderbird Email">Themes</a></dd>
<dt><a href="./overview.php?app=Thunderbird">Thunderbird</a>:</dt>
<dd><a href="{$config.webpath}/search.php?app=thunderbird&amp;type=T" title="Get Extensions for Thunderbird Email">Extensions</a>, <a href="{$config.webpath}/search.php?app=thunderbird&amp;type=T" title="Get Themes for Thunderbird Email">Themes</a></dd>
</dl>
<dl id="menu-mozillasuite">
<dt>Mozilla Suite:</dt>
<dt><a href="./overview.php?app=Mozilla">Mozilla Suite</a>:</dt>
<dd><a href="{$config.webpath}/overview.php?app=mozilla&amp;type=E" title="Get Extensions for the Mozilla Suite">Extensions</a>, <a href="{$config.webpath}/overview.php?app=mozilla&amp;type=T" title="Get Themes for the Mozilla Suite">Themes</a>, <a href="https://pfs.mozilla.org/plugins/" title="Get Plugins for Mozilla Suite">Plugins</a></dd>
<dd><a href="{$config.webpath}/search.php?app=mozilla&amp;type=E" title="Get Extensions for the Mozilla Suite">Extensions</a>, <a href="{$config.webpath}/search.php?app=mozilla&amp;type=T" title="Get Themes for the Mozilla Suite">Themes</a>, <a href="https://pfs.mozilla.org/plugins/" title="Get Plugins for Mozilla Suite">Plugins</a></dd>
</dl>
<div class="ie-clear-menu">&nbsp;</div>
</div>

Просмотреть файл

@ -0,0 +1,41 @@
<div class="tabs">
<ul>
{section name=tabs loop=$tabs}
{if $tabs[tabs].app eq $app}
<li><a href="./overview.php?app={$tabs[tabs].app|escape}" class="active-tab">{$tabs[tabs].app|escape}</a></li>
{else}
<li><a href="./overview.php?app={$tabs[tabs].app|escape}">{$tabs[tabs].app|escape}</a></li>
{/if}
{/section}
</ul>
</div>
<h2>Newest {$app} Addons</h2>
<ol class="popularlist">
{section name=new loop=$newest}
<li>
<a href="./addon.php?id={$newest[new].ID}">{$newest[new].Name} {$newest[new].Version}</a> ({$newest[new].DateAdded|date_format}) - {$newest[new].Description} ...
</li>
{/section}
</ol>
<p><strong><a href="./search.php?app={$app}&amp;cat=Newest">More ...</a></strong></p>
<h2>Popular {$app} Extensions</h2>
<ol class="popularlist">
{section name=pe loop=$popularExtensions}
<li>
<a href="./addon.php?id={$popularExtensions[pe].id}">{$popularExtensions[pe].name}</a> <span class="downloads">({$popularExtensions[pe].Rating} rating, {$popularExtensions[pe].dc} downloads)</span> - {$popularExtensions[pe].Description} ...
</li>
{/section}
</ol>
<p><strong><a href="./search.php?app={$app}&amp;cat=Popular&amp;type=E">More ...</a></strong></p>
<h2>Popular {$app} Themes</h2>
<ol class="popularlist">
{section name=pt loop=$popularThemes}
<li><a href="./addon.php?id={$popularThemes[pt].id}">{$popularThemes[pt].name}</a> <span class="downloads">({$popularThemes[pt].Rating} rating, {$popularThemes[pt].dc} downloads)</span></li>
{/section}
</ol>
<p><strong><a href="./search.php?app={$app}&amp;cat=Popular&amp;type=T">More ...</a></strong></p>