Bug 247409 Developer Comments. Bug 247144 Make Comments/Ratings Not Suck. 256485, More-Info should filter and not use vID. Bug 258307 URLs need to maintain vars w/o using sessions. Bug 258580. Bug 260880. and Bug 266207, Browser Detection Sucks.

This commit is contained in:
psychoticwolf%carolina.rr.com 2004-11-24 08:24:07 +00:00
Родитель ff064132cb
Коммит 51dc23feed
22 изменённых файлов: 1755 добавлений и 671 удалений

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

@ -0,0 +1,105 @@
<?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";
//Check and see if the CommentID/ID is valid.
$sql = "SELECT `ID`, `CommentID` FROM `t_feedback` WHERE `ID` = '".escape_string($_GET[id])."' AND `CommentID`='".escape_string($_GET["commentid"])."' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_ERROR);
if(mysql_num_rows($sql_result)=="0") {
unset($_GET["id"],$_GET["commentid"],$id,$commentid);
} else {
$id = escape_string($_GET["id"]);
$commentid = escape_string($_GET["commentid"]);
}
//Make Sure action is as expected.
if ($_GET["action"]=="yes") {
$action="yes";
} else if ($_GET["action"]=="no") {
$action="no";
}
if (!$commentid or !$action ) {
//No CommentID / Invalid Action --> Error.
page_error("4","No Comment ID or Action is Invalid");
exit;
}
//Get Data for the Comment Record as it stands.
$sql = "SELECT `helpful-yes`,`helpful-no`,`helpful-rating` FROM `t_feedback` WHERE `CommentID` = '$commentid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_ERROR);
$row = mysql_fetch_array($sql_result);
$helpful_yes = $row["helpful-yes"];
$helpful_no = $row["helpful-no"];
$helpful_rating = $row["helpful-rating"];
if ($action=="yes") {
$helpful_yes = $helpful_yes+1;
} else if ($action=="no") {
$helpful_no = $helpful_no+1;
}
//Recompute the Helpful Rating for this Comment
$total = $helpful_yes+$helpful_no;
if ($total=="0") {
$helpful_rating=0;
} else {
if ($helpful_yes>$helpful_no) {
$helpful_rating = ($helpful_yes/$total)*100;
} else {
$helpful_rating = ($helpful_no/$total)*-100;
}
}
$sql = "UPDATE `t_feedback` SET `helpful-yes`='$helpful_yes',`helpful-no`='$helpful_no',`helpful-rating`='$helpful_rating' WHERE `CommentID`='$commentid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if ($_GET["type"]=="E") {
$type="extensions";
} else if ($_GET["type"]=="T") {
$type="themes";
}
$return_path="$type/moreinfo.php?id=$id&vid=$vid&".uriparams()."&page=comments&pageid=$_GET[pageid]#$commentid";
header("Location: http://$sitehostname/$return_path");
exit;
?>

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

@ -44,9 +44,9 @@
include"dbconfig.php"; // Include Database Server Configuration File
// General Website Configuration Variables
$websitepath = "/opt/update-beta/"; // Local Path to Site Files
$repositorypath = "/opt/update-beta/files/"; //Path to XPI/JAR Respository
$sitehostname = "update-beta.mozilla.org"; // DNS Hostname
$websitepath = "D:/Websites/update/mozilla/webtools/update"; // Local Path to Site Files
$repositorypath = "D:/Websites/update/mozilla/webtools/update/files/"; //Path to XPI/JAR Respository
$sitehostname = "mozillaupdate.psychoticwolf.net"; // DNS Hostname
$ftpurl = "http://ftp.mozilla.org/pub/mozilla.org"; // URL to FTP site
// Page Header and Footer Path Variables
@ -61,8 +61,9 @@ function getmicrotime() {
$time_start = getmicrotime();
// Update Core Include Files
include"inc_guids.php"; // GUID Handler
include"inc_global.php"; // Global Functions
include"sessionconfig.php"; //Start Session
include"inc_guids.php"; // GUID --> AppName Handler
include"inc_global.php"; // Global Functions - Variable Cleanup
include"inc_browserdetection.php"; //Browser Detection - App Variable Handling
//include"sessionconfig.php"; //Start Session
?>

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

@ -45,11 +45,48 @@
//$_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+";
//$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20041001 Firefox/0.10.1";
if ($_GET["version"]=="auto-detect") {$_GET["version"]="";}//Clear Version For AutoDetect
//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;
}
$application = $_GET["application"];
$app_version = $_GET["version"];
$OS = $_GET["os"];
//print("$application, $app_version, $OS<br>\n");
include"browser_detection.php"; //Script that defines the browser_detection() function
$OS = browser_detection('os');
$moz_array = browser_detection('moz_version');
if (!$OS) {$OS = browser_detection('os');}
if (!$application or !$app_version) {$moz_array = browser_detection('moz_version');}
//Turn $OS into something usable.
if ( $moz_array[0] !== '' )
@ -79,10 +116,14 @@ if ( $moz_array[0] !== '' )
}
//Print what it's found, debug item.
//echo ( 'Your Mozilla product is ' . $moz_array[0] . ' ' . $moz_array[1] . ' running on '. $OS . ' ');
//echo ( 'Your Mozilla product is ' . $moz_array[0] . ' ' . $moz_array[1] . ' running on '. $OS . '<br>');
if (!$application) {$application = $moz_array[0];}
if (!$app_version) {$app_version = $moz_array[1];}
//If the applicatin is user-defined and not the same as what was detected, ignore the detected version and use the user-defined.
if ($_GET["application"] and $_GET[application] !==$moz_array[0]) {$app_version = $_GET["version"]; }
$application = $moz_array[0];
$app_version = $moz_array[1];
} else {
//If it's not a Mozilla product, then return nothing and let the default app code work..
@ -92,42 +133,50 @@ $app_version = $moz_array[1];
//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";}
//Get Max Version for Application Specified
if (!$app_version) {
$sql = "SELECT `major`,`minor`,`release`,`SubVer` FROM `t_applications` WHERE `AppName` = '$application' ORDER BY `major` DESC, `minor` DESC, `release` DESC, `SubVer` DESC LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
$release = "$row[major].$row[minor]";
if ($row["release"]) {
$release .= ".$row[release]";
}
$subver = $row["SubVer"];
if ($subver !=="final") {
$release .="$subver";
}
$app_version = $release;
unset($release, $subver);
}
//Check for Internal Versioning for the $app_version
$sql = "SELECT `int_version`,`major`,`minor`,`release`,`SubVer` FROM `t_applications` WHERE `AppName`='$application' AND `int_version` IS NOT NULL 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)) {
$release = "$row[major].$row[minor]";
if ($row["release"]) {
$release .= ".$row[release]";
}
$subver = $row["SubVer"];
if ($subver !=="final") {
$release .="$subver";
}
//echo"$release = $app_version ($row[int_version])<br>\n"; //Debug int-version replace
if (strtolower($release)==strtolower($app_version) and $row["int_version"]) {
$app_version=$row["int_version"];
break;
}
//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; }
?>
}
//So, at this point we gracefully leave, feeling happy and sending 3 variables on.
//$application
//$app_version
//$OS
?>

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

@ -54,6 +54,14 @@
<?php
//if ($_SESSION["debug"]=="true") {
//print(session_id());
//echo"<PRE>";print_r($_SESSION); echo"</PRE><Br>\n";
//echo"Current application data: $application - $app_version - $OS ";
//}
return;
//Site Timer Counter :: Debug-Mode Item Only

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

@ -96,22 +96,25 @@ 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";
global $page_header, $page_footer;
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>
&nbsp;&nbsp;&nbsp;<A HREF=\"javascript:history.back()\">&#171;&#171; Go Back to Previous Page</A>";
echo"</SPAN></DIV>\n";
include"$page_footer";
exit;
echo"<TITLE>Mozilla Update :: Error</TITLE>\n";
echo"<LINK REL=\"STYLESHEET\" TYPE=\"text/css\" HREF=\"/core/update.css\">\n";
include"$page_header";
echo"<h1>Mozilla Update :: Error</h1>\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>
&nbsp;&nbsp;&nbsp;<A HREF=\"javascript:history.back()\">&#171;&#171; Go Back to Previous Page</A>";
echo"</SPAN>\n";
include"$page_footer";
echo"</body>\n</html>\n";
exit;
}
function writeFormKey()
@ -135,4 +138,24 @@ function checkFormKey()
}
return true;
}
// -----------------------------
// function uriparams() -- print all the present and valid URI variables.
// Usage: string uriparams()
// -----------------------------
function uriparams() {
global $app_version, $application, $items_per_page, $category, $OS;
$uriparams = "";
if ($application) { $uriparams .="application=$application"; }
if ($app_version) { $uriparams .="&version=$app_version"; }
if ($OS) { $uriparams .="&os=$OS"; }
if ($category) { $uriparams .="&category=$category"; }
if ($items_per_page) { $uriparams .="&numpg=$items_per_page"; }
return $uriparams;
}
?>

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

