-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdateinfo-2.1.2.php
53 lines (50 loc) · 2.29 KB
/
updateinfo-2.1.2.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/* Files to delete */
defined('_NOAH') or die('Restricted access');
if( !class_exists("GlobalStat") ) die();
$nVersion = "2.1.2";
$_GS = new GlobalStat;
if( $_GS->instver<"2.1.2" )
{
if( class_exists("rss") )
{
getDbCount( $count, "SELECT COUNT(*) FROM @rss" );
if( !$count ) Rss::initialize();
}
// Cleanup the settings table:
$result = executeQueryForUpdate("SHOW COLUMNS FROM @settings", __FILE__, __LINE__);
$num = mysql_num_rows($result);
$rows = array();
for( $i=0, $count=0; $i<$num; $i++ )
{
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$rows[]=$row["Field"];
}
$newCols = array(
"showCreatedInLists"=>"ALTER TABLE @settings ADD `showCreatedInLists` INT NOT NULL DEFAULT '0'",
"showCreatedInDetails"=>"ALTER TABLE @settings ADD `showCreatedInDetails` INT NOT NULL DEFAULT '1'",
"showExpInLists"=>"ALTER TABLE @settings ADD `showExpInLists` INT NOT NULL DEFAULT '0'",
"showExpInDetails"=>"ALTER TABLE @settings ADD `showExpInDetails` INT NOT NULL DEFAULT '1'",
"dateFormat"=>"ALTER TABLE @settings ADD `dateFormat` VARCHAR( 100 ) NOT NULL DEFAULT 'Y-m-d'",
"enableFavorities"=>"ALTER TABLE @settings ADD `enableFavorities` INT NOT NULL DEFAULT '1'",
"enableRememberPassword"=>"ALTER TABLE @settings ADD `enableRememberPassword` INT NOT NULL DEFAULT '1'",
"enablePasswordReminder"=>"ALTER TABLE @settings ADD `enablePasswordReminder` INT NOT NULL DEFAULT '1'",
"updateCheckInterval"=>"ALTER TABLE @settings ADD `updateCheckInterval` INT NOT NULL DEFAULT '7'",
);
foreach( $newCols as $col=>$query )
{
if( !in_array( $col, $rows ) ) executeQueryForUpdate($query, __FILE__, __LINE__);
}
// Cleanup the globalstat table:
$result = executeQueryForUpdate("SHOW COLUMNS FROM @globalstat", __FILE__, __LINE__);
$num = mysql_num_rows($result);
$rows = array();
for( $i=0, $count=0; $i<$num; $i++ )
{
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$rows[]=$row["Field"];
}
if( !in_array( "lastUpdateCheck", $rows )) executeQueryForUpdate("ALTER TABLE @globalstat ADD `lastUpdateCheck` DATE NOT NULL AFTER `lastUpdate`", __FILE__, __LINE__);
updateGlobalstatAndFooter($nVersion);
}
?>