From 6e5890efd70cc7961b12db472c418a498d3bd508 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Mon, 1 Jun 2026 20:04:00 +0300 Subject: [PATCH 1/9] have-you-played: Remove \n"; echo "
" @@ -74,7 +70,7 @@ function updateUnwishList(id, stat) . "Rate it: " . showStarCtl("ratingStars", $currentUserRating, "updateRating", "mouseOutRating") - . "" + . "" . " - " From ca873e3e8979d33e51a09d445a05ad768a4726ea Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Tue, 7 Oct 2025 22:44:09 +0300 Subject: [PATCH 3/9] Remove unused argument to showStarCtl --- www/editgame | 3 +-- www/viewgame-components/have-you-played.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/www/editgame b/www/editgame index 63d24617..0a4e4375 100644 --- a/www/editgame +++ b/www/editgame @@ -1736,8 +1736,7 @@ function onComboSelectReviewSite(val)

Rating:
If the site uses a different rating diff --git a/www/viewgame-components/have-you-played.php b/www/viewgame-components/have-you-played.php index c693174c..44a43650 100644 --- a/www/viewgame-components/have-you-played.php +++ b/www/viewgame-components/have-you-played.php @@ -67,8 +67,7 @@ function updateUnwishList(id, stat) . "
" . "Rate it: " - . showStarCtl("ratingStars", $currentUserRating, - "updateRating", "mouseOutRating") + . showStarCtl("ratingStars", $currentUserRating, "updateRating") . "" . " - tag to replace inline event attributes function addEventListener($event, $code) { global $nonce; diff --git a/www/review b/www/review index b9c3b417..613f9be5 100644 --- a/www/review +++ b/www/review @@ -752,7 +752,7 @@ if (isset($missingFields['rating'])) 1. Rate this game on a scale of 1 to 5 stars (5 is best):
You don't have to rate the game to diff --git a/www/starctl.php b/www/starctl.php index cbf66ec1..e8b86ac5 100644 --- a/www/starctl.php +++ b/www/starctl.php @@ -1,6 +1,6 @@ " + $str .= "" . ""; } - $str .= addEventListener("change", "$clickFunc(event.target.value)"); + $str .= addEventListener("change", "$clickFunc('$gameid', event.target.value)"); $str .= "
"; diff --git a/www/viewgame b/www/viewgame index 93a4d7e6..8936b7c7 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");
- - - - - + + +" data-gameid="">

Have you played this game?

@@ -15,41 +22,6 @@ $result = mysqli_execute_query($db, "select userid from unwishlists where userid=? and gameid=?", [$curuser, $id]); $unwishlist = mysql_num_rows($result) > 0; - ?> - - " . "
" - . "Rate it: " - . showStarCtl("ratingStars", $currentUserRating, "updateRating") - . "" - . "" - . "
" + . "Rate it: " + . showStarCtl($id, "ratingStars_$id", $currentUserRating, "updateRating") + . "" + . "
" . "" . ($currentUserReview != "" ? "Revise my review" : "Review it") . "
" @@ -90,19 +50,19 @@ function updateUnwishList(id, stat) . "
" . "
"; - checkboxWrite("ckPlayed", "I've played it", $played, "updatePlayed"); + checkboxWrite("ckPlayed_$id", "I've played it", $played, "updatePlayed"); echo " (view)" - . "   " + . "   " . "
"; - checkboxWrite("ckWishList", "It's on my wish list", $wishlist, - "updateWishList"); + checkboxWrite("ckWishlist_$id", "It's on my wish list", $wishlist, + "updateWishlist"); echo " (view) " - . "   " + . "   " . "
"; - checkboxWrite("ckUnwishList", "I'm not interested", $unwishlist, - "updateUnwishList"); + checkboxWrite("ckUnwishlist_$id", "I'm not interested", $unwishlist, + "updateUnwishlist"); echo " (view) " - . "   " + . "   " . "
"; @@ -131,12 +91,12 @@ function updateUnwishList(id, stat) ?>
-
-Estimated play time: +
+Estimated play time: -
-Vote on how long it takes to finish this game.
+
+Vote on how long it takes to finish this game.
Tips
  • Vote only if you've played the game.
  • @@ -146,158 +106,28 @@ function updateUnwishList(id, stat)
  • Times don't need to be exact. Good-faith estimates are fine.
  • Your vote will be publicly attributed to you.
-

- - -

-

-

- +

+

+

+
-
-
- +
+
+
-
+
-
-

Your time has been submitted.

+
+

Your time has been submitted.

