peterisgb Posted August 9, 2020 Share Posted August 9, 2020 (edited) I decided to make a Daily Rewards System. It has a built in staff panel. Sql's for the Rewards You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Sql's for the User You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And finally the Page dailyrewards.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Add this to your Daily Cron. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I'm not the best or tidiest, but it works. Feedback welcome, NOT DIGS tho. A postback of this code if you make it better below would be great. Enjoy. Edited August 24, 2020 by peterisgb Updated from 1.4.7 to 1.4.8 6 Quote Link to comment Share on other sites More sharing options...
Sim Posted August 10, 2020 Share Posted August 10, 2020 This looks really good. You should post it on the marketplace so people don't have to copy and paste the code. Quote Link to comment Share on other sites More sharing options...
Dayo Posted August 11, 2020 Share Posted August 11, 2020 looks good, you could improve the code by changing the dayX() functions to day(X) like so You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I would also check using $_POST variables directly into queries it opens you up to SQL injection, from the quick glance i see its only on the ACP but its better to be safe then sorry 😉 3 Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 11, 2020 Author Share Posted August 11, 2020 (edited) 7 hours ago, Dayo said: looks good, you could improve the code by changing the dayX() functions to day(X) like so You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I would also check using $_POST variables directly into queries it opens you up to SQL injection, from the quick glance i see its only on the ACP but its better to be safe then sorry 😉 One of the main reasons i did it the way i did was as once it hits 28 it need to go back down to 1 and i wasn't sure how to do that. I tried to give this a go but as the X has moved i don't know how i would change the switch case :S Edited August 11, 2020 by peterisgb Quote Link to comment Share on other sites More sharing options...
SwiftGameR Posted August 12, 2020 Share Posted August 12, 2020 (edited) Might want to get some security in them post variables. but looks good You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. You might also want to add a check to make sure your not adding the same reward twice unless you wish it to be that way Edited August 12, 2020 by SwiftGameR 2 Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 23, 2020 Author Share Posted August 23, 2020 (edited) On 8/12/2020 at 1:00 AM, SwiftGameR said: Might want to get some security in them post variables. but looks good You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. You might also want to add a check to make sure your not adding the same reward twice unless you wish it to be that way All Done, I've also updated the buttons and the edit reward with a dropdown to make it easier and included my version checker in the staff panel too. Edited August 23, 2020 by peterisgb 1 Quote Link to comment Share on other sites More sharing options...
SwiftGameR Posted August 24, 2020 Share Posted August 24, 2020 Nice its looking amazing i might use it but for my grpg game 😛 2 Quote Link to comment Share on other sites More sharing options...
Sim Posted August 24, 2020 Share Posted August 24, 2020 2 hours ago, SwiftGameR said: Nice its looking amazing i might use it but for my grpg game 😛 I'm thinking about making a knock off for GL. I love his cron. Simple way to give someone a daily login credit. My code is over 150lines to determine if person login already once a day, and credit them. Simple one liner to credit someone a login bonus. Amazing. 🙂 1 Quote Link to comment Share on other sites More sharing options...
SwiftGameR Posted August 24, 2020 Share Posted August 24, 2020 yea not hard to make it update the user if hes online just need to create a variable to store time then do check if there online time greater than there current timestamp or you could use UNIX_TIMESTAMP() https://www.w3resource.com/mysql/date-and-time-functions/mysql-unix_timestamp-function.php Quote Link to comment Share on other sites More sharing options...
Sim Posted August 25, 2020 Share Posted August 25, 2020 1 hour ago, SwiftGameR said: yea not hard to make it update the user if hes online just need to create a variable to store time then do check if there online time greater than there current timestamp or you could use UNIX_TIMESTAMP() https://www.w3resource.com/mysql/date-and-time-functions/mysql-unix_timestamp-function.php Who are you speaking to? Quote Link to comment Share on other sites More sharing options...
SwiftGameR Posted August 31, 2020 Share Posted August 31, 2020 On 8/25/2020 at 2:02 AM, Sim said: Who are you speaking to? I was talking to you buddy 🙂 1 Quote Link to comment Share on other sites More sharing options...
Sim Posted August 31, 2020 Share Posted August 31, 2020 17 minutes ago, SwiftGameR said: I was talking to you buddy 🙂 I don't know how I should feel being told that. Maybe you don't know I code? LoL.. and been doing it for almost 20 years. What I meant was, giving everyone a daily token from the very beginning instead of checking if doesn't have one, give one, ECT. Like I did But then again he did create the same function 30x 😃 I was complimenting good theory on daily rewards on how he used that to check and reward. I know how to use a timestamp and check. Quote Link to comment Share on other sites More sharing options...
Zerex Posted August 18, 2023 Share Posted August 18, 2023 Awesome work! Having an incentive for a player to logon is everything, even if it is only for something as simple as a "daily". 1 Quote Link to comment Share on other sites More sharing options...
SwiftGameR Posted October 12, 2023 Share Posted October 12, 2023 On 8/31/2020 at 3:37 AM, Sim said: I don't know how I should feel being told that. Maybe you don't know I code? LoL.. and been doing it for almost 20 years. What I meant was, giving everyone a daily token from the very beginning instead of checking if doesn't have one, give one, ECT. Like I did But then again he did create the same function 30x 😃 I was complimenting good theory on daily rewards on how he used that to check and reward. I know how to use a timestamp and check. I know you code @Sim 😛 I remember you're and old member on these forums when I was a noob 🙂 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.