This commit is contained in:
bugzilla%micropipes.com 2006-04-06 03:46:50 +00:00
Родитель 996b6bb281
Коммит 71740ba3fa
4 изменённых файлов: 35 добавлений и 0 удалений

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

@ -34,6 +34,9 @@ $amo = new AMO_Object();
if (preg_match('/^(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}|[a-z0-9-\._]*\@[a-z0-9-\._]+)$/i',$_app)) {
$newestExtensions = $amo->getNewestAddonsByGuid($_app,'E',10);
$popularExtensions = $amo->getPopularAddonsByGuid($_app,'E',10);
/* This is a bit of a cheesy hack because of the way the templates are written.
* It's looking for the name of the app in $_GET, so here we are...*/
$_GET['app'] = strtolower($amo->getAppNameFromGuid($_app));
} else {
$newestExtensions = $amo->getNewestAddons($clean['app'],'E',10);
$popularExtensions = $amo->getPopularAddons($clean['app'],'E',10);

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

@ -38,6 +38,9 @@
{elseif $smarty.get.app eq "mozilla"}
{assign var="app" value="mozilla"}
<h1><a href="{$config.webpath}/?app=mozilla" title="Return to home page" accesskey="1"><img src="{$config.webpath}/images/title-suite.gif" width="370" height="54" alt="Mozilla Suite Add-ons Beta"></a></h1>
{elseif $smarty.get.app eq "seamonkey"}
{assign var="app" value="mozilla"}
<h1><a href="{$config.webpath}/?app=mozilla" title="Return to home page" accesskey="1"><img src="{$config.webpath}/images/title-suite.gif" width="370" height="54" alt="Mozilla Suite Add-ons Beta"></a></h1>
{else}
{assign var="app" value="firefox"}
<h1><a href="{$config.webpath}/?app=firefox" title="Return to home page" accesskey="1"><img src="{$config.webpath}/images/title-firefox.gif" width="276" height="54" alt="Firefox Add-ons Beta"></a></h1>

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

@ -37,6 +37,9 @@
{elseif $smarty.get.app eq "mozilla"}
{assign var="app" value="mozilla"}
<h1><a href="{$config.webpath}/mozilla/" title="Return to home page" accesskey="1"><img src="{$config.webpath}/images/title-suite.gif" width="370" height="54" alt="Mozilla Suite Add-ons Beta"></a></h1>
{elseif $smarty.get.app eq "seamonkey"}
{assign var="app" value="mozilla"}
<h1><a href="{$config.webpath}/mozilla/" title="Return to home page" accesskey="1"><img src="{$config.webpath}/images/title-suite.gif" width="370" height="54" alt="Mozilla Suite Add-ons Beta"></a></h1>
{else}
{assign var="app" value="firefox"}
<h1><a href="{$config.webpath}/firefox/" title="Return to home page" accesskey="1"><img src="{$config.webpath}/images/title-firefox.gif" width="276" height="54" alt="Firefox Add-ons Beta"></a></h1>

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

@ -492,5 +492,31 @@ class AMO_Object
return $this->db->record;
}
/**
* Get the name of an application from the GUID
*
* @param string $guid
* @return string name of the application
*/
function getAppNameFromGuid($app) {
$_app = mysql_real_escape_string($app);
$this->db->query("
SELECT
`AppName`
FROM
`applications`
WHERE
GUID='{$_app}'
LIMIT 1
", SQL_INIT, SQL_ASSOC);
// Our DB class makes me a sad panda :(
$throwaway = $this->db->record;
return $throwaway['AppName'];
}
}
?>