include("page_top.php");
include("langs/" . $_SESSION["lang"] . "/langue.php");
?>
function bbdecode($text, $uid)
{
$text = " " . $text;
// First: If there isn't a "[" and a "]" in the message, don't bother.
if (! (strpos($text, "[") && strpos($text, "]")) )
{
// Remove padding, return.
$text = substr($text, 1);
return $text;
}
$text = str_replace("[quote:$uid]", "", $text);
$text = str_replace("[/quote:$uid]", "", $text);
// New one liner to deal with opening quotes with usernames...
// replaces the two line version that I had here before..
$text = preg_replace("/\[quote:$uid=\"(.*?)\"\]/si", "", $text);
// [list] and [list=x] for (un)ordered lists.
// unordered lists
$text = str_replace("[list:$uid]", "
", $text);
// li tags
$text = str_replace("[*:$uid]", "- ", $text);
// ending tags
$text = str_replace("[/list:u:$uid]", "
", $text);
$text = str_replace("[/list:o:$uid]", "", $text);
// Ordered lists
$text = preg_replace("/\[list=([a1]):$uid\]/si", "
", $text);
// colours
$text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", "", $text);
$text = str_replace("[/color:$uid]", "", $text);
// size
$text = preg_replace("/\[size=([1-2]?[0-9]):$uid\]/si", "", $text);
$text = str_replace("[/size:$uid]", "", $text);
// [b] and [/b] for bolding text.
$text = str_replace("[b:$uid]", "", $text);
$text = str_replace("[/b:$uid]", "", $text);
// [u] and [/u] for underlining text.
$text = str_replace("[u:$uid]", "", $text);
$text = str_replace("[/u:$uid]", "", $text);
// [i] and [/i] for italicizing text.
$text = str_replace("[i:$uid]", "", $text);
$text = str_replace("[/i:$uid]", "", $text);
$text = substr($text, 1);
$text = str_replace("[img:$uid]", "[img]", $text);
$text = str_replace("[/img:$uid]", "[/img]", $text);
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'
'", $text);
$text = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\$1\$2", $text);
$text = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\$1\$2", $text);
$text = preg_replace("#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is", "\$1", $text);
$text = preg_replace("#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is", "\$1", $text);
$text = preg_replace("#\[url=([\w]+?://[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is", "\$2", $text);
$text = preg_replace("#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is", "\$3", $text);
return $text;
}
function phpbb_preg_quote($str, $delimiter)
{
$text = preg_quote($str);
$text = str_replace($delimiter, '\\' . $delimiter, $text);
return $text;
}
function smiley_sort($a, $b)
{
if ( strlen($a['code']) == strlen($b['code']) )
{
return 0;
}
return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1;
}
function parse_smilies($message)
{
static $orig, $repl;
if (!isset($orig))
{
$orig = $repl = array();
$sql = 'SELECT * FROM forumdoremi_smilies';
$result = mysql_query($sql);
for ($i = 0; $new = mysql_fetch_array($result); $i++) {
$smilies[$i] = $new;
}
if (count($smilies))
{
usort($smilies, 'smiley_sort');
}
for ($i = 0; $i < count($smilies); $i++)
{
$orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/";
$repl[] = '
';
}
}
if (count($orig))
{
$message = preg_replace($orig, $repl, ' ' . $message . ' ');
$message = substr($message, 1, -1);
}
return $message;
}
$sql = "SELECT * from forumdoremi_topics AS t, forumdoremi_posts_text AS p, forumdoremi_users AS u WHERE (t.forum_id = '2' && t.topic_first_post_id = p.post_id && t.topic_type != '0' && u.user_id = t.topic_poster) ORDER BY t.topic_id DESC LIMIT 0, 3";
$result = mysql_query ($sql) or die(mysql_error());
while ($news = mysql_fetch_object($result))
{
?>
echo $news->topic_title; ?> - topic_time)?> à topic_time)?> post_text, $news->bbcode_uid))); ?> Réactions |
 username?> |
}
?>