MyBB Community Forums

Full Version: Search Get Daily Gone Wrong?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Running latest version of MyBB, php 7.4.33.

The getdaily search link works normally for logged in users. BUT is completely different for logged out users. Its not even showing posts from within the last 24 hrs...

<a href="/search.php?action=getdaily" class="button">View Today's Posts</a>

As a guest:
[attachment=45799]

As a member:
[attachment=45800]

Guests are not limited in viewing these boards where these threads are.
Well, this makes sense, it checks the access of user groups. 
check usergroup canview or cansearch then show result of that forum on search list
(2023-02-20, 11:29 PM)Taylor M Wrote: [ -> ]Guests are not limited in viewing these boards where these threads are.

^ They are not limited. They can search the website and view all of the boards.
Do you have any plugins that might be affecting permissions or searching? On the forums here I get the same results, and looking at the code there's nothing done differently for guests vs logged in users, aside from permission checks. The threads that show for members but not for guests, can you definitely view those threads as a guest if you go to them directly?
Guests can navigate all boards and see/read all threads if they browse through. It’s just search function that’s being limited but there’s no limitations set for them.

I’ve never had trouble with any of these plugins before (other than stream not grouping events) and from my understanding none of them link to any part of search or thread/post visibility?

Plugins:
Account Switcher
Automention
Content Restricted (Age Verification Cookie)
Dice Roller MyCode
Discord Right Sync
Date of Birth On Registration
DVZ Mentions
DVZ Stream
MyAlerts
Newpoints
OUGC Awards
PHP and Template Conditionals
Staff Page
Style Usernames
Threadlog
Trash Bin
There must be a limit set somewhere and a forum being excluded, it's a fairly basic query it runs.

Edit search.php, around line 1498, before:

$tids  = '';

add:

if ($mybb->input['test']) {
	var_dump($where_sql);exit;
}

Then go to search.php?action=getdaily&test=1 as a guest and logged in and it'll output the query where clause. If no forums are restricted it should just have a check for lastpost and visible >= -1, but yours will likely have something different between them.
As Guest:
string(118) "lastpost >='1676933599' AND fid NOT IN ('2','7','23','11','9','10','8','13','4') AND fid NOT IN (13) AND (visible = 1)"

As Member:
string(85) "lastpost >='1676933662' AND fid NOT IN ('13') AND fid NOT IN (13) AND (visible >= -1)"

I'm assuming that means that all of those FID's in the guest string are hidden from them?

Looking at Guest usergroup perms "Can view board?" is enabled.

Then looking at Guest usergroup perms for each of those boards the "View" option is in the left column for "Overview: Allowed Actions".
There is a "Can search forum?" permission in the Miscellaneous tab when setting custom permissions, it's likely that is disabled for some reason.
(2023-02-21, 10:59 PM)Matt Wrote: [ -> ]There is a "Can search forum?" permission in the Miscellaneous tab when setting custom permissions, it's likely that is disabled for some reason.

Not sure how it happened as I didn't set any "custom" permissions other than dragging the basic "view", "new thread", "new reply", and "polls" options around. But that was the problem! Its weird because it was only like that on the boards I made weeks ago. But all the new ones I made the other day weren't included.

Anyways, thanks Matt!
No worries Smile It's possible maybe it was changed at usergroup level at some point as I believe the initial permissions inherit from the usergroup. So if in the past guests were set not to be able to search but that was the changed, older forums would have it disabled but newer would have it enabled.