Welcome Guest [Log In] [Register]
Welcome to the home of Viral's Modifications. We hope you enjoy your visit.

This forum is used for support and feedback purposes only. All modifications can also be found on the official site.

Username:   Password:
mQuote [-] mQuote [+]
Add Reply
  • Pages:
  • 1
  • 2
Notifications for "Facebook Style Like/ Dislike System v1.0"; Created 23/10/2014
Topic Started: Oct 23 2014, 06:48 PM (4,932 Views)
Viral
Member Avatar
Administrator
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:
 
<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>
Viral
ZetaBoard's Dynamo Developer
MEng Aeronautical Engineering @ Imperial College London


>> CULTURAL JETTISON <<
Offline Profile Quote Post Goto Top
 
Replies:
KyngzIndeyen
No Avatar

Nice code, but I'm afraid I can't get it working :( . I'm getting the problem that Ferby was having earlier.

The non-premium character limit is simply too small for the code to function correctly: even with one of the links removed, the notification text still cuts off just before the end.
Offline Profile Quote Post Goto Top
 
Desolation
Member Avatar

Viral
Oct 23 2014, 06:48 PM

Preview: Coming soon.

I was hoping to see this one. Does anyone have a screenshot?
Earn free Walmart gift cards ~ ♥
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Basic Modifications · Next Topic »
Add Reply
  • Pages:
  • 1
  • 2

Theme by Symbiote & Foxx of Outline