|
From: Paul S. O. <ps...@us...> - 2002-02-12 13:51:12
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv6906
Modified Files:
update_to_RC3.php
Log Message:
Added most users + moderator user_level updates
Index: update_to_RC3.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/update_to_RC3.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** update_to_RC3.php 12 Feb 2002 02:55:23 -0000 1.9
--- update_to_RC3.php 12 Feb 2002 13:51:09 -0000 1.10
***************
*** 197,200 ****
--- 197,202 ----
}
+ print "<br />Updating topic first post info<br />";
+
$sql = "SELECT MIN(post_id) AS first_post_id, topic_id
FROM " . POSTS_TABLE . "
***************
*** 224,227 ****
--- 226,260 ----
}
+ print "<br />Updating moderator user_level<br />";
+ $sql = "SELECT DISTINCT u.user_id
+ FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa
+ WHERE aa.auth_mod = 1
+ AND ug.group_id = aa.group_id
+ AND u.user_id = ug.user_id
+ AND u.user_level <> 1";
+ if ( !$db->sql_query($sql) )
+ {
+ die("Couldn't obtain moderator user ids");
+ }
+
+ if ( $row = $db->sql_fetchrow($result) )
+ {
+ do
+ {
+ $sql = "UPDATE " . USERS_TABLE . "
+ SET user_level = " . MOD . "
+ WHERE user_id = " . $row['user_id'];
+ if ( !$db->sql_query($sql) )
+ {
+ die("Couldn't update user level");
+ }
+ }
+ while ( $row = $db->sql_fetchrow($result) );
+
+ }
+
+
+ print "<br />Updating config settings<br />";
+
$sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value )
VALUES ('version', 'RC-3')";
***************
*** 231,235 ****
}
! echo "\n<br /><br />\n<b>COMPLETE! Please delete this file before continuing!</b><br />\n";
?>
--- 264,282 ----
}
! $sql = "INSERT INTO " . CONFIG_TABLE . "
! (config_name, config_value) VALUES ('record_online_users', '1')";
! if( !$db->sql_query($sql) )
! {
! die("Couldn't insert config key 'record_online_users'");
! }
!
! $sql = "INSERT INTO " . CONFIG_TABLE . "
! (config_name, config_value) VALUES ('record_online_date', '" . time() . "')";
! if( !$db->sql_query($sql) )
! {
! die("Couldn't insert config key 'record_online_date'");
! }
!
! echo "\n<br />\n<b>COMPLETE! Please delete this file before continuing!</b><br />\n";
?>
|