From 0f407e9c2fece5e515c5bb29da0d30d2ba114ed8 Mon Sep 17 00:00:00 2001 From: "psychoticwolf%carolina.rr.com" Date: Mon, 20 Dec 2004 13:38:30 +0000 Subject: [PATCH] Last Comments/Ratings Fixes. Disable MetaRatings, Reimplement rating average stars, linkify commenters names for null-rating posts from devcp. Bug 247144. --- webtools/update/core/commenthelpful.php | 4 ++ .../update/developers/commentsmanager.php | 14 ++++++- webtools/update/extensions/moreinfo.php | 37 ++++++++++++++++--- webtools/update/extensions/showlist.php | 20 +++++++++- webtools/update/themes/moreinfo.php | 37 ++++++++++++++++--- webtools/update/themes/showlist.php | 21 ++++++++++- 6 files changed, 117 insertions(+), 16 deletions(-) diff --git a/webtools/update/core/commenthelpful.php b/webtools/update/core/commenthelpful.php index 5cfca73e4b71..1c94d5785baa 100755 --- a/webtools/update/core/commenthelpful.php +++ b/webtools/update/core/commenthelpful.php @@ -36,6 +36,10 @@ // // ***** END LICENSE BLOCK ***** +//XXX -- Meta-Ratings not yet production ready. Disabled for Update 1.0. Bug 247144. +exit("Meta-Ratings Disabled"); + + //Submit Review/Rating Feedback to Table require"../core/config.php"; diff --git a/webtools/update/developers/commentsmanager.php b/webtools/update/developers/commentsmanager.php index 987be6b059a6..53d80c8b75a0 100755 --- a/webtools/update/developers/commentsmanager.php +++ b/webtools/update/developers/commentsmanager.php @@ -28,7 +28,7 @@ if ($_POST["submit"]=="Flag Selected" or $_POST["submit"]=="Delete Selected") {

Updating comments list, please wait...

Submitting Comment, please wait...\n"; $title = escape_string($_POST["title"]); $comments = escape_string($_POST["notes"]); + if ($_POST["type"]=="E") { + $type="extensions"; + } else if ($_POST["type"]=="T") { + $type="themes"; + } + + $name = "$_SESSION[name]"; + $sql = "INSERT INTO `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) { @@ -270,6 +279,7 @@ Need to make a reply comment or answer a question somebody left who didn't provi
&action=addcomment#addcomment"> "> + "> "> Title:
Comment:
diff --git a/webtools/update/extensions/moreinfo.php b/webtools/update/extensions/moreinfo.php index bdd5b32bf500..4fc5092948c8 100644 --- a/webtools/update/extensions/moreinfo.php +++ b/webtools/update/extensions/moreinfo.php @@ -272,7 +272,26 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des ?>
-
Rating: 3.8 Stars
+ +
Stars out of 5">Rating: "; + } + + if ($rating>floor($rating)) { + $val = ($rating-floor($rating))*10; + echo"\"\""; + $i++; + } + + for ($i = $i; $i <= 5; $i++) { + echo"\"";"; + } + ?> +
+

-

, by , released on

@@ -402,6 +421,7 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des echo"

$commenttitle by $commentname

\n"; echo"

$commentdate

\n"; echo"

$commentnotes

\n"; + if ($rating != NULL) { echo"

"; for ($i = 1; $i <= $rating; $i++) { echo"\"*\""; @@ -410,6 +430,7 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des echo"\"\""; } echo"

\n"; + } echo"\n"; } @@ -572,6 +593,7 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des echo"

$title by $name

\n"; echo"

$date

\n"; echo"

$notes

\n"; + if ($rating != NULL) { echo"

"; for ($i = 1; $i <= $rating; $i++) { echo"\"*\""; @@ -579,16 +601,19 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des for ($i = $i; $i <= 5; $i++) { echo"\"\""; } - 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.
\n"; - } - echo"Was this comment helpful to you? Yes   No"; + //XXX Meta-Ratings not Production Ready, disabled. Bug 247144. + // 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.
\n"; + // } + + //echo"Was this comment helpful to you? Yes   No"; echo" (Report Comment)"; echo"
"; echo"

\n"; + } echo"\n"; } diff --git a/webtools/update/extensions/showlist.php b/webtools/update/extensions/showlist.php index 78c5ae6b4743..0a02a93d0bee 100644 --- a/webtools/update/extensions/showlist.php +++ b/webtools/update/extensions/showlist.php @@ -365,8 +365,26 @@ $datestring = "$datetitle $date"; echo"
\n"; -echo"
Rating: \"3.8
\n"; + if ($rating != NULL) { + echo"
Rating: "; + for ($i = 1; $i <= floor($rating); $i++) { + echo"\"";"; + } + + if ($rating>floor($rating)) { + $val = ($rating-floor($rating))*10; + echo"\"\""; + $i++; + } + + for ($i = $i; $i <= 5; $i++) { + echo"\"";"; + } + + + echo"
\n"; + } echo"

$name $version

"; diff --git a/webtools/update/themes/moreinfo.php b/webtools/update/themes/moreinfo.php index 3ceddb2e2c3a..135a0d1cf7f3 100644 --- a/webtools/update/themes/moreinfo.php +++ b/webtools/update/themes/moreinfo.php @@ -272,7 +272,26 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des ?>
-
Rating: 3.8 Stars
+ +
Stars out of 5">Rating: "; + } + + if ($rating>floor($rating)) { + $val = ($rating-floor($rating))*10; + echo"\"\""; + $i++; + } + + for ($i = $i; $i <= 5; $i++) { + echo"\"";"; + } + ?> +
+

-

, by , released on

@@ -402,6 +421,7 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des echo"

$commenttitle by $commentname

\n"; echo"

$commentdate

\n"; echo"

$commentnotes

\n"; + if ($rating != NULL) { echo"

"; for ($i = 1; $i <= $rating; $i++) { echo"\"*\""; @@ -410,6 +430,7 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des echo"\"\""; } echo"

\n"; + } echo"\n"; } @@ -572,6 +593,7 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des echo"

$title by $name

\n"; echo"

$date

\n"; echo"

$notes

\n"; + if ($rating != NULL) { echo"

"; for ($i = 1; $i <= $rating; $i++) { echo"\"*\""; @@ -579,16 +601,19 @@ $sql = "SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Des for ($i = $i; $i <= 5; $i++) { echo"\"\""; } - 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.
\n"; - } - echo"Was this comment helpful to you? Yes   No"; + //XXX Meta-Ratings not Production Ready, disabled. Bug 247144. + // 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.
\n"; + // } + + // echo"Was this comment helpful to you? Yes   No"; echo" (Report Comment)"; echo"
"; echo"

\n"; + } echo"\n"; } diff --git a/webtools/update/themes/showlist.php b/webtools/update/themes/showlist.php index 067a1886548b..5f212645fc7b 100644 --- a/webtools/update/themes/showlist.php +++ b/webtools/update/themes/showlist.php @@ -366,7 +366,26 @@ $datestring = "$datetitle $date"; echo"
\n"; -echo"
Rating: \"3.8
\n"; + if ($rating != NULL) { + echo"
Rating: "; + + for ($i = 1; $i <= floor($rating); $i++) { + echo"\"";"; + } + + if ($rating>floor($rating)) { + $val = ($rating-floor($rating))*10; + echo"\"\""; + $i++; + } + + for ($i = $i; $i <= 5; $i++) { + echo"\"";"; + } + + + echo"
\n"; + } echo"

$name $version

";