Here i am sharing a very basic xtscript which will show the XT Forum to the logged in only users and ask them to log in if they are not logged in.
<!--parser:xtscript--> var $loginstatus=<xt:is_logged_in /> if $loginstatus==1 print <xt:forum /> else print Please log in to view the forum. endif <!--/parser:xtscript-->