<?php

/**
 * Plugin listing that shows available plugins for Firefox.
 * 
 * @package amo
 * @subpackage docs
 */
$currentTab = 'plugins';
startProcessing('plugins.tpl', $memcacheId, $compileId, 'rustico');
// Assign template variables.
$tpl->assign(array('currentTab' => $currentTab, 'title' => 'Plugins', 'content' => 'plugins.tpl', 'sidebar' => 'inc/plugin-sidebar.tpl', 'currentTab' => 'plugins'));
<?php

/**
 * Policy page.
 *
 * @package amo
 * @subpackage docs
 *
 * @todo talk to cbeard and rebron about establishing the policy document.
 */
startProcessing('policy.tpl', 'policy', $compileId);
require_once 'includes.php';
$links = array(array('href' => './faq.php', 'title' => 'Frequently Asked Questions', 'text' => 'FAQ'), array('href' => './policy.php', 'title' => 'Addons Policies', 'text' => 'Policy'));
// Send FAQ data to Smarty object.
$tpl->assign(array('links' => $links, 'sidebar' => 'inc/nav.tpl', 'content' => 'policy.tpl', 'title' => 'Policy'));
<?php

/**
 * Page that validates whether a user is logged in.  If they aren't, it will prompt
 * them for their username/pass
 *
 * @package amo
 * @subpackage docs
 *
 */
