Permalink
Browse files

move post approval types to constants.

  • Loading branch information...
1 parent e251689 commit 39d9562b828a6778210d18c24dfe0073cdca7eb3 @Informpro committed Jun 12, 2011
Showing with 124 additions and 110 deletions.
  1. +2 −1 .gitignore
  2. +1 −1 adm/admin_account.php
  3. +2 −2 adm/admin_attach_cp.php
  4. +1 −1 adm/admin_attachments.php
  5. +2 −2 adm/cash_recount.php
  6. +4 −4 attachments.php
  7. +2 −2 blocks/random_topics.php
  8. +2 −2 blocks/random_topics_ver.php
  9. +2 −2 blocks/recent_topics.php
  10. +2 −2 blocks/recent_topics_wide.php
  11. +11 −0 config.php
  12. +1 −1 download.php
  13. +1 −1 download_post.php
  14. +3 −3 edit_post_details.php
  15. +1 −1 flash_news.php
  16. +2 −2 forum.php
  17. +1 −1 includes/attach_mod/includes/functions_admin.php
  18. +1 −1 includes/attach_mod/includes/functions_delete.php
  19. +2 −2 includes/bb_usage_stats_functions.php
  20. +2 −2 includes/bbcode.php
  21. +4 −4 includes/class_mcp.php
  22. +3 −6 includes/class_topics.php
  23. +1 −1 includes/classes_cash.php
  24. +5 −0 includes/constants.php
  25. +1 −1 includes/forum_wordgraph.php
  26. +1 −1 includes/functions.php
  27. +1 −1 includes/functions_admin.php
  28. +1 −1 includes/functions_bbcode.php
  29. +1 −1 includes/functions_calendar.php
  30. +2 −2 includes/functions_categories_hierarchy.php
  31. +1 −1 includes/functions_flood.php
  32. +1 −1 includes/functions_meta.php
  33. +8 −6 includes/functions_post.php
  34. +1 −1 includes/functions_profile.php
  35. +1 −1 includes/functions_search.php
  36. +2 −2 includes/functions_topics.php
  37. +1 −1 includes/functions_topics_list.php
  38. +4 −4 includes/news_data.php
  39. +2 −2 includes/stats_modules/month_stat_module.php
  40. +1 −1 includes/stats_modules/new_posts_by_month_module.php
  41. +1 −1 includes/stats_modules/site_hist_week_top_posters_module.php
  42. +1 −1 includes/stats_modules/top_attachments_module.php
  43. +1 −1 includes/stats_modules/top_smilies_module.php
  44. +1 −1 includes/topic_download.php
  45. +1 −1 includes/topic_review.php
  46. +2 −2 includes/usercp_viewprofile.php
  47. +2 −2 install/includes/functions.php
  48. +2 −1 install/schemas/sql_update_ip.php
  49. +3 −3 posting.php
  50. +1 −1 recent.php
  51. +1 −1 rss.php
  52. +5 −5 search.php
  53. +1 −1 show_post.php
  54. +1 −1 sitemap.php
  55. +1 −1 uacp.php
  56. +5 −5 viewforum.php
  57. +1 −1 viewonline.php
  58. +6 −8 viewtopic.php
  59. +1 −2 watched_topics.php
