Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c33d887
incoming-schema-changes.sql: Add game_filter column to users table
alice-blue Dec 4, 2024
15dd836
editprofile: add game filter section to settings page
alice-blue Dec 4, 2024
483be87
Update searchutil.php to handle custom game filters
alice-blue Dec 4, 2024
6ec9ad0
Update search page to handle custom filters
alice-blue Dec 4, 2024
e0198ef
Update ifdb-recommends.php to handle custom game filters
alice-blue Dec 4, 2024
d6421d7
Misc fixes
alice-blue Dec 4, 2024
84ec727
Revise message to make it clear that results were actually filtered
alice-blue Dec 5, 2024
6b05a60
Make a function to generate the "games were filtered" message since i…
alice-blue Dec 5, 2024
a0f8cbf
newitems.php: Modify getNewItems function to deal with game filters
alice-blue Dec 8, 2024
5cfbedb
allnew: show "games were filtered" message
alice-blue Dec 8, 2024
9066155
searchutil.php: revise the games filtered announcement function so th…
alice-blue Dec 8, 2024
9fd2143
search: use new parameters for filtered game message function
alice-blue Dec 8, 2024
afb1b7d
home: add $game_filter_was_applied
alice-blue Dec 8, 2024
d5e78b5
Update competitions.php: add $game_filter_was_applied
alice-blue Dec 8, 2024
1b15649
Update recommended-lists.php: add $game_filter_was_applied
alice-blue Dec 8, 2024
7740129
Update reviews.php: add $game_filter_was_applied
alice-blue Dec 8, 2024
dc02597
games.php: add $game_filter_was_applied
alice-blue Dec 8, 2024
08b3e2b
allnew: Remember if we're overriding the game filter when going to an…
alice-blue Dec 8, 2024
acfc5b2
search: When we go to the next page of results, remember if we're ov…
alice-blue Dec 8, 2024
6768a79
searchutil.php: Avoid implying that results were hidden, since we don…
alice-blue Dec 8, 2024
89abff7
searchutil.php: the --> that
alice-blue Dec 8, 2024
61fbf4c
add lastReviewDate column to gameRatingsSandbox0_mv
alice-blue Jan 11, 2025
5b7854f
add lastreviewdate to line 430
alice-blue Jan 16, 2025
ee2c725
compute the maximum lastReviewDate of all of the grouped rows where h…
alice-blue Jan 16, 2025
235cde7
game id for testing
alice-blue Jan 16, 2025
e30b238
comment out specific game that we were testing
alice-blue Jan 16, 2025
5afce90
lastReviewDate --> lastRatingDate
alice-blue Jan 17, 2025
e81351f
lastRatingDate --> lastRatingOrReviewDate
alice-blue Jan 17, 2025
1c43e30
put lastReviewDate in all the right places
alice-blue Jan 17, 2025
86352e0
; --> ,
alice-blue Jan 17, 2025
f6d9984
+ key
alice-blue Jan 17, 2025
5753fb8
trying to sort by the lastReview column
alice-blue Jan 17, 2025
b2dfe67
remove lines for specific game being tested
alice-blue Jan 18, 2025
f6276fb
limit to 100 resuults
alice-blue Jan 18, 2025
a55a0ed
Update comments
alice-blue Jan 18, 2025
255a5df
oops, $limit should be a clause
alice-blue Jan 18, 2025
fe0e521
unscrub-ifarchive.sql: tinyint --> datetime
alice-blue Jan 18, 2025
207acf6
add "lastreview:" search prefix
alice-blue Jan 18, 2025
b0de404
newitems.php: Add "lastReviewDate:90d-" to search term when looking f…
alice-blue Jan 18, 2025
a6d0fcd
newitems: when fetching reviews and a filter is applied, look for gam…
alice-blue Jan 18, 2025
9519782
revise comments
alice-blue Jan 18, 2025
2449900
misc fixes
alice-blue Jan 18, 2025
69c1c3a
explain "lastreview:" in the comments
alice-blue Jan 18, 2025
d0f1a38
comment
alice-blue Jan 18, 2025
52c172b
Merge branch 'main' into filter-games-version-3
alice-blue Jan 18, 2025
157bf5f
searchutil.php: Add $count_all_possible_rows parameter to doSearch
alice-blue Jan 19, 2025
310ebac
ifdb-recommends.php: Use $count_all_possible_rows parameter in call t…
alice-blue Jan 19, 2025
be1f667
review: Use $count_all_possible_rows parameter and $override_game_fil…
alice-blue Jan 19, 2025
0954a8b
search: Use $count_all_possible_rows parameter in call to doSearch
alice-blue Jan 19, 2025
db7086a
editgame: Use $count_all_possible_rows and $override_game_filter para…
alice-blue Jan 19, 2025
9bc40d4
length($rows) --> count($rows) (to get rid of fatal error)
alice-blue Jan 19, 2025
166f2f6
$where --> !$term
alice-blue Jan 19, 2025
b571fc5
Combine conditions & comments
alice-blue Jan 19, 2025
8796aec
Merge branch 'main' into doSearch-need_total_rows-parameter
alice-blue Jan 20, 2025
f3d6803
Merge branch 'main' into filter-games-merged
dfabulich Jan 22, 2025
663cef4
Merge branch 'ifdb-recommends-performance' into filter-games-merged
dfabulich Jan 22, 2025
30cc954
Merge branch 'use-doSearch-for-newitems' into filter-games-merged
dfabulich Jan 22, 2025
07c67d6
Merge pull request #9 from dfabulich/filter-games-merged
alice-blue Jan 22, 2025
319a01e
searchutil.php: remove redundant lines
alice-blue Jan 22, 2025
9ce96d2
editprofile: update description of game filtering to say it applies t…
alice-blue Jan 23, 2025
1003e84
newitems.php: leave out the last review date limit if we need 20+ rev…
alice-blue Jan 23, 2025
4510639
use clearer variable to accomplish the same effect
alice-blue Jan 23, 2025
7f4e701
Mention that this applies to the "New Reviews on IFDB" page
alice-blue Jan 23, 2025
a32141f
Merge branch 'main' into filter-games-version-3
dfabulich Feb 3, 2025
37a1f48
Always search games to find new reviews
dfabulich Feb 3, 2025
b29b7ea
Merge branch 'searchutil-inner-join-gameratings' into always-search-g…
dfabulich Feb 3, 2025
41094c4
newitems.php: get $game_filter_was_applied from doSearch
alice-blue Feb 4, 2025
e9974e7
Update newitems.php
alice-blue Feb 4, 2025
c521685
Merge pull request #10 from dfabulich/always-search-games-for-new-rev…
alice-blue Feb 4, 2025
daef845
Add `lastReviewDate` to `gameRatingsSandbox01`
dfabulich Aug 18, 2025
8d207a2
Patch full schema
dfabulich Aug 18, 2025
299d173
Merge pull request #11 from dfabulich/sandboxed-lastReviewDate
alice-blue Aug 19, 2025
2c2c481
Merge pull request #12 from dfabulich/filter-games-patch-full-schema
alice-blue Aug 19, 2025
b449361
Merge branch 'main' into filter-games-version-3
alice-blue Aug 19, 2025
bf96322
Fix `refresh_gameRatingsSandbox0_mv` stored procedure
dfabulich Aug 28, 2025
fdd17d4
Merge pull request #13 from dfabulich/fix-mv-last-review-date
alice-blue Aug 30, 2025
f5250d3
Remove "lastreview" search prefix from searchutil.php
alice-blue Aug 30, 2025
9e4b42b
Add view and materialized view to track recent game news
alice-blue Aug 31, 2025
4c3d00c
Exclude deleted news items
alice-blue Sep 1, 2025
8934fb5
Add key (game_id) to recentgamenews materialized view
alice-blue Sep 1, 2025
069f447
gametimes --> recentgamenews
alice-blue Sep 1, 2025
5690ec5
Add a recent_game_news sorting option to the $sortList in searchutil.…
alice-blue Sep 1, 2025
c7c7b51
Explain what A means
alice-blue Sep 1, 2025
8d7c167
newitems.php: In the game news query, limit results to games that mat…
alice-blue Sep 1, 2025
d8d8dcb
newitems.php: Change recentgamenews_mv.game_id to g.id
alice-blue Sep 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sql/incoming-schema-changes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ alter table reviewvotes
add column `createdate` datetime NOT NULL DEFAULT current_timestamp(),
add PRIMARY KEY (`reviewvoteid`)
;

