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

Thumbs up/down not working
#1

I feel like I may have done something wrong here, but I have thumbs up and thumbs down buttons which simply don't work. I thought maybe there's a system to detect if I'm on the same IP as the comment poster, but I tried it from a different IP and a different browser (with no shared cookies), and still clicking on "thumbs up" has no effect.

Also, the "remember form details on this computer" doesn't work either, don't know if that's related.

Am I doing something wrong?
Reply
#2

What Commentics version?

Have you completed the interview?
Reply
#3

Also, a link to your site would help a lot. You can PM me it if you want to keep it private.

Have you completed the interview?
Reply
#4

(08-Apr-2013, 04:48 PM)Steven Wrote:  What Commentics version?

It's the latest version, I downloaded it a couple weeks ago. Dashboard says "You are using the latest version."

I'll PM you the URL.
Reply
#5

Okay, because of your URL re-write, you need to specify the absolute URL to the vote.php file.

To do this, open /comments/includes/template/comments.php

Replace this:
PHP Code:
<?php 
url
: "<?php echo $cmtx_path . "vote.php"?>",

With this:
PHP Code:
<?php 
url
: "http://www.xxxxxxxxxx.com/comments/vote.php",

(This is fixed in my development version)

Have you completed the interview?
Reply
#6

Regarding the form cookie not being set, did you add ..

PHP Code:
<?php 
ob_start
();

.. at the top of your page as instructed in the integration guide?

Have you completed the interview?
Reply
#7

I think your URL re-write is destroying the cmtx_sort and cmtx_page parameters. And that's why the 'Sort By' and 'Pagination' features aren't working. That's an issue with your URL re-write. If the parameters aren't made available to Commentics by the URL re-write then there's nothing that the Commentics script can do. Did you try adding "[QSA]" after the RewriteRule? If that doesn't work, you may want to ask on 'Stack Overflow' or somewhere on how to fix your URL re-write.

Have you completed the interview?
Reply
#8

A little aesthetic suggestion: you can reduce the size of the Gravatar image in Layout -> Comments -> Gravatar.

At the moment it's pushing down below the date. A size of 65px would look better.

Have you completed the interview?
Reply
#9

Aha, brilliant, thank you so much for your help on this.

I changed the vote.php URL as you suggested, and it's working perfectly now, thanks!

I had put the ob_start() right above the commentics code which I had assumed was good enough, but it seems I was wrong. So the cookie for saving form data is working now.

I added QSA to my URL rewrite, and that seems to have fixed the pagination and sorting issues. Although the URL gets progressively messier every time:

I rewrite www.xyz.com/comments-test/ to www.xyz.com/index.php?page=comments-test, and after a few sorts the URL looks like this:
xyz.com/comments-test/?cmtx_sort=3&page=comments-test&page=comments-test#cmtx_comments

It seems like my page parameter is getting added multiple times. Is that something I've done wrong with the URL rewriting?
Reply
#10

Can you replace the 'cmtx_get_query' function in /comments/includes/functions/page.php with this:

PHP Code:
<?php 
function cmtx_get_query ($type) { //gets query string from URL

$url = cmtx_url_decode("http" . ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? "s" : "") . "://" . strtolower($_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI']);

$query = parse_url($url, PHP_URL_QUERY);

if (
$type == "form" && !empty($query)) {
$query = "?" . $query;
} else if (
$type == "page" && !empty($query)) {
$query = "&" . $query;
} else if (
$type == "sort" && !empty($query)) {
$query = "&" . $query;
} else {
$query = "";
}

$query = preg_replace("/&cmtx_page=[0-9]*/", "", $query);
$query = preg_replace("/cmtx_page=[0-9]*&/", "", $query);
$query = preg_replace("/cmtx_page=[0-9]*/", "", $query);

$query = preg_replace("/&cmtx_perm=[0-9]*/", "", $query);
$query = preg_replace("/cmtx_perm=[0-9]*&/", "", $query);
$query = preg_replace("/cmtx_perm=[0-9]*/", "", $query);

if (
$type != "page") {
$query = preg_replace("/&cmtx_sort=[0-9]*/", "", $query);
$query = preg_replace("/cmtx_sort=[0-9]*&/", "", $query);
$query = preg_replace("/cmtx_sort=[0-9]*/", "", $query);
}

$query = rtrim($query, "?");

return
$query;

}
//end of get-query function

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
08-May-2016, 11:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)