Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/12/2010, 15:22
Avatar de memoadian
memoadian
Colaborador
 
Fecha de Ingreso: junio-2009
Ubicación: <?php echo 'México'?>
Mensajes: 3.696
Antigüedad: 15 años, 4 meses
Puntos: 641
Problema con simbolos especiales

Hola amigos tengo un problema con un script de php que hace es extraer los ultimos posts de mi foro en links para que los ponga en una página externa pero me suelta simbolos raros cuando le ponen títulos como.
"¿Hola me presento?"

MIREN EL ARCHIVO

http://manganimemas.com/foro/topic.php

verán lo que les digo, ya intente poniendo codificacion UTF-8 sin BOM

pero no entiendo, trate de investigar pero no encontré nada.

les dejo el código completo

Código PHP:
Ver original
  1. <?php
  2.  
  3. // Amount of active topics to show
  4. define("TOPIC_COUNT", 8);
  5.  
  6. // Path to the phpBB 3.0 root directory
  7. define("PHPBB_PATH", "../foro/");
  8.  
  9. // URL to the phpBB 3.0 installation
  10. define("PHPBB_LOCATION", "http://manganimemas.com/foro/");
  11.  
  12. // Time format to output the date/time (for format see PHP manual)
  13. define("TIME_FORMAT", "d/m/Y");
  14.  
  15. // php extension using
  16. $phpEx = "php";
  17.  
  18. // No Editing unless you know what your doing
  19. if ( !defined('IN_PHPBB') )
  20. {
  21.     define('IN_PHPBB', true);
  22. }
  23.  
  24.  
  25. // Get the needed phpbb files, thank you phpbb =]
  26. include($phpbb_root_path  . 'common.' . $phpEx);
  27. include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
  28.  
  29. $user->session_begin();
  30. $auth->acl($user->data);
  31. $user->setup();
  32.  
  33. // HTML header start
  34.  
  35. ?>
  36. <style>
  37. a:link,
  38. a:visited {
  39.     font-family: Verdana, Arial, Helvetica, sans-serif;
  40.     color: #496c9f;
  41.     text-decoration: none; 
  42. }
  43.  
  44. a:hover {
  45.     font-family: Verdana, Arial, Helvetica, sans-serif;
  46.     color: #496c9f;
  47.     text-decoration: underline;
  48. }
  49.  
  50. a:active {
  51.     font-family: Verdana, Arial, Helvetica, sans-serif;
  52.     color: #496c9f;
  53.     text-decoration: none;  
  54. }
  55. </style>
  56. <table border="0" cellpadding="1" cellspacing="1" width="100%">
  57. <tr>
  58. <th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Titulo</font></th>
  59. <th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Visitas</font></th>
  60. <th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Respuesta</font></th>
  61. <th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Ultimos mensajes</font></th>
  62. <th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Fecha</font></th>
  63. </tr>
  64. <?php
  65.  
  66. // HTML header end
  67.  
  68. $sql = "SELECT DISTINCT t.topic_title, t.topic_id,t.topic_views,t.topic_replies, t.topic_last_post_id,
  69.  
  70. p.post_time,p.poster_id, f.forum_name, u.user_id, u.username
  71. FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f, " . USERS_TABLE . " AS u
  72. WHERE
  73. t.forum_id = f.forum_id
  74.  
  75. AND p.topic_id = t.topic_id
  76. AND p.poster_id = u.user_id
  77. AND p.post_id = t.topic_last_post_id
  78. ORDER BY p.post_time DESC LIMIT " . TOPIC_COUNT;
  79. $nt_result = $db->sql_query($sql);
  80.  
  81. if(!$nt_result)
  82. {
  83. die("Failed obtaining list of active topics".mysql_error());
  84. }
  85. else
  86. {
  87. $nt_data = $db->sql_fetchrowset();
  88. }
  89.  
  90. if ( count($nt_data) == 0 )
  91. {
  92. die("No topics found");
  93. }
  94. else
  95. {
  96. $cq = 1;
  97. $cc = FFFFFF;
  98. // $nt_data contains all interesting data
  99. for ($i = 0; $i < count($nt_data); $i++)
  100. {
  101. $title = $nt_data[$i]['topic_title'];
  102. $Turl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id'];
  103. $LPurl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?p" . "=" . $nt_data[$i]['topic_last_post_id'] . "#p" . $nt_data[$i]['topic_last_post_id'];
  104.  
  105. $on_forum = 'Forum ' . $nt_data[$i]['forum_name'];
  106. $post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
  107. //Profile profile.php?mode=viewprofile&u=23
  108. $profile = PHPBB_LOCATION . 'memberlist.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ;
  109. $usrname = $nt_data[$i]['username'];
  110. // Item HTML start
  111.  
  112. if($cq%2 == 0){$cc = E8EFF4;$cq++;} else{$cc = E8EFF4;$cq++;}?>
  113. <tr>
  114. <td bgcolor="#<?php echo $cc;?>" align="left"><a href="<?php echo $LPurl; ?>" title="<?php echo $on_forum; ?>"
  115.  
  116. target="_parent"><font face="verdana" color="#496C9F" size="1"><B><?php echo $title; ?></B></font></a></td>
  117. <td bgcolor="#<?php echo $cc;?>" align="left"><div align="center"><font face="verdana" color="#5B5B5B" size="1"><?php echo
  118.  
  119. $nt_data[$i]['topic_views'] ?></div></td>
  120. <td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#5B5B5B" size="1"><div align="center"><?php echo
  121.  
  122. $nt_data[$i]['topic_replies'] ?></div></td>
  123. <td align="center" bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#666666" size="1"><a href="<?php
  124.  
  125. echo $profile; ?>" target="_parent"><font face="verdana" color="#496C9F" size="1"><B><?php echo $usrname?></B></a></td>
  126. <td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#5B5B5B" size="1"><div align="center"><?php echo
  127.  
  128. $post_time ?></div></td>
  129. </tr>
  130. <?php
  131.  
  132. // Item HTML end
  133.  
  134. }
  135. }
  136.  
  137. // Footer HTML start
  138.  
  139. ?>

el sistema funciona con phpBB3.

agradeceré cualquier idea :/