@ -69,13 +69,16 @@
<div>
<label for="q" title="Search update.mozilla.org">search update:</label>
<input type="hidden" name="cof" value="LW:174;LH:60;L:http://www.mozilla.org/images/mlogosm.gif;GIMP:#cc0000;T:black;ALC:#0000ff;GFNT:grey;LC:#990000;BGC:white;AH:center;VLC:purple;GL:0;GALT:#666633;AWFID:9262c37cefe23a86;">
<input type="hidden" name="domains" value="mozilla.org">
<input type="hidden" name="sitesearch" value="mozilla.org">
<input type="hidden" name="domains" value="update.mozilla.org">
<input type="hidden" name="sitesearch" value="update.mozilla.org">
<input type="text" id="q" name="q" accesskey="s" size="30">
<input type="submit" id="submit" value="Go">
</div>
</form>
</div>
Firefox: <a href="/extensions/?application=firefox">Extensions</a> <a href="/themes/?application=firefox">Themes</a> <a href="/searchplugins/">Search Plugins</a> |
Thunderbird: <a href="/extensions/?application=thunderbird">Extensions</a> <a href="/themes/?application=thunderbird">Themes</a> |
Mozilla Suite: <a href="/extensions/?application=mozilla">Extensions</a> <a href="/themes/?application=mozilla">Themes</a>
<!-- closes #header-->
<?php return; ?>

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

@ -38,54 +38,103 @@
//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;
//Check and see if the ID/vID is valid.
$sql = "SELECT TM.ID, TV.vID FROM `t_main` TM INNER JOIN `t_version` TV ON TM.ID=TV.ID WHERE TM.ID = '".escape_string($_POST[id])."' AND `vID`='".escape_string($_POST["vid"])."' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_ERROR);
if(mysql_num_rows($sql_result)=="0") {
unset($_POST["id"],$_POST["vid"],$id,$vid);
} else {
$id = escape_string($_POST["id"]);
$vid = escape_string($_POST["vid"]);
}
$name = escape_string(strip_tags($_POST["name"]));
$title = escape_string(strip_tags($_POST["title"]));
$rating = escape_string($_POST["rating"]);
$comments = nl2br(strip_tags(escape_string($_POST["comments"])));
$email = escape_string($_POST["email"]);
if (!$name) {
$name="Anonymous";
}
if (!$title) {
$title="No Title";
}
//Make Sure Rating is as expected.
if (is_numeric($rating) and $rating<=5 and $rating>=0) {
} else {
unset($rating);
}
if (!$rating or !$comments ) {
//No Rating or Comment Defined, throw an error.
page_error("3","Comment is Blank or Rating is Null.");
exit;
}
//Compile Info about What Version of the item this comment is about.
$sql = "SELECT TV.Version, `OSName`, `AppName` FROM `t_version` TV
INNER JOIN `t_os` TOS ON TOS.OSID=TV.OSID
INNER JOIN `t_applications` TA ON TA.AppID=TV.AppID
WHERE TV.ID = '$id' AND TV.vID='$vid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_ERROR);
$row = mysql_fetch_array($sql_result);
$version = $row["Version"];
$os = $row["OSName"];
$appname = $row["AppName"];
$versiontagline = "version $version for $appname";
if ($os !=="ALL") {$versiontagline .=" on $os"; }
//Check the Formkey against the DB, and see if this has already been posted...
$formkey = escape_string($_POST["formkey"]);
$date = date("Y-m-d H:i:s", mktime(0, 0, 0, date("m"), date("d")-1, date("Y")));
$sql = "SELECT `CommentID` FROM `t_feedback` WHERE `formkey` = '$formkey' AND `CommentDate`>='$date'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_ERROR);
if (mysql_num_rows($sql_result)=="0") {
//FormKey doesn't exist, go ahead and add their comment.
$sql = "INSERT INTO `t_feedback` (`ID`, `CommentName`, `CommentVote`, `CommentTitle`, `CommentNote`, `CommentDate`, `commentip`, `email`, `formkey`, `VersionTagline`) VALUES ('$id', '$name', '$rating', '$title', '$comments', NOW(NULL), '$_SERVER[REMOTE_ADDR]', '$email', '$formkey', '$versiontagline');";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
//Get Rating Data and Create $ratingarray
$date = date("Y-m-d H:i:s", mktime(0, 0, 0, date("m"), date("d")-30, date("Y")));
$sql = "SELECT ID, CommentVote FROM `t_feedback` WHERE `ID` = '$id' AND `CommentDate`>='$date' AND `CommentVote` IS NOT NULL";
$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
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="2.5"; //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[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"]);
if ($_POST["type"]=="E") {
$type="extensions";
} else if ($_POST["type"]=="T") {
$type="themes";
}
$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), '$_SERVER[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 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);
$return_path="extensions/moreinfo.php?id=$_POST[id]&vid=$_POST[vid]&page=comments&action=postsuccessfull";
header("Location: http://$_SERVER[HTTP_HOST]/$return_path");
$return_path="$type/moreinfo.php?id=$id&vid=$vid&page=comments&action=postsuccessfull";
header("Location: http://$sitehostname/$return_path");
exit;
?>

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

@ -0,0 +1,101 @@
<?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 *****
//Inappropriate Comment Reporting Tool
require"../core/config.php";
//Check and see if the CommentID/ID is valid.
$sql = "SELECT `ID`, `CommentID` FROM `t_feedback` WHERE `ID` = '".escape_string($_GET[id])."' AND `CommentID`='".escape_string($_GET["commentid"])."' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_ERROR);
if(mysql_num_rows($sql_result)=="0") {
unset($_GET["id"],$_GET["commentid"],$id,$commentid);
} else {
$id = escape_string($_GET["id"]);
$commentid = escape_string($_GET["commentid"]);
}
//Make Sure action is as expected.
if ($_GET["action"]=="report") {
$action="yes";
}
if (!$commentid or !$action ) {
//No CommentID / Invalid Action --> Error.
page_error("4","No Comment ID or Action is Invalid");
exit;
}
//Set Flag on the Comment Record
$sql = "UPDATE `t_feedback` SET `flag`='YES' WHERE `CommentID`='$commentid' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if ($_GET["type"]=="E") {
$type="extensions";
} else if ($_GET["type"]=="T") {
$type="themes";
}
$return_path="$type/moreinfo.php?id=$id&vid=$vid&".uriparams()."&page=comments&pageid=$_GET[pageid]#$commentid";
//header("Location: http://$sitehostname/$return_path");
//exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html lang="EN" dir="ltr">
<head>
<title>Mozilla Update :: Report a Comment</title>
</head>
<body>
<?php
include"$page_header";
?>
<h1>Mozilla Update :: Report a Comment Tool</h1>
You have sucessfully reported this comment to Mozilla Update staff.
A staff member will review your submission and take the appropriate action.<br>
Thank you for your assistance.<br><br>
To return to where you were browsing, <a href="/<?php echo"$return_path"; ?>">click this link</a>.
<?php
include"$page_footer";
?>
</body>
</html>

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

