Basically all I did was modify the code in the getinfo section of member.php but here is what pulls the posts.
Code:
// get last posts
$totalposts=$userinfo[posts];
if ($totalposts!=0 or $userinfo[lastpost]!=0) {
$getlastposts=$DB_site->query("SELECT thread.title,thread.threadid,thread.forumid,postid,post.dateline,pagetext FROM post,thread WHERE thread.threadid=post.threadid AND post.userid=$userid ORDER BY post.dateline DESC");
$postctr=0;
$latestposts="";
while ($getlastpost=$DB_site->fetch_array($getlastposts)) {
$getperms=getpermissions($bbuserid,$bbusergroupid,$getlastpost[forumid]);
if ($getperms[canview]==1) {
$lastpostdate=date($dateformat,$getlastpost[dateline]+(($timeoffset+$bbtimezoneoffset)*3600));
$lastposttime=date($timeformat,$getlastpost[dateline]+(($timeoffset+$bbtimezoneoffset)*3600));
$lastposttitle=$getlastpost[title];
$lastposturl="showthread.php?postid=$getlastpost[postid]#post$getlastpost[postid]";
$message=$getlastpost[pagetext];
if (strlen($message) > 160) {
$snippet = substr($message,0,160) . " (<a href=\"".$lastposturl."\">more...</a>)<br>";
} else {
$snippet = $message;
}
$postctr++;
$latestposts.="<p><a href=\"".$lastposturl."\">".$lastposttitle."</a>??".$lastpostdate." at ".$lastposttime."<br><font face=\"verdana,arial,helvetica\" size=\"1\">".$snippet."</font></p>";
if ($postctr==5) {
break;
}
}
}
} else {
$lastpostdate=$username." has not made any posts yet.";
}
It doesn't pull the whole message unless it is less than 160 characters. Normally it just pulls a snippet. I hadn't made it into templates yet so all the HTML is still in the code. If you don't want to use the snippets then just delete the following lines and remove $snippet from the HTML block.
Code:
$message=$getlastpost[pagetext];
if (strlen($message) > 160) {
$snippet = substr($message,0,160) . " (<a href=\"".$lastposturl."\">more...</a>)<br>";
} else {
$snippet = $message;
}
All you should have to do to use it outside of vB per se is add:
require (global.php)