DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
<?php
// ***** BEGIN LICENSE BLOCK *****
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
//
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
//
// The Original Code is Mozilla Update.
//
// The Initial Developer of the Original Code is
// Chris "Wolf" Crews.
// Portions created by the Initial Developer are Copyright (C) 2004
// the Initial Developer. All Rights Reserved.
//
// Contributor(s):
//   Chris "Wolf" Crews <psychoticwolf@carolina.rr.com>
//
// 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 *****
?>
<?php
require"core/config.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

<head>
 <title>Mozilla Update</title>
 <link rel="alternate" type="application/rss+xml" title="New <?php echo ucwords($application); ?> Additions" href="/rss/?application=<?php echo"$application"; ?>&amp;list=newest">
<?php
include"$page_header";
?>

<?php
//Get Current Version for Detected Application
$sql = "SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `applications` WHERE `AppName` = '$application' AND `public_ver` = 'YES'  ORDER BY `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
    $row = mysql_fetch_array($sql_result);
        $version = $row["Version"];
        $subver = $row["SubVer"];
        $release = "$row[major].$row[minor]";
        if ($row["release"]) {
            $release = ".$release$row[release]";
        }
    $currentver = $release;
    $currentver_display = $version;
    unset($version,$subver,$release);

?>

<?php
$securitywarning=false;
if ($securitywarning=="true") {
?>
<!-- Don't display if no urgent security updates -->
<div class="key-point"><p class="security-update"><strong>Important Firefox Security Update:</strong><br>Lorem ipsum dolor sit amet, <a href="#securitydownload">consectetuer adipiscing</a> elit. Curabitur viverra ultrices ante. Aliquam nec lectus. Praesent vitae risus. Aenean vulputate sapien et leo. Nullam euismod tortor id wisi.</p></div>
<hr class="hide">
<!-- close security update -->
<?php } ?>

