Use:
PHP Code:
if ($action=="showthread") {
extract ($GLOBALS);
$users_t=$DB_site->query("SELECT thread.threadid, thread.title,thread.postusername, thread.dateline, forum.title as forumtitle FROM thread LEFT JOIN forum ON forum.forumid=thread.forumid WHERE thread.postuserid=".$postuserid." AND thread.forumid=X AND thread.visible=1");
while ($users_threads=$DB_site->fetch_array($users_t)) {
$post[specialthreads].="<a href=\"showthread.php?s=".$session[sessionhash]."&thread=".$users_threads[threadid].'">'.$users_threads[title].'</a> ('.vbdate($dateformat,$users_threads[dateline]).') ['.$users_threads[forumtitle].']<br>';
$postusername=$users_threads[postusername];
}
if (!$post[specialthreads])
{
$post[specialthreads]='N/A';
}
if (!$postusername)
{
$users_t2=$DB_site->query_first("SELECT username FROM user WHERE userid=$postuserid");
$postusername=$users_t2[username];
}
eval("dooutput(\"".gettemplate("usersthreads")."\");");
exit;
}