If you search the template you are putting the custom code in, look at what variable names are already being used.
In showthread $forum is never used... Nor is $thread, the actual one used is $threadinfo.
In forumdisplay it's $foruminfo....
So for the forumdisplay template this would be the code:
PHP Code:
<if condition="$show['newthreadlink'] AND $foruminfo['forumid'] == 8">
<a href="complaints-suggestions.php" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a>
<else />
<a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a>
</if>