Archive > AO 0.6 support

Server merge!

<< < (6/6)

Dontask:
Here is a little function for restoring !logons since character IDs were reset on merge. This is only relevant if you backed up your old whois table. I named mine whois_old so you will need to change that if needed.

Either make a new module out of this or add it to some existing module temporarily.


--- Code: ---function updatelogons(){
$idupdates = 0;
$oldid = $this -> bot -> db -> select("SELECT id FROM #___logon");
foreach ($oldid as $id){
$name = $this -> bot -> db -> select("SELECT nickname FROM #___whois_old WHERE ID = '$id[0]'");
$newid = $this -> bot -> db -> select("SELECT ID FROM #___whois WHERE nickname = '" . $name[0][0] . "'");
if(!(empty($newid))){
$this -> bot -> db -> query("UPDATE #___logon SET id = '" . $newid[0][0] . "' WHERE id = '$id[0]'");
$idupdates++;
}
}
return "Selected " . count($oldid) . " IDs. Updated " . $idupdates . ".";
}

--- End code ---

If someone feels like adding to this by looking information up from AUNO or some other source be my guest.

Navigation

[0] Message Index

[*] Previous page

Go to full version