@ -0,0 +1,405 @@
<?php
require"core/sessionconfig.php";
require"../core/config.php";
$function = $_GET["function"];
//Kill access to flagged comments for users.
if ($_SESSION["level"] !=="admin" and $_SESSION["level"] !=="editor") {
if ($function=="flaggedcomments") {
unset($function);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<HTML>
<HEAD>
<TITLE>Mozilla Update :: Developer Control Panel :: Comments Manager</TITLE>
<?php
include"$page_header";
include"inc_sidebar.php";
?>
<?php
if (!$function) {
?>
<?php
if ($_POST["submit"]=="Flag Selected" or $_POST["submit"]=="Delete Selected") {
?>
<h1>Updating comments list, please wait...</h1>
<?php
//Process Post Data, Make Changes to User Table.
//Begin General Updating
for ($i=1; $i<=$_POST[maxid]; $i++) {
if (!$_POST["selected_$i"]) {
continue;
} else {
$selected = escape_string($_POST["selected_$i"]);
}
//Admins/Editors can delete from here. Regular Users Can't.
if ($_SESSION["level"] !=="admin" and $_SESSION["level"] !=="editor") {
if ($_POST["submit"]=="Delete Selected") {
$_POST["submit"]="Flag Selected";
}
}
if (checkFormKey()) {
if ($_POST["submit"]=="Delete Selected") {
$sql = "DELETE FROM `t_feedback` WHERE `CommentID`='$selected'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
if ($sql_result) {
echo"Comment $selected deleted from database.<br>\n";
}
} else if ($_POST["submit"]=="Flag Selected") {
$sql = "UPDATE `t_feedback` SET `flag`= 'YES' WHERE `CommentID`='$selected'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
if ($sql_result) {
echo"Comment $selected flagged for editor review.<br>\n";
}
}
}
}
unset($i);
echo"Your changes to the comment list have been succesfully completed<BR>\n";
}
?>
<?php
if ($_GET["numpg"]) {$items_per_page=$_GET["numpg"]; } else {$items_per_page="50";} //Default Num per Page is 50
if (!$_GET["pageid"]) {$pageid="1"; } else { $pageid = $_GET["pageid"]; } //Default PageID is 1
$startpoint = ($pageid-1)*$items_per_page;
$id = escape_string($_GET["id"]);
$sql = "SELECT `Name` FROM `t_main` WHERE `ID`='$id' 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);
$name = $row["Name"];
$sql = "SELECT CommentID FROM `t_feedback` WHERE ID = '$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$num_pages = ceil(mysql_num_rows($sql_result)/$items_per_page);
?>
<h1>Manage Comments for <?php echo"$name :: Page $pageid of $num_pages"; ?></h1>
<?php
//Flagged Comments Queue Link for Admins/Editors
if ($_SESSION["level"] =="admin" or $_SESSION["level"]=="editor") {
echo"<a href=\"?function=flaggedcomments\">View Flagged Comments Queue</a> | \n";
}
// Begin Code for Dynamic Navbars
if ($pageid <=$num_pages) {
$previd=$pageid-1;
if ($previd >"0") {
echo"<a href=\"?".uriparams()."&id=$id&page=$page&pageid=$previd\">&#171; Previous</A> &bull; ";
}
}
echo"Page $pageid of $num_pages";
$nextid=$pageid+1;
if ($pageid <$num_pages) {
echo" &bull; <a href=\"?".uriparams()."&id=$id&page=$page&pageid=$nextid\">Next &#187;</a>";
}
echo"<BR>\n";
?>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 ALIGN=CENTER STYLE="border: 0px; width: 100%">
<TR style="font-weight: bold">
<TH>Name/E-Mail</TH>
<TH>Date</TH>
<TH>Rating</TH>
<TH>Select</TH>
</TR>
<FORM NAME="updateusers" METHOD="POST" ACTION="?id=<?php echo"$id&pageid=$pageid&numpg=$items_per_page"; ?>&action=update">
<?writeFormKey();?>
<?php
$sql = "SELECT * FROM `t_feedback` WHERE `ID`='$id' ORDER BY `CommentDate`DESC LIMIT $startpoint,$items_per_page";
$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)) {
$commentid = $row["CommentID"];
$name = $row["CommentName"];
$email = $row["email"];
$title = $row["CommentTitle"];
$notes = $row["CommentNote"];
$helpful_yes = $row["helpful-yes"];
$helpful_no = $row["helpful-no"];
$helpful_total = $helpful_yes+$helpful_no;
$date = date("l, F j Y g:i:sa", strtotime($row["CommentDate"]));
$rating = $row["CommentVote"];
if (!$title) {$title = "No Title"; }
if (!$name) {$name = "Anonymous"; }
if ($rating==NULL) {$rating="N/A"; }
if ($row["flag"]=="YES") {$title .= " (flagged)"; }
$i++;
echo"<TR><TD COLSPAN=4><h2>$i.&nbsp;&nbsp;$title</h2></TD></TR>\n";
echo"<TR>\n";
echo"<TD COLSPAN=4>$notes";
if ($helpful_total>0) {echo" ($helpful_yes of $helpful_total found this comment helpful)"; }
echo"</TD>\n";
echo"</TR>\n";
echo"<TR>";
if ($email) {
echo"<TD>Posted by <A HREF=\"mailto:$email\">$name</A></TD>\n";
} else {
echo"<TD>Posted by $name</TD>\n";
}
echo"<TD NOWRAP>$date</TD>\n";
echo"<TD NOWRAP>Rated $rating of 5</TD>\n";
echo"<TD ALIGN=CENTER><INPUT NAME=\"selected_$i\" TYPE=\"CHECKBOX\" VALUE=\"$commentid\" TITLE=\"Selected User\"></TD>";
echo"</TR>\n";
}
echo"<INPUT NAME=\"maxid\" TYPE=\"HIDDEN\" VALUE=\"$i\">\n";
?>
<TR>
<TD COLSPAN=4>
<h3></h3>
Found a duplicate or inappropriate comment? To Flag comments for review by Mozilla Update Staff for review, select the comment and choose "Flag Selected".<BR>
</TD>
</TR>
<TR><TD COLSPAN=4 ALIGN=RIGHT>
<?php
if ($_SESSION["level"] =="admin" or $_SESSION["level"]=="editor") {
//This user is an Admin or Editor, show the delete button.
?>
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Delete Selected" ONCLICK="return confirm('Are you sure you want to delete all selected comments?');">
<?php
}
?>
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Flag Selected" ONCLICK="return confirm('Are you sure you want to flag all selected comments for editor review?');">
</TD>
<TD>
</TR>
</FORM>
</TABLE>
<h3></h3>
<?php
// Begin Code for Dynamic Navbars
if ($pageid <=$num_pages) {
$previd=$pageid-1;
if ($previd >"0") {
echo"<a href=\"?".uriparams()."&id=$id&page=$page&pageid=$previd\">&#171; Previous</A> &bull; ";
}
}
echo"Page $pageid of $num_pages";
$nextid=$pageid+1;
if ($pageid <$num_pages) {
echo" &bull; <a href=\"?".uriparams()."&id=$id&page=$page&pageid=$nextid\">Next &#187;</a>";
}
echo"<BR>\n";
//Skip to Page...
if ($num_pages>1) {
echo"Jump to Page: ";
$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>&nbsp;";
} else {
echo"<A HREF=\"?".uriparams()."&id=$id&page=$page&pageid=$i\">$i</A>&nbsp;";
}
$i++;
}
}
if ($num_pages>1) {
echo"<br>\nComments per page: \n";
$perpagearray = array("25","50","100");
foreach ($perpagearray as $items_per_page) {
echo"<A HREF=\"?".uriparams()."&id=$id&page=$page&pageid=1\">$items_per_page</A>&nbsp;";
}
}
?>
<?php
if ($_POST["submit"]=="Add Comment") {
echo"<a name=\"addcomment\"></a>\n";
echo"<h2>Submitting Comment, please wait...</h2>\n";
if (checkFormKey()) {
$id = escape_string($_POST["id"]);
$name = escape_string($_POST["name"]);
$title = escape_string($_POST["title"]);
$comments = escape_string($_POST["notes"]);
$sql = "INSERT INTO `t_feedback` (`ID`, `CommentName`, `CommentVote`, `CommentTitle`, `CommentNote`, `CommentDate`, `commentip`) VALUES ('$id', '$name', NULL, '$title', '$comments', NOW(NULL), '$_SERVER[REMOTE_ADDR]');";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if ($sql_result) {
echo"Your comment has been added successfully...<br>\n";
} else {
echo"There was a problem adding your comment, please try again.<br>\n";
}
}
}
?>
<h2>Add Comment with No Rating</h2>
Need to make a reply comment or answer a question somebody left who didn't provide an e-mail address? Use the form below. No rating is supplied and it will not affect your item's overall rating.
<form name="addcoment" method="post" action="?id=<?php echo"$id"; ?>&action=addcomment#addcomment">
<?writeFormKey();?>
<input name="id" type="hidden" value="<?php echo"$id"; ?>">
<input name="name" type="hidden" value="<?php echo"$_SESSION[name]"; ?>">
<strong>Title:</strong> <input name="title" type="text" size="30" maxlength="150" value=""><br>
<strong>Comment:</strong><br>
<textarea name="notes" rows=5 cols=50></textarea><br>
<input name="submit" type="submit" value="Add Comment"></SPAN>
</form>
</div>
<?php
} else if ($function=="flaggedcomments") {
?>
<?php
if ($_POST["submit"]=="Process Queue") {
echo"<h2>Processing Changes to the Flagged Comments List, please wait...</h2>\n";
for ($i=1; $i<=$_POST[maxid]; $i++) {
$action = $_POST["action_$i"];
$commentid = escape_string($_POST["selected_$i"]);
if ($action=="skip") {continue;}
if ($action=="delete") {
$sql = "DELETE FROM `t_feedback` WHERE `CommentID`='$commentid'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
if ($sql_result) {
echo"Comment $commentid deleted from database.<br>\n";
}
} else if ($action=="clear") {
$sql = "UPDATE `t_feedback` SET `flag`= '' WHERE `CommentID`='$commentid'";
$sql_result = mysql_query($sql, $connection) or trigger_error("<FONT COLOR=\"#FF0000\"><B>MySQL Error ".mysql_errno().": ".mysql_error()."</B></FONT>", E_USER_NOTICE);
if ($sql_result) {
echo"Flag cleared for comment $commentid.<br>\n";
}
}
}
}
unset($i);
?>
<h1>Comments Flagged for Editor Review</h1>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1 ALIGN=CENTER STYLE="border: 0px; width: 100%">
<?php
$sql = "SELECT `CommentID`,`CommentName`,`email`,`CommentTitle`,`CommentNote`,`CommentDate`,`CommentVote`,`commentip`, TM.Name FROM `t_feedback` INNER JOIN `t_main` TM ON t_feedback.ID=TM.ID WHERE `flag`='YES' ORDER BY `CommentDate`DESC";
$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);
if ($num_results>"0") {
?>
<TR style="font-weight: bold">
<TH>Name/E-Mail</TH>
<TH>Date</TH>
<TH>Rating</TH>
<TH>Select</TH>
</TR>
<FORM NAME="updateusers" METHOD="POST" ACTION="?function=flaggedcomments&action=update">
<?writeFormKey();?>
<?php
}
while ($row = mysql_fetch_array($sql_result)) {
$itemname = $row["Name"];
$commentid = $row["CommentID"];
$name = $row["CommentName"];
$email = $row["email"];
$title = $row["CommentTitle"];
$notes = $row["CommentNote"];
$date = date("l, F j Y g:i:sa", strtotime($row["CommentDate"]));
$rating = $row["CommentVote"];
$commentip = $row["commentip"];
if (!$title) {$title = "No Title"; }
if (!$name) {$name = "Anonymous"; }
if ($rating==NULL) {$rating="N/A"; }
$i++;
echo"<TR><TD COLSPAN=4><h2>$i.&nbsp;&nbsp;$itemname :: $title</h2></TD></TR>\n";
echo"<TR>\n";
echo"<TD COLSPAN=4>$notes";
if ($commentip) {echo"<BR>(Posted from IP: $commentip)"; }
echo"</TD>\n";
echo"</TR>\n";
echo"<TR>";
if ($email) {
echo"<TD>Posted by <A HREF=\"mailto:$email\">$name</A></TD>\n";
} else {
echo"<TD>Posted by $name</TD>\n";
}
echo"<TD NOWRAP>$date</TD>\n";
echo"<TD NOWRAP>Rated $rating of 5</TD>\n";
echo"<TD>&nbsp;<INPUT NAME=\"selected_$i\" TYPE=\"hidden\" VALUE=\"$commentid\"></TD>";
echo"</TR>\n";
echo"<TR>\n";
echo"<TD COLSPAN=4><input name=\"action_$i\" type=\"radio\" value=\"delete\"> Delete Comment <input name=\"action_$i\" type=\"radio\" value=\"clear\"> Clear Flag <input name=\"action_$i\" type=\"radio\" value=\"skip\" checked> No Action</TD>\n";
echo"</TR>\n";
}
if ($num_results>"0") {
echo"<INPUT NAME=\"maxid\" TYPE=\"HIDDEN\" VALUE=\"$i\">\n";
?>
<TR><TD COLSPAN=4 ALIGN=RIGHT>
<h3></h3>
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Process Queue">&nbsp;&nbsp;<INPUT name="reset" type="reset" value="Reset Form">
</TD>
<TD>
</TR>
<?php
} else {
echo"<TR><TD COLSPAN=4 align=center>No Comments are Currently Flagged for Editor Review</TD></TR>\n";
}
?>
</FORM>
</TABLE>
<?php
} else {}
?>
<?php
include"$page_footer";
?>
</BODY>
</HTML>

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

