sql_query($sql)) )
{
$db->sql_close();
exit;
}
if ($javascript)
{
if ($javascriptID) echo 'if (document.getElementById(\'' . $javascriptID . '\')) document.getElementById(\'' . $javascriptID . '\').innerHTML = \'';
else echo "document.write('";
}
echo '
';
$i = 0;
while ($row = $db->sql_fetchrow($result))
{
$row['topic_title'] = html_entity_decode($row['topic_title']);
$row['topic_title'] = stripslashes($row['topic_title']);
// Przycinanie:
if (strlen($row['topic_title']) > $maxlength)
{
$row['topic_title'] = substr($row['topic_title'], 0, $maxlength);
if (strstr($row['topic_title'], ' ')) $row['topic_title'] = substr($row['topic_title'], 0, strrpos($row['topic_title'], ' '));
$row['topic_title'] .= '...';
}
// Cenzura:
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
if (count($orig_word)) $row['topic_title'] = preg_replace($orig_word, $replacement_word, $row['topic_title']);
// Zamiana strony kodowej:
$charset = strtolower($charset);
if ($charset == 'windows-1250')
{
$row['topic_title'] = strtr($row['topic_title'], "\xA1\xA6\xAC\xB1\xB6\xBC", "\xA5\x8C\x8F\xB9\x9C\x9F");
$row['forum_name'] = strtr($row['forum_name'], "\xA1\xA6\xAC\xB1\xB6\xBC", "\xA5\x8C\x8F\xB9\x9C\x9F");
}
else if ($charset == 'utf-8')
{
$row['topic_title'] = str_replace(array("\xA1","\xC6","\xCA","\xA3","\xD1","\xD3","\xA6","\xAC","\xAF", "\xB1","\xE6","\xEA","\xB3","\xF1","\xF3","\xB6","\xBC","\xBF"), array("\xC4\x84","\xC4\x86","\xC4\x98","\xC5\x81","\xC5\x83","\xC3\x93","\xC5\x9A","\xC5\xB9","\xC5\xBB", "\xC4\x85","\xC4\x87","\xC4\x99","\xC5\x82","\xC5\x84","\xC3\xB3","\xC5\x9B","\xC5\xBA","\xC5\xBC"), $row['topic_title']);
$row['forum_name'] = str_replace(array("\xA1","\xC6","\xCA","\xA3","\xD1","\xD3","\xA6","\xAC","\xAF", "\xB1","\xE6","\xEA","\xB3","\xF1","\xF3","\xB6","\xBC","\xBF"), array("\xC4\x84","\xC4\x86","\xC4\x98","\xC5\x81","\xC5\x83","\xC3\x93","\xC5\x9A","\xC5\xB9","\xC5\xBB", "\xC4\x85","\xC4\x87","\xC4\x99","\xC5\x82","\xC5\x84","\xC3\xB3","\xC5\x9B","\xC5\xBA","\xC5\xBC"), $row['forum_name']);
}
$link = '- ' . htmlspecialchars($row['topic_title']) . ' »
';
echo (!$javascript ? $link . "\n" : str_replace(array("\\", "'"), array("\\\\", "\\'"), $link));
}
echo '
';
if ($javascript)
{
if ($javascriptID) echo '\';';
else echo '\');';
}
$db->sql_freeresult($result);
$db->sql_close();
unset($base_url, $base_path);
?>