I have a simple problem. I need a php/mysql page done.
What we are working on: A file called send_messages.php that checks “prights” for that user and checks to see if they have rights to send messages. If they do it checks to see how many messages they have sent per month / per day. Problem is that my default member rights are not added to a table called “prights”. I need a workaround.
Here is my problem. I have a table called “prights” that has all the user rights. I had a programmer do a script that looks in the table for a specific rights. Problem happened that default rights are not added to the prights table, only if I modify the rights. So when my script looks at prights, the user does not have the right that they need (even though it is default).
My thinking is adding it to my send_message.php file since that is where the script looks at those values. You can either change the script to do a default value of 4 (messages per day and messages per month). But if i change the value to 10 for that user, it would have to see 10 messages max. Problem with doing a default of 4, people that are not registered should not be allowed to send a message.
If you choose we could do a cron file that changes the table. How we do it is up to you, the programmer. All I know is I need it done. Not a hard project, but I tried explaining everything here.
I have added send_message.php to the download file on this project for you to take a look.
Let me try to explain it.
Table “members” has member ID – Each user
Table prights has “PID” which equals “ID”
Under “prights” table
ID = PID
If RID = “53″ exists do nothing
If RID = 53 does exist, adds following lines (example PID=100). PID is the constant. RID 3 & 4 are also constants.
PID=100
RID=53 (53 = per day)
Value=4 (Able to send 4 messages per day
PID=100
RID=54 (54 = messages per month)
VALUE=4 (Able to send 4 messages per month)
Other problem might be that the script looks at the table right off the bat and if they don’t have the correct rights, it tells them they don’t. So you will have to make a modification to the script that changes it before it tells them that they have sent too many messages.
Bonus: If you add to the page where it tells them how many messages they have sent in last 30 days and how many they have left, I will add a bonus.