include("../connect-forum-mybb.php");
$ID_TOPIC = 3299;
if (isset($_GET['id'])) {
$select = "SELECT pid, subject, message FROM mybb_posts WHERE tid = $ID_TOPIC AND pid = ".$_GET['id']." AND subject LIKE 'Saviez-vous que...'";
} else {
$select = "SELECT pid, subject, message FROM mybb_posts WHERE tid = $ID_TOPIC AND subject LIKE 'Saviez-vous que...' ORDER BY dateline DESC";
}
$result = mysql_query($select);
$nb = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
$htmlcode = array("", "", "", "", "", "");
$bbcode = array("[b]", "[/b]", "[u]", "[/u]", "[i]", "[/i]");
$texte=nl2br(str_replace($bbcode, $htmlcode, utf8_decode($row['message'])));
echo "";
echo $texte;
echo "
Lien vers ce saviez-vous.";
echo "
";
}
mysql_free_result($result);
mysql_close();
?>