2014-09-19 09:58:54 +00:00
|
|
|
|
2014-01-18 13:35:29 +00:00
|
|
|
{if $userquery->login_check('',true) || $Cbucket->configs.anonym_comments == 'yes'}
|
2014-09-19 09:58:54 +00:00
|
|
|
<div class="add_comment_box" id="add_comment"> </div>
|
2014-02-04 13:16:11 +00:00
|
|
|
<div class="">
|
2014-05-08 14:12:46 +00:00
|
|
|
<div id="comment-add-err"></div>
|
2014-09-19 09:58:54 +00:00
|
|
|
|
2014-02-04 13:16:11 +00:00
|
|
|
<form class="" id="comment_form" >
|
2014-01-18 13:35:29 +00:00
|
|
|
|
|
|
|
<input type="hidden" name="reply_to" id="reply_to" value="0">
|
|
|
|
<input type="hidden" name="obj_id" id="obj_id" value="{$id}">
|
|
|
|
{if !$userquery->login_check('',true) && $Cbucket->configs.anonym_comments == 'yes'}
|
|
|
|
|
2014-02-13 11:29:11 +00:00
|
|
|
<div class="form-group">
|
2014-01-18 13:35:29 +00:00
|
|
|
<label for="comment_name">
|
|
|
|
{lang code='name'}
|
|
|
|
</label>
|
|
|
|
<input type="text" name="name" id="comment_name" class="form-control">
|
|
|
|
</div>
|
|
|
|
|
2014-02-13 11:29:11 +00:00
|
|
|
<div class="form-group">
|
2014-01-18 13:35:29 +00:00
|
|
|
<label for="comment_email">
|
|
|
|
{lang code='email_wont_display'}
|
|
|
|
</label>
|
|
|
|
<input type="email" name="email" id="comment_email" class="form-control">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{else}
|
|
|
|
<strong>{sprintf(lang('Comment as %s'),$userquery->username)}</strong>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
{ANCHOR place='before_compose_box'}
|
|
|
|
|
|
|
|
|
|
|
|
{if config('comments_captcha')=='all' || ( config('comments_captcha')=='guests' && !$userquery->login_check('',true) )}
|
|
|
|
|
2014-02-13 11:29:11 +00:00
|
|
|
<div class="form-group">
|
2014-01-18 13:35:29 +00:00
|
|
|
|
|
|
|
{assign var=captcha value=get_captcha()}
|
|
|
|
{if $captcha}
|
|
|
|
{if $captcha.show_field}
|
|
|
|
<label class="label" for="captcha">Verification Code</label>
|
|
|
|
{load_captcha captcha=$captcha load=field field_params = ' id="captcha" class="input" '}
|
|
|
|
|
|
|
|
{/if}
|
|
|
|
{load_captcha captcha=$captcha load=function}
|
|
|
|
|
|
|
|
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
2014-02-04 13:16:11 +00:00
|
|
|
<div class="form-group">
|
2014-01-18 13:35:29 +00:00
|
|
|
{if !$userquery->login_check('',true) && $Cbucket->configs.anonym_comments == 'yes'}
|
|
|
|
<label for="comment_text">
|
|
|
|
{lang code='Your comment'}
|
|
|
|
</label>
|
2014-09-19 09:58:54 +00:00
|
|
|
{/if}
|
|
|
|
|
2014-05-08 14:12:46 +00:00
|
|
|
<textarea name="comment" id="comment_text" class="form-control clearfix comment_text_new"></textarea>
|
2014-09-19 09:58:54 +00:00
|
|
|
<div id="reply_to_img"><i class="glyphicon glyphicon-share-alt" style="color:#428BCA;"></i></div>
|
2014-02-04 13:16:11 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group clearfix">
|
2014-05-08 14:12:46 +00:00
|
|
|
<button data-loading-text="Loading..." type="button" class="hidden-xs hidden-sm btn btn-primary pull-right" id="addCommentButton">{lang('Comment')}</button>
|
|
|
|
|
2014-01-18 13:35:29 +00:00
|
|
|
</div>
|
|
|
|
|
2014-05-08 14:12:46 +00:00
|
|
|
|
2014-02-05 12:26:01 +00:00
|
|
|
<script>
|
2014-09-19 09:58:54 +00:00
|
|
|
|
|
|
|
function blink(selector){
|
|
|
|
$(selector).fadeOut('slow', function(){
|
|
|
|
$(this).fadeIn('slow', function(){
|
|
|
|
blink(this);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2014-12-02 08:46:47 +00:00
|
|
|
|
2014-05-08 14:12:46 +00:00
|
|
|
var ajaxPage = baseurl+'/ajax.php';
|
2014-12-03 06:55:46 +00:00
|
|
|
$('#addCommentButton').on('click',function(e){
|
2014-05-08 14:12:46 +00:00
|
|
|
e.preventDefault();
|
|
|
|
var btn =$(this);
|
2014-12-02 07:55:04 +00:00
|
|
|
btn.button('loading');
|
|
|
|
|
2014-05-08 14:12:46 +00:00
|
|
|
|
|
|
|
$('#comment-add-err').hide();
|
|
|
|
|
|
|
|
var data = $(this).parents("form").serialize() + "&type={$type}&mode=add_comment";
|
|
|
|
$.ajax({
|
|
|
|
url: ajaxPage,
|
|
|
|
type: "post",
|
|
|
|
data: data,
|
|
|
|
dataType : 'json',
|
|
|
|
}).success(function(response){
|
2014-12-03 06:55:46 +00:00
|
|
|
|
2014-05-08 14:12:46 +00:00
|
|
|
//var response = $.parseJSON(response);
|
2014-12-03 06:55:46 +00:00
|
|
|
|
2014-05-08 14:12:46 +00:00
|
|
|
var cid = parseInt(response.cid);
|
|
|
|
if(cid > 1){
|
2014-02-05 12:26:01 +00:00
|
|
|
$.ajax({
|
|
|
|
url: ajaxPage,
|
|
|
|
type: "post",
|
2014-05-08 14:12:46 +00:00
|
|
|
data: {
|
|
|
|
mode: "get_comment",
|
2014-12-02 07:55:04 +00:00
|
|
|
cid: cid,
|
|
|
|
|
2014-05-08 14:12:46 +00:00
|
|
|
},
|
|
|
|
}).success(function(comment){
|
|
|
|
$("#comment_text").val('');
|
|
|
|
$("#userCommentsList").prepend(comment);
|
2014-12-02 07:55:04 +00:00
|
|
|
|
|
|
|
var count_comments = $("#comment_counter").val();
|
|
|
|
$("#com_count").html("");
|
2014-12-02 08:46:47 +00:00
|
|
|
$("#com_count").append(count_comments);
|
2014-12-02 07:55:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-05 12:26:01 +00:00
|
|
|
});
|
2014-05-08 14:12:46 +00:00
|
|
|
}else{
|
|
|
|
if(response.msg){
|
|
|
|
$('#comment-add-err').show().html(response.msg);
|
|
|
|
}
|
|
|
|
else if(response.err)
|
|
|
|
{
|
|
|
|
$('#comment-add-err').show().html(response.err);
|
|
|
|
}
|
2014-02-05 12:26:01 +00:00
|
|
|
}
|
2014-05-08 14:12:46 +00:00
|
|
|
|
|
|
|
btn.button('reset');
|
2014-02-05 12:26:01 +00:00
|
|
|
});
|
2014-05-08 14:12:46 +00:00
|
|
|
|
2014-02-05 12:26:01 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2014-09-23 13:47:24 +00:00
|
|
|
<div class="hidden-lg hidden-md mbxl">
|
2014-02-04 13:16:11 +00:00
|
|
|
<button type="submit" class="btn btn-primary" onclick="add_comment_js('comment_form','{$type}'){ANCHOR place='onClickAddComment'}">{lang('Comment')}</button>
|
2014-01-18 13:35:29 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2014-09-19 09:58:54 +00:00
|
|
|
|
|
|
|
|
2014-01-18 13:35:29 +00:00
|
|
|
|
|
|
|
<div id="add_comment_result" class="add_comment_result mtm mbm" style="display:none"></div>
|
|
|
|
|
|
|
|
{else}
|
|
|
|
{lang code='please_login_to_comment'}
|
|
|
|
{/if}
|
|
|
|
</div>
|
2014-09-19 09:58:54 +00:00
|
|
|
|
|
|
|
<style>
|
|
|
|
#reply_to_img{
|
|
|
|
|
|
|
|
position:absolute;
|
|
|
|
margin-left:686px;
|
|
|
|
margin-top:-65px;
|
|
|
|
display:none;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|