@ -14,6 +14,7 @@ if ($_SESSION["level"] == "user") {
<li><A HREF="listmanager.php?type=T">Themes list</A></li>
<li><A HREF="listmanager.php?type=E">Extensions list</A></li>
<li><A HREF="usermanager.php">Users Manager</A></li>
<li><a href="commentsmanger.php?function=flaggedcomments">Comments Manager</a></li>
<?php
} else {
?>
@ -25,6 +26,7 @@ if ($_SESSION["level"] == "user") {
<li><a href="appmanager.php">Application Manager</a></li>
<li><a href="categorymanager.php">Category Manager</A></li>
<li><a href="faqmanager.php">FAQ Manager</A></li>
<li><a href="commentsmanager.php?function=flaggedcomments">Comments Manager</a></li>
<?php } ?>
<li><a href="logout.php">Logout</A></li>
</ul>

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

@ -104,7 +104,13 @@ $sql2 = "SELECT TV.Version, AppName, MinAppVer, MaxAppVer FROM `t_version` TV
<BR>
<img src="/images/ratings.png" border=0 height=34 width=34 alt="" class="iconbar">Rated: <?php echo"$rating"; ?> of 5<BR>&nbsp;<br>
<BR>
<img src="/images/edit.png" border=0 height=34 width=34 alt="" class="iconbar">Comments: <?php echo"$num_comments"; ?><BR>&nbsp;<br>
<?php
$sql = "SELECT CommentID FROM `t_feedback` WHERE ID = '$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$num_comments = mysql_num_rows($sql_result);
?>
<img src="/images/edit.png" border=0 height=34 width=34 alt="" class="iconbar"><a href="commentsmanager.php?id=<?php echo"$id"; ?>">Comments: <?php echo"$num_comments"; ?></a><BR>&nbsp;<br>
<h2>Developer Comments</h2>
<?php

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

@ -139,7 +139,7 @@ $v++;
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
$dateupdated = gmdate("F d, Y g:i:sa", $timestamp); //gmdate("F d, Y", $dutimestamp);
echo"<h3><A HREF=\"moreinfo.php?id=$id\">$name</A></h3>";
echo"<h3><A HREF=\"moreinfo.php?".uriparams()."&id=$id\">$name</A></h3>";
echo"$description<br>\n";
}
}

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

