The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Point me in the right direction...
Here's what I have.
A member receives 100 points for every day they're registered. A member receives 1 point for every post they make. Days registered + total posts = Total Points. I want to write something that will give a member MONEY if they have a certain number of Total Points. So if they have between 1000 and 1200 Total Points, they receive $200 dollars. Now I was able to do this and have it written but this is where I get into a problem and I can't figure out how to go about solving it. A member would receive that $200 dollars ONLY if they're ONLINE and while they were online, reached 1000 Total Points. Since a member receives 100 points every day they're registered, if they're not ONLINE on the day they have 1000 Total Points, they don't get that $200. How can I make it check to see if a member has the required Total Points and give them the associated MONEY if they're not online? It works great when they're online. Use the DB function and write it to the database. If they're not online, it obviously cannot know who and when to update in the database. I was using the code I wrote in functions.php and then I realized members who are not logged in when they reach a certain # of Total Points will not be able to receive their MONEY. They must be logged in. How can I get around this? I'd like to write a routine that goes through the entire user database and checks their Total Points and if it falls between amount 1 and amount 2, give them x amount of money BUT ONLY ONCE say, at midnight of every day. Possible? If so, what direction do I need to go to make it happen. Syl... |
#2
|
||||
|
||||
Could you show us the code?
|
#3
|
||||
|
||||
Quote:
However, if you have access to your server's cron jobs, you can create a new PHP with the relevant code and queries and make your cron job run that PHP file once each day to update users. That would be the best way to do it. |
#4
|
|||
|
|||
Cron what?!
I'm getting over my head on this aren't I? I'm not familiar with the terminology but I guess what you're saying is that it would be impossible to write this into an existing VB php file? Is a cron job like a system event or something? Anyhow, here's the code if anyone wants to pick it apart or use some of it. As I mention in the code and in my posts, it's pretty useless when a member gains enough Total Points to get money but are not online that day when it happens. As you can see with this: Code:
You may not view this code unless Sylvus provided you with the password to unlock it. |
#5
|
||||
|
||||
A cron job is a scheduled task
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|