-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate.php
More file actions
35 lines (27 loc) · 973 Bytes
/
update.php
File metadata and controls
35 lines (27 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* update.php
* @package Mod Cdr
* @author Machine
* @co-author Capi
* @version 1.62
* @license https://opensource.org/licenses/gpl-license.php GNU Public License
* @description Fichier de mise à jour du mod Cdr
*/
if (!defined('IN_SPYOGAME')) die("Hacking attempt");
global $db, $table_prefix;
define("TABLE_MOD_CDR", $table_prefix."mod_cdr");
define("TABLE_CDR", $table_prefix."cdr");
$mod_folder = "cdr";
$mod_name = "Champs de ruines";
$query = "SELECT `version` FROM ".TABLE_MOD." WHERE action='cdr'";
$req = $db->sql_query($query);
$ver = $db->sql_fetch_row($req);
if (version_compare($ver[0], '1.9.0', '<')) {
$query = "ALTER TABLE " . TABLE_MOD_CDR . " ADD `retention` varchar(3) default '2' not null";
$req = $db->sql_query($query);
}
if (version_compare($ver[0], '2.0.0', '<')) {
$db->sql_query("ALTER TABLE " . TABLE_CDR . " ADD COLUMN IF NOT EXISTS `deuterium` INT(11) NOT NULL DEFAULT 0");
}
update_mod($mod_folder, $mod_name);