View
@@ -1 +1,2 @@
-cache/*
+cache/*
+config.php
View
@@ -315,7 +315,7 @@ function period($date) // borrowed from birthday mod
$sql_posts_count = "SELECT COUNT(post_id) AS total_posts
FROM " . POSTS_TABLE . "
- WHERE deleted = 0
+ WHERE post_approval = " . POST_APPROVED . "
AND poster_id = " . $user_id;
$result_posts = $db->sql_query($sql_posts_count);
$row_posts = $db->sql_fetchrow($result_posts);
View
@@ -335,7 +335,7 @@
$sql = "SELECT p.topic_id
FROM " . ATTACHMENTS_TABLE . " a, " . POSTS_TABLE . " p
- WHERE a.post_id = p.post_id AND p.deleted != 2
+ WHERE a.post_id = p.post_id AND p.post_approval != " . POST_DELETED . "
GROUP BY p.topic_id";
$result = $db->sql_query($sql);
$number_of_topics = $db->sql_numrows($result);
@@ -679,7 +679,7 @@
{
$sql = "SELECT t.topic_title
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
- WHERE p.post_id = " . intval($ids[$j]['post_id']) . " AND p.topic_id = t.topic_id AND p.deleted != 2
+ WHERE p.post_id = " . intval($ids[$j]['post_id']) . " AND p.topic_id = t.topic_id AND p.post_approval != " . POST_DELETED . "
GROUP BY t.topic_id, t.topic_title";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -948,7 +948,7 @@
WHERE a.user_id_2 = 0
AND p.post_id = a.post_id
AND a.user_id_1 <> p.poster_id
- AND p.deleted != 2';
+ AND p.post_approval != ' . POST_DELETED;
$result = $db->sql_query($sql);
echo '<br />';
View
@@ -71,9 +71,9 @@
if ($userlist['user_id'] != ANONYMOUS)
{
$c_user = new cash_user($userlist[$i]['user_id'],$userlist[$i]);
- $sql = "SELECT t.forum_id, t.topic_id, t.topic_poster, t.topic_replies, count(p.post_id) AS user_replies, p.deleted
+ $sql = "SELECT t.forum_id, t.topic_id, t.topic_poster, t.topic_replies, count(p.post_id) AS user_replies, p.post_approval
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
- WHERE t.topic_id = p.topic_id AND p.poster_id = " . $c_user->id() . " AND deleted = 0
+ WHERE t.topic_id = p.topic_id AND p.poster_id = " . $c_user->id() . " AND post_approval = " . POST_APPROVED . "
GROUP BY t.topic_id";
$result = $db->sql_query($sql);
View
@@ -305,15 +305,15 @@
{
$sql = "SELECT a.post_id, t.topic_title, d.*
FROM " . $attach_table . " a, " . $attach_desc_table . " d, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
- WHERE p.deleted = 0 AND (a.post_id = p.post_id) AND (p.forum_id IN (" . implode(', ', $forum_ids) . ")) AND (p.topic_id = t.topic_id) AND (a.attach_id = d.attach_id)
+ WHERE p.post_approval = " . POST_APPROVED . " AND (a.post_id = p.post_id) AND (p.forum_id IN (" . implode(', ', $forum_ids) . ")) AND (p.topic_id = t.topic_id) AND (a.attach_id = d.attach_id)
ORDER BY $order_by";
$result = $db->sql_query($sql);
}
elseif (($is_auth_ary[$forum_id]['auth_read']) && ($is_download_auth_ary[$forum_id]['auth_download']))
{
$sql = "SELECT a.post_id, t.topic_title, d.*
FROM " . $attach_table . " a, " . $attach_desc_table . " d, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
- WHERE p.deleted = 0 AND (a.post_id = p.post_id) AND (p.forum_id = " . $forum_id . ") AND (p.topic_id = t.topic_id) AND (a.attach_id = d.attach_id)
+ WHERE p.post_approval = " . POST_APPROVED . " AND (a.post_id = p.post_id) AND (p.forum_id = " . $forum_id . ") AND (p.topic_id = t.topic_id) AND (a.attach_id = d.attach_id)
ORDER BY $order_by";
$result = $db->sql_query($sql);
}
@@ -418,15 +418,15 @@
$gen_pagination = true;
$sql = "SELECT count(*) AS total
FROM " . $attach_table . " a, " . POSTS_TABLE . " p
- WHERE (a.post_id = p.post_id) AND (p.forum_id IN (" . implode(', ', $forum_ids) . ")) AND p.deleted = 0";
+ WHERE (a.post_id = p.post_id) AND (p.forum_id IN (" . implode(', ', $forum_ids) . ")) AND p.post_approval = " . POST_APPROVED;
$result = $db->sql_query($sql);
}
elseif (($is_auth_ary[$forum_id]['auth_read']) && ($is_download_auth_ary[$forum_id]['auth_download']) && ($num_attachments > 0))
{
$gen_pagination = true;
$sql = "SELECT count(*) AS total
FROM " . $attach_table . " a, " . POSTS_TABLE . " p
- WHERE (a.post_id = p.post_id) AND (p.forum_id = " . $forum_id . ") AND p.deleted = 0";
+ WHERE (a.post_id = p.post_id) AND (p.forum_id = " . $forum_id . ") AND p.post_approval = " . POST_APPROVED;
$result = $db->sql_query($sql);
}
$pagination_append = POST_FORUM_URL . '=' . $forum_id . '&amp;';
View
@@ -76,14 +76,14 @@ function cms_block_random_topics()
$allowed_forums_sql = '';
}
- $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, f.forum_name, p.deleted
+ $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, f.forum_name, p.post_approval
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u, " . FORUMS_TABLE . " AS f
WHERE t.topic_status <> 2
" . $allowed_forums_sql . "
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
- AND p.deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
ORDER BY RAND()
LIMIT " . $cms_config_vars['md_num_random_topics'][$block_id];
$result = $db->sql_query($sql);
@@ -71,14 +71,14 @@ function cms_block_random_topics_ver()
$allowed_forums_sql = '';
}
- $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, p.deleted
+ $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, p.post_approval
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u, " . FORUMS_TABLE . " AS f
WHERE t.topic_status <> 2
" . $allowed_forums_sql . "
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
- WHERE deleted = 0
+ WHERE p.post_approval = " . POST_APPROVED . "
ORDER BY RAND()
LIMIT " . $cms_config_vars['md_num_random_topics_ver'][$block_id];
$result = $db->sql_query($sql);
View
@@ -33,13 +33,13 @@ function cms_block_recent_topics()
$current_time = time();
$extra = "AND t.topic_time <= $current_time";
- $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, p.deleted = 0
+ $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, p.post_approval = 0
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id NOT IN (" . $except_forums . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
- AND deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
$extra
ORDER BY p.post_time DESC
LIMIT " . $cms_config_vars['md_num_recent_topics'][$block_id];
@@ -34,14 +34,14 @@ function cms_block_recent_topics_wide()
//$extra = "AND t.topic_time <= $current_time";
$extra = '';
- $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, f.forum_name, p.deleted
+ $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, u.user_active, u.user_color, f.forum_name, p.post_approval
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u, " . FORUMS_TABLE . " AS f
WHERE t.forum_id NOT IN (" . $except_forums . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
AND f.forum_id = t.forum_id
- AND p.deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
$extra
ORDER BY p.post_time DESC
LIMIT " . $cms_config_vars['md_num_recent_topics_wide'][$block_id];
View
@@ -3,4 +3,15 @@
// Icy Phoenix auto-generated config file
// Do not change anything in this file!
+$dbms = 'mysql4';
+
+$dbhost = 'localhost';
+$dbname = '';
+$dbuser = 'root';
+$dbpasswd = '';
+
+$table_prefix = 'ip_';
+
+define('IP_INSTALLED', true);
+
?>
View
@@ -288,7 +288,7 @@ function send_file_to_browser($attachment, $upload_dir)
{
$sql = 'SELECT forum_id
FROM ' . POSTS_TABLE . '
- WHERE deleted = 0 AND post_id = ' . (int) $auth_pages[$i]['post_id'];
+ WHERE post_approval = ' . POST_APPROVED . ' AND post_id = ' . (int) $auth_pages[$i]['post_id'];
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$forum_id = $row['forum_id'];
View
@@ -33,7 +33,7 @@
}
// get post
-$sql = "SELECT * FROM " . POSTS_TABLE . " WHERE deleted = 0 AND post_id = " . $post_id;
+$sql = "SELECT * FROM " . POSTS_TABLE . " WHERE post_approval = " . POST_APPROVED . " AND post_id = " . $post_id;
$db->sql_return_on_error(true);
$result = $db->sql_query($sql);
$db->sql_return_on_error(false);
View
@@ -102,7 +102,7 @@
{
$sql = "SELECT p.topic_id
FROM " . POSTS_TABLE . " p
- WHERE p.deleted = 0 AND p.post_id = '" . $post_id . "'";
+ WHERE p.post_approval = " . POST_APPROVED . " AND p.post_id = '" . $post_id . "'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
@@ -142,10 +142,10 @@
{
$topic_post_time = 'post';
- $sql = "SELECT p.post_time, p.poster_id, u.user_id, u.username, u.user_active, u.user_color, p.deleted
+ $sql = "SELECT p.post_time, p.poster_id, u.user_id, u.username, u.user_active, u.user_color, p.post_approval
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u
WHERE p.post_id = '" . $post_id . "'
- AND p.deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
AND u.user_id = p.poster_id";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
View
@@ -122,7 +122,7 @@ function xml_file_content($file_content)
WHERE t.forum_id IN (" . $allowed_forums . ")
AND u.user_id = t.topic_poster
AND p.post_id = t.topic_first_post_id
- AND p.deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
" . $sql_news . "
ORDER BY " . $sql_sort . "
LIMIT " . $news_items;
View
@@ -117,7 +117,7 @@
if ($tree['type'][ $keys['idx'][$i] ] == POST_FORUM_URL)
{
$forum_id = $tree['id'][ $keys['idx'][$i] ];
- $sql = "SELECT MAX(post_time) AS last_post FROM " . POSTS_TABLE . " WHERE deleted = 0 AND forum_id = '" . $forum_id . "'";
+ $sql = "SELECT MAX(post_time) AS last_post FROM " . POSTS_TABLE . " WHERE post_approval = " . POST_APPROVED . " AND forum_id = '" . $forum_id . "'";
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
@@ -396,7 +396,7 @@
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
- AND p.deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
ORDER BY p.post_id DESC
LIMIT " . intval($config['last_msgs_n']);
$result = $db->sql_query($sql);
@@ -769,7 +769,7 @@ function search_attachments($order_by, &$total_rows)
// Search Cat... nope... sorry :(
$sql = 'SELECT a.*, t.post_id, p.post_time, p.topic_id
- FROM ' . ATTACHMENTS_TABLE . ' t, ' . ATTACHMENTS_DESC_TABLE . ' a, ' . POSTS_TABLE . ' p WHERE p.deleted = 0 AND ';
+ FROM ' . ATTACHMENTS_TABLE . ' t, ' . ATTACHMENTS_DESC_TABLE . ' a, ' . POSTS_TABLE . ' p WHERE p.post_approval = ' . POST_APPROVED . ' AND ';
if (sizeof($where_sql) > 0)
{
@@ -36,7 +36,7 @@ function attachment_sync_topic($topic_id)
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
- AND deleted != 2
+ AND post_approval != " . POST_DELETED . "
GROUP BY post_id";
$result = $db->sql_query($sql);
$post_list = $db->sql_fetchrowset($result);
@@ -188,7 +188,7 @@ function get_unpruned_post_count($user_id)
{
global $db;
- $sql = "SELECT DISTINCT p.poster_id, COUNT(p.poster_id) AS post_count FROM " . POSTS_TABLE . " AS p WHERE p.deleted = 0 AND p.poster_id = $user_id GROUP BY p.poster_id";
+ $sql = "SELECT DISTINCT p.poster_id, COUNT(p.poster_id) AS post_count FROM " . POSTS_TABLE . " AS p WHERE p.post_approval = " . POST_APPROVED . " AND p.poster_id = $user_id GROUP BY p.poster_id";
$result = $db->sql_query($sql);
$post_count = 0;
@@ -271,7 +271,7 @@ function &get_forum_usage_rows($user_id, $user_posts, $show_all_forums)
$topics_watched_rows = & get_topics_watched_rows($user_id);
/* Next, retrieve user's forum usage info */
- $sql = "SELECT f.forum_id, f.forum_name, p.poster_id, COUNT(p.poster_id) AS forum_post_count, (COUNT(p.poster_id) / $user_posts)*100 AS forum_post_pct FROM " . POSTS_TABLE . " AS p INNER JOIN " . FORUMS_TABLE . " AS f ON f.forum_id = p.forum_id GROUP BY p.forum_id, p.poster_id HAVING (p.poster_id = $user_id) AND p.deleted = 0 ORDER BY f.forum_id";
+ $sql = "SELECT f.forum_id, f.forum_name, p.poster_id, COUNT(p.poster_id) AS forum_post_count, (COUNT(p.poster_id) / $user_posts)*100 AS forum_post_pct FROM " . POSTS_TABLE . " AS p INNER JOIN " . FORUMS_TABLE . " AS f ON f.forum_id = p.forum_id GROUP BY p.forum_id, p.poster_id HAVING (p.poster_id = $user_id) AND p.post_approval = " . POST_APPROVED . " ORDER BY f.forum_id";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
View
@@ -1880,10 +1880,10 @@ function process_tag(&$item)
}
else
{
- $sql = "SELECT p.poster_id, p.topic_id, p.deleted
+ $sql = "SELECT p.poster_id, p.topic_id, p.post_approval
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = " . intval($topic_id) . "
- AND p.deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
AND p.poster_id = " . $user->data['user_id'];
$db->sql_return_on_error(true);
$result = $db->sql_query($sql);
View
@@ -21,7 +21,7 @@ class class_mcp_topic
/**
* Delete topic(s)
*/
- function topic_delete($topics, $forum_id, $method = class_topics::SOFT_DELETE)
+ function topic_delete($topics, $forum_id, $method = POST_UNAPPROVE)
{
global $db, $cache, $lang;
@@ -75,13 +75,13 @@ function topic_delete($topics, $forum_id, $method = class_topics::SOFT_DELETE)
$db->sql_freeresult($result);
$sql = "UPDATE " . TOPICS_TABLE . "
- SET deleted = " . $method . ", deleter_user_id = '" . $user->data['user_id'] . "', deleter_username = '" . $user->data['username'] . "'
+ SET post_approval = " . $method . ", deleter_user_id = '" . $user->data['user_id'] . "', deleter_username = '" . $user->data['username'] . "'
WHERE " . $db->sql_in_set('topic_id', $topics_ids) . "
OR " . $db->sql_in_set('topic_moved_id', $topics_ids);
$db->sql_transaction('begin');
$db->sql_query($sql);
- if ($method == class_topics::RAW_DELETE)
+ if ($method == POST_DELETED)
{
$sql = "DELETE FROM " . THANKS_TABLE . "
WHERE " . $db->sql_in_set('topic_id', $topics_ids);
@@ -157,7 +157,7 @@ function topic_delete($topics, $forum_id, $method = class_topics::SOFT_DELETE)
}
$sql = "UPDATE " . POSTS_TABLE . "
- SET deleted = " . $method . ", deleter_user_id = '" . $user->data['user_id'] . "', deleter_username = '" . $db->sql_escape($user->data['username']) . "'
+ SET post_approval = " . $method . ", deleter_user_id = '" . $user->data['user_id'] . "', deleter_username = '" . $db->sql_escape($user->data['username']) . "'
WHERE " . $db->sql_in_set('topic_id', $topics_ids);
$db->sql_query($sql);
$db->sql_transaction('commit');
@@ -18,9 +18,6 @@
*/
class class_topics
{
- const SOFT_DELETE = 1,
- RAW_DELETE = 2;
-
var $cat_id = 0;
var $forum_id = 0;
var $topic_id = 0;
@@ -383,7 +380,7 @@ function user_replied_array($topic_rowset)
$s_topic_ids = implode(', ', $topic_ids);
$sql = "SELECT DISTINCT topic_id FROM " . POSTS_TABLE . "
WHERE topic_id IN (" . $s_topic_ids . ")
- AND deleted = 0
+ AND post_approval = " . POST_APPROVED . "
AND poster_id = " . $user->data['user_id'];
$result = $db->sql_query($sql);
@@ -479,7 +476,7 @@ function fetch_posts($forum_sql, $number_of_posts, $text_length, $show_portal =
FROM " . POSTS_TABLE . " AS p, " . TOPICS_TABLE . " AS t, " . USERS_TABLE . " AS u
WHERE p.post_id = '" . $single_post_id . "'
" . $add_to_sql . "
- AND p.deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
AND t.topic_id = p.topic_id
AND p.poster_id = u.user_id";
}
@@ -490,7 +487,7 @@ function fetch_posts($forum_sql, $number_of_posts, $text_length, $show_portal =
WHERE t.topic_time <= " . time() . "
" . $add_to_sql . "
AND t.topic_poster = u.user_id
- AND p.deleted = 0
+ AND p.post_approval = " . POST_APPROVED . "
AND t.topic_first_post_id = p.post_id
AND t.topic_status <> 2
ORDER BY " . $order_sql . $limit_sql;
@@ -596,7 +596,7 @@ function cash_update($mode, $poster_id, $first_post, &$old_message, &$new_messag
FROM " . POSTS_TABLE . "
WHERE poster_id = $poster_id
AND post_time > $interval
- AND deleted = 0
+ AND post_approval = " . POST_APPROVED . "
GROUP BY forum_id";
$result = $db->sql_query($sql);
View
@@ -182,6 +182,11 @@
define('STYLE_URL', 's');
define('LANG_URL', 'l');
+//POST APPROVAL
+define('POST_UNAPPROVED', 0);
+define('POST_APPROVED', 1);
+define('POST_DELETED', 2);
+
// Error codes
define('GENERAL_MESSAGE', 200);
define('GENERAL_ERROR', 202);
@@ -24,7 +24,7 @@
WHERE m.word_id = w.word_id
AND m.post_id = p.post_id
AND p.topic_id = t.topic_id
- AND p.deleted = 0
+ AND p.post_approval = ' . POST_APPROVED . '
AND t.forum_id = ' . $forum_id . '
GROUP BY m.word_id
ORDER BY word_count DESC
View
@@ -4017,7 +4017,7 @@ function page_header($title = '', $parse_template = false)
$sql = "SELECT COUNT(post_id) as total
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $user->data['user_lastvisit'] . $auth_forum . "
- AND deleted = 0
+ AND post_approval = " . POST_APPROVED . "
AND poster_id != " . $user->data['user_id'];
$db->sql_return_on_error(true);
$result = $db->sql_query($sql);
Oops, something went wrong.

0 comments on commit 39d9562

Please sign in to comment.