Moderators: Dynamo Support, Moderator

Notifications for "Facebook Style Like/ Dislike System v1.0"

Joined: August 3rd, 2008, 11:45 am

October 23rd, 2014, 6:48 pm #1

What this does: This is an add-on to -Wonder's "Facebook Style Like/Dislike System v1.0 [CB]". Basically, when someone "likes" or "dislikes" a post, the user who made the post will be sent a notification through ZetaBoards Dynamo. "likes" and "dislikes" will still work exactly the same, except a notification will now be sent as well.

Preview: Coming soon.

Prerequisites: You must be using ZetaBoards Dynamo for this to work. You must also be using -Wonder's "Facebook Style Like/Dislike System v1.0 [CB]"!

Notes: -Wonder has explicitly stated he does not want people to edit his code - therefore I coded this as an addon, without modifying his script file at all.

Where does it go: Admin CP >> Themes >> Board Template >> Anywhere below the ZetaBoard's Dynamo main code and the Facebook Style Like/ Dislike code.

Code:

Code: Select all

<script type="text/javascript">
//<![CDATA[
// Add notifications for "Facebook Style Like/Dislike System v1.0 by -Wonder", by Viral of http://viralsmods.com
// You must have the above code AND ZetaBoards Dynamo (dynamo.viralsmods.com) installed for this to function correctly
$("body").on("dynamo_loaded", function(e) {
	var tempLoadLikeData = window.loadLikeData;
	window.loadLikeData = function(e, h) {
		if((e == 1 || e == 2) && "notifications" in dynamo.server.modules) {
			var postData = h.split(".");
			var action = (e == 1 ? likeText : dislikeText)[3];
			var poster = parseInt($("tr#post-" + (+postData[1]) + " td.c_username a.member:first").attr("href").split("profile/")[1], 10);
			dynamo.module.server_call(2, {
				m : "notifications",
				p1 : "add",
				info : {
					zbid : poster,
					message : '[url=' + main_url + 'profile/' + dynamo.toolbox.get_zbid() + ']' + dynamo.toolbox.get_username() + '[/url] [url=' + main_url + 'single/?p=' + postData[1] + '&t=' + postData[0] + ']' + action + ' post[/url].'
				}
			});
		}
		return tempLoadLikeData.apply(tempLoadLikeData, [e, h]);
	};
});
//]]>
</script>
Quote
Like
Share

Joined: October 23rd, 2014, 9:24 pm

October 24th, 2014, 6:18 pm #2

Hey I tried this, for some odd reason it doesn't work. My code is underneth the original like/dislike code and I have dynamo installed.
Last edited by Esper on October 24th, 2014, 6:18 pm, edited 1 time in total.
Quote
Like
Share

Joined: August 3rd, 2008, 11:45 am

October 27th, 2014, 2:31 pm #3

Is the code placed underneath the Dynamo code? Could you give me a link to the forum you are using this on, and also the exact code which you are using?
Quote
Like
Share

Joined: October 23rd, 2014, 9:24 pm

October 28th, 2014, 6:38 am #4

Yeah, my code is placed under Dynamo and the original fb like/dislike code, link is http://atriumforum.com/ and the code is literally copy and pasted from your thing.

Code: Select all

<script type="text/javascript">
//<![CDATA[
// Add notifications for "Facebook Style Like/Dislike System v1.0 by -Wonder", by Viral of http://viralsmods.com
// You must have the above code AND ZetaBoards Dynamo (dynamo.viralsmods.com) installed for this to function correctly
$("body").on("dynamo_loaded", function(e) {
var tempLoadLikeData = window.loadLikeData;
window.loadLikeData = function(e, h) {
if((e == 1 || e == 2) && "notifications" in dynamo.server.modules) {
var postData = h.split(".");
var action = (e == 1 ? likeText : dislikeText)[3];
var poster = parseInt($("tr#post-" + (+postData[1]) + " td.c_username a.member:first").attr("href").split("profile/")[1], 10);
dynamo.module.server_call(2, {
m : "notifications",
p1 : "add",
info : {
zbid : poster,
message : '[url=' + main_url + 'profile/' + dynamo.toolbox.get_zbid() + ']' + dynamo.toolbox.get_username() + '[/url] [url=' + main_url + 'single/?p=' + postData[1] + '&t=' + postData[0] + ']' + action + ' post[/url].'
}
});
}
return tempLoadLikeData.apply(tempLoadLikeData, [e, h]);
};
});
//]]>
</script>
Last edited by Esper on October 28th, 2014, 6:39 am, edited 1 time in total.
Quote
Like
Share

