News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Post moderation menu notification

Started by asmith, January 11, 2016, 02:46:28 AM

Previous topic - Next topic

asmith

Hello,

When post moderation is on, new posts number doesn't show on the main menu. I mean the same way we get error log numbers.

Reviewing the codes, I understand that it is board-based and it depends whether or not the moderator has access to that board. I did a dirty hack like this for one particular member just to get things going for now (small forum):


$request = $smcFunc['db_query']('', '
SELECT SUM(unapproved_posts)
FROM {db_prefix}boards AS b
WHERE {query_see_board}',
array()
);


But it is possible to save a cache of boards' unapproved stuff by their id_board (serialized into $modSettings) and depending on what boards the user is allowed to approve posts, it just sums up their boards unapproved number and finally injecting it into menu buttons moderate key.

Am I missing something so obvious here?
I don't think email notification is enough.

Illori

are you using SMF 2.1?

i think something like this was tested and due to caching the number of unapproved posts or topics was not correct unless the user could approve posts in all boards.

asmith

Yes I'm using SMF 2.1.

Why the number of unapproved posts/topics would be incorrect? Also the overhead of some recount function would be so small.


Kindred

Actually, the overhead of counting posts in almost any way is NEVER "small"
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

asmith

We already have the unapproved numbers in the boards table, so it is actually fetching boards' IDs and their unapproved numbers (not recounting posts) which could be put into scheduled tasks. (if the incorrect number is really big an issue)

Maybe the most icky part is to query permissions table to see what boards the user is allowed to approve_posts.
Anyway I'm sure SMF must show some sort of menu notification for it, be it just an Astrix.

Advertisement: