Version: , by Boofo
Developer Last Online: Jun 2012
Version: Unknown
Rating:
Released: 03-07-2003
Last Update: Never
Installs: 0
No support by the author.
What I'm trying to do with the code below is pull both the post title (if there is one) and the thread title from the getlastposts query. What I want it to do is is show "Re: threadtitle" is there is no post title. Can someone please tell me what I am doing wrong?
PHP Code:
$totalposts=$userinfo[posts];
if ($totalposts!=0 or $userinfo[lastpost]!=0) {
$getlastposts=$DB_site->query("SELECT thread.title,thread.threadid,thread.forumid,post.title,postid,post.dateline FROM post,thread WHERE thread.threadid=post.threadid AND post.userid=$userinfo[userid] AND post.visible=1 ORDER BY post.dateline DESC");
$postctr=0;
$latestposts="";
while ($getlastpost=$DB_site->fetch_array($getlastposts)) {
$getperms=getpermissions($getlastpost[forumid],$bbuserinfo[userid],$bbuserinfo[usergroupid]);
if ($getperms[canview]==1) {
$postdate=vbdate($dateformat,$getlastpost[dateline]);
$posttime=vbdate($timeformat,$getlastpost[dateline]);
$posttitle=$getlastpost[title];
$posttitle=censortext($posttitle);
$posttitle=htmlspecialchars($posttitle);
$posttitle=preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $posttitle);
$threadtitle=$getlastpost[title];
$threadtitle=censortext($threadtitle);
$threadtitle=htmlspecialchars($threadtitle);
$threadtitle=preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $threadtitle);
$posturl="showthread.php?postid=$getlastpost[postid]#post$getlastpost[postid]";
$postctr++;
if ($postctr==1){
$lastpostdate=$postdate;
$lastposttime=$posttime;
$lastposttitle=$posttitle;
$lastposturl=$posturl;
}
eval("\$latestposts .= \"".gettemplate("getinfo_latestposts")."\";");
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
ok try this, it's late so it might not be perfect and if it's not i'll fix it tomorrow cuz my bed's calling me
PHP Code:
$totalposts=$userinfo[posts];
if ($totalposts!=0 or $userinfo[lastpost]!=0) {
$getlastposts=$DB_site->query("SELECT thread.title AS threadtitle,thread.threadid,thread.forumid,post.title AS posttitle,post.postid,post.dateline,post.userid,post.visible FROM thread,post WHERE thread.threadid=post.threadid AND post.userid=$userinfo[userid] AND post.visible=1 ORDER BY post.dateline DESC");
$postctr=0;
$latestposts="";
while ($getlastpost=$DB_site->fetch_array($getlastposts)) {
$getperms=getpermissions($getlastpost[forumid],$bbuserinfo[userid],$bbuserinfo[usergroupid]);
if ($getperms[canview]==1) {
$postdate=vbdate($dateformat,$getlastpost[dateline]);
$posttime=vbdate($timeformat,$getlastpost[dateline]);
$posttitle=$getlastpost[posttitle]."(Thread: ".$threadtitle.")";
$posttitle=censortext($posttitle);
$posttitle=htmlspecialchars($posttitle);
$posttitle=preg_replace("/(\[)(you)(])/siU", $bbuserinfo[username], $posttitle);
$posturl="showthread.php?postid=$getlastpost[postid]#post$getlastpost[postid]"; ///////// <- Not sure what this is supposed to be, what's with the # sign?
How do you then get this into postbit template to display the RE: threadtitle on all replies after the initial threadpost? I've been looking for something like this as well to avoid an empty field in my postbit.