News:

Wondering if this will always be free?  See why free is better.

Main Menu

Unapproved Posts on Moderate Button

Started by grafitus, January 26, 2011, 10:53:11 PM

Previous topic - Next topic

grafitus

Link to Mod

Unapproved Posts on Moderate Button
This mod put a counter to Moderate button about the number of the unapproved posts. The mod don't need any file and language changes.

Donate

Blade_Runner

Thanks for this great mod!
You did not update the version number in the "Package Manager" page. It is still showing version 1.0.
I think it would also be a good idea to include the version number in the filename. People can know which file they have already downloaded.

Chas Large

Thanks for this mod.

The number only shows when the moderate button is clicked. Could it be changed such that it appears there all the time, to act as an alert that some posts need attention?

Cheers

Chas.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

RICH BEAST

Quote from: Chas Large on January 06, 2013, 09:03:59 AM
Thanks for this mod.

The number only shows when the moderate button is clicked. Could it be changed such that it appears there all the time, to act as an alert that some posts need attention?

Cheers

Chas.
Yes please.

margarett

For anyone interested, the MOD behavior with the coded caching isn't correct. For it to work correctly, the cache should be dismissed.

Do note that this will add 2 significant (a.k.a. heavy) queries for EVERY page load, for EVERY user allowed to approve posts.

Subs-ModerateButton.php, find:
if (($context['total_unapproved_posts'] = cache_get_data('total_unapproved_posts', 3600)) === null)
Replace with:
if  ($approve_query != ' AND 0')
Find and remove
cache_put_data('total_unapproved_posts', $context['total_unapproved_posts'], 3600);

Find:
if (($context['total_unapproved_topics'] = cache_get_data('total_unapproved_topics', 3600)) === null)
Replace with:
if  ($approve_query != ' AND 0')
Find and remove
cache_put_data('total_unapproved_topics', $context['total_unapproved_topics'], 3600);

Disclaimer: I didn't exactly tested this :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

RICH BEAST

Quote from: margarett on September 13, 2015, 07:03:23 PM
For anyone interested, the MOD behavior with the coded caching isn't correct. For it to work correctly, the cache should be dismissed.

Do note that this will add 2 significant (a.k.a. heavy) queries for EVERY page load, for EVERY user allowed to approve posts.

Subs-ModerateButton.php, find:
if (($context['total_unapproved_posts'] = cache_get_data('total_unapproved_posts', 3600)) === null)
Replace with:
if  ($approve_query != ' AND 0')
Find and remove
cache_put_data('total_unapproved_posts', $context['total_unapproved_posts'], 3600);

Find:
if (($context['total_unapproved_topics'] = cache_get_data('total_unapproved_topics', 3600)) === null)
Replace with:
if  ($approve_query != ' AND 0')
Find and remove
cache_put_data('total_unapproved_topics', $context['total_unapproved_topics'], 3600);

Disclaimer: I didn't exactly tested this :P
Worked perfectly, good job & thank you.

Advertisement: