пару дополнений
no_post_counts
Код: Выделить всё
$sql = "SELECT u.user_id, u.username, u.user_posts, Count(p.post_id) AS new_counter
FROM " . USERS_TABLE . " u
INNER JOIN " . POSTS_TABLE . " p ON u.user_id = p.poster_id
WHERE u.user_id <> " . ANONYMOUS . "
GROUP BY u.user_id, u.username, u.user_posts";
Код: Выделить всё
//для учета счетчика соообщений в разрешенных форумах by Miracle
$sql = "SELECT u.user_id, u.username, u.user_posts, Count(p.post_id) AS new_counter, p.forum_id, f.forum_postcount
FROM " . USERS_TABLE . " u
INNER JOIN " . POSTS_TABLE . " p ON u.user_id = p.poster_id
LEFT JOIN " . FORUMS_TABLE . " f ON p.forum_id = f.forum_id
WHERE u.user_id <> " . ANONYMOUS . "
AND f.forum_postcount = 1
GROUP BY u.user_id, u.username, u.user_posts";
Код: Выделить всё
// We have all data so get the post information
$sql = "SELECT post_id, post_subject, post_text
FROM " . POSTS_TEXT_TABLE . "
WHERE post_id > " . intval($board_config['dbmtnc_rebuild_pos']) . "
AND post_id <= " . intval($board_config['dbmtnc_rebuild_end']) . "
ORDER BY post_id
LIMIT $posts_to_index";
Код: Выделить всё
// We have all data so get the post information
$sql = "SELECT pt.post_id, pt.post_subject, pt.post_text
FROM " . POSTS_TEXT_TABLE . " as pt, " . POSTS_TABLE . " as p, " . FORUMS_TABLE . " as f
WHERE f.forum_indexing = 1
AND p.forum_id = f.forum_id
AND p.post_id = pt.post_id
AND pt.post_id > " . intval($board_config['dbmtnc_rebuild_pos']) . "
ORDER BY pt.post_id
LIMIT $posts_to_index";
Код: Выделить всё
$posts_total = 0;
$sql = "SELECT Count(*) AS posts_total
FROM " . POSTS_TEXT_TABLE . "
WHERE post_id <= " . intval($board_config['dbmtnc_rebuild_end']);
Код: Выделить всё
$posts_total = 0;
$sql = "SELECT Count(pt.post_id) AS posts_total
FROM " . POSTS_TEXT_TABLE . " as pt, " . POSTS_TABLE . " as p, " . FORUMS_TABLE . " as f
WHERE f.forum_indexing = 1
AND p.forum_id = f.forum_id
AND p.post_id = pt.post_id
AND pt.post_id <= " . intval($board_config['dbmtnc_rebuild_end']);
Код: Выделить всё
$posts_indexed = 0;
$sql = "SELECT Count(*) AS posts_indexed
FROM " . POSTS_TEXT_TABLE . "
WHERE post_id <= " . intval($last_post);
Код: Выделить всё
$posts_indexed = 0;
$sql = "SELECT Count(pt.post_id) AS posts_indexed
FROM " . POSTS_TEXT_TABLE . " as pt, " . POSTS_TABLE . " as p, " . FORUMS_TABLE . " as f
WHERE f.forum_indexing = 1
AND p.forum_id = f.forum_id
AND p.post_id = pt.post_id
AND pt.post_id <= " . intval($last_post);