diff --git a/mozilla/webtools/update/database/mozillaupdate.sql b/mozilla/webtools/update/database/mozillaupdate.sql
index ceefabfc470..1b9536caa5c 100644
--- a/mozilla/webtools/update/database/mozillaupdate.sql
+++ b/mozilla/webtools/update/database/mozillaupdate.sql
@@ -280,18 +280,19 @@ CREATE TABLE `previews` (
CREATE TABLE `reviews` (
`rID` int(11) NOT NULL auto_increment,
`ID` int(11) NOT NULL default '0',
- `AppID` int(11) NOT NULL default '0',
`DateAdded` datetime NOT NULL default '0000-00-00 00:00:00',
`AuthorID` int(11) NOT NULL default '0',
`Title` varchar(60) NOT NULL default '',
`Body` text,
+ `ExtendedBody` text NOT NULL,
`pick` enum('YES','NO') NOT NULL default 'NO',
`featured` enum('YES','NO') NOT NULL default 'NO',
+ `featuredate` varchar(6) NOT NULL default '',
PRIMARY KEY (`rID`),
- KEY `ID` (`ID`),
- KEY `AppID` (`AppID`),
+ UNIQUE KEY `ID` (`ID`),
KEY `AuthorID` (`AuthorID`)
) TYPE=InnoDB PACK_KEYS=0;
+
-- --------------------------------------------------------
diff --git a/mozilla/webtools/update/developers/inc_sidebar.php b/mozilla/webtools/update/developers/inc_sidebar.php
index 0d19b97928e..82204174a65 100755
--- a/mozilla/webtools/update/developers/inc_sidebar.php
+++ b/mozilla/webtools/update/developers/inc_sidebar.php
@@ -1,10 +1,12 @@
@@ -25,7 +27,8 @@ if ($_SESSION["level"] == "user") {
Themes list
Extensions list
Users Manager
-
Comments Manager
+
Comments Manager
+
Reviews Manager
@@ -37,7 +40,8 @@ if ($_SESSION["level"] == "user") {
Application Manager
Category Manager
FAQ Manager
-
Comments Manager
+
Comments Manager
+
Reviews Manager
Logout
diff --git a/mozilla/webtools/update/developers/reviewsmanager.php b/mozilla/webtools/update/developers/reviewsmanager.php
new file mode 100755
index 00000000000..603972b98b9
--- /dev/null
+++ b/mozilla/webtools/update/developers/reviewsmanager.php
@@ -0,0 +1,213 @@
+
+
+
+
+
Mozilla Update :: Developer Control Panel :: Reviews Manager
+
+
+"Extensions","T"=>"Themes");
+if (!$_GET["type"]) {$_GET["type"]="E";}
+?>
+
+
Manage Reviews for :
+
Show: $typename) {
+$i++;
+echo"$typename";
+if ($i !== $count) {echo" / "; }
+
+}
+unset($i);
+?>
+
+
+
+ |
+Name |
+Review... |
+Review Posted |
+
+
+\n";
+ echo"$i. | \n";
+ echo"$name | \n";
+ echo"$description | \n";
+ echo"$dateadded | \n";
+ echo"\n";
+}
+?>
+
+
+Adding review for $name, please wait...";
+
+ if ($_POST["title"] && $_POST["body"] && $_POST["id"] && $_POST["method"]=="add") {
+ //Everything We *must* have is present... Begin....
+
+ if (checkFormKey()) {
+ $sql = "INSERT INTO `reviews` (`ID`,`DateAdded`,`AuthorID`,`Title`,`Body`,`ExtendedBody`,`pick`,`featured`,`featuredate`) VALUES ('".escape_string($_POST[id])."', NOW(NULL), '".escape_string($_SESSION[uid])."','".escape_string($_POST[title])."','".escape_string($_POST[body])."','".escape_string($_POST[extendedbody])."','".escape_string($_POST[pick])."','".escape_string($_POST[featured])."','".escape_string($_POST[featuredate])."');";
+ $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
+ if ($sql_result) {
+ echo"Your review of $name has been submitted successfully...
\n";
+ }
+ }
+ }
+
+ } else if ($_POST["submit"]=="Update Review") {
+ $name = escape_string($_POST["name"]);
+ echo"
Updating review for $name, please wait...
";
+
+ if ($_POST["title"] && $_POST["body"] && $_POST["rid"] && $_POST["method"]=="edit") {
+ //Everything We *must* have is present... Begin....
+
+ if (checkFormKey()) {
+ $sql = "UPDATE `reviews` SET `Title`= '".escape_string($_POST[title])."', `Body`='".escape_string($_POST[body])."', `ExtendedBody`='".escape_string($_POST[extendedbody])."', `pick`='".escape_string($_POST[pick])."', `featured`='".escape_string($_POST[featured])."', `featuredate`='".escape_string($_POST[featuredate])."' WHERE `rID`='".escape_string($_POST[rid])."' LIMIT 1";
+ $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
+ if ($sql_result) {
+ echo"Your update to the review for $name has been submitted successfully...
\n";
+ }
+ }
+ }
+
+ } else if ($_POST["submit"]=="Delete") {
+ $name = escape_string($_POST["name"]);
+ $rid = escape_string($_POST["rid"]);
+
+ echo"
Deleting $name, please wait...
\n";
+
+ if (checkFormKey()) {
+ $sql = "DELETE FROM `reviews` WHERE `rID`='$rid' LIMIT 1";
+ $sql_result = mysql_query($sql, $connection) or trigger_error("
MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
+ if ($sql_result) {
+ echo"The review for $name has been deleted...
\n";
+ echo"
«« Back to Main Page...\n";
+ include"$page_footer";
+ echo"\n\n";
+ exit;
+ }
+
+ }
+
+ }
+
+//Get Parent Item Information
+$id = escape_string($_GET["id"]);
+if (!$id) {$id = escape_string($_POST["id"]); }
+
+$sql = "SELECT TM.ID, TM.Type, TM.Name FROM `main` TM WHERE TM.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);
+ $id = $row["ID"];
+ $type = $row["Type"];
+ $name = $row["Name"];
+
+$sql = "SELECT `rID`,TU.UserName as AuthorName, `DateAdded`, `Title`, `Body`, `ExtendedBody`, `pick`, `featured`, `featuredate` FROM `reviews` INNER JOIN `userprofiles` TU ON reviews.AuthorID=TU.UserID WHERE `ID` = '$id' LIMIT 1";
+ $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
+ $sql_num = mysql_num_rows($sql_result);
+ if ($sql_num=="0") { $method="Add"; $action="Add"; } else { $method="Edit"; $action="Update"; }
+ $row = mysql_fetch_array($sql_result);
+ $rid = $row["rID"];
+ $authorname = $row["AuthorName"];
+ $dateadded = date("F d, Y", strtotime($row["DateAdded"]));
+ $title = $row["Title"];
+ $body = $row["Body"];
+ $extendedbody = $row["ExtendedBody"];
+ $pick = $row["pick"];
+ $featured = $row["featured"];
+ $featuredate = $row["featuredate"];
+ if (!$featuredate) {$featuredate = date("Ym"); }
+ if (!$authorname) { $authorname = $_SESSION["name"]; }
+?>
+
+\n"; ?>
+
+
+
">«« Back to Reviews Manager
+
+
+
+
+
+
+
+
+