G
Gemini_13
Гость
FineRider, можно, но это +1 запрос или +1 колонка в bb_users. оно Вам надо такими жертвами?
в вюпрофиль
if (!$count_book = CACHE('bb_cache')->get('count_book', 300))
{
$count_book = DB()->fetch_row("SELECT COUNT(topic_id) as book_count FROM ". BB_BOOKMARKS ." WHERE user_id = {$profiledata['user_id']}");
CACHE('bb_cache')->set('count_book', $count_book);
}
в массив
'COUNT_BOOK' => $count_book["book_count"],
в тпл
<tr>
<th>Закладок:</th>
<td>{COUNT_BOOK}</td>
</tr>
Fatal error: Call to undefined function message_die() in C:\OpenServer\domains\localhost\bookmarks.php on line 59
message_die(GENERAL_ERROR, $lang['EXIST_BOOK']);
GENERAL_MESSAGE
bb_die(GENERAL_MESSAGE, $message);
$sql = "SELECT b.topic_id, b.forum_id, t.*, f.*
FROM " . BB_BOOKMARKS . " b
LEFT JOIN " . BB_TOPICS . " t ON (b.topic_id = t.topic_id)
LEFT JOIN " . BB_FORUMS . " f ON (b.forum_id = f.forum_id)
WHERE b.user_id = '" . intval($userdata['user_id']) . "'";
$sql = "SELECT
b.topic_id, b.forum_id,
COALESCE(t.topic_title, '<i style=\"color:red\">".$lang['NO_MATCH']."</i>') AS `topic_title`, t.topic_replies,t.topic_views, t.topic_type,t.topic_status,
f.forum_name
FROM " . BB_BOOKMARKS . " b
LEFT JOIN " . BB_TOPICS . " t ON (b.topic_id = t.topic_id)
LEFT JOIN " . BB_FORUMS . " f ON (b.forum_id = f.forum_id)
WHERE b.user_id = '" . intval($userdata['user_id']) . "'";