You don't have to rate the game to
diff --git a/www/search b/www/search
index c3c97359..ff9a37b1 100644
--- a/www/search
+++ b/www/search
@@ -9,9 +9,11 @@ checkPersistentLogin();
include_once "pagetpl.php";
include_once "util.php";
include_once "searchutil.php";
+include_once "viewgame-components/have-you-played.php";
include_once "dbconnect.php";
$db = dbConnect();
+$curuser = checkPersistentLogin();
// check for API requests
$api_mode = null;
@@ -1126,7 +1128,8 @@ else if ($term || $browse)
. ($searchType == "poll" ? "&poll" : "")
. ($searchType == "member" ? "&member" : "")
. ($searchType == "comp" ? "&comp" : "")
- . ($searchType == "tag" ? "&tag" : ""),
+ . ($searchType == "tag" ? "&tag" : "")
+ . (isset($_GET['showRatingBoxes']) ? "&showRatingBoxes" : ""),
$pg, $lastPage, $firstOnPage, $lastOnPage,
$rowcnt, true,
$rowcnt < $showAllMaxRows, $pgAll)
@@ -1249,8 +1252,11 @@ else if ($term || $browse)
$hids[$searchType] = '1';
if ($urlXL)
$hids['xlink'] = $extraLink;
+ echo "";
showSortingControls("searchOrder", "sortby", $sortList, $sortby,
$hids, "search");
+ $checked = isset($_GET['showRatingBoxes']) ? "checked" : "";
+ echo " Show rating boxes
";
// show the page controls at the top of the results;
// if all of the results fit on one page, don't bother with
@@ -1424,9 +1430,16 @@ else if ($term || $browse)
if ($playtime != "")
echo "$playtime
";
- echo "";
+ echo "";
+
+ if ($curuser) {
+ showHaveYouPlayedThisCtl($db, $curuser, $id, $row['current_user_rating'], $row['current_user_has_review'],
+ 'searchRatingBox' . (isset($_GET['showRatingBoxes']) ? '' : ' hidden'));
+ }
+
+ echo "";
break;
-
+
case "list":
// get the row data
$id = $row['id'];
@@ -1583,6 +1596,36 @@ else if ($term || $browse)
if (!$api_mode) {
?>
+
+
+
0 as current_user_has_review";
+ }
$baseWhere = "";
$groupBy = "";
$baseOrderBy = "";
$tableList = "games
join ".getGameRatingsView($db)." on games.id = gameid";
+ if ($curuser) {
+ $tableList .= " left outer join reviews on games.id = reviews.gameid and reviews.userid = '$curuser'";
+ }
$matchCols = "title, author, `desc`, tags";
$likeCol = "title";
$summaryDesc = "Games";
diff --git a/www/starctl.php b/www/starctl.php
index 1295e08e..e8b86ac5 100644
--- a/www/starctl.php
+++ b/www/starctl.php
@@ -1,24 +1,6 @@
-
- "
+ $str .= " "
. ""
. ($i === 1 ? "1 star": "$i stars")
." ";
}
- $str .= addEventListener("change", "$clickFunc(event.target.value)");
+ $str .= addEventListener("change", "$clickFunc('$gameid', event.target.value)");
$str .= "Remove Rating"
- . addEventListener("click", "setStarCtlValue('$id', 0); $clickFunc(0);")
+ . addEventListener("click", "setStarCtlValue('$id', 0); $clickFunc('$gameid', 0);")
." ";
diff --git a/www/viewgame b/www/viewgame
index 93a4d7e6..6f4c78ad 100644
--- a/www/viewgame
+++ b/www/viewgame
@@ -14,6 +14,7 @@ include_once "game-rss.php";
include_once "gameinfo.php";
include_once "commentutil.php";
include_once "news.php";
+include_once "viewgame-components/have-you-played.php";
$db = dbConnect();
$curuser = checkPersistentLogin();
@@ -896,19 +897,12 @@ echo helpWinLink("help-ifid", "IFID");
Read More
-
-
-
-
-
-
-
- Have you played this game?
+
+
+
-
-
+
+
+