Bonjour,
Nous avons installer un cms e107 avec un forum phpbb3.
Le forum comme le cms sont en UTF-8.
Sur le site e107 nous avons un script qui permet d'afficher les derniers post.
Mais celui ci marche mal, nous avons un soucis avec des accents
Et je ne comprend pas trop le pourkoi de la chose, ce bloque là affiche en ISO au lieu d'etre en utf8.
Je supose que se sont les requette que fait php qui encode mal mais je ne trouve pas.
Voici le script qui permet d'afficher les dernier post :
Avez vous une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64 <? $lan_file = e_PLUGIN."e107bb/languages/".e_LANGUAGE.".php"; require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."e107bb/languages/English.php"); $gen = new convert; $text = ""; if(defined("PHPBB_PREFIX")) { $text .="<div style=\"text-align: center;\"> <table style=\"width: auto;\" class=\"fborder\"> <tbody><tr> <td style=\"width: 5%;\" class=\"forumheader\"> </td> <td style=\"width: 45%;\" class=\"forumheader\">Sujets</td> <td style=\"width: 15%; text-align: center;\" class=\"forumheader\">Auteur</td> <td style=\"width: 5%; text-align: center;\" class=\"forumheader\">Vues</td> <td style=\"width: 5%; text-align: center;\" class=\"forumheader\">Réponses</td> <td style=\"width: 25%; text-align: center;\" class=\"forumheader\">Date</td> </tr>"; $lastsql="SELECT * FROM `".PHPBB_PREFIX."topics` ORDER BY `topic_last_post_time` DESC LIMIT 0, 5"; $lastsql2=mysql_query($lastsql) or die("could not select posts".mysql_error()); while($lastsql3=mysql_fetch_array($lastsql2)) { $usersql="SELECT username FROM `".PHPBB_PREFIX."users` WHERE user_id='".$lastsql3['topic_poster']."' LIMIT 0, 1"; $usersql2=mysql_query($usersql) or die("could not select users"); $usersql3=mysql_fetch_array($usersql2); $forumsql="SELECT forum_name FROM `".PHPBB_PREFIX."forums` WHERE forum_id='".$lastsql3['forum_id']."' LIMIT 0, 1"; $forumsql2=mysql_query($forumsql) or die("could not select users"); $forumsql3=mysql_fetch_array($forumsql2); //From newforumposts_menu.php $datestamp = $gen->convert_date($lastsql3['topic_last_post_time'], "forum"); // $text .= "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".PHPBB_PATH."viewtopic.php?p=".$lastsql3['post_id']."'>Post: ".$lastsql3['post_subject']."</a>< br /> Posted by ".$usersql3['username']."<br />".$datestamp."<br />"; $text .= ' <tr> <td style="width: 5%; text-align: center;" class="forumheader3"><img src="e107_plugins/forum/images/lite/new_small.png" alt=""></td> <td style="width: 45%;" class="forumheader3"><b><a href="'.PHPBB_PATH.'viewtopic.php?f='.$lastsql3['forum_id'].'&t='.$lastsql3['topic_id'].'">'.$lastsql3['topic_title'].'</a></b> <span class="smalltex t">(<a href="'.PHPBB_PATH.'viewforum.php?f='.$lastsql3['forum_id'].'">'.$forumsql3['forum_name'].'</a>)</span></td> <td style="width: 15%; text-align: center;" class="forumheader3"><a href="'.PHPBB_PATH.'memberlist.php?mode=viewprofile&u='.$lastsql3['topic_poster'].'">'.$usersql3['username'].'</a></td> <td style="width: 5%; text-align: center;" class="forumheader3">'.$lastsql3['topic_views'].'</td> <td style="width: 5%; text-align: center;" class="forumheader3">'.$lastsql3['topic_replies'].'</td> <td style="width: 25%; text-align: center;" class="forumheader3"><a href="'.PHPBB_PATH.'memberlist.php?mode=viewprofile&u='.$lastsql3['topic_last_poster_id'].'">'.$lastsql3['topic_last_poster_name'].' </a><br/>'.$datestamp.'</td> </tr> '; } $text .=" </tbody></table> </div>"; /* And the menu creation part */ $caption = "Derniers Messages Du Forum"; $ns -> tablerender($caption, $text); } ?>
Merci de votre aide.
L'adresse du site : http://www.cfb-team.com/test/
Partager