2006-12-19, 02:28 AM
Hey, I'm using a script that someone else made, and I was wondering if someone could modify it so it would display the post as well as the subject.
Thanks (here's the code)[/code]
*bump*
Thanks (here's the code)[/code]
<?php
/** Config **/
$dbhost = "xxx";
$dbuser = "xxx";
$dbpassword = "xxx";
$dbdatabase = "xxx";
$prefix = "mybb_"; //Databaseprefix
$url = "xxx"; // URL to the board
$viewable_forums = "xx"; //viewable forums - seperate with coma , (for examble "xx")
$limit = "xx"; // How many topics we want to see?
$length = "xx"; // length of the subject (0 ist full length)
/** End of config **/
// We connect to the database
$db = mysql_connect($dbhost,$dbuser,$dbpassword) or die ("Verbindung fehlgeschlagen");
mysql_select_db($dbdatabase,$db);
$viewable_forums = str_replace(","," OR fid=",$viewable_forums);
echo "";
// username= author // replies = answers
$query = mysql_query ("SELECT subject,tid,replies,fid FROM ".$prefix."threads WHERE visible='1' AND fid=".$viewable_forums." ORDER BY tid DESC LIMIT 0,".$limit."");
while ($newest_threads = mysql_fetch_array($query))
{
if ($length != 0)
{
if (strlen($newest_threads['subject']) > $length)
{
$newest_threads['subject'] = substr($newest_threads['subject'],0,$length) . "...";
}
}
echo "<h2 align=left><img src=img/newshead.png>".$newest_threads['subject']."
- <a href=\"".$url."/showthread.php?tid=".$newest_threads['tid']."\" target=\"_blank\">Discuss!</a></h2><br />";
}
echo "<br />";
?>
*bump*