News:

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

Main Menu

Unapproved Attachments, Posts and Topics in Mod

Started by Diego Andrés, April 10, 2011, 10:42:15 PM

Previous topic - Next topic

bolubeyi61

if used code total see the moderators
// Count how many post and topics are there to be approved
function Posttoapprove()
{
   global $context, $smcFunc;

   $approve_boards = boardsAllowedTo('approve_posts');

   if ($approve_boards == array(0))
      $approve_query = '';
   elseif (!empty($approve_boards))
      $approve_query = ' AND m.id_board IN (' . implode(',', $approve_boards) . ')';
   else
      $approve_query = ' AND 0';
     
   $request = $smcFunc['db_query']('', '
      SELECT COUNT(m.id_topic)
      FROM {db_prefix}topics AS m
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
      WHERE m.approved = {int:not_approved}
         AND {query_see_board}
         ' . $approve_query,
      array(
         'not_approved' => 0,
      )
   );
   list ($totalUnapprovedTopics) = $smcFunc['db_fetch_row']($request);
   $smcFunc['db_free_result']($request);
   $context['total_unapproved_topics'] = $totalUnapprovedTopics;
   
   
   $request = $smcFunc['db_query']('', '
      SELECT COUNT(*)
      FROM {db_prefix}messages AS m
         INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic AND t.id_first_msg != m.id_msg)
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
      WHERE m.approved = {int:not_approved}
         AND {query_see_board}
         ' . $approve_query,
      array(
         'not_approved' => 0,
      )
   );
   list ($totalUnapprovedPosts) = $smcFunc['db_fetch_row']($request);
   $smcFunc['db_free_result']($request);
   $context['total_unapproved_posts'] = $totalUnapprovedPosts;
}


but
if used code total see the moderators all user
How do I change the code?
?

used code (risk)?
function posttoapprove()
{
global $approve_query, $context, $smcFunc;

$request = $smcFunc['db_query']('', '
SELECT COUNT(m.id_topic)
FROM {db_prefix}topics AS m
INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
WHERE m.approved = {int:not_approved}
AND {query_see_board}
' . $approve_query,
array(
'not_approved' => 0,
)
);
list ($totalUnapprovedTopics) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

// Update the tabs with the correct number of posts.
$context['total_unapproved_topics'] = $totalUnapprovedTopics;
}

Joker™

Are you trying to achieve that everyone can see the count of how many topics are unapproved?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

bolubeyi61

Yes.
index.template.php code edit: ok. We took care of
ModerationCenter.php code edit: ?. I could not

Joker™

Note - Make backup of file before editing it

Code (Try this) Select
// Count how many post and topics are there to be approved
function Posttoapprove()
{
global $context, $smcFunc;

$request = $smcFunc['db_query']('', '
SELECT COUNT(m.id_topic)
FROM {db_prefix}topics AS m
INNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
WHERE m.approved = {int:not_approved}
AND {query_see_board}',
array(
'not_approved' => 0,
)
);
list ($totalUnapprovedTopics) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
$context['total_unapproved_topics'] = $totalUnapprovedTopics;


$request = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = m.id_topic AND t.id_first_msg != m.id_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
WHERE m.approved = {int:not_approved}
AND {query_see_board}',
array(
'not_approved' => 0,
)
);
list ($totalUnapprovedPosts) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
$context['total_unapproved_posts'] = $totalUnapprovedPosts;
}
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved


beanflying

#26
Still installs on 2.0.9 using emulation to 2.0.1. Manual mod needed to custom theme but works great as always.

Work in progress unless someone has already done it. I am going to try and have it show Unapproved members too under the posts and topics on my custom theme. **Sorted it and Done :)
Owner of many many shiny toys.

Diego Andrés

1.0 - 02 October 2021
Display number of unapproved attachments, posts and topics in the mod button counter.
Added support for unapproved attachments.
Initial Release for SMF 2.1

SMF Tricks - Free & Premium Responsive Themes for SMF.

tareko

this is a very useful mod to have especially when you have large and busy forums.

gevv

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Advertisement: