Witam. Mam pewien problem. Przerabialem skrypt pobierający ostatnie tematy z forum tak abym mogl go wstawic w JavaScript (i w .tpl na stronke) i teraz nie wiem jak zrobic by wczytywał polskie znaki. Próbowałem róznych kodowań ale nadal pobiera np. "PromujÄcy" zamiast "Promujący". Nie mogę wstawić <meta ... > bo wtedy nie przeczyta skryptu.
<?
$phpbb_root_path = ''; // Path to phpbb folder
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
// Grab user preferences
$user->setup();
/*** phpBB3 - Last Active Topics System ***/
//Show last x topics
// Create arrays
// Get forums that current user has read rights to.
// Get active topics.
$sql="SELECT *
FROM " . TOPICS_TABLE . "
WHERE topic_approved = '1' AND " . $db->sql_in_set('forum_id', $forums) . "
ORDER BY topic_last_post_time DESC";
$result = $db->sql_query_limit($sql,TOPICS_LIMIT);
while ($r = $db->sql_fetchrow($result))
{
$topics[] = $r;
}
$db->sql_freeresult($result);
?>document.writeln('Nowe tematy na forum:<br>');
<?
foreach($topics as $t)
{
// Get folder img, topic status/type related information
$topic_tracking_info = get_complete_topic_tracking($t['forum_id'], $t['topic_id']);
$unread_topic = (isset($topic_tracking_info[$t['topic_id']]) && $t['topic_last_post_time'] > $topic_tracking_info[$t['topic_id']]) ?
true : false; $folder_img = $folder_alt = $topic_type = '';
topic_status($t, $t['topic_replies'], $unread_topic, $folder_img, $folder_alt, $topic_type);
// output the link
?>document.writeln('<img style=\"vertical-align: text-bottom\" width=\"16\" height=\"16\" src=\"/forum/
<?=$user->img($folder_img, $folder_alt, false, '', 'src');?>\"/><a href="/forum/
<?=$phpbb_root_path . 'viewtopic.php?f=' . $t['forum_id'] . '&t=' . $t['topic_id'] . '&p=' . $t['topic_last_post_id'] . '#p' . $t['topic_last_post_id'];?>">
<?=html_entity_decode($t['topic_title']);?></a><br>');
<?
}
?>
Ten post edytował fardbleecker 1.11.2013, 02:51:21