@ -45,44 +45,43 @@ $typename = $types["$type"];
echo"<ul id=\"nav\">\n";
if (!$category AND $index !="yes") {echo"<SPAN CLASS=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=All\" TITLE=\"Show All ".ucwords($typename)." Alphabetically\"><strong>All Extensions</strong></A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=All\" TITLE=\"Show All ".ucwords($typename)." Alphabetically\"><strong>All Extensions</strong></A></li>\n";
if (!$category AND $index !="yes") {echo"</SPAN>"; }
// Object Categories
$sql = "SELECT `CatName`,`CatDesc` FROM `t_categories` WHERE `CatType` = '$type' ORDER BY `CatName`";
$sql = "SELECT `CatName`,`CatDesc` FROM `t_categories` WHERE `CatType` = '$type' and `CatApp` = '$application' 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=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\"><strong>$catname</strong></A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\"><strong>$catname</strong></A></li>\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=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\">Editor's Pick</A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\">Editor's Pick</A></li>\n";
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
$catname = "Popular";
$catdesc = ucwords($typename)." downloaded the most";
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\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=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
$catname = "Newest";
$catdesc = "Most recent ".ucwords($typename);
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
?>
</ul>

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

@ -61,47 +61,6 @@ $index="yes";
include"inc_sidebar.php";
?>
<div class="key-point">
<h2 style="margin: 0; font-size: 2px;"><img src="/images/t_featuring.gif" alt="Featuring: Firefox!"></h2>
<?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&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>
<div id="mBody">
<h3>What is an Extension?</h3>
<p>Extensions are small add-ons that add new functionality to <?php print(ucwords($application)); ?>.
@ -111,15 +70,15 @@ to download <?php } ?>.</p>
<?php
//Temporary!! Current Version Array Code
$currentver_array = array("firefox"=>"0.95", "thunderbird"=>"0.8", "mozilla"=>"1.7");
$currentver_display_array = array("firefox"=>"1.0 Preview Release", "thunderbird"=>"0.8", "mozilla"=>"1.7.x");
$currentver_array = array("firefox"=>"1.0", "thunderbird"=>"0.9", "mozilla"=>"1.7");
$currentver_display_array = array("firefox"=>"1.0", "thunderbird"=>"0.9", "mozilla"=>"1.7.x");
$currentver = $currentver_array[$application];
$currentver_display = $currentver_display_array[$application];
?>
<!-- Start News Columns -->
<div class="frontcolumn">
<a href="http://www.mozilla.org/news.rdf"><img src="../images/rss.png" width="28" height="16" class="rss" alt="Mozilla News in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?category=Newest" title="New Extensions on Mozilla Update">New Additions</a></h2>
<a href="http://www.mozilla.org/news.rdf"><img src="../images/rss.png" width="28" height="16" class="rss" alt="Mozilla News in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?application=<?php echo uriparams(); ?>&category=Newest" title="New Extensions on Mozilla Update">New Additions</a></h2>
<span class="newsSubline">New and Updated Extensions</span>
<ul class="news">
@ -146,7 +105,7 @@ WHERE `Type` = '$type' AND `AppName` = '$application' AND (`OSName` = '$_SESS
if ($lastname == $name) {$i--; continue; }
echo"<li>\n";
echo"<div class=\"date\">$dateadded</div>\n";
echo"<a href=\"moreinfo.php?id=$id&vid=$vid\">$name $version</a><BR>\n";
echo"<a href=\"moreinfo.php?".uriparams()."&id=$id\">$name $version</a><BR>\n";
echo"</li>\n";
$lastname = $name;
@ -156,7 +115,7 @@ if ($i >= "5") {break;}
</ul>
</div>
<div class="frontcolumn">
<a href="http://planet.mozilla.org/rss10.xml"><img src="../images/rss.png" width="28" height="16" class="rss" alt="Mozilla Weblogs in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?category=Popular" title="Most Popular Extensions, based on Downloads over the last week">Most Popular</a></h2>
<a href="http://planet.mozilla.org/rss10.xml"><img src="../images/rss.png" width="28" height="16" class="rss" alt="Mozilla Weblogs in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?<?php echo uriparams(); ?>&category=Popular" title="Most Popular Extensions, based on Downloads over the last week">Most Popular</a></h2>
<span class="newsSubline">Downloads over the last week</span>
<ul class="news">
@ -179,7 +138,7 @@ WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='
if ($lastname == $name) {$i--; continue; }
echo"<li>\n";
echo"<div class=\"date\">$i</div>\n";
echo"<a href=\"moreinfo.php?id=$id\">$name</a><br>\n";
echo"<a href=\"moreinfo.php?".uriparams()."&id=$id\">$name</a><br>\n";
echo"<span class=\"newsSubline\">($downloadcount downloads)</span>\n";
echo"</li>\n";
$lastname = $name;
@ -190,7 +149,7 @@ if ($i >= "5") {break;}
</div>
<div class="frontcolumn">
<a href="http://www.mozillazine.org/atom.xml"><img src="../images/rss.png" width="28" height="16" class="rss" alt="MozillaZine News in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?category=Top Rated" title="Highest Rated Extensions by the Community">Top Rated</a></h2>
<a href="http://www.mozillazine.org/atom.xml"><img src="../images/rss.png" width="28" height="16" class="rss" alt="MozillaZine News in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?<?php echo uriparams(); ?>&category=Top Rated" title="Highest Rated Extensions by the Community">Top Rated</a></h2>
<span class="newsSubline">Based on feedback from visitors</span>
<ul class="news">
@ -217,25 +176,10 @@ WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='
echo"<li>\n";
echo"<div class=\"date\">$rating stars</div>\n";
echo"<a href=\"moreinfo.php?id=$id\">$name</a>\n";
echo"<a href=\"moreinfo.php?".uriparams()."&id=$id\">$name</a>\n";
echo"</li>\n";
// Code for the OLD Graphical Star System.
//$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";
$usednames[$s] = $name;
$usedversions[$s] = $version;
if ($r >= "5") {break;}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -48,7 +48,7 @@ require"../core/config.php";
//Global General $_GET variables
//----------------------------
//Detection Override
if ($_GET["version"]) {$app_version=$_GET["version"]; $_SESSION["app_version"]=$_GET["version"];}
//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
@ -121,7 +121,7 @@ $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, TM.downloadcount, TV.vID,
SUBSTRING(MAX(CONCAT(LPAD(TV.Version, 6, '0'), TV.vID)), 7) AS MAXvID,
MAX(TV.Version) AS Version,
@ -189,15 +189,16 @@ echo"".ucwords("$typename")." $startitem - $enditem of $totalresults&nbsp;&nbsp;
$previd=$pageid-1;
if ($previd >"0") {
echo"<a href=\"?pageid=$previd\">&#171; Previous</A> &bull; ";
echo"<a href=\"?".uriparams()."&pageid=$previd\">&#171; Previous</A> &bull; ";
}
echo"Page $pageid of $num_pages";
$nextid=$pageid+1;
if ($pageid <$num_pages) {
echo" &bull; <a href=\"?pageid=$nextid\">Next &#187;</a>";
echo" &bull; <a href=\"?".uriparams()."&pageid=$nextid\">Next &#187;</a>";
}
echo"<br><br>\n";
@ -206,6 +207,7 @@ echo"<br><br>\n";
echo"<DIV class=\"key-point\">";
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");
@ -237,7 +239,7 @@ 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 = "SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` WHERE `AppName` = '$application' AND `public_ver` = 'YES' 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"];
@ -302,7 +304,7 @@ $sql = "$resultsquery";
$dateadded = $row["DateAdded"];
$dateupdated = $row["DateUpdated"];
$homepage = $row["Homepage"];
$description = $row["Description"];
$description = nl2br($row["Description"]);
$rating = $row["Rating"];
$authors = $authorarray[$name];
$osname = $row["OSName"];
@ -345,7 +347,7 @@ $authorcount = count($authors);
foreach ($authors as $author) {
$userid = $authorids[$author];
$n++;
$authorstring .= "<A HREF=\"authorprofiles.php?id=$userid\">$author</A>";
$authorstring .= "<A HREF=\"authorprofiles.php?".uriparams()."&id=$userid\">$author</A>";
if ($authorcount != $n) {$authorstring .=", "; }
}
@ -375,7 +377,7 @@ echo"<IMG SRC=\"$previewuri\" BORDER=0 HEIGHT=$height WIDTH=$width ALT=\"$name p
echo"</DIV>\n";
}
echo"<h5>";
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?id=$id&vid=$vid\">$name $version</A></SPAN><BR>";
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?".uriparams()."&id=$id\">$name $version</A></SPAN><BR>";
echo"<SPAN class=\"authorline\">By $authors</SPAN>";
echo"</h5>";
@ -388,7 +390,7 @@ echo"<BR>";
echo"<DIV style=\"margin-top: 30px; height: 34px\">";
echo"<DIV class=\"iconbar\">";
if ($appname=="Thunderbird") {
echo"<A HREF=\"moreinfo.php?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
echo"<A HREF=\"moreinfo.php?".uriparams()."&id=$id\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 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 TITLE=\"Install $name\" ALT=\"\">Install</A>";
}
@ -396,7 +398,7 @@ echo"<BR><SPAN class=\"filesize\">&nbsp;&nbsp;$filesize kb</SPAN></DIV>";
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">&nbsp;For $appname:<BR>&nbsp;&nbsp;$minappver - $maxappver</DIV>";
if($osname !=="ALL") { echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">For&nbsp;$osname<BR>only</DIV>"; }
if ($homepage) {echo"<DIV class=\"iconbar\"><A HREF=\"$homepage\"><IMG SRC=\"/images/home.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"$name Homepage\" ALT=\"\">Homepage</A></DIV>";}
echo"<DIV class=\"iconbar\" title=\"$rating of 5 stars\"><A HREF=\"moreinfo.php?id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV>";
echo"<DIV class=\"iconbar\" title=\"$rating of 5 stars\"><A HREF=\"moreinfo.php?".uriparams()."&id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV>";
echo"</DIV>";
echo"<DIV class=\"baseline\">$datestring | Total Downloads: $downloadcount";
@ -427,14 +429,14 @@ if ($pageid <=$num_pages) {
$previd=$pageid-1;
if ($previd >"0") {
echo"<a href=\"?pageid=$previd\">&#171; Previous</A> &bull; ";
echo"<a href=\"?".uriparams()."&pageid=$previd\">&#171; Previous</A> &bull; ";
}
echo"Page $pageid of $num_pages";
$nextid=$pageid+1;
if ($pageid <$num_pages) {
echo" &bull; <a href=\"?pageid=$nextid\">Next &#187;</a>";
echo" &bull; <a href=\"?".uriparams()."&pageid=$nextid\">Next &#187;</a>";
}
echo"<BR>\n";
@ -458,7 +460,7 @@ while ($i <= $maxpagesonpage && $i <= $num_pages) {
if ($i==$pageid) {
echo"<SPAN style=\"color: #FF0000\">$i</SPAN>&nbsp;";
} else {
echo"<A HREF=\"?pageid=$i\">$i</A>&nbsp;";
echo"<A HREF=\"?".uriparams()."&pageid=$i\">$i</A>&nbsp;";
}

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

@ -49,44 +49,10 @@ require"core/config.php";
include"$page_header";
?>
<div class="key-point cnet" id="firefox-feature">
<script type="text/javascript">
<!--
var classes = new Array("cnet");
var date = new Date();
var seconds;
var classid;
seconds = date.getSeconds();
classid = seconds % classes.length;
document.getElementById('firefox-feature').className = 'key-point front-feature-' + classes[classid];
-->
</script>
<a href="/products/firefox" title="Learn more about Firefox" id="featurelink">Learn more about Firefox</a>
<div id="feature-content">
<h2 style="margin: 0; font-size: 2px;"><img src="/images/t_firefox.gif" alt="Featuring: Firefox!"></h2>
<p>Firefox 0.9 is the <a href="shelf.html">award winning</a> preview of Mozilla's next generation browser. Download Firefox entirely free or <a href="">purchase it on a CD</a> from the Mozilla store. <a href="#dfg">Learn more about Firefox...</a></p>
<script type="text/javascript" src="products/firefox/download.js"></script>
<script type="text/javascript">
<!--
writeDownloadsFrontpage();
//-->
</script>
<noscript>
<div class="download">
<h3>Download Now</h3>
<ul>
<li><a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/0.9.2/FirefoxSetup-0.9.2.exe">Windows (4.7MB)</a> </li>
<li><a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/0.9.1/firefox-0.9.1-i686-linux-gtk2+xft-installer.tar.gz">Linux (8.1MB)</a></li>
<li><a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/0.9.1/firefox-0.9.1-mac.dmg.gz">Mac OS X (8.6MB)</a></li>
</ul>
</div>
</noscript>
</div>
</div>
<?php
if ($_GET["application"]) {$application=$_GET["application"]; }
//Temporary!! Current Version Array Code
//XXX Temporary!! Current Version Array Code
$currentver_array = array("firefox"=>"0.95", "thunderbird"=>"0.8", "mozilla"=>"1.7");
$currentver_display_array = array("firefox"=>"1.0 Preview Release", "thunderbird"=>"0.8", "mozilla"=>"1.7.x");
$currentver = $currentver_array[$application];
@ -95,7 +61,7 @@ include"$page_header";
<div id="mBody">
<div class="frontcolumn">
<h2><a href="extensions/">Get Extensions</a></h2>
<h2><a href="extensions/?application=<?php echo"$application"; ?>">Get Extensions</a></h2>
<a href="products/thunderbird"><img src="images/product-front-thunderbird.png" alt="Thunderbird" class="promo" width="60" height="60"></a>
<p>Extensions are small add-ons that add new functionality. They can add anything from a toolbar button to a completely new feature.</p>
@ -108,10 +74,10 @@ WHERE `Type` = 'E' AND `AppName` = '$application' AND `minAppVer_int`<='$curr
$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/">Browse extensions</a><BR>(<?php echo"$numextensions"; ?> available for <?php print(ucwords($application)); echo" $currentver_display"; ?>)<BR>
<a href="/extensions/?application=<?php echo"$application"; ?>">Browse extensions</a><BR>(<?php echo"$numextensions"; ?> available for <?php print(ucwords($application)); echo" $currentver_display"; ?>)<BR>
</div>
<div class="frontcolumn">
<h2><a href="themes/">Get Themes</a></h2>
<h2><a href="themes/?application=<?php echo"$application"; ?>">Get Themes</a></h2>
<a href="products/mozilla1.x"><img src="images/product-front-mozilla.png" alt="Mozilla" class="promo" width="60" height="60"></a>
<p>Themes are skins for Firefox, they allow you to change the look and feel of the browser and personalize it to your tastes.</p>
<?php
@ -122,7 +88,7 @@ WHERE `Type` = 'T' AND `AppName` = '$application' AND `minAppVer_int`<='$curr
$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/">Browse themes</a><BR>(<?php echo"$numthemes"; ?> available for <?php print(ucwords($application)); echo" $currentver_display"; ?>)
<a href="/themes/?application=<?php echo"$application"; ?>">Browse themes</a><BR>(<?php echo"$numthemes"; ?> available for <?php print(ucwords($application)); echo" $currentver_display"; ?>)
</div>
<div class="frontcolumnlast">
<h2><a href="http://www.MozillaStore.com">Get Plugins</a></h2>

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

@ -140,7 +140,7 @@ $v++;
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
$dateupdated = gmdate("F d, Y g:i:sa", $timestamp); //gmdate("F d, Y", $dutimestamp);
echo"<h3><A HREF=\"moreinfo.php?id=$id\">$name</A></h3>";
echo"<h3><A HREF=\"moreinfo.php?".uriparams()."&id=$id\">$name</A></h3>";
echo"$description<br>\n";
}
}

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

