Promise Posted July 7, 2016 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 386 Reputation: 38 Joined: 04/28/13 Last Seen: March 22, 2024 Share 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. Link to comment Share on other sites More sharing options...
0 Secrets Posted July 7, 2016 Group: Developer Topic Count: 36 Topics Per Day: 0.01 Content Count: 588 Reputation: 437 Joined: 01/26/16 Last Seen: Wednesday at 03:00 PM Share 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 Link to comment Share on other sites More sharing options...
0 Promise Posted July 8, 2016 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 386 Reputation: 38 Joined: 04/28/13 Last Seen: March 22, 2024 Author Share 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 Link to comment Share on other sites More sharing options...
0 Secrets Posted July 8, 2016 Group: Developer Topic Count: 36 Topics Per Day: 0.01 Content Count: 588 Reputation: 437 Joined: 01/26/16 Last Seen: Wednesday at 03:00 PM Share 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. Link to comment Share on other sites More sharing options...
0 Promise Posted July 8, 2016 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 386 Reputation: 38 Joined: 04/28/13 Last Seen: March 22, 2024 Author Share Posted July 8, 2016 ic... okay, thank you so much! I'll learn about that. Link to comment Share on other sites More sharing options...
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.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts