Файл: adultscript-2.0.3-pro/files/templates/defboot/user_comments.tpl.php
Строк: 80
<?php defined('_VALID') or die('Restricted Access!'); ?>
<script type="text/javascript">
$(document).ready(function() {
$("button[id^='comment-approve-']").click(function(e) {
e.preventDefault();
var comment_id = $(this).attr('id').match(/comment-approve-(.*)/)[1];
$.ajax({
url: base_url + '/ajax.php?s=user_comment_approve',
cache: false,
type: "POST",
dataType: "json",
data: { comment_id: comment_id },
success: function(response) {
if (response.status == '1') {
$("#comment-approve-" + comment_id).text(response.msg);
$("#comment-approve-" + comment_id).attr('disabled', 'disabled');
}
}
});
});
$("button[id^='comment-delete-']").click(function(e) {
e.preventDefault();
var comment_id = $(this).attr('id').match(/comment-delete-(.*)/)[1];
$.ajax({
url: base_url + '/ajax.php?s=user_comment_delete',
cache: false,
type: "POST",
dataType: "json",
data: { comment_id: comment_id },
success: function(response) {
if (response.status == '1') {
$("#comment-" + comment_id).css('border', '1px solid red');
$("#comment-" + comment_id).fadeOut(1000);
}
if (!$(".media:visible").length) {
$("#comments-container").html('<div id="no-comments" class="none">No comments yet!</div>');
}
}
});
});
});
</script>
<div id="response" class="alert alert-dismissible" style="display: none;">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<?php echo $this->fetch('_user_header'); ?>
<?php if ($this->comments): echo $this->fetch('_comments_list'); ?>
<nav class="text-center"><ul class="pagination pagination-lg"><?php echo p('pagination', $this->pagination, CUR_URL); ?></ul></nav>
<?php else: ?>
<div class="none"><?php echo __('no-comments'); ?></div>
<?php endif; ?>
<?php echo $this->fetch('_user_footer'); ?>