-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoninstall.php
More file actions
31 lines (26 loc) · 873 Bytes
/
oninstall.php
File metadata and controls
31 lines (26 loc) · 873 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
<?php
# trackback -> refpage upgrade
# $Id: oninstall.php,v 1.1 2009/10/31 10:05:53 nobu Exp $
global $xoopsDB;
# rename trackback* -> refpage*
define('OLDTBL', $xoopsDB->prefix("trackback"));
define('NEWTBL', $xoopsDB->prefix("refpage"));
if ($xoopsDB->query("SELECT * FROM ".OLDTBL."_ref LIMIT 1")) {
report_message(" Add new table: <b>$table</b>");
foreach (array('', '_ref', '_log') as $pfix) {
report_message("Replace: trackback$pfix -> refpage$pfix");
$xoopsDB->query('DROP TABLE `'.NEWTBL.$pfix.'`');
$xoopsDB->query('RENAME TABLE `'.OLDTBL.$pfix.'` TO `'.NEWTBL.$pfix.'`');
}
}
function report_message($msg) {
global $msgs; // module manager's variable
static $first = true;
if ($first) {
$msgs[] = "Update Database...";
$first = false;
}
$msgs[] = " $msg";
}
$handler =& xoops_gethandler('groupperm');
?>