<div id="mBody">
	<div id="mainContent" class="right">
	<h2>What is Mozilla Update?</h2>
	<p class="first">Mozilla Update is the place to get extras for your <a href="http://www.mozilla.org/">Mozilla</a> products. Learn more <a href="/about/">about us</a>.</p>

    <?php
    $uriparams_skip="application";
    ?>
	<dl>
		<dt>Extensions</dt>
		<dd>Extensions are small add-ons that add new functionality to your Mozilla program. They can add anything from a toolbar button to a completely new feature. Browse extensions for: <a href="/extensions/?<?php echo"".uriparams()."&amp;"; ?>application=firefox">Firefox</a>, <a href="/extensions/?<?php echo"".uriparams()."&amp;"; ?>application=thunderbird">Thunderbird</a>, <a href="/extensions/?<?php echo"".uriparams()."&amp;"; ?>application=mozilla">Mozilla&nbsp;Suite</a></dd>
		<dt>Themes</dt>
		<dd>Themes allow you to change the way your Mozilla program looks. New graphics and colors. Browse themes for: <a href="/themes/?<?php echo"".uriparams()."&amp;"; ?>application=firefox">Firefox</a>, <a href="/themes/?<?php echo"".uriparams()."&amp;"; ?>application=thunderbird">Thunderbird</a>, <a href="/themes/?<?php echo"".uriparams()."&amp;"; ?>application=mozilla">Mozilla&nbsp;Suite</a></dd>
		<dt>Plugins</dt>
		<dd>Plugins are programs that allow websites to provide content to you and have it appear in your browser. Examples of Plugins are Flash, RealPlayer, and Java. Browse plug-ins for <a href="/plugins/">Mozilla Suite and Firefox</a></dd>
		<!--<dt>Search Engines</dt>
		<dd>In Firefox, you can add search engines that will be available in the search in the top of the browser. Browse search engines for <a href="/searchengines/">Firefox</a></dd>-->
	</dl>
    <?php
    unset($uriparams_skip);
    ?>
    <?php
    $featuredate = date("Ym");
    $sql = "SELECT TM.ID, TM.Type, TM.Name, TR.Title, TR.Body, TR.ExtendedBody, TP.PreviewURI 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
            INNER JOIN `reviews` TR ON TR.ID = TM.ID
            INNER JOIN `previews` TP ON TP.ID = TM.ID
            WHERE  `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND (`OSName` = '$OS' OR `OSName` = 'ALL') AND `approved` = 'YES' AND TR.featured = 'YES' AND TR.featuredate = '$featuredate' AND TP.preview='YES' LIMIT 1";
        $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
        while ($row = mysql_fetch_array($sql_result)) {
        $id = $row["ID"];
        $type = $row["Type"];
        if ($type=="E") {$typename = "extensions"; } else if ($type=="T") {$typename="themes"; }
        $name = $row["Name"];
        $title = $row["Title"];
        $body = nl2br($row["Body"]);
        $extendedbody = $row["ExtendedBody"];
        $previewuri = $row["PreviewURI"];
        $attr = getimagesize("$websitepath/$previewuri");
        $attr = $attr[3];

    ?>
	<h2>Currently Featuring... <?php echo"$name"; ?></a></h2>
	<a href="<?php echo"/$typename/moreinfo.php?".uriparams()."&amp;id=$id"; ?>"><img src="<?php echo"$previewuri"; ?>" <?php echo"$attr"; ?> alt="<?php echo"$name for $application"; ?>" class="imgright"></a>
    <p class="first">
    <strong><a href="<?php echo"/$typename/moreinfo.php?".uriparams()."&amp;id=$id"; ?>" style="text-decoration: none"><?php echo"$title"; ?></a></strong><br>
    <?php
    echo"$body";  
    if ($extendedbody) {
        echo" <a href=\"/$typename/moreinfo.php?".uriparams()."&amp;id=$id&amp;page=staffreview#more\">More...</a>";
    }
    ?></p>
    <?php } ?>
	</div>
	<div id="side" class="right">
	<h2>Most Popular <?php echo ucwords($application); ?> Extensions</h2>
	<ol class="popularlist">

        <?php
        $i=0;
        $sql = "SELECT TM.ID, TV.vID,TM.Name, TV.Version, TM.TotalDownloads, TM.downloadcount
            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  `Type`  =  'E' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND (`OSName` = '$OS' OR `OSName` = 'ALL') AND `downloadcount` > '0' AND `approved` = 'YES' ORDER BY `downloadcount` DESC ";
        $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
            if (mysql_num_rows($sql_result)=="0") {
                echo"        <li>No Popular Extensions</li>\n";
            }
            while ($row = mysql_fetch_array($sql_result)) {
                $i++;
                $id = $row["ID"];
                $vid = $row["vID"];
                $name = $row["Name"];
                $version = $row["Version"];
                $downloadcount = $row["downloadcount"];
                $totaldownloads = $row["TotalDownloads"];
                $typename="extensions";
                if ($lastname == $name) {
                    $i--;
                    continue;
                }

                echo"		<li>";
                echo"<a href=\"/$typename/moreinfo.php?".uriparams()."&amp;id=$id\">$name</a>";
                echo"<span class=\"downloads\"> ($downloadcount downloads)</span>";
                echo"</li>\n";

                $lastname = $name;
                if ($i >= "5") {
                    break;
                }
            }
        ?>
	</ol>
	<h2>Most Popular <?php echo ucwords($application); ?> Themes</h2>
	<ol class="popularlist">

        <?php
        $i=0;
        $sql = "SELECT TM.ID, TV.vID,TM.Name, TV.Version, TM.TotalDownloads, TM.downloadcount
            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  `Type`  =  'T' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND (`OSName` = '$OS' OR `OSName` = 'ALL') AND `downloadcount` > '0' AND `approved` = 'YES' ORDER BY `downloadcount` DESC ";
        $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
            if (mysql_num_rows($sql_result)=="0") {
                echo"        <li>No Popular Themes</li>\n";
            }
            while ($row = mysql_fetch_array($sql_result)) {
                $i++;
                $id = $row["ID"];
                $vid = $row["vID"];
                $name = $row["Name"];
                $version = $row["Version"];
                $downloadcount = $row["downloadcount"];
                $totaldownloads = $row["TotalDownloads"];
                $typename="themes";
                if ($lastname == $name) {
                    $i--;
                    continue;
                }

                echo"		<li>";
                echo"<a href=\"/$typename/moreinfo.php?".uriparams()."&amp;id=$id\">$name</a>";
                echo"<span class=\"downloads\"> ($downloadcount downloads)</span>";
                echo"</li>\n";

                $lastname = $name;
                if ($i >= "5") {
                    break;
                }
            }
        ?>
	</ol>
	<a href="/rss/?application=<?php echo"$application"; ?>&amp;list=newest"><img src="images/rss.png" width="16" height="16" class="rss" alt="News Additions in RSS"></a>
	<h2>New Additions</h2>
	<ol class="popularlist">

        <?php
        $i=0;
        $sql = "SELECT TM.ID, TM.Type, TV.vID, TM.Name, TV.Version, TV.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` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND (`OSName` = '$OS' OR `OSName` = 'ALL') AND `approved` = 'YES' ORDER BY `DateAdded` DESC ";
        $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
            if (mysql_num_rows($sql_result)=="0") {
                echo"        <li>Nothing Recently Added</li>\n";
            }
            while ($row = mysql_fetch_array($sql_result)) {
                $i++;
                $id = $row["ID"];
                $vid = $row["vID"];
                $type = $row["Type"];
                $name = $row["Name"];
                $version = $row["Version"];
                $dateadded = $row["DateAdded"];
                $dateadded = gmdate("M d, Y", strtotime("$dateadded")); 
                //$dateupdated = gmdate("F d, Y g:i:sa T", $timestamp);

                if ($type=="E") {
                    $typename = "extensions";
                } else if ($type=="T") {
                    $typename = "themes";
                }

                if ($lastname == $name) {
                    $i--;
                    continue;
                }

                echo"		<li>";
                echo"<a href=\"/$typename/moreinfo.php?".uriparams()."&amp;id=$id\">$name $version</a>";
                echo"<span class=\"downloads\"> ($dateadded)</span>";
                echo"</li>\n";

                $lastname = $name;
                if ($i >= "8") {
                    break;
                }
            }
        ?>
	</ol>
	</div>
</div>

<!-- closes #mBody-->

<?php
include"$page_footer";
?>

</body>
</html>