コード例 #1
0
ファイル: index.php プロジェクト: koki-h/xoops_utf8
     $content = $dbm->report();
     if (!$result) {
         //$deleted = $dbm->deleteTables($tables);
         $content .= "<p>" . _INSTALL_L114 . "</p>\n";
         $b_back = array('start', _INSTALL_L103);
     } else {
         $content .= "<p>" . _INSTALL_L115 . "</p>\n";
         $b_next = array('siteInit', _INSTALL_L112);
     }
     include 'install_tpl.php';
     break;
 case 'updateTables':
     include_once "../mainfile.php";
     include_once './class/dbmanager.php';
     $db = new db_manager();
     $sql = 'SELECT * FROM ' . $db->prefix('groups');
     $result = $db->query($sql);
     $content = '<h5>' . _INSTALL_L157 . '</h5>';
     $content .= '<table align="center" cellspacing="0" border="1"><tr><td>' . _INSTALL_L158 . '</td><td>' . _INSTALL_L159 . '</td><td>' . _INSTALL_L160 . '</td><td>' . _INSTALL_L161 . '</td></tr>';
     while ($myrow = $db->fetchArray($result)) {
         if ($myrow['type'] == 'Admin') {
             $content .= '<tr><td>' . $myrow['name'] . '</td><td><input type="radio" name="g_webmasters" value="' . $myrow['groupid'] . '" /></td><td>&nbsp;</td><td>&nbsp;</td></tr>';
         } elseif ($myrow['type'] == 'User') {
             $content .= '<tr><td>' . $myrow['name'] . '</td><td>&nbsp;</td><td><input type="radio" name="g_users" value="' . $myrow['groupid'] . '" /></td><td>&nbsp;</td></tr>';
         } else {
             $content .= '<tr><td>' . $myrow['name'] . '</td><td>&nbsp;</td><td>&nbsp;</td><td><input type="radio" name="g_anonymous" value="' . $myrow['groupid'] . '" /></td></tr>';
         }
     }
     $content .= '</table>';
     $b_back = array();
     $b_next = array('updateTables_go', _INSTALL_L132);
コード例 #2
0
                        $msgs[] = '&nbsp;&nbsp;Config <b>' . $config['name'] . '</b> added to the database.' . $confop_msgs;
                    } else {
                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert config <b>' . $config['name'] . '</b> to the database.</span>';
                    }
                    unset($confobj);
                }
                unset($configs);
            }
            foreach ($msgs as $msg) {
                echo '<code>' . $msg . '</code><br />';
            }
        }
        // data for table 'block_module_link'
        include_once './class/dbmanager.php';
        $dbm = new db_manager();
        $sql = 'SELECT bid, side FROM ' . $dbm->prefix('newblocks');
        $result = $dbm->query($sql);
        while ($myrow = $dbm->fetchArray($result)) {
            if ($myrow['side'] == 0) {
                $dbm->insert("block_module_link", " VALUES (" . $myrow['bid'] . ", 0)");
            } else {
                $dbm->insert("block_module_link", " VALUES (" . $myrow['bid'] . ", -1)");
            }
        }
    }
    echo '<br />';
    flush();
    sleep(1);
}
$title = _INSTALL_L142;
$content = "<table width='80%' align='center'><tr><td align='left'>\n";
コード例 #3
0
//                        , '9' => 'skin_blockcenter_r.html');
//    foreach ($skinfiles as $key => $skinfile) {
//        if(preg_match('/\.css$/', $skinfile)) {
//            $type = 'css';
//        }else{
//            $type = 'skin';
//        }
//        $dbm->insert('tplfile', " VALUES ($key, 0, '', 'default', '$skinfile', '', $time, $time, '$type')");
//        $fp = fopen('./templates/default_skin/'.$skinfile, 'r');
//        $skinsource = fread($fp, filesize('./templates/default_skin/'.$skinfile));
//        fclose($fp);
//        $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES ($key, '".addslashes($skinsource)."')");
//        if(preg_match('/\.css$/',$skinfile)) {
//            $cm->write($skinfile, $skinsource);
//        }
//    }
$dbm->query("INSERT INTO " . $dbm->prefix('group_permission') . " (gperm_groupid, gperm_itemid) SELECT groupid, block_id FROM " . $dbm->prefix('groups_blocks_link'));
$dbm->query("UPDATE " . $dbm->prefix('group_permission') . " SET gperm_name = 'block_read'");
$dbm->query("INSERT INTO " . $dbm->prefix('group_permission') . " (gperm_groupid, gperm_itemid) SELECT groupid, mid FROM " . $dbm->prefix('groups_modules_link') . " WHERE type='A'");
$dbm->query("UPDATE " . $dbm->prefix('group_permission') . " SET gperm_name = 'module_admin' WHERE gperm_name = ''");
$dbm->query("INSERT INTO " . $dbm->prefix('group_permission') . " (gperm_groupid, gperm_itemid) SELECT groupid, mid FROM " . $dbm->prefix('groups_modules_link') . " WHERE type='R'");
$dbm->query("UPDATE " . $dbm->prefix('group_permission') . " SET gperm_name = 'module_read' WHERE gperm_name = ''");
$dbm->query("UPDATE " . $dbm->prefix('group_permission') . " SET gperm_modid = 1");
$dbm->query('DROP TABLE ' . $dbm->prefix('groups_blocks_link'));
$dbm->query('DROP TABLE ' . $dbm->prefix('groups_modules_link'));
// insert some more data
$result = $dbm->queryFromFile('./sql/' . XOOPS_DB_TYPE . '.data.sql');
$content = $dbm->report();
//$content .= $cm->report();
$b_next = array('updateModules', _INSTALL_L14);
include './install_tpl.php';
コード例 #4
0
    $mm = new mainfile_manager("../mainfile.php");
    $mm->setRewrite('XOOPS_GROUP_ADMIN', $g_webmasters);
    $mm->setRewrite('XOOPS_GROUP_USERS', $g_users);
    $mm->setRewrite('XOOPS_GROUP_ANONYMOUS', $g_anonymous);
    $ret = $mm->doRewrite();
    if (!$ret) {
        $content = _INSTALL_L60;
        include './install_tpl.php';
        exit;
    }
}
if (false != $error) {
    $b_back = array();
    $content = _INSTALL_L162;
    include './install_tpl.php';
    break;
}
include_once './class/dbmanager.php';
$dbm = new db_manager();
if (!$dbm->query("ALTER TABLE " . $dbm->prefix("newblocks") . " ADD dirname VARCHAR(50) NOT NULL, ADD func_file VARCHAR(50) NOT NULL, ADD show_func VARCHAR(50) NOT NULL, ADD edit_func VARCHAR(50) NOT NULL")) {
}
$result = $dbm->queryFromFile('./sql/upgrade/' . XOOPS_DB_TYPE . '.structure.sql');
$content = $dbm->report();
if (!$result) {
    $content .= "<p>" . _INSTALL_L135 . "</p>\n";
    $b_back = array();
} else {
    $content .= "<p>" . _INSTALL_L136 . "</p>\n";
    $b_next = array('updateConfig', _INSTALL_L14);
}
include './install_tpl.php';