Posts: 3
Threads: 1
Joined: Jul 2012
13-Jul-2012, 02:41 PM
Hello everyone,
I've used Commentics for a couple months now and it works great
! But on one page i now have more comments then fit on one page. unfortunatly, the newest comment shows on the second page, instead of the oldest one sliding onto that second page. How can i change that?
http://amadeocompositions.com/tutorials.html
Thanks in advance
Aurel
Posts: 2,894
Threads: 59
Joined: Jun 2010
Hi,
I think it's just because it's a reply. The replies always appear either underneath the original comment or on the next page if the original comment is the last one on the page. If you submit a new comment (which isn't a reply) then it should appear at the top of the first page and the oldest comment will slide onto the second page as expected.
By the way, the like/dislike and flag buttons aren't working.
Have
you completed
the interview?
Posts: 2,894
Threads: 59
Joined: Jun 2010
It may be because you're using MooTools and there's a conflict with jQuery.
Can you let me know what Commentics version you're on.
Have
you completed
the interview?
Posts: 3
Threads: 1
Joined: Jul 2012
Thanks Steven,
I should have noticed that it's a reply -.- sorry bout that...
Under Reports->version it says 1.6 installed in september - They do not work indeed.
Thanks
Aurel
Posts: 2,894
Threads: 59
Joined: Jun 2010
Would you mind letting me know if the following works.
In /comments/includes/template/comments.php
Find this:
Code:
<?php if ($settings->show_like || $settings->show_dislike) { ?>
<script type="text/javascript">
// <![CDATA[
$(function() {
$(".vote").click(function()
{
var id = $(this).attr("id");
var name = $(this).attr("name");
var dataString = 'id='+ id ;
var parent = $(this);
if (name == 'up') {
$.ajax({
type: "POST",
url: "<?php echo $path_to_comments_folder . "vote.php?type=up"?>",
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
} else {
$.ajax({
type: "POST",
url: "<?php echo $path_to_comments_folder . "vote.php?type=down"?>",
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
}
return false;
});
});
// ]]>
</script>
<?php } ?>
<?php if ($settings->show_flag) { ?>
<script type="text/javascript">
// <![CDATA[
$(function() {
$(".flag").click(function()
{
var id = $(this).attr("id");
var name = $(this).attr("name");
var dataString = 'id='+ id ;
var parent = $(this);
var proceed = true;
var answer = confirm("<?php echo CMTX_FLAG_CONFIRM; ?>");
if (!answer) { proceed = false; }
if (proceed) {
var text = prompt("<?php echo CMTX_FLAG_REASON; ?>","");
if (text == null) {
proceed = false;
}
}
if (name == 'flag' && proceed) {
$.ajax({
type: "POST",
url: "<?php echo $path_to_comments_folder . "flag.php?reason="?>" + text,
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
}
return false;
});
});
// ]]>
</script>
<?php } ?>
Replace with:
Code:
<?php if ($settings->show_like || $settings->show_dislike) { ?>
<script type="text/javascript">
// <![CDATA[
var $cmtx_jQuery = jQuery;
$cmtx_jQuery(document).ready(function() {
$cmtx_jQuery(".vote").click(function()
{
var id = $(this).attr("id");
var name = $(this).attr("name");
var dataString = 'id='+ id ;
var parent = $(this);
if (name == 'up') {
$cmtx_jQuery.ajax({
type: "POST",
url: "<?php echo $path_to_comments_folder . "vote.php?type=up"?>",
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
} else {
$cmtx_jQuery.ajax({
type: "POST",
url: "<?php echo $path_to_comments_folder . "vote.php?type=down"?>",
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
}
return false;
});
});
// ]]>
</script>
<?php } ?>
<?php if ($settings->show_flag) { ?>
<script type="text/javascript">
// <![CDATA[
var $cmtx_jQuery = jQuery;
$cmtx_jQuery(document).ready(function() {
$cmtx_jQuery(".flag").click(function()
{
var id = $(this).attr("id");
var name = $(this).attr("name");
var dataString = 'id='+ id ;
var parent = $(this);
var proceed = true;
var answer = confirm("<?php echo CMTX_FLAG_CONFIRM; ?>");
if (!answer) { proceed = false; }
if (proceed) {
var text = prompt("<?php echo CMTX_FLAG_REASON; ?>","");
if (text == null) {
proceed = false;
}
}
if (name == 'flag' && proceed) {
$cmtx_jQuery.ajax({
type: "POST",
url: "<?php echo $path_to_comments_folder . "flag.php?reason="?>" + text,
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
}
return false;
});
});
// ]]>
</script>
<?php } ?>
Have
you completed
the interview?
Posts: 3
Threads: 1
Joined: Jul 2012
I did as you said, but it didn't change anything... I don't know much about php, so maybe i made a mistake, but i don't think so!
Right now the comments.php on the server is the one with the correction, but it doesn't make a difference. I did however comment out the mootools part, and that made it work. But as soon as mootool is back on it screws it up ;/
Thanks for you efforts
Aurel
Posts: 2,894
Threads: 59
Joined: Jun 2010
I managed to replicate your setup. I tried a few workarounds but the only way that I could resolve it was to load jQuery after MooTools. This may be something which you could try.
If it doesn't work, it seems logical to disable the features in Layout -> Comments -> Enabled:
"Like"
"Dislike"
"Flag"
Have
you completed
the interview?