[xoops-cvslog 6342] CVS update: xoops2jp/html/modules/legacy/admin/class

Back to archive index

Minahito minah****@users*****
2007年 4月 25日 (水) 17:38:34 JST


Index: xoops2jp/html/modules/legacy/admin/class/Updater.class.php
diff -u /dev/null xoops2jp/html/modules/legacy/admin/class/Updater.class.php:1.1.2.1
--- /dev/null	Wed Apr 25 17:38:34 2007
+++ xoops2jp/html/modules/legacy/admin/class/Updater.class.php	Wed Apr 25 17:38:33 2007
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @package Legacy
+ * @version $Id: Updater.class.php,v 1.1.2.1 2007/04/25 08:38:33 minahito Exp $
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+class Legacy_Updater extends Legacy_ModulePhasedUpgrader
+{
+	function executeUpgrade()
+	{
+		if ($this->_mCurrentVersion <= 211)
+			$this->doFixUserRankBugs();
+		
+		parent::executeUpgrade();
+	}
+	
+	function doFixUserRankBugs()
+	{
+		$root =& XCube_Root::getSingleton();
+		$db =& $root->mController->getDB();
+		
+		$result = $db->query("SELECT uid, posts FROM " . $db->prefix('users') . " WHERE rank=0");
+		while ($row = $db->fetchArray($result)) {
+			$rank = xoops_getrank(0, $row['posts']);
+			$db->query("UPDATE " . $db->prefix('users') . " SET rank=" . $rank['id'] . " WHERE uid=" . $row['uid']);
+			$this->mLog->addReport("Fix bug #10324(sf.jp) to uid " . $row['uid'] . ".");
+		}
+	}
+}
+
+?>
\ No newline at end of file


xoops-cvslog メーリングリストの案内
Back to archive index