Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] kodowanie
Konuss
post
Post #1





Grupa: Zarejestrowani
Postów: 52
Pomógł: 0
Dołączył: 21.07.2005
Skąd: Konin

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


Witam serwis mam kodowany na "latin1_swedish_ci" a forum phpbb 3 na "utf8_bin" mam serwis zintegrowany razem z forum lecz przy wyciąganiu np danych ostatnich tematów nie mam polskich liter. prosiłbym o pomoc jak to zrobić bo jestem zielony. a pamiętam że dopisywało się do funkcji coś.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Konuss
post
Post #2





Grupa: Zarejestrowani
Postów: 52
Pomógł: 0
Dołączył: 21.07.2005
Skąd: Konin

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


poniżej przedstawiam tą funkcję. prosiłbym o pomoc:


  1. function last_post($limit, $lim, $punkt='> ') {
  2.  
  3.  
  4.  
  5. global $forum_post_tbl, $forum_topic_tbl, $forum_user_tbl, $PHP_SELF, $phpbb_root_path;
  6.  
  7.  
  8.  
  9. $query = "SELECT * FROM $forum_post_tbl ORDER BY post_time DESC LIMIT 5";
  10.  
  11. $result = mysql_query($query);
  12.  
  13.  
  14.  
  15.  
  16.  
  17. while($r = mysql_fetch_array($result)) {
  18.  
  19.  
  20.  
  21. $forum_id=$r['forum_id'];
  22.  
  23. $topic_id=$r['topic_id'];
  24.  
  25. $author=$r['poster_id'];
  26.  
  27.  
  28.  
  29. $query2 = "SELECT * FROM $forum_user_tbl WHERE user_id='$author'";
  30.  
  31. $result2 = mysql_query($query2);
  32.  
  33. $r2 = mysql_fetch_array($result2);
  34.  
  35.  
  36.  
  37. $author=$r2['username'];
  38.  
  39.  
  40.  
  41. $query3 = "SELECT * FROM $forum_topic_tbl WHERE topic_id='$topic_id'";
  42.  
  43. $result3 = mysql_query($query3);
  44.  
  45. $r3 = mysql_fetch_array($result3);
  46.  
  47.  
  48.  
  49. $title=$r3['topic_title'];
  50.  
  51.  
  52.  
  53. $title = stripslashes($title);
  54.  
  55. $len = strlen($title);
  56.  
  57.  
  58.  
  59. if($len>=$lim) {
  60.  
  61.  
  62.  
  63. $tit = $title;
  64.  
  65. $len = $lim - 3;
  66.  
  67. $len = ceil($len);
  68.  
  69. $title = substr($title, 0, $len);
  70.  
  71. $title = $title."...";
  72.  
  73.  
  74.  
  75. }
  76.  
  77.  
  78.  
  79. echo $punkt.'<a href="'.$phpbb_root_path.'viewtopic.php?f='.$forum_id.'&t='.$topic_id.'" title="dodal: '.$author.'">'.$title.'</a><br>';
  80.  
  81.  
  82.  
  83. }
  84.  
  85. }
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: 14.10.2025 - 01:51