Modules table??

... unapproved_topics?
If you are trying to get a list of topics that are unapproved, you would want something like this...
- Code: Select all
$sql = 'SELECT topic_id, topic_title
FROM ' . TOPICS_TABLE .
WHERE topic_approved = 0;
$result = $db->sql_query($sql);
...
If you are trying to get a count, the number of unapproved topics, it would be:
- Code: Select all
$sql = 'SELECT COUNT(topic_id) AS unapproved_topics
FROM ' . TOPICS_TABLE . '
WHERE topic_approved = 0;
$result = $db->sql_query($sql);
$unapproved_topics = $db->sql_fetchfield('unapproved_topics);
$db->sql_freeresult($result);
Before running the DB query, a check should be run to see if that moderator has permission, therefore, you would go...
- Code: Select all
if ($auth->acl_get('m_approve'))
{
}
If you get errors, it always helps to know what those are so we can see what is causing the problem.
