This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

New Comments on first page
#1
Tongue 

Hello everyone,

I've used Commentics for a couple months now and it works greatTongue! 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
Reply
#2

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?
Reply
#3

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?
Reply
#4

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
Reply
#5

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?
Reply
#6

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
Reply
#7

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?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Toeb
17-Oct-2021, 07:55 PM
Last Post by Steven
06-Aug-2021, 06:50 PM
Last Post by Steven
27-Jul-2021, 07:12 PM
Last Post by clixcity
29-Jul-2020, 07:56 PM
Last Post by Steven
09-Jul-2018, 08:40 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)