startProcessing('login.tpl', null, null, 'rustico');
require_once 'includes.php';
// When the template is drawn, if this isn't null, it will print out a "failure to
// authenticate, try again" message.
$login_error = null;
$valid_destinations = array('default' => WEB_PATH . '/index.php', 'rate' => WEB_PATH . '/ratecomment.php', 'comment' => WEB_PATH . '/addcomment.php');
if (!empty($_POST['username']) && !empty($_POST['password'])) {
    if ($_auth->authenticate($_POST['username'], $_POST['password'])) {
        session_start();
        $_auth->createSession();
        if (array_key_exists('dest', $_GET) && array_key_exists($_GET['dest'], $valid_destinations)) {
            $_next_page = $valid_destinations[$_GET['dest']];
        } else {
            $_next_page = $valid_destinations['default'];
        }
        /* Right now $_GET['aid'] is needed for all pages, but potentially you could
         * login and not need it, so this should handle all cases. */
        if (array_key_exists('aid', $_GET) && is_numeric($_GET['aid'])) {
            $_addon = "?aid={$_GET['aid']}";
        } else {
            $_addon = '';
<?php

/**
 * Addon summary page.  Displays a top-down view of all Addon properties.
 * 
 * @package amo
 * @subpackage docs
 */
// Get the int value of our addon ID.
$clean['ID'] = intval($_GET['id']);
$sql['ID'] =& $clean['ID'];
startProcessing('addon.tpl', $clean['ID'], $compileId, "rustico");
require_once 'includes.php';
// Create our AddOn object using the ID.
$addon = new AddOn($sql['ID']);
/* This is kind of a cheesy hack to determine how to display
   download links on the addon page.  If only one link is shown,
   there will just be an "Install Now" link, otherwise there will
   be links for each version. */
if (sizeof($addon->OsVersions) == 1) {
    $multiDownloadLinks = false;
} else {
    $multiDownloadLinks = true;
}
// Assign template variables.
$tpl->assign(array('addon' => $addon, 'multiDownloadLinks' => $multiDownloadLinks, 'title' => $addon->Name, 'content' => 'addon.tpl', 'sidebar' => 'inc/addon-sidebar.tpl'));
<?php

/**
 * Overview provides an inside look at what is going on for an application.
 *
 * @package amo
 * @subpackage docs
 */
$currentTab = 'home';
setApp();
$pageType = $clean['app'] === 'Firefox' ? 'rustico' : 'nonav';
startProcessing('index.tpl', 'home', $compileId, $pageType);
require_once 'includes.php';
$amo = new AMO_Object();
header("Cache-Control: max-age=120, must-revalidate");
// Assign template variables.
$tpl->assign(array('popularExtensions' => $amo->getPopularAddons($sql['app'], 'E', 5), 'feature' => $amo->getFeature($sql['app']), 'currentTab' => $currentTab, 'app' => $sql['app']));
<?php

/**
 * Search page.  All searches are filtered through this page.
 *
 * @package amo
 * @subpackage docs
 */
// App.
$clean['app'] = isset($app) ? $app : 'firefox';
$pageType = $clean['app'] == 'firefox' ? 'rustico' : 'nonav';
startProcessing('search.tpl', $memcacheId, $compileId, $pageType);
require_once 'includes.php';
// Instantiate AMO_Object so we can get our categories and platforms.
$amo = new AMO_Object();
$appList = $amo->getApps();
$appSelectList = array();
foreach ($appList as $id => $name) {
    $appSelectList[strtolower($name)] = $name;
}
// Array to store our page information.
$page = array();
// Category.
if (isset($_GET['cat']) && ctype_digit($_GET['cat'])) {
    $clean['cat'] = intval($_GET['cat']);
}
// Type.
if (isset($_GET['type'])) {
    switch ($_GET['type']) {
        case 'T':
            $clean['type'] = 'T';
Exemple #7
0
<?php

/**
 * FAQ page.
 *
 * @package amo
 * @subpackage docs
 *
 * @todo FAQ search?
 */
startProcessing('faq.tpl', 'faq', $compileId, "rustico");
require_once 'includes.php';
$db->query("\n    SELECT\n        `title`,\n        `text`\n    FROM\n        `faq`\n    WHERE\n        `active` = 'YES'\n    ORDER BY\n        `index` ASC,\n        `title` ASC\n", SQL_ALL, SQL_ASSOC);
$faq = $db->record;
$sql = "\n    SELECT \n        `AppName`,\n        `GUID`,\n        `Version`\n    FROM\n        `applications`\n    WHERE\n        `public_ver`='YES'\n    ORDER BY\n        Appname, Version\n";
$db->query($sql, SQL_ALL, SQL_ASSOC);
if (is_array($db->record)) {
    foreach ($db->record as $row) {
        $appVersions[] = array('displayVersion' => $row['Version'], 'appName' => $row['AppName'], 'guid' => $row['GUID']);
    }
}
$links = array(array('href' => './faq.php', 'title' => 'Frequently Asked Questions', 'text' => 'FAQ'), array('href' => './policy.php', 'title' => 'Addons Policies', 'text' => 'Policy'));
// Send FAQ data to Smarty object.
$tpl->assign(array('faq' => $faq, 'links' => $links, 'sidebar' => 'inc/nav.tpl', 'content' => 'faq.tpl', 'title' => 'Frequently Asked Questions', 'appVersions' => $appVersions));
//   Chris "Wolf" Crews <*****@*****.**>
//
// Alternatively, the contents of this file may be used under the terms of
// either the GNU General Public License Version 2 or later (the "GPL"), or
// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
// in which case the provisions of the GPL or the LGPL are applicable instead
// of those above. If you wish to allow use of your version of this file only
// under the terms of either the GPL or the LGPL, and not to allow others to
// use your version of this file under the terms of the MPL, indicate your
// decision by deleting the provisions above and replace them with the notice
// and other provisions required by the GPL or the LGPL. If you do not delete
// the provisions above, a recipient may use your version of this file under
// the terms of any one of the MPL, the GPL or the LGPL.
//
// ***** END LICENSE BLOCK *****
startProcessing('winners.tpl', null, $compileId, 'nonav');
require_once 'includes.php';
/**
 * Setting up variables.
 */
$guids = array('*****@*****.**' => 'Grand Prize Winner: New Extension, Best in Class: Best User Experience New Extension', '{c45c406e-ab73-11d8-be73-000a95be3b12}' => 'Grand Prize Winner: Upgraded Extension', '{89506680-e3f4-484c-a2c0-ed711d481eda}' => 'Grand Prize Winner: Best Use of Firefox 1.5 Features', '*****@*****.**' => 'Best in Class: Most Innovative New Extension', '{a6ca9b3b-5e52-4f47-85d8-cca35bb57596}' => 'Best in Class: Most Innovative Upgraded Extension', '*****@*****.**' => 'Best in Class Most Useful New Extension', '{53A03D43-5363-4669-8190-99061B2DEBA5}' => 'Best in Class: Most Useful Upgraded Extension', '{097d3191-e6fa-4728-9826-b533d755359d}' => 'Best in Class: Best User Experience Upgraded Extension', '{bbc21d30-1cff-11da-8cd6-0800200c9a66}' => 'Best in Class: Best Integration with a Web Service New Extension', '{3CE993BF-A3D9-4fd2-B3B6-768CBBC337F8}' => 'Best in Class: Best Integration with a Web Service Upgraded Extension');
$guids_tmp = array();
foreach ($guids as $guid => $discard) {
    $guids_tmp[] = "'" . $guid . "'";
}
$guids_imploded = implode(',', $guids_tmp);
$descriptions = array('{097d3191-e6fa-4728-9826-b533d755359d}' => "Manage Extensions, Themes, Downloads, and more including Web content via Firefox’s sidebar.", '{89506680-e3f4-484c-a2c0-ed711d481eda}' => "View open Tabs and Windows with Showcase.  You can use it in two ways: global mode (F12) or local mode (Shift + F12). In global mode, a new window will be opened with thumbnails of the pages you've opened in all windows. In local mode, only content in tabs of your current window will be shown.\n\nYou can also right click in those thumbnails to perform the most usual operations on them. Mouse middle button can be used to zoom a thumbnail, although other actions can be assigned to it.", '{3CE993BF-A3D9-4fd2-B3B6-768CBBC337F8}' => "Get international weather forecasts and display it in any toolbar or status bar.", '{bbc21d30-1cff-11da-8cd6-0800200c9a66}' => "Allows sticky notes to be added to any web page, and viewed upon visiting the Web page again.  You can also share sticky notes.  Requires account.", '*****@*****.**' => "Reveal allows you to see thumbnails of pages in your history by mousing over the back and forward buttons.  With many tabs open, quickly find the page you want, by pressing F2. Reveal also has a rectangular magnifying glass you can use to zoom in on areas of any web page. Comes  with a quick tour of all the features. ", '{a6ca9b3b-5e52-4f47-85d8-cca35bb57596}' => "A lightweight RSS and Atom feed aggregator.  Alt+S to open Sage in the Sidebar to start reading feed content.", '{53A03D43-5363-4669-8190-99061B2DEBA5}' => "Highlight text, create sticky notes, and more to Web pages and Web sites that are saved to your desktop.  Scrapbook Includes full text search and quick filtering of saved pages.", '*****@*****.**' => "Click on the icon in the status bar to view all Web pages in Tabbed windows as thumbnail images.  Press F8 to activate foXpose.", '{c45c406e-ab73-11d8-be73-000a95be3b12}' => "Web developer toolbar includes various development tools such as window resizing, form and image debugging, links to page validation and optimization tools and much more.", '*****@*****.**' => "Manage tabs by creating a tab separator.  Right click on a Tab to add a new Tab separator.  Click on the Tab separator to view thumbnail images of web sites that are to the left and right of the Tab separator.");
$screenshots = array('{097d3191-e6fa-4728-9826-b533d755359d}' => 'all-in-one-mini.png', '{89506680-e3f4-484c-a2c0-ed711d481eda}' => 'firefox-showcase.png', '{3CE993BF-A3D9-4fd2-B3B6-768CBBC337F8}' => 'forecastfoxenhanced-small.png', '{bbc21d30-1cff-11da-8cd6-0800200c9a66}' => 'stickies-small.png', '*****@*****.**' => 'reveal.png', '{a6ca9b3b-5e52-4f47-85d8-cca35bb57596}' => 'sage.png', '{53A03D43-5363-4669-8190-99061B2DEBA5}' => 'scrapbook-final.png', '*****@*****.**' => 'separe.png', '*****@*****.**' => 'xpose-small.png', '{c45c406e-ab73-11d8-be73-000a95be3b12}' => 'web-developer-toolbar-small.png');
$authors = array('{53A03D43-5363-4669-8190-99061B2DEBA5}' => 'Taiga Gomibuchi', '*****@*****.**' => 'Massimo Mangoni');
$winners = array();
// Get data for GUIDs.
<?php

/**
 * Support page.
 * @package amo
 * @subpackage docs
 */
startProcessing('support.tpl', $memcacheId, $compileId, 'rustico');
$tpl->assign(array('title' => 'Support', 'content' => 'support.tpl'));
<?php

/**
 * Page to reset passwords for existing accounts
 *
 * @package amo
 * @subpackage docs
 *
 */
startProcessing('resetpassword.tpl', null, null, 'rustico');
require_once 'includes.php';
if (!(array_key_exists('email', $_GET) && array_key_exists('code', $_GET))) {
    triggerError('There was an error processing your request.');
}
$user = user::getUserByEmail($_GET['email']);
if ($user === false) {
    // bad email address
    triggerError('There was an error processing your request.');
}
$authorized = $user->checkResetPasswordCode($_GET['email'], $_GET['code']);
if ($authorized === false) {
    // bad code
    triggerError('There was an error processing your request.');
}
$bad_input = false;
$success = false;
if (array_key_exists('password', $_POST) && array_key_exists('passwordconfirm', $_POST) && !empty($_POST['password'])) {
    if ($_POST['password'] != $_POST['passwordconfirm']) {
        $bad_input = true;
    }
    if ($bad_input === false) {
<?php

/**
 * Page to recover passwords for existing accounts
 *
 * @package amo
 * @subpackage docs
 *
 */
startProcessing('recoverpassword.tpl', null, null, 'rustico');
require_once 'includes.php';
$bad_input = false;
$success = false;
// Give us a default value if it exists
$email_value = array_key_exists('email', $_GET) ? $_GET['email'] : '';
if (array_key_exists('email', $_POST) && !empty($_POST['email'])) {
    $user = user::getUserByEmail($_POST['email']);
    if ($user === false) {
        // bad email address
        $bad_input = true;
    } else {
        $user->generateConfirmationCode();
        $user->sendPasswordRecoveryEmail();
        $success = true;
    }
    //override the get string
    $email_value = $_POST['email'];
}
// Assign template variables.
$tpl->assign(array('title' => 'Firefox Add-ons Password Recovery', 'currentTab' => null, 'email' => $email_value, 'bad_input' => $bad_input, 'success' => $success));
<?php

/**
 * Rate comment for Adddon.
 * 
 * @package amo
 * @subpackage docs
 * @TODO Disallow comment rating by poster -- users should not be able to rate their own comments.
 * @TODO Throttle for comment ratings.
 */
startProcessing('ratecomment.tpl', null, null, 'rustico');
require_once 'includes.php';
session_start();
// If some of the inputs don't exist, throw an error and exit
if (empty($_GET['aid']) || empty($_GET['cid']) || empty($_GET['r'])) {
    triggerError('Missing required parameter(s).  Script cannot continue.');
}
//This is a secure page, so we'll check the session
if (!$_auth->validSession()) {
    //id is already verified to be numeric from above
    $_aid = urlencode($_GET['aid']);
    $_cid = urlencode($_GET['cid']);
    $_r = urlencode($_GET['r']);
    header('Location: ' . WEB_PATH . "/login.php?dest=rate&aid={$_aid}&cid={$_cid}&r={$_r}");
    exit;
}
// Get our addon ID.
if (isset($_GET['aid'])) {
    $clean['aid'] = intval($_GET['aid']);
    $sql['aid'] =& $clean['aid'];
    // Get addon
<?php

/**
 * Verify a newly created account
 *
 * @package amo
 * @subpackage docs
 *
 */
startProcessing('verifyaccount.tpl', null, null, 'rustico');
require_once 'includes.php';
if (!(array_key_exists('email', $_GET) && array_key_exists('confirmationcode', $_GET))) {
    triggerError('There was an error processing your request.');
}
$user = user::getUserByEmail($_GET['email']);
// Most likely not a valid email
if ($user === false) {
    triggerError('There was an error processing your request.');
}
$confirmed = $user->confirm($_GET['confirmationcode']);
// Assign template variables.
$tpl->assign(array('title' => 'Verify your Firefox Add-ons Account', 'currentTab' => null, 'email' => $_GET['email'], 'confirmed' => $confirmed));
<?php

/**
 * Home page for extensions, switchable on application.
 *
 * @package amo
 * @subpackage docs
 * @todo make this dynamic based on an SQL field (recommended)
 */
startProcessing('bookmarks.tpl', 'bookmarks', $compileId, 'rustico');
require_once 'includes.php';
setApp();
$amo = new AMO_Object();
$primary = $amo->getAddons(array(3615));
if (is_array($primary) && !empty($primary)) {
    $primary = $primary[0];
}
$other = $amo->getAddons(array(2410, 1833));
// Assign template variables.
$tpl->assign(array('primary' => $primary, 'other' => $other, 'content' => 'bookmarks.tpl', 'currentTab' => 'bookmarks'));
Exemple #15
0
/**
 * Plugin Finder Service
 *
 * The purpose of this script is to determine a matching plugin based on mime-type
 * for an embedded HTML object, then return the correct information for a corresponding plugin.
 * 
 * @package amo
 * @subpackage docs
 * @TODO clean this ____ up
 *
 * @author Vladimir Vukicevic <*****@*****.**>
 * @author Doron Rosenberg <*****@*****.**>
 * @author Johnny Stenback <*****@*****.**>
 * @author Mike Morgan <*****@*****.**> (reindented everything 08/06)
 */
startProcessing('pfs.tpl', $memcacheId, $compileId, 'xml');
/**
 * Set variables.  We are allowing these to come in since they are compared to regular
 * expressions eventually anyway.  So yes, we are aware they are coming from $_GET.
 */
$mimetype = isset($_GET['mimetype']) ? $_GET['mimetype'] : null;
$reqTargetAppGuid = isset($_GET['appID']) ? $_GET['appID'] : null;
$reqTargetAppVersion = isset($_GET['appVersion']) ? $_GET['appVersion'] : null;
$clientOS = isset($_GET['clientOS']) ? $_GET['clientOS'] : null;
$chromeLocale = isset($_GET['chromeLocale']) ? $_GET['chromeLocale'] : null;
/**
 * Only execute if we have proper variables passed from the client.
 */
if (!empty($mimetype) && !empty($reqTargetAppGuid) && !empty($reqTargetAppVersion) && !empty($clientOS) && !empty($chromeLocale)) {
    /**
     * Figure out what plugins we've got, and what plugins we know where
<?php

/**
 * Addon history page.  Displays all the previous releases for a particular
 * addon or theme
 * 
 * @package amo
 * @subpackage docs
 *
 * @todo break this into a simpler design, probably a smaller table with an abbreviated desc.
 * @todo do we still want to allow users access to old versions?
 */
// Get our addon ID.
$clean['ID'] = intval($_GET['id']);
$sql['ID'] =& $clean['ID'];
startProcessing('history.tpl', $clean['ID'], $compileId, 'rustico');
require_once 'includes.php';
$addon = new AddOn($sql['ID']);
$addon->getHistory();
// Assign template variables.
$tpl->assign(array('addon' => $addon, 'title' => $addon->Name . ' Version History', 'content' => 'history.tpl', 'sidebar' => 'inc/addon-sidebar.tpl'));
Exemple #17
0
<?php

/**
 * Home page for extensions, switchable on application.
 *
 * @package amo
 * @subpackage docs
 */
startProcessing('feeds.tpl', null, $compileId, 'rustico');
require_once 'includes.php';
// Assign template variables.
$tpl->assign(array('title' => 'Feeds', 'content' => 'feeds.tpl'));
//   Chris "Wolf" Crews <*****@*****.**>
//
// Alternatively, the contents of this file may be used under the terms of
// either the GNU General Public License Version 2 or later (the "GPL"), or
// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
// in which case the provisions of the GPL or the LGPL are applicable instead
// of those above. If you wish to allow use of your version of this file only
// under the terms of either the GPL or the LGPL, and not to allow others to
// use your version of this file under the terms of the MPL, indicate your
// decision by deleting the provisions above and replace them with the notice
// and other provisions required by the GPL or the LGPL. If you do not delete
// the provisions above, a recipient may use your version of this file under
// the terms of any one of the MPL, the GPL or the LGPL.
//
// ***** END LICENSE BLOCK *****
startProcessing('finalists.tpl', null, $compileId, 'nonav');
require_once 'includes.php';
/**
 * Setting up variables.
 */
$guids = array('{34274bf4-1d97-a289-e984-17e546307e4f}', '{097d3191-e6fa-4728-9826-b533d755359d}', '{B9DAB69C-460E-4085-AE6C-F95B0D858581}', '{DDC359D1-844A-42a7-9AA1-88A850A938A8}', '{89506680-e3f4-484c-a2c0-ed711d481eda}', '{3CE993BF-A3D9-4fd2-B3B6-768CBBC337F8}', '{268ad77e-cff8-42d7-b479-da60a7b93305}', '{77b819fa-95ad-4f2c-ac7c-486b356188a9}', '{bbc21d30-1cff-11da-8cd6-0800200c9a66}', '{37E4D8EA-8BDA-4831-8EA1-89053939A250}', '{a089fffd-e0cb-431b-8d3a-ebb8afb26dcf}', '*****@*****.**', '{a6ca9b3b-5e52-4f47-85d8-cca35bb57596}', '{53A03D43-5363-4669-8190-99061B2DEBA5}', '*****@*****.**', '*****@*****.**', '{c45c406e-ab73-11d8-be73-000a95be3b12}', '{D5EDC062-A372-4936-B782-BD611DD18D86}');
$guids_tmp = array();
foreach ($guids as $guid) {
    $guids_tmp[] = "'" . $guid . "'";
}
$guids_imploded = implode(',', $guids_tmp);
$descriptions = array('{34274bf4-1d97-a289-e984-17e546307e4f}' => "Block ads including Flash ads from their source.  Right click on an ad and select Adblock to block ads.  Hit the status-element and see what has or hasn't been blocked.", '{097d3191-e6fa-4728-9826-b533d755359d}' => "Manage Extensions, Themes, Downloads, and more including Web content via Firefox’s sidebar.", '{B9DAB69C-460E-4085-AE6C-F95B0D858581}' => "Blog directly within Firefox to LiveJournal, WordPress or Blogger. Select Deepest Sender from the ‘Tools’ menu.", '{DDC359D1-844A-42a7-9AA1-88A850A938A8}' => "DownThemAll lets you filter and download all the links contained in any web-page, and lets you pause and resume downloads from previous Firefox sessions.", '{89506680-e3f4-484c-a2c0-ed711d481eda}' => "View open Tabs and Windows with Showcase.  You can use it in two ways: global mode (F12) or local mode (Shift + F12). In global mode, a new window will be opened with thumbnails of the pages you've opened in all windows. In local mode, only content in tabs of your current window will be shown.\n\nYou can also right click in those thumbnails to perform the most usual operations on them. Mouse middle button can be used to zoom a thumbnail, although other actions can be assigned to it.", '{3CE993BF-A3D9-4fd2-B3B6-768CBBC337F8}' => "Get international weather forecasts and display it in any toolbar or status bar.", '{268ad77e-cff8-42d7-b479-da60a7b93305}' => "Select from several of your favorite toolbars including including Google, Yahoo, Ask Jeeves, Teoma, Amazon, Download.com and others with one toolbar. The entire toolbar reconfigures when you select a different engine and it includes many advanced features found in each engine.\nYou can also easily repeat your search on all engines included in toolbar.", '{77b819fa-95ad-4f2c-ac7c-486b356188a9}' => "View pages with in Internet Explorer with IE Tab.  Select the Firefox icon on the bottom right of the browser to switch to using the Internet Explorer engine or Firefox to switch to IE.", '{bbc21d30-1cff-11da-8cd6-0800200c9a66}' => "Allows sticky notes to be added to any web page, and viewed upon visiting the Web page again.  You can also share sticky notes.  Requires account.", '{37E4D8EA-8BDA-4831-8EA1-89053939A250}' => "PDF Download Extension allows you to choose if you want to view a PDF file inside the browser (as PDF or HTML), if you want to view it outside Firefox with your default or custom PDF reader, or if you want to download it.", '{a089fffd-e0cb-431b-8d3a-ebb8afb26dcf}' => "Platypus is a Firefox extension which lets you modify a Web page from your browser -- \"What You See Is What You Get\" -- and then save those changes as a GreaseMonkey script so that they'll be repeated the next time you visit the page.", '*****@*****.**' => "Reveal allows you to see thumbnails of pages in your history by mousing over the back and forward buttons.  With many tabs open, quickly find the page you want, by pressing F2. Reveal also has a rectangular magnifying glass you can use to zoom in on areas of any web page. Comes  with a quick tour of all the features. ", '{a6ca9b3b-5e52-4f47-85d8-cca35bb57596}' => "A lightweight RSS and Atom feed aggregator.  Alt+S to open Sage in the Sidebar to start reading feed content.", '{53A03D43-5363-4669-8190-99061B2DEBA5}' => "Highlight text, create sticky notes, and more to Web pages and Web sites that are saved to your desktop.  Scrapbook Includes full text search and quick filtering of saved pages.", '*****@*****.**' => "Manage tabs by creating a tab separator.  Right click on a Tab to add a new Tab separator.  Click on the Tab separator to view thumbnail images of web sites that are to the left and right of the Tab separator.", '*****@*****.**' => "Click on the icon in the status bar to view all Web pages in Tabbed windows as thumbnail images.  Press F8 to activate foXpose.", '{c45c406e-ab73-11d8-be73-000a95be3b12}' => "Web developer toolbar includes various development tools such as window resizing, form and image debugging, links to page validation and optimization tools and much more.", '{D5EDC062-A372-4936-B782-BD611DD18D86}' => "RSS news reader with integrated with services such as Feedster and weather information.  Includes online help documentation.");
$screenshots = array('{34274bf4-1d97-a289-e984-17e546307e4f}' => 'adblock-mini.png', '{097d3191-e6fa-4728-9826-b533d755359d}' => 'all-in-one-mini.png', '{B9DAB69C-460E-4085-AE6C-F95B0D858581}' => 'deepest-sender-mini.png', '{DDC359D1-844A-42a7-9AA1-88A850A938A8}' => 'downthemall-small.png', '{89506680-e3f4-484c-a2c0-ed711d481eda}' => 'firefox-showcase.png', '{3CE993BF-A3D9-4fd2-B3B6-768CBBC337F8}' => 'forecastfoxenhanced-small.png', '{268ad77e-cff8-42d7-b479-da60a7b93305}' => 'groowe-small.png', '{77b819fa-95ad-4f2c-ac7c-486b356188a9}' => 'IE-Tab.png', '{bbc21d30-1cff-11da-8cd6-0800200c9a66}' => 'stickies-small.png', '{37E4D8EA-8BDA-4831-8EA1-89053939A250}' => 'pdf-download.png', '{a089fffd-e0cb-431b-8d3a-ebb8afb26dcf}' => 'platypus.png', '*****@*****.**' => 'reveal.png', '{a6ca9b3b-5e52-4f47-85d8-cca35bb57596}' => 'sage.png', '{53A03D43-5363-4669-8190-99061B2DEBA5}' => 'scrapbook-final.png', '*****@*****.**' => 'separe.png', '*****@*****.**' => 'xpose-small.png', '{c45c406e-ab73-11d8-be73-000a95be3b12}' => 'web-developer-toolbar-small.png', '{D5EDC062-A372-4936-B782-BD611DD18D86}' => 'wizz-small.png');
$authors = array('{34274bf4-1d97-a289-e984-17e546307e4f}' => 'Ben Karel (and the Adblock Crew)', '{DDC359D1-844A-42a7-9AA1-88A850A938A8}' => 'Federico Parodi', '{a6ca9b3b-5e52-4f47-85d8-cca35bb57596}' => 'Peter Andrews (and the Sage Team)', '{53A03D43-5363-4669-8190-99061B2DEBA5}' => 'Taiga Gomibuchi', '*****@*****.**' => 'Massimo Mangoni', '{77b819fa-95ad-4f2c-ac7c-486b356188a9}' => 'yuoo2k and Hong Jen Yee (PCMan)');
$finalists = array();
// Get data for GUIDs.
<?php

/**
 * This script tells clients whether or not a given add-on is blocklisted.
 *
 * It should always be well-formed and won't be seen by users,
 * at least initially.
 *
 * At some point we should consider generating an XSLT in case we want to
 * publish this list.
 *
 * @todo stylesheet for client viewing of blocklists
 * @package amo 
 * @subpackage pub
 */
startProcessing('blocklist.tpl', $memcacheId, $compileId, 'xml');
/**
 *  VARIABLES
 *
 *  Initialize, set up and clean variables.
 */
// Required variables that we need to run the script.
$required_vars = array('reqVersion', 'appGuid', 'appVersion');
// Version of the client requesting the blocklist (not used).
// Debug flag.
$debug = isset($_GET['debug']) && $_GET['debug'] == 'true' ? true : false;
// Array to hold errors for debugging.
$errors = array();
// Iterate through required variables, and escape/assign them as necessary.
foreach ($required_vars as $var) {
    if (empty($_GET[$var])) {
<?php

/**
 * Dictionaries page.
 *
 * @package amo
 * @subpackage docs
 */
startProcessing('dictionaries.tpl', 'dictionaries', $compileId, 'rustico');
require_once 'includes.php';
setApp();
$amo = new AMO_Object();
$dicts = $amo->getDictionaries();
// Assign template variables.
$tpl->assign(array('dicts' => $dicts, 'content' => 'dictionaries.tpl', 'currentTab' => 'dictionaries'));
<?php

/**
 * Home page for extensions, switchable on application.
 *
 * @package amo
 * @subpackage docs
 * @todo make this dynamic based on an SQL field (recommended)
 */
startProcessing('recommended.tpl', 'recommended', $compileId, 'rustico');
require_once 'includes.php';
setApp();
$amo = new AMO_Object();
// Assign template variables.
$tpl->assign(array('recommended' => $amo->getRecommendedAddons($sql['app'], 'E', 100), 'content' => 'recommended.tpl', 'currentTab' => 'recommended'));
<?php

/**
 * Home page for extensions, switchable on application.  Since v1 used GUIDs, the
 * flow on this page is a little confusing (we need to support both name and GUID.
 *
 * @package amo
 * @subpackage docs
 */
$currentTab = 'extensions';
startProcessing('extensions.tpl', 'extensions', $compileId, "rustico");
require_once 'includes.php';
$_app = array_key_exists('app', $_GET) ? $_GET['app'] : null;
// Determine our application.
switch ($_app) {
    case 'mozilla':
        $clean['app'] = 'Mozilla';
        break;
    case 'thunderbird':
        $clean['app'] = 'Thunderbird';
        break;
    case 'sunbird':
        $clean['app'] = 'Sunbird';
        break;
    case 'firefox':
    default:
        $clean['app'] = 'Firefox';
        break;
}
$amo = new AMO_Object();
// Despite what $clean holds, GUIDs were used in v1 so we have to support them
<?php

/**
 * VersionCheck.php is a dynamic RDF that compares version information for
 * extensions and determines whether or not an update is needed.  If an update
 * is needed, the correct update file is referenced based on the UMO database
 * and repository.  The script is set to die silently instead of echoing errors
 * clients don't use anyway.  For testing, if you would like to debug, supply
 * the script with ?debug=true
 *
 * @package amo 
 * @subpackage pub
 */
startProcessing('update.tpl', $memcacheId, $compileId, 'xml');
include 'version_comparison.inc.php';
/**
 *  VARIABLES
 *
 *  Initialize, set up and clean variables.
 */
// Map the mysql main.type enum into the right type.
$ext_typemap = array('T' => 'theme', 'E' => 'extension', 'P' => 'plugin');
// Required variables that we need to run the script.
$required_vars = array('reqVersion', 'id', 'version', 'appID', 'appVersion');
// Debug flag.
$debug = isset($_GET['debug']) && $_GET['debug'] == 'true' ? true : false;
// Array to hold errors for debugging.
$errors = array();
// Set OS.  get_os_id() can only return an int.
$sql['os_id'] = get_os_id();
// Iterate through required variables, and escape/assign them as necessary.
<?php

/**
 * Create a new account
 *
 * @package amo
 * @subpackage docs
 *
 */
startProcessing('createaccount.tpl', null, null, 'rustico');
require_once 'includes.php';
// If there are problems, these will be set to true and used in the template.  By
// using null/booleans, error messages are kept in the template.
$error_email_empty = null;
$error_email_malformed = null;
$error_emailconfirm_empty = null;
$error_emailconfirm_nomatch = null;
$error_email_duplicate = null;
$error_name_empty = null;
$error_password_empty = null;
$error_passwordconfirm_empty = null;
$error_passwordconfirm_nomatch = null;
$_bad_input = false;
// think positive :)
$account_created = false;
if (array_key_exists('submit', $_POST) && isset($_POST['submit'])) {
    /* Verify Input */
    // Check email - a little long and confusing.  Basically, throw an error if
    // the following is not met (in order):
    // $email is set, $emailconfirm is set, $email=$emailconfirm, and $email is a valid address
    if (!array_key_exists('email', $_POST) || empty($_POST['email'])) {
<?php

/**
 * Add a comment to any Addon.
 *
 * @package amo
 * @subpackage docs
 *
 * Variables:
 *   $_GET['aid'] = Addon ID (integer)
 */
startProcessing('addcomment.tpl', null, null, 'rustico');
require_once 'includes.php';
session_start();
if (!array_key_exists('aid', $_GET) || !is_numeric($_GET['aid'])) {
    triggerError('There was an error processing your request.');
}
//This is a secure page, so we'll check the session
if (!$_auth->validSession()) {
    //id is already verified to be numeric from above
    header('Location: ' . WEB_PATH . "/login.php?dest=comment&aid={$_GET['aid']}");
    exit;
}
// If there are errors, this will be populated
$_errors = array();
// This will be used in queries and the template
$addon = new AddOn($_GET['aid']);
// If the comment is added successfully, this will toggle (used in the template)
$added_comment = false;
// They're posting a comment
if (isset($_POST['c_submit'])) {
<?php

/**
 * Overview provides an inside look at what is going on for an application.
 *
 * @package amo
 * @subpackage docs
 *
 * @todo Do something to spice up this page.
 * @todo Get main template spruced up.
 */
$currentTab = 'search-engines';
startProcessing('search-engines.tpl', 'searchEngines', $compileId, 'rustico');
require_once 'includes.php';
// Assign template variables.
$tpl->assign(array('title' => 'Search Engines', 'currentTab' => $currentTab, 'content' => 'search-engines.tpl'));
<?php

/**
 * Addon previews page.  Displays all the previews for a particular addon or extension.
 * 
 * @package amo
 * @subpackage docs
 */
// Get the int value of our addon ID.
$clean['ID'] = intval($_GET['id']);
$sql['ID'] =& $clean['ID'];
startProcessing('previews.tpl', $clean['ID'], $compileId, 'rustico');
require_once 'includes.php';
$addon = new AddOn($sql['ID']);
$addon->getPreviews();
// Assign template variables.
$tpl->assign(array('addon' => $addon, 'title' => $addon->Name . ' Previews &amp; Screenshots', 'content' => 'previews.tpl', 'sidebar' => 'inc/addon-sidebar.tpl'));
<?php

/**
 * Author information.
 * @package amo
 * @subpackage docs
 */
// Get our addon ID.
$clean['UserID'] = intval($_GET['id']);
$sql['UserID'] =& $clean['UserID'];
startProcessing('author.tpl', $clean['UserID'], $compileId, 'rustico');
require_once 'includes.php';
$user = new User($sql['UserID']);
// Assign template variables.
$tpl->assign(array('user' => $user, 'title' => $user->UserName, 'content' => 'author.tpl', 'sidebar' => 'inc/author-sidebar.tpl'));
<?php

/**
 * Home page for themes, switchable on application.  Since v1 used GUIDs, the
 * flow on this page is a little confusing (we need to support both name and GUID.
 *
 * @package amo
 * @subpackage docs
 */
$currentTab = 'themes';
startProcessing('themes.tpl', 'themes', $compileId, "rustico");
require_once 'includes.php';
$_app = array_key_exists('app', $_GET) ? $_GET['app'] : null;
// Determine our application.
switch ($_app) {
    case 'seamonkey':
    case 'mozilla':
        $clean['app'] = 'Mozilla';
        break;
    case 'thunderbird':
        $clean['app'] = 'Thunderbird';
        break;
    case 'sunbird':
        $clean['app'] = 'Sunbird';
        break;
    case 'firefox':
    default:
        $clean['app'] = 'Firefox';
        break;
}
$amo = new AMO_Object();
 * @TODO Throttle comment entry.
 */
// Get our addon id.
$clean['id'] = intval($_GET['id']);
$sql['id'] =& $clean['id'];
// Sort.
if (isset($_GET['sort']) && ctype_alpha($_GET['sort'])) {
    $clean['sort'] = $_GET['sort'];
}
// Starting point.
$page['left'] = isset($_GET['left']) ? intval($_GET['left']) : 0;
// Ending point.
$page['right'] = $page['left'] + 10;
// Order by.
$page['orderby'] = !empty($_GET['orderby']) && ctype_alpha($_GET['orderby']) ? $_GET['orderby'] : "";
startProcessing('comments.tpl', $clean['id'], $compileId, 'rustico');
require_once 'includes.php';
$addon = new AddOn($sql['id']);
$addon->getComments($page['left'], 10, $page['orderby']);
// Get our result count.
$db->query("SELECT FOUND_ROWS()", SQL_INIT);
$resultCount = !empty($db->record) ? $db->record[0] : $page['right'];
if ($resultCount < $page['right']) {
    $page['right'] = $resultCount;
}
// Do we even have a next or previous page?
$page['previous'] = $page['left'] >= 10 ? $page['left'] - 10 : null;
$page['next'] = $page['left'] + 10 < $resultCount ? $page['left'] + 10 : null;
$page['resultCount'] = $resultCount;
$page['leftDisplay'] = $page['left'] + 1;
// Build the URL based on passed arguments.