Spotkania kibiców
function bb2html($text)
{
$bbcode = array(
"[list]", "[*]", "[/list]",
"[img]", "[/img]",
"[b]", "[/b]",
"[u]", "[/u]",
"[i]", "[/i]",
'[color=', "[/color]",
"[size=", "[/size]",
'[url=', "[/url]",
"[mail=", "[/mail]",
"[code]", "[/code]",
"[quote]", "[/quote]",
"[center]", "[/center]",
']');
$htmlcode = array(
"
- „, „
- „, „
„,
„„,
„„, „„,
„„, „„,
„„, „„,
„„,
„„,
‘„,
„„,
„", "„,
„
„, „
„,
„
‘”>’);
$newtext = str_replace($bbcode, $htmlcode, $text);
$newtext = nl2br($newtext);//second pass
return $newtext;
}
global $wpdb;
$wpdb->get_results(‘USE redtalk;’);
$sql = ‘
SELECT phpbb_topics . * , phpbb_posts.post_text, phpbb_posts.bbcode_uid
FROM phpbb_topics, phpbb_posts
WHERE phpbb_topics.forum_id =43
AND phpbb_posts.post_id = phpbb_topics.topic_last_post_id
ORDER BY phpbb_topics.topic_last_post_time DESC’;
$posts = $wpdb->get_results($sql);
$wpdb->get_results(‘USE redlog;’);
if (!empty($posts))
{
foreach ($posts as $post)
{
$post->post_text = str_replace(‘{SMILIES_PATH}’, ‘http://redcafe.pl/images/smilies’, $post->post_text);
$post->post_text = str_replace(‘topic_id&p=$post->topic_last_post_id#p$post->topic_last_post_id\” title=\”$post->topic_title\”>$post->topic_title
„.bb2html(str_replace(‘:’.$post->bbcode_uid, ”, $post->post_text)).”
„;
}
}
else
{
echo „dupa”;
}
?>







