Quote:
Originally posted by 006
does anybody know how to get this working with maybe an if/then/else statement?
here's what i want to do. i want it to instead of ALWAYS showing the thread title that was posted in, i want it to be something like
if thread title exists, it will use that UNLESS there is also an individual post subject that someone has manually entered along the line, then it would use that? see what I mean? thanks.
|
Just add:
PHP Code:
if ($posttitle == "") {
$posttitle = "Re: $threadtitle";
} else {
$posttitle = "$posttitle";
}
Above:
You'll also have to change the query to this:
PHP Code:
$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");
And add this:
PHP Code:
$threadtitle=$getlastpost[threadtitle];
$threadtitle=censortext($threadtitle);
$threadtitle=htmlspecialchars($threadtitle);
$threadurl="showthread.php?s=$session[sessionhash]&threadid=$getlastpost[threadid]\" title=\"Go to first post";
Above this:
PHP Code:
$posttitle=$getlastpost[posttitle];