By Niklas Elmgren on Monday, 20 January 2014
Posted in Technical Issues
Replies 14
Likes 0
Views 689
Votes 0
When guests click the Like button, it text changes to Unlike, like if their click actually was registered.

The expected behavior would be some notice like "You need to log in to like".

I've tried to identify the script handling this and found /media/com_easydiscuss/scripts/likes.js but I does'nt seem to make any difference. Can you tell me which script handles this, I would like to use some easydiscuss built-in function for displaying the notice as well.

Thanks
Hello Niklas Elmgren,

Sorry for late reply to this,
That's strange, i have tried to click that LIKE button, but it work only first time, when i click second time then it no response.
Or you also facing same happen with me? or when you first click already no response right? Hmm are you interesting to update your Easydiscuss to latest version? Because i checked you current version is using 3.1xxx. Please advise.
·
Monday, 20 January 2014 22:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

I rather don't update too often because we've made a lot of hacks

I looked at your demo site right now which I assume is running the latest version. Try this url http://demo.stackideas.com/easydiscuss/getting-a-new-car-for-daughter

The button says Like
I click it, it says Unlike
I click it, it says Like
I click it, it says Unlike
And so on.. And no likes are actually registered.

I tried this in Opera 12.16 and Firefox 26.0, same behavior.

Thanks
·
Tuesday, 21 January 2014 19:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Niklas Elmgren,

Sorry for late reply to this,
I'm guess it too you're made a lot of customization
I have checked our demo, it seems like no appear the LIKE button when the guest user access with the discussion post. -> http://screencast.com/t/HudboxzZPcd Please advise.
·
Wednesday, 22 January 2014 11:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

I don't see any Like button neither on that page right now. But yesterday! Right now I can see the like button for example on the first post on http://demo.stackideas.com/easydiscuss/is-sectionex-3-0-ready

My guess is that for me to see the LIKE button as a guest. It has to be that someone has already liked the post. Should make sense, so find a post that has gotten a LIKE by some registered user and try click that.

Thanks
·
Wednesday, 22 January 2014 17:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Niklas,

I'm really sorry that delayed of this reply,
Thanks for reporting on this, unfortunately we do not have this feature in current system, we will consider to add in the future version.
·
Saturday, 25 January 2014 08:50
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Arlex

This is not a feature suggestion, it's a bug!

I you don't plan on fixing this right away, could you point us in the right direction to solve it?

Thanks
·
Tuesday, 28 January 2014 23:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello? Is there anybody out there?
·
Thursday, 06 February 2014 19:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Niklas,

I'm really sorry that delayed of this reply,
The LIKE button don't support this behavior in currently
But you can referring on this 2 file :
JoomlaFolder\components\com_easydiscuss\themes\YourTheme\post.likes.php
JoomlaFolder\media\com_easydiscuss\scripts\likes.js
·
Thursday, 06 February 2014 23:33
·
0 Likes
·
0 Votes
·
0 Comments
·
So this is a part of likes.js:
likeItem: function()
{

if (!self.options.registeredUser)
{
return false;
}

EasyDiscuss.ajax('site.views.likes.like' ,
{
'postid' : self.options.postId
})
.done(function(result )
{
self.likeText().html(result);
});
},

'{likeButton} click' : function(element )
{
// If user is not logged in, do not allow them to click this.
var btnLike = self.likeButton();

btnLike.addClass('btnUnlike');
btnLike.attr('data-original-title', $.language('COM_EASYDISCUSS_UNLIKE_THIS_POST'));
btnLike.find('i')
.removeClass('icon-ed-love')
.addClass('icon-ed-remove');
self.likeStatus().html($.language('COM_EASYDISCUSS_UNLIKE'));
btnLike.removeClass('btnLike');
self.likeItem(element);
},


The comment in the click function says that it should do something which it doesn't and instead is done later on, when the button already been changed to Unlike.

So I modified it to this, which does the trick:

likeItem: function()
{

EasyDiscuss.ajax('site.views.likes.like' ,
{
'postid' : self.options.postId
})
.done(function(result )
{
self.likeText().html(result);
});
},

'{likeButton} click' : function(element )
{
// If user is not logged in, do not allow them to click this.
if (!self.options.registeredUser)
{
return false;
}

var btnLike = self.likeButton();

btnLike.addClass('btnUnlike');
btnLike.attr('data-original-title', $.language('COM_EASYDISCUSS_UNLIKE_THIS_POST'));
btnLike.find('i')
.removeClass('icon-ed-love')
.addClass('icon-ed-remove');
self.likeStatus().html($.language('COM_EASYDISCUSS_UNLIKE'));
btnLike.removeClass('btnLike');
self.likeItem(element);
},


But I would like to display a message saying something like "You have to be logged in to be able to like.". What message functions are available from the EasyDiscuss js library? I need something fancier than window.alert().

Thanks
·
Tuesday, 11 February 2014 18:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Niklas Elmgren,

Sorry for late reply to this,
The language string is located from here -> JoomlaFolder\language\en-GB\en-GB.com_easydiscuss.ini
Hope this help.
·
Wednesday, 12 February 2014 16:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

Sorry but that is not what I need.
I want to display a message, not to change a message which already displayed. Please re-read my question with that in mind.

Thanks
·
Wednesday, 12 February 2014 18:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Niklas Elmgren,

I'm sorry for delayed of this reply and misunderstand of your previous reply,
For the Easydiscuss available function example :

EasyDiscuss.dialog({
content: 'Hello'
});

Hope this help.
·
Thursday, 13 February 2014 15:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Arlex,

That function doesn't seem available. After a half hour searching I found it available as disjax.dialog (initialized in discuss.js).

disjax.dialog({
title: "Login required"
, content: 'You have to be logged in to be able to like.<br><br><a href="#">Login</a> or <a href="#">sign up</a>'
});
·
Monday, 17 February 2014 18:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Niklas Elmgren,

Sorry for late reply to this,
Is it the message work success on your site right now when the guest user click on the LIKE button?
·
Tuesday, 18 February 2014 10:59
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post