Witam.
Jeśli piszę w złym dziale, to proszę o przeniesienie do właściwego.
Mam problem z wyświetlaniem "Ostatnio Byli U Nas". Zrobiłem to w ten sposób:
Otworzyłem plik
Kod:
includes/page_header.php
i po linijce
Kod:
define('HEADER_INC', TRUE);
dodałem następujący kod
Kod:
//Ostatnio napisane tematy
$sql = 'SELECT topic_id, topic_title, topic_time
FROM ' . TOPICS_TABLE . '
WHERE forum_id AND (topic_status <> 2)
ORDER BY topic_time DESC
LIMIT 5';
$result = mysql_query($sql);
$i=0;
while ($row = $db->sql_fetchrow($result))
{
$posttime = create_date($board_config['default_dateformat'], $row['topic_time'], $board_config['board_timezone']);
$i++;
if (strlen($row['topic_title']) > 25)
{
$topic_title = substr($row['topic_title'], 0, 25)."...";
}
else
{
$topic_title = $row['topic_title'];
}
$template->assign_block_vars('tem', array(
'LI' => $i+0,
'POSTTIME' => $posttime,
'URL' => '<a href="' . append_sid("viewtopic.$phpEx?t=" . $row['topic_id']) . '" class="gensmall" title="' . $row['topic_title'] . '">' . $topic_title . '</a>')
);
}
// Ostatnio odwiedzil forum
$sql = 'SELECT user_id, username, user_lastvisit, user_level, user_jr
FROM ' . USERS_TABLE . '
WHERE user_id <> ' . ANONYMOUS . '
AND user_allow_viewonline = 1
ORDER BY user_lastvisit DESC
LIMIT 5';
$result = mysql_query($sql);
$i=0;
while ($row = $db->sql_fetchrow($result))
{
$colored_username = color_username($row['user_level'], $row['user_jr'], $row['user_id'], $row['username']);
$row_user_name = $colored_username[0];
$visitdate = create_date($board_config['default_dateformat'], $row['user_lastvisit'], $board_config['board_timezone']);
$i++;
$who = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '" class="gensmall"' . $colored_username[1] . '>' . $row_user_name . '</a>';
$how_many = '<b>' . $row['how_many'] . '</b>';
$template->assign_block_vars('use', array(
'LI' => $i+0,
'USERNAME' => $who,
'LASTVISIT' => $visitdate)
);
}
Jeśli chodzi o "Ostatnio Napisane Tematy" to wszystko ładnie działa, ale jeśli chodzi o "Ostatnio byli u nas", to zamiast nazwy użytkownika wyświetla się taki błąd
Kod:
{'LOGGED_IN_USER_LIST' => $online_userlist}
Na innym forum ktoś polecił mi abym w/w kod zamienił na
Kod:
'LOGGED_IN_USER_LIST' => $online_userlist
(w pliku index_body.tpl). Niestety błąd nadal występuje.