@ -42,7 +42,7 @@
echo"<ul id=\"nav\">\n";
if (!$category AND $index !="yes") {echo"<SPAN CLASS=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=All\" TITLE=\"Show All ".ucwords($typename)." Alphabetically\"><strong>All Themes</strong></A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=All\" TITLE=\"Show All ".ucwords($typename)." Alphabetically\"><strong>All Themes</strong></A></li>\n";
if (!$category AND $index !="yes") {echo"</SPAN>"; }
// Object Categories
@ -52,7 +52,7 @@ $sql = "SELECT `CatName`,`CatDesc` FROM `t_categories` WHERE `CatType` = '$type'
$catname = $row["CatName"];
$catdesc = $row["CatDesc"];
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\"><strong>$catname</strong></A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\"><strong>$catname</strong></A></li>\n";
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
}
?>
@ -61,25 +61,25 @@ $sql = "SELECT `CatName`,`CatDesc` FROM `t_categories` WHERE `CatType` = '$type'
$catname = "Editors Pick";
$catdesc = ucwords($typename)." picked by the Mozilla Update Editors";
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\">Editor's Pick</A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\">Editor's Pick</A></li>\n";
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
$catname = "Popular";
$catdesc = ucwords($typename)." downloaded the most";
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\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=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
$catname = "Newest";
$catdesc = "Most recent ".ucwords($typename);
if (strtolower($category) == strtolower($catname)) {echo"<SPAN CLASS=\"selected\">"; }
echo"<li><A HREF=\"showlist.php?category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
echo"<li><A HREF=\"showlist.php?".uriparams()."&category=$catname\" TITLE=\"$catdesc\">$catname</A></li>\n";
if (strtolower($category) == strtolower($catname)) {echo"</SPAN>"; }
?>
</ul>

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

@ -61,47 +61,6 @@ $index="yes";
include"inc_sidebar.php";
?>
<div class="key-point">
<h2 style="margin: 0; font-size: 2px;"><img src="/images/t_featuring.gif" alt="Featuring: Firefox!"></h2>
<?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&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>
<div id="mBody">
<h3>What is a Theme?</h3>
<p>Themes are skins for <?php print(ucwords($application)); ?>, they allow you to change the look and
@ -111,15 +70,15 @@ or it can change every piece of the browser appearance.</p>
<?php
//Temporary!! Current Version Array Code
$currentver_array = array("firefox"=>"0.95", "thunderbird"=>"0.8", "mozilla"=>"1.7");
$currentver_display_array = array("firefox"=>"1.0 Preview Release", "thunderbird"=>"0.8", "mozilla"=>"1.7.x");
$currentver_array = array("firefox"=>"1.0", "thunderbird"=>"0.9", "mozilla"=>"1.7");
$currentver_display_array = array("firefox"=>"1.0", "thunderbird"=>"0.9", "mozilla"=>"1.7.x");
$currentver = $currentver_array[$application];
$currentver_display = $currentver_display_array[$application];
?>
<!-- Start News Columns -->
<div class="frontcolumn">
<a href="http://www.mozilla.org/news.rdf"><img src="../images/rss.png" width="28" height="16" class="rss" alt="Mozilla News in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?category=Newest" title="New Extensions on Mozilla Update">New Additions</a></h2>
<a href="http://www.mozilla.org/news.rdf"><img src="../images/rss.png" width="28" height="16" class="rss" alt="Mozilla News in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?<?php echo uriparams(); ?>&category=Newest" title="New Extensions on Mozilla Update">New Additions</a></h2>
<span class="newsSubline">New and Updated Themes</span>
<ul class="news">
@ -149,7 +108,7 @@ WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='$
if ($lastname == $name) {$i--; continue; }
echo"<li>\n";
echo"<div class=\"date\">$dateadded</div>\n";
echo"<a href=\"moreinfo.php?id=$id&vid=$vid\">$name $version</a><BR>\n";
echo"<a href=\"moreinfo.php?".uriparams()."&id=$id\">$name $version</a><BR>\n";
echo"</li>\n";
$lastname = $name;
@ -159,7 +118,7 @@ if ($i >= "5") {break;}
</ul>
</div>
<div class="frontcolumn">
<a href="http://planet.mozilla.org/rss10.xml"><img src="../images/rss.png" width="28" height="16" class="rss" alt="Mozilla Weblogs in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?category=Popular" title="Most Popular Extensions, based on Downloads over the last week">Most Popular</a></h2>
<a href="http://planet.mozilla.org/rss10.xml"><img src="../images/rss.png" width="28" height="16" class="rss" alt="Mozilla Weblogs in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?<?php echo uriparams(); ?>&category=Popular" title="Most Popular Extensions, based on Downloads over the last week">Most Popular</a></h2>
<span class="newsSubline">Downloads over the last week</span>
<ul class="news">
@ -182,7 +141,7 @@ WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='
if ($lastname == $name) {$i--; continue; }
echo"<li>\n";
echo"<div class=\"date\">$i</div>\n";
echo"<a href=\"moreinfo.php?id=$id\">$name</a><br>\n";
echo"<a href=\"moreinfo.php?".uriparams()."&id=$id\">$name</a><br>\n";
echo"<span class=\"newsSubline\">($downloadcount downloads)</span>\n";
echo"</li>\n";
$lastname = $name;
@ -193,7 +152,7 @@ if ($i >= "5") {break;}
</div>
<div class="frontcolumn">
<a href="http://www.mozillazine.org/atom.xml"><img src="../images/rss.png" width="28" height="16" class="rss" alt="MozillaZine News in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?category=Top Rated" title="Highest Rated Extensions by the Community">Top Rated</a></h2>
<a href="http://www.mozillazine.org/atom.xml"><img src="../images/rss.png" width="28" height="16" class="rss" alt="MozillaZine News in RSS"></a><h2 style="margin-top: 0;"><a href="showlist.php?<?php echo uriparams(); ?>&category=Top Rated" title="Highest Rated Extensions by the Community">Top Rated</a></h2>
<span class="newsSubline">Based on feedback from visitors</span>
<ul class="news">
@ -220,25 +179,9 @@ WHERE `Type` = '$type' AND `AppName` = '$application' AND `minAppVer_int` <='
echo"<li>\n";
echo"<div class=\"date\">$rating stars</div>\n";
echo"<a href=\"moreinfo.php?id=$id\">$name</a>\n";
echo"<a href=\"moreinfo.php?".uriparams()."&id=$id\">$name</a>\n";
echo"</li>\n";
// Code for the OLD Graphical Star System.
//$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";
$usednames[$s] = $name;
$usedversions[$s] = $version;
if ($r >= "5") {break;}

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