@@ -315,3 +145,7 @@ function prepareTimeControls() {
+ + From 9fa404379bb5e6a2d1fe114a1029a5808791c052 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Mon, 1 Jun 2026 20:56:02 +0300 Subject: [PATCH 5/9] have-you-played: Accept bool review, since contents are unused --- www/viewgame | 2 +- www/viewgame-components/have-you-played.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/viewgame b/www/viewgame index 8936b7c7..6f4c78ad 100644 --- a/www/viewgame +++ b/www/viewgame @@ -901,7 +901,7 @@ echo helpWinLink("help-ifid", "IFID"); // ------------ end of the external links table ----------------- if (!$downloadsView) { - showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, $currentUserReview); + showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, $currentUserReview !== ""); } ?> diff --git a/www/viewgame-components/have-you-played.php b/www/viewgame-components/have-you-played.php index e88de0d2..3d06ad65 100644 --- a/www/viewgame-components/have-you-played.php +++ b/www/viewgame-components/have-you-played.php @@ -2,7 +2,7 @@ include_once "starctl.php"; -function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, $currentUserReview) { +function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, bool $currentUserHasReview, bool $hidden = false) { ?> " data-gameid=""> @@ -41,7 +41,7 @@ function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, $curre . "" . "
" . "" - . ($currentUserReview != "" ? "Revise my review" : "Review it") + . ($currentUserHasReview ? "Revise my review" : "Review it") . "
" . "" . ($myCrossRecs ? "Edit my suggestions ($myCrossRecs)" From 415dcf2220cd49054db3e1998b468e4e434fe872 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Mon, 1 Jun 2026 13:02:39 +0300 Subject: [PATCH 6/9] Show have-you-played boxes in search page --- www/ifdb.css | 7 +++++++ www/search | 48 +++++++++++++++++++++++++++++++++++++++++++--- www/searchutil.php | 6 ++++++ 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/www/ifdb.css b/www/ifdb.css index 3cfbff88..ba9ce3bc 100644 --- a/www/ifdb.css +++ b/www/ifdb.css @@ -104,6 +104,13 @@ form.sortingControls { margin: 1em 0 1em 0; } +/* A box that has the sorting controls and other search result controls */ +.searchControls { + display: flex; + align-items: baseline; + column-gap: 5em; +} + /* The default style for cells within tables. We use the same style here as in the main page body. diff --git a/www/search b/www/search index c3c97359..50ed930c 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 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,15 @@ 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'], /* hidden */ !isset($_GET['showRatingBoxes'])); + } + + echo ""; break; - + case "list": // get the row data $id = $row['id']; @@ -1583,6 +1595,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"; From b9d8a4057bf0adcb0cf2165864c964a0fc97c8fa Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Tue, 2 Jun 2026 09:51:34 +0300 Subject: [PATCH 7/9] search: Add custom CSS to have-you-played box; hide some titles and tips --- www/ifdb.css | 13 ++++++++++++- www/search | 3 ++- www/viewgame-components/have-you-played.php | 16 ++++++++-------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/www/ifdb.css b/www/ifdb.css index ba9ce3bc..e6d7605c 100644 --- a/www/ifdb.css +++ b/www/ifdb.css @@ -571,10 +571,21 @@ td.coverart { white-space: nowrap; } -.viewgame__playedSection { +.haveYouPlayed_playedSection { margin: 1.25ex 0 0.75ex 0; } +.searchRatingBox { + width: 20rem !important; /* Overrides the 'width: 100%' in '.gamerightbar' */ + margin-left: auto !important; + margin-right: 100px !important; +} + +.searchRatingBox .haveYouPlayed_title, +.searchRatingBox .howLong { + display: none; +} + /* We use the "authorProfileLink" style for hyperlinks to author profiles, as shown in the author section of a game listing. We show these without diff --git a/www/search b/www/search index 50ed930c..ff9a37b1 100644 --- a/www/search +++ b/www/search @@ -1433,7 +1433,8 @@ else if ($term || $browse) echo ""; if ($curuser) { - showHaveYouPlayedThisCtl($db, $curuser, $id, $row['current_user_rating'], $row['current_user_has_review'], /* hidden */ !isset($_GET['showRatingBoxes'])); + showHaveYouPlayedThisCtl($db, $curuser, $id, $row['current_user_rating'], $row['current_user_has_review'], + 'searchRatingBox' . (isset($_GET['showRatingBoxes']) ? '' : ' hidden')); } echo ""; diff --git a/www/viewgame-components/have-you-played.php b/www/viewgame-components/have-you-played.php index 3d06ad65..c1d600eb 100644 --- a/www/viewgame-components/have-you-played.php +++ b/www/viewgame-components/have-you-played.php @@ -2,13 +2,13 @@ include_once "starctl.php"; -function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, bool $currentUserHasReview, bool $hidden = false) { +function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, bool $currentUserHasReview, string $extraClasses = '') { ?> -
" data-gameid=""> +
" data-gameid="">
-

Have you played this game?

+

Have you played this game?

" - . "
" + . "
" . "Rate it: " . showStarCtl($id, "ratingStars_$id", $currentUserRating, "updateRating") . "" @@ -49,7 +49,7 @@ function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, bool $ . "" . "
" - . "
"; + . "
"; checkboxWrite("ckPlayed_$id", "I've played it", $played, "updatePlayed"); echo " (view)" . "   " @@ -91,12 +91,12 @@ function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, bool $ ?>
-
+
Estimated play time:
-Vote on how long it takes to finish this game.
+
Vote on how long it takes to finish this game.
Tips
  • Vote only if you've played the game.
  • @@ -105,7 +105,7 @@ function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, bool $
  • To help players gauge how long a game with puzzles might take, you can note if your time is with or without hints.
  • Times don't need to be exact. Good-faith estimates are fine.
  • Your vote will be publicly attributed to you.
  • -
+

From f3f5d852136303ef3412ed6e9398690bb1c76b2c Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Fri, 5 Jun 2026 23:14:53 +0300 Subject: [PATCH 8/9] have-you-played: Reduce spacing between time input boxes --- www/ifdb.css | 4 ++++ www/viewgame-components/have-you-played.php | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/www/ifdb.css b/www/ifdb.css index e6d7605c..eb506eac 100644 --- a/www/ifdb.css +++ b/www/ifdb.css @@ -693,6 +693,10 @@ on the viewgame page display: none; } +.submitTimeSection > div { + margin-top: 1px; +} + /* The "downloads" section is for external links. */ diff --git a/www/viewgame-components/have-you-played.php b/www/viewgame-components/have-you-played.php index c1d600eb..6a81ec71 100644 --- a/www/viewgame-components/have-you-played.php +++ b/www/viewgame-components/have-you-played.php @@ -106,9 +106,9 @@ function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, bool $
  • Times don't need to be exact. Good-faith estimates are fine.
  • Your vote will be publicly attributed to you.
  • -

    -

    -

    +
    +
    +
    From 97f7bb4e6c61ff7823f1870d08847cf7bfbdba2f Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sat, 6 Jun 2026 00:11:02 +0300 Subject: [PATCH 9/9] have-you-played: Don't use table, replace 'gamerightbar' class with 'haveYouPlayed' --- www/ifdb.css | 22 ++++++++++----------- www/viewgame-components/have-you-played.php | 8 ++------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/www/ifdb.css b/www/ifdb.css index eb506eac..80ce5c38 100644 --- a/www/ifdb.css +++ b/www/ifdb.css @@ -576,7 +576,7 @@ td.coverart { } .searchRatingBox { - width: 20rem !important; /* Overrides the 'width: 100%' in '.gamerightbar' */ + width: 20rem !important; /* Overrides the 'width: 100%' in '.haveYouPlayed' */ margin-left: auto !important; margin-right: 100px !important; } @@ -656,27 +656,25 @@ the page. } /* - The "gamerightbar" table is the box on a game's listing page, + The "haveYouPlayed" class is the box on a game's listing page, underneath the Download box, where we display quick rating input links ("Have you played this game?"). */ - table.gamerightbar { - padding: 0 0 0 0; - margin: 0 0 0 0; + .haveYouPlayed { + padding: 3px; + margin: 0; background: #F0F0F0; border: thin dotted #e0e0e0; width: 100%; font-size: 80%; + height: fit-content; } - table.gamerightbar h3 { + .haveYouPlayed h3 { font: 100%/140% Verdana, Arial, Helvetica, Sans-Serif; font-weight: bold; color: #000080; margin: 0 0 0.5em 0; } - table.gamerightbar td { - padding: 0 0 0.5em 0; - } } /* @@ -2265,14 +2263,14 @@ span.sfl-save-autodesc { #externalLinks.downloads h3 { color: #d0d0ff; } - table.gamerightbar { + .haveYouPlayed { background: #101030; border: thin dotted #303030; } - table.gamerightbar td { + .haveYouPlayed { color: #d8d8d8; } - table.gamerightbar td h3 { + .haveYouPlayed h3 { color: #d0d0ff; } } diff --git a/www/viewgame-components/have-you-played.php b/www/viewgame-components/have-you-played.php index 6a81ec71..87bbf3a0 100644 --- a/www/viewgame-components/have-you-played.php +++ b/www/viewgame-components/have-you-played.php @@ -5,9 +5,7 @@ function showHaveYouPlayedThisCtl($db, $curuser, $id, $currentUserRating, bool $currentUserHasReview, string $extraClasses = '') { ?> -" data-gameid=""> - - - -
    +
    " data-gameid="">

    Have you played this game?

    -
    +