2015-06-04, 11:32 AM
Hi All , wondered if some kind souls could help me please ,im trying to display threads from a certain forum on a external page this is the code i have so far
what do i need to add for it to display posts from one forum only ,also the current code i have added only seems to show thread title and poster and i would like it to display for example 500 characters of the thread ,i'm a bit of a noob with code so if you could kindly post my above code with the extra lines needed in there i would be eternally gratefull
Thanks in advance
<?php
@mysql_connect("localhost", "root", "********") or die("Could not connect to MySQL");
@mysql_select_db("forum") or die("Could not connect to MySQL");
define("IN_MYBB", 1);
$tlimit = 5; // How many titles you want
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads ORDER BY `tid` DESC LIMIT $tlimit");
$list = '';
while($fetch = $db->fetch_array($query))
{
$list .= " | <strong><a href=\"./showthread.php?tid={$fetch['tid']}\" target=\"_blank\">".htmlspecialchars_uni($fetch['subject'])."</a></strong>";
$poster = "<a href=\"./member.php?action=profile&uid=".$fetch['uid']."\">{$fetch['username']}</a>";
$list .= "Created by: {$poster} ";
}
echo $list;
?>
what do i need to add for it to display posts from one forum only ,also the current code i have added only seems to show thread title and poster and i would like it to display for example 500 characters of the thread ,i'm a bit of a noob with code so if you could kindly post my above code with the extra lines needed in there i would be eternally gratefull
Thanks in advance