@ -58,7 +58,7 @@ exit;
$row = mysql_fetch_array($sql_result);
//Page Titles
$pagetitles = array("releases"=>"All Releases", "comments"=>"User Comments", "staffreview"=>"Editor Review", "opinion"=>" My Opinion");
$pagetitles = array("releases"=>"All Releases", "previews"=>"Preview Images", "comments"=>"User Comments", "staffreview"=>"Editor Review", "opinion"=>" My Opinion");
$pagetitle = $pagetitles[$_GET["page"]];
?>
@ -74,6 +74,9 @@ include"inc_sidebar.php";
?>
<?php
$id = $_GET["id"];
//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
@ -107,16 +110,66 @@ 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 TM.ID = '$_GET[id]' AND `approved` = 'YES' ";
if ($_GET["vid"]) { $sql .=" AND TV.vID = '$_GET[vid]' "; }
$sql .= "ORDER BY `Name` , `Version` DESC LIMIT 1";
";
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 TM.ID = '$_GET[id]'";
if ($_GET["vid"]) {$vid=$_GET["vid"]; $sql .=" AND TV.vID = '$vid' ";
} else {
$sql .=" AND 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 .= "\nORDER BY `Name` , `Version` DESC LIMIT 1";
//echo"<pre>$sql</pre><BR>\n";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$row = mysql_fetch_array($sql_result);
if (mysql_num_rows($sql_result)=="0") {
echo"<h1>Incompatible Theme or Theme No Longer Available</h1>\n";
echo"The theme you requested is either incompatible with the application selected, or the version of it is no longer available on Mozilla Update.<br><br>\n";
echo"To try your request again for a different application version, use the form below.<br>\n";
echo"<form name=\"changeapp\" method=\"get\" action=\"?\">
<input name=\"id\" type=\"hidden\" value=\"$id\">
<input name=\"os\" type=\"hidden\" value=\"$OS\">
<strong>".ucwords($application)."</strong> <input name=\"application\" type=\"hidden\" value=\"$application\">";
echo"<select name=\"version\">";
$sql = "SELECT `Version`,`major`,`minor`,`release`,`SubVer` FROM `t_applications` WHERE `AppName`='$application' and `public_ver` ='YES' 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)) {
$release = "$row[major].$row[minor]";
if ($row["release"]) {
$release .= ".$row[release]";
}
$subver = $row["SubVer"];
if ($subver !=="final") {
$release .="$subver";
}
echo"<option value=\"$release\">$row[Version]</option>";
}
echo"</select>&nbsp;<input name=\"go\" type=\"submit\" value=\"Go\">";
echo"</form>";
include"$page_footer";
echo"</body>\n</html>\n";
exit;
}
$v++;
$id = $row["ID"];
$type = $row["Type"];
$name = $row["Name"];
$dateadded = $row["DateAdded"];
$dateupdated = $row["DateUpdated"];
@ -155,7 +208,7 @@ $authorcount = count($authors);
foreach ($authors as $author) {
$userid = $authorids[$author];
$n++;
$authorstring .= "<A HREF=\"authorprofiles.php?id=$userid\">$author</A>";
$authorstring .= "<A HREF=\"authorprofiles.php?".uriparams()."&id=$userid\">$author</A>";
if ($authorcount != $n) {$authorstring .=", "; }
}
@ -180,13 +233,27 @@ if (!$rating) { $rating="0"; }
?>
<H3> <?php ucwords("$application "); ?> Extensions &#187; <?php echo"$row[Name]"; if ($pagetitle) {echo" :: $pagetitle"; } ?></H3>
<H3> <?php ucwords("$application "); ?> Themes &#187; <?php echo"$row[Name]"; if ($pagetitle) {echo" :: $pagetitle"; } ?></H3>
<A HREF="?<?php echo"id=$id&vid=$vid"; ?>">More Info</A> |
<A HREF="?<?php echo"id=$id&vid=$vid&page=releases"; ?>">All Releases</A> |
<A HREF="?<?php echo"id=$id&vid=$vid&page=comments"; ?>">Comments</A> |
<A HREF="?<?php echo"id=$id&vid=$vid&page=staffreview"; ?>">Editor Review</A> |
<A HREF="?<?php echo"id=$id&vid=$vid&page=opinion"; ?>">My Opinion</A>
<A HREF="?<?php echo"".uriparams()."&id=$id&vid=$vid"; ?>">More Info</A> |
<A HREF="?<?php echo"".uriparams()."&id=$id&vid=$vid&page=releases"; ?>">All Releases</A> |
<A HREF="?<?php echo"".uriparams()."&id=$id&vid=$vid&page=comments"; ?>">Comments</A> |
<?php
$sql = "SELECT `PreviewID` from `t_previews` WHERE `ID`='$id' and `preview`='NO' 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") {
?>
<A HREF="?<?php echo"".uriparams()."&id=$id&vid=$vid&page=previews"; ?>">Previews</A> |
<?php
}
$sql = "SELECT `rID` from `t_reviews` WHERE `ID`='$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") {
?>
<A HREF="?<?php echo"".uriparams()."&id=$id&vid=$vid&page=staffreview"; ?>">Editor Review</A> |
<?php } ?>
<A HREF="?<?php echo"".uriparams()."&id=$id&vid=$vid&page=opinion"; ?>">My Opinion</A>
<?php
echo"<DIV id=\"item\">\n";
@ -197,13 +264,24 @@ echo"<IMG SRC=\"$previewuri\" BORDER=0 HEIGHT=$height WIDTH=$width ALT=\"$name p
echo"</DIV>\n";
}
echo"<h5>";
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?id=$id&vid=$vid\">$name $version</A></SPAN><BR>";
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?".uriparams()."&id=$id&vid=$vid\">$name $version</A></SPAN><BR>";
echo"<SPAN class=\"authorline\">By $authors</SPAN>";
echo"</h5>";
//Categories
$sql = "SELECT `CatName` from `t_categoryxref` TCX INNER JOIN `t_categories` TC ON TCX.CategoryID=TC.CategoryID WHERE `ID`='$id' ORDER BY `CatName` 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); $i=0;
while ($row = mysql_fetch_array($sql_result)) {
$i++;
$categories .= $row["CatName"];
if ($num_results < $i ) { $categories .= ", "; }
}
//Description & Version Notes
echo"$description<BR>\n";
echo"$description";
if ($categories) { echo" (Categories: $categories)"; }
echo"<BR>\n";
if ($notes) {echo"<BR>\n$notes<BR>"; }
echo"<BR>\n";
@ -259,7 +337,7 @@ echo"<DIV style=\"margin-top: 30px; height: 34px\">";
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">&nbsp;For $appname:<BR>&nbsp;&nbsp;$minappver - $maxappver</DIV>";
if($osname !=="ALL") { echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">For&nbsp;$osname<BR>only</DIV>"; }
if ($homepage) {echo"<DIV class=\"iconbar\"><A HREF=\"$homepage\"><IMG SRC=\"/images/home.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"$name Homepage\" ALT=\"\">Homepage</A></DIV>";}
echo"<DIV class=\"iconbar\" title=\"$rating of 5 stars\"><A HREF=\"moreinfo.php?id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV>";
echo"<DIV class=\"iconbar\" title=\"$rating of 5 stars\"><A HREF=\"moreinfo.php?".uriparams()."&id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV>";
echo"</DIV>";
@ -277,14 +355,23 @@ if ($homepage) {echo"<SPAN style=\"font-size:10pt\">Having a problem with this t
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?id=$id&vid=$vid&page=releases\">Other Versions</A>";
echo"<LI> <A HREF=\"moreinfo.php?".uriparams()."&id=$id&vid=$vid&page=releases\">Other Versions</A>";
?>
</UL>
</DIV>
<?php
$sql = "SELECT `devcomments` FROM `t_main` WHERE `id`='$id' 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);
if ($row["devcomments"]) {
$devcomments = nl2br($row["devcomments"]);
echo"<h3>Developer Comments:</h3>\n";
echo"$devcomments";
echo"<br>\n";
}
?>
<DIV class="commentbox">
<H3>User Comments:</H3>
<?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";
@ -307,7 +394,6 @@ $sql = "SELECT CommentName, CommentTitle, CommentNote, CommentDate, CommentVote
$timestamp = strtotime("$year-$month-$day $hour:$minute:$second");
$commentdate = gmdate("F d, Y g:ia", $timestamp);
//echo"<DIV class=\"commenttitlebar\">";
echo"<h4>$commenttitle</h4>";
echo"<SPAN class=\"liststars\">";
@ -318,26 +404,25 @@ 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"&nbsp;&nbsp;By $commentname<BR>\n";
echo"&nbsp;<BR>\n";
echo"$commentnotes<BR>\n\n";
echo"&nbsp;<BR>\n";
echo"<DIV class=\"commentfooter\">\n";
echo"$commentdate | <A HREF=\"moreinfo.php?id=$id&vid=$vid&page=comments\">More Comments...</A> | <A HREF=\"moreinfo.php?id=$id&vid=$vid&page=opinion\">Rate It!</A>\n";
echo"$commentdate | <A HREF=\"moreinfo.php?".uriparams()."&id=$id&vid=$vid&page=comments\">More Comments...</A> | <A HREF=\"moreinfo.php?".uriparams()."&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?id=$id&vid=$vid&page=opinion\">Rate It!</A>";
echo"Be the First! <A HREF=\"moreinfo.php?".uriparams()."&id=$id&vid=$vid&page=opinion\">Rate It!</A>";
echo"</DIV>";
}
?>
</DIV>
<?php
echo"<DIV class=\"baseline\">$datestring | Total Downloads: $downloadcount";
if ($populardownloads > 5 ) {echo" | Downloads this Week: $populardownloads";}
@ -371,7 +456,7 @@ if ($appvernames[$row["MaxAppVer"]]) {$maxappver = $appvernames[$row["MaxAppVer"
echo"<DIV>"; //Open Version DIV
//Description & Version Notes
echo"<h4><A HREF=\"moreinfo.php?id=$id&vid=$vid\">Version $version</A></h4>\n";
echo"<h4><A HREF=\"moreinfo.php?".uriparams()."&id=$id&vid=$vid\">Version $version</A></h4>\n";
if ($notes) {echo"$notes<br><br>\n"; }
//Icon Bar Modules
@ -388,37 +473,160 @@ echo"</DIV>";
//End General Page
} else if ($page=="comments") {
//Comments/Ratings Page
echo"<h3>User Comments:</h3>";
$sql = "SELECT CommentName, CommentTitle, CommentNote, CommentDate, CommentVote FROM `t_feedback` WHERE ID = '$_GET[id]' AND CommentNote IS NOT NULL ORDER BY `CommentDate` DESC";
if ($_GET["numpg"]) {$items_per_page=$_GET["numpg"]; } else {$items_per_page="25";} //Default Num per Page is 25
if (!$_GET["pageid"]) {$pageid="1"; } else { $pageid = $_GET["pageid"]; } //Default PageID is 1
$startpoint = ($pageid-1)*$items_per_page;
$sql = "SELECT CommentID FROM `t_feedback` WHERE ID = '$id'";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
$num_pages = ceil(mysql_num_rows($sql_result)/$items_per_page);
//Comments/Ratings Page
echo"<h3>User Comments:</h3>";
if ($pageid <=$num_pages) {
$previd=$pageid-1;
if ($previd >"0") {
echo"<a href=\"?".uriparams()."&id=$id&page=$page&pageid=$previd\">&#171; Previous</A> &bull; ";
}
}
echo"Page $pageid of $num_pages";
$nextid=$pageid+1;
if ($pageid <$num_pages) {
echo" &bull; <a href=\"?".uriparams()."&id=$id&page=$page&pageid=$nextid\">Next &#187;</a>";
}
echo"<BR>\n";
$sql = "SELECT CommentID, CommentName, CommentTitle, CommentNote, CommentDate, CommentVote, `helpful-yes`,`helpful-no` FROM `t_feedback` WHERE ID = '$id' ORDER BY `CommentDate` DESC LIMIT $startpoint, $items_per_page";
$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)) {
$commentid = $row["CommentID"];
$name = $row["CommentName"];
$title = $row["CommentTitle"];
$notes = $row["CommentNote"];
$helpful_yes = $row["helpful-yes"];
$helpful_no = $row["helpful-no"];
$date = date("l, F j Y", strtotime($row["CommentDate"]));
$rating = $row["CommentVote"];
if (!$title) {$title = "No Title"; }
if (!$name) {$name = "Anonymous"; }
echo"<a name=\"$commentid\"></a>\n";
echo"<h4>$title</h4>";
echo"&nbsp;&nbsp;Posted on $date by $name<br>";
echo"$notes<BR>\n\n";
echo"<DIV class=\"iconbar\" style=\"padding-left: 20px\" title=\"$rating of 5 stars\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</DIV><BR><BR>";
if ($helpful_yes>0 or $helpful_no>0) {
$helpful_total=$helpful_yes+$helpful_no;
echo"$helpful_yes of $helpful_total people found this comment helpful.<br>\n";
}
echo"Was this comment helpful to you? <a href=\"../core/commenthelpful.php?".uriparams()."&id=$id&type=$type&commentid=$commentid&pageid=$pageid&action=yes\">Yes</a>&nbsp;&nbsp;&nbsp;<a href=\"../core/commenthelpful.php?".uriparams()."&id=$id&type=$type&commentid=$commentid&pageid=$pageid&action=no\">No</a>";
echo" <span style=\"font-size: xx-small\"><a href=\"../core/reportcomment.php?".uriparams()."&id=$id&type=$type&commentid=$commentid&pageid=$pageid&action=report\" ONCLICK=\"return confirm('Report this comment as inappropriate on the site?');\">(Report Comment)</a></span>";
echo"<BR>";
}
if ($num_results=="0") {
echo"<DIV class=\"nocomment\">";
echo"Nobody has commented on this extension yet...<BR>
Be the First!
<A HREF=\"moreinfo.php?".uriparams()."&id=$id&vid=$vid&page=opinion\">Leave your comments</A>...";
echo"</DIV>\n";
}
echo"<DIV style=\"height: 15px; border-bottom: 1px #CCC solid\"></DIV>";
// Begin Code for Dynamic Navbars
if ($pageid <=$num_pages) {
$previd=$pageid-1;
if ($previd >"0") {
echo"<a href=\"?".uriparams()."&id=$id&page=$page&pageid=$previd\">&#171; Previous</A> &bull; ";
}
}
echo"Page $pageid of $num_pages";
$nextid=$pageid+1;
if ($pageid <$num_pages) {
echo" &bull; <a href=\"?".uriparams()."&id=$id&page=$page&pageid=$nextid\">Next &#187;</a>";
}
echo"<BR>\n";
//Skip to Page...
if ($num_pages>1) {
echo"Jump to Page: ";
$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>&nbsp;";
} else {
echo"<A HREF=\"?".uriparams()."&id=$id&page=$page&pageid=$i\">$i</A>&nbsp;";
}
$i++;
}
}
if ($num_pages>1) {
echo"<br>\nComments per page: \n";
$perpagearray = array("25","50","100");
foreach ($perpagearray as $items_per_page) {
echo"<A HREF=\"?".uriparams()."&id=$id&page=$page&pageid=1\">$items_per_page</A>&nbsp;";
}
}
} else if ($page=="previews") {
// Item Previews Tab
echo"<h2>Previews for $name</h2>\n";
$sql = "SELECT `PreviewURI`,`caption` from `t_previews` WHERE `ID`='$id' and `preview`='NO' ORDER BY `PreviewID` 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 = date("l, F j Y", strtotime($row["CommentDate"]));
$rating = $row["CommentVote"];
$uri = $row["PreviewURI"];
$caption = $row["caption"];
echo"<h4>$caption</h4>";
list($src_width, $src_height, $type, $attr) = getimagesize("$websitepath/$uri");
//Scale Image Dimensions
$dest_width="690"; // Destination Width /$tn_size_width
$dest_height_fixed="520"; // Destination Height / $tn_size_height (Fixed)
if ($src_width<=$dest_width AND $src_height<=$dest_width) {
$dest_width = $src_width;
$dest_height = $src_height;
} else {
$dest_height= ($src_height * $dest_width) / $src_width; // (Aspect Ratio Variable Height
if ($dest_height>$dest_height_fixed) {
$dest_height = $dest_height_fixed;
$dest_width = ($src_width * $dest_height) / $src_height;
}
}
echo"<h4>$title</h4>";
echo"&nbsp;&nbsp;Posted on $date by $name<br>";
echo"$notes<BR>\n\n";
echo"<img src=\"$uri\" alt=\"$caption\" width=\"$dest_width\" height=\"$dest_height\" border=0><br>\n";
echo"<DIV class=\"iconbar\" style=\"padding-left: 20px\" title=\"$rating of 5 stars\"><A HREF=\"moreinfo.php?id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV><BR><BR>";
}
}
if ($num_results=="0") {
echo"<DIV class=\"nocomment\">";
echo"Nobody has commented on this extension yet...<BR>
Be the First!
<A HREF=\"moreinfo.php?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
@ -457,7 +665,7 @@ echo"
This $typename has not yet been reviewed.<BR><BR>
To see what other users think of this theme, view the <A HREF=\"moreinfo.php?id=$id&page=comments\">User Comments...</A>
To see what other users think of this theme, view the <A HREF=\"moreinfo.php?".uriparams()."&id=$id&page=comments\">User Comments...</A>
";
@ -478,9 +686,10 @@ Your comment submission had the following error(s), please fix these errors and
}
?>
<DIV class="opinionform">
<FORM NAME="opinon" METHOD="POST" ACTION="../core/postfeedback.php">
<FORM NAME="opinon" METHOD="POST" ACTION="../core/postfeedback.php?<?php echo uriparams(); ?>">
<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>

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

