The script that I am using as an example is my forumrules page, that takes the information from the rules forum, and displays the only topic there which contains the text of the rules
Link to forums rules(WARNING HAS SOME SWEARING): http://djdtm.com/ind...page=forumrules
The code to forum rules:
<?php
include("**********.php");
//Mysql Connect Script
$result = mysql_query("SELECT * from phpbb_topics WHERE forum_id=25 AND topic_vote != 1 order by topic_id desc LIMIT 0, 1")
or die("Invalid query: " . mysql_error());
while($myrow=mysql_fetch_array($result))
{
$topic_id = $myrow["topic_id"];
$sql = sprintf("Select * from phpbb_posts_text where post_subject='%s' order by post_id desc LIMIT 0, 1", $myrow["topic_title"]);
$result2 = mysql_query($sql) or die("Couldn't get news post");
while($rows2=mysql_fetch_array($result2))
$post_body = markup($rows2["post_text"]);
}
?>
<?php printf("%s", $post_body);?>
I narrowed down all the useless code like tables to save room.The forum_id which is 25 is the rules forum, and it only shows the first thread LIMIT 0,1
And as you can see the bbcode shows as, if bold:
[b:c82d668aeb]TEST[/b:c82d668aeb]
and italics:
[i:c82d668aeb]TeST[/i:c82d668aeb]
And the breaks aren't being shown either.
So how would I accomplish changing all the bbcode from phpbb to html code when its being displayed on my site, and setting the breaks in their propper positions.
Any help would be greatly appreciated.
Edited by DjDTM, 05 March 2006 - 12:11 PM.