Joined: August 3rd, 2008, 11:45 am

October 28th, 2014, 11:07 am #5

Hm, I can't see the code on your forum.
Quote
Like
Share

Joined: March 8th, 2014, 3:48 am

December 14th, 2014, 4:38 am #6

I can't get this to work either.
I've tried it below the board and in theme layout (The FB L/D code is in each theme's layout).

All it does is just the page to the top, it doesn't even give likes anymore.
Quote
Like
Share

Joined: January 29th, 2012, 3:44 pm

December 14th, 2014, 1:24 pm #7

Works for me, but the BBCode in the notification doesn't work. It cuts off after w11.zetaboards.com
Quote
Like
Share

Joined: August 3rd, 2008, 11:45 am

December 14th, 2014, 1:27 pm #8

The dynamic notifications have a character limit to prevent abuse and bandwidth problems, and this limit is increased for premium users. The following adjustment seems to have worked for everyone I know without Premium (it removes one of the links):

Code: Select all

<script type="text/javascript">
//<![CDATA[
// Add notifications for "Facebook Style Like/Dislike System v1.0 by -Wonder", by Viral of http://viralsmods.com
// You must have the above code AND ZetaBoards Dynamo (dynamo.viralsmods.com) installed for this to function correctly
$("body").on("dynamo_loaded", function(e) {
	var tempLoadLikeData = window.loadLikeData;
	window.loadLikeData = function(e, h) {
		if((e == 1 || e == 2) && "notifications" in dynamo.server.modules) {
			var postData = h.split(".");
			var action = (e == 1 ? likeText : dislikeText)[3];
			var poster = parseInt($("tr#post-" + (+postData[1]) + " td.c_username a.member:first").attr("href").split("profile/")[1], 10);
			dynamo.module.server_call(2, {
				m : "notifications",
				p1 : "add",
				info : {
					zbid : poster,
					message : dynamo.toolbox.get_username() + ' [url=' + main_url + 'single/?p=' + postData[1] + '&t=' + postData[0] + ']' + action + ' post[/url].'
				}
			});
		}
		return tempLoadLikeData.apply(tempLoadLikeData, [e, h]);
	};
});
//]]>
</script>
Quote
Like
Share

Joined: March 8th, 2014, 3:48 am

December 15th, 2014, 3:13 am #9

Viral wrote:The dynamic notifications have a character limit to prevent abuse and bandwidth problems, and this limit is increased for premium users. The following adjustment seems to have worked for everyone I know without Premium (it removes one of the links):

Code: Select all

<script type="text/javascript">
//<![CDATA[
// Add notifications for "Facebook Style Like/Dislike System v1.0 by -Wonder", by Viral of http://viralsmods.com
// You must have the above code AND ZetaBoards Dynamo (dynamo.viralsmods.com) installed for this to function correctly
$("body").on("dynamo_loaded", function(e) {
var tempLoadLikeData = window.loadLikeData;
window.loadLikeData = function(e, h) {
if((e == 1 || e == 2) && "notifications" in dynamo.server.modules) {
var postData = h.split(".");
var action = (e == 1 ? likeText : dislikeText)[3];
var poster = parseInt($("tr#post-" + (+postData[1]) + " td.c_username a.member:first").attr("href").split("profile/")[1], 10);
dynamo.module.server_call(2, {
m : "notifications",
p1 : "add",
info : {
zbid : poster,
message : dynamo.toolbox.get_username() + ' [url=' + main_url + 'single/?p=' + postData[1] + '&t=' + postData[0] + ']' + action + ' post[/url].'
}
});
}
return tempLoadLikeData.apply(tempLoadLikeData, [e, h]);
};
});
//]]>
</script>
Nope, still doesn't work. Does the exact thing as I explained above.

Breaks the code, no notification or like is given.
Quote
Like
Share

Joined: August 3rd, 2008, 11:45 am

December 16th, 2014, 4:39 pm #10

I'll take a look into it ASAP, could you give me admin assistant access to the board templates so I can try it out?
Quote
Like
Share