hashover-next icon indicating copy to clipboard operation
hashover-next copied to clipboard

Like and Dislike No displayed ?

Open Hscpro opened this issue 7 years ago • 4 comments

Like and Dislike No displayed ?

The configuration file is opened as follows

	public $allowsLikes		= true;				// Whether a "Like" link is displayed
	public $allowsDislikes		= true;			// Whether a "Dislike" link is displayed; allowing 
	public $setsCookies		= true;				// Whether cookies are enabled

But doesn't it show what's wrong with it ? 20170530120036

Once the comment is deleted, it will not be restored

Login administrator account can not be restored, or marked to delete?

Hscpro avatar May 30 '17 04:05 Hscpro

public $countIncludesDeleted = false; What's the function of this? I haven't found any changes or functions on the page

Hscpro avatar May 30 '17 05:05 Hscpro

@jacobwb

Hscpro avatar May 30 '17 06:05 Hscpro

The cause of this error is 'spl_autoload_register' in like.php fetching the wrong path. When 'spl_autoload_register' gets the classes it also gets the namespace. So from the current directory, it then adds `hashover\statistics.php for example, which is wrong because the classes are inside the scripts folder

To fix the issue and get the like/dislike working go to like.php and swap the current spl_autoload_register with the below code:

spl_autoload_register(function ($class) {
	$get_class = explode('\\', $class);
	$class_name = array_pop($get_class);
	$file_name = __DIR__ . "\\" . strtolower($class_name) . '.php';  // some systems may need to use forward slashes instead

	if(!file_exists($file_name)) {
        echo json_encode (array (
			'error' => $file_name . ' file could not be included!'
		));
		exit;
    }
    include $file_name;
});

leem32 avatar Oct 20 '17 10:10 leem32

Hello, sorry for the long delay.

  1. The like and dislike buttons are only displayed to other users, if you are logged in you will not see the like/dislike buttons for your own comments. The like and dislike buttons are also not displayed when HashOver is used from a remote website. Are either of these what is happening?

  2. I don't know what you mean by this...

  3. The public $countIncludesDeleted property does what it says, it includes the number of deleted comments in the comment counts. For example, if there are 15 comments, but 5 are deleted, by default the comment count will be 10, with this property set to true the comment count will be 15.

I hope this helps.

jacobwb avatar Feb 26 '18 16:02 jacobwb