• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Auto Update your statics daily

Status
Not open for further replies.
Skilled Illusionist
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
PHP:
include(ROOT_PATH . 'includes/functions/UpdateStatics.'.PHPEXT);
If you use Xnova 0.X add this line
PHP:
include($xnova_root_path . 'includes/functions/UpdateStatics.'.$phpEx);

4. Open Common.php in the root direction

5. Before
PHP:
SetSelectedPlanet($user);
Add
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

You must be registered for see attachments list
Last edited by a moderator:
Status
Not open for further replies.
Back
Top