Jump to content
MakeWebGames

Daily Rewards


peterisgb

Recommended Posts

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.

Opera Snapshot_2020-08-08_224307_www.androidian.ga.png

Edited by peterisgb
Updated from 1.4.7 to 1.4.8
  • Like 6
Link to comment
Share on other sites

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 😉

  • Like 3
Link to comment
Share on other sites

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 by peterisgb
Link to comment
Share on other sites

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 by SwiftGameR
  • Like 2
Link to comment
Share on other sites

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 by peterisgb
  • Like 1
Link to comment
Share on other sites

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. 🙂

  • Like 1
Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

  • 2 years later...
  • 1 month later...
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 🙂

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...