 <script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'clean'
 };
 </script>
<h3 style="font-size:20px;"><?php echo $this->articleName;?></h3>
<div>
        <a href="index.php?fuse=knowledgebase&view=KB_MainView&public=1&amp;showall=1"><?php echo $this->lang("Categories");?></a> /
        <a href="index.php?fuse=knowledgebase&view=KB_CategoriesView&categoryId=<?php echo $this->categoryId; ?>&amp;public=1&amp;showall=1"><?php echo $this->categoryName;?></a>
</div>

<br />

<img id="authoricon" src="templates/<?php echo $this->gTemplateName;?>/images/public/avatar.gif" height="40" alt="icon" class="icon" style="border: 2px solid #dddddd" />
<p style="margin:0;padding-left:10px;"><?php echo $this->articleAuthor;?><br />
   <strong><?php echo $this->lang("Posted on");?></strong> <?php echo $this->articleCreated;?><!--Last Modified on: {articleModified}--></p>

<input type="hidden" id="articleId" name="articleId" value="<?php echo $this->articleId;?>" />

<div class="hr"></div>
<div id="kbarticle">
<p><?php echo $this->articleDescription;?></p>
</div>
<div class="hr"></div>

<?php if ($this->showAttachedFiles) { ?>
<h2><?php echo $this->lang("Attached Files");?></h2>
<ul class="file_list">
    <?php foreach ($this->articleAttachedFiles as $attachedFile) { ?>
        <li><a href="index.php?sessionHash=<?php echo $this->gHash;?>&amp;fuse=knowledgebase&amp;action=KB_GetAttachment&amp;articleId=<?php echo $this->articleId;?>&amp;file_id=<?php echo $attachedFile['file_id'];?>" target="_blank" ><?php echo $attachedFile['articleFilename'];?></a></li>
    <?php } ?>
</ul>
<?php } ?>

<?php if ($this->userCanRate) { ?>
<div id="ratearticle">
    <?php echo $this->lang("How helpful was this article to you?");?><br />
    <span class="rate_article">
        <span class="rate_article_stars">
            <span id="unit_long<?php echo $this->articleId;?>">
                <ul id="unit_ul<?php echo $this->articleId;?>" class="unit-rating" style="width:<?php echo $this->width;?>px;">
                    <li class="current-rating" style="width:<?php echo $this->ratingWidth;?>px;"><?php echo $this->lang("Currently");?> <?php echo $this->articleRate;?>/<?php echo $this->limitRate;?></li>
                    <?php foreach ($this->ratingScale as $ratingScale) { ?>
                    <li style="margin:0;list-style: none;"><a href="#" title="<?php echo $ratingScale['_ncount'];?> out of <?php echo $ratingScale['_limitRate'];?>" class="r<?php echo $ratingScale['_ncount'];?>-unit rater" rel="nofollow" onclick="RateArticle(<?php echo $ratingScale['_ncount'];?>)"><?php echo $ratingScale['_ncount'];?></a></li>
                    <?php } ?>
                </ul>
                <?php echo $this->lang("Rating");?>: <span id="textRating"><b><?php echo $this->articleRating1;?></b>&nbsp;/&nbsp;<?php echo $this->limitRate;?>&nbsp;(<?php echo $this->ratePhrase;?>&nbsp;<?php echo $this->lang("cast");?>)</span>
            </span>
        </span>
    </span>
</div>
<?php } ?>

<?php if ($this->alreadyRated) { ?>
<span class="rate_article" style="margin-left: 0">
    <span id="unit_long<?php echo $this->articleId;?>">
    <?php echo $this->lang("Rating");?>: <span id="textRating"><b><?php echo $this->articleRating1;?></b>&nbsp;/&nbsp;<?php echo $this->limitRate;?>&nbsp;(<?php echo $this->ratePhrase;?>&nbsp;<?php echo $this->lang("cast");?>)</span>
        <p><?php echo $this->lang("You have already rated this article");?></p>
    </span>
</span>
<?php } ?>

