-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOHIDEALL button on user profile page. #926
Comments
The requirement makes sense (assuming you meant does not have any visible posts). The implementation you suggest, however, is inefficient. If a user has X visible posts, you would be getting from the database to the memory X post ids just to check if there is at least 1, each time a user profile page is displayed to a Moderator+. It would make more sense to only check if there is at least one. That would only require a single boolean and will not hit the database so hard. Considering you have development experience, do you think you could provide a pull request for this? Officially this should go to |
yes, i meant posts. And the above function is retries all data of users visible posts, so as you said it is redundant. So, if it is okay, I can write a new function that counts if any visible posts and returns true/false boolean. |
Exactly. Something like |
is this okay?
|
Just a few comments: The fact that the function returns one value (such as a SELECT 1 FROM ^posts
WHERE userid = $ AND type IN ('Q', 'A', 'C', 'Q_QUEUED', 'A_QUEUED', 'C_QUEUED')
LIMIT 1 BTW, If the function is called The comparison of the I'd say there's no need for the Those are all the things I can think of :) |
ok it makes sense now, and should queued posts be considered as visible ones or not ? |
Considering visible posts are not hidden posts, then they are visible. |
I noticed that "dohideall" button appears on users profile page even if the user does not have any visible posts. Logically, the button should not be displayed if the user does not have any visible questions. This can be fixed with function qa_db_get_user_visible_postids($userid) and with implementing if statement on result of that function.
The text was updated successfully, but these errors were encountered: