<div id="submenu"><div id="smarty_plugin">{{getcontent id=300}}</div></div>
<div id="middle2">
<div>
<div id="smarty_plugin">
{{getCollectionByCategory CollectionID=3 ColumnID=1 Value=$smarty.session.UserID OrderColumn=1 var=Groups}} 
{{assign var=generalUser value=0}} 
{{assign var=moderatorUser value=0}}
{{foreach from=$Groups item=v key=k}} 
	{{if $v.Collection_3_2 eq 5 or $v.Collection_3_2 eq 1 }} {{assign var=moderatorUser value=1}} {{/if}} 
	{{if $v.Collection_3_2 eq 4 }} {{assign var=generalUser value=1}} {{/if}} 
{{/foreach}} 
	{{assign var=CatCollection value=60}} 
	{{assign var=DescCollection value=61}} 
	{{assign var=CommentsCollection value=62}} 
	{{getCollectionByCategory CollectionID=$DescCollection OrderColumn=1 OrderWay=1 var=Articles ColumnID='ID' Value=$smarty.get.article}} 
	{{if $Articles|@count eq 0}} 
		{{urlredirect page='/notfond.html'}} 
	{{/if}} 
	{{assign var=ArticleData value=$Articles[0]}} 
	{{assign var=ArticleName value=1|fieldName:$DescCollection}} 
	{{assign var=Article value=3|fieldName:$DescCollection}} 
	{{assign var=Topic value=2|fieldName:$DescCollection}} 
	{{assign var=PostedBy value=6|fieldName:$DescCollection}} 
	{{assign var=DiscPosted value=5|fieldName:$DescCollection}} 
	{{assign var='PageTitle' value='Discussions - '}} 
	{{assign var='PageTitle' value=$PageTitle|concat:$ArticleData.$ArticleName}} 
	{{setPage var=Collection_17_2 value=$PageTitle}} 
	{{getCollectionByCategory CollectionID=$CatCollection OrderColumn=2 OrderWay=1 var=Categories ColumnID='ID' Value=$ArticleData.$Topic}} 
	{{assign var=CatData value=$Categories[0]}} 
	{{assign var=CatName value=1|fieldName:$CatCollection}} 
	{{getCollectionByCategory CollectionID=1 OrderColumn=1 OrderWay=1 var=User ColumnID='ID' Value=$ArticleData.$PostedBy}} 
	{{assign var=UData value=$User[0]}}
</div>
</div>
<h1>{{$ArticleData.$ArticleName}}</h1>
<div class="topic">{{$CatData.$CatName}}</div>


<h3>{{assign var=dateposted value=$ArticleData.$DiscPosted}}{{$dateposted|date_format:'%A, %B %e, %Y'}}</h3>
<div id="article_content">{{$ArticleData.$Article}}</div>
<div>
<p><span>Posted By {{$UData.Collection_1_3}} {{$UData.Collection_1_4}} at {{$dateposted|date_format:'%H:%M'}}</span> {{if $moderatorUser eq 1}} <a href="/edit-article.html?article={{$smarty.get.article}}"><img alt="" border="0" src="/images/edit-icon.gif" /></a> <a href="javascript: if(confirm('Delete Article?')) { window.location='/delete-article.html?article={{$smarty.get.article}}'; }"><img alt="" border="0" src="/images/delete-icon.gif" /></a> {{/if}}</p>
</div>
<div><img src="/images/sep.gif" height="20"/></div>
<div id="blog_article">
<h3>Comments</h3>
<div>
<div id="smarty_plugin">{{getCollectionByCategory CollectionID=$CommentsCollection OrderColumn=5 OrderWay=0 var=Comments ColumnID='4' Value=$smarty.get.article}} {{if $Comments|@count eq 0}}

<p>There are no comments posted for this article</p>
{{else}} {{assign var=CommentUser value=3|fieldName:$CommentsCollection}} {{assign var=CommentID value='ID'|fieldName:$CommentsCollection}} {{assign var=CommentTitle value='1'|fieldName:$CommentsCollection}} {{assign var=CommentComment value=2|fieldName:$CommentsCollection}} {{assign var=CommentTime value=5|fieldName:$CommentsCollection}} {{foreach from=$Comments item=v key=k}} {{getCollectionByCategory CollectionID=1 OrderColumn=1 OrderWay=1 var=User ColumnID='ID' Value=$v.$CommentUser}} {{assign var=UData value=$User[0]}}
<div id="comment">
<h4>{{$UData.Collection_1_3}} {{$UData.Collection_1_4}} said...</h4>
<h5>{{$v.$CommentTitle}}</h5>
<div>{{$v.$CommentComment|nl2br}}</div>
<div>
<p><span>{{assign var=dateposted value=$v.$CommentTime}}{{$dateposted|date_format:'%A, %B %e, %Y'}}</span> {{if $moderatorUser eq 1}} <a href="/edit-comment.html?article={{$smarty.get.article}}&comment={{$v.$CommentID}}"><img alt="" border="0" src="/images/edit-icon.gif" /></a> <a href="javascript: if(confirm('Delete Comment?')) { window.location='/delete-comment.html?article={{$smarty.get.article}}&comment={{$v.$CommentID}}'; }"><img alt="" border="0" src="/images/delete-icon.gif" /></a> {{/if}}</p>
</div>
</div>
{{/foreach}} {{/if}}</div>
</div>
<div id="postcomment">
<div id="smarty_plugin">{{if $moderatorUser eq 1 or $generalUser eq 1}}
<div><img src="/images/sep.gif" height="20"/></div>
<h3>Post a Comment</h3>
{{ViewCollection CollectionID=62 TemplateID=9}} {{/if}}</div>
</div>

</div>