Compare commits
29 Commits
test_unit
...
update_0_9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1dace337d | ||
|
|
9fc8cd3057 | ||
|
|
b4ea8189e5 | ||
|
|
e74d33e7ea | ||
|
|
6e62621e8f | ||
|
|
bd412fad49 | ||
|
|
a0a74072eb | ||
|
|
8fe0d8fc48 | ||
|
|
139e876b15 | ||
|
|
5bbed92557 | ||
|
|
107f866844 | ||
|
|
c27b2b3c9f | ||
|
|
feb7c5d697 | ||
|
|
2da88561e6 | ||
|
|
26c589006d | ||
|
|
2c0504e414 | ||
|
|
61ba5ab47e | ||
|
|
e932f1f6a6 | ||
|
|
bc50181c4a | ||
|
|
d04c2ca368 | ||
|
|
b164fa146b | ||
|
|
b0922498e5 | ||
|
|
b46f1bb26f | ||
|
|
1e44763fe2 | ||
|
|
0e58de6ad0 | ||
|
|
10f245c313 | ||
|
|
0f6b1e3e2d | ||
|
|
c6bb0a4e81 | ||
|
|
fda0a511a5 |
@@ -1 +0,0 @@
|
||||
Another clobber to see about the orange... :(
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
## hostname: gaius
|
||||
## uname: WINNT GAIUS 5.2 3790 xx I386
|
||||
#
|
||||
|
||||
|
||||
# . $topsrcdir/browser/config/mozconfig
|
||||
|
||||
mk_add_options MOZ_CO_PROJECT=browser
|
||||
##mk_add_options MOZ_MAKE_FLAGS="-j8"
|
||||
#mk_add_options MOZ_CO_MODULE="mozilla/tools/update-packaging"
|
||||
mk_add_options MOZ_PACKAGE_NSIS=1
|
||||
|
||||
ac_add_options --enable-application=browser
|
||||
ac_add_options --enable-update-channel=nightly
|
||||
ac_add_options --enable-optimize
|
||||
ac_add_options --disable-debug
|
||||
# ac_add_options --enable-codesighs
|
||||
ac_add_options --enable-tests
|
||||
ac_add_options --disable-static
|
||||
# ac_add_options --disable-shared
|
||||
# ac_add_options --enable-official-branding
|
||||
ac_add_options --enable-svg
|
||||
ac_add_options --enable-canvas
|
||||
ac_add_options --enable-default-toolkit=cairo-windows
|
||||
#ac_add_options --enable-update-packaging
|
||||
@@ -1,254 +0,0 @@
|
||||
#
|
||||
## hostname: gaius
|
||||
## uname: WINNT GAIUS 5.2 3790 xx I386
|
||||
#
|
||||
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
$ENV{MOZ_INSTALLER_USE_7ZIP} = '1';
|
||||
$ENV{NO_EM_RESTART} = '1';
|
||||
$ENV{MOZ_PACKAGE_NSIS} = '1';
|
||||
|
||||
# $ENV{MOZ_PACKAGE_MSI}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: 0
|
||||
# Values: 0 | 1
|
||||
# Purpose: Controls whether a MSI package is made.
|
||||
# Requires: Windows and a local MakeMSI installation.
|
||||
#$ENV{MOZ_PACKAGE_MSI} = 0;
|
||||
|
||||
# $ENV{MOZ_SYMBOLS_TRANSFER_TYPE}
|
||||
#-----------------------------------------------------------------------------
|
||||
# Default: scp
|
||||
# Values: scp | rsync
|
||||
# Purpose: Use scp or rsync to transfer symbols to the Talkback server.
|
||||
# Requires: The selected type requires the command be available both locally
|
||||
# and on the Talkback server.
|
||||
#$ENV{MOZ_SYMBOLS_TRANSFER_TYPE} = "scp";
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'build@mozilla.org';
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
#$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
$BuildXForms = 1;
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
#$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
#$BuildDepend = 1; # Depend or Clobber
|
||||
#$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
#$ReportStatus = 1; # Send results to server, or not
|
||||
#$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
#$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
#$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
#$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
#$BuildLocales = 0; # Do l10n packaging?
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 1;
|
||||
#$ResetHomeDirForTests = 1;
|
||||
$ProductName = "Firefox";
|
||||
$VendorName = "Mozilla";
|
||||
|
||||
$RunMozillaTests = 1; # Allow turning off of all tests if needed.
|
||||
$RegxpcomTest = 0;
|
||||
$AliveTest = 0;
|
||||
#$JavaTest = 0;
|
||||
#$ViewerTest = 0;
|
||||
#$BloatTest = 0; # warren memory bloat test
|
||||
#$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
#$DomToTextConversionTest = 0;
|
||||
#$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
|
||||
#$MailBloatTest = 0;
|
||||
#$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 0; # Tp
|
||||
#$DHTMLPerformanceTest = 0; # Tdhtml
|
||||
#$QATest = 0;
|
||||
$XULWindowOpenTest = 0; # Txul
|
||||
#$StartupPerformanceTest = 1; # Ts
|
||||
#$NeckoUnitTest = 0;
|
||||
$RenderPerformanceTest = 0; # Tgfx
|
||||
|
||||
$RunUnitTests = 1;
|
||||
|
||||
$TestsPhoneHome = 1; # Should test report back to server?
|
||||
$GraphNameOverride = 'fxexp-win32-tbox';
|
||||
|
||||
# $results_server
|
||||
#----------------------------------------------------------------------------
|
||||
# Server on which test results will be accessible. This was originally tegu,
|
||||
# then became axolotl. Once we moved services from axolotl, it was time
|
||||
# to give this service its own hostname to make future transitions easier.
|
||||
# - cmp@mozilla.org
|
||||
#$results_server = "build-graphs.mozilla.org";
|
||||
|
||||
$pageload_server = "pageload.build.mozilla.org"; # localhost
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
#$CVSCheckoutTimeout = 3600;
|
||||
#$CreateProfileTimeout = 45;
|
||||
#$RegxpcomTestTimeout = 120;
|
||||
|
||||
#$AliveTestTimeout = 30;
|
||||
#$ViewerTestTimeout = 45;
|
||||
#$EmbedTestTimeout = 45;
|
||||
#$BloatTestTimeout = 120; # seconds
|
||||
#$MailBloatTestTimeout = 120; # seconds
|
||||
#$JavaTestTimeout = 45;
|
||||
#$DomTestTimeout = 45; # seconds
|
||||
#$XpcomGlueTestTimeout = 15;
|
||||
#$CodesizeTestTimeout = 900; # seconds
|
||||
#$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
$LayoutPerformanceTestTimeout = 800; # entire test, seconds
|
||||
#$DHTMLPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
#$QATestTimeout = 1200; # entire test, seconds
|
||||
#$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
#$StartupPerformanceTestTimeout = 20; # seconds
|
||||
#$XULWindowOpenTestTimeout = 90; # seconds
|
||||
#$NeckoUnitTestTimeout = 30; # seconds
|
||||
$RenderPerformanceTestTimeout = 1800; # seconds
|
||||
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
|
||||
#$UseMozillaProfile = 1;
|
||||
#$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
$Make = 'make'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
#$mail = '/bin/mail';
|
||||
#$CVS = 'cvs -q';
|
||||
#$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
$blat = 'd:/moztools/bin/blat.exe';
|
||||
$use_blat = 1;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
#$moz_cvsroot = $ENV{CVSROOT};
|
||||
$moz_cvsroot = ':ext:cltbld@cvs.mozilla.org:/cvsroot';
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
#$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
#$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
#$ObjDir = 'fx-trunk-cairo';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = 'Unit Testing';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
#$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
#$BuildTree = 'MozillaTest';
|
||||
#$BuildTree = 'Firefox-Cairo';
|
||||
$BuildTree = 'MozillaExperimental';
|
||||
|
||||
#$BuildName = '';
|
||||
#$BuildTag = '';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'firefox.exe';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
#$EmbedBinaryName = 'TestGtkEmbed';
|
||||
#$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
|
||||
# Release build options
|
||||
$ReleaseBuild = 0;
|
||||
$shiptalkback = 0;
|
||||
$ReleaseToLatest = 0; # Push the release to latest-<milestone>?
|
||||
$ReleaseToDated = 0; # Push the release to YYYY-MM-DD-HH-<milestone>?
|
||||
$build_hour = "4";
|
||||
$package_creation_path = "/browser/installer";
|
||||
# needs setting for mac + talkback: $mac_bundle_path = "/browser/app";
|
||||
$ssh_version = "2";
|
||||
#$ssh_user = "cltbld";
|
||||
#$ssh_server = "stage.mozilla.org";
|
||||
$ftp_path = "/home/ftp/pub/firefox/nightly";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly";
|
||||
$tbox_ftp_path = "/home/ftp/pub/firefox/tinderbox-builds";
|
||||
$tbox_url_path = "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds";
|
||||
$milestone = "trunk";
|
||||
$notify_list = 'build-announce@mozilla.org';
|
||||
#$stub_installer = 0;
|
||||
#$sea_installer = 1;
|
||||
#$archive = 1;
|
||||
#$push_raw_xpis = 1;
|
||||
#$update_package = 1;
|
||||
#$update_product = "Firefox";
|
||||
#$update_version = "trunk";
|
||||
#$update_platform = "WINNT_x86-msvc";
|
||||
#$update_hash = "sha1";
|
||||
#$update_filehost = "ftp.mozilla.org";
|
||||
#$update_appv = "3.0a1";
|
||||
#$update_extv = "3.0a1";
|
||||
#$update_pushinfo = 0;
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
#$RebootSystem = 0;
|
||||
|
||||
# LogCompression specifies the type of compression used on the log file.
|
||||
# Valid options are 'gzip', and 'bzip2'. Please make sure the binaries
|
||||
# for 'gzip' or 'bzip2' are in the user's path before setting this
|
||||
# option.
|
||||
#$LogCompression = '';
|
||||
|
||||
# LogEncoding specifies the encoding format used for the logs. Valid
|
||||
# options are 'base64', and 'uuencode'. If $LogCompression is set above,
|
||||
# this needs to be set to 'base64' or 'uuencode' to ensure that the
|
||||
# binary data is transferred properly.
|
||||
#$LogEncoding = '';
|
||||
|
||||
# Prevent Extension Manager from spawning child processes during tests
|
||||
# - processes that tbox scripts cannot kill.
|
||||
#$ENV{NO_EM_RESTART} = '1';
|
||||
|
||||
# Build XForms
|
||||
$BuildXForms = 1;
|
||||
419
mozilla/webtools/update/core/browser_detection.php
Normal file
@@ -0,0 +1,419 @@
|
||||
<?php
|
||||
/*
|
||||
Script Name: Full Featured PHP Browser/OS detection
|
||||
Author: Harald Hope, Website: http://tech.ratmachines.com/
|
||||
Script Source URI: http://tech.ratmachines.com/downloads/browser_detection.php
|
||||
Version 4.2.7
|
||||
Copyright (C) 04 March 2004
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
Lesser GPL license text:
|
||||
http://www.gnu.org/licenses/lgpl.txt
|
||||
|
||||
Coding conventions:
|
||||
http://cvs.sourceforge.net/viewcvs.py/phpbb/phpBB2/docs/codingstandards.htm?rev=1.3
|
||||
*/
|
||||
|
||||
/******************************************
|
||||
this is currently set to accept 9 parameters, although you can add as many as you want:
|
||||
1. safe - returns true/false, you can determine what makes the browser be safe lower down,
|
||||
currently it's set for ns4 and pre version 1 mozillas not being safe, plus all older browsers
|
||||
2. ie_version - tests to see what general IE it is, ie5x-6, ie4, or macIE, returns these values.
|
||||
3. moz_version - returns array of moz version, version number (includes full version, + etc), rv number (for math
|
||||
comparison), rv number (for full rv, including alpha and beta versions), and release date
|
||||
4. dom - returns true/false if it is a basic dom browser, ie >= 5, opera >= 5, all new mozillas, safaris, konquerors
|
||||
5. os - returns which os is being used
|
||||
6. os_number - returns windows versions, 95, 98, me, nt 4, nt 5 [windows 2000], nt 5.1 [windows xp],
|
||||
otherwise returns false
|
||||
7. browser - returns the browser name, in shorthand: ie, ie4, ie5x, op, moz, konq, saf, ns4
|
||||
8. number - returns the browser version number, if available, otherwise returns '' [not available]
|
||||
9. full - returns this array: $browser_name, $version_number, $ie_version, $dom_browser, $safe_browser, $os, $os_number
|
||||
*******************************************/
|
||||
|
||||
// main script, uses two other functions, which_os() and browser_version() as needed
|
||||
function browser_detection( $which_test ) {
|
||||
/*
|
||||
uncomment the global variable declaration if you want the variables to be available on a global level
|
||||
throughout your php page, make sure that php is configured to support the use of globals first!
|
||||
Use of globals should be avoided however, and they are not necessary with this script
|
||||
*/
|
||||
|
||||
/*global $dom_browser, $safe_browser, $browser_user_agent, $os, $browser_name, $ie_version,
|
||||
$version_number, $os_number, $b_repeat, $moz_version, $moz_version_number, $moz_rv, $moz_rv_full, $moz_release;*/
|
||||
|
||||
static $dom_browser, $safe_browser, $browser_user_agent, $os, $browser_name, $ie_version,
|
||||
$version_number, $os_number, $b_repeat, $moz_version, $moz_version_number, $moz_rv, $moz_rv_full, $moz_release;
|
||||
|
||||
/*
|
||||
this makes the test only run once no matter how many times you call it
|
||||
since all the variables are filled on the first run through, it's only a matter of returning the
|
||||
the right ones
|
||||
*/
|
||||
if ( !$b_repeat )
|
||||
{
|
||||
//initialize all variables with default values to prevent error
|
||||
$dom_browser = false;
|
||||
$safe_browser = false;
|
||||
$os = '';
|
||||
$os_number = '';
|
||||
$a_os_data = '';
|
||||
$browser_name = '';
|
||||
$version_number = '';
|
||||
$ie_version = '';
|
||||
$moz_version = '';
|
||||
$moz_version_number = '';
|
||||
$moz_rv = '';
|
||||
$moz_rv_full = '';
|
||||
$moz_release = '';
|
||||
|
||||
//make navigator user agent string lower case to make sure all versions get caught
|
||||
$browser_user_agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
||||
|
||||
$a_os_data = which_os( $browser_user_agent );// get os/number array
|
||||
$os = $a_os_data[0];// os name, abbreviated
|
||||
$os_number = $a_os_data[1];// os number if windows
|
||||
|
||||
/*
|
||||
pack the browser type array, in this order
|
||||
the order is important, because opera must be tested first, and ie4 tested for before ie general
|
||||
same for konqueror, then safari, then gecko, since safari navigator user agent id's with 'gecko' in string.
|
||||
note that $dom_browser is set for all modern dom browsers, this gives you a default to use.
|
||||
|
||||
array[0] = id string for useragent, array[1] is if dom capable, array[2] is working name for browser
|
||||
|
||||
Note: all browser strings are in lower case to match the strtolower output, this avoids possible detection
|
||||
errors
|
||||
*/
|
||||
$a_browser_types[] = array( 'opera', true, 'op' );
|
||||
$a_browser_types[] = array( 'msie', true, 'ie' );
|
||||
$a_browser_types[] = array( 'konqueror', true, 'konq' );
|
||||
$a_browser_types[] = array( 'safari', true, 'saf' );
|
||||
// covers Netscape 6-7, K-Meleon, Most linux versions
|
||||
// the 3 is for the rv: number, the release date is hardcoded
|
||||
$a_browser_types[] = array( 'gecko', true, 'moz' );
|
||||
// netscape 4 test: this has to be last or else ie or opera might register true
|
||||
$a_browser_types[] = array( 'mozilla/4', false, 'ns4' );
|
||||
$a_browser_types[] = array( 'lynx', false, 'lynx' );
|
||||
$a_browser_types[] = array( 'webtv', true, 'webtv' );
|
||||
// search engine spider bots:
|
||||
$a_browser_types[] = array( 'googlebot', false, 'google' );// google
|
||||
$a_browser_types[] = array( 'fast-webcrawler', false, 'fast' );// Fast AllTheWeb
|
||||
$a_browser_types[] = array( 'msnbot', false, 'msn' );// msn search
|
||||
$a_browser_types[] = array( 'scooter', false, 'scooter' );// altavista
|
||||
//$a_browser_types[] = array( '', false ); // browser array template
|
||||
|
||||
/*
|
||||
moz types array
|
||||
note the order, netscape6 must come before netscape, which is how netscape 7 id's itself.
|
||||
rv comes last in case it is plain old mozilla
|
||||
*/
|
||||
$moz_types = array( 'firebird', 'phoenix', 'firefox', 'galeon', 'k-meleon', 'camino', 'netscape6',
|
||||
'netscape', 'rv' );
|
||||
|
||||
/*
|
||||
run through the browser_types array, break if you hit a match, if no match, assume old browser
|
||||
or non dom browser, assigns false value to $b_success.
|
||||
*/
|
||||
for ($i = 0; $i < count($a_browser_types); $i++)
|
||||
{
|
||||
//unpacks browser array, assigns to variables
|
||||
$s_browser = $a_browser_types[$i][0];// text string to id browser from array
|
||||
$b_dom = $a_browser_types[$i][1];// hardcoded dom support from array
|
||||
$browser_name = $a_browser_types[$i][2];// working name for browser
|
||||
$b_success = false;
|
||||
|
||||
if (stristr($browser_user_agent, $s_browser))
|
||||
{
|
||||
// it defaults to true, will become false below if needed
|
||||
// this keeps it easier to keep track of what is safe, only explicit false assignment will make it false.
|
||||
$safe_browser = true;
|
||||
switch ( $browser_name )
|
||||
{
|
||||
case 'ns4':
|
||||
$safe_browser = false;
|
||||
break;
|
||||
case 'moz':
|
||||
/*
|
||||
note: The 'rv' test is not absolute since the rv number is very different on
|
||||
different versions, for example Galean doesn't use the same rv version as Mozilla,
|
||||
neither do later Netscapes, like 7.x. For more on this, read the full mozilla numbering
|
||||
conventions here:
|
||||
http://www.mozilla.org/releases/cvstags.html
|
||||
*/
|
||||
|
||||
// this will return alpha and beta version numbers, if present
|
||||
$moz_rv_full = browser_version( $browser_user_agent, 'rv' );
|
||||
// this slices them back off for math comparisons
|
||||
$moz_rv = substr( $moz_rv_full, 0, 3 );
|
||||
|
||||
// this is to pull out specific mozilla versions, firebird, netscape etc..
|
||||
for ( $i = 0; $i < count( $moz_types ); $i++ )
|
||||
{
|
||||
if ( stristr( $browser_user_agent, $moz_types[$i] ) )
|
||||
{
|
||||
$moz_version = $moz_types[$i];
|
||||
$moz_version_number = browser_version( $browser_user_agent, $moz_version );
|
||||
break;
|
||||
}
|
||||
}
|
||||
// this is necesary to protect against false id'ed moz'es and new moz'es.
|
||||
// this corrects for galeon, or any other moz browser without an rv number
|
||||
if ( !$moz_rv )
|
||||
{
|
||||
$moz_rv = substr( $moz_version_number, 0, 3 );
|
||||
$moz_rv_full = $moz_version_number;
|
||||
/*
|
||||
// you can use this instead if you are running php >= 4.2
|
||||
$moz_rv = floatval( $moz_version_number );
|
||||
$moz_rv_full = $moz_version_number;
|
||||
*/
|
||||
}
|
||||
// this corrects the version name in case it went to the default 'rv' for the test
|
||||
if ( $moz_version == 'rv' )
|
||||
{
|
||||
$moz_version = 'mozilla';
|
||||
}
|
||||
|
||||
//the moz version will be taken from the rv number, see notes above for rv problems
|
||||
$version_number = $moz_rv;
|
||||
// gets the actual release date, necessary if you need to do functionality tests
|
||||
$moz_release = browser_version( $browser_user_agent, 'gecko/' );
|
||||
/*
|
||||
Test for mozilla 0.9.x / netscape 6.x
|
||||
test your javascript/CSS to see if it works in these mozilla releases, if it does, just default it to:
|
||||
$safe_browser = true;
|
||||
*/
|
||||
if ( ( $moz_release < 20020400 ) || ( $moz_rv < 1 ) )
|
||||
{
|
||||
$safe_browser = false;
|
||||
}
|
||||
break;
|
||||
case 'ie':
|
||||
//$version_number = browser_version( $browser_user_agent, $s_browser, $substring_length );
|
||||
$version_number = browser_version( $browser_user_agent, $s_browser );
|
||||
if ( $os == 'mac' )
|
||||
{
|
||||
$ie_version = 'ieMac';
|
||||
}
|
||||
// this assigns a general ie id to the $ie_version variable
|
||||
if ( $version_number >= 5 )
|
||||
{
|
||||
$ie_version = 'ie5x';
|
||||
}
|
||||
elseif ( ( $version_number > 3 ) && $version_number < 5 )
|
||||
{
|
||||
$dom_browser = false;
|
||||
$ie_version = 'ie4';
|
||||
$safe_browser = true; // this depends on what you're using the script for, make sure this fits your needs
|
||||
}
|
||||
else
|
||||
{
|
||||
$ie_version = 'old';
|
||||
$safe_browser = false;
|
||||
}
|
||||
break;
|
||||
case 'op':
|
||||
//$version_number = browser_version( $browser_user_agent, $s_browser, $substring_length );
|
||||
$version_number = browser_version( $browser_user_agent, $s_browser );
|
||||
if ( $version_number < 5 )// opera 4 wasn't very useable.
|
||||
{
|
||||
$safe_browser = false;
|
||||
}
|
||||
break;
|
||||
case 'saf':
|
||||
//$version_number = browser_version( $browser_user_agent, $s_browser, $substring_length );
|
||||
$version_number = browser_version( $browser_user_agent, $s_browser );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$dom_browser = $b_dom;
|
||||
$b_success = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
//assigns defaults if the browser was not found in the loop test
|
||||
if ( !$b_success )
|
||||
{
|
||||
$safe_browser = false;
|
||||
$dom_browser = false;
|
||||
$browser_name = '';
|
||||
}
|
||||
// this ends the run through once if clause, set the boolean
|
||||
//to true so the function won't retest everything
|
||||
$b_repeat = true;
|
||||
}
|
||||
/*
|
||||
This is where you return values based on what parameter you used to call the function
|
||||
$which_test is the passed parameter in the initial browser_detection('os') for example call
|
||||
*/
|
||||
switch ( $which_test )
|
||||
{
|
||||
case 'safe':// returns true/false if your tests determine it's a safe browser
|
||||
// you can change the tests to determine what is a safeBrowser for your scripts
|
||||
// in this case sub rv 1 Mozillas and Netscape 4x's trigger the unsafe condition
|
||||
return $safe_browser;
|
||||
break;
|
||||
case 'ie_version': // returns iemac or ie5x
|
||||
return $ie_version;
|
||||
break;
|
||||
case 'moz_version':// returns array of all relevant moz information
|
||||
$moz_array = array( $moz_version, $moz_version_number, $moz_rv, $moz_rv_full, $moz_release );
|
||||
return $moz_array;
|
||||
break;
|
||||
case 'dom':// returns true/fale if a DOM capable browser
|
||||
return $dom_browser;
|
||||
break;
|
||||
case 'os':// returns os name
|
||||
return $os;
|
||||
break;
|
||||
case 'os_number':// returns os number if windows
|
||||
return $os_number;
|
||||
break;
|
||||
case 'browser':// returns browser name
|
||||
return $browser_name;
|
||||
break;
|
||||
case 'number':// returns browser number
|
||||
return $version_number;
|
||||
break;
|
||||
case 'full':// returns all relevant browser information in an array
|
||||
$full_array = array( $browser_name, $version_number, $ie_version, $dom_browser, $safe_browser, $os, $os_number );
|
||||
return $full_array;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// gets which os from the browser string
|
||||
function which_os ( $browser_string )
|
||||
{
|
||||
// initialize variables
|
||||
$os = '';
|
||||
$os_version = '';
|
||||
/*
|
||||
packs the os array
|
||||
use this order since some navigator user agents will put 'macintosh' in the navigator user agent string
|
||||
which would make the nt test register true
|
||||
*/
|
||||
$a_os = array('lin', 'mac', 'unix', 'sunos', 'bsd', 'nt', 'win');
|
||||
|
||||
//os tester
|
||||
for ($i = 0; $i < count($a_os); $i++)
|
||||
{
|
||||
//unpacks os array, assigns to variable
|
||||
$s_os = $a_os[$i];
|
||||
|
||||
//assign os to global os variable, os flag true on success
|
||||
if (stristr( $browser_string, $s_os ))
|
||||
{
|
||||
$os = $s_os;
|
||||
|
||||
switch ( $os )
|
||||
{
|
||||
case 'win':
|
||||
if ( strstr( $browser_string, '95' ) )
|
||||
{
|
||||
$os_version = '95';
|
||||
}
|
||||
elseif ( strstr( $browser_string, '98' ) )
|
||||
{
|
||||
$os_version = '98';
|
||||
}
|
||||
elseif ( strstr( $browser_string, 'me' ) )
|
||||
{
|
||||
$os_version = 'me';
|
||||
}
|
||||
elseif ( strstr( $browser_string, '2000' ) )// windows 2000, for opera ID
|
||||
{
|
||||
$os_version = '5.0';
|
||||
$os = 'nt';
|
||||
}
|
||||
elseif ( strstr( $browser_string, 'xp' ) )// windows 2000, for opera ID
|
||||
{
|
||||
$os_version = '5.1';
|
||||
$os = 'nt';
|
||||
}
|
||||
break;
|
||||
case 'nt':
|
||||
if ( strstr( $browser_string, 'nt 5.1' || strstr( $browser_string, 'xp' )) )// windows xp
|
||||
{
|
||||
$os_version = '5.1';//
|
||||
}
|
||||
elseif ( strstr( $browser_string, 'nt 5' ) || strstr( $browser_string, '2000' ) )// windows 2000
|
||||
{
|
||||
$os_version = '5.0';
|
||||
}
|
||||
elseif ( strstr( $browser_string, 'nt 4' ) )// nt 4
|
||||
{
|
||||
$os_version = '4';
|
||||
}
|
||||
elseif ( strstr( $browser_string, 'nt 3' ) )// nt 4
|
||||
{
|
||||
$os_version = '3';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// pack the os data array for return to main function
|
||||
$os_data = array( $os, $os_version );
|
||||
return $os_data;
|
||||
}
|
||||
|
||||
// function returns browser number, gecko rv number, or gecko release date
|
||||
//function browser_version( $browser_user_agent, $search_string, $substring_length )
|
||||
function browser_version( $browser_user_agent, $search_string )
|
||||
{
|
||||
// 8 is the longest that will be required, handles release dates: 20020323; 0.8.0+
|
||||
$substring_length = 8;
|
||||
//initialize browser number, will return '' if not found
|
||||
$browser_number = '';
|
||||
|
||||
// use the passed parameter for $search_string
|
||||
// start the substring slice right after these moz search strings
|
||||
$start_pos = strpos( $browser_user_agent, $search_string ) + strlen( $search_string );
|
||||
|
||||
// this is just to get the release date, not other moz information
|
||||
if ( ( $search_string != 'gecko/' ) )
|
||||
{
|
||||
$start_pos++;
|
||||
}
|
||||
|
||||
// Initial trimming
|
||||
$browser_number = substr( $browser_user_agent, $start_pos, $substring_length );
|
||||
|
||||
// Find the space, ;, or parentheses that ends the number
|
||||
$browser_number = substr( $browser_number, 0, strcspn($browser_number, ' );') );
|
||||
|
||||
//make sure the returned value is actually the id number and not a string
|
||||
// otherwise return ''
|
||||
if ( !is_numeric( substr( $browser_number, 0, 1 ) ) )
|
||||
{
|
||||
$browser_number = '';
|
||||
}
|
||||
|
||||
return $browser_number;
|
||||
}
|
||||
|
||||
/*
|
||||
Here are some typical navigator.userAgent strings so you can see where the data comes from
|
||||
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Firebird/0.7
|
||||
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1
|
||||
*/
|
||||
?>
|
||||
73
mozilla/webtools/update/core/config.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?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 *****
|
||||
|
||||
// Mozilla Update -- PHP Configuration File
|
||||
// All common PHP Variables/functions are defined here
|
||||
|
||||
//-- Site Timing :: Function and Start... --//
|
||||
function getmicrotime() {
|
||||
list($usec, $sec) = explode(" ", microtime());
|
||||
return ((float)$usec + (float)$sec);
|
||||
}
|
||||
$time_start = getmicrotime();
|
||||
|
||||
//-- Website Variables--//
|
||||
$websitepath = "/opt/update"; // Local Path to Site Files
|
||||
$sitehostname = "update.mozilla.org"; // DNS Hostname
|
||||
|
||||
//-- MySQL Server/Database Properties/Connection --//
|
||||
$mysqlServer="localhost";
|
||||
$mysqlData="update"; //MySQL Server Database Name
|
||||
$mysqlLogin=""; //MySQL Server UserName
|
||||
$mysqlPass=""; //MySQL Server Password
|
||||
|
||||
|
||||
$connection = mysql_connect("$mysqlServer","$mysqlLogin","$mysqlPass") or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_ERROR);
|
||||
$db = mysql_select_db("$mysqlData", $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_ERROR);
|
||||
|
||||
//-- Page Header & Footer --//
|
||||
$page_header = "$websitepath/core/inc_header.php";
|
||||
$page_footer = "$websitepath/core/inc_footer.php";
|
||||
|
||||
|
||||
//includes
|
||||
include"inc_guids.php"; // GUID Handler
|
||||
include"inc_global.php"; // Global Functions
|
||||
include"sessionconfig.php"; //Start Session
|
||||
|
||||
?>
|
||||
145
mozilla/webtools/update/core/inc_browserdetection.php
Normal file
@@ -0,0 +1,145 @@
|
||||
<?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 *****
|
||||
|
||||
//Various Sample User_Agents, uncomment to debug detection for one. :-)
|
||||
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (Photon; U; QNX x86pc; en-US; rv:1.6a) Gecko/20030122";
|
||||
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.4a) Gecko/20030305";
|
||||
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.7b) Gecko/20040302";
|
||||
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Lightninglizard/0.8";
|
||||
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040322 Nuclearunicorn/0.8.0+ (Firefox/0.8.0+ rebrand)";
|
||||
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9";
|
||||
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3";
|
||||
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040818 Firefox/0.9.1+";
|
||||
|
||||
include"browser_detection.php"; //Script that defines the browser_detection() function
|
||||
|
||||
$OS = browser_detection('os');
|
||||
$moz_array = browser_detection('moz_version');
|
||||
|
||||
//Turn $OS into something usable.
|
||||
if ( $moz_array[0] !== '' )
|
||||
{
|
||||
switch ( $OS )
|
||||
{
|
||||
case 'win':
|
||||
case 'nt':
|
||||
$OS = 'Windows';
|
||||
break;
|
||||
case 'lin':
|
||||
$OS = 'Linux';
|
||||
break;
|
||||
case 'solaris':
|
||||
case 'sunos':
|
||||
$OS = 'Solaris';
|
||||
break;
|
||||
case 'unix':
|
||||
case 'bsd':
|
||||
$OS = 'BSD';
|
||||
break;
|
||||
case 'mac':
|
||||
$OS = 'MacOSX';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//Print what it's found, debug item.
|
||||
//echo ( 'Your Mozilla product is ' . $moz_array[0] . ' ' . $moz_array[1] . ' running on '. $OS . ' ');
|
||||
|
||||
$application = $moz_array[0];
|
||||
$app_version = $moz_array[1];
|
||||
|
||||
// XXX hack for 10.1 security release -- we need to munge
|
||||
// versions to just check major.minor and ignore release/etc. bits
|
||||
if ($app_version == "0.10.1") {
|
||||
$app_version = "0.10";
|
||||
}
|
||||
|
||||
// XXX hack for 1.0RC1/1.0RC2 release. browser detection needs to be more customizeable per release. heh.
|
||||
// This changes the displayed UA, to the app.extensions.ver internal.
|
||||
if ($app_version == "1.0rc1" or $app_version == "1.0rc2") {
|
||||
$app_version = "1.0";
|
||||
}
|
||||
|
||||
} else {
|
||||
//If it's not a Mozilla product, then return nothing and let the default app code work..
|
||||
}
|
||||
|
||||
//----------------------------
|
||||
//Browser & OS Detection (Default Code)
|
||||
//----------------------------
|
||||
|
||||
//if (!$_GET["application"] or ($_GET["application"]==$application && $_GET["version"]==$moz_array[1])) {
|
||||
//$app_version = $moz_array[1]; //Set app_version from Detection
|
||||
//}
|
||||
|
||||
//Application
|
||||
if (!$application) { $application="firefox"; } //Default App is Firefox
|
||||
|
||||
//App_Version
|
||||
//if ($_GET["version"]) {$app_version = $_GET["version"]; }
|
||||
|
||||
if ($detection_force_version=="true") {$application=$_SESSION["application"];}
|
||||
//Get Max Version for App Specified
|
||||
$sql = "SELECT `major`,`minor`,`release`,`SubVer` FROM `t_applications` WHERE `AppName` = '$application' ORDER BY `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
$release = "$row[major].$row[minor]";
|
||||
if ($row["release"]) {$release = ".$release$row[release]";}
|
||||
$subver = $row["SubVer"];
|
||||
if ($subver !=="final") {$release="$release$subver";}
|
||||
|
||||
if (!$app_version OR $detection_force_version=="true") { $app_version = $release; }
|
||||
unset($release, $subver);
|
||||
|
||||
//OS
|
||||
if ($_GET["os"]) {$OS = $_GET["os"];} //If Defined, set.
|
||||
|
||||
// 1.0PR support
|
||||
if ($app_version=="1.0PR") {$app_version="0.10"; }
|
||||
|
||||
// 0.9.x branch support -- All non-branch (+) builds should be 0.9.
|
||||
if (strpos($app_version, "+")=== false AND strpos($app_version, "0.9")===0) { $app_version="0.9";}
|
||||
|
||||
|
||||
|
||||
//Register Browser Detection Values with the session
|
||||
if (!$_SESSION["application"]) { $_SESSION["application"] = $application; }
|
||||
if (!$_SESSION["app_version"]) { $_SESSION["app_version"] = $app_version; }
|
||||
if (!$_SESSION["app_os"]) { $_SESSION["app_os"] = $OS; }
|
||||
?>
|
||||
57
mozilla/webtools/update/core/inc_footer.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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 *****
|
||||
?>
|
||||
<!--Page Footer-->
|
||||
<?php
|
||||
//Site Timer Counter :: Debug-Mode Item Only
|
||||
$time_end = getmicrotime();
|
||||
//Returns in format: sss.mmmuuunnnppp ;-)
|
||||
// m = millisec, u=microsec, n=nansec, p=picosec
|
||||
$time = round($time_end - $time_start,"6");
|
||||
|
||||
echo"<DIV class=\"footer\">© 2004 <A HREF=\"http://www.mozilla.org\">The Mozilla Organization</A>"; if ($_SESSION["debug"]=="true") {echo" | Page Created in $time seconds"; } echo" | Terms of Use | Top</DIV>"; //Debug Time
|
||||
|
||||
if ($pos !== false) {
|
||||
echo"</div>\n";
|
||||
}
|
||||
if ($_SESSION["debug"]=="true") {
|
||||
print(session_id());
|
||||
echo"<PRE>";print_r($_SESSION); echo"</PRE><Br>\n";
|
||||
echo"Current application data: $application - $app_version - $OS ";
|
||||
}
|
||||
?>
|
||||
102
mozilla/webtools/update/core/inc_global.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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 *****
|
||||
|
||||
//inc_global.php -- Stuff that needs to be done globally to all of Mozilla Update
|
||||
|
||||
//Cache Control Headers
|
||||
$expstr = gmdate("D, d M Y H:i:s", time() + 1800) . " GMT";
|
||||
header("Expires: $expstr");
|
||||
header("Cache-Control: public, pre-check=0, post-check=0, max-age=1800");
|
||||
|
||||
|
||||
//Attempt to fix Bug 246743 (strip_tags) and Bug 248242 (htmlentities)
|
||||
foreach ($_GET as $key => $val) {
|
||||
$_GET["$key"] = htmlentities(str_replace("\\","",strip_tags($_GET["$key"])));
|
||||
}
|
||||
|
||||
//Set Debug Mode session Variable
|
||||
if ($_GET["debug"]=="true") {$_SESSION["debug"]=$_GET["debug"]; } else if ($_GET["debug"]=="false") {unset($_SESSION["debug"]);}
|
||||
|
||||
// Bug 250596 Fixes for incoming $_GET variables.
|
||||
if ($_GET["application"]) {
|
||||
$_GET["application"] = strtolower($_GET["application"]);
|
||||
$sql = "SELECT AppID FROM `t_applications` WHERE `AppName` = '".ucwords(strtolower($_GET["application"]))."' LIMIT 1";
|
||||
$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) {unset($_GET["application"]);}
|
||||
}
|
||||
|
||||
//if ($_GET["version"]) {
|
||||
//$sql = "SELECT AppID FROM `t_applications` WHERE `Release` = '$_GET[version]' LIMIT 1";
|
||||
// $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) {unset($_GET["application"]);}
|
||||
//}
|
||||
|
||||
if ($_GET["category"] AND $_GET["category"] !=="All"
|
||||
AND $_GET["category"] !=="Editors Pick" AND $_GET["category"] !=="Popular"
|
||||
AND $_GET["category"] !=="Top Rated" AND $_GET["category"] !=="Newest") {
|
||||
$sql = "SELECT CatName FROM `t_categories` WHERE `CatName` = '".ucwords(strtolower($_GET["category"]))."' LIMIT 1";
|
||||
$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) {unset($_GET["category"]);}
|
||||
}
|
||||
|
||||
if (!is_numeric($_GET["id"])) { unset($_GET["id"]); }
|
||||
if (!is_numeric($_GET["vid"])) { unset($_GET["vid"]); }
|
||||
if (!is_numeric($_GET["pageid"])) { unset($_GET["pageid"]); }
|
||||
if (!is_numeric($_GET["numpg"])) { unset($_GET["numpg"]); }
|
||||
|
||||
// page_error() function
|
||||
|
||||
function page_error($reason, $custom_message) {
|
||||
global $page_header, $page_footer;
|
||||
echo"<TITLE>Mozilla Update :: Error</TITLE>\n";
|
||||
echo"<LINK REL=\"STYLESHEET\" TYPE=\"text/css\" HREF=\"/core/update.css\">\n";
|
||||
include"$page_header";
|
||||
|
||||
echo"<DIV class=\"contentbox\" style=\"border-color: #F00; width: 90%; margin: auto; min-height: 250px; margin-bottom: 5px\">\n";
|
||||
echo"<DIV class=\"boxheader\">Mozilla Update :: Error</DIV>\n";
|
||||
echo"<SPAN style=\"font-size: 12pt\">\n";
|
||||
echo"Mozilla Update has encountered an error and is unable to fulfill your request. Please try your request again later. If the
|
||||
problem continues, please contact the Mozilla Update staff. More information about the error may be found at the end of this
|
||||
message.<BR><BR>
|
||||
Error $reason: $custom_message<BR><BR>
|
||||
<A HREF=\"javascript:history.back()\">«« Go Back to Previous Page</A>";
|
||||
echo"</SPAN></DIV>\n";
|
||||
include"$page_footer";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
49
mozilla/webtools/update/core/inc_guids.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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 *****
|
||||
|
||||
//Reset GUIDs to something human-readable
|
||||
if ($_GET["application"]=="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") {
|
||||
$_GET["application"]="firefox";
|
||||
|
||||
} else if ($_GET["application"]=="{3550f703-e582-4d05-9a08-453d09bdfdc6}") {
|
||||
$_GET["application"]="thunderbird";
|
||||
|
||||
} else if ($_GET["application"]=="{86c18b42-e466-45a9-ae7a-9b95ba6f5640}") {
|
||||
$_GET["application"]="mozilla";
|
||||
}
|
||||
?>
|
||||
82
mozilla/webtools/update/core/inc_header.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?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 *****
|
||||
|
||||
$pos = strpos($_SERVER["REQUEST_URI"], "/admin");
|
||||
if ($pos !== false) {
|
||||
echo'<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/mozupdates.bak.css">';
|
||||
$application="login";
|
||||
}
|
||||
?>
|
||||
<DIV class="header">
|
||||
<?php //if ($_GET["application"]) {$application=$_GET["application"]; } else {$application="firefox"; } ?>
|
||||
<DIV class="logo"><IMG SRC="/images/<?php echo"$application"; ?>-cornerlogo.png" BORDER=0 ALT=""></DIV>
|
||||
<DIV class="header-top"><A HREF="/"><IMG SRC="/images/updatelogo.png" BORDER=0 HEIGHT=55 WIDTH=270 ALT="Mozilla Update"></A></DIV>
|
||||
<DIV class="tabbar">
|
||||
<A HREF="/?application=mozilla"><IMG SRC="/images/tab-mozilla<?php if ($application=="mozilla") {echo"-selected"; } ?>.png" BORDER=0 HEIGHT=20 WIDTH=98 ALT="[Mozilla] "></A><A HREF="/?application=firefox"><IMG SRC="/images/tab-firefox<?php if ($application=="firefox") {echo"-selected"; } ?>.png" BORDER=0 HEIGHT=20 WIDTH=98 ALT="[Firefox] "></A><A HREF="/?application=thunderbird"><IMG SRC="/images/tab-thunderbird<?php if ($application=="thunderbird") {echo"-selected"; } ?>.png" BORDER=0 HEIGHT=20 WIDTH=105 ALT="[Thunderbird] "></A><A HREF="/developercp.php"><IMG SRC="/images/tab-login<?php if ($application=="login") {echo"-selected"; } ?>.png" BORDER=0 HEIGHT=20 WIDTH=98 ALT="[Login]"></A>
|
||||
</DIV>
|
||||
</DIV>
|
||||
<DIV class="bar"></DIV>
|
||||
<DIV class="nav">
|
||||
<?php if ($application !=="login") { ?>
|
||||
<A HREF="/?application=<?php echo"$application"; ?>">Home</A>
|
||||
| <A HREF="/faq/?application=<?php echo"$application"; ?>">FAQ</A>
|
||||
<?php
|
||||
// Types
|
||||
$types = array("E"=>"Extensions","T"=>"Themes");
|
||||
foreach($types as $typeid => $typename) {
|
||||
echo" | <A HREF=\"/".strtolower($typename)."/?application=$application\">$typename</A>";
|
||||
}
|
||||
//echo"<BR>\n";
|
||||
|
||||
} else { echo" "; }
|
||||
?>
|
||||
</DIV>
|
||||
|
||||
<?php
|
||||
if ($pos !== false) {
|
||||
?>
|
||||
<?php if ($_SESSION["logoncheck"] =="YES" && $headerline !="none") { ?>
|
||||
<DIV class="adminheading">
|
||||
Welcome<?php echo" $_SESSION[name]"; ?>!
|
||||
<a href="usermanager.php?function=edituser&userid=<?php echo"$_SESSION[uid]"; ?>">Your Profile</a> | <A HREF="main.php">Home</A> |<A HREF="logout.php">Logout</A>
|
||||
<?php } ?>
|
||||
</DIV>
|
||||
<div id="mainContent">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
103
mozilla/webtools/update/core/postfeedback.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?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 *****
|
||||
|
||||
//Submit Review/Rating Feedback to Table
|
||||
require"../core/config.php";
|
||||
if (!$_POST[rating] && $_POST[rating] !=="0") {
|
||||
//No Rating Defined, send user back...
|
||||
$return_path="extensions/moreinfo.php?id=$_POST[id]&vid=$_POST[vid]&page=opinion&error=norating";
|
||||
header("Location: http://$_SERVER[HTTP_HOST]/$return_path");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$_POST[comments]) {
|
||||
$_POST[comments]="NULL";
|
||||
} else {
|
||||
//Comments is not null, format comments and get default name/title.. if needed.
|
||||
$_POST["comments"]="'$_POST[comments]'";
|
||||
if (!$_POST[name]) {$_POST[name]=="Anonymous"; }
|
||||
if (!$_POST[title]) {$_POST[title]=="My Comments..."; }
|
||||
}
|
||||
|
||||
$_POST["name"] = strip_tags($_POST["name"]);
|
||||
$_POST["title"] = strip_tags($_POST["title"]);
|
||||
$_POST["comments"] = strip_tags($_POST["comments"]);
|
||||
|
||||
//Are we behind a proxy and given the IP via an alternate enviroment variable? If so, use it.
|
||||
if ($_SERVER["HTTP_X_FORWARDED_FOR"]) {
|
||||
$remote_addr = $_SERVER["HTTP_X_FORWARDED_FOR"];
|
||||
} else {
|
||||
$remote_addr = $_SERVER["REMOTE_ADDR"];
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `t_feedback` (`ID`, `CommentName`, `CommentVote`, `CommentTitle`, `CommentNote`, `CommentDate`, `commentip`) VALUES ('$_POST[id]', '$_POST[name]', '$_POST[rating]', '$_POST[title]', $_POST[comments], NOW(NULL), '$remote_addr');";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
|
||||
//Get Rating Data and Create $ratingarray
|
||||
$sql = "SELECT ID, CommentVote FROM `t_feedback` WHERE `ID` = '$_POST[id]' AND `CommentVote` IS NOT NULL AND `CommentNote` IS NOT NULL ORDER BY `CommentDate` ASC";
|
||||
$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)) {
|
||||
$ratingarray[$row[ID]][] = $row["CommentVote"];
|
||||
}
|
||||
|
||||
//Compile Rating Average
|
||||
$id = $_POST[id];
|
||||
if (!$ratingarray[$id]) {$ratingarray[$id] = array(); }
|
||||
$numratings = count($ratingarray[$id]);
|
||||
$sumratings = array_sum($ratingarray[$id]);
|
||||
if ($numratings>0) {
|
||||
$rating = round($sumratings/$numratings, 1);
|
||||
} else {
|
||||
$rating="0"; } //Default Rating
|
||||
|
||||
|
||||
$sql = "UPDATE `t_main` SET `Rating`='$rating' WHERE `ID`='$id' LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
|
||||
if ($_POST["type"]=="E") {
|
||||
$type="extensions";
|
||||
} else if ($_POST["type"]=="T") {
|
||||
$type="themes";
|
||||
}
|
||||
|
||||
$return_path="$type/moreinfo.php?id=$_POST[id]&vid=$_POST[vid]&page=comments&action=postsuccessfull";
|
||||
header("Location: http://$sitehostname/$return_path");
|
||||
exit;
|
||||
?>
|
||||
94
mozilla/webtools/update/core/sessionconfig.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?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 *****
|
||||
|
||||
//session_name('sid');
|
||||
//session_name();
|
||||
//session_start();
|
||||
|
||||
if ($_GET["version"]=="auto-detect") {$_GET["version"]=""; unset($_SESSION["app_version"]);}//Clear Versioning in Session For AutoDetect
|
||||
if ($_GET["application"] AND $_GET["application"] != $_SESSION["application"]) {
|
||||
$_SESSION["application"] = $_GET["application"]; //Put the selected app into session. skip detection. ;-)
|
||||
unset($_SESSION["app_version"]);
|
||||
$detection_force_version = "true"; //Skip application checking, just fill in the version.
|
||||
}
|
||||
|
||||
//Get Browser Detection Data if it's not in the Session vars already
|
||||
if (!$_SESSION["application"] OR !$_SESSION["app_version"]) {
|
||||
include"inc_browserdetection.php";
|
||||
}
|
||||
|
||||
//Change OS Support for showlist.php
|
||||
switch ( $_GET["os"] )
|
||||
{
|
||||
case 'windows':
|
||||
$_GET["os"] = 'Windows';
|
||||
break;
|
||||
case 'linux':
|
||||
$_GET["os"] = 'Linux';
|
||||
break;
|
||||
case 'solaris':
|
||||
$_GET["os"] = 'Solaris';
|
||||
break;
|
||||
case 'bsd':
|
||||
$_GET["os"] = 'BSD';
|
||||
break;
|
||||
case 'macosx':
|
||||
$_GET["os"] = 'MacOSX';
|
||||
break;
|
||||
case 'all':
|
||||
$_GET["os"] = 'ALL';
|
||||
break;
|
||||
default:
|
||||
unset($_GET["os"]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (($_GET["os"] and $_SESSION["app_os"]) AND $_GET["os"] !== $_SESSION["app_os"]) {
|
||||
$_SESSION["app_os"]=$_GET["os"];
|
||||
|
||||
}
|
||||
|
||||
//Got session data for browser/app detection, populate the variables
|
||||
$application = $_SESSION["application"];
|
||||
$app_version = $_SESSION["app_version"];
|
||||
$OS = $_SESSION["app_os"];
|
||||
|
||||
|
||||
if ($_GET["debug"]=="killappdata") { unset($_SESSION["application"],$_SESSION["app_version"]); }
|
||||
?>
|
||||
226
mozilla/webtools/update/core/update.css
Normal file
@@ -0,0 +1,226 @@
|
||||
/* ***** 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 ***** */
|
||||
|
||||
BODY {
|
||||
MARGIN: 0px 0px 5px; FONT-FAMILY: Arial; BACKGROUND-COLOR: #fff
|
||||
}
|
||||
A {
|
||||
COLOR: #00129c; TEXT-DECORATION: none
|
||||
}
|
||||
A:visited {
|
||||
COLOR: #00129c; TEXT-DECORATION: none
|
||||
}
|
||||
A:hover {
|
||||
COLOR: #fc5900
|
||||
}
|
||||
DIV.header {
|
||||
BACKGROUND-IMAGE: url(/images/header.png); BACKGROUND-REPEAT: repeat-x; HEIGHT: 77px
|
||||
}
|
||||
DIV.header-top {
|
||||
HEIGHT: 57px
|
||||
}
|
||||
DIV.logo {
|
||||
z-index: 1; position: absolute; right: 0px
|
||||
}
|
||||
DIV.tabbar {
|
||||
PADDING-LEFT: 26px; HEIGHT: 20px
|
||||
}
|
||||
|
||||
DIV.nav {
|
||||
BACKGROUND-IMAGE: url(/images/orangebar.png); background-repeat: repeat-x; PADDING-TOP: 3px; PADDING-LEFT: 10px; FONT-WEIGHT: bold; MARGIN-BOTTOM: 10px; COLOR: #fff; BACKGROUND-COLOR: #0F67C1; a:VISITED: #fff
|
||||
}
|
||||
DIV.nav A:visited {
|
||||
COLOR: #FFF;
|
||||
}
|
||||
DIV.nav A {
|
||||
COLOR: #fff
|
||||
}
|
||||
DIV.adminheading {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN-RIGHT: 10px; HEIGHT: 25px; TEXT-ALIGN: right
|
||||
}
|
||||
.box {
|
||||
BORDER-RIGHT: #ccc 2px solid; PADDING-RIGHT: 5px; BORDER-TOP: #ccc 2px solid; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 14pt; MARGIN-BOTTOM: 15px; PADDING-BOTTOM: 5px; POSITION: relative; LEFT: 150px; BORDER-LEFT: #ccc 2px solid; WIDTH: 78%; PADDING-TOP: 5px; BORDER-BOTTOM: #ccc 2px solid; -moz-border-radius: 10px
|
||||
}
|
||||
.boxheader {
|
||||
MARGIN-BOTTOM: 6px; BORDER-BOTTOM: #000 1px solid
|
||||
}
|
||||
.boxcolumns {
|
||||
BORDER-RIGHT: #ccc 2px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ccc 2px solid; PADDING-LEFT: 2px; FONT-SIZE: 12pt; MIN-HEIGHT: 200px; FLOAT: left; PADDING-BOTTOM: 2px; MARGIN-LEFT: 2px; BORDER-LEFT: #ccc 2px solid; WIDTH: 31%; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 2px solid; -moz-border-radius: 10px
|
||||
}
|
||||
DIV.sidelinks {
|
||||
BORDER-RIGHT: #ccc 2px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ccc 2px solid; MARGIN-TOP: 10px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN-LEFT: 3px; BORDER-LEFT: #ccc 2px solid; WIDTH: 135px; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 2px solid; POSITION: absolute; -moz-border-radius: 10px
|
||||
}
|
||||
.sidebartitle {
|
||||
FONT-WEIGHT: bold
|
||||
}
|
||||
.sidebartext {
|
||||
MARGIN-LEFT: 4px
|
||||
}
|
||||
.updatebox {
|
||||
BORDER-RIGHT: #ccc 2px solid; PADDING-RIGHT: 5px; BORDER-TOP: #ccc 2px solid; MARGIN-TOP: 3px; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 14pt; MIN-HEIGHT: 200px; MARGIN-BOTTOM: 15px; PADDING-BOTTOM: 5px; MARGIN-LEFT: 1px; BORDER-LEFT: #ccc 2px solid; WIDTH: 230px; PADDING-TOP: 5px; BORDER-BOTTOM: #ccc 2px solid; POSITION: absolute; -moz-border-radius: 10px
|
||||
}
|
||||
.frontpagecontainer {
|
||||
MIN-HEIGHT: 150px; WIDTH: 100%
|
||||
}
|
||||
.contentbox {
|
||||
BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 14pt; PADDING-BOTTOM: 5px; MARGIN: 0px 5px 15px 0px; BORDER-LEFT: #ccc 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #ccc 1px solid; -moz-border-radius: 10px
|
||||
}
|
||||
.contentcolumns {
|
||||
FLOAT: left; WIDTH: 48%
|
||||
}
|
||||
|
||||
#content {
|
||||
PADDING-LEFT: 5px; POSITION: relative; LEFT: 145px; WIDTH: 85%;
|
||||
}
|
||||
|
||||
DIV.item {
|
||||
BORDER-RIGHT: #ccc 2px solid; PADDING-RIGHT: 8px; BORDER-TOP: #ccc 2px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 0px; MARGIN: 0px auto 15px; BORDER-LEFT: #ccc 2px solid; WIDTH: 95%; PADDING-TOP: 8px; BORDER-BOTTOM: #ccc 2px solid; -moz-border-radius: 10px
|
||||
}
|
||||
#listnav {
|
||||
BORDER-RIGHT: #ccc 2px solid; PADDING-RIGHT: 6px; BORDER-TOP: #ccc 2px solid; PADDING-LEFT: 6px; FONT-WEIGHT: bold; FONT-SIZE: 10pt; PADDING-BOTTOM: 6px; MARGIN: 3px auto; BORDER-LEFT: #ccc 2px solid; WIDTH: 95%; PADDING-TOP: 6px; BORDER-BOTTOM: #ccc 2px solid; TEXT-ALIGN: left; -moz-border-radius: 10px
|
||||
}
|
||||
.listform {
|
||||
BORDER-RIGHT: #3d97c0 1px dotted; PADDING-RIGHT: 2px; BORDER-TOP: #3d97c0 1px dotted; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 10px auto auto; BORDER-LEFT: #3d97c0 1px dotted; WIDTH: 90%; PADDING-TOP: 2px; BORDER-BOTTOM: #3d97c0 1px dotted; HEIGHT: 25px; BACKGROUND-COLOR: #d4e9f2; TEXT-ALIGN: center
|
||||
}
|
||||
.title A {
|
||||
COLOR: #fc5900
|
||||
}
|
||||
.title A:visited {
|
||||
COLOR: #fc5900
|
||||
}
|
||||
.liststars {
|
||||
FLOAT: right; WIDTH: 80px; HEIGHT: 20px
|
||||
}
|
||||
.listtitle {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 11pt
|
||||
}
|
||||
.itemtitle {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 14pt; MARGIN-BOTTOM: 10px; MARGIN-LEFT: 30px
|
||||
}
|
||||
.authorline {
|
||||
FONT-SIZE: 10pt; MARGIN-LEFT: 15px
|
||||
}
|
||||
.itemdescription {
|
||||
FONT-SIZE: 10pt
|
||||
}
|
||||
.iconbar {
|
||||
PADDING-RIGHT: 5px; FONT-WEIGHT: normal; FONT-SIZE: 9pt; FLOAT: right; WIDTH: 125px; HEIGHT: 34px; TEXT-ALIGN: left
|
||||
}
|
||||
.filesize {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 8pt
|
||||
}
|
||||
.smallfont {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 8pt
|
||||
}
|
||||
.baseline {
|
||||
BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 10px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #333
|
||||
}
|
||||
.noitems {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 60px; TEXT-ALIGN: center
|
||||
}
|
||||
.pagenum {
|
||||
FONT-SIZE: 9pt; FLOAT: right
|
||||
}
|
||||
DIV.tabbar {
|
||||
PADDING-RIGHT: 8px; PADDING-LEFT: 8px; PADDING-BOTTOM: 0px; MARGIN: 0px auto auto; WIDTH: 85%; PADDING-TOP: 0px; HEIGHT: 20px
|
||||
}
|
||||
DIV.tab {
|
||||
BORDER-RIGHT: #ccc 2px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ccc 2px solid; PADDING-LEFT: 3px; FONT-SIZE: 11pt; FLOAT: left; MARGIN: 0px 3px; VERTICAL-ALIGN: middle; BORDER-LEFT: #ccc 2px solid; BORDER-BOTTOM: #ccc 2px solid; HEIGHT: 20px; BACKGROUND-COLOR: #ddd; TEXT-ALIGN: center; -moz-border-radius: 10px
|
||||
}
|
||||
.downloadbox {
|
||||
BORDER-RIGHT: #ccc 1px dotted; BORDER-TOP: #ccc 1px dotted; FONT-WEIGHT: bold; FLOAT: left; BORDER-LEFT: #ccc 1px dotted; BORDER-BOTTOM: #ccc 1px dotted; max-width: 395px;
|
||||
}
|
||||
.moreinfoinstall {
|
||||
MARGIN-LEFT: 18px; WIDTH: 250px; HEIGHT: 34px
|
||||
}
|
||||
.commentbox {
|
||||
BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 10pt; MIN-HEIGHT: 260px; PADDING-BOTTOM: 6px; MARGIN: auto 0px 5px auto; BORDER-LEFT: #ccc 1px solid; WIDTH: 50%; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 1px solid
|
||||
}
|
||||
.commenttitlebar {
|
||||
PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 11pt; HEIGHT: 20px; BACKGROUND-COLOR: #eee
|
||||
}
|
||||
.commenttitle {
|
||||
PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 11pt; POSITION: absolute
|
||||
}
|
||||
.commentfooter {
|
||||
PADDING-RIGHT: 5px; FONT-SIZE: 8pt; TEXT-ALIGN: right
|
||||
}
|
||||
.nocomment {
|
||||
MARGIN-LEFT: 30px
|
||||
}
|
||||
.mipageheading {
|
||||
BORDER-TOP: #ccc 1px solid; MARGIN-TOP: 5px; PADDING-LEFT: 4px; FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN-BOTTOM: 5px; COLOR: #333
|
||||
}
|
||||
.reviewbox {
|
||||
BORDER-RIGHT: #bbb 1px dotted; BORDER-TOP: #bbb 1px dotted; FONT-WEIGHT: bold; MARGIN: auto auto 10px; BORDER-LEFT: #bbb 1px dotted; WIDTH: 70%; BORDER-BOTTOM: #bbb 1px dotted
|
||||
};
|
||||
.opinionform {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN: auto 30px; WIDTH: 80%; LINE-HEIGHT: 30px
|
||||
}
|
||||
.errorbox {
|
||||
BORDER-RIGHT: #f00 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #f00 1px solid; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; MARGIN: auto auto 20px; BORDER-LEFT: #f00 1px solid; WIDTH: 80%; PADDING-TOP: 3px; BORDER-BOTTOM: #f00 1px solid
|
||||
}
|
||||
.boxheader2 {
|
||||
BORDER-TOP: #2e64ff 4px solid; HEIGHT: 4px
|
||||
}
|
||||
.boldfont {
|
||||
FONT-WEIGHT: bold
|
||||
}
|
||||
.disabled {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #ccc; FONT-STYLE: italic
|
||||
}
|
||||
.emailactive {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-STYLE: italic
|
||||
}
|
||||
.profileitemdesc {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN-BOTTOM: 4px; MARGIN-LEFT: 20px
|
||||
}
|
||||
.mailresult {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 14pt; MARGIN: auto; WIDTH: 650px; HEIGHT: 30px; TEXT-ALIGN: center
|
||||
}
|
||||
.faqtitle {
|
||||
FONT-WEIGHT: normal; FONT-SIZE: 24pt; COLOR: #0065CA; TEXT-ALIGN: center
|
||||
}
|
||||
.faqitemtitle {
|
||||
FONT-WEIGHT: bold; FONT-SIZE: 12pt
|
||||
}
|
||||
.faqitemtext {
|
||||
MARGIN-LEFT: 5px
|
||||
}
|
||||
.footer {
|
||||
PADDING-RIGHT: 30px; FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN-LEFT: 200px; TEXT-ALIGN: right
|
||||
}
|
||||
4
mozilla/webtools/update/database/README
Normal file
@@ -0,0 +1,4 @@
|
||||
The files contained in this directory are schema for the Mozilla Update MySQL Database.
|
||||
This directory does not have to be on the webserver for the site to function, in fact, it should not be.
|
||||
|
||||
Mozilla Update requires MySQL 4.0 or higher w/ InnoDB support.
|
||||
348
mozilla/webtools/update/database/mozillaupdate.sql
Normal file
@@ -0,0 +1,348 @@
|
||||
# ***** 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>
|
||||
# Alan Starr <alanjstarr@yahoo.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 *****
|
||||
|
||||
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 2.6.0-rc1
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Sep 12, 2004 at 05:07 AM
|
||||
-- Server version: 4.0.18
|
||||
-- PHP Version: 4.3.8
|
||||
--
|
||||
-- Database: `mozillaupdate`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_applications`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_applications` (
|
||||
`AppID` int(11) NOT NULL auto_increment,
|
||||
`AppName` varchar(30) NOT NULL default '',
|
||||
`Version` varchar(10) NOT NULL default '',
|
||||
`major` int(3) NOT NULL default '0',
|
||||
`minor` int(3) NOT NULL default '0',
|
||||
`release` int(3) NOT NULL default '0',
|
||||
`build` int(14) NOT NULL default '0',
|
||||
`SubVer` enum('a','b','final','','+') NOT NULL default 'final',
|
||||
`GUID` varchar(50) NOT NULL default '',
|
||||
PRIMARY KEY (`AppID`),
|
||||
KEY `AppName` (`AppName`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=25 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_approvallog`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_approvallog` (
|
||||
`LogID` int(5) NOT NULL auto_increment,
|
||||
`ID` varchar(11) NOT NULL default '',
|
||||
`vID` varchar(11) NOT NULL default '',
|
||||
`UserID` varchar(11) NOT NULL default '',
|
||||
`action` varchar(255) NOT NULL default '',
|
||||
`date` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`comments` text NOT NULL,
|
||||
PRIMARY KEY (`LogID`),
|
||||
KEY `ID` (`ID`),
|
||||
KEY `vID` (`vID`),
|
||||
KEY `UserID` (`UserID`),
|
||||
KEY `UserID_2` (`UserID`)
|
||||
) TYPE=InnoDB AUTO_INCREMENT=430 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_authorxref`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_authorxref` (
|
||||
`ID` int(11) NOT NULL default '0',
|
||||
`UserID` int(11) NOT NULL default '0',
|
||||
KEY `ID` (`ID`),
|
||||
KEY `UserID` (`UserID`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_categories`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_categories` (
|
||||
`CategoryID` int(11) NOT NULL auto_increment,
|
||||
`CatName` varchar(30) NOT NULL default '',
|
||||
`CatDesc` varchar(100) NOT NULL default '',
|
||||
`CatType` enum('E','T','P') NOT NULL default 'E',
|
||||
PRIMARY KEY (`CategoryID`)
|
||||
) TYPE=InnoDB AUTO_INCREMENT=28 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_categoryxref`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_categoryxref` (
|
||||
`ID` int(11) NOT NULL default '0',
|
||||
`CategoryID` int(11) NOT NULL default '0',
|
||||
KEY `IDIndex` (`ID`,`CategoryID`),
|
||||
KEY `CategoryID` (`CategoryID`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_downloads`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_downloads` (
|
||||
`dID` int(11) NOT NULL auto_increment,
|
||||
`ID` varchar(5) NOT NULL default '',
|
||||
`date` varchar(14) default NULL,
|
||||
`downloadcount` int(15) NOT NULL default '0',
|
||||
`vID` varchar(5) NOT NULL default '',
|
||||
`user_ip` varchar(15) NOT NULL default '',
|
||||
`user_agent` text NOT NULL,
|
||||
`type` enum('count','download') NOT NULL default 'download',
|
||||
PRIMARY KEY (`dID`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=3 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_faq`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_faq` (
|
||||
`id` int(3) NOT NULL auto_increment,
|
||||
`index` varchar(5) NOT NULL default '1',
|
||||
`alias` varchar(12) NOT NULL default '',
|
||||
`title` varchar(150) NOT NULL default '',
|
||||
`text` text NOT NULL,
|
||||
`lastupdated` timestamp(14) NOT NULL,
|
||||
`active` enum('YES','NO') NOT NULL default 'YES',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=7 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_feedback`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_feedback` (
|
||||
`CommentID` int(11) NOT NULL auto_increment,
|
||||
`ID` int(11) NOT NULL default '0',
|
||||
`CommentName` varchar(100) default NULL,
|
||||
`CommentVote` enum('0','1','2','3','4','5') default NULL,
|
||||
`CommentTitle` varchar(75) NOT NULL default '',
|
||||
`CommentNote` text,
|
||||
`CommentDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`commentip` varchar(15) NOT NULL default '',
|
||||
PRIMARY KEY (`CommentID`),
|
||||
KEY `ID` (`ID`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=15487 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_main`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_main` (
|
||||
`ID` int(11) NOT NULL auto_increment,
|
||||
`GUID` varchar(50) NOT NULL default '',
|
||||
`Name` varchar(100) NOT NULL default '',
|
||||
`Type` enum('T','E','P') NOT NULL default 'T',
|
||||
`DateAdded` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`DateUpdated` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`Homepage` varchar(200) default NULL,
|
||||
`Description` varchar(255) NOT NULL default '',
|
||||
`Rating` varchar(4) NOT NULL default '0',
|
||||
`downloadcount` int(15) NOT NULL default '0',
|
||||
`TotalDownloads` int(18) NOT NULL default '0',
|
||||
PRIMARY KEY (`ID`),
|
||||
KEY `Type` (`Type`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=218 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_os`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_os` (
|
||||
`OSID` int(11) NOT NULL auto_increment,
|
||||
`OSName` varchar(20) NOT NULL default '',
|
||||
PRIMARY KEY (`OSID`),
|
||||
UNIQUE KEY `OSName` (`OSName`)
|
||||
) TYPE=InnoDB AUTO_INCREMENT=7 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_previews`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_previews` (
|
||||
`PreviewID` int(11) NOT NULL auto_increment,
|
||||
`PreviewURI` varchar(200) NOT NULL default '',
|
||||
`vID` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`PreviewID`),
|
||||
KEY `vID` (`vID`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=24 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_reviews`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_reviews` (
|
||||
`rID` int(11) NOT NULL auto_increment,
|
||||
`ID` int(11) NOT NULL default '0',
|
||||
`AppID` int(11) NOT NULL default '0',
|
||||
`DateAdded` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`AuthorID` int(11) NOT NULL default '0',
|
||||
`Title` varchar(60) NOT NULL default '',
|
||||
`Body` text,
|
||||
`pick` enum('YES','NO') NOT NULL default 'NO',
|
||||
`featured` enum('YES','NO') NOT NULL default 'NO',
|
||||
PRIMARY KEY (`rID`),
|
||||
KEY `ID` (`ID`),
|
||||
KEY `AppID` (`AppID`),
|
||||
KEY `AuthorID` (`AuthorID`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=3 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_userprofiles`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_userprofiles` (
|
||||
`UserID` int(11) NOT NULL auto_increment,
|
||||
`UserName` varchar(100) NOT NULL default '',
|
||||
`UserEmail` varchar(100) NOT NULL default '',
|
||||
`UserWebsite` varchar(100) default NULL,
|
||||
`UserPass` varchar(200) NOT NULL default '',
|
||||
`UserMode` enum('A','E','U','D') NOT NULL default 'U',
|
||||
`UserTrusted` enum('TRUE','FALSE') NOT NULL default 'FALSE',
|
||||
`UserEmailHide` tinyint(1) NOT NULL default '1',
|
||||
PRIMARY KEY (`UserID`),
|
||||
UNIQUE KEY `UserEmail` (`UserEmail`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=142 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `t_version`
|
||||
--
|
||||
|
||||
CREATE TABLE `t_version` (
|
||||
`vID` int(11) NOT NULL auto_increment,
|
||||
`ID` int(11) NOT NULL default '0',
|
||||
`Version` varchar(30) NOT NULL default '0',
|
||||
`OSID` int(11) NOT NULL default '0',
|
||||
`AppID` int(11) NOT NULL default '0',
|
||||
`MinAppVer` varchar(10) NOT NULL default '',
|
||||
`MinAppVer_int` varchar(10) NOT NULL default '',
|
||||
`MaxAppVer` varchar(10) NOT NULL default '',
|
||||
`MaxAppVer_int` varchar(10) NOT NULL default '',
|
||||
`Size` int(11) NOT NULL default '0',
|
||||
`DateAdded` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`DateUpdated` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`URI` varchar(255) NOT NULL default '',
|
||||
`Notes` text,
|
||||
`approved` enum('YES','NO','?') NOT NULL default '?',
|
||||
PRIMARY KEY (`vID`),
|
||||
KEY `ID` (`ID`),
|
||||
KEY `AppID` (`AppID`),
|
||||
KEY `OSID` (`OSID`),
|
||||
KEY `Version` (`Version`)
|
||||
) TYPE=InnoDB PACK_KEYS=0 AUTO_INCREMENT=558 ;
|
||||
|
||||
--
|
||||
-- Constraints for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Constraints for table `t_authorxref`
|
||||
--
|
||||
ALTER TABLE `t_authorxref`
|
||||
ADD CONSTRAINT `0_125` FOREIGN KEY (`ID`) REFERENCES `t_main` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `0_126` FOREIGN KEY (`UserID`) REFERENCES `t_userprofiles` (`UserID`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `t_categoryxref`
|
||||
--
|
||||
ALTER TABLE `t_categoryxref`
|
||||
ADD CONSTRAINT `0_128` FOREIGN KEY (`ID`) REFERENCES `t_main` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `0_129` FOREIGN KEY (`CategoryID`) REFERENCES `t_categories` (`CategoryID`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `t_feedback`
|
||||
--
|
||||
ALTER TABLE `t_feedback`
|
||||
ADD CONSTRAINT `0_131` FOREIGN KEY (`ID`) REFERENCES `t_main` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `t_previews`
|
||||
--
|
||||
ALTER TABLE `t_previews`
|
||||
ADD CONSTRAINT `0_133` FOREIGN KEY (`vID`) REFERENCES `t_version` (`vID`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `t_reviews`
|
||||
--
|
||||
ALTER TABLE `t_reviews`
|
||||
ADD CONSTRAINT `0_135` FOREIGN KEY (`ID`) REFERENCES `t_main` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `0_136` FOREIGN KEY (`AppID`) REFERENCES `t_applications` (`AppID`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `t_version`
|
||||
--
|
||||
ALTER TABLE `t_version`
|
||||
ADD CONSTRAINT `0_139` FOREIGN KEY (`ID`) REFERENCES `t_main` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `0_140` FOREIGN KEY (`AppID`) REFERENCES `t_applications` (`AppID`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
77
mozilla/webtools/update/developercp.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<TITLE>Mozilla Update :: Developer Control Panel - Coming Soon</TITLE>
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
$application="login";
|
||||
include"$page_header";
|
||||
?>
|
||||
<DIV class="faqtitle">Developer Control Panel - Coming Soon</DIV>
|
||||
|
||||
<DIV style="width: 75%; margin: auto; margin-top: 20px; border: 1px dotted #0065CA; padding: 5px">
|
||||
In the next version of Mozilla Update, Mozilla Update will have a new section for Extension/Theme authors to login to. This new section
|
||||
will give them the ability to manage their extensions and themes that're hosted on Mozilla Update themselves.<BR>
|
||||
<BR>
|
||||
Authors will have the ability to add a new extension or theme themselves, as well as adding new versions of that extension or theme,
|
||||
updating an existing listing (including being able to change the application-compatibility settings w/o needing a new file), and if
|
||||
they so desire, the ability to remove entirely an old version of an extension or theme or the entire listing.<BR>
|
||||
<BR>
|
||||
Other features that will be available include the capability of adding and managing preview images of their extension or theme,
|
||||
a developer comments feature, so they can easily communicate to end-users known problems with the extension/theme.
|
||||
<BR>
|
||||
</DIV>
|
||||
|
||||
<P>
|
||||
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
194
mozilla/webtools/update/extensions/authorprofiles.php
Normal file
@@ -0,0 +1,194 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
|
||||
<?php
|
||||
//Bookmarking-Friendly Page Title
|
||||
$sql = "SELECT UserName FROM `t_userprofiles` WHERE UserID = '$_GET[id]' LIMIT 1";
|
||||
$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) {
|
||||
$return = page_error("2","Author ID is Invalid or Missing.");
|
||||
exit;
|
||||
|
||||
}
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
?>
|
||||
|
||||
<TITLE>Mozilla Update :: Extensions - Author Profile: <?php echo"$row[UserName]"; ?></TITLE>
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
include"$page_header";
|
||||
|
||||
$type = "E";
|
||||
$category = $_GET["category"];
|
||||
include"inc_sidebar.php";
|
||||
?>
|
||||
<DIV id="content">
|
||||
<?php
|
||||
$userid = $_GET["id"];
|
||||
$sql = "SELECT * FROM `t_userprofiles` WHERE `UserID` = '$userid' 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);
|
||||
$userid = $row["UserID"];
|
||||
$username = $row["UserName"];
|
||||
$useremail = $row["UserEmail"];
|
||||
$userwebsite = $row["UserWebsite"];
|
||||
$userpass = $row["UserPass"];
|
||||
$userrole = $row["UserRole"];
|
||||
$useremailhide = $row["UserEmailHide"];
|
||||
?>
|
||||
<DIV class="item">
|
||||
<SPAN class="boldfont">Profile for <?php echo"$username"; ?></SPAN><BR>
|
||||
<DIV class="boxheader2"></DIV>
|
||||
<SPAN class="boldfont">Homepage:</SPAN> <?php
|
||||
if ($userwebsite) {echo"<A HREF=\"$userwebsite\" target=\"_blank\">$userwebsite</A>";
|
||||
} else {
|
||||
echo"<SPAN CLASS=\"disabled\">Not Available for this Author</SPAN>";
|
||||
}
|
||||
?><BR>
|
||||
<SPAN class="boldfont">E-Mail:</SPAN> <?php if ($useremailhide=="1") {
|
||||
echo"<SPAN class=\"disabled\">Not Disclosed by Author</SPAN>";
|
||||
} else {
|
||||
echo"<SPAN class=\"emailactive\">Contact this Author via the <A HREF=\"#email\">E-Mail form</A> below</SPAN>";
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
<BR>
|
||||
<DIV class="item">
|
||||
<SPAN class="boldfont">All Extensions and Themes by <?php echo"$username"; ?></SPAN><BR>
|
||||
<DIV class="boxheader2"></DIV>
|
||||
<?php
|
||||
$sql = "SELECT TM.ID, TM.Type, TM.Name, TM.Description, TM.DateUpdated, TM.TotalDownloads, TU.UserEmail FROM `t_main` TM
|
||||
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
|
||||
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
|
||||
WHERE TU.UserID = '$userid' AND TM.Type !='P'
|
||||
ORDER BY `Type` , `Name` ";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$numresults = mysql_num_rows($sql_result);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
|
||||
|
||||
$sql2 = "SELECT `vID`, `Version` FROM `t_version` WHERE `ID` = '$row[ID]' AND `approved` = 'YES' ORDER BY `Version` ASC LIMIT 1";
|
||||
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
while ($row2 = mysql_fetch_array($sql_result2)) {
|
||||
$vid = $row2["vID"];
|
||||
$version = $row2["Version"];
|
||||
|
||||
$v++;
|
||||
$id = $row["ID"];
|
||||
$type = $row["Type"];
|
||||
$name = $row["Name"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$dateupdated = $row["DateUpdated"];
|
||||
$homepage = $row["Homepage"];
|
||||
$description = $row["Description"];
|
||||
$authors = $row["UserEmail"];
|
||||
$downloadcount = $row["TotalDownloads"];
|
||||
|
||||
$day=substr($dateupdated,8,2); //get the day
|
||||
$month=substr($dateupdated,5,2); //get the month
|
||||
$year=substr($dateupdated,0,4); //get the year
|
||||
$hour=substr($dateupdated,11,2); //get the hour
|
||||
$minute=substr($dateupdated,14,2); //get the minute
|
||||
$second=substr($dateupdated,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$dateupdated = gmdate("F d, Y g:i:sa", $timestamp); //gmdate("F d, Y", $dutimestamp);
|
||||
|
||||
echo"<DIV CLASS=\"item\">";
|
||||
echo"<SPAN class=\"title itemtitle\" style=\"margin-left: 0px\"><A HREF=\"moreinfo.php?application=$application&id=$id\">$name</A></SPAN><BR>";
|
||||
echo"<DIV class=\"profileitemdesc\">$description</DIV>\n";
|
||||
echo"<DIV class=\"baseline\">Updated: $dateupdated | Downloads: $downloadcount</DIV>\n";
|
||||
|
||||
echo"</DIV>\n";
|
||||
echo"<BR>\n";
|
||||
}
|
||||
}
|
||||
if ($numresults=="0") {
|
||||
echo"<DIV class=\"noitems\">No Extensions or Themes in the Database for $username yet...</DIV>";
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
<BR>
|
||||
<?php if ($useremailhide !=="1") { ?>
|
||||
<A NAME="email"></A>
|
||||
<DIV class="item">
|
||||
<SPAN class="boldfont">Send an E-Mail to <?php echo"$username"; ?></SPAN><BR>
|
||||
<DIV class="boxheader2"></DIV>
|
||||
<?php
|
||||
//SendMail Returned Message Section
|
||||
if ($_GET["mail"]) {
|
||||
$mail = $_GET["mail"];
|
||||
echo"<DIV class=\"mailresult\">";
|
||||
if ($mail=="successful") {
|
||||
echo"Your message has been sent successfully...";
|
||||
} else if ($mail=="unsuccessful") {
|
||||
echo"An error occured, your message was not sent... Please try again...";
|
||||
}
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
?>
|
||||
<FORM NAME="sendmail" METHOD="POST" ACTION="sendmail.php">
|
||||
<INPUT NAME="senduserid" TYPE="HIDDEN" VALUE="<?php echo"$userid"; ?>">
|
||||
Your Name: <INPUT NAME="fromname" TYPE="TEXT" SIZE=40 MAXLENGTH=100> Email: <INPUT NAME="fromemail" TYPE="TEXT" SIZE=40 MAXLENGTH=100><BR>
|
||||
Subject: <INPUT NAME="subject" TYPE="TEXT" SIZE=40 MAXLENGTH=100><BR>
|
||||
Message:<BR>
|
||||
<CENTER><TEXTAREA NAME="body" ROWS=20 COLS=65></TEXTAREA><BR>
|
||||
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Send Message"> <INPUT NAME="reset" TYPE="RESET" VALUE="Reset Form"><BR>
|
||||
</CENTER>
|
||||
</FORM>
|
||||
</DIV>
|
||||
<BR>
|
||||
<?php } ?>
|
||||
</DIV>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
88
mozilla/webtools/update/extensions/inc_sidebar.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?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 *****
|
||||
?>
|
||||
<DIV class="sidelinks">
|
||||
<?php
|
||||
unset($typename);
|
||||
$types = array("E"=>"Extensions","T"=>"Themes","U"=>"Updates");
|
||||
$typename = $types["$type"];
|
||||
echo"<DIV CLASS=\"sidebartitle\">Categories:</DIV>\n";
|
||||
echo"<DIV class=\"sidebartext\">";
|
||||
if (!$category AND $index !="yes") {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<SPAN class=\"sidebartitle\"><A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=All\" TITLE=\"Show All ".ucwords($typename)." Alphabetically\">All</A></SPAN><BR>\n";
|
||||
if (!$category AND $index !="yes") {echo"</SPAN>"; }
|
||||
|
||||
// Object Categories
|
||||
$sql = "SELECT `CatName`,`CatDesc` FROM `t_categories` WHERE `CatType` = '$type' ORDER BY `CatName`";
|
||||
$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)) {
|
||||
$catname = $row["CatName"];
|
||||
$catdesc = $row["CatDesc"];
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">$catname</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
}
|
||||
?>
|
||||
<BR>
|
||||
<?php
|
||||
$catname = "Editors Pick";
|
||||
$catdesc = ucwords($typename)." picked by the Mozilla Update Editors";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">Editor's Pick</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
|
||||
$catname = "Popular";
|
||||
$catdesc = ucwords($typename)." downloaded the most";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">$catname</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
|
||||
$catname = "Top Rated";
|
||||
$catdesc = ucwords($typename)." rated the highest";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">$catname</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
|
||||
$catname = "Newest";
|
||||
$catdesc = "Most recent ".ucwords($typename);
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">$catname</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
?>
|
||||
</DIV>
|
||||
</DIV>
|
||||
229
mozilla/webtools/update/extensions/index.php
Normal file
@@ -0,0 +1,229 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
|
||||
<TITLE>Mozilla Update :: Extensions - Add Features to Mozilla Software</TITLE>
|
||||
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
$type = "E";
|
||||
if ($_GET["application"]) {$application=$_GET["application"]; }
|
||||
include"$page_header";
|
||||
$index="yes";
|
||||
include"inc_sidebar.php";
|
||||
?>
|
||||
<DIV class="box">
|
||||
<DIV class="boxheader" style="width: 100%">What is an Extension?</DIV>
|
||||
<SPAN class="itemdescription">Extensions are small add-ons that add new functionality to <?php print(ucwords($application)); ?>.
|
||||
They can add anything from a toolbar button to a completely new feature. They allow the browser to be customized to fit the
|
||||
personal needs of each user if they need additional features<?php if ($application !=="mozilla") { ?>, while keeping <?php print(ucwords($application)); ?> small
|
||||
to download <?php } ?>.</SPAN>
|
||||
</DIV>
|
||||
|
||||
<DIV class="box">
|
||||
<DIV class="boxheader" style="width: 100%">Featured <?php print(ucwords($application)); ?> Extension</DIV>
|
||||
<?php
|
||||
$sql = "SELECT TR.ID, TM.Name, `Title`, TR.DateAdded, `Body`, `Type`, `pick` FROM `t_reviews` TR
|
||||
INNER JOIN t_main TM ON TR.ID = TM.ID
|
||||
INNER JOIN t_version TV ON TV.ID = TM.ID
|
||||
INNER JOIN t_applications TA ON TA.AppID = TV.AppID
|
||||
WHERE `Type` = '$type' AND `AppName` = '$application' AND `featured`='YES' ORDER BY `rID` DESC 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"];
|
||||
$name = $row["Name"];
|
||||
$title = $row["Title"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$pick = $row["pick"];
|
||||
$body = $row["Body"];
|
||||
$bodylength = strlen($body);
|
||||
if ($bodylength>"250") {
|
||||
$body = substr($body,0,250);
|
||||
$body .= " <a href=\"moreinfo.php?id=$id&application=$application&page=staffreview\">[More...]</a>";
|
||||
|
||||
}
|
||||
|
||||
//Create Customizeable Timestamp
|
||||
$day=substr($dateadded,8,2); //get the day
|
||||
$month=substr($dateadded,5,2); //get the month
|
||||
$year=substr($dateadded,0,4); //get the year
|
||||
$hour=substr($dateadded,11,2); //get the hour
|
||||
$minute=substr($dateadded,14,2); //get the minute
|
||||
$second=substr($dateadded,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$date = gmdate("F, Y", $timestamp);
|
||||
|
||||
echo"<a href=\"moreinfo.php?id=$id\">$name</A> -- $title";
|
||||
if ($pick=="YES") {echo" - $date Editors Pick"; }
|
||||
echo"<BR>\n";
|
||||
echo"<SPAN class=\"itemdescription\">$body</SPAN><BR>\n";
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
<?php
|
||||
//Temporary!! Current Version Array Code
|
||||
$currentver_array = array("firefox"=>"1.0", "thunderbird"=>"1.0", "mozilla"=>"1.7");
|
||||
$currentver_display_array = array("firefox"=>"1.0", "thunderbird"=>"1.0", "mozilla"=>"1.7.x");
|
||||
$currentver = $currentver_array[$application];
|
||||
$currentver_display = $currentver_display_array[$application];
|
||||
?>
|
||||
<DIV class="box" style="width: 80%; min-height: 200px; border: 0px">
|
||||
<DIV class="boxcolumns">
|
||||
<DIV class="boxheader"><A HREF="showlist.php?application=<?php echo"$application"; ?>&category=Popular">Most Popular</A>:</DIV>
|
||||
<?php
|
||||
$i=0;
|
||||
$sql = "SELECT TM.ID, TV.vID,TM.Name, TV.Version, TM.TotalDownloads, TM.downloadcount
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' 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);
|
||||
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"];
|
||||
if ($lastname == $name) {$i--; continue; }
|
||||
echo"$i - <a href=\"moreinfo.php?application=$application&id=$id\">$name</a><br>\n";
|
||||
echo"<SPAN class=\"smallfont nocomment\">($downloadcount downloads)</SPAN><BR>\n";
|
||||
|
||||
$lastname = $name;
|
||||
if ($i >= "5") {break;}
|
||||
}
|
||||
?>
|
||||
<BR>
|
||||
</DIV>
|
||||
<DIV class="boxcolumns">
|
||||
<DIV class="boxheader"><A HREF="showlist.php?category=Top Rated">Top Rated</A>:</DIV>
|
||||
<?php
|
||||
$r=0;
|
||||
$usednames = array();
|
||||
$sql = "SELECT TM.ID, TV.vID, TM.Name, TV.Version, TM.Rating, TU.UserName
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_authorxref TAX ON TAX.ID = TM.ID
|
||||
INNER JOIN t_userprofiles TU ON TU.UserID = TAX.UserID
|
||||
WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND `Rating` > '0' AND `approved` = 'YES' ORDER BY `Rating` DESC, `Name` ASC, `Version` DESC";
|
||||
$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)) {
|
||||
$r++; $s++;
|
||||
$id = $row["ID"];
|
||||
$vid = $row["vID"];
|
||||
$name = $row["Name"];
|
||||
$version = $row["Version"];
|
||||
$rating = $row["Rating"];
|
||||
$arraysearch = array_search("$name", $usednames);
|
||||
if ($arraysearch !== false AND $usedversions[$arraysearch]['version']<$version) {$r--; continue; } //
|
||||
echo"$r - <a href=\"moreinfo.php?application=$application&id=$id\">$name</a> ";
|
||||
|
||||
//$rating = round($rating);
|
||||
echo"<SPAN title=\"Rated: $rating of 5\" style=\"font-size: 8pt\">";
|
||||
for ($i = 1; $i <= floor($rating); $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
if ($rating>floor($rating)) {
|
||||
$val = ($rating-floor($rating))*10;
|
||||
echo"<IMG SRC=\"/images/stars/star_0$val.png\" BORDER=0 ALT=\"\">";
|
||||
$i++;
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
echo"</SPAN><br>\n";
|
||||
//echo"<SPAN class=\"smallfont nocomment\">By $author</SPAN><BR>\n";
|
||||
$usednames[$s] = $name;
|
||||
$usedversions[$s] = $version;
|
||||
if ($r >= "5") {break;}
|
||||
}
|
||||
unset($usednames, $usedversions, $r, $s, $i);
|
||||
?>
|
||||
</DIV>
|
||||
<DIV class="boxcolumns">
|
||||
<DIV class="boxheader"><A HREF="showlist.php?category=Newest">Most Recent</A>:</DIV>
|
||||
<?php
|
||||
$i=0;
|
||||
$sql = "SELECT TM.ID, TV.vID, TM.Name, TV.Version, TV.DateAdded
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID
|
||||
WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND (`OSName` = '$_SESSION[app_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);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
$i++;
|
||||
$id = $row["ID"];
|
||||
$vid = $row["vID"];
|
||||
$name = $row["Name"];
|
||||
$version = $row["Version"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
//Create Customizeable Datestamp
|
||||
$timestamp = strtotime("$dateadded");
|
||||
$dateadded = gmdate("F d, Y g:i:sa", $timestamp); // $dateupdated = gmdate("F d, Y g:i:sa T", $timestamp);
|
||||
|
||||
if ($lastname == $name) {$i--; continue; }
|
||||
echo"$i - <a href=\"moreinfo.php?application=$application&id=$id&vid=$vid\">$name $version</a><BR>\n";
|
||||
echo"<SPAN class=\"smallfont nocomment\">($dateadded)</SPAN><BR>\n";
|
||||
|
||||
$lastname = $name;
|
||||
if ($i >= "5") {break;}
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
</DIV>
|
||||
<BR>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
106
mozilla/webtools/update/extensions/install.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?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";
|
||||
//Get Full Information for the file requested.
|
||||
$sql = "SELECT `URI` FROM `t_version` WHERE `ID`='$_GET[id]' AND `vID`='$_GET[vid]' 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);
|
||||
$uri=$row["URI"];
|
||||
|
||||
header("Location: $uri");
|
||||
exit;
|
||||
|
||||
//XXX This codepath sucks performance wise and has been disabled. See Bug 267822.
|
||||
|
||||
// New DownloadCount management Code..
|
||||
//Check for user, to see if they recently accessed this file (filters duplicate/triplicate+ requests in a short period).
|
||||
$maxlife = date("YmdHis", mktime(date("H"), date("i")-10, date("s"), date("m"), date("d"), date("Y")));
|
||||
$sql = "SELECT `dID` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `vID`='$_GET[vid]' AND `user_ip`='$_SERVER[REMOTE_ADDR]' AND `user_agent` = '$_SERVER[HTTP_USER_AGENT]' AND `date`>'$maxlife' AND `type`='download' LIMIT 1";
|
||||
$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") {
|
||||
//Insert a record of this download for the next 10 minutes anyway. :-)
|
||||
$today=date("YmdHis");
|
||||
$sql = "INSERT INTO `t_downloads` (`ID`,`date`,`vID`, `user_ip`, `user_agent`, `type`) VALUES ('$_GET[id]','$today','$_GET[vid]', '$_SERVER[REMOTE_ADDR]', '$_SERVER[HTTP_USER_AGENT]', 'download');";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
//Cleanup the Individual Downloads part of the table for old records
|
||||
$sql = "DELETE FROM `t_downloads` WHERE `date`<'$maxlife' AND `type`='download'";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
$today=date("Ymd")."000000";
|
||||
//Per day download tracking -- Record hits for this day in the record (if it doesn't exist create it)
|
||||
$sql = "SELECT `dID` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`='$today' AND `type`='count' LIMIT 1";
|
||||
$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") {
|
||||
$sql = "INSERT INTO `t_downloads` (`ID`,`date`,`downloadcount`,`type`) VALUES ('$_GET[id]','$today','1','count');";
|
||||
} else {
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
$sql = "UPDATE `t_downloads` SET `downloadcount`=downloadcount+1 WHERE `dID`='$row[dID]' LIMIT 1";
|
||||
}
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
|
||||
//Download Statistic Management Code
|
||||
// Maintain the last 7 days record count
|
||||
// This is also where the weekly w/e code would go. if that feature is ever created.
|
||||
$mindate = date("Ymd", mktime(0, 0, 0, date("m"), date("d")-7, date("Y")))."000000";
|
||||
$downloadcount="0";
|
||||
$sql = "SELECT `downloadcount` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`>='$mindate' AND `type`='count' ORDER BY `date` DESC";
|
||||
$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)) {
|
||||
$downloadcount = $downloadcount+$row["downloadcount"];
|
||||
}
|
||||
//Update the 7 day count in the main record.
|
||||
$sql = "UPDATE `t_main` SET `downloadcount`='$downloadcount' WHERE `ID`='$_GET[id]' LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
//Update the total downloadcount in the main record.
|
||||
$sql = "UPDATE `t_main` SET `TotalDownloads`=TotalDownloads+1 WHERE `ID`='$_GET[id]' LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
//Clean up the Counts per day for >8 days. (and in the future, compile the week/ending records for this data)
|
||||
$sql = "DELETE FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`<'$mindate' AND `type`='count'";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
}
|
||||
|
||||
//Send User on their way to the file...
|
||||
header("Location: $uri")
|
||||
?>
|
||||
550
mozilla/webtools/update/extensions/moreinfo.php
Normal file
@@ -0,0 +1,550 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
|
||||
<?php
|
||||
//Bookmarking-Friendly Page Title
|
||||
$sql = "SELECT Name FROM `t_main` WHERE ID = '$_GET[id]' AND Type = 'E' LIMIT 1";
|
||||
$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) {
|
||||
$return = page_error("1","Extension ID is Invalid or Missing.");
|
||||
exit;
|
||||
|
||||
}
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
|
||||
//Page Titles
|
||||
$pagetitles = array("releases"=>"All Releases", "comments"=>"User Comments", "staffreview"=>"Editor Review", "opinion"=>" My Opinion");
|
||||
$pagetitle = $pagetitles[$_GET["page"]];
|
||||
?>
|
||||
|
||||
<TITLE>Mozilla Update :: Extensions -- More Info: <?php echo"$row[Name]"; if ($pagetitle) {echo" - $pagetitle"; } ?></TITLE>
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
include"$page_header";
|
||||
$type = "E";
|
||||
$category=$_GET["category"];
|
||||
include"inc_sidebar.php";
|
||||
?>
|
||||
<DIV id="content">
|
||||
<?php
|
||||
//Get Author Data
|
||||
$sql2 = "SELECT TM.Name, TU.UserName, TU.UserID, TU.UserEmail FROM `t_main` TM
|
||||
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
|
||||
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
|
||||
WHERE TM.ID = '$_GET[id]'
|
||||
ORDER BY `Type` , `Name` ASC ";
|
||||
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
while ($row2 = mysql_fetch_array($sql_result2)) {
|
||||
$authorarray[$row2[Name]][] = $row2["UserName"];
|
||||
$authorids[$row2[UserName]] = $row2["UserID"];
|
||||
}
|
||||
|
||||
|
||||
//Run Query and Create List
|
||||
$s = "0";
|
||||
$sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Description, TM.Rating, TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.DateAdded AS VerDateAdded, TV.DateUpdated AS VerDateUpdated, TV.URI, TV.Notes, TM.TotalDownloads, TA.AppName, TOS.OSName, TP.PreviewURI
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID
|
||||
LEFT JOIN t_previews TP ON TV.vID = TP.vID
|
||||
WHERE TM.ID = '$_GET[id]' AND `approved` = 'YES' ";
|
||||
if ($_GET["vid"]) { $sql .=" AND TV.vID = '$_GET[vid]' "; }
|
||||
$sql .= "ORDER BY `Name` , `Version` 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);
|
||||
|
||||
|
||||
$v++;
|
||||
$id = $row["ID"];
|
||||
$type = $row["Type"];
|
||||
$name = $row["Name"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$dateupdated = $row["DateUpdated"];
|
||||
$homepage = $row["Homepage"];
|
||||
$description = $row["Description"];
|
||||
$rating = $row["Rating"];
|
||||
$authors = $authorarray[$name];
|
||||
$osname = $row["OSName"];
|
||||
|
||||
$vid = $row["vID"];
|
||||
if (!$_GET['vid']) {$_GET['vid']=$vid;}
|
||||
$appname = $row["AppName"];
|
||||
$minappver = $row["MinAppVer"];
|
||||
$maxappver = $row["MaxAppVer"];
|
||||
$verdateadded = $row["VerDateAdded"];
|
||||
$verdateupdated = $row["VerDateUpdated"];
|
||||
$filesize = $row["Size"];
|
||||
$notes = $row["Notes"];
|
||||
$version = $row["Version"];
|
||||
$uri = $row["URI"];
|
||||
$previewuri = $row["PreviewURI"];
|
||||
$downloadcount = $row["TotalDownloads"];
|
||||
|
||||
if ($VerDateAdded > $dateadded) {$dateadded = $VerDateAdded; }
|
||||
if ($VerDateUpdated > $dateupdated) {$dateupdated = $VerDateUpdated; }
|
||||
|
||||
|
||||
|
||||
//Turn Authors Array into readable string...
|
||||
$authorcount = count($authors);
|
||||
foreach ($authors as $author) {
|
||||
$userid = $authorids[$author];
|
||||
$n++;
|
||||
$authorstring .= "<A HREF=\"authorprofiles.php?application=$application&id=$userid\">$author</A>";
|
||||
if ($authorcount != $n) {$authorstring .=", "; }
|
||||
|
||||
}
|
||||
$authors = $authorstring;
|
||||
unset($authorstring, $n); // Clear used Vars..
|
||||
|
||||
//Create Customizeable Timestamp for DateAdded/DateUpdated
|
||||
$day=substr($dateadded,8,2); //get the day
|
||||
$month=substr($dateadded,5,2); //get the month
|
||||
$year=substr($dateadded,0,4); //get the year
|
||||
$hour=substr($dateadded,11,2); //get the hour
|
||||
$minute=substr($dateadded,14,2); //get the minute
|
||||
$second=substr($dateadded,17,2); //get the sec
|
||||
$datimestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
|
||||
$day=substr($dateupdated,8,2); //get the day
|
||||
$month=substr($dateupdated,5,2); //get the month
|
||||
$year=substr($dateupdated,0,4); //get the year
|
||||
$hour=substr($dateupdated,11,2); //get the hour
|
||||
$minute=substr($dateupdated,14,2); //get the minute
|
||||
$second=substr($dateupdated,17,2); //get the sec
|
||||
$dutimestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
|
||||
$dateadded = gmdate("F d, Y g:i:sa", $datimestamp); //gmdate("F d, Y", $datimestamp);
|
||||
$dateupdated = gmdate("F d, Y g:i:sa", $dutimestamp); //gmdate("F d, Y", $dutimestamp);
|
||||
|
||||
//Rating
|
||||
if (!$rating) { $rating="0"; }
|
||||
?>
|
||||
|
||||
|
||||
<DIV class="tabbar">
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid"; ?>">More Info</A></DIV>
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid&page=releases"; ?>">All Releases</A></DIV>
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid&page=comments"; ?>">Comments</A></DIV>
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid&page=staffreview"; ?>">Editor Review</A></DIV>
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid&page=opinion"; ?>">My Opinion</A></DIV>
|
||||
</DIV>
|
||||
<?php
|
||||
echo"<DIV class=\"item\">\n";
|
||||
//echo"<DIV style=\"height: 100px\">"; //Why?!?
|
||||
if ($previewuri) {
|
||||
list($width, $height, $imagetype, $attr) = getimagesize("$websitepath"."$previewuri");
|
||||
|
||||
echo"<IMG SRC=\"$previewuri\" BORDER=0 HEIGHT=$height WIDTH=$width STYLE=\"float: right; padding-right: 5px\" ALT=\"$name preview\">";
|
||||
}
|
||||
|
||||
//Upper-Right Side Box
|
||||
echo"<DIV class=\"liststars\" title=\"$rating of 5 stars\" style=\"font-size: 8pt\"><A HREF=\"moreinfo.php?application=$application&id=$id&page=comments\">";
|
||||
for ($i = 1; $i <= floor($rating); $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
if ($rating>floor($rating)) {
|
||||
$val = ($rating-floor($rating))*10;
|
||||
echo"<IMG SRC=\"/images/stars/star_0$val.png\" BORDER=0 ALT=\"\">";
|
||||
$i++;
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
echo"</A></DIV>\n";
|
||||
|
||||
echo"<DIV class=\"itemtitle\">";
|
||||
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid\">$name $version</A></SPAN><BR>";
|
||||
echo"<SPAN class=\"authorline\">By $authors</SPAN><br>";
|
||||
echo"</DIV>";
|
||||
|
||||
//Description & Version Notes
|
||||
echo"<SPAN class=\"itemdescription\">";
|
||||
echo"$description<BR>";
|
||||
if ($notes) {echo"$notes"; }
|
||||
echo"</SPAN>\n";
|
||||
|
||||
//echo"</DIV>\n";
|
||||
echo"<BR>\n\n";
|
||||
|
||||
$page = $_GET["page"];
|
||||
if (!$page or $page=="general") {
|
||||
?>
|
||||
<DIV class="downloadbox">
|
||||
<?php
|
||||
//Create DateStamp for Version Release Date ($verdateadded)
|
||||
$day=substr($verdateadded,8,2); //get the day
|
||||
$month=substr($verdateadded,5,2); //get the month
|
||||
$year=substr($verdateadded,0,4); //get the year
|
||||
$hour=substr($verdateadded,11,2); //get the hour
|
||||
$minute=substr($verdateadded,14,2); //get the minute
|
||||
$second=substr($verdateadded,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$verdateadded = gmdate("F d, Y", $timestamp);
|
||||
|
||||
//Calculate Download Time
|
||||
$speed = "56"; //In Kbit/s
|
||||
$speedinkb = "5.5"; //$speedinkb = $speed/8; //In KB/s
|
||||
$timeinsecs = round($filesize/$speedinkb);
|
||||
$time_minutes = floor($timeinsecs/60);
|
||||
$time_seconds = round($timeinsecs-($time_minutes*60),-1);
|
||||
$time_seconds = $time_seconds+2; //Compensate for mirror overhead
|
||||
|
||||
$time = "About ";
|
||||
if ($time_minutes>0) {
|
||||
$time .= "$time_minutes minutes ";
|
||||
}
|
||||
$time .="$time_seconds seconds";
|
||||
|
||||
$filename = basename($uri);
|
||||
|
||||
echo"
|
||||
<SPAN style=\"itemdescription\">Released on $verdateadded</SPAN><BR>
|
||||
|
||||
|
||||
<DIV class=\"moreinfoinstall\">";
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\" TITLE=\"Download $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Download Now )</A><BR>";
|
||||
} else {
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.install({'$name $version':'$uri'}))\" TITLE=\"Install $name $version\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Install Now )</A><BR>";
|
||||
//echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Install Now )</A><BR>";
|
||||
}
|
||||
echo"
|
||||
<SPAN class=\"filesize\"> $filesize KB, ($time @ $speed"."k)</SPAN></DIV>
|
||||
<BR>";
|
||||
if ($application=="thunderbird") {
|
||||
echo"<SPAN style=\"font-size: 10pt; color: #00F\">Extension Install Instructions for Thunderbird Users:</SPAN><BR>
|
||||
<SPAN style=\"font-size: 8pt;\">(1) Right-Click the link above and choose \"Save Link As...\" to Download and save the file to your hard disk.<BR>
|
||||
(2) In Mozilla Thunderbird, open the extension manager (Tools Menu/Extensions)<BR>
|
||||
(3) Click the Install button, and locate/select the file you downloaded and click \"OK\"</SPAN><BR>
|
||||
";
|
||||
}
|
||||
if ($homepage) {echo"<SPAN style=\"font-size:10pt\">Having a problem with this Extension? For Help and Technical Support, visit the <A HREF=\"$homepage\">Extension's Homepage</A>.</SPAN>";}
|
||||
|
||||
echo"<UL style=\"font-size:10pt\">";
|
||||
if ($homepage) {echo"<LI> <A HREF=\"$homepage\">Extension Home Page</A>"; }
|
||||
if ($appname !="Thunderbird") {echo"<LI> <a href=\"install.php/$filename?id=$id&vid=$vid\" TITLE=\"Right-click to Save\">Download Extension</A>"; }
|
||||
echo"<LI> <A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&page=releases\">Other Versions</A>";
|
||||
?>
|
||||
</UL>
|
||||
</DIV>
|
||||
|
||||
<DIV class="commentbox">
|
||||
<DIV class="boxheader">User Comments:</DIV>
|
||||
<BR>
|
||||
<?php
|
||||
$sql = "SELECT CommentName, CommentTitle, CommentNote, CommentDate, CommentVote FROM `t_feedback` WHERE ID = '$_GET[id]' AND CommentNote IS NOT NULL ORDER BY `CommentDate` DESC LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$num_results = mysql_num_rows($sql_result);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
$commentname = $row["CommentName"];
|
||||
$commenttitle = $row["CommentTitle"];
|
||||
$commentnotes = $row["CommentNote"];
|
||||
$commentdate = $row["CommentDate"];
|
||||
$rating = $row["CommentVote"];
|
||||
|
||||
//Create Customizeable Datestamp
|
||||
$day=substr($commentdate,8,2); //get the day
|
||||
$month=substr($commentdate,5,2); //get the month
|
||||
$year=substr($commentdate,0,4); //get the year
|
||||
$hour=substr($commentdate,11,2); //get the hour
|
||||
$minute=substr($commentdate,14,2); //get the minute
|
||||
$second=substr($commentdate,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$commentdate = gmdate("F d, Y g:ia", $timestamp);
|
||||
|
||||
echo"<DIV class=\"commenttitlebar\">";
|
||||
echo"<SPAN class=\"commenttitle\">$commenttitle</SPAN>";
|
||||
echo"<SPAN class=\"liststars\">";
|
||||
|
||||
for ($i = 1; $i <= $rating; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 WIDTH=16 HEIGHT=16 ALT=\"*\">";
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 WIDTH=16 HEIGHT=16 ALT=\"\">";
|
||||
}
|
||||
echo"</SPAN>";
|
||||
echo"</DIV>";
|
||||
echo" By $commentname<BR>\n";
|
||||
echo" <BR>\n";
|
||||
echo"$commentnotes<BR>\n\n";
|
||||
echo" <BR>\n";
|
||||
echo"<DIV class=\"commentfooter\">\n";
|
||||
echo"$commentdate | <A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&page=comments\">More Comments...</A> | <A HREF=\"moreinfo.php?id=$id&vid=$vid&category=$category&vid=$vid&page=opinion\">Rate It!</A>\n";
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
|
||||
if ($num_results=="0") {
|
||||
echo"<DIV class=\"nocomment\">";
|
||||
echo"Nobody's Commented on this Extension Yet<BR>";
|
||||
echo"Be the First! <A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&page=opinion\">Rate It!</A>";
|
||||
echo"</DIV>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</DIV>
|
||||
|
||||
<?php
|
||||
} else if ($page=="releases") {
|
||||
|
||||
echo"<DIV class=\"mipageheading\">";
|
||||
echo"Recent Releases:<BR>";
|
||||
echo"</DIV>";
|
||||
|
||||
$sql = "SELECT TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.URI, TV.Notes, TA.AppName, TOS.OSName
|
||||
FROM `t_version` TV
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID
|
||||
WHERE TV.ID = '$_GET[id]' AND `approved` = 'YES'
|
||||
ORDER BY `Version` DESC, `OSName` ASC
|
||||
LIMIT 0, 10";
|
||||
|
||||
$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)) {
|
||||
$vid = $row["vID"];
|
||||
$minappver = $row["MinAppVer"];
|
||||
$maxappver = $row["MaxAppVer"];
|
||||
$filesize = $row["Size"];
|
||||
$notes = $row["Notes"];
|
||||
$version = $row["Version"];
|
||||
$uri = $row["URI"];
|
||||
$osname = $row["OSName"];
|
||||
$appname = $row["AppName"];
|
||||
$filename = basename($uri);
|
||||
|
||||
echo"<DIV>"; //Open Version DIV
|
||||
|
||||
//Description & Version Notes
|
||||
echo"<SPAN class=\"itemdescription\">";
|
||||
echo"<SPAN class=\"listtitle\"><A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid\">Version $version</A></SPAN><br>\n";
|
||||
if ($notes) {echo"$notes"; }
|
||||
echo"</SPAN>\n";
|
||||
|
||||
//Icon Bar Modules
|
||||
echo"<DIV style=\"height: 34px\">";
|
||||
echo"<DIV class=\"iconbar\" style=\"width: 100px;\">";
|
||||
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Download</A>";
|
||||
} else {
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.install({'$name $version':'$uri'}))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Install</A>";
|
||||
}
|
||||
|
||||
echo"<BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
//echo"<DIV class=\"iconbar\" style=\"width: 100px;\"><A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Install</A><BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"$appname\"> Works with:<BR> $minappver - $maxappver</DIV>";
|
||||
echo"<DIV class=\"iconbar\" style=\"width: 90px;\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"\">OS:<BR>"; if($osname=="ALL") {echo"All OSes";} else {echo"$osname";} echo"</DIV>";
|
||||
echo"</DIV>";
|
||||
|
||||
echo"</DIV>";
|
||||
}
|
||||
|
||||
//End General Page
|
||||
} else if ($page=="comments") {
|
||||
//Comments/Ratings Page
|
||||
echo"<DIV class=\"mipageheading\">";
|
||||
echo"User Comments:<BR>";
|
||||
echo"</DIV>";
|
||||
$sql = "SELECT CommentName, CommentTitle, CommentNote, CommentDate, CommentVote FROM `t_feedback` WHERE ID = '$_GET[id]' AND CommentNote IS NOT NULL ORDER BY `CommentDate` ASC";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$num_results = mysql_num_rows($sql_result);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
$name = $row["CommentName"];
|
||||
$title = $row["CommentTitle"];
|
||||
$notes = $row["CommentNote"];
|
||||
$date = $row["CommentDate"];
|
||||
$rating = $row["CommentVote"];
|
||||
|
||||
echo"<DIV class=\"commenttitlebar\">";
|
||||
echo"<SPAN class=\"commenttitle\">$title</SPAN>";
|
||||
echo"<SPAN class=\"liststars\">";
|
||||
|
||||
for ($i = 1; $i <= $rating; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 WIDTH=16 HEIGHT=16 ALT=\"*\">";
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 WIDTH=16 HEIGHT=16 ALT=\"\">";
|
||||
}
|
||||
echo"</SPAN>";
|
||||
echo"</DIV>";
|
||||
echo"$notes<BR>\n\n";
|
||||
|
||||
echo"<DIV class=\"commentfooter\">\n";
|
||||
echo"<SPAN style=\"padding-left: 30px; font-size: 8pt; font-weight: bold\">Posted on $date by $name</SPAN><br>";
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
|
||||
if ($num_results=="0") {
|
||||
echo"<DIV class=\"nocomment\">";
|
||||
echo"Nobody has commented on this extension yet...<BR>
|
||||
Be the First!
|
||||
<A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&page=opinion\">Leave your comments</A>...";
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
|
||||
|
||||
echo"<DIV style=\"height: 5px;\"></DIV>";
|
||||
|
||||
} else if ($page=="staffreview") {
|
||||
//Staff/Editor Review Tab
|
||||
echo"<DIV class=\"mipageheading\">";
|
||||
echo"Editor Review:<BR>";
|
||||
echo"</DIV>";
|
||||
|
||||
echo"<DIV class=\"reviewbox\">\n";
|
||||
$sql = "SELECT TR.ID, `Title`, TR.DateAdded, `Body`, `Type`, `Pick`, TU.UserName FROM `t_reviews` TR
|
||||
INNER JOIN t_main TM ON TR.ID = TM.ID
|
||||
INNER JOIN t_userprofiles TU ON TR.AuthorID = TU.UserID
|
||||
WHERE `Type` = 'E' AND TR.ID = '$_GET[id]' ORDER BY `rID` DESC LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$num_results = mysql_num_rows($sql_result);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
$id = $row["ID"];
|
||||
$title = $row["Title"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$body = $row["Body"];
|
||||
$pick = $row["Pick"];
|
||||
$username = $row["UserName"];
|
||||
|
||||
//Create Customizeable Timestamp
|
||||
// $day=substr($dateadded,8,2); //get the day
|
||||
// $month=substr($dateadded,5,2); //get the month
|
||||
// $year=substr($dateadded,0,4); //get the year
|
||||
// $hour=substr($dateadded,11,2); //get the hour
|
||||
// $minute=substr($dateadded,14,2); //get the minute
|
||||
// $second=substr($dateadded,17,2); //get the sec
|
||||
// $timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$timestamp = strtotime("$dateadded");
|
||||
$date = gmdate("F, Y", $timestamp);
|
||||
$posteddate = date("F j Y, g:i:sa", $timestamp);
|
||||
|
||||
|
||||
echo"$title<br>\n";
|
||||
if ($pick=="YES") {echo"<SPAN class=\"itemdescription\"> $date Editors Pick<BR>\n"; }
|
||||
echo"<BR>\n";
|
||||
echo"$body</SPAN><BR>\n";
|
||||
echo"<DIV class=\"commentfooter\">Posted on $posteddate by $username</DIV>\n";
|
||||
}
|
||||
$typename = "extension";
|
||||
if ($num_results=="0") {
|
||||
echo"
|
||||
<SPAN style=\"font-weight: bold\">
|
||||
This $typename has not yet been reviewed.<BR><BR>
|
||||
|
||||
To see what other users think of this extension, view the <A HREF=\"moreinfo.php?application=$application&id=$id&page=comments\">User Comments...</A>
|
||||
</SPAN>
|
||||
";
|
||||
|
||||
|
||||
}
|
||||
echo"</DIV>\n";
|
||||
|
||||
} else if ($page=="opinion") {
|
||||
//My Opinion Tab
|
||||
echo"<DIV class=\"mipageheading\">";
|
||||
echo"Your Rating / Feedback:<BR>";
|
||||
echo"</DIV>";
|
||||
?>
|
||||
<?php
|
||||
if ($_GET["error"]=="norating") {
|
||||
echo"<DIV class=\"errorbox\">\n
|
||||
Your comment submission had the following error(s), please fix these errors and try again.<br>\n
|
||||
Rating field cannot be left blank.<br>\n
|
||||
</DIV>\n";
|
||||
}
|
||||
?>
|
||||
<DIV class="opinionform">
|
||||
<FORM NAME="opinon" METHOD="POST" ACTION="../core/postfeedback.php">
|
||||
<INPUT NAME="id" TYPE="HIDDEN" VALUE="<?php echo"$id"; ?>">
|
||||
<INPUT NAME="vid" TYPE="HIDDEN" VALUE="<?php echo"$vid"; ?>">
|
||||
<INPUT NAME="type" TYPE="HIDDEN" value="E">
|
||||
Your Name:<BR>
|
||||
<INPUT NAME="name" TYPE="TEXT" SIZE=30 MAXLENGTH=30><BR>
|
||||
|
||||
Rating:*<BR>
|
||||
<SELECT NAME="rating">
|
||||
<OPTION value="">Rating:
|
||||
<OPTION value="5">5 Stars
|
||||
<OPTION value="4">4 Stars
|
||||
<OPTION value="3">3 Stars
|
||||
<OPTION value="2">2 Stars
|
||||
<OPTION value="1">1 Star
|
||||
<OPTION value="0">0 Stars
|
||||
</SELECT><BR>
|
||||
|
||||
Title:<BR>
|
||||
<INPUT NAME="title" TYPE="TEXT" SIZE=30 MAXLENGTH=50><BR>
|
||||
|
||||
Review/Comments:<BR>
|
||||
<TEXTAREA NAME="comments" ROWS=5 COLS=55></TEXTAREA><BR>
|
||||
<SPAN class="smallfont">No Comment?<INPUT NAME="commententered" TYPE="CHECKBOX" VALUE="FALSE"></SPAN><BR>
|
||||
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Post"> <INPUT NAME="reset" TYPE="RESET" VALUE="Reset"><BR>
|
||||
<SPAN class="smallfont">* Required Fields</SPAN>
|
||||
</FORM>
|
||||
|
||||
</DIV>
|
||||
<?php
|
||||
} // End Pages
|
||||
echo"<DIV class=\"baseline\">";
|
||||
echo"Date Added: $dateadded | Last Updated: $dateupdated | ";
|
||||
echo"Total Downloads: $downloadcount<BR>";
|
||||
echo"</DIV>\n";
|
||||
echo"</DIV>\n";
|
||||
echo"<BR>\n";
|
||||
?>
|
||||
</DIV>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
107
mozilla/webtools/update/extensions/sendmail.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?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
|
||||
//Mozilla Update Message System
|
||||
//Send Mail script...
|
||||
exit;
|
||||
require"../core/config.php";
|
||||
|
||||
if (!$_POST["senduserid"]) {
|
||||
exit("<B>Error: no valid user to e-mail, possible attempt to spam detected...</B>");
|
||||
}
|
||||
|
||||
//Get E-Mail Address from DB based on passed data..
|
||||
$sql = "SELECT `UserEmail` FROM `t_userprofiles` WHERE `UserID` = '$_POST[senduserid]' AND `UserEmailHide`='0' LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
$to_address=$row["UserEmail"];
|
||||
|
||||
|
||||
//All From_, To_, and subject variables are passed from the form
|
||||
// and do not need to be defined here.. unless debugging..
|
||||
|
||||
$from_name = $_POST["fromname"];
|
||||
$from_address = $_POST["fromemail"];
|
||||
$subject = $_POST["subject"];
|
||||
|
||||
//Anti-Abuse
|
||||
$findme = '@';
|
||||
$pos = strpos($to_address, $findme);
|
||||
|
||||
if ($pos === false) {
|
||||
//This isn't a valid e-mail address being passed...
|
||||
//Send the e-mail message to the $from_address, just for fun..
|
||||
$to_address = $from_address;
|
||||
}
|
||||
|
||||
$message = $_POST["body"];
|
||||
|
||||
//Message Footer (Auto-Appended to Messages sent using this form.
|
||||
$message .= "\n\n";
|
||||
$message .= "____________________________________\n";
|
||||
$message .= "Message sent through the Mozilla Update Message system.\n
|
||||
The system allows visitors to send you e-mail without revealing your e-mail address to them.
|
||||
If you no longer wish to receive e-mail from visitors, you may change your preferences online at http;//update.mozilla.org.\n";
|
||||
|
||||
|
||||
$headers .= "MIME-Version: 1.0\r\n";
|
||||
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
|
||||
$headers .= "From: ".$from_name." <".$from_address.">\r\n";
|
||||
$headers .= "Reply-To: ".$from_name." <".$from_address.">\r\n";
|
||||
$headers .= "X-Priority: 3\r\n";
|
||||
$headers .= "X-MSMail-Priority: Normal\r\n";
|
||||
$headers .= "X-Mailer: Mozilla Update Message System 1.0";
|
||||
|
||||
$mailstatus = mail($to_address, $subject, $message, $headers);
|
||||
|
||||
|
||||
|
||||
if ($mailstatus===FALSE) {
|
||||
//Message Unsuccessful
|
||||
$return_path="extensions/authorprofiles.php?id=$_POST[senduserid]&mail=unsuccessful";
|
||||
|
||||
} else if ($mailstatus===TRUE) {
|
||||
//Message Successful
|
||||
$return_path="extensions/authorprofiles.php?id=$_POST[senduserid]&mail=successful";
|
||||
|
||||
}
|
||||
header("Location: http://$_SERVER[HTTP_HOST]/$return_path#email");
|
||||
exit;
|
||||
|
||||
?>
|
||||
484
mozilla/webtools/update/extensions/showlist.php
Normal file
@@ -0,0 +1,484 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
|
||||
<?php
|
||||
//----------------------------
|
||||
//Global General $_GET variables
|
||||
//----------------------------
|
||||
//Detection Override
|
||||
if ($_GET["version"]) {$app_version=$_GET["version"]; $_SESSION["app_version"]=$_GET["version"];}
|
||||
|
||||
if ($_GET["numpg"]) {$_SESSION["items_per_page"]=$_GET["numpg"]; }
|
||||
if ($_SESSION["items_per_page"]) {$items_per_page = $_SESSION["items_per_page"];} else {$items_per_page="10";}//Default Num per Page is 10
|
||||
|
||||
if ($_GET["category"]) { $_SESSION["category"] = $_GET["category"]; }
|
||||
if ($_SESSION["category"]) {$category = $_SESSION["category"];}
|
||||
if ($category=="All") {$category="";}
|
||||
|
||||
|
||||
if (!$_GET["pageid"]) {$pageid="1"; } else { $pageid = $_GET["pageid"]; } //Default PageID is 1
|
||||
$type="E"; //Default Type is E
|
||||
|
||||
unset($typename);
|
||||
$types = array("E"=>"Extensions","T"=>"Themes","U"=>"Updates");
|
||||
$typename = $types["$type"];
|
||||
|
||||
//RSS Autodiscovery Link Stuff
|
||||
switch ($_SESSION["category"]) {
|
||||
case "Newest":
|
||||
$rsslist = "newest";
|
||||
break;
|
||||
case "Popular":
|
||||
$rsslist = "popular";
|
||||
break;
|
||||
case "Top Rated":
|
||||
$rsslist = "rated";
|
||||
break;
|
||||
}
|
||||
|
||||
$rssfeed = "rss/?application=" . $application . "&type=" . $type . "&list=" . $rsslist;
|
||||
|
||||
if (!$category) {$categoryname = "All $typename"; } else {$categoryname = $category; }
|
||||
?>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
|
||||
<TITLE>Mozilla Update :: Extensions - List - <?php echo"$categoryname"; if ($pageid) {echo" - Page $pageid"; } ?></TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
<?php
|
||||
if ($rsslist) {
|
||||
echo"<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"http://$_SERVER[HTTP_HOST]/$rssfeed\">";
|
||||
}
|
||||
?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
include"$page_header";
|
||||
|
||||
// -----------------------------------------------
|
||||
// Begin Content of the Page Here
|
||||
// -----------------------------------------------
|
||||
|
||||
include"inc_sidebar.php";
|
||||
|
||||
echo"<DIV id=\"content\">\n"; // Begin Content Area
|
||||
//Query for List Creation
|
||||
$s = "0";
|
||||
$startpoint = ($pageid-1)*$items_per_page;
|
||||
if ($category=="Editors Pick" or $category=="Newest" or $category=="Popular" or $category=="Top Rated") {
|
||||
if ($category =="Editors Pick") {
|
||||
$editorpick="true";
|
||||
} else if ($category =="Newest") {
|
||||
$orderby = "TV.DateAdded DESC, `Name` ASC";
|
||||
} else if ($category =="Popular") {
|
||||
$orderby = "TM.TotalDownloads DESC, `Name` ASC";
|
||||
} else if ($category =="Top Rated") {
|
||||
$orderby = "TM.Rating DESC, `Name` ASC";
|
||||
}
|
||||
$catname = $category;
|
||||
$category = "%";
|
||||
}
|
||||
if ($app_version=="0.10") {$app_version="0.95"; }
|
||||
$sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Description, TM.Rating, TM.TotalDownloads, TV.vID,
|
||||
SUBSTRING(MAX(CONCAT(LPAD(TV.Version, 6, '0'), TV.vID)), 7) AS MAXvID,
|
||||
MAX(TV.Version) AS Version,
|
||||
TA.AppName, TOS.OSName
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID ";
|
||||
if ($category && $category !=="%") { $sql .="INNER JOIN t_categoryxref TCX ON TM.ID = TCX.ID
|
||||
INNER JOIN t_categories TC ON TCX.CategoryID = TC.CategoryID "; }
|
||||
if ($editorpick=="true") { $sql .="INNER JOIN t_reviews TR ON TM.ID = TR.ID "; }
|
||||
$sql .="WHERE Type = '$type' AND AppName = '$application' AND `approved` = 'YES' ";
|
||||
if ($editorpick=="true") { $sql .="AND TR.Pick = 'YES' "; }
|
||||
if ($category && $category !=="%") {$sql .="AND CatName LIKE '$category' ";}
|
||||
if ($app_version) { $sql .=" AND TV.MinAppVer_int <= '".strtolower($app_version)."' AND TV.MaxAppVer_int >= '".strtolower($app_version)."' ";}
|
||||
if ($OS) { $sql .=" AND (TOS.OSName = '$OS' OR TOS.OSName = 'All') "; }
|
||||
$sql .="GROUP BY `Name` ";
|
||||
if ($orderby) {
|
||||
$sql .="ORDER BY $orderby";
|
||||
} else {
|
||||
$sql .="ORDER BY `Name` , `Version` DESC ";
|
||||
}
|
||||
|
||||
$resultsquery = $sql;
|
||||
unset($sql);
|
||||
|
||||
//Get Total Results from Result Query & Populate Page Control Vars.
|
||||
$sql_result = mysql_query($resultsquery, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$totalresults = mysql_num_rows($sql_result);
|
||||
|
||||
$num_pages = ceil($totalresults/$items_per_page); //Total # of Pages
|
||||
if ($pageid>$num_pages) {$pageid=$num_pages;} //Check PageId for Validity
|
||||
$startpoint = ($pageid-1)*$items_per_page;
|
||||
if ($startpoint<0) {$startpoint=0; $startitem=0;}
|
||||
$startitem = $startpoint+1;
|
||||
$enditem = $startpoint+$items_per_page;
|
||||
if ($totalresults=="0") {$startitem = "0"; }
|
||||
if ($enditem>$totalresults) {$enditem=$totalresults;} //Verify EndItem
|
||||
|
||||
|
||||
if ($_GET[nextnum]) {$startpoint = $_GET["nextnum"]; }
|
||||
//$resultsquery = str_replace("GROUP BY `Name` ", "", $resultsquery);
|
||||
$resultsquery .= " LIMIT $startpoint , $items_per_page"; //Append LIMIT clause to result query
|
||||
|
||||
if ($category=="%") {$category = $catname; unset($catname); }
|
||||
|
||||
//Now Showing Box
|
||||
echo"<DIV id=\"listnav\">";
|
||||
if (!$OS) {$OS="all";}
|
||||
if (!$category) {$categoryname="All"; } else {$categoryname = $category;}
|
||||
echo"<DIV class=\"pagenum\" "; if ($application!="mozilla") {echo" style=\"margin-right: 58%;\""; } echo">";
|
||||
$previd=$pageid-1;
|
||||
if ($previd >"0") {
|
||||
echo"<a href=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$previd\">« Previous</A> • ";
|
||||
}
|
||||
echo"Page $pageid of $num_pages";
|
||||
|
||||
$nextid=$pageid+1;
|
||||
if ($pageid <$num_pages) {
|
||||
echo" • <a href=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$nextid\">Next »</a>";
|
||||
}
|
||||
|
||||
echo"</DIV>\n";
|
||||
|
||||
echo"<SPAN class=\"listtitle\">".ucwords("$application $typename » $categoryname ")."</SPAN><br>";
|
||||
echo"".ucwords("$typename")." $startitem - $enditem of $totalresults";
|
||||
|
||||
|
||||
// Modify List Form
|
||||
|
||||
echo"<DIV class=\"listform\">";
|
||||
echo"<FORM NAME=\"listviews\" METHOD=\"GET\" ACTION=\"showlist.php\">\n";
|
||||
echo"<INPUT NAME=\"application\" TYPE=\"hidden\" VALUE=\"$application\">\n";
|
||||
//Items-Per-Page
|
||||
echo"Show/Page: ";
|
||||
$perpage = array("5","10","20","50");
|
||||
echo"<SELECT name=\"numpg\">";
|
||||
foreach ($perpage as $value) {
|
||||
echo"<OPTION value=\"$value\"";
|
||||
if ($items_per_page==$value) {echo" SELECTED"; }
|
||||
echo">$value</OPTION>";
|
||||
}
|
||||
echo"</SELECT>\n";
|
||||
|
||||
|
||||
// Operating Systems
|
||||
echo" OS: ";
|
||||
echo"<SELECT name=\"os\">\n";
|
||||
$sql = "SELECT `OSName` FROM `t_os` ORDER BY `OSName`";
|
||||
$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)) {
|
||||
$osname = $row["OSName"];
|
||||
echo"<OPTION value=\"".strtolower($osname)."\"";
|
||||
if (strtolower($OS) == strtolower($osname)) {echo" SELECTED";}
|
||||
echo">$osname</OPTION>";
|
||||
}
|
||||
echo"</SELECT>\n";
|
||||
|
||||
|
||||
//Versions of Application
|
||||
echo"Versions: ";
|
||||
echo"<SELECT name=\"version\">";
|
||||
if ($application != "thunderbird") {echo"<OPTION value=\"auto-detect\">Auto-Detect</OPTION>";}
|
||||
$app_orig = $application; //Store original to protect against possible corruption
|
||||
$sql = "SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` WHERE `AppName` = '$application' ORDER BY `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC";
|
||||
$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)) {
|
||||
$version = $row["Version"];
|
||||
$subver = $row["SubVer"];
|
||||
$release = "$row[major].$row[minor]";
|
||||
if ($row["release"]) {$release = ".$release$row[release]";}
|
||||
if ($app_version=="0.95") {$app_version="0.10"; }
|
||||
//Firesomething Support
|
||||
if ($application=="firefox") { if ($release == "0.7") {$application="firebird";} else {$application="firefox";} }
|
||||
|
||||
if ($subver !=="final") {$release="$release$subver";}
|
||||
echo"<OPTION value=\"$release\"";
|
||||
if ($app_version == $release) {echo" SELECTED"; }
|
||||
echo">".ucwords($application)." $version</OPTION>";
|
||||
|
||||
if ($app_version=="0.10") {$app_version="0.95"; }
|
||||
}
|
||||
$application = $app_orig; unset($app_orig);
|
||||
|
||||
|
||||
echo"</SELECT>\n";
|
||||
echo"<INPUT NAME=\"submit\" TYPE=\"SUBMIT\" VALUE=\"Update\">";
|
||||
echo"</FORM>";
|
||||
echo"</DIV>";
|
||||
|
||||
echo"</DIV>\n";
|
||||
|
||||
|
||||
//---------------------------------
|
||||
// Begin List
|
||||
//---------------------------------
|
||||
//Get Author Data and Create $authorarray and $authorids
|
||||
$sql = "SELECT TM.Name, TU.UserName, TU.UserID, TU.UserEmail FROM `t_main` TM
|
||||
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
|
||||
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
|
||||
ORDER BY `Type` , `Name` ASC "; // TM.Type = 'E'
|
||||
$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)) {
|
||||
$authorarray[$row[Name]][] = $row["UserName"];
|
||||
$authorids[$row[UserName]] = $row["UserID"];
|
||||
}
|
||||
|
||||
//Assemble a display application version array
|
||||
$sql = "SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` WHERE `AppName`='$application' ORDER BY `major`,`minor`";
|
||||
$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)) {
|
||||
$version = $row["Version"];
|
||||
$subver = $row["SubVer"];
|
||||
$release = "$row[major].$row[minor]";
|
||||
if ($row["release"]) {$release = ".$release$row[release]";}
|
||||
if ($subver !=="final") {$release="$release$subver";}
|
||||
|
||||
$appvernames[$release] = $version;
|
||||
}
|
||||
|
||||
//Query to Generate List..
|
||||
$sql = "$resultsquery";
|
||||
$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"];
|
||||
$name = $row["Name"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$dateupdated = $row["DateUpdated"];
|
||||
$homepage = $row["Homepage"];
|
||||
$description = $row["Description"];
|
||||
$rating = $row["Rating"];
|
||||
$authors = $authorarray[$name];
|
||||
$osname = $row["OSName"];
|
||||
$appname = $row["AppName"];
|
||||
$downloadcount = $row["TotalDownloads"];
|
||||
|
||||
//Get Version Record for Referenced MAXvID from list query
|
||||
$sql2 = "SELECT TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.DateAdded AS VerDateAdded, TV.DateUpdated AS VerDateUpdated, TV.URI, TV.Notes, TP.PreviewURI FROM `t_version` TV
|
||||
LEFT JOIN t_previews TP ON TV.vID = TP.vID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID
|
||||
WHERE TV.ID = '$id' AND TV.Version = '$row[Version]' AND TA.AppName = '$appname' AND TOS.OSName = '$osname' LIMIT 1";
|
||||
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$vid = $row[MAXvID];
|
||||
$row = mysql_fetch_array($sql_result2);
|
||||
|
||||
$vid = $row["vID"];
|
||||
if ($appvernames[$row["MinAppVer"]]) {$minappver = $appvernames[$row["MinAppVer"]]; } else { $minappver = $row["MinAppVer"]; }
|
||||
if ($appvernames[$row["MaxAppVer"]]) {$maxappver = $appvernames[$row["MaxAppVer"]]; } else { $maxappver = $row["MaxAppVer"]; }
|
||||
$VerDateAdded = $row["VerDateAdded"];
|
||||
$VerDateUpdated = $row["VerDateUpdated"];
|
||||
$filesize = $row["Size"];
|
||||
$notes = $row["Notes"];
|
||||
$version = $row["Version"];
|
||||
$uri = $row["URI"];
|
||||
$previewuri = $row["PreviewURI"];
|
||||
|
||||
$filename = basename($uri);
|
||||
|
||||
if ($VerDateAdded > $dateadded) {$dateadded = $VerDateAdded; }
|
||||
if ($VerDateUpdated > $dateupdated) {$dateupdated = $VerDateUpdated; }
|
||||
|
||||
//Turn Authors Array into readable string...
|
||||
$authorcount = count($authors);
|
||||
foreach ($authors as $author) {
|
||||
$userid = $authorids[$author];
|
||||
$n++;
|
||||
$authorstring .= "<A HREF=\"authorprofiles.php?application=$application&id=$userid\">$author</A>";
|
||||
if ($authorcount != $n) {$authorstring .=", "; }
|
||||
|
||||
}
|
||||
$authors = $authorstring;
|
||||
unset($authorstring, $n); // Clear used Vars..
|
||||
|
||||
//Create Customizeable Timestamp
|
||||
$day=substr($dateupdated,8,2); //get the day
|
||||
$month=substr($dateupdated,5,2); //get the month
|
||||
$year=substr($dateupdated,0,4); //get the year
|
||||
$hour=substr($dateupdated,11,2); //get the hour
|
||||
$minute=substr($dateupdated,14,2); //get the minute
|
||||
$second=substr($dateupdated,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$dateupdated = gmdate("F d, Y g:i:sa", $timestamp); //gmdate("F d, Y g:i:sa T", $timestamp);
|
||||
|
||||
|
||||
echo"<DIV class=\"item\">\n";
|
||||
//echo"<DIV style=\"height: 100px\">"; //Not sure why this is here, it caused text to flood out of the box though.
|
||||
|
||||
if ($previewuri) {
|
||||
list($width, $height, $type, $attr) = getimagesize("$websitepath"."$previewuri");
|
||||
|
||||
echo"<IMG SRC=\"$previewuri\" BORDER=0 HEIGHT=$height WIDTH=$width STYLE=\"float: right; padding-right: 5px\" ALT=\"$name preview\">";
|
||||
}
|
||||
|
||||
|
||||
//Upper-Right Side Box
|
||||
echo"<DIV class=\"liststars\" title=\"$rating of 5 stars\" style=\"font-size: 8pt\"><A HREF=\"moreinfo.php?application=$application&id=$id&page=comments\">";
|
||||
for ($i = 1; $i <= floor($rating); $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
if ($rating>floor($rating)) {
|
||||
$val = ($rating-floor($rating))*10;
|
||||
echo"<IMG SRC=\"/images/stars/star_0$val.png\" BORDER=0 ALT=\"\">";
|
||||
$i++;
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
echo"</A></DIV>\n";
|
||||
|
||||
|
||||
echo"<DIV class=\"itemtitle\">";
|
||||
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid\">$name $version</A></SPAN><BR>";
|
||||
echo"<SPAN class=\"authorline\">By $authors</SPAN><br>";
|
||||
echo"</DIV>";
|
||||
|
||||
//Description & Version Notes
|
||||
echo"<SPAN class=\"itemdescription\">";
|
||||
echo"$description<BR>";
|
||||
if ($notes) {echo"$notes"; }
|
||||
echo"</SPAN>\n";
|
||||
echo"<BR>";
|
||||
//echo"</DIV>";
|
||||
|
||||
//Icon Bar Modules
|
||||
echo"<DIV style=\"height: 34px\">";
|
||||
echo"<DIV class=\"iconbar\" style=\"width: 104px;\">";
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
|
||||
} else {
|
||||
//echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name\" ALT=\"\">Install</A>";
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.install({'$name $version':'$uri'}))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name\" ALT=\"\">Install</A>";
|
||||
}
|
||||
echo"<BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
if ($homepage) {echo"<DIV class=\"iconbar\" style=\"width: 98px;\"><A HREF=\"$homepage\"><IMG SRC=\"/images/home.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"$name Homepage\" ALT=\"\">Homepage</A></DIV>";}
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"$appname\"> Works with:<BR> $minappver - $maxappver</DIV>";
|
||||
if($osname !=="ALL") { echo"<DIV class=\"iconbar\" style=\"width: 85px;\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"\">OS:<BR>$osname</DIV>"; }
|
||||
echo"</DIV>";
|
||||
|
||||
echo"<DIV class=\"baseline\">Updated: $dateupdated | Total Downloads: $downloadcount<BR></DIV>\n";
|
||||
echo"</DIV>\n";
|
||||
|
||||
} //End While Loop
|
||||
if ($totalresults=="0") {
|
||||
echo"<DIV class=\"item noitems\">\n";
|
||||
echo"No extensions found in this category for ".ucwords($application).".\n";
|
||||
echo"</DIV>\n";
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
// Begin PHP Code for Dynamic Navbars
|
||||
if ($pageid <=$num_pages) {
|
||||
echo"<DIV id=\"listnav\">";
|
||||
|
||||
|
||||
echo"<DIV class=\"pagenum\">";
|
||||
$previd=$pageid-1;
|
||||
if ($previd >"0") {
|
||||
echo"<a href=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$previd\">« Previous</A> • ";
|
||||
}
|
||||
echo"Page $pageid of $num_pages";
|
||||
|
||||
|
||||
$nextid=$pageid+1;
|
||||
if ($pageid <$num_pages) {
|
||||
echo" • <a href=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$nextid\">Next »</a>";
|
||||
}
|
||||
echo"<BR>\n";
|
||||
|
||||
|
||||
//Skip to Page...
|
||||
if ($num_pages>1) {
|
||||
echo"Jump to: ";
|
||||
$pagesperpage=9; //Plus 1 by default..
|
||||
$i = 01;
|
||||
//Dynamic Starting Point
|
||||
if ($pageid>11) {
|
||||
$nextpage=$pageid-10;
|
||||
}
|
||||
$i=$nextpage;
|
||||
|
||||
//Dynamic Ending Point
|
||||
$maxpagesonpage=$pageid+$pagesperpage;
|
||||
//Page #s
|
||||
while ($i <= $maxpagesonpage && $i <= $num_pages) {
|
||||
|
||||
if ($i==$pageid) {
|
||||
echo"<SPAN style=\"color: #FF0000\">$i</SPAN> ";
|
||||
} else {
|
||||
echo"<A HREF=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$i\">$i</A> ";
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
echo"</DIV>\n";
|
||||
|
||||
echo"<SPAN class=\"listtitle\">".ucwords("$application $typename » $categoryname ")."</SPAN><br>";
|
||||
echo"".ucwords("$typename")." $startitem - $enditem of $totalresults";
|
||||
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
|
||||
echo"</DIV>\n"; //End Content
|
||||
?>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
75
mozilla/webtools/update/faq/index.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<TITLE>Mozilla Update :: Frequently Asked Questions</TITLE>
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
include"$page_header";
|
||||
?>
|
||||
<DIV class="faqtitle">Frequently Asked Questions</DIV>
|
||||
|
||||
<?php
|
||||
$sql = "SELECT `title`, `text` FROM `t_faq` WHERE `active` = 'YES' ORDER BY `index` ASC, `title` ASC";
|
||||
$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)) {
|
||||
$title = $row["title"];
|
||||
$text = nl2br($row["text"]);
|
||||
|
||||
echo"<DIV class=\"item\">\n";
|
||||
echo"<DIV class=\"boxheader faqitemtitle\">$title</DIV>\n";
|
||||
echo"<DIV class=\"faqitemtext\">$text</DIV>\n";
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
BIN
mozilla/webtools/update/images/all_icon.png
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
mozilla/webtools/update/images/bsd_icon.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
mozilla/webtools/update/images/download.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
mozilla/webtools/update/images/firefox-cornerlogo.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
mozilla/webtools/update/images/firefox_icon.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
mozilla/webtools/update/images/header.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
mozilla/webtools/update/images/home.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
mozilla/webtools/update/images/linux_icon.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mozilla/webtools/update/images/macosx_icon.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
mozilla/webtools/update/images/mozilla-cornerlogo.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
mozilla/webtools/update/images/mozilla_icon.png
Normal file
|
After Width: | Height: | Size: 913 B |
BIN
mozilla/webtools/update/images/orangebar.png
Normal file
|
After Width: | Height: | Size: 242 B |
BIN
mozilla/webtools/update/images/product-front-firefox.png
Executable file
|
After Width: | Height: | Size: 19 KiB |
BIN
mozilla/webtools/update/images/product-front-thunderbird.png
Executable file
|
After Width: | Height: | Size: 16 KiB |
BIN
mozilla/webtools/update/images/solaris_icon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
mozilla/webtools/update/images/stars/graystar_icon.png
Normal file
|
After Width: | Height: | Size: 484 B |
BIN
mozilla/webtools/update/images/stars/halfstar_icon.png
Normal file
|
After Width: | Height: | Size: 820 B |
BIN
mozilla/webtools/update/images/stars/star_01.png
Normal file
|
After Width: | Height: | Size: 616 B |
BIN
mozilla/webtools/update/images/stars/star_02.png
Normal file
|
After Width: | Height: | Size: 628 B |
BIN
mozilla/webtools/update/images/stars/star_03.png
Normal file
|
After Width: | Height: | Size: 654 B |
BIN
mozilla/webtools/update/images/stars/star_04.png
Normal file
|
After Width: | Height: | Size: 666 B |
BIN
mozilla/webtools/update/images/stars/star_05.png
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
mozilla/webtools/update/images/stars/star_06.png
Normal file
|
After Width: | Height: | Size: 702 B |
BIN
mozilla/webtools/update/images/stars/star_07.png
Normal file
|
After Width: | Height: | Size: 706 B |
BIN
mozilla/webtools/update/images/stars/star_08.png
Normal file
|
After Width: | Height: | Size: 712 B |
BIN
mozilla/webtools/update/images/stars/star_09.png
Normal file
|
After Width: | Height: | Size: 726 B |
BIN
mozilla/webtools/update/images/stars/star_icon.png
Normal file
|
After Width: | Height: | Size: 837 B |
BIN
mozilla/webtools/update/images/tab-firefox-selected.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
mozilla/webtools/update/images/tab-firefox.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
mozilla/webtools/update/images/tab-login-selected.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
mozilla/webtools/update/images/tab-login.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
mozilla/webtools/update/images/tab-mozilla-selected.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
mozilla/webtools/update/images/tab-mozilla.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
mozilla/webtools/update/images/tab-thunderbird-selected.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
mozilla/webtools/update/images/tab-thunderbird.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
mozilla/webtools/update/images/thunderbird-cornerlogo.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
mozilla/webtools/update/images/thunderbird_icon.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
mozilla/webtools/update/images/updatelogo.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
mozilla/webtools/update/images/windows_icon.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
76
mozilla/webtools/update/inc_featuredupdate.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?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 *****
|
||||
?>
|
||||
|
||||
<DIV class="contentbox" style="margin-left: 2px; border-color: #00E;">
|
||||
<DIV class="boxheader">Thunderbird 1.0 Released!</DIV>
|
||||
<SPAN class="itemdescription">
|
||||
<P><IMG SRC="images/product-front-thunderbird.png" width="96" height="105" alt="" align=left border=0>Thunderbird 1.0 is now available for download! New features include Saved Search Folders (aka Virtual Folders)
|
||||
which allow you to display messages based on previously set search criteria across multiple folders. Message Grouping
|
||||
allows you to organize e-mail in a folder by grouping them based on various attributes like Date, Sender, Label, etc.
|
||||
Thunderbird 1.0 also includes numerous bug fixes and other improvements.</P>
|
||||
|
||||
<SPAN style="font-size: 16pt; text-align: center;">
|
||||
<a href="http://www.mozilla.org/products/thunderbird/">Get Thunderbird 1.0!</a></SPAN><BR>
|
||||
|
||||
<a href="http://www.mozilla.org/products/thunderbird/releases/">Thunderbird Release Notes</a> | <a href="http://www.mozilla.org/press/mozilla-2004-12-7.html">Press Release</a><BR>
|
||||
|
||||
|
||||
</SPAN>
|
||||
</DIV>
|
||||
|
||||
<DIV class="contentbox" style="margin-left: 2px; border-color: #E00;">
|
||||
<DIV class="boxheader">Firefox 1.0 Released!</DIV>
|
||||
<SPAN class="itemdescription">
|
||||
<P><IMG SRC="images/product-front-firefox.png" width="112" height="112" alt="" align=left border=0>
|
||||
The wait is over. Get Firefox 1.0, the most standards compliant, flexible, and user-centric web-browsing platform on Earth.
|
||||
Firefox 1.0 is the culmination of almost 7 years of work by thousands of independent hackers and companies through Mozilla.org,
|
||||
and over two years of intense focus on a streamlined browser made for the masses hungry for a better web experience.
|
||||
Firefox 1.0 Features include Tabbed Browsing, Smarter Search and FastFind, Hassle-Free Downloading, Live Bookmarks,
|
||||
Extension and Theme Support, and more.
|
||||
|
||||
</P>
|
||||
|
||||
<SPAN style="font-size: 16pt; text-align: center;">
|
||||
<a href="http://www.mozilla.org/products/firefox/">Get Firefox 1.0!</a></SPAN><BR>
|
||||
|
||||
<a href="http://www.mozilla.org/products/firefox/releases/1.0.html">Firefox Release Notes</a> | <a href="http://www.mozilla.org/press/mozilla-2004-11-09.html">Press Release</a><BR>
|
||||
|
||||
|
||||
</SPAN>
|
||||
</DIV>
|
||||
192
mozilla/webtools/update/index.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
|
||||
<TITLE>Mozilla Update</TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
include"$page_header";
|
||||
?>
|
||||
|
||||
<DIV class="contentbox" style="margin-left: 2px;">
|
||||
<DIV class="boxheader">Welcome to Mozilla Update</DIV>
|
||||
<SPAN class="itemdescription">
|
||||
Mozilla Update hosts Extensions and Themes for Mozilla software. On this site you can find Extensions and Themes for Mozilla Firefox,
|
||||
Mozilla Thunderbird and the Mozilla 1.x suite, with more to come. The site is broken up into sections for each product, with the
|
||||
extensions and themes categorized to be easy to find. They're also sorted by what version of the product you're using, so you can
|
||||
browse only for Firefox 0.9 compatible extensions, for example. For more information about Mozilla Update, please read our <A HREF="/faq/">Frequently Asked Questions...</A>
|
||||
|
||||
</SPAN>
|
||||
</DIV>
|
||||
<?php include"inc_featuredupdate.php"; ?>
|
||||
|
||||
<?php
|
||||
//include"inc_softwareupdate.php";
|
||||
if ($_GET["application"]) {$application=$_GET["application"]; }
|
||||
?>
|
||||
<?php
|
||||
//Temporary!! Current Version Array Code
|
||||
$currentver_array = array("firefox"=>"1.0", "thunderbird"=>"1.0", "mozilla"=>"1.7");
|
||||
$currentver_display_array = array("firefox"=>"1.0", "thunderbird"=>"1.0", "mozilla"=>"1.7.x");
|
||||
$currentver = $currentver_array[$application];
|
||||
$currentver_display = $currentver_display_array[$application];
|
||||
?>
|
||||
|
||||
|
||||
<DIV class="frontpagecontainer">
|
||||
<DIV class="contentbox contentcolumns">
|
||||
<DIV class="boxheader"><?php print(ucwords($application)); echo" $currentver_display"; ?> Extensions</DIV>
|
||||
|
||||
<?php
|
||||
$sql = "SELECT TM.ID
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
WHERE `Type` = 'E' AND `AppName` = '$application' AND `minAppVer_int`<='$currentver' AND `maxAppVer_int` >='$currentver' AND `approved` = 'YES' GROUP BY TM.ID";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$numextensions = mysql_num_rows($sql_result);
|
||||
?>
|
||||
<a href="/extensions/?application=<?php echo"$application"; ?>">Browse extensions</a> (<?php echo"$numextensions"; ?> available)<BR>
|
||||
<BR>
|
||||
<?php
|
||||
$sql = "SELECT TR.ID, `Title`, TR.DateAdded, `Body`, `Type`, `pick` FROM `t_reviews` TR
|
||||
INNER JOIN t_main TM ON TR.ID = TM.ID
|
||||
INNER JOIN t_version TV ON TV.ID = TM.ID
|
||||
INNER JOIN t_applications TA ON TA.AppID = TV.AppID
|
||||
WHERE `Type` = 'E' AND `AppName` = '$application' AND `pick`='YES' ORDER BY `rID` DESC 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"];
|
||||
$title = $row["Title"];
|
||||
$pick = $row["pick"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$body = $row["Body"];
|
||||
$bodylength = strlen($body);
|
||||
if ($bodylength>"250") {
|
||||
$body = substr($body,0,250);
|
||||
$body .= " <a href=\"/extensions/moreinfo.php?id=$id&application=$application&page=staffreview\">[More...]</a>";
|
||||
|
||||
}
|
||||
|
||||
//Create Customizeable Timestamp
|
||||
$day=substr($dateadded,8,2); //get the day
|
||||
$month=substr($dateadded,5,2); //get the month
|
||||
$year=substr($dateadded,0,4); //get the year
|
||||
$hour=substr($dateadded,11,2); //get the hour
|
||||
$minute=substr($dateadded,14,2); //get the minute
|
||||
$second=substr($dateadded,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$date = gmdate("F, Y", $timestamp);
|
||||
|
||||
|
||||
echo"$title<br> $date";
|
||||
if ($pick=="YES") {echo" Editors Pick";}
|
||||
echo"<BR><BR>\n";
|
||||
echo"<SPAN class=\"itemdescription\">$body</SPAN><BR>\n";
|
||||
}
|
||||
?>
|
||||
<BR>
|
||||
</DIV>
|
||||
|
||||
<DIV class="contentbox contentcolumns">
|
||||
<DIV class="boxheader"><?php print(ucwords($application)); echo" $currentver_display"; ?> Themes</DIV>
|
||||
<?php
|
||||
$sql = "SELECT TM.ID FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
WHERE `Type` = 'T' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND `approved` = 'YES' GROUP BY TM.ID";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$numthemes = mysql_num_rows($sql_result);
|
||||
?>
|
||||
<a href="/themes/?application=<?php echo"$application"; ?>">Browse themes</a> (<?php echo"$numthemes"; ?> available)<BR>
|
||||
<BR>
|
||||
<?php
|
||||
$sql = "SELECT TR.ID, `Title`, TR.DateAdded, `Body`, `Type`, `pick` FROM `t_reviews` TR
|
||||
INNER JOIN t_main TM ON TR.ID = TM.ID
|
||||
INNER JOIN t_version TV ON TV.ID = TM.ID
|
||||
INNER JOIN t_applications TA ON TA.AppID = TV.AppID
|
||||
WHERE `Type` = 'T' AND `AppName` = '$application' AND `pick`='YES' ORDER BY `rID` DESC 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"];
|
||||
$title = $row["Title"];
|
||||
$pick = $row["pick"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$body = $row["Body"];
|
||||
$bodylength = strlen($body);
|
||||
if ($bodylength>"250") {
|
||||
$body = substr($body,0,250);
|
||||
$body .= " <a href=\"/moreinfo.php?id=$id&application=$application&page=staffreview\">[More...]</a>";
|
||||
|
||||
}
|
||||
|
||||
//Create Customizeable Timestamp
|
||||
$day=substr($dateadded,8,2); //get the day
|
||||
$month=substr($dateadded,5,2); //get the month
|
||||
$year=substr($dateadded,0,4); //get the year
|
||||
$hour=substr($dateadded,11,2); //get the hour
|
||||
$minute=substr($dateadded,14,2); //get the minute
|
||||
$second=substr($dateadded,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$date = gmdate("F, Y", $timestamp);
|
||||
|
||||
echo"$title - $date";
|
||||
if ($pick=="YES") {echo" Editors Pick<BR><BR>\n";}
|
||||
echo"<BR><BR>\n";
|
||||
echo"$body<BR>\n";
|
||||
}
|
||||
?>
|
||||
<BR>
|
||||
</DIV>
|
||||
</DIV>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
95
mozilla/webtools/update/rss/inc_rssfeed.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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>
|
||||
// Alan Starr <alanjstarr@yahoo.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
|
||||
// http://blogs.law.harvard.edu/tech/rss
|
||||
|
||||
switch ($type) {
|
||||
case "E":
|
||||
$listType = "Extensions";
|
||||
break;
|
||||
case "P":
|
||||
$listType = "Plugins";
|
||||
break;
|
||||
case "T":
|
||||
$listType = "Themes";
|
||||
break;
|
||||
}
|
||||
|
||||
echo "<rss version=\"2.0\">\n";
|
||||
echo "<channel>\n";
|
||||
|
||||
echo " <title>" . htmlentities($sitetitle) . "::" . htmlentities($list) . " " . $listType . "</title>\n";
|
||||
echo " <link>" . htmlentities($siteurl) . "</link>\n";
|
||||
echo " <description>" . htmlentities($description) . "</description>\n";
|
||||
echo " <language>" . htmlentities($sitelanguage) . "</language>\n";
|
||||
echo " <copyright>" . htmlentities($sitecopyright) . "</copyright>\n";
|
||||
echo " <lastBuildDate>" . $currenttime . "</lastBuildDate>\n";
|
||||
echo " <ttl>" . $rssttl . "</ttl>\n";
|
||||
echo " <image>\n";
|
||||
echo " <title>" . htmlentities($sitetitle) . "</title>\n";
|
||||
echo " <link>" . htmlentities($siteurl) . "</link>\n";
|
||||
echo " <url>" . htmlentities($siteicon) . "</url>\n";
|
||||
echo " <width>16</width>\n";
|
||||
echo " <height>16</height>\n";
|
||||
echo " </image>\n";
|
||||
|
||||
$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"];
|
||||
$title = htmlentities($row["Title"]);
|
||||
$description = htmlentities($row["Description"]);
|
||||
$dateupdated = gmdate("r", strtotime($row["DateStamp"]));
|
||||
$version = $row["Version"];
|
||||
$vid = $row["vID"];
|
||||
$appname = $row["AppName"];
|
||||
|
||||
echo " <item>\n";
|
||||
echo " <pubDate>" . $dateupdated . "</pubDate>\n";
|
||||
echo " <title>" . $title . " " . $version . " for " . $appname . "</title>\n";
|
||||
echo " <link>http://$sitehostname/" . strtolower($listType) . "/moreinfo.php?id=" . $id . "&vid=" . $vid . "</link>\n";
|
||||
echo " <description>" . $description . "</description>\n";
|
||||
echo " </item>\n";
|
||||
|
||||
}
|
||||
|
||||
echo "</channel>\n";
|
||||
echo "</rss>\n";
|
||||
|
||||
?>
|
||||
107
mozilla/webtools/update/rss/index.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?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>
|
||||
// Alan Starr <alanjstarr@yahoo.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";
|
||||
|
||||
$app = strtolower($_GET["application"]); // Firefox, Thunderbird, Mozilla
|
||||
$type = $_GET["type"]; //E, T, [P]
|
||||
$list = ucwords(strtolower($_GET["list"])); // Newest, Updated, [Editors], Popular
|
||||
|
||||
$sitetitle = "Mozilla Update";
|
||||
$siteicon = "http://www.mozilla.org/images/mozilla-16.png";
|
||||
$siteurl = "http://update.mozilla.org";
|
||||
$sitedescription = "the way to keep your mozilla software up-to-date";
|
||||
$sitelanguage = "en-us";
|
||||
$sitecopyright = "Creative Commons?";
|
||||
$currenttime = gmdate(r);// GMT
|
||||
$rssttl = "120"; //Life of feed in minutes
|
||||
|
||||
//header("Content-Type: application/octet-stream");
|
||||
header("Content-Type: text/xml");
|
||||
|
||||
// Firefox, extensions, by date added
|
||||
|
||||
$select = "SELECT DISTINCT
|
||||
t_main.ID,
|
||||
t_main.Name AS Title,
|
||||
t_main.Description,
|
||||
t_version.Version,
|
||||
t_version.vID,
|
||||
t_version.DateUpdated AS DateStamp,
|
||||
t_applications.AppName";
|
||||
|
||||
$from = "FROM t_main
|
||||
INNER JOIN t_version ON t_main.ID = t_version.ID
|
||||
INNER JOIN t_applications ON t_version.AppID = t_applications.AppID";
|
||||
|
||||
$where = "`approved` = 'YES'"; // Always have a WHERE
|
||||
|
||||
if ($app == 'firefox' || $app == 'thunderbird' || $app == 'mozilla') {
|
||||
$where .= " AND t_applications.AppName = '$app'";
|
||||
}
|
||||
|
||||
if ($type == 'E' || $type == 'T' || $type == 'P') {
|
||||
$where .= " AND t_main.Type = '$type'";
|
||||
}
|
||||
|
||||
switch ($list) {
|
||||
case "Popular":
|
||||
$orderby = "t_main.DownloadCount DESC";
|
||||
break;
|
||||
case "Updated":
|
||||
$orderby = "t_main.DateUpdated DESC";
|
||||
break;
|
||||
case "Rated":
|
||||
$orderby = "t_main.Rating DESC";
|
||||
break;
|
||||
case "Newest":
|
||||
default:
|
||||
$orderby = "t_main.DateAdded DESC";
|
||||
break;
|
||||
}
|
||||
|
||||
$sql = $select . " " . $from . " WHERE " . $where . " ORDER BY " . $orderby . " LIMIT 0, 10";
|
||||
|
||||
//echo $sql;
|
||||
|
||||
include"inc_rssfeed.php";
|
||||
|
||||
|
||||
?>
|
||||
195
mozilla/webtools/update/themes/authorprofiles.php
Normal file
@@ -0,0 +1,195 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
|
||||
<?php
|
||||
//Bookmarking-Friendly Page Title
|
||||
$sql = "SELECT UserName FROM `t_userprofiles` WHERE UserID = '$_GET[id]' LIMIT 1";
|
||||
$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) {
|
||||
$return = page_error("2","Author ID is Invalid or Missing.");
|
||||
exit;
|
||||
|
||||
}
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
?>
|
||||
|
||||
<TITLE>Mozilla Update :: Themes - Author Profile: <?php echo"$row[UserName]"; ?></TITLE>
|
||||
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
include"$page_header";
|
||||
|
||||
$type = "T";
|
||||
$category = $_GET["category"];
|
||||
include"inc_sidebar.php";
|
||||
?>
|
||||
<DIV id="content">
|
||||
<?php
|
||||
$userid = $_GET["id"];
|
||||
$sql = "SELECT * FROM `t_userprofiles` WHERE `UserID` = '$userid' 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);
|
||||
$userid = $row["UserID"];
|
||||
$username = $row["UserName"];
|
||||
$useremail = $row["UserEmail"];
|
||||
$userwebsite = $row["UserWebsite"];
|
||||
$userpass = $row["UserPass"];
|
||||
$userrole = $row["UserRole"];
|
||||
$useremailhide = $row["UserEmailHide"];
|
||||
?>
|
||||
<DIV class="item">
|
||||
<SPAN class="boldfont">Profile for <?php echo"$username"; ?></SPAN><BR>
|
||||
<DIV class="boxheader2"></DIV>
|
||||
<SPAN class="boldfont">Homepage:</SPAN> <?php
|
||||
if ($userwebsite) {echo"<A HREF=\"$userwebsite\" target=\"_blank\">$userwebsite</A>";
|
||||
} else {
|
||||
echo"<SPAN CLASS=\"disabled\">Not Available for this Author</SPAN>";
|
||||
}
|
||||
?><BR>
|
||||
<SPAN class="boldfont">E-Mail:</SPAN> <?php if ($useremailhide=="1") {
|
||||
echo"<SPAN class=\"disabled\">Not Disclosed by Author</SPAN>";
|
||||
} else {
|
||||
echo"<SPAN class=\"emailactive\">Contact this Author via the <A HREF=\"#email\">E-Mail form</A> below</SPAN>";
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
<BR>
|
||||
<DIV class="item">
|
||||
<SPAN class="boldfont">All Extensions and Themes by <?php echo"$username"; ?></SPAN><BR>
|
||||
<DIV class="boxheader2"></DIV>
|
||||
<?php
|
||||
$sql = "SELECT TM.ID, TM.Type, TM.Name, TM.Description, TM.DateUpdated, TM.TotalDownloads, TU.UserEmail FROM `t_main` TM
|
||||
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
|
||||
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
|
||||
WHERE TU.UserID = '$userid' AND TM.Type !='P'
|
||||
ORDER BY `Type` , `Name` ";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$numresults = mysql_num_rows($sql_result);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
unset($downloadcount);
|
||||
|
||||
$sql2 = "SELECT `vID`, `Version` FROM `t_version` WHERE `ID` = '$row[ID]' AND `approved` = 'YES' ORDER BY `Version` ASC LIMIT 1";
|
||||
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
while ($row2 = mysql_fetch_array($sql_result2)) {
|
||||
$vid = $row2["vID"];
|
||||
$version = $row2["Version"];
|
||||
|
||||
$v++;
|
||||
$id = $row["ID"];
|
||||
$type = $row["Type"];
|
||||
$name = $row["Name"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$dateupdated = $row["DateUpdated"];
|
||||
$homepage = $row["Homepage"];
|
||||
$description = $row["Description"];
|
||||
$authors = $row["UserEmail"];
|
||||
$downloadcount = $row["TotalDownloads"];
|
||||
|
||||
$day=substr($dateupdated,8,2); //get the day
|
||||
$month=substr($dateupdated,5,2); //get the month
|
||||
$year=substr($dateupdated,0,4); //get the year
|
||||
$hour=substr($dateupdated,11,2); //get the hour
|
||||
$minute=substr($dateupdated,14,2); //get the minute
|
||||
$second=substr($dateupdated,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$dateupdated = gmdate("F d, Y g:i:sa", $timestamp); //gmdate("F d, Y", $dutimestamp);
|
||||
|
||||
echo"<DIV CLASS=\"item\">";
|
||||
echo"<SPAN class=\"title itemtitle\" style=\"margin-left: 0px\"><A HREF=\"moreinfo.php?application=$application&id=$id\">$name</A></SPAN><BR>";
|
||||
echo"<DIV class=\"profileitemdesc\">$description</DIV>\n";
|
||||
echo"<DIV class=\"baseline\">Updated: $dateupdated | Downloads: $downloadcount</DIV>\n";
|
||||
|
||||
echo"</DIV>\n";
|
||||
echo"<BR>\n";
|
||||
}
|
||||
}
|
||||
if ($numresults=="0") {
|
||||
echo"<DIV class=\"noitems\">No Extensions or Themes in the Database for $username yet...</DIV>";
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
<BR>
|
||||
<?php if ($useremailhide !=="1") { ?>
|
||||
<A NAME="email"></A>
|
||||
<DIV class="item">
|
||||
<SPAN class="boldfont">Send an E-Mail to <?php echo"$username"; ?></SPAN><BR>
|
||||
<DIV class="boxheader2"></DIV>
|
||||
<?php
|
||||
//SendMail Returned Message Section
|
||||
if ($_GET["mail"]) {
|
||||
$mail = $_GET["mail"];
|
||||
echo"<DIV class=\"mailresult\">";
|
||||
if ($mail=="successful") {
|
||||
echo"Your message has been sent successfully...";
|
||||
} else if ($mail=="unsuccessful") {
|
||||
echo"An error occured, your message was not sent... Please try again...";
|
||||
}
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
?>
|
||||
<FORM NAME="sendmail" METHOD="POST" ACTION="sendmail.php">
|
||||
<INPUT NAME="senduserid" TYPE="HIDDEN" VALUE="<?php echo"$userid"; ?>">
|
||||
Your Name: <INPUT NAME="fromname" TYPE="TEXT" SIZE=40 MAXLENGTH=100> Email: <INPUT NAME="fromemail" TYPE="TEXT" SIZE=40 MAXLENGTH=100><BR>
|
||||
Subject: <INPUT NAME="subject" TYPE="TEXT" SIZE=40 MAXLENGTH=100><BR>
|
||||
Message:<BR>
|
||||
<CENTER><TEXTAREA NAME="body" ROWS=20 COLS=65></TEXTAREA><BR>
|
||||
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Send Message"> <INPUT NAME="reset" TYPE="RESET" VALUE="Reset Form"><BR>
|
||||
</CENTER>
|
||||
</FORM>
|
||||
</DIV>
|
||||
<BR>
|
||||
<?php } ?>
|
||||
</DIV>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
85
mozilla/webtools/update/themes/inc_sidebar.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?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 *****
|
||||
?>
|
||||
<DIV class="sidelinks">
|
||||
<?php
|
||||
echo"<DIV CLASS=\"sidebartitle\">Categories:</DIV>\n";
|
||||
echo"<DIV class=\"sidebartext\">";
|
||||
if (!$category AND $index !="yes") {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<SPAN class=\"sidebartitle\"><A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=All\" TITLE=\"Show All ".ucwords($typename)." Alphabetically\">All</A></SPAN><BR>\n";
|
||||
if (!$category AND $index !="yes") {echo"</SPAN>"; }
|
||||
|
||||
// Object Categories
|
||||
$sql = "SELECT `CatName`,`CatDesc` FROM `t_categories` WHERE `CatType` = '$type' ORDER BY `CatName`";
|
||||
$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)) {
|
||||
$catname = $row["CatName"];
|
||||
$catdesc = $row["CatDesc"];
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">$catname</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
}
|
||||
?>
|
||||
<BR>
|
||||
<?php
|
||||
$catname = "Editors Pick";
|
||||
$catdesc = ucwords($typename)." picked by the Mozilla Update Editors";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">Editor's Pick</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
|
||||
$catname = "Popular";
|
||||
$catdesc = ucwords($typename)." downloaded the most";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">$catname</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
|
||||
$catname = "Top Rated";
|
||||
$catdesc = ucwords($typename)." rated the highest";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">$catname</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
|
||||
$catname = "Newest";
|
||||
$catdesc = "Most recent ".ucwords($typename);
|
||||
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"title\">"; }
|
||||
echo"<A HREF=\"showlist.php?application=$application&version=$app_version&numpg=$items_per_page&category=$catname\" TITLE=\"$catdesc\">$catname</A><BR>\n";
|
||||
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
|
||||
?>
|
||||
</DIV>
|
||||
</DIV>
|
||||
232
mozilla/webtools/update/themes/index.php
Normal file
@@ -0,0 +1,232 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
|
||||
<TITLE>Mozilla Update :: Themes - Change the Look of Mozilla Software</TITLE>
|
||||
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
$type = "T";
|
||||
if ($_GET["application"]) {$application=$_GET["application"]; }
|
||||
include"$page_header";
|
||||
$index="yes";
|
||||
include"inc_sidebar.php";
|
||||
?>
|
||||
<DIV class="box">
|
||||
<DIV class="boxheader" style="width: 100%">What is a Theme?</DIV>
|
||||
<SPAN class="itemdescription">Themes are skins for <?php print(ucwords($application)); ?>, they allow you to change the look and
|
||||
feel of the browser and personalize it to your tastes. A theme can simply change the colors of <?php print(ucwords($application)); ?>
|
||||
or it can change every piece of the browser appearance.</SPAN>
|
||||
</DIV>
|
||||
|
||||
<DIV class="box">
|
||||
<DIV class="boxheader" style="width: 100%">Featured <?php print(ucwords($application)); ?> Theme</DIV>
|
||||
<?php
|
||||
$sql = "SELECT TR.ID, TM.Name, `Title`, TR.DateAdded, `Body`, `Type`, `pick` FROM `t_reviews` TR
|
||||
INNER JOIN t_main TM ON TR.ID = TM.ID
|
||||
INNER JOIN t_version TV ON TV.ID = TM.ID
|
||||
INNER JOIN t_applications TA ON TA.AppID = TV.AppID
|
||||
WHERE `Type` = '$type' AND `AppName` = '$application' AND `featured`='YES' ORDER BY `rID` DESC 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"];
|
||||
$name = $row["Name"];
|
||||
$title = $row["Title"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$pick = $row["pick"];
|
||||
$body = $row["Body"];
|
||||
$bodylength = strlen($body);
|
||||
if ($bodylength>"250") {
|
||||
$body = substr($body,0,250);
|
||||
$body .= " <a href=\"moreinfo.php?application=$application&id=$id&page=staffreview\">[More...]</a>";
|
||||
|
||||
}
|
||||
|
||||
//Create Customizeable Timestamp
|
||||
$day=substr($dateadded,8,2); //get the day
|
||||
$month=substr($dateadded,5,2); //get the month
|
||||
$year=substr($dateadded,0,4); //get the year
|
||||
$hour=substr($dateadded,11,2); //get the hour
|
||||
$minute=substr($dateadded,14,2); //get the minute
|
||||
$second=substr($dateadded,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$date = gmdate("F, Y", $timestamp);
|
||||
|
||||
echo"<a href=\"moreinfo.php?application=$application&id=$id\">$name</A> -- $title";
|
||||
if ($pick=="YES") {echo" - $date Editors Pick"; }
|
||||
echo"<BR>\n";
|
||||
echo"<SPAN class=\"itemdescription\">$body</SPAN><BR>\n";
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
<?php
|
||||
//Temporary!! Current Version Array Code
|
||||
$currentver_array = array("firefox"=>"1.0", "thunderbird"=>"1.0", "mozilla"=>"1.7");
|
||||
$currentver_display_array = array("firefox"=>"1.0", "thunderbird"=>"1.0", "mozilla"=>"1.7.x");
|
||||
$currentver = $currentver_array[$application];
|
||||
$currentver_display = $currentver_display_array[$application];
|
||||
?>
|
||||
<DIV class="box" style="width: 80%; min-height: 200px; border: 0px">
|
||||
<DIV class="boxcolumns">
|
||||
<DIV class="boxheader"><A HREF="showlist.php?application=<?php echo"$application"; ?>&category=Popular">Most Popular</A>:</DIV>
|
||||
<?php
|
||||
$i=0;
|
||||
$sql = "SELECT TM.ID, TV.vID,TM.Name, TV.Version, TM.TotalDownloads, TM.downloadcount
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' 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);
|
||||
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"];
|
||||
if ($lastname == $name) {$i--; continue; }
|
||||
echo"$i - <a href=\"moreinfo.php?application=$application&id=$id\">$name</a><br>\n";
|
||||
echo"<SPAN class=\"smallfont nocomment\">($downloadcount downloads)</SPAN><BR>\n";
|
||||
|
||||
$lastname = $name;
|
||||
if ($i >= "5") {break;}
|
||||
}
|
||||
?>
|
||||
<BR>
|
||||
</DIV>
|
||||
<DIV class="boxcolumns">
|
||||
<DIV class="boxheader"><A HREF="showlist.php?application=<?php echo"$application"; ?>&category=Top Rated">Top Rated</A>:</DIV>
|
||||
<?php
|
||||
$r=0;
|
||||
$usednames = array();
|
||||
$sql = "SELECT TM.ID, TV.vID, TM.Name, TV.Version, TM.Rating, TU.UserName
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_authorxref TAX ON TAX.ID = TM.ID
|
||||
INNER JOIN t_userprofiles TU ON TU.UserID = TAX.UserID
|
||||
WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND `Rating` > '0' AND `approved` = 'YES' ORDER BY `Rating` DESC, `Name` ASC, `Version` DESC";
|
||||
$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)) {
|
||||
$r++; $s++;
|
||||
$id = $row["ID"];
|
||||
$vid = $row["vID"];
|
||||
$name = $row["Name"];
|
||||
$version = $row["Version"];
|
||||
$rating = $row["Rating"];
|
||||
$arraysearch = array_search("$name", $usednames);
|
||||
if ($arraysearch !== false AND $usedversions[$arraysearch]['version']<$version) {$r--; continue; } //
|
||||
echo"$r - <a href=\"moreinfo.php?application=$application&id=$id&vid=$vid\">$name</a> ";
|
||||
|
||||
//$rating = round($rating);
|
||||
|
||||
echo"<SPAN title=\"Rated: $rating of 5\" style=\"font-size: 8pt\">";
|
||||
for ($i = 1; $i <= floor($rating); $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
if ($rating>floor($rating)) {
|
||||
$val = ($rating-floor($rating))*10;
|
||||
echo"<IMG SRC=\"/images/stars/star_0$val.png\" BORDER=0 ALT=\"\">";
|
||||
$i++;
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
echo"</SPAN><br>\n";
|
||||
//echo"<SPAN class=\"smallfont nocomment\">By $author</SPAN><BR>\n";
|
||||
$usednames[$s] = $name;
|
||||
$usedversions[$s] = $version;
|
||||
if ($r >= "5") {break;}
|
||||
}
|
||||
unset($usednames, $usedversions, $r, $s, $i);
|
||||
?>
|
||||
</DIV>
|
||||
<DIV class="boxcolumns">
|
||||
<DIV class="boxheader"><A HREF="showlist.php?application=<?php echo"$application"; ?>&category=Newest">Most Recent</A>:</DIV>
|
||||
<?php
|
||||
$i=0;
|
||||
//MacOSX Specific override for All+Mac themes. Bug 252294
|
||||
if ($_SESSION["app_os"]=="MacOSX") { $app_os = $_SESSION["app_os"]; } else { $app_os = "ALL"; }
|
||||
|
||||
$sql = "SELECT TM.ID, TV.vID, TM.Name, TV.Version, TV.DateAdded
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID
|
||||
WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='$currentver' AND `maxAppVer_int` >= '$currentver' AND (`OSName` = '$_SESSION[app_os]' OR `OSName` = '$app_os') 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);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
$i++;
|
||||
$id = $row["ID"];
|
||||
$vid = $row["vID"];
|
||||
$name = $row["Name"];
|
||||
$version = $row["Version"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
//Create Customizeable Datestamp
|
||||
$timestamp = strtotime("$dateadded");
|
||||
$dateadded = gmdate("F d, Y g:i:sa", $timestamp); // $dateupdated = gmdate("F d, Y g:i:sa T", $timestamp);
|
||||
|
||||
if ($lastname == $name) {$i--; continue; }
|
||||
echo"$i - <a href=\"moreinfo.php?application=$application&id=$id&vid=$vid\">$name $version</a><BR>\n";
|
||||
echo"<SPAN class=\"smallfont nocomment\">($dateadded)</SPAN><BR>\n";
|
||||
|
||||
$lastname = $name;
|
||||
if ($i >= "5") {break;}
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
</DIV>
|
||||
<BR>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
106
mozilla/webtools/update/themes/install.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?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";
|
||||
//Get Full Information for the file requested.
|
||||
$sql = "SELECT `URI` FROM `t_version` WHERE `ID`='$_GET[id]' AND `vID`='$_GET[vid]' 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);
|
||||
$uri=$row["URI"];
|
||||
|
||||
header("Location: $uri");
|
||||
exit;
|
||||
|
||||
//XXX This codepath sucks performance wise and has been disabled. See Bug 267822.
|
||||
|
||||
// New DownloadCount management Code..
|
||||
//Check for user, to see if they recently accessed this file (filters duplicate/triplicate+ requests in a short period).
|
||||
$maxlife = date("YmdHis", mktime(date("H"), date("i")-10, date("s"), date("m"), date("d"), date("Y")));
|
||||
$sql = "SELECT `dID` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `vID`='$_GET[vid]' AND `user_ip`='$_SERVER[REMOTE_ADDR]' AND `user_agent` = '$_SERVER[HTTP_USER_AGENT]' AND `date`>'$maxlife' AND `type`='download' LIMIT 1";
|
||||
$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") {
|
||||
//Insert a record of this download for the next 10 minutes anyway. :-)
|
||||
$today=date("YmdHis");
|
||||
$sql = "INSERT INTO `t_downloads` (`ID`,`date`,`vID`, `user_ip`, `user_agent`, `type`) VALUES ('$_GET[id]','$today','$_GET[vid]', '$_SERVER[REMOTE_ADDR]', '$_SERVER[HTTP_USER_AGENT]', 'download');";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
//Cleanup the Individual Downloads part of the table for old records
|
||||
$sql = "DELETE FROM `t_downloads` WHERE `date`<'$maxlife' AND `type`='download'";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
$today=date("Ymd")."000000";
|
||||
//Per day download tracking -- Record hits for this day in the record (if it doesn't exist create it)
|
||||
$sql = "SELECT `dID` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`='$today' AND `type`='count' LIMIT 1";
|
||||
$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") {
|
||||
$sql = "INSERT INTO `t_downloads` (`ID`,`date`,`downloadcount`,`type`) VALUES ('$_GET[id]','$today','1','count');";
|
||||
} else {
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
$sql = "UPDATE `t_downloads` SET `downloadcount`=downloadcount+1 WHERE `dID`='$row[dID]' LIMIT 1";
|
||||
}
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
|
||||
//Download Statistic Management Code
|
||||
// Maintain the last 7 days record count
|
||||
// This is also where the weekly w/e code would go. if that feature is ever created.
|
||||
$mindate = date("Ymd", mktime(0, 0, 0, date("m"), date("d")-7, date("Y")))."000000";
|
||||
$downloadcount="0";
|
||||
$sql = "SELECT `downloadcount` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`>='$mindate' AND `type`='count' ORDER BY `date` DESC";
|
||||
$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)) {
|
||||
$downloadcount = $downloadcount+$row["downloadcount"];
|
||||
}
|
||||
//Update the 7 day count in the main record.
|
||||
$sql = "UPDATE `t_main` SET `downloadcount`='$downloadcount' WHERE `ID`='$_GET[id]' LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
//Update the total downloadcount in the main record.
|
||||
$sql = "UPDATE `t_main` SET `TotalDownloads`=TotalDownloads+1 WHERE `ID`='$_GET[id]' LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
//Clean up the Counts per day for >8 days. (and in the future, compile the week/ending records for this data)
|
||||
$sql = "DELETE FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`<'$mindate' AND `type`='count'";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
|
||||
}
|
||||
|
||||
//Send User on their way to the file...
|
||||
header("Location: $uri")
|
||||
?>
|
||||
541
mozilla/webtools/update/themes/moreinfo.php
Normal file
@@ -0,0 +1,541 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
|
||||
<?php
|
||||
//Bookmarking-Friendly Page Title
|
||||
$sql = "SELECT Name FROM `t_main` WHERE ID = '$_GET[id]' AND Type = 'T' LIMIT 1";
|
||||
$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) {
|
||||
$return = page_error("1","Extension ID is Invalid or Missing.");
|
||||
exit;
|
||||
|
||||
}
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
|
||||
//Page Titles
|
||||
$pagetitles = array("releases"=>"All Releases", "comments"=>"User Comments", "staffreview"=>"Editor Review", "opinion"=>" My Opinion");
|
||||
$pagetitle = $pagetitles[$_GET["page"]];
|
||||
?>
|
||||
|
||||
<TITLE>Mozilla Update :: Themes -- More Info: <?php echo"$row[Name]"; if ($pagetitle) {echo" - $pagetitle"; } ?></TITLE>
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
include"$page_header";
|
||||
$type = "T";
|
||||
$category=$_GET["category"];
|
||||
include"inc_sidebar.php";
|
||||
?>
|
||||
<DIV id="content">
|
||||
<?php
|
||||
//Get Author Data
|
||||
$sql2 = "SELECT TM.Name, TU.UserName, TU.UserID, TU.UserEmail FROM `t_main` TM
|
||||
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
|
||||
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
|
||||
WHERE TM.ID = '$_GET[id]'
|
||||
ORDER BY `Type` , `Name` ASC "; // TM.Type = 'E'
|
||||
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
while ($row2 = mysql_fetch_array($sql_result2)) {
|
||||
$authorarray[$row2[Name]][] = $row2["UserName"];
|
||||
$authorids[$row2[UserName]] = $row2["UserID"];
|
||||
}
|
||||
|
||||
|
||||
//Run Query and Create List
|
||||
$s = "0";
|
||||
$sql = "SELECT TM.ID, TM.Type, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Description, TM.Rating, TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.DateAdded AS VerDateAdded, TV.DateUpdated AS VerDateUpdated, TV.URI, TV.Notes, TM.TotalDownloads, TA.AppName, TOS.OSName, TP.PreviewURI
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID
|
||||
LEFT JOIN t_previews TP ON TV.vID = TP.vID
|
||||
WHERE TM.ID = '$_GET[id]' AND `approved` = 'YES' ";
|
||||
if ($_GET["vid"]) { $sql .=" AND TV.vID = '$_GET[vid]' "; }
|
||||
$sql .= "ORDER BY `Name` , `Version` 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);
|
||||
|
||||
|
||||
$v++;
|
||||
$id = $row["ID"];
|
||||
$type = $row["Type"];
|
||||
$name = $row["Name"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$dateupdated = $row["DateUpdated"];
|
||||
$homepage = $row["Homepage"];
|
||||
$description = $row["Description"];
|
||||
$rating = $row["Rating"];
|
||||
$authors = $authorarray[$name];
|
||||
$osname = $row["OSName"];
|
||||
|
||||
$vid = $row["vID"];
|
||||
if (!$_GET['vid']) {$_GET['vid']=$vid;}
|
||||
$appname = $row["AppName"];
|
||||
$minappver = $row["MinAppVer"];
|
||||
$maxappver = $row["MaxAppVer"];
|
||||
$verdateadded = $row["VerDateAdded"];
|
||||
$verdateupdated = $row["VerDateUpdated"];
|
||||
$filesize = $row["Size"];
|
||||
$notes = $row["Notes"];
|
||||
$version = $row["Version"];
|
||||
$uri = $row["URI"];
|
||||
$previewuri = $row["PreviewURI"];
|
||||
$downloadcount = $row["TotalDownloads"];
|
||||
$filename = basename($uri);
|
||||
|
||||
if ($VerDateAdded > $dateadded) {$dateadded = $VerDateAdded; }
|
||||
if ($VerDateUpdated > $dateupdated) {$dateupdated = $VerDateUpdated; }
|
||||
|
||||
|
||||
|
||||
//Turn Authors Array into readable string...
|
||||
$authorcount = count($authors);
|
||||
foreach ($authors as $author) {
|
||||
$userid = $authorids[$author];
|
||||
$n++;
|
||||
$authorstring .= "<A HREF=\"authorprofiles.php?application=$application&id=$userid\">$author</A>";
|
||||
if ($authorcount != $n) {$authorstring .=", "; }
|
||||
|
||||
}
|
||||
$authors = $authorstring;
|
||||
unset($authorstring, $n); // Clear used Vars..
|
||||
|
||||
//Create Customizeable Timestamp for DateAdded/DateUpdated
|
||||
$day=substr($dateadded,8,2); //get the day
|
||||
$month=substr($dateadded,5,2); //get the month
|
||||
$year=substr($dateadded,0,4); //get the year
|
||||
$hour=substr($dateadded,11,2); //get the hour
|
||||
$minute=substr($dateadded,14,2); //get the minute
|
||||
$second=substr($dateadded,17,2); //get the sec
|
||||
$datimestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
|
||||
$day=substr($dateupdated,8,2); //get the day
|
||||
$month=substr($dateupdated,5,2); //get the month
|
||||
$year=substr($dateupdated,0,4); //get the year
|
||||
$hour=substr($dateupdated,11,2); //get the hour
|
||||
$minute=substr($dateupdated,14,2); //get the minute
|
||||
$second=substr($dateupdated,17,2); //get the sec
|
||||
$dutimestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
|
||||
$dateadded = gmdate("F d, Y g:i:sa", $datimestamp); //gmdate("F d, Y", $datimestamp);
|
||||
$dateupdated = gmdate("F d, Y g:i:sa", $dutimestamp); //gmdate("F d, Y", $dutimestamp);
|
||||
|
||||
//Rating
|
||||
if (!$rating) { $rating="0"; }
|
||||
?>
|
||||
|
||||
|
||||
<DIV class="tabbar">
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid"; ?>">More Info</A></DIV>
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid&page=releases"; ?>">All Releases</A></DIV>
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid&page=comments"; ?>">Comments</A></DIV>
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid&page=staffreview"; ?>">Editor Review</A></DIV>
|
||||
<DIV class="tab"><A HREF="?<?php echo"application=$application&id=$id&vid=$vid&page=opinion"; ?>">My Opinion</A></DIV>
|
||||
</DIV>
|
||||
<?php
|
||||
echo"<DIV class=\"item\">\n";
|
||||
//echo"<DIV style=\"height: 100px\">"; //Why?!?
|
||||
if ($previewuri) {
|
||||
list($width, $height, $imagetype, $attr) = getimagesize("$websitepath"."$previewuri");
|
||||
|
||||
echo"<IMG SRC=\"$previewuri\" BORDER=0 HEIGHT=$height WIDTH=$width STYLE=\"float: right; padding-right: 5px\" ALT=\"$name preview\">";
|
||||
}
|
||||
|
||||
//Upper-Right Side Box
|
||||
echo"<DIV class=\"liststars\" title=\"$rating of 5 stars\" style=\"font-size: 8pt\"><A HREF=\"moreinfo.php?application=$application&id=$id&page=comments\">";
|
||||
for ($i = 1; $i <= floor($rating); $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
if ($rating>floor($rating)) {
|
||||
$val = ($rating-floor($rating))*10;
|
||||
echo"<IMG SRC=\"/images/stars/star_0$val.png\" BORDER=0 ALT=\"\">";
|
||||
$i++;
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
echo"</A></DIV>\n";
|
||||
|
||||
echo"<DIV class=\"itemtitle\">";
|
||||
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid\">$name $version</A></SPAN><BR>";
|
||||
echo"<SPAN class=\"authorline\">By $authors</SPAN><br>";
|
||||
echo"</DIV>";
|
||||
|
||||
//Description & Version Notes
|
||||
echo"<SPAN class=\"itemdescription\">";
|
||||
echo"$description<BR>";
|
||||
if ($notes) {echo"$notes"; }
|
||||
echo"</SPAN>\n";
|
||||
|
||||
//echo"</DIV>\n";
|
||||
echo"<BR>\n\n";
|
||||
|
||||
$page = $_GET["page"];
|
||||
if (!$page or $page=="general") {
|
||||
?>
|
||||
<DIV class="downloadbox">
|
||||
<?php
|
||||
//Create DateStamp for Version Release Date ($verdateadded)
|
||||
$day=substr($verdateadded,8,2); //get the day
|
||||
$month=substr($verdateadded,5,2); //get the month
|
||||
$year=substr($verdateadded,0,4); //get the year
|
||||
$hour=substr($verdateadded,11,2); //get the hour
|
||||
$minute=substr($verdateadded,14,2); //get the minute
|
||||
$second=substr($verdateadded,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$verdateadded = gmdate("F d, Y", $timestamp);
|
||||
|
||||
//Calculate Download Time
|
||||
$speed = "56"; //In Kbit/s
|
||||
$speedinkb = "5.5"; //$speedinkb = $speed/8; //In KB/s
|
||||
$timeinsecs = round($filesize/$speedinkb);
|
||||
$time_minutes = floor($timeinsecs/60);
|
||||
$time_seconds = round($timeinsecs-($time_minutes*60),-1);
|
||||
$time_seconds = $time_seconds+2; //Compensate for mirror overhead
|
||||
|
||||
$time = "About ";
|
||||
if ($time_minutes>0) {
|
||||
$time .= "$time_minutes minutes ";
|
||||
}
|
||||
$time .="$time_seconds seconds";
|
||||
|
||||
echo"
|
||||
<SPAN style=\"itemdescription\">Released on $verdateadded</SPAN><BR>
|
||||
<DIV class=\"moreinfoinstall\">";
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\" TITLE=\"Download $name $version\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Download Now )</A><BR>";
|
||||
} else {
|
||||
//Make Theme Install work again, Bug 246754
|
||||
//echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'install.php/$filename?id=$id&vid=$vid','$name'))\"";
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name $version'))\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Install Now )</A><BR>";
|
||||
}
|
||||
echo"
|
||||
<SPAN class=\"filesize\"> $filesize KB, ($time @ $speed"."k)</SPAN></DIV>
|
||||
<BR>";
|
||||
if ($application=="thunderbird") {
|
||||
echo"<SPAN style=\"font-size: 10pt; color: #00F\">Theme Install Instructions for Thunderbird Users:</SPAN><BR>
|
||||
<SPAN style=\"font-size: 8pt;\">(1) Click the link above to Download and save the file to your hard disk.<BR>
|
||||
(2) In Mozilla Thunderbird, open the theme manager (Tools Menu/Themes)<BR>
|
||||
(3) Click the Install button, and locate/select the file you downloaded and click \"OK\"<BR></SPAN>
|
||||
";
|
||||
}
|
||||
|
||||
if ($homepage) {echo"<SPAN style=\"font-size:10pt\">Having a problem with this theme? For Help and Technical Support, visit the <A HREF=\"$homepage\">Theme's Homepage</A>.</SPAN>";}
|
||||
|
||||
echo"<UL style=\"font-size:10pt\">";
|
||||
if ($homepage) {echo"<LI> <A HREF=\"$homepage\">Theme Homepage</A>"; }
|
||||
if ($appname !="Thunderbird") {echo"<LI> <a href=\"install.php/$filename?id=$id&vid=$vid\">Download Theme</A>"; }
|
||||
echo"<LI> <A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&page=releases\">Other Versions</A>";
|
||||
?>
|
||||
</UL>
|
||||
</DIV>
|
||||
|
||||
<DIV class="commentbox">
|
||||
<DIV class="boxheader">User Comments:</DIV>
|
||||
<BR>
|
||||
<?php
|
||||
$sql = "SELECT CommentName, CommentTitle, CommentNote, CommentDate, CommentVote FROM `t_feedback` WHERE ID = '$_GET[id]' AND CommentNote IS NOT NULL ORDER BY `CommentDate` DESC LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$num_results = mysql_num_rows($sql_result);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
$commentname = $row["CommentName"];
|
||||
$commenttitle = $row["CommentTitle"];
|
||||
$commentnotes = $row["CommentNote"];
|
||||
$commentdate = $row["CommentDate"];
|
||||
$rating = $row["CommentVote"];
|
||||
|
||||
//Create Customizeable Datestamp
|
||||
$day=substr($commentdate,8,2); //get the day
|
||||
$month=substr($commentdate,5,2); //get the month
|
||||
$year=substr($commentdate,0,4); //get the year
|
||||
$hour=substr($commentdate,11,2); //get the hour
|
||||
$minute=substr($commentdate,14,2); //get the minute
|
||||
$second=substr($commentdate,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$commentdate = gmdate("F d, Y g:ia", $timestamp);
|
||||
|
||||
echo"<DIV class=\"commenttitlebar\">";
|
||||
echo"<SPAN class=\"commenttitle\">$commenttitle</SPAN>";
|
||||
echo"<SPAN class=\"liststars\">";
|
||||
|
||||
for ($i = 1; $i <= $rating; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 WIDTH=16 HEIGHT=16 ALT=\"*\">";
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 WIDTH=16 HEIGHT=16 ALT=\"\">";
|
||||
}
|
||||
echo"</SPAN>";
|
||||
echo"</DIV>";
|
||||
echo" By $commentname<BR>\n";
|
||||
echo" <BR>\n";
|
||||
echo"$commentnotes<BR>\n\n";
|
||||
echo" <BR>\n";
|
||||
echo"<DIV class=\"commentfooter\">\n";
|
||||
echo"$commentdate | <A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&page=comments\">More Comments...</A> | <A HREF=\"moreinfo.php?id=$id&vid=$vid&page=opinion\">Rate It!</A>\n";
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
|
||||
if ($num_results=="0") {
|
||||
echo"<DIV class=\"nocomment\">";
|
||||
echo"Nobody's Commented on this Extension Yet<BR>";
|
||||
echo"Be the First! <A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&page=opinion\">Rate It!</A>";
|
||||
echo"</DIV>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</DIV>
|
||||
|
||||
<?php
|
||||
} else if ($page=="releases") {
|
||||
|
||||
echo"<DIV class=\"mipageheading\">";
|
||||
echo"Recent Releases:<BR>";
|
||||
echo"</DIV>";
|
||||
|
||||
$sql = "SELECT TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.URI, TV.Notes, TA.AppName, TOS.OSName
|
||||
FROM `t_version` TV
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID
|
||||
WHERE TV.ID = '$_GET[id]' AND `approved` = 'YES'
|
||||
ORDER BY `Version` DESC, `OSName` ASC
|
||||
LIMIT 0, 10";
|
||||
|
||||
$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)) {
|
||||
$vid = $row["vID"];
|
||||
$minappver = $row["MinAppVer"];
|
||||
$maxappver = $row["MaxAppVer"];
|
||||
$filesize = $row["Size"];
|
||||
$notes = $row["Notes"];
|
||||
$version = $row["Version"];
|
||||
$uri = $row["URI"];
|
||||
$osname = $row["OSName"];
|
||||
$appname = $row["AppName"];
|
||||
|
||||
echo"<DIV>"; //Open Version DIV
|
||||
|
||||
//Description & Version Notes
|
||||
echo"<SPAN class=\"itemdescription\">";
|
||||
echo"<SPAN class=\"listtitle\"><A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid\">Version $version</A></SPAN><br>\n";
|
||||
if ($notes) {echo"$notes"; }
|
||||
echo"</SPAN>\n";
|
||||
|
||||
//Icon Bar Modules
|
||||
echo"<DIV style=\"height: 34px\">";
|
||||
echo"<DIV class=\"iconbar\" style=\"width: 100px;\">";
|
||||
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Download</A>";
|
||||
} else {
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name $version'))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name\" ALT=\"\">Install</A>";
|
||||
}
|
||||
|
||||
echo"<BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"$appname \"> Works with:<BR> $minappver - $maxappver</DIV>";
|
||||
echo"<DIV class=\"iconbar\" style=\"width: 90px;\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"\">OS:<BR>"; if($osname=="ALL") {echo"All OSes";} else {echo"$osname";} echo"</DIV>";
|
||||
echo"</DIV>";
|
||||
|
||||
echo"</DIV>";
|
||||
}
|
||||
|
||||
//End General Page
|
||||
} else if ($page=="comments") {
|
||||
//Comments/Ratings Page
|
||||
echo"<DIV class=\"mipageheading\">";
|
||||
echo"User Comments:<BR>";
|
||||
echo"</DIV>";
|
||||
$sql = "SELECT CommentName, CommentTitle, CommentNote, CommentDate, CommentVote FROM `t_feedback` WHERE ID = '$_GET[id]' AND CommentNote IS NOT NULL ORDER BY `CommentDate` ASC";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$num_results = mysql_num_rows($sql_result);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
$name = $row["CommentName"];
|
||||
$title = $row["CommentTitle"];
|
||||
$notes = $row["CommentNote"];
|
||||
$date = $row["CommentDate"];
|
||||
$rating = $row["CommentVote"];
|
||||
|
||||
echo"<DIV class=\"commenttitlebar\">";
|
||||
echo"<SPAN class=\"commenttitle\">$title</SPAN>";
|
||||
echo"<SPAN class=\"liststars\">";
|
||||
|
||||
for ($i = 1; $i <= $rating; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 WIDTH=16 HEIGHT=16 ALT=\"*\">";
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 WIDTH=16 HEIGHT=16 ALT=\"\">";
|
||||
}
|
||||
echo"</SPAN>";
|
||||
echo"</DIV>";
|
||||
echo"$notes<BR>\n\n";
|
||||
|
||||
echo"<DIV class=\"commentfooter\">\n";
|
||||
echo"<SPAN style=\"padding-left: 30px; font-size: 8pt; font-weight: bold\">Posted on $date by $name</SPAN><br>";
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
|
||||
if ($num_results=="0") {
|
||||
echo"<DIV class=\"nocomment\">";
|
||||
echo"Nobody has commented on this extension yet...<BR>
|
||||
Be the First!
|
||||
<A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&page=opinion\">Leave your comments</A>...";
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
|
||||
|
||||
echo"<DIV style=\"height: 5px;\"></DIV>";
|
||||
|
||||
} else if ($page=="staffreview") {
|
||||
//Staff/Editor Review Tab
|
||||
echo"<DIV class=\"mipageheading\">";
|
||||
echo"Editor Review:<BR>";
|
||||
echo"</DIV>";
|
||||
|
||||
echo"<DIV class=\"reviewbox\">\n";
|
||||
$sql = "SELECT TR.ID, `Title`, TR.DateAdded, `Body`, `Type`, `Pick`, TU.UserName FROM `t_reviews` TR
|
||||
INNER JOIN t_main TM ON TR.ID = TM.ID
|
||||
INNER JOIN t_userprofiles TU ON TR.AuthorID = TU.UserID
|
||||
WHERE `Type` = 'E' AND TR.ID = '$_GET[id]' ORDER BY `rID` DESC LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$num_results = mysql_num_rows($sql_result);
|
||||
while ($row = mysql_fetch_array($sql_result)) {
|
||||
$id = $row["ID"];
|
||||
$title = $row["Title"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$body = $row["Body"];
|
||||
$pick = $row["Pick"];
|
||||
$username = $row["UserName"];
|
||||
|
||||
//Create Customizeable Timestamp
|
||||
$timestamp = strtotime("$dateadded");
|
||||
$date = gmdate("F, Y", $timestamp);
|
||||
$posteddate = gmdate("F j Y, g:i:sa", $timestamp);
|
||||
|
||||
|
||||
echo"$title<br>\n";
|
||||
if ($pick=="YES") {echo"<SPAN class=\"itemdescription\"> $date Editors Pick<BR>\n"; }
|
||||
echo"<BR>\n";
|
||||
echo"$body</SPAN><BR>\n";
|
||||
echo"<DIV class=\"commentfooter\">Posted on $posteddate by $username</DIV>\n";
|
||||
}
|
||||
$typename = "extension";
|
||||
if ($num_results=="0") {
|
||||
echo"
|
||||
<SPAN style=\"font-weight: bold\">
|
||||
This $typename has not yet been reviewed.<BR><BR>
|
||||
|
||||
To see what other users think of this extension, view the <A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid&category=$category&page=comments\">User Comments...</A>
|
||||
</SPAN>
|
||||
";
|
||||
|
||||
|
||||
}
|
||||
echo"</DIV>\n";
|
||||
|
||||
} else if ($page=="opinion") {
|
||||
//My Opinion Tab
|
||||
echo"<DIV class=\"mipageheading\">";
|
||||
echo"Your Rating / Feedback:<BR>";
|
||||
echo"</DIV>";
|
||||
?>
|
||||
<?php
|
||||
if ($_GET["error"]=="norating") {
|
||||
echo"<DIV class=\"errorbox\">\n
|
||||
Your comment submission had the following error(s), please fix these errors and try again.<br>\n
|
||||
Rating field cannot be left blank.<br>\n
|
||||
</DIV>\n";
|
||||
}
|
||||
?>
|
||||
<DIV class="opinionform">
|
||||
<FORM NAME="opinon" METHOD="POST" ACTION="../core/postfeedback.php">
|
||||
<INPUT NAME="id" TYPE="HIDDEN" VALUE="<?php echo"$id"; ?>">
|
||||
<INPUT NAME="vid" TYPE="HIDDEN" VALUE="<?php echo"$vid"; ?>">
|
||||
<INPUT NAME="type" TYPE="HIDDEN" value="T">
|
||||
Your Name:<BR>
|
||||
<INPUT NAME="name" TYPE="TEXT" SIZE=30 MAXLENGTH=30><BR>
|
||||
|
||||
Rating:*<BR>
|
||||
<SELECT NAME="rating">
|
||||
<OPTION value="">Rating:
|
||||
<OPTION value="5">5 Stars
|
||||
<OPTION value="4">4 Stars
|
||||
<OPTION value="3">3 Stars
|
||||
<OPTION value="2">2 Stars
|
||||
<OPTION value="1">1 Star
|
||||
<OPTION value="0">0 Stars
|
||||
</SELECT><BR>
|
||||
|
||||
Title:<BR>
|
||||
<INPUT NAME="title" TYPE="TEXT" SIZE=30 MAXLENGTH=50><BR>
|
||||
|
||||
Review/Comments:<BR>
|
||||
<TEXTAREA NAME="comments" ROWS=5 COLS=55></TEXTAREA><BR>
|
||||
<SPAN class="smallfont">No Comment?<INPUT NAME="commententered" TYPE="CHECKBOX" VALUE="FALSE"></SPAN><BR>
|
||||
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Post"> <INPUT NAME="reset" TYPE="RESET" VALUE="Reset"><BR>
|
||||
<SPAN class="smallfont">* Required Fields</SPAN>
|
||||
</FORM>
|
||||
|
||||
</DIV>
|
||||
<?php
|
||||
} // End Pages
|
||||
|
||||
echo"<DIV class=\"baseline\">";
|
||||
echo"Date Added: $dateadded | Last Updated: $dateupdated | ";
|
||||
echo"Total Downloads: $downloadcount<BR>";
|
||||
echo"</DIV>\n";
|
||||
echo"</DIV>\n";
|
||||
echo"<BR>\n";
|
||||
?>
|
||||
</DIV>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
107
mozilla/webtools/update/themes/sendmail.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?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
|
||||
//Mozilla Update Message System
|
||||
//Send Mail script...
|
||||
exit;
|
||||
require"../core/config.php";
|
||||
|
||||
if (!$_POST["senduserid"]) {
|
||||
exit("<B>Error: no valid user to e-mail, possible attempt to spam detected...</B>");
|
||||
}
|
||||
|
||||
//Get E-Mail Address from DB based on passed data..
|
||||
$sql = "SELECT `UserEmail` FROM `t_userprofiles` WHERE `UserID` = '$_POST[senduserid]' AND `UserEmailHide`='0' LIMIT 1";
|
||||
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
|
||||
$row = mysql_fetch_array($sql_result);
|
||||
$to_address=$row["UserEmail"];
|
||||
|
||||
|
||||
//All From_, To_, and subject variables are passed from the form
|
||||
// and do not need to be defined here.. unless debugging..
|
||||
|
||||
$from_name = $_POST["fromname"];
|
||||
$from_address = $_POST["fromemail"];
|
||||
$subject = $_POST["subject"];
|
||||
|
||||
//Anti-Abuse
|
||||
$findme = '@';
|
||||
$pos = strpos($to_address, $findme);
|
||||
|
||||
if ($pos === false) {
|
||||
//This isn't a valid e-mail address being passed...
|
||||
//Send the e-mail message to the $from_address, just for fun..
|
||||
$to_address = $from_address;
|
||||
}
|
||||
|
||||
$message = $_POST["body"];
|
||||
|
||||
//Message Footer (Auto-Appended to Messages sent using this form.
|
||||
$message .= "\n\n";
|
||||
$message .= "____________________________________\n";
|
||||
$message .= "Message sent through the Mozilla Update Message system.\n
|
||||
The system allows visitors to send you e-mail without revealing your e-mail address to them.
|
||||
If you no longer wish to receive e-mail from visitors, you may change your preferences online at http;//update.mozilla.org.\n";
|
||||
|
||||
|
||||
$headers .= "MIME-Version: 1.0\r\n";
|
||||
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
|
||||
$headers .= "From: ".$from_name." <".$from_address.">\r\n";
|
||||
$headers .= "Reply-To: ".$from_name." <".$from_address.">\r\n";
|
||||
$headers .= "X-Priority: 3\r\n";
|
||||
$headers .= "X-MSMail-Priority: Normal\r\n";
|
||||
$headers .= "X-Mailer: Mozilla Update Message System 1.0";
|
||||
|
||||
$mailstatus = mail($to_address, $subject, $message, $headers);
|
||||
|
||||
|
||||
|
||||
if ($mailstatus===FALSE) {
|
||||
//Message Unsuccessful
|
||||
$return_path="extensions/authorprofiles.php?id=$_POST[senduserid]&mail=unsuccessful";
|
||||
|
||||
} else if ($mailstatus===TRUE) {
|
||||
//Message Successful
|
||||
$return_path="extensions/authorprofiles.php?id=$_POST[senduserid]&mail=successful";
|
||||
|
||||
}
|
||||
header("Location: http://$_SERVER[HTTP_HOST]/$return_path#email");
|
||||
exit;
|
||||
|
||||
?>
|
||||
501
mozilla/webtools/update/themes/showlist.php
Normal file
@@ -0,0 +1,501 @@
|
||||
<?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 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
|
||||
<html lang="EN" dir="ltr">
|
||||
<head>
|
||||
|
||||
<?php
|
||||
//----------------------------
|
||||
//Global General $_GET variables
|
||||
//----------------------------
|
||||
//Detection Override
|
||||
if ($_GET["version"]) { $app_version=$_GET["version"]; $_SESSION["app_version"]=$_GET["version"]; }
|
||||
|
||||
if ($_GET["numpg"]) {$_SESSION["items_per_page"]=$_GET["numpg"]; }
|
||||
if ($_SESSION["items_per_page"]) {$items_per_page = $_SESSION["items_per_page"];} else {$items_per_page="10";}//Default Num per Page is 10
|
||||
|
||||
if ($_GET["category"]) { $_SESSION["category"] = $_GET["category"]; }
|
||||
if ($_SESSION["category"]) {$category = $_SESSION["category"];}
|
||||
if ($category=="All") {$category="";}
|
||||
|
||||
|
||||
if (!$_GET["pageid"]) {$pageid="1"; } else { $pageid = $_GET["pageid"]; } //Default PageID is 1
|
||||
$type="T"; //Default Type is T
|
||||
|
||||
|
||||
unset($typename);
|
||||
$types = array("E"=>"Extensions","T"=>"Themes","U"=>"Updates");
|
||||
$typename = $types["$type"];
|
||||
|
||||
|
||||
//RSS Autodiscovery Link
|
||||
switch ($_SESSION["category"]) {
|
||||
case "Newest":
|
||||
$rsslist = "newest";
|
||||
break;
|
||||
case "Popular":
|
||||
$rsslist = "popular";
|
||||
break;
|
||||
case "Top Rated":
|
||||
$rsslist = "rated";
|
||||
break;
|
||||
}
|
||||
|
||||
$rssfeed = "rss/?application=" . $application . "&type=" . $type . "&list=" . $rsslist;
|
||||
|
||||
if (!$category) {$categoryname = "All $typename"; } else {$categoryname = $category; }
|
||||
?>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Language" content="en">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<TITLE>Mozilla Update :: Themes - List - <?php echo"$categoryname"; if ($pageid) {echo" - Page $pageid"; } ?></TITLE>
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
<?php
|
||||
if ($rsslist) {
|
||||
echo"<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"http://$_SERVER[HTTP_HOST]/$rssfeed\">";
|
||||
}
|
||||
?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?php
|
||||
include"$page_header";
|
||||
|
||||
// -----------------------------------------------
|
||||
// Begin Content of the Page Here
|
||||
// -----------------------------------------------
|
||||
|
||||
include"inc_sidebar.php";
|
||||
|
||||
|
||||
|
||||
echo"<DIV id=\"content\">\n"; // Begin Content Area
|
||||
|
||||
//Query for List Creation
|
||||
$s = "0";
|
||||
$startpoint = ($pageid-1)*$items_per_page;
|
||||
if ($category=="Editors Pick" or $category=="Newest" or $category=="Popular" or $category=="Top Rated") {
|
||||
if ($category =="Editors Pick") {
|
||||
$editorpick="true";
|
||||
} else if ($category =="Newest") {
|
||||
$orderby = "TV.DateAdded DESC, `Name` ASC";
|
||||
} else if ($category =="Popular") {
|
||||
$orderby = "TM.TotalDownloads DESC, `Name` ASC";
|
||||
} else if ($category =="Top Rated") {
|
||||
$orderby = "TM.Rating DESC, `Name` ASC";
|
||||
}
|
||||
$catname = $category;
|
||||
$category = "%";
|
||||
}
|
||||
|
||||
if ($app_version=="0.10") {$app_version="0.95"; }
|
||||
$sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Description, TM.Rating, TM.TotalDownloads, TV.vID,
|
||||
SUBSTRING(MAX(CONCAT(LPAD(TV.Version, 6, '0'), TV.vID)), 7) AS MAXvID,
|
||||
MAX(TV.Version) AS Version,
|
||||
TA.AppName, TOS.OSName
|
||||
FROM `t_main` TM
|
||||
INNER JOIN t_version TV ON TM.ID = TV.ID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID ";
|
||||
if ($category && $category !=="%") { $sql .="INNER JOIN t_categoryxref TCX ON TM.ID = TCX.ID
|
||||
INNER JOIN t_categories TC ON TCX.CategoryID = TC.CategoryID "; }
|
||||
if ($editorpick=="true") { $sql .="INNER JOIN t_reviews TR ON TM.ID = TR.ID "; }
|
||||
$sql .="WHERE Type = '$type' AND AppName = '$application' AND `approved` = 'YES' ";
|
||||
if ($editorpick=="true") { $sql .="AND TR.Pick = 'YES' "; }
|
||||
if ($category && $category !=="%") {$sql .="AND CatName LIKE '$category' ";}
|
||||
if ($app_version) { $sql .=" AND TV.MinAppVer_int <= '".strtolower($app_version)."' AND TV.MaxAppVer_int >= '".strtolower($app_version)."' ";}
|
||||
|
||||
//MacOSX Specific override for All+Mac themes. Bug 252294
|
||||
if ($OS=="MacOSX") { $app_os = $OS; } else { $app_os = "ALL"; }
|
||||
|
||||
if ($OS) { $sql .=" AND (TOS.OSName = '$OS' OR TOS.OSName = '$app_os') "; }
|
||||
$sql .="GROUP BY `Name` ";
|
||||
if ($orderby) {
|
||||
$sql .="ORDER BY $orderby";
|
||||
} else {
|
||||
$sql .="ORDER BY `Name` , `Version` DESC ";
|
||||
}
|
||||
$resultsquery = $sql;
|
||||
unset($sql);
|
||||
|
||||
//Get Total Results from Result Query & Populate Page Control Vars.
|
||||
$sql_result = mysql_query($resultsquery, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$totalresults = mysql_num_rows($sql_result);
|
||||
|
||||
$num_pages = ceil($totalresults/$items_per_page); //Total # of Pages
|
||||
if ($pageid>$num_pages) {$pageid=$num_pages;} //Check PageId for Validity
|
||||
$startpoint = ($pageid-1)*$items_per_page;
|
||||
if ($startpoint<0) {$startpoint=0; $startitem=0;}
|
||||
$startitem = $startpoint+1;
|
||||
$enditem = $startpoint+$items_per_page;
|
||||
if ($totalresults=="0") {$startitem = "0"; }
|
||||
if ($enditem>$totalresults) {$enditem=$totalresults;} //Verify EndItem
|
||||
|
||||
|
||||
if ($_GET[nextnum]) {$startpoint = $_GET["nextnum"]; }
|
||||
//$resultsquery = str_replace("GROUP BY `Name` ", "", $resultsquery);
|
||||
$resultsquery .= " LIMIT $startpoint , $items_per_page"; //Append LIMIT clause to result query
|
||||
|
||||
if ($category=="%") {$category = $catname; unset($catname); }
|
||||
|
||||
//Now Showing Box
|
||||
echo"<DIV id=\"listnav\">";
|
||||
if (!$OS) {$OS="all";}
|
||||
if (!$category) {$categoryname="All"; } else {$categoryname = $category;}
|
||||
echo"<DIV class=\"pagenum\" "; if ($application!="mozilla") {echo" style=\"margin-right: 58%;\""; } echo">";
|
||||
$previd=$pageid-1;
|
||||
if ($previd >"0") {
|
||||
echo"<a href=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$previd\">« Previous</A> • ";
|
||||
}
|
||||
echo"Page $pageid of $num_pages";
|
||||
|
||||
|
||||
$nextid=$pageid+1;
|
||||
if ($pageid <$num_pages) {
|
||||
echo" • <a href=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$nextid\">Next »</a>";
|
||||
}
|
||||
|
||||
echo"</DIV>\n";
|
||||
|
||||
echo"<SPAN class=\"listtitle\">".ucwords("$application $typename » $categoryname ")."</SPAN><br>";
|
||||
echo"".ucwords("$typename")." $startitem - $enditem of $totalresults";
|
||||
|
||||
|
||||
|
||||
// Modify List Form
|
||||
|
||||
echo"<DIV class=\"listform\">";
|
||||
echo"<FORM NAME=\"listviews\" METHOD=\"GET\" ACTION=\"showlist.php\">\n";
|
||||
echo"<input name=\"application\" type=\"hidden\" value=\"$application\">\n";
|
||||
//Items-Per-Page
|
||||
echo"Show/Page: ";
|
||||
$perpage = array("5","10","20","50");
|
||||
echo"<SELECT name=\"numpg\">";
|
||||
foreach ($perpage as $value) {
|
||||
echo"<OPTION value=\"$value\"";
|
||||
if ($items_per_page==$value) {echo" SELECTED"; }
|
||||
echo">$value</OPTION>";
|
||||
}
|
||||
echo"</SELECT>\n";
|
||||
|
||||
// Operating Systems
|
||||
echo" OS: ";
|
||||
echo"<SELECT name=\"os\">\n";
|
||||
$sql = "SELECT `OSName` FROM `t_os` ORDER BY `OSName`";
|
||||
$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)) {
|
||||
$osname = $row["OSName"];
|
||||
echo"<OPTION value=\"".strtolower($osname)."\"";
|
||||
if (strtolower($OS) == strtolower($osname)) {echo" SELECTED";}
|
||||
echo">$osname</OPTION>";
|
||||
}
|
||||
echo"</SELECT>\n";
|
||||
|
||||
|
||||
//Versions of Application
|
||||
echo"Versions: ";
|
||||
echo"<SELECT name=\"version\">";
|
||||
if ($application != "thunderbird") {echo"<OPTION value=\"auto-detect\">Auto-Detect</OPTION>";}
|
||||
$app_orig = $application; //Store original to protect against possible corruption
|
||||
$sql = "SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` WHERE `AppName` = '$application' ORDER BY `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC";
|
||||
$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)) {
|
||||
$version = $row["Version"];
|
||||
$subver = $row["SubVer"];
|
||||
$release = "$row[major].$row[minor]";
|
||||
if ($row["release"]) {$release = ".$release$row[release]";}
|
||||
if ($app_version=="0.95") {$app_version="0.10"; }
|
||||
//Firesomething Support
|
||||
if ($application=="firefox") { if ($release == "0.7") {$application="firebird";} else {$application="firefox";} }
|
||||
|
||||
if ($subver !=="final") {$release="$release$subver";}
|
||||
echo"<OPTION value=\"$release\"";
|
||||
if ($app_version == $release) {echo" SELECTED"; }
|
||||
echo">".ucwords($application)." $version</OPTION>";
|
||||
|
||||
if ($app_version=="0.10") {$app_version="0.95"; }
|
||||
}
|
||||
$application = $app_orig; unset($app_orig);
|
||||
|
||||
echo"</SELECT>\n";
|
||||
echo"<INPUT NAME=\"submit\" TYPE=\"SUBMIT\" VALUE=\"Update\">";
|
||||
echo"</FORM>";
|
||||
echo"</DIV>";
|
||||
|
||||
echo"</DIV>\n";
|
||||
|
||||
|
||||
//---------------------------------
|
||||
// Begin List
|
||||
//---------------------------------
|
||||
//Get Author Data and Create $authorarray and $authorids
|
||||
$sql = "SELECT TM.Name, TU.UserName, TU.UserID, TU.UserEmail FROM `t_main` TM
|
||||
LEFT JOIN t_authorxref TAX ON TM.ID = TAX.ID
|
||||
INNER JOIN t_userprofiles TU ON TAX.UserID = TU.UserID
|
||||
ORDER BY `Type` , `Name` ASC "; // TM.Type = 'E'
|
||||
$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)) {
|
||||
$authorarray[$row[Name]][] = $row["UserName"];
|
||||
$authorids[$row[UserName]] = $row["UserID"];
|
||||
}
|
||||
|
||||
//Assemble a display application version array
|
||||
$sql = "SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` WHERE `AppName`='$application' ORDER BY `major`,`minor`";
|
||||
$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)) {
|
||||
$version = $row["Version"];
|
||||
$subver = $row["SubVer"];
|
||||
$release = "$row[major].$row[minor]";
|
||||
if ($row["release"]) {$release = ".$release$row[release]";}
|
||||
if ($subver !=="final") {$release="$release$subver";}
|
||||
|
||||
$appvernames[$release] = $version;
|
||||
}
|
||||
|
||||
//Query to Generate List..
|
||||
$sql = "$resultsquery";
|
||||
$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"];
|
||||
$name = $row["Name"];
|
||||
$dateadded = $row["DateAdded"];
|
||||
$dateupdated = $row["DateUpdated"];
|
||||
$homepage = $row["Homepage"];
|
||||
$description = $row["Description"];
|
||||
$rating = $row["Rating"];
|
||||
$authors = $authorarray[$name];
|
||||
$osname = $row["OSName"];
|
||||
$appname = $row["AppName"];
|
||||
$downloadcount = $row["TotalDownloads"];
|
||||
|
||||
//Get Version Record for Referenced MAXvID from list query
|
||||
//$sql2 = "SELECT TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.DateAdded AS VerDateAdded, TV.DateUpdated AS VerDateUpdated, TV.URI, TV.Notes, TP.PreviewURI FROM `t_version` TV
|
||||
//LEFT JOIN t_previews TP ON TV.vID = TP.vID
|
||||
//WHERE TV.vID = '$row[MAXvID]' LIMIT 1";
|
||||
|
||||
$sql2 = "SELECT TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.DateAdded AS VerDateAdded, TV.DateUpdated AS VerDateUpdated, TV.URI, TV.Notes, TP.PreviewURI FROM `t_version` TV
|
||||
LEFT JOIN t_previews TP ON TV.vID = TP.vID
|
||||
INNER JOIN t_applications TA ON TV.AppID = TA.AppID
|
||||
INNER JOIN t_os TOS ON TV.OSID = TOS.OSID
|
||||
WHERE TV.ID = '$id' AND TV.Version = '$row[Version]' AND TA.AppName = '$appname' AND TOS.OSName = '$osname' LIMIT 1";
|
||||
$sql_result2 = mysql_query($sql2, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
||||
$row = mysql_fetch_array($sql_result2);
|
||||
|
||||
$vid = $row["vID"];
|
||||
if ($appvernames[$row["MinAppVer"]]) {$minappver = $appvernames[$row["MinAppVer"]]; } else { $minappver = $row["MinAppVer"]; }
|
||||
if ($appvernames[$row["MaxAppVer"]]) {$maxappver = $appvernames[$row["MaxAppVer"]]; } else { $maxappver = $row["MaxAppVer"]; }
|
||||
$VerDateAdded = $row["VerDateAdded"];
|
||||
$VerDateUpdated = $row["VerDateUpdated"];
|
||||
$filesize = $row["Size"];
|
||||
$notes = $row["Notes"];
|
||||
$version = $row["Version"];
|
||||
$uri = $row["URI"];
|
||||
$previewuri = $row["PreviewURI"];
|
||||
|
||||
|
||||
if ($VerDateAdded > $dateadded) {$dateadded = $VerDateAdded; }
|
||||
if ($VerDateUpdated > $dateupdated) {$dateupdated = $VerDateUpdated; }
|
||||
|
||||
//Turn Authors Array into readable string...
|
||||
$authorcount = count($authors);
|
||||
foreach ($authors as $author) {
|
||||
$userid = $authorids[$author];
|
||||
$n++;
|
||||
$authorstring .= "<A HREF=\"authorprofiles.php?application=$application&id=$userid\">$author</A>";
|
||||
if ($authorcount != $n) {$authorstring .=", "; }
|
||||
|
||||
}
|
||||
$authors = $authorstring;
|
||||
unset($authorstring, $n); // Clear used Vars..
|
||||
|
||||
//Create Customizeable Timestamp
|
||||
$day=substr($dateupdated,8,2); //get the day
|
||||
$month=substr($dateupdated,5,2); //get the month
|
||||
$year=substr($dateupdated,0,4); //get the year
|
||||
$hour=substr($dateupdated,11,2); //get the hour
|
||||
$minute=substr($dateupdated,14,2); //get the minute
|
||||
$second=substr($dateupdated,17,2); //get the sec
|
||||
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
|
||||
$dateupdated = gmdate("F d, Y g:i:sa", $timestamp); //gmdate("F d, Y g:i:sa T", $timestamp);
|
||||
|
||||
|
||||
echo"<DIV class=\"item\">\n";
|
||||
//echo"<DIV style=\"height: 100px\">"; //Not sure why this is here, it caused text to flood out of the box though.
|
||||
|
||||
if ($previewuri) {
|
||||
list($width, $height, $imagetype, $attr) = getimagesize("$websitepath"."$previewuri");
|
||||
|
||||
echo"<IMG SRC=\"$previewuri\" BORDER=0 HEIGHT=$height WIDTH=$width STYLE=\"float: right; padding-right: 5px\" ALT=\"$name preview\">";
|
||||
}
|
||||
|
||||
//Upper-Right Side Box
|
||||
echo"<DIV class=\"liststars\" title=\"$rating of 5 stars\" style=\"font-size: 8pt\"><A HREF=\"moreinfo.php?application=$application&id=$id&page=comments\">";
|
||||
for ($i = 1; $i <= floor($rating); $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/star_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
if ($rating>floor($rating)) {
|
||||
$val = ($rating-floor($rating))*10;
|
||||
echo"<IMG SRC=\"/images/stars/star_0$val.png\" BORDER=0 ALT=\"\">";
|
||||
$i++;
|
||||
}
|
||||
for ($i = $i; $i <= 5; $i++) {
|
||||
echo"<IMG SRC=\"/images/stars/graystar_icon.png\" BORDER=0 ALT=\""; if ($i==1) {echo"$rating of 5 stars";} echo"\">";
|
||||
}
|
||||
echo"</A></DIV>\n";
|
||||
|
||||
|
||||
echo"<DIV class=\"itemtitle\">";
|
||||
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid\">$name $version</A></SPAN><BR>";
|
||||
echo"<SPAN class=\"authorline\">By $authors</SPAN><br>";
|
||||
echo"</DIV>";
|
||||
|
||||
//Description & Version Notes
|
||||
echo"<SPAN class=\"itemdescription\">";
|
||||
echo"$description<BR>";
|
||||
if ($notes) {echo"$notes"; }
|
||||
echo"</SPAN>\n";
|
||||
echo"<BR>";
|
||||
//echo"</DIV>";
|
||||
|
||||
//Icon Bar Modules
|
||||
echo"<DIV style=\"height: 34px\">";
|
||||
echo"<DIV class=\"iconbar\" style=\"width: 104px;\">";
|
||||
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"moreinfo.php?application=$application&id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
|
||||
} else {
|
||||
//Make Theme Install work again, Bug 246754
|
||||
//echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'install.php?id=$id&vid=$vid','$name'))\">";
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name $version'))\">";
|
||||
echo"<IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"Install $name\" ALT=\"\">Install</A>";
|
||||
}
|
||||
echo"<BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
|
||||
if ($homepage) {echo"<DIV class=\"iconbar\" style=\"width: 98px;\"><A HREF=\"$homepage\"><IMG SRC=\"/images/home.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" TITLE=\"$name Homepage\" ALT=\"\">Homepage</A></DIV>";}
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"$appname\"> Works with:<BR> $minappver - $maxappver</DIV>";
|
||||
if ($osname !=="ALL") {
|
||||
echo"<DIV class=\"iconbar\" style=\"width: 85px;\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float: left\" ALT=\"\">OS:<BR>$osname</DIV>";
|
||||
}
|
||||
echo"</DIV>";
|
||||
|
||||
echo"<DIV class=\"baseline\">Updated: $dateupdated | Total Downloads: $downloadcount<BR></DIV>\n";
|
||||
echo"</DIV>\n";
|
||||
|
||||
} //End While Loop
|
||||
if ($totalresults=="0") {
|
||||
echo"<DIV class=\"item noitems\">\n";
|
||||
echo"No themes found in this category for ".ucwords($application).".\n";
|
||||
echo"</DIV>\n";
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$type="T";
|
||||
// Begin PHP Code for Dynamic Navbars
|
||||
if ($pageid <=$num_pages) {
|
||||
echo"<DIV id=\"listnav\">";
|
||||
|
||||
|
||||
echo"<DIV class=\"pagenum\">";
|
||||
$previd=$pageid-1;
|
||||
if ($previd >"0") {
|
||||
echo"<a href=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$previd\">« Previous</A> • ";
|
||||
}
|
||||
echo"Page $pageid of $num_pages";
|
||||
|
||||
|
||||
$nextid=$pageid+1;
|
||||
if ($pageid <$num_pages) {
|
||||
echo" • <a href=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$nextid\">Next »</a>";
|
||||
}
|
||||
echo"<BR>\n";
|
||||
|
||||
|
||||
//Skip to Page...
|
||||
if ($num_pages>1) {
|
||||
echo"Jump to: ";
|
||||
$pagesperpage=9; //Plus 1 by default..
|
||||
$i = 01;
|
||||
//Dynamic Starting Point
|
||||
if ($pageid>11) {
|
||||
$nextpage=$pageid-10;
|
||||
}
|
||||
$i=$nextpage;
|
||||
|
||||
//Dynamic Ending Point
|
||||
$maxpagesonpage=$pageid+$pagesperpage;
|
||||
//Page #s
|
||||
while ($i <= $maxpagesonpage && $i <= $num_pages) {
|
||||
|
||||
if ($i==$pageid) {
|
||||
echo"<SPAN style=\"color: #FF0000\">$i</SPAN> ";
|
||||
} else {
|
||||
echo"<A HREF=\"?application=$application&version=$app_version&category=$category&numpg=$items_per_page&pageid=$i\">$i</A> ";
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
echo"</DIV>\n";
|
||||
|
||||
echo"<SPAN class=\"listtitle\">".ucwords("$application $typename » $categoryname ")."</SPAN><br>";
|
||||
echo"".ucwords("$typename")." $startitem - $enditem of $totalresults";
|
||||
|
||||
echo"</DIV>\n";
|
||||
}
|
||||
|
||||
echo"</DIV>\n"; //End Content
|
||||
?>
|
||||
<?php
|
||||
include"$page_footer";
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
270
mozilla/webtools/update/update/VersionCheck.php
Normal file
@@ -0,0 +1,270 @@
|
||||
<?php
|
||||
/* -*- Mode: php; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** 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 the Extension Update Service.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Vladimir Vukicevic.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2004
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vladimir Vukicevic <vladimir@pobox.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 ***** */
|
||||
|
||||
/// config bits:
|
||||
$db_server = "localhost";
|
||||
$db_user = "";
|
||||
$db_pass = "";
|
||||
$db_name = "";
|
||||
|
||||
// map the mysql t_main.type enum into the right type
|
||||
$ext_typemap = array('T' => 'theme',
|
||||
'E' => 'extension',
|
||||
'P' => 'plugin');
|
||||
|
||||
header("Content-type: text/rdf");
|
||||
|
||||
// error handling
|
||||
function bail ($errstr) {
|
||||
die("Error: " . $errstr);
|
||||
}
|
||||
|
||||
|
||||
// major.minor.release.build[+]
|
||||
// make sure this is a valid version
|
||||
function expandversion ($vstr) {
|
||||
$v = explode('.', $vstr);
|
||||
|
||||
if ($vstr == '' || count($v) == 0 || count($v) > 4) {
|
||||
bail ('Bogus version.');
|
||||
}
|
||||
|
||||
$vlen = count($v);
|
||||
$ret = array();
|
||||
$hasplus = 0;
|
||||
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
if ($i > $vlen-1) {
|
||||
// this version chunk was not specified; give 0
|
||||
$ret[] = 0;
|
||||
} else {
|
||||
$s = $v[$i];
|
||||
if ($i == 3) {
|
||||
// need to check for +
|
||||
$slen = strlen($s);
|
||||
if ($s{$slen-1} == '+') {
|
||||
$s = substr($s, 0, $slen-1);
|
||||
$hasplus = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$ret[] = intval($s);
|
||||
}
|
||||
}
|
||||
|
||||
$ret[] = $hasplus;
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function vercmp ($a, $b) {
|
||||
if ($a == $b)
|
||||
return 0;
|
||||
|
||||
$va = expandversion($a);
|
||||
$vb = expandversion($b);
|
||||
|
||||
for ($i = 0; $i < 5; $i++)
|
||||
if ($va[$i] != $vb[$i])
|
||||
return ($vb[$i] - $va[$i]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// These are passed in the GET string
|
||||
//
|
||||
|
||||
if (!array_key_exists('reqVersion', $_GET))
|
||||
bail ("Invalid request.");
|
||||
|
||||
$reqVersion = $_GET['reqVersion'];
|
||||
|
||||
if ($reqVersion == 1) {
|
||||
|
||||
if (!array_key_exists('id', $_GET) ||
|
||||
!array_key_exists('version', $_GET) ||
|
||||
!array_key_exists('maxAppVersion', $_GET) ||
|
||||
!array_key_exists('appID', $_GET) ||
|
||||
!array_key_exists('appVersion', $_GET))
|
||||
bail ("Invalid request.");
|
||||
|
||||
$reqItemGuid = $_GET['id'];
|
||||
$reqItemVersion = $_GET['version'];
|
||||
$reqItemMaxAppVersion = $_GET['maxAppVersion'];
|
||||
$reqTargetAppGuid = $_GET['appID'];
|
||||
$reqTargetAppVersion = $_GET['appVersion'];
|
||||
} else {
|
||||
// bail
|
||||
bail ("Bad request version received");
|
||||
}
|
||||
|
||||
// check args
|
||||
if (empty($reqItemGuid) || empty($reqItemVersion) || empty($reqTargetAppGuid)) {
|
||||
bail ("Invalid request.");
|
||||
}
|
||||
|
||||
// XXX PUT VALUES IN
|
||||
mysql_connect($db_server, $db_user, $db_pass)
|
||||
|| bail ("Failed to connect to database.");
|
||||
|
||||
mysql_select_db ($db_name)
|
||||
|| bail ("Failed to select database.");
|
||||
|
||||
// We need to fetch two things for the database:
|
||||
// 1) The current extension version's info, for a possibly updated max version
|
||||
// 2) The latest version available, if different from the above.
|
||||
//
|
||||
// We know:
|
||||
// - $reqItemGuid
|
||||
// - $reqItemVersion
|
||||
// - $reqTargetAppGuid
|
||||
// - $reqTargetAppVersion
|
||||
//
|
||||
// We need to get:
|
||||
// - extension GUID
|
||||
// - extension version
|
||||
// - extension xpi link
|
||||
// - app ID
|
||||
// - app min version
|
||||
// - app max version
|
||||
|
||||
$query = "SELECT t_main.guid AS extguid,
|
||||
t_main.type AS exttype,
|
||||
t_version.version AS extversion,
|
||||
t_version.uri AS exturi,
|
||||
t_version.minappver AS appminver,
|
||||
t_version.maxappver AS appmaxver,
|
||||
t_applications.guid AS appguid
|
||||
FROM t_main, t_version, t_applications
|
||||
WHERE t_main.guid = '" . mysql_real_escape_string($reqItemGuid) . "' AND
|
||||
t_main.id = t_version.id AND
|
||||
t_version.appid = t_applications.appid AND
|
||||
t_version.approved = 'YES' AND
|
||||
t_applications.guid = '" . mysql_real_escape_string($reqTargetAppGuid) . "'";
|
||||
|
||||
$result = mysql_query ($query);
|
||||
|
||||
if (!$result) {
|
||||
bail ('Query error: ' . mysql_error());
|
||||
}
|
||||
|
||||
// info for this version
|
||||
$thisVersionData = '';
|
||||
// info for highest version
|
||||
$highestVersion = '';
|
||||
$highestVersionData = '';
|
||||
|
||||
$itemType = '';
|
||||
|
||||
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
|
||||
if (empty($itemType)) {
|
||||
$itemType = $ext_typemap[$line['exttype']];
|
||||
}
|
||||
|
||||
// is this row for the current version?
|
||||
if ($line['extversion'] == $reqItemVersion) {
|
||||
$thisVersionData = $line;
|
||||
} else if (vercmp ($reqItemVersion, $line['extversion']) > 0) {
|
||||
// did we already see an update with a higher version than this?
|
||||
if ($highestVersion != '' && vercmp ($highestVersion, $line['extversion']) < 0)
|
||||
continue;
|
||||
|
||||
// does this update support my current app version?
|
||||
if (vercmp($line['appmaxver'], $reqTargetAppVersion) > 0 ||
|
||||
vercmp($reqTargetAppVersion, $line['appminver']) > 0)
|
||||
continue;
|
||||
|
||||
$highestVersion = $line['extversion'];
|
||||
$highestVersionData = $line;
|
||||
}
|
||||
}
|
||||
|
||||
mysql_free_result ($result);
|
||||
|
||||
//
|
||||
// Now to spit out the RDF. We hand-generate because the data is pretty simple.
|
||||
//
|
||||
|
||||
print "<?xml version=\"1.0\"?>\n";
|
||||
print "<RDF:RDF xmlns:RDF=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:em=\"http://www.mozilla.org/2004/em-rdf#\">\n\n";
|
||||
|
||||
print "<RDF:Description about=\"urn:mozilla:{$itemType}:{$reqItemGuid}\">\n";
|
||||
|
||||
// output list of updates (just highest and this)
|
||||
print " <em:updates><RDF:Seq>\n";
|
||||
if (!empty($thisVersionData))
|
||||
print " <RDF:li resource=\"urn:mozilla:{$itemType}:{$reqItemGuid}:{$thisVersionData['extversion']}\"/>\n";
|
||||
if (!empty($highestVersionData))
|
||||
print " <RDF:li resource=\"urn:mozilla:{$itemType}:{$reqItemGuid}:{$highestVersionData['extversion']}\"/>\n";
|
||||
print " </RDF:Seq></em:updates>\n";
|
||||
|
||||
// output compat bits for firefox 0.9
|
||||
if (!empty($highestVersionData)) {
|
||||
print " <em:version>{$highestVersionData['extversion']}</em:version>\n";
|
||||
print " <em:updateLink>{$highestVersionData['exturi']}</em:updateLink>\n";
|
||||
}
|
||||
|
||||
print "</RDF:Description>\n\n";
|
||||
|
||||
function print_update ($data) {
|
||||
global $ext_typemap;
|
||||
$dataItemType = $ext_typemap[$data['exttype']];
|
||||
print "<RDF:Description about=\"urn:mozilla:{$dataItemType}:{$data['extguid']}:{$data['extversion']}\">\n";
|
||||
print " <em:version>{$data['extversion']}</em:version>\n";
|
||||
print " <em:targetApplication>\n";
|
||||
print " <RDF:Description>\n";
|
||||
print " <em:id>{$data['appguid']}</em:id>\n";
|
||||
print " <em:minVersion>{$data['appminver']}</em:minVersion>\n";
|
||||
print " <em:maxVersion>{$data['appmaxver']}</em:maxVersion>\n";
|
||||
print " <em:updateLink>{$data['exturi']}</em:updateLink>\n";
|
||||
print " </RDF:Description>\n";
|
||||
print " </em:targetApplication>\n";
|
||||
print "</RDF:Description>\n";
|
||||
}
|
||||
|
||||
if (!empty($thisVersionData))
|
||||
print_update ($thisVersionData);
|
||||
if (!empty($highestVersionData))
|
||||
print_update ($highestVersionData);
|
||||
|
||||
print "</RDF:RDF>\n";
|
||||
|
||||
?>
|
||||
|
||||