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
Notifications for "Facebook Style Like/ Dislike System v1.0"; Created 23/10/2014
Topic Started: Oct 23 2014, 06:48 PM (4,535 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
 
Esper
Member Avatar

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.
Edited by Esper, Oct 24 2014, 06:18 PM.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Administrator
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?
Viral
ZetaBoard's Dynamo Developer
MEng Aeronautical Engineering @ Imperial College London


>> CULTURAL JETTISON <<
Offline Profile Quote Post Goto Top
 
Esper
Member Avatar

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:
 
<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>
Edited by Esper, Oct 28 2014, 06:39 AM.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Administrator
Hm, I can't see the code on your forum.
Viral
ZetaBoard's Dynamo Developer
MEng Aeronautical Engineering @ Imperial College London


>> CULTURAL JETTISON <<
Offline Profile Quote Post Goto Top
 
Kankuro
Member Avatar
ぱ ぺっと ますたあ
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.
Offline Profile Quote Post Goto Top
 
Ferby
Member Avatar
Support
Works for me, but the BBCode in the notification doesn't work. It cuts off after w11.zetaboards.com
Posted Image
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Administrator
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:
 
<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>
Viral
ZetaBoard's Dynamo Developer
MEng Aeronautical Engineering @ Imperial College London


>> CULTURAL JETTISON <<
Offline Profile Quote Post Goto Top
 
Kankuro
Member Avatar
ぱ ぺっと ますたあ
Viral
Dec 14 2014, 01:27 PM
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:
 
<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.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Administrator
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?
Viral
ZetaBoard's Dynamo Developer
MEng Aeronautical Engineering @ Imperial College London


>> CULTURAL JETTISON <<
Offline Profile Quote Post Goto Top
 
2 users reading this topic (2 Guests and 0 Anonymous)
Go to Next Page
« Previous Topic · Basic Modifications · Next Topic »
Add Reply
  • Pages:
  • 1

Theme by Symbiote & Foxx of Outline