GSX-Racing
06-06-2005, 05:35 AM
Not sure if that is the wording but here goes.
I have a script that grabs the first post from the latest 3 threads and displays on a non vb page.
http://www.groundpilots.com/vb/print_news.phtml is what I'm talking about.
However, if you notice, it doesn't bring any of the formatting (like line breaks, colors, bold text, center) with it.
Does anyone know how I could achieve this? Also, it is only grabbing part of the post, how can I get it to grab all the text.
Here is most of the file is anyone can see where I need to change some of it.
require_once("./includes/functions_bbcodeparse.phtml");
$outxt=parse_bbcode2($ptext,"1","1","1","1","1");
$outxt=substr($outxt,0,350);
// This is optional. It strips out unecessary tags if you wish and leaves those specified behind
$outxt = strip_tags($outxt, '<p>');
// This sql gets the title of the forum
$sql3 = "SELECT title FROM ".$dbprefix."forum WHERE forumid = \"$forumid\" LIMIT 1";
$sql_result3 = mysql_query($sql3, $connection) or die ("Could not execute query in second sql statement.");
$row3 = mysql_fetch_array($sql_result3);
$forumname = $row3["title"];
//EDIT the HTML OUTPUT HERE
$towrite .= '
<table class="newstext" width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td bgcolor="#2F3E49"><a href="'.$forumspath.'/showthread.phtml?s=&threadid='.$threadid.'"><font color=#FFFFFF>'.$title.'</font></a></td>
<td align="right" bgcolor="#2F3E49"><font color=#CCCCCC>Posted by</font> <a href="'.$forumspath.'/member.phtml?s=&action=getinfo&userid='.$postuseri d.'"><b><font color=#FFFFFF>'.$postusername.'</font></b></a><font color=#CCCCCC> on <i>'.$dateposted.'</i></font></td>
</tr>
<tr>
<td colspan="2" bgcolor="#232D35"><font color=#CCCCCC>'.$outxt.'</font></td>
</tr>
<tr bgcolor="#2F3E49">
<td><a class=newsout href="'.$forumspath.'/showthread.phtml?s=&threadid='.$threadid.'"><font color=#FFFFFF>'.$replycount.' '.$commenttext.'</font></a></td>
<td align="right" bgcolor="#2F3E49"><a href="'.$forumspath.'/showthread.phtml?s=&threadid='.$threadid.'"><font color=#FFFFFF>Read Complete Article</font></a> <a href="'.$forumspath.'/newreply.phtml?do=newreply&t='.$threadid.'"><img src="'.$forumspath.'/tren_z/buttons/reply.gif" title="Post a reply to this article" border="0"></a></td>
</tr>
</table><br>
';
// END HTML EDIT
}
}
echo $towrite;
echo '</body></html>';
}
writenews("27", "","3");
?>
I have a script that grabs the first post from the latest 3 threads and displays on a non vb page.
http://www.groundpilots.com/vb/print_news.phtml is what I'm talking about.
However, if you notice, it doesn't bring any of the formatting (like line breaks, colors, bold text, center) with it.
Does anyone know how I could achieve this? Also, it is only grabbing part of the post, how can I get it to grab all the text.
Here is most of the file is anyone can see where I need to change some of it.
require_once("./includes/functions_bbcodeparse.phtml");
$outxt=parse_bbcode2($ptext,"1","1","1","1","1");
$outxt=substr($outxt,0,350);
// This is optional. It strips out unecessary tags if you wish and leaves those specified behind
$outxt = strip_tags($outxt, '<p>');
// This sql gets the title of the forum
$sql3 = "SELECT title FROM ".$dbprefix."forum WHERE forumid = \"$forumid\" LIMIT 1";
$sql_result3 = mysql_query($sql3, $connection) or die ("Could not execute query in second sql statement.");
$row3 = mysql_fetch_array($sql_result3);
$forumname = $row3["title"];
//EDIT the HTML OUTPUT HERE
$towrite .= '
<table class="newstext" width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td bgcolor="#2F3E49"><a href="'.$forumspath.'/showthread.phtml?s=&threadid='.$threadid.'"><font color=#FFFFFF>'.$title.'</font></a></td>
<td align="right" bgcolor="#2F3E49"><font color=#CCCCCC>Posted by</font> <a href="'.$forumspath.'/member.phtml?s=&action=getinfo&userid='.$postuseri d.'"><b><font color=#FFFFFF>'.$postusername.'</font></b></a><font color=#CCCCCC> on <i>'.$dateposted.'</i></font></td>
</tr>
<tr>
<td colspan="2" bgcolor="#232D35"><font color=#CCCCCC>'.$outxt.'</font></td>
</tr>
<tr bgcolor="#2F3E49">
<td><a class=newsout href="'.$forumspath.'/showthread.phtml?s=&threadid='.$threadid.'"><font color=#FFFFFF>'.$replycount.' '.$commenttext.'</font></a></td>
<td align="right" bgcolor="#2F3E49"><a href="'.$forumspath.'/showthread.phtml?s=&threadid='.$threadid.'"><font color=#FFFFFF>Read Complete Article</font></a> <a href="'.$forumspath.'/newreply.phtml?do=newreply&t='.$threadid.'"><img src="'.$forumspath.'/tren_z/buttons/reply.gif" title="Post a reply to this article" border="0"></a></td>
</tr>
</table><br>
';
// END HTML EDIT
}
}
echo $towrite;
echo '</body></html>';
}
writenews("27", "","3");
?>