ezor Posted January 6, 2008 Share Posted January 6, 2008 I have lastest forum posts on my main site's page, and i need to decode it to utf8, im used to work with htmlentities only and have no clue about this code : <table width="265px" height="85px" hborder="0" cellspacing="0" cellpadding="0" style='margin-top:0px;padding-left:0px;'><?php if (!$user) { $niveau = 0; } else { $niveau = $user[1]; } $sql_forums = mysql_query ("SELECT id FROM $nuked[prefix]_forums WHERE niveau <= $niveau"); while (list ($id) = mysql_fetch_array ($sql_forums)) { if (!isset ($where)) { $where = "WHERE forum_id='$id'"; } else { $where .= " || forum_id='$id'"; } } $sql_posts = mysql_query ("SELECT titre,auteur,thread_id,forum_id FROM $nuked[prefix]_forums_messages $where ORDER BY id DESC LIMIT 0,5"); while (list ($titre,$auteur,$tid,$fid) = mysql_fetch_array ($sql_posts)) { $pseudo = $auteur; $titre = strtolower ($titre); if (strlen($titre) > 35) { $titre = substr ($titre, 0,35) . '...'; } if (strlen($auteur) > 15) { $pseudo = substr ($auteur, 0,15) . '...'; } echo '<tr><td width="70%" style="padding-left:15px";> <a href="index.php?file=Forum&page=viewtopic&forum_id=' . $fid . '&thread_id=' . $tid . '"> <span style="font-size:9px">'.stripslashes($titre).'</span> </a> </td><td width="30%" style="padding-left:10px";> <a href="index.php?file=Members&op=detail&autor=' . $auteur . '"> <span style="font-size:9px">' . $pseudo . '</span> </a> </td> </tr>'; } ?></table> Thanks for any kind of help Quote Link to comment https://forums.phpfreaks.com/topic/84687-lastest-forum-posts-at-main-page-utf8-decoding/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.