if you still want it the way, it should work, try this:
PHP Code:
if ($permissions['canopenclose'] and (ismoderator($threadinfo[forumid],"canopenclose") or $isstarter=$DB_site->query_first("SELECT postuserid FROM thread WHERE threadid='$threadid' and postuserid='$bbuserinfo[userid]'"))) {
$closethreadchecked=iif(trim($closethread)=="yes","checked","");
eval("\$closethreadbox = \"".gettemplate("newpost_closethread")."\";");
} else {
$closethreadbox="";
}
it checks, if the user can open close own threads (and started this thread) or is moderator with this rights.
See it in Action on
http://www.hotornot.de