<?php if ($this->showrelatedtopics) { ?>
    <hr />
    <h2><?php echo $this->lang("Related Topics");?></h2>
    <ul class="related_articles">
        <?php foreach ($this->relatedTopics as $relatedTopic) { ?>
        <li><a href="index.php?fuse=knowledgebase&amp;view=KB_viewArticle&amp;articleId=<?php echo $relatedTopic['articleRelatedId'] ?>"><?php echo $relatedTopic['articleRelatedTitle'] ?></a></li>
        <?php } ?>
    </ul>
<?php } ?>

<div class="hr"></div>

<?php if ($this->hasArticleComments) { ?>
<h3><?php echo $this->lang("Comments");?></h3>
<?php } ?>

<?php foreach($this->ArticleComments as $articleComment) { ?>
<div style="border-bottom:1px solid #f3f3f3; padding:15px 15px 15px 0;">
<div class="left" style="text-align:center; width:66px; margin-right:15px;"><img src="templates/<?php echo $this->gTemplateName;?>/images/public/avatar_large.gif" alt="icon" />
</div>
    <b><?php echo $articleComment['CommentUser'];?></b><br /><?php echo $articleComment['dateAdded'];?><p><?php echo nl2br($articleComment['CommentArticle']);?></p>
 <div class="clear"></div>   
</div>
<?php } ?>

<?php if ($this->showArticleForm) { ?>
<div style="margin:15px 0;padding:10px; background:#f6f6f6;"><?php echo $this->lang("Add a comment");?></div>
<form name="formAddComments" method="post" action="index.php?fuse=knowledgebase&amp;action=KB_AddComment&amp;articleId=<?php echo $this->articleId;?>" id="comment_block" style="">
    <input type="hidden" name="public" value="" />
    <table class="ts2" cellspacing="0">
    	<tr>
        	<td class="label"><?php echo $this->lang("Name");?>:</td>
            <td><input type="text" id="userName" name="userName" value="<?php echo $this->user->getFullName(); ?>" /><input name="r_userName" type="hidden" value="Name" /></td>
        </tr>
        <tr>
        	<td class="label"><?php echo $this->lang("E-mail");?>:</td>
            <td><input type="text" id="userEmail" name="userEmail" value="<?php echo $this->user->getEmail(); ?>" /><input name="r_userEmail" type="hidden" value="E-mail" /></td>
        </tr>
        <tr>
        	<td colspan="2" style="padding-left:0px !important;border-bottom: 0px;"><textarea class="textarea" id="userComment" name="userComment" rows="8"></textarea></td>
        </tr>
        <?php if ($this->showCaptcha) { ?>
        <tr>
        	<td class="label" style="border-top: 1px solid #DBE6EC;"><?php echo $this->lang("Enter the code");?>:</td>
            <td style="border-top: 1px solid #DBE6EC;"><?php echo recaptcha_get_html($this->publickey); ?></td>
        </tr>
        <?php } ?>

    </table>     
	<input name="btnSubmitComment" type="submit" value="<?php echo $this->lang("Submit");?>" class="submit" onclick="check(form,form.elements.length);return false;"/>
</form>
<?php } ?>

<script type="text/javascript">
$(document).ready(function() {
    gravataremail = "<?php echo $this->articleAuthorEmail;?>";
    pathArray = window.location.pathname.split( '/' );
    newPathname = "";
    for ( var i = 0; i < pathArray.length -1 ; i++ ) {
        newPathname += "/";
        newPathname += pathArray[i];
    }
    defaultpicurl = window.location.protocol + "//" + window.location.host + "/" + newPathname + "/../images/defaultuserpic.jpg";
    img = ('https:' == document.location.protocol ? 'https://secure' : 'http://www') + '.gravatar.com/avatar.php?gravatar_id=' + MD5(gravataremail);
    $('#authoricon').attr("src",img);
});
</script>