@ -192,13 +192,13 @@ echo"".ucwords("$typename")." $startitem - $enditem of $totalresults&nbsp;&nbsp;
$previd=$pageid-1;
if ($previd >"0") {
echo"<a href=\"?pageid=$previd\">&#171; Previous</A> &bull; ";
echo"<a href=\"?".uriparams()."&pageid=$previd\">&#171; Previous</A> &bull; ";
}
echo"Page $pageid of $num_pages";
$nextid=$pageid+1;
if ($pageid <$num_pages) {
echo" &bull; <a href=\"?pageid=$nextid\">Next &#187;</a>";
echo" &bull; <a href=\"?".uriparams()."&pageid=$nextid\">Next &#187;</a>";
}
echo"<br><br>\n";
@ -209,6 +209,8 @@ echo"<br><br>\n";
echo"<DIV class=\"key-point\">";
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");
@ -240,7 +242,7 @@ 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 = "SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `t_applications` WHERE `AppName` = '$application' AND `public_ver` = 'YES' 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"];
@ -346,7 +348,7 @@ $authorcount = count($authors);
foreach ($authors as $author) {
$userid = $authorids[$author];
$n++;
$authorstring .= "<A HREF=\"authorprofiles.php?id=$userid\">$author</A>";
$authorstring .= "<A HREF=\"authorprofiles.php?".uriparams()."&id=$userid\">$author</A>";
if ($authorcount != $n) {$authorstring .=", "; }
}
@ -376,7 +378,7 @@ echo"<IMG SRC=\"$previewuri\" BORDER=0 HEIGHT=$height WIDTH=$width ALT=\"$name p
echo"</DIV>\n";
}
echo"<h5>";
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?id=$id&vid=$vid\">$name $version</A></SPAN><BR>";
echo"<SPAN class=\"title\"><A HREF=\"moreinfo.php?".uriparams()."&id=$id\">$name $version</A></SPAN><BR>";
echo"<SPAN class=\"authorline\">By $authors</SPAN>";
echo"</h5>";
@ -389,7 +391,7 @@ echo"<BR>";
echo"<DIV style=\"margin-top: 30px; height: 34px\">";
echo"<DIV class=\"iconbar\">";
if ($appname=="Thunderbird") {
echo"<A HREF=\"moreinfo.php?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
echo"<A HREF=\"moreinfo.php?".uriparams()."&id=$id\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
} else {
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name'))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name\" ALT=\"\">Install</A>";
}
@ -397,7 +399,7 @@ echo"<BR><SPAN class=\"filesize\">&nbsp;&nbsp;$filesize kb</SPAN></DIV>";
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">&nbsp;For $appname:<BR>&nbsp;&nbsp;$minappver - $maxappver</DIV>";
if($osname !=="ALL") { echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">For&nbsp;$osname<BR>only</DIV>"; }
if ($homepage) {echo"<DIV class=\"iconbar\"><A HREF=\"$homepage\"><IMG SRC=\"/images/home.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"$name Homepage\" ALT=\"\">Homepage</A></DIV>";}
echo"<DIV class=\"iconbar\" title=\"$rating of 5 stars\"><A HREF=\"moreinfo.php?id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV>";
echo"<DIV class=\"iconbar\" title=\"$rating of 5 stars\"><A HREF=\"moreinfo.php?".uriparams()."&id=$id&page=comments\"><IMG SRC=\"/images/ratings.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">Rated<br>&nbsp;&nbsp;$rating of 5</A></DIV>";
echo"</DIV>";
echo"<DIV class=\"baseline\">$datestring | Total Downloads: $downloadcount";
@ -428,14 +430,14 @@ if ($pageid <=$num_pages) {
$previd=$pageid-1;
if ($previd >"0") {
echo"<a href=\"?pageid=$previd\">&#171; Previous</A> &bull; ";
echo"<a href=\"?".uriparams()."&pageid=$previd\">&#171; Previous</A> &bull; ";
}
echo"Page $pageid of $num_pages";
$nextid=$pageid+1;
if ($pageid <$num_pages) {
echo" &bull; <a href=\"?pageid=$nextid\">Next &#187;</a>";
echo" &bull; <a href=\"?".uriparams()."&pageid=$nextid\">Next &#187;</a>";
}
echo"<BR>\n";
@ -459,7 +461,7 @@ while ($i <= $maxpagesonpage && $i <= $num_pages) {
if ($i==$pageid) {
echo"<SPAN style=\"color: #FF0000\">$i</SPAN>&nbsp;";
} else {
echo"<A HREF=\"?pageid=$i\">$i</A>&nbsp;";
echo"<A HREF=\"?".uriparams()."&pageid=$i\">$i</A>&nbsp;";
}