Advertisement:

Author Topic: Unapproved Posts on Moderate Button  (Read 4428 times)

Offline grafitus

  • SMF Hero
  • ******
  • Posts: 3,034
    • beratdogan on GitHub
    • beratdogan on LinkedIn
    • @beratdgan on Twitter
Unapproved Posts on Moderate Button
« on: January 26, 2011, 10:53:11 PM »
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

Offline Blade_Runner

  • Jr. Member
  • **
  • Posts: 247
Re: Unapproved Posts on Moderate Button
« Reply #1 on: June 14, 2011, 09:58:42 PM »
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.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,108
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Unapproved Posts on Moderate Button
« Reply #2 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.
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.

Offline RICH BEAST

  • Jr. Member
  • **
  • Posts: 101
Re: Unapproved Posts on Moderate Button
« Reply #3 on: September 11, 2015, 12:06:04 PM »
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.

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Unapproved Posts on Moderate Button
« Reply #4 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:
Code: [Select]
if (($context['total_unapproved_posts'] = cache_get_data('total_unapproved_posts', 3600)) === null)Replace with:
Code: [Select]
if  ($approve_query != ' AND 0')Find and remove
Code: [Select]
cache_put_data('total_unapproved_posts', $context['total_unapproved_posts'], 3600);
Find:
Code: [Select]
if (($context['total_unapproved_topics'] = cache_get_data('total_unapproved_topics', 3600)) === null)Replace with:
Code: [Select]
if  ($approve_query != ' AND 0')Find and remove
Code: [Select]
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

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

Offline RICH BEAST

  • Jr. Member
  • **
  • Posts: 101
Re: Unapproved Posts on Moderate Button
« Reply #5 on: September 14, 2015, 04:56:11 AM »
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:
Code: [Select]
if (($context['total_unapproved_posts'] = cache_get_data('total_unapproved_posts', 3600)) === null)Replace with:
Code: [Select]
if  ($approve_query != ' AND 0')Find and remove
Code: [Select]
cache_put_data('total_unapproved_posts', $context['total_unapproved_posts'], 3600);
Find:
Code: [Select]
if (($context['total_unapproved_topics'] = cache_get_data('total_unapproved_topics', 3600)) === null)Replace with:
Code: [Select]
if  ($approve_query != ' AND 0')Find and remove
Code: [Select]
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.