-- Add column for game search filter to the users table

ALTER TABLE `users` ADD COLUMN `game_filter` VARCHAR(150) DEFAULT '';
14 changes: 12 additions & 2 deletions www/allnew
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,27 @@ if ($pg < 1)
$pg = 1;

$showFlagged = isset($_GET['showFlagged']) && $_GET['showFlagged'];
$override_game_filter = get_req_data('nogamefilter');

// calculate where that puts us in the results
$firstOnPage = ($pg - 1) * PER_PAGE;
$lastOnPage = $firstOnPage + PER_PAGE - 1;

// query the items
$items = getNewItems($db, $lastOnPage + 1, $type);
list($items, $game_filter_was_applied) = getNewItems($db, $lastOnPage + 1, $type, $override_game_filter);
$tot = count($items);

$params = [];
if ($showFlagged) $params['showFlagged'] = 1;
if ($reviews) $params['reviews'] = "";

// set up the page controls
$game_filter_parameter = "";
if ($override_game_filter) {
$game_filter_parameter = "&nogamefilter=1";
}
$pageCtl = "<span class=details>"
. makePageControl("allnew?" . http_build_query($params), $pg, $pg + ($tot > PER_PAGE ? 1 : 0),
. makePageControl("allnew?" . http_build_query($params) . $game_filter_parameter, $pg, $pg + ($tot > PER_PAGE ? 1 : 0),
$firstOnPage, $lastOnPage, -1,
false, false, false)
. "</span>";
Expand All @@ -53,6 +58,11 @@ showNewItems($db, $firstOnPage, $lastOnPage, $items, ['showFlagged' => $showFlag
echo "<p><hr class=dots><p>$pageCtl<br>\n";
echo "</div>"; // prerender-moderate

if ($game_filter_was_applied) {
$games_filtered_announcement = writeGamesFilteredAnnouncement("all_new_reviews", null, null);
echo "<p class='details'>" . $games_filtered_announcement . "<p>";
}

// end the page
pageFooter();

Expand Down
4 changes: 2 additions & 2 deletions www/components/competitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<?php

// get the latest competitions and competition news
$items = getNewItems($db, 7, NEWITEMS_COMPS | NEWITEMS_COMPNEWS);
list($items, $game_filter_was_applied) = getNewItems($db, 7, NEWITEMS_COMPS | NEWITEMS_COMPNEWS);

for ($idx = 0 ; $idx <= 7; $idx++)
{
Expand Down Expand Up @@ -72,4 +72,4 @@
<p><span class=details>
<a href="/search?browse&comp">Browse competitions</a> |
<a href="/search?comp">Search competitions</a>
</span></p>
</span></p>
2 changes: 1 addition & 1 deletion www/components/games.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
define("ENABLE_IMAGES", 1);

// get the latest games and game news
$items = getNewItems($db, 6, NEWITEMS_GAMES | NEWITEMS_GAMENEWS);
list($items, $game_filter_was_applied) = getNewItems($db, 6, NEWITEMS_GAMES | NEWITEMS_GAMENEWS);

// show the items
$totcnt = count($items);
Expand Down
5 changes: 3 additions & 2 deletions www/components/ifdb-recommends.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ function sortBySortorder($a, $b)
$maxpicks = 12; // Get the first twelve results. (We want extras so we're not always displaying the same games.)
$limit = "limit 0, $maxpicks";
$browse = 0;
$override_game_filter = 0;


// run the search for highly-rated games
list($recs, $rowcnt, $sortList, $errMsg, $summaryDesc, $badges,
$specials, $specialsUsed, $orderBy) =
doSearch($db, $term, $searchType, $sortby, $limit, $browse);
$specials, $specialsUsed, $orderBy, $games_were_filtered) =
doSearch($db, $term, $searchType, $sortby, $limit, $browse, $override_game_filter);


// show some recommendations
Expand Down
4 changes: 2 additions & 2 deletions www/components/recommended-lists.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<?php

// get the latest lists
$items = getNewItems($db, 10, NEWITEMS_LISTS);
list($items, $game_filter_was_applied) = getNewItems($db, 10, NEWITEMS_LISTS);

// show the items

Expand Down Expand Up @@ -66,4 +66,4 @@
<p><span class=details>
<a href="/search?browse&list">Browse lists</a> |
<a href="/search?list">Search lists</a>
</span></p>
</span></p>
2 changes: 1 addition & 1 deletion www/components/reviews.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class=headline id='reviews'><h1 class='unset'>Reviews</h1></div>
<?php
// get the latest reviews
$items = getNewItems($db, 7, NEWITEMS_REVIEWS);
list($items, $game_filter_was_applied) = getNewItems($db, 7, NEWITEMS_REVIEWS);

// show the items
$totcnt = count($items);
Expand Down
47 changes: 40 additions & 7 deletions www/editprofile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ $emailcloaked = (get_req_data('emailcloaked') != 0);
$gender = get_req_data('gender');
$offsite = get_req_data('offsite');
$accessibility = (get_req_data('accessibility') ? 1 : 0);
$game_filter = get_req_data('game_filter');

if (strlen($gender) != 1 || strpos("MF", $gender) === false)
$gender = "";
Expand All @@ -72,7 +73,7 @@ function showHiddenFields()
global $email, $email2, $pubemail, $dname, $loc, $profile, $pic,
$defaultOS, $mirror, $noExes,
$playlistPub, $wishlistPub, $unwishlistPub, $gender,
$emailcaptcha, $emailcloaked;
$emailcaptcha, $emailcloaked, $game_filter;

echo "<input type=hidden name=email value=\""
. htmlspecialcharx($email) . "\">"
Expand Down Expand Up @@ -103,6 +104,7 @@ function showHiddenFields()
. "<input type=hidden name=gender value=\"$gender\">"
. "<input type=hidden name=offsite value=\"$offsite\">"
. "<input type=hidden name=accessibility value=\"$accessibility\">"
. "<input type=hidden name=game_filter value=\"$game_filter\">"
. "<input type=hidden name=mirror value=\""
. htmlspecialcharx($mirror) . "\">"
. "<input type=hidden name=defaultos value=\""
Expand Down Expand Up @@ -135,7 +137,7 @@ function init()
$unwishlistPub, $oldUnwishlistPub, $gender, $oldGender,
$emailcaptcha, $oldEmailcaptcha, $emailcloaked, $oldEmailcloaked,
$mirror, $oldMirror, $actcode, $oldPicName, $offsite, $oldOffsite,
$accessibility, $oldAccessibility;
$accessibility, $oldAccessibility, $game_filter, $old_game_filter;

// connect to the database
if ($db == false) {
Expand All @@ -155,7 +157,7 @@ function init()
acctstatus, activationcode,
concat(defaultos, '.', ifnull(defaultosvsn,'')) as defaultos,
noexedownloads, publiclists, gender, emailflags,
offsite_display, accessibility
offsite_display, accessibility, game_filter
from
users
where
Expand Down Expand Up @@ -193,6 +195,7 @@ function init()
$oldEmailcloaked = (($emailflags & EMAIL_CLOAKED) ? 1 : 0);
$oldOffsite = mysql_result($result, 0, "offsite_display");
$oldAccessibility = mysql_result($result, 0, "accessibility");
$old_game_filter = mysql_result($result, 0, "game_filter");

// if we're not posting, populate the form with the current values
// from the database
Expand All @@ -215,6 +218,7 @@ function init()
$mirror = $oldMirror;
$offsite = $oldOffsite;
$accessibility = $oldAccessibility;
$game_filter = $old_game_filter;
}

// if the current cover art setting refers to an uploaded image
Expand All @@ -237,8 +241,8 @@ function saveChanges()
$unwishlistPub, $oldUnwishlistPub,
$gender, $oldGender, $emailcaptcha, $oldEmailcaptcha,
$emailcloaked, $oldEmailcloaked, $mirror, $oldMirror, $actcode,
$offsite, $oldOffsite, $accessibility, $oldAccessibility,
$captchaKey, $captchaOK, $captchaErr;
$offsite, $oldOffsite, $accessibility, $oldAccessibility, $game_filter,
$old_game_filter, $captchaKey, $captchaOK, $captchaErr;

// no new picture yet
$imgID = false;
Expand All @@ -260,7 +264,8 @@ function saveChanges()
|| $gender != $oldGender
|| $mirror != $oldMirror
|| $offsite != $oldOffsite
|| $accessibility != $oldAccessibility)
|| $accessibility != $oldAccessibility
|| $game_filter != $old_game_filter)
{
// if we're changing the email address, we'll need to reactivate
if (strcmp($email, $oldemail) != 0) {
Expand Down Expand Up @@ -309,6 +314,7 @@ function saveChanges()
$qpubemail = mysql_real_escape_string($pubemail, $db);
$qloc = mysql_real_escape_string($loc, $db);
$qprofile = mysql_real_escape_string($profile, $db);
$qgamefilter = mysql_real_escape_string($game_filter, $db);

// make sure the location doesn't contain a url
if (preg_match("/http:/i", $loc)) {
Expand Down Expand Up @@ -570,7 +576,8 @@ complete the re-activation process.</b>
noexedownloads = '$qNoExes', publiclists = '$qPublicLists',
gender = '$qGender', emailflags = '$emailflags',
offsite_display = '$qOffsite',
accessibility = '$qAccessibility'
accessibility = '$qAccessibility',
game_filter = '$qgamefilter'
$setPic
where id = '$usernum'", $db) == false) {
$errFlagged = "An error occurred updating the database. You might
Expand Down Expand Up @@ -924,6 +931,32 @@ captchaSupportScripts($captchaKey);

</div>

<h2>5. Game Filtering</h2>

<div class=indented>
<p><span class=details>To limit what kinds of games appear on the
<a href="/search" target="_blank">search page</a> and on the
<a href="/search?browse" target="_blank">browse page</a>, you can
create a filter using IFDB's
<a href="/search" target="_blank">search prefixes</a>.
For instance, to hide games in a certain language, games in a
certain genre, and games with a certain tag, you can type
<br><b>-language:example -genre:example -tag:example</b><br>
(replacing "example" with the name of the language, genre, or tag).
While you are logged in, your saved filter will automatically be
be added to the end of your search terms when you search for games.
The filter will also be applied when you browse games on the browse
page. At the bottom of the page of results, there will be an option
to search again without the filter. (Note: Game information on IFDB
is incomplete and can have mistakes. A filter is not a reliable way
to make sure that games are kid-friendly.)
</span>
<p><label for='game_filter'>Game filter:</label>
<input type='text' name='game_filter' id='game_filter' maxlength=150 size=40 value="<?php echo htmlspecialcharx($game_filter) ?>"></span>

</div>


<br><br>
<input type=submit value="Save Changes" name="save">
<input type=submit value="Cancel" name="cancel">
Expand Down
4 changes: 2 additions & 2 deletions www/home
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if ($debugflag) echo "debug mode enabled...<br>";
<?php
// get the latest site news, polls, competitions, and lists, and show a mix
$itemTypes = NEWITEMS_SITENEWS | NEWITEMS_LISTS | NEWITEMS_POLLS | NEWITEMS_COMPS | NEWITEMS_COMPNEWS;
$items = getNewItems($db, 8, $itemTypes, [
list($items, $game_filter_was_applied) = getNewItems($db, 8, $itemTypes, [
'sitenews_limit' => 1,
'lists_limit' => 2,
'polls_limit' => 2,
Expand All @@ -137,7 +137,7 @@ if ($debugflag) echo "debug mode enabled...<br>";
'enableImages' => false,
]);
} else {
$items = getNewItems($db, 1, $itemTypes);
list($items, $game_filter_was_applied) = getNewItems($db, 1, $itemTypes);
showNewItems($db, 0, 0, $items, [
'allowHiddenBanner' => false,
'showDescriptions' => false,
Expand Down
67 changes: 59 additions & 8 deletions www/newitems.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

include_once "searchutil.php";

define("NEWITEMS_SITENEWS", 0x0001);
define("NEWITEMS_GAMES", 0x0002);
define("NEWITEMS_LISTS", 0x0004);
Expand All @@ -20,7 +22,7 @@
| NEWITEMS_COMPNEWS
);

function getNewItems($db, $limit, $itemTypes = NEWITEMS_ALLITEMS, $options = [])
function getNewItems($db, $limit, $itemTypes = NEWITEMS_ALLITEMS, $options = [], $override_game_filter = 0)
{
$days = $options['days'] ?? null;

Expand All @@ -37,6 +39,11 @@ function getNewItems($db, $limit, $itemTypes = NEWITEMS_ALLITEMS, $options = [])
. "and filtertype = 'K') = 0";
}

$override_game_filter = get_req_data('nogamefilter');

// So far, we have not applied a custom game filter
$game_filter_was_applied = 0;

// Include only reviews from our sandbox or sandbox 0 (all users)
$sandbox = "(0)";
if ($curuser)
Expand Down Expand Up @@ -167,6 +174,36 @@ function getNewItems($db, $limit, $itemTypes = NEWITEMS_ALLITEMS, $options = [])

if ($itemTypes & NEWITEMS_REVIEWS) {
$reviews_limit = $options['reviews_limit'] ?? $limit;
$reviews_limit_clause = "";
// deal with custom game filters
$game_filter = "";
$gameids_after_filtering = [];
if ($curuser && $override_game_filter != 1) {
$result = mysqli_execute_query($db, "select game_filter from users where id = ?", [$curuser]);
if (!$result) throw new Exception("Error: " . mysqli_error($db));
[$game_filter] = mysql_fetch_row($result);
if ($game_filter != "") {
// Find games that have at least one review, and use the custom game filter to filter them
$term = "#reviews:1-";
$searchType = "game";
$sortby = "lnew";
$limit = null;
Comment thread
dfabulich marked this conversation as resolved.
Outdated
$browse = 0;
list($game_rows_after_filtering, $rowcnt, $sortList, $errMsg, $summaryDesc, $badges, $specials, $specialsUsed, $orderBy) =
doSearch($db, $term, $searchType, $sortby, $limit, $browse);
// Note the gameids of games that we might want to display reviews for
foreach ($game_rows_after_filtering as $game_row) {
$gameids_after_filtering[] = $game_row['id'];
}
$game_filter_was_applied = 1;
}
}
if (!$game_filter_was_applied) {
// We're not applying a game filter, so we don't need extra reviews. (We only need extras if some of them might get filtered out.)
// That means we can use a limit clause for reviews.
$reviews_limit_clause = "limit $reviews_limit";
}
// prepare to query reviews
if ($days) $dayWhere = "greatest(reviews.createdate, ifnull(reviews.embargodate, '0000-00-00')) > date_sub(now(), interval $days day)";
// query the recent reviews (minus plonks)
$anp = str_replace('#USERID#', 'reviews.userid', $andNotPlonked);
Expand Down Expand Up @@ -199,11 +236,25 @@ function getNewItems($db, $limit, $itemTypes = NEWITEMS_ALLITEMS, $options = [])
and $dayWhere
$anp
order by d desc, id desc
limit $reviews_limit", $db);
$reviews_limit_clause", $db);
$revcnt = mysql_num_rows($result);
for ($i = 0 ; $i < $revcnt ; $i++) {
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$items[] = array('R', $row['d'], $row);
if ($game_filter != "") {
for ($i = 0 ; $i < $revcnt ; $i++) {
$row = mysql_fetch_array($result, MYSQL_ASSOC);
// Only add the review to $items if it matches a gameid
// in $gameids_after_filtering
if (in_array($row['gameid'], $gameids_after_filtering)) {
$items[] = array('R', $row['d'], $row);
if ( count($items) == $reviews_limit ) {
break;
}
}
}
} else {
for ($i = 0 ; $i < $revcnt ; $i++) {
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$items[] = array('R', $row['d'], $row);
}
}
}

Expand Down Expand Up @@ -252,7 +303,7 @@ function getNewItems($db, $limit, $itemTypes = NEWITEMS_ALLITEMS, $options = [])
usort($items, "sortNewItemsByDate");

// return the item list
return $items;
return array($items, $game_filter_was_applied);
}

// sorting callback: sort from newest to oldest
Expand Down Expand Up @@ -351,7 +402,7 @@ function showNewItems($db, $first, $last, $items, $options = [])
$itemTypes = $options['itemTypes'] ?? NEWITEMS_ALLITEMS;
// if the caller didn't provide the new item lists, query them
if (!$items)
$items = getNewItems($db, $last, $itemTypes, $options);
list($items, $game_filter_was_applied) = getNewItems($db, $last, $itemTypes, $options);

// show them
showNewItemList($db, $first, $last, $items, $options);
Expand Down Expand Up @@ -718,7 +769,7 @@ function showNewItemList($db, $first, $last, $items, $options)
function showNewItemsRSS($db, $showcnt)
{
// query the new items
$items = getNewItems($db, $showcnt - 1);
list($items, $game_filter_was_applied) = getNewItems($db, $showcnt - 1);
$totcnt = count($items);

$lastBuildDate = false;
Expand Down
Loading