Promise Posted July 7, 2016 Posted July 7, 2016 Hi guise, i have a question about a web system. Is there any chance to make a facebook share button that when u share the server facebook page, it adds a sql value? Like... I share the server page on my profile. Then if(#facebookshare == 2) end; else adds #facebookshare to the server DB OnPCLoginEvent: if(#facebookshare == 1) getitem .@reward, 1; set #facebookshare, 2; So the players will get a reward on facebook share, only one time per account.
0 Secrets Posted July 7, 2016 Posted July 7, 2016 You can do that with Facebook Javascript SDK. It provides a callback which you can use to call another web endpoint that increments the account variable. FB.ui( { method: 'share', href: 'your-ro.com', }, // callback function(response) { if (response && !response.error_message) { //endpoint call alert('Shared the link!'); } else { alert('Error!'); } } ); Read more : https://developers.facebook.com/docs/javascript/reference/FB.ui
0 Promise Posted July 8, 2016 Author Posted July 8, 2016 (edited) So.. should i add a query sql on if (response && !response.error_message) { // HERE? alert('Shared the link!'); } else { alert('Error!'); } Edited July 8, 2016 by Promise
0 Secrets Posted July 8, 2016 Posted July 8, 2016 No, this is a JavaScript code for you web page, and you should not interact with your database on front-end of your web app. You should raise a XMLHttpRequest call or jQuery.ajax() call if you are using jQuery to call a back-end code to update the database instead. If you don't understand what I'm talking about above, you should rather learn about coding a web app or hire someone to do it for you.
0 Promise Posted July 8, 2016 Author Posted July 8, 2016 ic... okay, thank you so much! I'll learn about that.
Question
Promise
Hi guise,
i have a question about a web system.
Is there any chance to make a facebook share button that when u share the server facebook page, it adds a sql value?
Like...
So the players will get a reward on facebook share, only one time per account.
4 answers to this question
Recommended Posts