Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][SQL] Problem ze znakami
fardbleecker
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 24.12.2012

Ostrzeżenie: (0%)
-----


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.
  1. <?
  2. define('IN_PHPBB', true);
  3. $phpbb_root_path = ''; // Path to phpbb folder
  4. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  5. include($phpbb_root_path . 'common.' . $phpEx);
  6. include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
  7.  
  8. // Start session management
  9. $user->session_begin();
  10. $auth->acl($user->data);
  11.  
  12. // Grab user preferences
  13. $user->setup();
  14.  
  15. /*** phpBB3 - Last Active Topics System ***/
  16. //Show last x topics
  17. define('TOPICS_LIMIT',10);
  18.  
  19. // Create arrays
  20. $topics = array();
  21.  
  22. // Get forums that current user has read rights to.
  23. $forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
  24.  
  25. // Get active topics.
  26. $sql="SELECT *
  27. FROM " . TOPICS_TABLE . "
  28. WHERE topic_approved = '1' AND " . $db->sql_in_set('forum_id', $forums) . "
  29. ORDER BY topic_last_post_time DESC";
  30. $result = $db->sql_query_limit($sql,TOPICS_LIMIT);
  31. while ($r = $db->sql_fetchrow($result))
  32. {
  33. $topics[] = $r;
  34. }
  35. $db->sql_freeresult($result);
  36. ?>document.writeln('Nowe tematy na forum:<br>');
  37. <?
  38. foreach($topics as $t)
  39. {
  40. // Get folder img, topic status/type related information
  41. $topic_tracking_info = get_complete_topic_tracking($t['forum_id'], $t['topic_id']);
  42. $unread_topic = (isset($topic_tracking_info[$t['topic_id']]) && $t['topic_last_post_time'] > $topic_tracking_info[$t['topic_id']]) ? true : false;
  43. $folder_img = $folder_alt = $topic_type = '';
  44. topic_status($t, $t['topic_replies'], $unread_topic, $folder_img, $folder_alt, $topic_type);
  45.  
  46. // output the link
  47. ?>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>');
  48. <?
  49. }
  50. ?>


Ten post edytował fardbleecker 1.11.2013, 02:51:21
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.12.2025 - 06:23