- Joined
- Oct 28, 2008
- Messages
- 379
- Reaction score
- 47
Hi,
I've seen people asking, why dont my statics update???
That's because you need to do it manualy. Why manualy?
Because if you have a lot of players it will take alot of ram.
Now if you want to update daily you could use a cronjob on your host. But for the people who don't know a thing about that here is my little script.
1. Download the attachement and put it in the ./includes/functions/ folder
2. Open 'todofleetcontrol.php' in the ./includes/ folder
3. At the bottom add this line
If you use Xnova 0.X add this line
4. Open Common.php in the root direction
5. Before
Add
You're done. Every time the script updates you'll get a message that the daily update went succesfull.
Greetz Aropop
I've seen people asking, why dont my statics update???
That's because you need to do it manualy. Why manualy?
Because if you have a lot of players it will take alot of ram.
Now if you want to update daily you could use a cronjob on your host. But for the people who don't know a thing about that here is my little script.
1. Download the attachement and put it in the ./includes/functions/ folder
2. Open 'todofleetcontrol.php' in the ./includes/ folder
3. At the bottom add this line
PHP:
include(ROOT_PATH . 'includes/functions/UpdateStatics.'.PHPEXT);
PHP:
include($xnova_root_path . 'includes/functions/UpdateStatics.'.$phpEx);
4. Open Common.php in the root direction
5. Before
PHP:
SetSelectedPlanet($user);
PHP:
//lines for auto update statics
$time = time();
$tomorrow = time() + 86400; //Change this number if you want to be at other time. The time is in seconds so 86400 is 1 day
$laststup = doquery("SELECT * FROM {{table}} WHERE `stat_date` > '$tomorrow'",'statpoints');
if(mysql_num_rows($laststup) != 0){
updateStatics();
}
unset($laststup);
unset($time);
unset($tomorrow);
You're done. Every time the script updates you'll get a message that the daily update went succesfull.
Greetz Aropop
Attachments
Last edited by a moderator: