\n";
- $tables = array();
- $result = $dbm->queryFromFile('./sql/'.XOOPS_DB_TYPE.'.structure.sql');
- $content = $dbm->report();
- if(! $result ){
- //$deleted = $dbm->deleteTables($tables);
- $content .= " "._INSTALL_L114." \n";
- $b_back = array('start', _INSTALL_L103);
- }else{
- $content .= ""._INSTALL_L115." \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 = ''._INSTALL_L157.'';
- $content .= '';
- $b_back = array();
- $b_next = array('updateTables_go', _INSTALL_L132);
- include 'install_tpl.php';
- break;
-
-case 'updateTables_go':
- include_once "../mainfile.php";
- $error = false;
- $g_webmasters = isset($g_webmasters) ? intval($g_webmasters) : 0;
- $g_users = isset($g_users) ? intval($g_users) : 0;
- $g_anonymous = isset($g_anonymous) ? intval($g_anonymous) : 0;
- if (empty($g_webmasters) || empty($g_users) || empty($g_anonymous)) {
- $error = true;
- } else {
- include_once "./class/mainfilemanager.php";
- $title = _INSTALL_L88;
- $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 .= ""._INSTALL_L135." \n";
- $b_back = array();
- } else {
- $content .= ""._INSTALL_L136." \n";
- $b_next = array('updateConfig', _INSTALL_L14);
- }
- include 'install_tpl.php';
- break;
-
-case 'updateConfig':
- $b_next = array('updateConfig_go', _INSTALL_L144);
- $content = ""._INSTALL_L143." \n";
- include 'install_tpl.php';
- break;
-
-case 'updateConfig_go':
- include_once "../mainfile.php";
-
- $language = check_language($language);
- if ( file_exists("./language/".$language."/install2.php") ) {
- include_once "./language/".$language."/install2.php";
- } elseif ( file_exists("./language/english/install2.php") ) {
- include_once "./language/english/install2.php";
- $language = 'english';
- } else {
- echo 'no language file (install2.php).';
- exit();
- }
- include_once './class/dbmanager.php';
- $dbm = new db_manager;
-
- // default settings
- $xoopsConfig['sitename'] = 'XOOPS Site';
- $xoopsConfig['slogan'] = 'Just use it!';
- $xoopsConfig['adminmail'] = '';
- $xoopsConfig['language'] = 'english';
- $xoopsConfig['anonymous'] = 'Anonymous';
- $xoopsConfig['minpass'] = 5;
- $xoopsConfig['anonpost'] = 0;
- $xoopsConfig['new_user_notify'] = 0;
- $xoopsConfig['new_user_notify_group'] = 1;
- $xoopsConfig['self_delete'] = 0;
- $xoopsConfig['gzip_compression'] = 0;
- $xoopsConfig['uname_test_level'] = 0;
- $xoopsConfig['usercookie'] = "xoops_user";
- $xoopsConfig['sessioncookie'] = "xoops_session";
- $xoopsConfig['sessionexpire'] = 4500;
- $xoopsConfig['server_TZ'] = 0;
- $xoopsConfig['default_TZ'] = 0;
- $xoopsConfig['banners'] = 1;
- $xoopsConfig['com_mode'] = "nest";
- $xoopsConfig['com_order'] = 1;
- $xoopsConfig['my_ip'] = "127.0.0.1";
- $xoopsConfig['avatar_allow_upload'] = 0;
- $xoopsConfig['avatar_width'] = 120;
- $xoopsConfig['avatar_height'] = 120;
- $xoopsConfig['avatar_maxsize'] = 15000;
-
- // override deafault with 1.3.x settings if any
- if (file_exists('../modules/system/cache/config.php')) {
- include_once('../modules/system/cache/config.php');
- }
-
- $dbm->insert('config', " VALUES (1, 0, 1, 'sitename', '_MD_AM_SITENAME', '".addslashes($xoopsConfig['sitename'])."', '_MD_AM_SITENAMEDSC', 'textbox', 'text', 0)");
- $dbm->insert('config', " VALUES (2, 0, 1, 'slogan', '_MD_AM_SLOGAN', '".addslashes($xoopsConfig['slogan'])."', '_MD_AM_SLOGANDSC', 'textbox', 'text', 2)");
- $dbm->insert('config', " VALUES (3, 0, 1, 'language', '_MD_AM_LANGUAGE', '".$xoopsConfig['language']."', '_MD_AM_LANGUAGEDSC', 'language', 'other', 4)");
- $dbm->insert('config', " VALUES (4, 0, 1, 'startpage', '_MD_AM_STARTPAGE', '--', '_MD_AM_STARTPAGEDSC', 'startpage', 'other', 6)");
- $dbm->insert('config', " VALUES (5, 0, 1, 'server_TZ', '_MD_AM_SERVERTZ', '".addslashes($xoopsConfig['server_TZ'])."', '_MD_AM_SERVERTZDSC', 'timezone', 'float', 8)");
- $dbm->insert('config', " VALUES (6, 0, 1, 'default_TZ', '_MD_AM_DEFAULTTZ', '".addslashes($xoopsConfig['default_TZ'])."', '_MD_AM_DEFAULTTZDSC', 'timezone', 'float', 10)");
- $dbm->insert('config', " VALUES (7, 0, 1, 'theme_set', '_MD_AM_DTHEME', 'default', '_MD_AM_DTHEMEDSC', 'theme', 'other', 12)");
- $dbm->insert('config', " VALUES (8, 0, 1, 'anonymous', '_MD_AM_ANONNAME', '".addslashes($xoopsConfig['anonymous'])."', '_MD_AM_ANONNAMEDSC', 'textbox', 'text', 15)");
- $dbm->insert('config', " VALUES (9, 0, 1, 'gzip_compression', '_MD_AM_USEGZIP', '".intval($xoopsConfig['gzip_compression'])."', '_MD_AM_USEGZIPDSC', 'yesno', 'int', 16)");
- $dbm->insert('config', " VALUES (10, 0, 1, 'usercookie', '_MD_AM_USERCOOKIE', '".addslashes($xoopsConfig['usercookie'])."', '_MD_AM_USERCOOKIEDSC', 'textbox', 'text', 18)");
- $dbm->insert('config', " VALUES (11, 0, 1, 'session_expire', '_MD_AM_SESSEXPIRE', '15', '_MD_AM_SESSEXPIREDSC', 'textbox', 'int', 22)");
- $dbm->insert('config', " VALUES (12, 0, 1, 'banners', '_MD_AM_BANNERS', '".intval($xoopsConfig['banners'])."', '_MD_AM_BANNERSDSC', 'yesno', 'int', 26)");
- $dbm->insert('config', " VALUES (13, 0, 1, 'debug_mode', '_MD_AM_DEBUGMODE', '1', '_MD_AM_DEBUGMODEDSC', 'select', 'int', 24)");
- $dbm->insert('config', " VALUES (14, 0, 1, 'my_ip', '_MD_AM_MYIP', '".addslashes($xoopsConfig['my_ip'])."', '_MD_AM_MYIPDSC', 'textbox', 'text', 29)");
- $dbm->insert('config', " VALUES (15, 0, 1, 'use_ssl', '_MD_AM_USESSL', '0', '_MD_AM_USESSLDSC', 'yesno', 'int', 30)");
- $dbm->insert('config', " VALUES (16, 0, 1, 'session_name', '_MD_AM_SESSNAME', 'xoops_session', '_MD_AM_SESSNAMEDSC', 'textbox', 'text', 20)");
- $dbm->insert('config', " VALUES (17, 0, 2, 'minpass', '_MD_AM_MINPASS', '".intval($xoopsConfig['minpass'])."', '_MD_AM_MINPASSDSC', 'textbox', 'int', 1)");
- $dbm->insert('config', " VALUES (18, 0, 2, 'minuname', '_MD_AM_MINUNAME', '5', '_MD_AM_MINUNAMEDSC', 'textbox', 'int', 2)");
- $dbm->insert('config', " VALUES (19, 0, 2, 'new_user_notify', '_MD_AM_NEWUNOTIFY', '".intval($xoopsConfig['new_user_notify'])."', '_MD_AM_NEWUNOTIFYDSC', 'yesno', 'int', 4)");
- $dbm->insert('config', " VALUES (20, 0, 2, 'new_user_notify_group', '_MD_AM_NOTIFYTO', ".intval($xoopsConfig['new_user_notify_group']).", '_MD_AM_NOTIFYTODSC', 'group', 'int', 6)");
- $dbm->insert('config', " VALUES (21, 0, 2, 'activation_type', '_MD_AM_ACTVTYPE', '0', '_MD_AM_ACTVTYPEDSC', 'select', 'int', 8)");
- $dbm->insert('config', " VALUES (22, 0, 2, 'activation_group', '_MD_AM_ACTVGROUP', ".XOOPS_GROUP_ADMIN.", '_MD_AM_ACTVGROUPDSC', 'group', 'int', 10)");
- $dbm->insert('config', " VALUES (23, 0, 2, 'uname_test_level', '_MD_AM_UNAMELVL', '".intval($xoopsConfig['uname_test_level'])."', '_MD_AM_UNAMELVLDSC', 'select', 'int', 12)");
- $dbm->insert('config', " VALUES (24, 0, 2, 'avatar_allow_upload', '_MD_AM_AVATARALLOW', '".intval($xoopsConfig['avatar_allow_upload'])."', '_MD_AM_AVATARALWDSC', 'yesno', 'int', 14)");
- $dbm->insert('config', " VALUES (27, 0, 2, 'avatar_width', '_MD_AM_AVATARW', '".intval($xoopsConfig['avatar_width'])."', '_MD_AM_AVATARWDSC', 'textbox', 'int', 16)");
- $dbm->insert('config', " VALUES (28, 0, 2, 'avatar_height', '_MD_AM_AVATARH', '".intval($xoopsConfig['avatar_height'])."', '_MD_AM_AVATARHDSC', 'textbox', 'int', 18)");
- $dbm->insert('config', " VALUES (29, 0, 2, 'avatar_maxsize', '_MD_AM_AVATARMAX', '".intval($xoopsConfig['avatar_maxsize'])."', '_MD_AM_AVATARMAXDSC', 'textbox', 'int', 20)");
- $dbm->insert('config', " VALUES (30, 0, 1, 'adminmail', '_MD_AM_ADMINML', '".addslashes($xoopsConfig['adminmail'])."', '_MD_AM_ADMINMLDSC', 'textbox', 'text', 3)");
- $dbm->insert('config', " VALUES (31, 0, 2, 'self_delete', '_MD_AM_SELFDELETE', '".intval($xoopsConfig['self_delete'])."', '_MD_AM_SELFDELETEDSC', 'yesno', 'int', 22)");
- $dbm->insert('config', " VALUES (32, 0, 1, 'com_mode', '_MD_AM_COMMODE', '".addslashes($xoopsConfig['com_mode'])."', '_MD_AM_COMMODEDSC', 'select', 'text', 34)");
- $dbm->insert('config', " VALUES (33, 0, 1, 'com_order', '_MD_AM_COMORDER', '".intval($xoopsConfig['com_order'])."', '_MD_AM_COMORDERDSC', 'select', 'int', 36)");
- $dbm->insert('config', " VALUES (34, 0, 2, 'bad_unames', '_MD_AM_BADUNAMES', '".addslashes(serialize(array('webmaster', '^xoops', '^admin')))."', '_MD_AM_BADUNAMESDSC', 'textarea', 'array', 24)");
- $dbm->insert('config', " VALUES (35, 0, 2, 'bad_emails', '_MD_AM_BADEMAILS', '".addslashes(serialize(array('xoops.org$')))."', '_MD_AM_BADEMAILSDSC', 'textarea', 'array', 26)");
- $dbm->insert('config', " VALUES (36, 0, 2, 'maxuname', '_MD_AM_MAXUNAME', '10', '_MD_AM_MAXUNAMEDSC', 'textbox', 'int', 3)");
- $dbm->insert('config', " VALUES (37, 0, 1, 'bad_ips', '_MD_AM_BADIPS', '".addslashes(serialize(array('127.0.0.1')))."', '_MD_AM_BADIPSDSC', 'textarea', 'array', 42)");
- $dbm->insert('config', " VALUES (38, 0, 3, 'meta_keywords', '_MD_AM_METAKEY', 'news, technology, headlines, xoops, xoop, nuke, myphpnuke, myphp-nuke, phpnuke, SE, geek, geeks, hacker, hackers, linux, software, download, downloads, free, community, mp3, forum, forums, bulletin, board, boards, bbs, php, survey, poll, polls, kernel, comment, comments, portal, odp, open, source, opensource, FreeSoftware, gnu, gpl, license, Unix, *nix, mysql, sql, database, databases, web site, weblog, guru, module, modules, theme, themes, cms, content management', '_MD_AM_METAKEYDSC', 'textarea', 'text', 0)");
- $dbm->insert('config', " VALUES (39, 0, 3, 'footer', '_MD_AM_FOOTER', 'Powered by XOOPS 2.0 © 2001-2003 The XOOPS Project', '_MD_AM_FOOTERDSC', 'textarea', 'text', 20)");
- $dbm->insert('config', " VALUES (40, 0, 4, 'censor_enable', '_MD_AM_DOCENSOR', '0', '_MD_AM_DOCENSORDSC', 'yesno', 'int', 0)");
- $dbm->insert('config', " VALUES (41, 0, 4, 'censor_words', '_MD_AM_CENSORWRD', '".addslashes(serialize(array('fuck', 'shit')))."', '_MD_AM_CENSORWRDDSC', 'textarea', 'array', 1)");
- $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '#OOPS#', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)");
- $dbm->insert('config', " VALUES (43, 0, 3, 'meta_robots', '_MD_AM_METAROBOTS', 'index,follow', '_MD_AM_METAROBOTSDSC', 'select', 'text', 2)");
- $dbm->insert('config', " VALUES (44, 0, 5, 'enable_search', '_MD_AM_DOSEARCH', '1', '_MD_AM_DOSEARCHDSC', 'yesno', 'int', 0)");
- $dbm->insert('config', " VALUES (45, 0, 5, 'keyword_min', '_MD_AM_MINSEARCH', '5', '_MD_AM_MINSEARCHDSC', 'textbox', 'int', 1)");
- $dbm->insert('config', " VALUES (46, 0, 2, 'avatar_minposts', '_MD_AM_AVATARMP', '0', '_MD_AM_AVATARMPDSC', 'textbox', 'int', 15)");
- $dbm->insert('config', " VALUES (47, 0, 1, 'enable_badips', '_MD_AM_DOBADIPS', '0', '_MD_AM_DOBADIPSDSC', 'yesno', 'int', 40)");
- $dbm->insert('config', " VALUES (48, 0, 3, 'meta_rating', '_MD_AM_METARATING', 'general', '_MD_AM_METARATINGDSC', 'select', 'text', 4)");
- $dbm->insert('config', " VALUES (49, 0, 3, 'meta_author', '_MD_AM_METAAUTHOR', 'XOOPS', '_MD_AM_METAAUTHORDSC', 'textbox', 'text', 6)");
- $dbm->insert('config', " VALUES (50, 0, 3, 'meta_copyright', '_MD_AM_METACOPYR', 'Copyright © 2001-2003', '_MD_AM_METACOPYRDSC', 'textbox', 'text', 8)");
- $dbm->insert('config', " VALUES (51, 0, 3, 'meta_description', '_MD_AM_METADESC', 'XOOPS is a dynamic Object Oriented based open source portal script written in PHP.', '_MD_AM_METADESCDSC', 'textarea', 'text', 1)");
- $dbm->insert('config', " VALUES (52, 0, 2, 'allow_chgmail', '_MD_AM_ALLWCHGMAIL', '0', '_MD_AM_ALLWCHGMAILDSC', 'yesno', 'int', 3)");
- $dbm->insert('config', " VALUES (53, 0, 1, 'use_mysession', '_MD_AM_USEMYSESS', '0', '_MD_AM_USEMYSESSDSC', 'yesno', 'int', 19)");
- $dbm->insert('config', " VALUES (54, 0, 2, 'reg_dispdsclmr', '_MD_AM_DSPDSCLMR', 1, '_MD_AM_DSPDSCLMRDSC', 'yesno', 'int', 30)");
- $dbm->insert('config', " VALUES (55, 0, 2, 'reg_disclaimer', '_MD_AM_REGDSCLMR', '".addslashes(_INSTALL_DISCLMR)."', '_MD_AM_REGDSCLMRDSC', 'textarea', 'text', 32)");
- $dbm->insert('config', " VALUES (56, 0, 2, 'allow_register', '_MD_AM_ALLOWREG', 1, '_MD_AM_ALLOWREGDSC', 'yesno', 'int', 0)");
- $dbm->insert('config', " VALUES (57, 0, 1, 'theme_fromfile', '_MD_AM_THEMEFILE', '0', '_MD_AM_THEMEFILEDSC', 'yesno', 'int', 13)");
- $dbm->insert('config', " VALUES (58, 0, 1, 'closesite', '_MD_AM_CLOSESITE', '0', '_MD_AM_CLOSESITEDSC', 'yesno', 'int', 26)");
- $dbm->insert('config', " VALUES (59, 0, 1, 'closesite_okgrp', '_MD_AM_CLOSESITEOK', '".addslashes(serialize(array('1')))."', '_MD_AM_CLOSESITEOKDSC', 'group_multi', 'array', 27)");
- $dbm->insert('config', " VALUES (60, 0, 1, 'closesite_text', '_MD_AM_CLOSESITETXT', '"._INSTALL_L165."', '_MD_AM_CLOSESITETXTDSC', 'textarea', 'text', 28)");
- $dbm->insert('config', " VALUES (61, 0, 1, 'sslpost_name', '_MD_AM_SSLPOST', 'xoops_ssl', '_MD_AM_SSLPOSTDSC', 'textbox', 'text', 31)");
- $dbm->insert('config', " VALUES (62, 0, 1, 'module_cache', '_MD_AM_MODCACHE', '', '_MD_AM_MODCACHEDSC', 'module_cache', 'array', 50)");
- $dbm->insert('config', " VALUES (63, 0, 1, 'template_set', '_MD_AM_DTPLSET', 'default', '_MD_AM_DTPLSETDSC', 'tplset', 'other', 14)");
- $dbm->insert('config', " VALUES (64,0,6,'mailmethod','_MD_AM_MAILERMETHOD','mail','_MD_AM_MAILERMETHODDESC','select','text',4)");
- $dbm->insert('config', " VALUES (65,0,6,'smtphost','_MD_AM_SMTPHOST','a:1:{i:0;s:0:\"\";}', '_MD_AM_SMTPHOSTDESC','textarea','array',6)");
- $dbm->insert('config', " VALUES (66,0,6,'smtpuser','_MD_AM_SMTPUSER','','_MD_AM_SMTPUSERDESC','textbox','text',7)");
- $dbm->insert('config', " VALUES (67,0,6,'smtppass','_MD_AM_SMTPPASS','','_MD_AM_SMTPPASSDESC','password','text',8)");
- $dbm->insert('config', " VALUES (68,0,6,'sendmailpath','_MD_AM_SENDMAILPATH','/usr/sbin/sendmail','_MD_AM_SENDMAILPATHDESC','textbox','text',5)");
- $dbm->insert('config', " VALUES (69,0,6,'from','_MD_AM_MAILFROM','','_MD_AM_MAILFROMDESC','textbox','text',1)");
- $dbm->insert('config', " VALUES (70,0,6,'fromname','_MD_AM_MAILFROMNAME','','_MD_AM_MAILFROMNAMEDESC','textbox','text',2)");
- $dbm->insert('config', " VALUES (71, 0, 1, 'sslloginlink', '_MD_AM_SSLLINK', 'https://', '_MD_AM_SSLLINKDSC', 'textbox', 'text', 33)");
- $dbm->insert('config', " VALUES (72, 0, 1, 'theme_set_allowed', '_MD_AM_THEMEOK', '".serialize(array('default'))."', '_MD_AM_THEMEOKDSC', 'theme_multi', 'array', 13)");
- $dbm->insert('config', " VALUES (73,0,6,'fromuid','_MD_AM_MAILFROMUID','1','_MD_AM_MAILFROMUIDDESC','user','int',3)");
-
-
- // default the default theme
-
- $time = time();
- $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Default Theme', '', ".$time.")");
-
-// include_once './class/cachemanager.php';
-// $cm = new cache_manager;
-// $skinfiles = array('1' => 'skin.html', '2' => 'style.css'
-// , '3' => 'styleNN.css','4' => 'styleMAC.css'
-// , '5' => 'skin_blockleft.html', '6' => 'skin_blockright.html'
-// , '7' => 'skin_blockcenter_l.html', '8' => 'skin_blockcenter_c.html'
-// , '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';
- break;
-
-case 'updateModules':
- $b_next = array('updateModules_go', _INSTALL_L137);
- $content = ""._INSTALL_L141." \n";
- include 'install_tpl.php';
- break;
-
-case 'updateModules_go':
- unset($xoopsOption['nocommon']);
- include_once "../mainfile.php";
-?>
-
-
-
- XOOPS Custom Installation
-
-
-
-
-
-
-
-
-"._INSTALL_L149."\n";
- $b_next = array('updateComments_go', _INSTALL_L138);
- include 'install_tpl.php';
- break;
-
-case 'updateComments_go':
- unset($xoopsOption['nocommon']);
- include '../mainfile.php';
- include '../class/xoopscomments.php';
- include '../include/comment_constants.php';
- $module_handler =& xoops_gethandler('module');
- $old_commentd_mods = array('news' => 'comments', 'xoopspoll' => 'xoopspollcomments');
- $title = _INSTALL_L147;
- $content = '';
- foreach ($old_commentd_mods as $module => $com_table) {
- $moduleobj =& $module_handler->getByDirname($module);
- if (is_object($moduleobj)) {
- $content .= ''.$moduleobj->getVar('name').'';
- $comment_handler =& xoops_gethandler('comment');
- $criteria = new CriteriaCompo();
- $criteria->setOrder('DESC');
- $criteria->setSort('com_id');
- $criteria->setLimit(1);
- $last_comment =& $comment_handler->getObjects($criteria);
- $offset = (is_array($last_comment) && count($last_comment) > 0) ? $last_comment[0]->getVar('com_id') : 0;
- $xc = new XoopsComments($xoopsDB->prefix($com_table));
- $top_comments =& $xc->getAllComments(array('pid=0'));
-
- foreach ($top_comments as $tc) {
- $sql = sprintf("INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_ip, com_sig, com_itemid, com_rootid, com_status, dohtml, dosmiley, doxcode, doimage, dobr) VALUES (%u, %u, %u, '%s', '%s', '%s', %u, %u, %u, '%s', %u, %u, %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix('xoopscomments'), $tc->getVar('comment_id') + $offset, 0, $moduleobj->getVar('mid'), '', addslashes($tc->getVar('subject', 'n')), addslashes($tc->getVar('comment', 'n')), $tc->getVar('date'), $tc->getVar('date'), $tc->getVar('user_id'), $tc->getVar('ip'), 0, $tc->getVar('item_id'), $tc->getVar('comment_id') + $offset, XOOPS_COMMENT_ACTIVE, 0, 1, 1, 1, 1);
-
- if (!$xoopsDB->query($sql)) {
- $content .= _NGIMG.sprintf(_INSTALL_L146, $tc->getVar('comment_id') + $offset).' ';
- } else {
- $content .= _OKIMG.sprintf(_INSTALL_L145, $tc->getVar('comment_id') + $offset).' ';
- $child_comments = $tc->getCommentTree();
- foreach ($child_comments as $cc) {
- $sql = sprintf("INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_ip, com_sig, com_itemid, com_rootid, com_status, dohtml, dosmiley, doxcode, doimage, dobr) VALUES (%u, %u, %u, '%s', '%s', '%s', %u, %u, %u, '%s', %u, %u, %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix('xoopscomments'), $cc->getVar('comment_id') + $offset, $cc->getVar('pid') + $offset, $moduleobj->getVar('mid'), '', addslashes($cc->getVar('subject', 'n')), addslashes($cc->getVar('comment', 'n')), $cc->getVar('date'), $cc->getVar('date'), $cc->getVar('user_id'), $cc->getVar('ip'), 0, $cc->getVar('item_id'), $tc->getVar('comment_id') + $offset, XOOPS_COMMENT_ACTIVE, 0, 1, 1, 1, 1);
- if (!$xoopsDB->query($sql)) {
- $content .= _NGIMG.sprintf(_INSTALL_L146, $cc->getVar('comment_id') + $offset).' ';
- } else {
- $content .= _OKIMG.sprintf(_INSTALL_L145, $cc->getVar('comment_id') + $offset).' ';
- }
- }
- }
- }
- }
- }
- $xoopsDB->query('ALTER TABLE '.$xoopsDB->prefix('xoopscomments').' CHANGE com_id com_id mediumint(8) unsigned NOT NULL auto_increment PRIMARY KEY');
- $b_next = array('updateSmilies', _INSTALL_L14);
- include 'install_tpl.php';
- break;
-
-case 'updateSmilies':
- $content = ''._INSTALL_L150.' ';
- $b_next = array('updateSmilies_go', _INSTALL_L140);
- include 'install_tpl.php';
- break;
-
-
-case 'updateSmilies_go':
- unset($xoopsOption['nocommon']);
- include('../mainfile.php');
- $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix('smiles'));
- $content = '';
- $title = _INSTALL_L155;
- if (!defined('XOOPS_UPLOAD_PATH')) {
- define('XOOPS_UPLOAD_PATH', '../uploads');
- }
- while ($smiley = $xoopsDB->fetchArray($result)) {
- if (file_exists('../images/smilies/'.$smiley['smile_url']) && false != $fp = fopen('../images/smilies/'.$smiley['smile_url'], 'rb')) {
- $binary = fread($fp, filesize('../images/smilies/'.$smiley['smile_url']));
- fclose($fp);
- if (!preg_match("/\.([a-zA-Z0-9]+)$/", $smiley['smile_url'], $matched)) {
- continue;
- }
- $newsmiley = uniqid('smil').'.'.strtolower($matched[1]);
- if (false != $fp = fopen(XOOPS_UPLOAD_PATH.'/'.$newsmiley, 'wb')) {
- if (-1 != fwrite($fp, $binary)) {
- $xoopsDB->query("UPDATE ".$xoopsDB->prefix('smiles')." SET smile_url='".$newsmiley."' WHERE id=".$smiley['id']);
- $content .= _OKIMG.sprintf(_INSTALL_L154, $smiley['smile_url']).' ';
- } else {
- $content .= _NGIMG.sprintf(_INSTALL_L153, $smiley['smile_url']).' ';
- }
- fclose($fp);
- }
- } else {
- $content .= _OKIMG.sprintf(_INSTALL_L152, $smiley['smile_url']).' ';
- }
- }
- $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix('ranks'));
- while ($rank = $xoopsDB->fetchArray($result)) {
- if (file_exists('../images/ranks/'.$rank['rank_image']) && false != $fp = fopen('../images/ranks/'.$rank['rank_image'], 'rb')) {
- $binary = fread($fp, filesize('../images/ranks/'.$rank['rank_image']));
- fclose($fp);
- if (!preg_match("/\.([a-zA-Z0-9]+)$/", $rank['rank_image'], $matched)) {
- continue;
- }
- $newrank = uniqid('rank').'.'.strtolower($matched[1]);
- if (false != $fp = fopen(XOOPS_UPLOAD_PATH.'/'.$newrank, 'wb')) {
- if (-1 != fwrite($fp, $binary)) {
- $content .= _OKIMG.sprintf(_INSTALL_L154, $rank['rank_image']).' ';
- $xoopsDB->query("UPDATE ".$xoopsDB->prefix('ranks')." SET rank_image='".$newrank."' WHERE rank_id=".$rank['rank_id']);
- } else {
- $content .= _NGIMG.sprintf(_INSTALL_L153, $rank['rank_image']).' ';
- }
- fclose($fp);
- }
- } else {
- $content .= _OKIMG.sprintf(_INSTALL_L152, $rank['rank_image']).' ';
- }
- }
- $b_next = array('updateAvatars', _INSTALL_L14);
- include 'install_tpl.php';
- break;
-
-case 'updateAvatars':
- $content = ''._INSTALL_L151.' ';
- $b_next = array('updateAvatars_go', _INSTALL_L139);
- include 'install_tpl.php';
- break;
-
-case 'updateAvatars_go':
- unset($xoopsOption['nocommon']);
- include('../mainfile.php');
- $content = '';
- $title = _INSTALL_L156;
- $avatars = getImageFileList(XOOPS_ROOT_PATH.'/images/avatar/users/');
- $xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='blank.gif'");
- $avt_handler =& xoops_gethandler('avatar');
- if (!defined('XOOPS_UPLOAD_PATH')) {
- define('XOOPS_UPLOAD_PATH', '../uploads');
- }
- foreach ($avatars as $avatar_file) {
- if (preg_match("/^([0-9]+)\.([a-zA-Z]+)$/", $avatar_file, $matched)) {
- $user_id = intval($matched[1]);
- if ($user_id > 0 && false != $fp = fopen('../images/avatar/users/'.$avatar_file, 'rb')) {
- $binary = fread($fp, filesize('../images/avatar/users/'.$avatar_file));
- fclose($fp);
- $newavatar = uniqid('cavt').'.'.strtolower($matched[2]);
- if (false != $fp = fopen(XOOPS_UPLOAD_PATH.'/'.$newavatar, 'wb')) {
- if (-1 != fwrite($fp, $binary)) {
- $error = false;
- if (!$xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='".$newavatar."' WHERE uid=".$user_id)) {
- $error = true;
- } else {
- $avatar =& $avt_handler->create();
- $avatar->setVar('avatar_file', $newavatar);
- $avatar->setVar('avatar_name', 'custom');
- $avatar->setVar('avatar_mimetype', '');
- $avatar->setVar('avatar_display', 1);
- $avatar->setVar('avatar_type', 'C');
- if(!$avt_handler->insert($avatar)) {
- $error = true;
- } else {
- $avt_handler->addUser($avatar->getVar('avatar_id'), $user['uid']);
- }
- }
- if (false != $error) {
- $content .= _NGIMG.sprintf(_INSTALL_L153, $avatar_file).' ';
- @unlink(XOOPS_UPLOAD_PATH.'/'.$newavatar);
- } else {
- $content .= _OKIMG.sprintf(_INSTALL_L154, $avatar_file).' ';
- }
- } else {
- $content .= _NGIMG.sprintf(_INSTALL_L153, $avatar_file).' ';
- $xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='blank.gif' WHERE uid=".$user_id);
- }
- fclose($fp);
- }
- } else {
- $content .= _NGIMG.sprintf(_INSTALL_L152, $avatar_file).' ';
- }
- }
- }
-
- $b_next = array('finish', _INSTALL_L14);
- include 'install_tpl.php';
- break;
-
-
-case "siteInit":
- include_once "../mainfile.php";
-
- $content = "\n";
- $b_next = array('insertData', _INSTALL_L116);
-
- include 'install_tpl.php';
- break;
-
-case "insertData":
- $adminname = $myts->stripSlashesGPC(trim($_POST['adminname']));
- $adminpass = $myts->stripSlashesGPC($_POST['adminpass']);
- $adminmail = $myts->stripSlashesGPC(trim($_POST['adminmail']));
-
- if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$adminmail)) {
- $content = ""._INSTALL_L73." \n";
- $b_back = array('', _INSTALL_L112 );
- include 'install_tpl.php';
- exit();
- }
- if ( !isset($adminname) || !isset($adminpass) || !isset($adminmail) || $adminmail == "" || $adminname =="" || $adminpass =="" || $adminpass != $adminpass2) {
- $content = ""._INSTALL_L41." \n";
- $b_back = array('', _INSTALL_L112 );
- include 'install_tpl.php';
- exit();
- }
-
- include_once "../mainfile.php";
- //include_once './include/createtables2.php';
- include_once './makedata.php';
- include_once './class/dbmanager.php';
- $dbm = new db_manager;
- include_once './class/cachemanager.php';
- $cm = new cache_manager;
-
- $language = check_language($language);
- if ( file_exists("./language/".$language."/install2.php") ) {
- include_once "./language/".$language."/install2.php";
- } elseif ( file_exists("./language/english/install2.php") ) {
- include_once "./language/english/install2.php";
- $language = 'english';
- } else {
- echo 'no language file (install2.php).';
- exit();
- }
-
- //$tables = array();
- $result = $dbm->queryFromFile('./sql/'.XOOPS_DB_TYPE.'.data.sql');
-
- $result = $dbm->queryFromFile('./language/'.$language.'/'.XOOPS_DB_TYPE.'.lang.data.sql');
-
- $group = make_groups($dbm);
- $result = make_data($dbm, $cm, $adminname, $adminpass, $adminmail, $language, $group);
-
- $content = $dbm->report();
- $content .= $cm->report();
- include_once "./class/mainfilemanager.php";
- $mm = new mainfile_manager("../mainfile.php");
- foreach($group as $key => $val){
- $mm->setRewrite($key, intval($val));
- }
- $result = $mm->doRewrite();
- $content .= $mm->report();
-
- $b_next = array('finish', _INSTALL_L117);
- $title = _INSTALL_L116;
- setcookie('xoops_session', '', time() - 3600);
- include 'install_tpl.php';
-
- break;
-
-case 'finish':
-
- $title = _INSTALL_L32;
- $content = "\n";
- include './language/'.$language.'/finish.php';
- $content .= " | \n";
- include 'install_tpl.php';
- break;
-}
-
-/*
- * gets list of name of directories inside a directory
- */
-function getDirList($dirname)
-{
- $dirlist = array();
- if (is_dir($dirname) && $handle = opendir($dirname)) {
- while (false !== ($file = readdir($handle))) {
- if ( !preg_match("/^[.]{1,2}$/",$file) ) {
- if (strtolower($file) != 'cvs' && is_dir($dirname.$file) ) {
- $dirlist[$file]=$file;
- }
- }
- }
- closedir($handle);
- asort($dirlist);
- reset($dirlist);
- }
- return $dirlist;
-}
-
-/*
- * gets list of name of files within a directory
- */
-function getImageFileList($dirname)
-{
- $filelist = array();
- if (is_dir($dirname) && $handle = opendir($dirname)) {
- while (false !== ($file = readdir($handle))) {
- if (!preg_match("/^[.]{1,2}$/",$file) && preg_match("/[.gif|.jpg|.png]$/i",$file) ) {
- $filelist[$file]=$file;
- }
- }
- closedir($handle);
- asort($filelist);
- reset($filelist);
- }
- return $filelist;
-}
-
-function &xoops_module_gettemplate($dirname, $template, $block=false)
-{
- if ($block) {
- $path = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/blocks/'.$template;
- } else {
- $path = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/'.$template;
- }
- if (!file_exists($path)) {
- return false;
- } else {
- $lines = file($path);
- }
- if (!$lines) {
- return false;
- }
- $ret = '';
- $count = count($lines);
- for ($i = 0; $i < $count; $i++) {
- $ret .= str_replace("\n", "\r\n", str_replace("\r\n", "\n", $lines[$i]));
- }
- return $ret;
+} else {
+ $op = 'langselect';
}
+$widzard->setOp($op);
-function check_language($language){
- if ( file_exists('../modules/system/language/'.$language.'/modinfo.php') ) {
- return $language;
- } else {
- return 'english';
- }
+$op=basename($op);
+$fname = './widzards/install_'.$op.'.inc.php';
+$custom_fname = './custom/install_'.$op.'.inc.php';
+if (file_exists($fname)) {
+ include $fname;
+} else if(file_exists($custom_fname)) {
+ include $custom_fname;
+} else {
+ $widzard->render();
}
?>
\ No newline at end of file
Index: xoops2jp/html/install/makedata.php
diff -u xoops2jp/html/install/makedata.php:1.2.8.10 xoops2jp/html/install/makedata.php:1.5
--- xoops2jp/html/install/makedata.php:1.2.8.10 Sat Feb 4 18:46:28 2006
+++ xoops2jp/html/install/makedata.php Mon Oct 24 20:44:16 2005
@@ -1,5 +1,5 @@
insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (1, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/xoops_banner.gif', 'http://xoopscube.jp/', 1008813250)");
- $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (2, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/xoops_banner_2.gif', 'http://xoopscube.jp/', 1008813250)");
- $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (3, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/banner.swf', 'http://xoopscube.jp/', 1008813250)");
+ $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (1, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/xoops_banner.gif', 'http://jp.xoops.org/', 1008813250)");
+ $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (2, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/xoops_banner_2.gif', 'http://jp.xoops.org/', 1008813250)");
+ $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (3, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/banner.swf', 'http://jp.xoops.org/', 1008813250)");
// default theme
$time = time();
- $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Cube Default Template Set', '', ".$time.")");
+ $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Default Template Set', '', ".$time.")");
+
+ // system modules
+
+ if ( file_exists('../modules/system/language/'.$language.'/modinfo.php') ) {
+ include '../modules/system/language/'.$language.'/modinfo.php';
+ } else {
+ include '../modules/system/language/english/modinfo.php';
+ $language = 'english';
+ }
+
+ $modversion = array();
+ include_once '../modules/system/xoops_version.php';
+ $time = time();
+
+ // RMV-NOTIFY (updated for extra column in table)
+ $dbm->insert("modules", " VALUES (1, '"._MI_SYSTEM_NAME."', 100, ".$time.", 0, 1, 'system', 0, 1, 0, 0, 0, 0)");
+
+ foreach ($modversion['templates'] as $tplfile) {
+ if ($fp = fopen('../modules/system/templates/'.$tplfile['file'], 'r')) {
+ $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '".addslashes($tplfile['file'])."', '".addslashes($tplfile['description'])."', ".$time.", ".$time.", 'module')");
+ //$newtplid = $xoopsDB->getInsertId();
+ $tplsource = fread($fp, filesize('../modules/system/templates/'.$tplfile['file']));
+ fclose($fp);
+ $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (".$newtplid.", '".addslashes($tplsource)."')");
+ }
+ }
+
+ foreach ($modversion['blocks'] as $func_num => $newblock) {
+ if ($fp = fopen('../modules/system/templates/blocks/'.$newblock['template'], 'r')) {
+ if (in_array($newblock['template'], array('system_block_user.html', 'system_block_login.html', 'system_block_mainmenu.html'))) {
+ $visible = 1;
+ } else {
+ $visible = 0;
+ }
+ $options = !isset($newblock['options']) ? '' : trim($newblock['options']);
+ $edit_func = !isset($newblock['edit_func']) ? '' : trim($newblock['edit_func']);
+ $newbid = $dbm->insert('newblocks', " VALUES (0, 1, ".$func_num.", '".addslashes($options)."', '".addslashes($newblock['name'])."', '".addslashes($newblock['name'])."', '', 0, 0, ".$visible.", 'S', 'H', 1, 'system', '".addslashes($newblock['file'])."', '".addslashes($newblock['show_func'])."', '".addslashes($edit_func)."', '".addslashes($newblock['template'])."', 0, ".$time.")");
+ //$newbid = $xoopsDB->getInsertId();
+ $newtplid = $dbm->insert('tplfile', " VALUES (0, ".$newbid.", 'system', 'default', '".addslashes($newblock['template'])."', '".addslashes($newblock['description'])."', ".$time.", ".$time.", 'block')");
+ //$newtplid = $xoopsDB->getInsertId();
+ $tplsource = fread($fp, filesize('../modules/system/templates/blocks/'.$newblock['template']));
+ fclose($fp);
+ $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (".$newtplid.", '".addslashes($tplsource)."')");
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 1, 'block_read')");
+ //$dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 'xoops_blockadmiin')");
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", ".$newbid.", 1, 'block_read')");
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ANONYMOUS'].", ".$newbid.", 1, 'block_read')");
+ }
+ }
+
+ // data for table 'users'
+
+ $temp = md5($adminpass);
+ $regdate = time();
+ //$dbadminname= addslashes($adminname);
+ // RMV-NOTIFY (updated for extra columns in user table)
+ $dbm->insert('users', " VALUES (1,'','".addslashes($adminname)."','".addslashes($adminmail)."','".XOOPS_URL."/','blank.gif','".$regdate."','','','',1,'','','','','".$temp."',0,0,7,5,'default','0.0',".time().",'thread',0,1,0,'','','',0)");
+
+
+ // data for table 'block_module_link'
+
+ $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)");
+ }
+ }
// data for table 'config'
@@ -99,12 +170,12 @@
$dbm->insert('config', " VALUES (4, 0, 1, 'startpage', '_MD_AM_STARTPAGE', '--', '_MD_AM_STARTPAGEDSC', 'startpage', 'other', 6)");
$dbm->insert('config', " VALUES (5, 0, 1, 'server_TZ', '_MD_AM_SERVERTZ', '0', '_MD_AM_SERVERTZDSC', 'timezone', 'float', 8)");
$dbm->insert('config', " VALUES (6, 0, 1, 'default_TZ', '_MD_AM_DEFAULTTZ', '0', '_MD_AM_DEFAULTTZDSC', 'timezone', 'float', 10)");
- $dbm->insert('config', " VALUES (7, 0, 1, 'theme_set', '_MD_AM_DTHEME', 'cube_default', '_MD_AM_DTHEMEDSC', 'theme', 'other', 12)");
+ $dbm->insert('config', " VALUES (7, 0, 1, 'theme_set', '_MD_AM_DTHEME', 'default', '_MD_AM_DTHEMEDSC', 'theme', 'other', 12)");
$dbm->insert('config', " VALUES (8, 0, 1, 'anonymous', '_MD_AM_ANONNAME', '".addslashes(_INSTALL_ANON)."', '_MD_AM_ANONNAMEDSC', 'textbox', 'text', 15)");
$dbm->insert('config', " VALUES (9, 0, 1, 'gzip_compression', '_MD_AM_USEGZIP', '0', '_MD_AM_USEGZIPDSC', 'yesno', 'int', 16)");
$dbm->insert('config', " VALUES (10, 0, 1, 'usercookie', '_MD_AM_USERCOOKIE', 'xoops_user', '_MD_AM_USERCOOKIEDSC', 'textbox', 'text', 18)");
$dbm->insert('config', " VALUES (11, 0, 1, 'session_expire', '_MD_AM_SESSEXPIRE', '15', '_MD_AM_SESSEXPIREDSC', 'textbox', 'int', 22)");
- $dbm->insert('config', " VALUES (12, 0, 1, 'banners', '_MD_AM_BANNERS', '0', '_MD_AM_BANNERSDSC', 'yesno', 'int', 26)");
+ $dbm->insert('config', " VALUES (12, 0, 1, 'banners', '_MD_AM_BANNERS', '1', '_MD_AM_BANNERSDSC', 'yesno', 'int', 26)");
$dbm->insert('config', " VALUES (13, 0, 1, 'debug_mode', '_MD_AM_DEBUGMODE', '1', '_MD_AM_DEBUGMODEDSC', 'select', 'int', 24)");
$dbm->insert('config', " VALUES (14, 0, 1, 'my_ip', '_MD_AM_MYIP', '127.0.0.1', '_MD_AM_MYIPDSC', 'textbox', 'text', 29)");
$dbm->insert('config', " VALUES (15, 0, 1, 'use_ssl', '_MD_AM_USESSL', '0', '_MD_AM_USESSLDSC', 'yesno', 'int', 30)");
@@ -125,11 +196,11 @@
$dbm->insert('config', " VALUES (32, 0, 1, 'com_mode', '_MD_AM_COMMODE', 'nest', '_MD_AM_COMMODEDSC', 'select', 'text', 34)");
$dbm->insert('config', " VALUES (33, 0, 1, 'com_order', '_MD_AM_COMORDER', '0', '_MD_AM_COMORDERDSC', 'select', 'int', 36)");
$dbm->insert('config', " VALUES (34, 0, 2, 'bad_unames', '_MD_AM_BADUNAMES', '".addslashes(serialize(array('webmaster', '^xoops', '^admin')))."', '_MD_AM_BADUNAMESDSC', 'textarea', 'array', 24)");
- $dbm->insert('config', " VALUES (35, 0, 2, 'bad_emails', '_MD_AM_BADEMAILS', '".addslashes(serialize(array('xoopscube.org$', 'xoopscube.jp$')))."', '_MD_AM_BADEMAILSDSC', 'textarea', 'array', 26)");
+ $dbm->insert('config', " VALUES (35, 0, 2, 'bad_emails', '_MD_AM_BADEMAILS', '".addslashes(serialize(array('xoops.org$')))."', '_MD_AM_BADEMAILSDSC', 'textarea', 'array', 26)");
$dbm->insert('config', " VALUES (36, 0, 2, 'maxuname', '_MD_AM_MAXUNAME', '10', '_MD_AM_MAXUNAMEDSC', 'textbox', 'int', 3)");
$dbm->insert('config', " VALUES (37, 0, 1, 'bad_ips', '_MD_AM_BADIPS', '".addslashes(serialize(array('127.0.0.1')))."', '_MD_AM_BADIPSDSC', 'textarea', 'array', 42)");
- $dbm->insert('config', " VALUES (38, 0, 3, 'meta_keywords', '_MD_AM_METAKEY', '', '_MD_AM_METAKEYDSC', 'textarea', 'text', 0)");
- $dbm->insert('config', " VALUES (39, 0, 3, 'footer', '_MD_AM_FOOTER', 'Powered by XOOPS Cube 2.1 Alpha 1 © 2001-2006 The XOOPS Cube Project', '_MD_AM_FOOTERDSC', 'textarea', 'text', 20)");
+ $dbm->insert('config', " VALUES (38, 0, 3, 'meta_keywords', '_MD_AM_METAKEY', 'news, technology, headlines, xoops, xoop, nuke, myphpnuke, myphp-nuke, phpnuke, SE, geek, geeks, hacker, hackers, linux, software, download, downloads, free, community, mp3, forum, forums, bulletin, board, boards, bbs, php, survey, poll, polls, kernel, comment, comments, portal, odp, open, source, opensource, FreeSoftware, gnu, gpl, license, Unix, *nix, mysql, sql, database, databases, web site, weblog, guru, module, modules, theme, themes, cms, content management', '_MD_AM_METAKEYDSC', 'textarea', 'text', 0)");
+ $dbm->insert('config', " VALUES (39, 0, 3, 'footer', '_MD_AM_FOOTER', 'Powered by XOOPS 2.0 © 2001-2003 The XOOPS Project', '_MD_AM_FOOTERDSC', 'textarea', 'text', 20)");
$dbm->insert('config', " VALUES (40, 0, 4, 'censor_enable', '_MD_AM_DOCENSOR', '0', '_MD_AM_DOCENSORDSC', 'yesno', 'int', 0)");
$dbm->insert('config', " VALUES (41, 0, 4, 'censor_words', '_MD_AM_CENSORWRD', '".addslashes(serialize(array('fuck', 'shit')))."', '_MD_AM_CENSORWRDDSC', 'textarea', 'array', 1)");
$dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '#OOPS#', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)");
@@ -139,9 +210,9 @@
$dbm->insert('config', " VALUES (46, 0, 2, 'avatar_minposts', '_MD_AM_AVATARMP', '0', '_MD_AM_AVATARMPDSC', 'textbox', 'int', 15)");
$dbm->insert('config', " VALUES (47, 0, 1, 'enable_badips', '_MD_AM_DOBADIPS', '0', '_MD_AM_DOBADIPSDSC', 'yesno', 'int', 40)");
$dbm->insert('config', " VALUES (48, 0, 3, 'meta_rating', '_MD_AM_METARATING', 'general', '_MD_AM_METARATINGDSC', 'select', 'text', 4)");
- $dbm->insert('config', " VALUES (49, 0, 3, 'meta_author', '_MD_AM_METAAUTHOR', '', '_MD_AM_METAAUTHORDSC', 'textbox', 'text', 6)");
- $dbm->insert('config', " VALUES (50, 0, 3, 'meta_copyright', '_MD_AM_METACOPYR', '', '_MD_AM_METACOPYRDSC', 'textbox', 'text', 8)");
- $dbm->insert('config', " VALUES (51, 0, 3, 'meta_description', '_MD_AM_METADESC', '', '_MD_AM_METADESCDSC', 'textarea', 'text', 1)");
+ $dbm->insert('config', " VALUES (49, 0, 3, 'meta_author', '_MD_AM_METAAUTHOR', 'XOOPS', '_MD_AM_METAAUTHORDSC', 'textbox', 'text', 6)");
+ $dbm->insert('config', " VALUES (50, 0, 3, 'meta_copyright', '_MD_AM_METACOPYR', 'Copyright © 2001-2003', '_MD_AM_METACOPYRDSC', 'textbox', 'text', 8)");
+ $dbm->insert('config', " VALUES (51, 0, 3, 'meta_description', '_MD_AM_METADESC', 'XOOPS is a dynamic Object Oriented based open source portal script written in PHP.', '_MD_AM_METADESCDSC', 'textarea', 'text', 1)");
$dbm->insert('config', " VALUES (52, 0, 2, 'allow_chgmail', '_MD_AM_ALLWCHGMAIL', '0', '_MD_AM_ALLWCHGMAILDSC', 'yesno', 'int', 3)");
$dbm->insert('config', " VALUES (53, 0, 1, 'use_mysession', '_MD_AM_USEMYSESS', '0', '_MD_AM_USEMYSESSDSC', 'yesno', 'int', 19)");
$dbm->insert('config', " VALUES (54, 0, 2, 'reg_dispdsclmr', '_MD_AM_DSPDSCLMR', 1, '_MD_AM_DSPDSCLMRDSC', 'yesno', 'int', 30)");
@@ -167,177 +238,10 @@
// RMV-NOTIFY... Need to specify which user is sender of notification PM
$dbm->insert('config', " VALUES (73,0,6,'fromuid','_MD_AM_MAILFROMUID','1','_MD_AM_MAILFROMUIDDESC','user','int',3)");
- // install modules
- installModule($dbm, 1, "system", _MI_SYSTEM_NAME, $language, $gruops);
-
- installModule($dbm, 2, "base", _MI_BASE_NAME, $language, $gruops, true);
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 2, 1, 'module_admin')");
-
- installModule($dbm, 3, "legacyRender", _MI_LEGACYRENDER_NAME, $language, $gruops, true);
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 3, 1, 'module_admin')");
-
- installModule($dbm, 4, "user", _MI_USER_NAME, $language, $gruops, true);
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 4, 1, 'module_admin')");
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 4, 1, 'module_read')");
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", 4, 1, 'module_read')");
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ANONYMOUS'].", 4, 1, 'module_read')");
-
- installModule($dbm, 5, "pm", _MI_PM_NAME, $language, $gruops, true);
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 5, 1, 'module_admin')");
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 5, 1, 'module_read')");
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", 5, 1, 'module_read')");
-
- installModule($dbm, 6, "stdCache", _MI_STDCACHE_NAME, $language, $gruops, true);
- $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 6, 1, 'module_admin')");
-
- // data for table 'users'
-
- $temp = md5($adminpass);
- $regdate = time();
- //$dbadminname= addslashes($adminname);
- // RMV-NOTIFY (updated for extra columns in user table)
- $dbm->insert('users', " VALUES (1,'','".addslashes($adminname)."','".addslashes($adminmail)."','".XOOPS_URL."/','blank.gif','".$regdate."','','','',1,'','','','','".$temp."',0,0,7,5,'default','0.0',".time().",'thread',0,1,0,'','','',0)");
-
-
- // data for table 'block_module_link'
-
- $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)");
- }
- }
return $gruops;
}
-/**
- *
- * Install module by module's name, language and specified mid.
- *
- * @param $dbm object Database manager instance
- * @param $mid int module's ID
- * @param $module string module's name
- * @param $language string language
- * @param $grops array hash map
- */
-function installModule(&$dbm, $mid, $module, $module_name, $language = 'english', &$groups) {
- if ( file_exists("../modules/${module}/language/${language}/modinfo.php") ) {
- include "../modules/${module}/language/${language}/modinfo.php";
- } else {
- include "../modules/${module}/language/english/modinfo.php";
- $language = 'english';
- }
- $modversion = array();
- require_once "../modules/${module}/xoops_version.php";
- $time = time();
-
- // RMV-NOTIFY (updated for extra column in table)
- //
- // TODO We should set hasconfig and more option values here.
- //
- $hasconfig = isset($modversion['config']) ? 1 : 0;
- $hasmain = 0;
- if (isset($modversion['hasMain']) && $modversion['hasMain'] == 1) {
- $hasmain = 1;
- }
- $dbm->insert("modules", " VALUES (${mid}, '" . constant($module_name) . "', 100, ".$time.", 0, 1, '${module}', ${hasmain}, 1, 0, ${hasconfig}, 0, 0)");
-
- //
- // Database
- // TODO Dependence on mysql, Now.
- //
- if (isset($modversion['sqlfile']['mysql'])) {
- $dbm->queryFromFile("../modules/${module}/" . $modversion['sqlfile']['mysql']);
- }
-
- if (is_array($modversion['templates']) && count($modversion['templates']) > 0) {
- foreach ($modversion['templates'] as $tplfile) {
- if ($fp = fopen("../modules/${module}/templates/".$tplfile['file'], 'r')) {
- $newtplid = $dbm->insert('tplfile', " VALUES (0, ${mid}, '${module}', 'default', '".addslashes($tplfile['file'])."', '".addslashes($tplfile['description'])."', ".$time.", ".$time.", 'module')");
- //$newtplid = $xoopsDB->getInsertId();
- if (filesize("../modules/${module}/templates/".$tplfile['file']) > 0) {
- $tplsource = fread($fp, filesize("../modules/${module}/templates/".$tplfile['file']));
- }
- else {
- $tplsource = "";
- }
- fclose($fp);
- $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (".$newtplid.", '".addslashes($tplsource)."')");
- }
- }
- }
-
- if (is_array($modversion['blocks']) && count($modversion['blocks']) > 0) {
- foreach ($modversion['blocks'] as $func_num => $newblock) {
- if ($fp = fopen("../modules/${module}/templates/blocks/".$newblock['template'], 'r')) {
- //
- // The following checking is dependence on the structure of system module.
- //
- if (in_array($newblock['template'], array('system_block_user.html', 'system_block_login.html', 'system_block_mainmenu.html'))) {
- $visible = 1;
- } else {
- $visible = 0;
- }
- $options = !isset($newblock['options']) ? '' : trim($newblock['options']);
- $edit_func = !isset($newblock['edit_func']) ? '' : trim($newblock['edit_func']);
- $newbid = $dbm->insert('newblocks', " VALUES (0, ${mid}, ".$func_num.", '".addslashes($options)."', '".addslashes($newblock['name'])."', '".addslashes($newblock['name'])."', '', 0, 0, ".$visible.", 'S', 'H', 1, '${module}', '".addslashes($newblock['file'])."', '".addslashes($newblock['show_func'])."', '".addslashes($edit_func)."', '".addslashes($newblock['template'])."', 0, ".$time.")");
- //$newbid = $xoopsDB->getInsertId();
- $newtplid = $dbm->insert('tplfile', " VALUES (0, ".$newbid.", '${module}', 'default', '".addslashes($newblock['template'])."', '".addslashes($newblock['description'])."', ".$time.", ".$time.", 'block')");
- //$newtplid = $xoopsDB->getInsertId();
- if (filesize("../modules/${module}/templates/blocks/".$newblock['template']) > 0) {
- $tplsource = fread($fp, filesize("../modules/${module}/templates/blocks/".$newblock['template']));
- }
- else {
- $tplsource = "";
- }
- fclose($fp);
- $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (".$newtplid.", '".addslashes($tplsource)."')");
-
- $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_ADMIN'].", ".$newbid.", 1, 'block_read')");
- //$dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 'xoops_blockadmiin')");
- $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_USERS'].", ".$newbid.", 1, 'block_read')");
- $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_ANONYMOUS'].", ".$newbid.", 1, 'block_read')");
- }
- }
- }
-
- //
- // Install preferences
- //
- if (isset($modversion['config'])) {
- $count = 0;
- foreach ($modversion['config'] as $configInfo) {
- //
- // TODO We have to sanitize.
- //
- $name = $configInfo['name'];
- $title = $configInfo['title'];
- $desc = $configInfo['description'];
- $formtype = $configInfo['formtype'];
- $valuetype = $configInfo['valuetype'];
- $default = $configInfo['default'];
-
- if ($valuetype == "array") {
- $default = serialize(explode('|', trim($default)));
- }
-
- $conf_id = $dbm->insert("config", " VALUES (0, ${mid}, 0, '${name}', '${title}', '${default}', '${desc}', '${formtype}', '${valuetype}', ${count})");
-
- if (isset($configInfo['options']) && is_array($configInfo['options'])) {
- foreach ($configInfo['options'] as $key => $value) {
- $dbm->insert("configoption", " VALUES (0, '${key}', '${value}', ${conf_id})");
- }
- }
-
- $count++;
- }
- }
-}
?>
From nobunobu @ users.sourceforge.jp Tue Mar 7 22:11:40 2006
From: nobunobu @ users.sourceforge.jp (NobuNobu)
Date: Tue, 7 Mar 2006 22:11:40 +0900
Subject: [xoops-cvslog 2376] CVS update: xoops2jp/html/install/include
Message-ID: <20060307131140.109D12AC069@users.sourceforge.jp>
Index: xoops2jp/html/install/include/functions.php
diff -u /dev/null xoops2jp/html/install/include/functions.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/include/functions.php Tue Mar 7 22:11:39 2006
@@ -0,0 +1,157 @@
+ 'english',
+ 'ja' => 'japanese',
+ 'fr' => 'french',
+ 'de' => 'german',
+ 'nl' => 'dutch',
+ 'es' => 'spanish',
+ 'tw' => 'tchinese',
+ 'cn' => 'schinese',
+ 'ro' => 'romanian'
+ );
+
+ $language = 'english';
+ if ( !empty($_POST['lang']) ) {
+ $language = $_POST['lang'];
+ } else {
+ if (isset($_COOKIE['install_lang'])) {
+ $language = $_COOKIE['install_lang'];
+ } else {
+ $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'ja,en-us;q=0.7,zh-TW;q=0.6';
+ if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+ $accept_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+ foreach ($accept_langs as $al) {
+ $al = strtolower($al);
+ $al_len = strlen($al);
+ if ($al_len > 2) {
+ if (preg_match('/([a-z]{2});q=[0-9.]+$/', $al, $al_match)) {
+ $al = $al_match[1];
+ } else {
+ continue;
+ }
+ }
+ if (isset($language_array[$al])) {
+ $language = $language_array[$al];
+ break;
+ }
+ }
+ }
+ }
+ }
+ if ( !file_exists('./language/'.$language.'/install.php') ) {
+ $language = 'english';
+ }
+ setcookie('install_lang', $language);
+ return $language;
+}
+
+/*
+ * gets list of name of directories inside a directory
+ */
+function getDirList($dirname)
+{
+ $dirlist = array();
+ if (is_dir($dirname) && $handle = opendir($dirname)) {
+ while (false !== ($file = readdir($handle))) {
+ if ( !preg_match('/^[.]{1,2}$/',$file) ) {
+ if (strtolower($file) != 'cvs' && is_dir($dirname.$file) ) {
+ $dirlist[$file]=$file;
+ }
+ }
+ }
+ closedir($handle);
+ asort($dirlist);
+ reset($dirlist);
+ }
+ return $dirlist;
+}
+
+/*
+ * gets list of name of files within a directory
+ */
+function getImageFileList($dirname)
+{
+ $filelist = array();
+ if (is_dir($dirname) && $handle = opendir($dirname)) {
+ while (false !== ($file = readdir($handle))) {
+ if (!preg_match('/^[.]{1,2}$/', $file) && preg_match('/[.gif|.jpg|.png]$/i', $file) ) {
+ $filelist[$file]=$file;
+ }
+ }
+ closedir($handle);
+ asort($filelist);
+ reset($filelist);
+ }
+ return $filelist;
+}
+
+function &xoops_module_gettemplate($dirname, $template, $block=false)
+{
+ if ($block) {
+ $path = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/blocks/'.$template;
+ } else {
+ $path = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/'.$template;
+ }
+ if (!file_exists($path)) {
+ return false;
+ } else {
+ $lines = file($path);
+ }
+ if (!$lines) {
+ return false;
+ }
+ $ret = '';
+ $count = count($lines);
+ for ($i = 0; $i < $count; $i++) {
+ $ret .= str_replace("\n", "\r\n", str_replace("\r\n", "\n", $lines[$i]));
+ }
+ return $ret;
+}
+
+function check_language($language){
+ if ( file_exists('../modules/system/language/'.$language.'/modinfo.php') ) {
+ return $language;
+ } else {
+ return 'english';
+ }
+}
+
+function b_back($option = null)
+{
+ if(!isset($option) || !is_array($option)) return '';
+ $content = '';
+ if(isset($option[0]) && $option[0] != ''){
+ $content .= '';
+ }else{
+ $content .= '';
+ }
+ if(isset($option[1]) && $option[1] != ''){
+ $content .= '<< '.htmlspecialchars($option[1]).'';
+ }
+ return $content;
+}
+
+function b_reload($option=''){
+ if(empty($option)) return '';
+ if (!defined('_INSTALL_L200')) {
+ define('_INSTALL_L200', 'Reload');
+ }
+ return '';
+}
+
+function b_next($option=null){
+ if(!isset($option) || !is_array($option)) return '';
+ $content = '';
+ if(isset($option[1]) && $option[1] != ''){
+ $content .= ''.htmlspecialchars($option[1]).' >>';
+ }
+ $content .= '';
+ $content .= '';
+ return $content;
+}
+
+?>
Index: xoops2jp/html/install/include/makedata.php
diff -u /dev/null xoops2jp/html/install/include/makedata.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/include/makedata.php Tue Mar 7 22:11:39 2006
@@ -0,0 +1,345 @@
+ //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+
+include_once './class/dbmanager.php';
+
+// RMV
+// TODO: Shouldn't we insert specific field names?? That way we can use
+// the defaults specified in the database...!!!! (and don't have problem
+// of missing fields in install file, when add new fields to database)
+
+function make_groups(&$dbm){
+ $gruops['XOOPS_GROUP_ADMIN'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_WEBMASTER)."', '".addslashes(_INSTALL_WEBMASTERD)."', 'Admin')");
+ $gruops['XOOPS_GROUP_USERS'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_REGUSERS)."', '".addslashes(_INSTALL_REGUSERSD)."', 'User')");
+ $gruops['XOOPS_GROUP_ANONYMOUS'] = $dbm->insert('groups', " VALUES (0, '".addslashes(_INSTALL_ANONUSERS)."', '".addslashes(_INSTALL_ANONUSERSD)."', 'Anonymous')");
+
+ if(!$gruops['XOOPS_GROUP_ADMIN'] || !$gruops['XOOPS_GROUP_USERS'] || !$gruops['XOOPS_GROUP_ANONYMOUS']){
+ return false;
+ }
+
+ return $gruops;
+}
+function make_data(&$dbm, &$cm, $adminname, $adminpass, $adminmail, $language, $gruops){
+
+ $myts =& textSanitizer::getInstance();
+ //$xoopsDB =& Database::getInstance();
+ //$dbm = new db_manager;
+
+ $tables = array();
+
+ // data for table 'groups_users_link'
+
+ $dbm->insert('groups_users_link', " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 1)");
+ $dbm->insert('groups_users_link', " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", 1)");
+
+ // data for table 'group_permission'
+
+ $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1,'module_admin')");
+ $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1, 'module_read')");
+ $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_USERS'].",1,1,'module_read')");
+ $dbm->insert("group_permission", " VALUES (0,".$gruops['XOOPS_GROUP_ANONYMOUS'].",1,1,'module_read')");
+
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",1,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",2,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",3,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",4,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",5,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",6,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",7,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",8,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",9,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",10,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",11,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",12,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",13,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",14,1,'system_admin')");
+ $dbm->insert("group_permission", " VALUES(0,".$gruops['XOOPS_GROUP_ADMIN'].",15,1,'system_admin')");
+
+ // data for table 'banner'
+
+ $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (1, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/xoops_banner.gif', 'http://xoopscube.jp/', 1008813250)");
+ $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (2, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/xoops_banner_2.gif', 'http://xoopscube.jp/', 1008813250)");
+ $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date) VALUES (3, 1, 0, 1, 0, '".XOOPS_URL."/images/banners/banner.swf', 'http://xoopscube.jp/', 1008813250)");
+
+ // default theme
+
+ $time = time();
+ $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Cube Default Template Set', '', ".$time.")");
+
+ // data for table 'config'
+
+ $dbm->insert('config', " VALUES (1, 0, 1, 'sitename', '_MD_AM_SITENAME', 'XOOPS Cube Site', '_MD_AM_SITENAMEDSC', 'textbox', 'text', 0)");
+ $dbm->insert('config', " VALUES (2, 0, 1, 'slogan', '_MD_AM_SLOGAN', 'Just Use it!', '_MD_AM_SLOGANDSC', 'textbox', 'text', 2)");
+ $dbm->insert('config', " VALUES (3, 0, 1, 'language', '_MD_AM_LANGUAGE', '".addslashes($language)."', '_MD_AM_LANGUAGEDSC', 'language', 'other', 4)");
+ $dbm->insert('config', " VALUES (4, 0, 1, 'startpage', '_MD_AM_STARTPAGE', '--', '_MD_AM_STARTPAGEDSC', 'startpage', 'other', 6)");
+ //Get Server timezone Setting
+ $time_diff_val = date('O');
+ $time_diff = floatval(substr($time_diff_val,0,1).(substr($time_diff_val,1,2) + substr($time_diff_val,3,2)/60));
+ $dbm->insert('config', " VALUES (5, 0, 1, 'server_TZ', '_MD_AM_SERVERTZ', '".$time_diff."', '_MD_AM_SERVERTZDSC', 'timezone', 'float', 8)");
+ $dbm->insert('config', " VALUES (6, 0, 1, 'default_TZ', '_MD_AM_DEFAULTTZ', '".$time_diff."', '_MD_AM_DEFAULTTZDSC', 'timezone', 'float', 10)");
+ $dbm->insert('config', " VALUES (7, 0, 1, 'theme_set', '_MD_AM_DTHEME', 'cube_default', '_MD_AM_DTHEMEDSC', 'theme', 'other', 12)");
+ $dbm->insert('config', " VALUES (8, 0, 1, 'anonymous', '_MD_AM_ANONNAME', '".addslashes(_INSTALL_ANON)."', '_MD_AM_ANONNAMEDSC', 'textbox', 'text', 15)");
+ $dbm->insert('config', " VALUES (9, 0, 1, 'gzip_compression', '_MD_AM_USEGZIP', '0', '_MD_AM_USEGZIPDSC', 'yesno', 'int', 16)");
+ $dbm->insert('config', " VALUES (10, 0, 1, 'usercookie', '_MD_AM_USERCOOKIE', 'xoops_user', '_MD_AM_USERCOOKIEDSC', 'textbox', 'text', 18)");
+ $dbm->insert('config', " VALUES (11, 0, 1, 'session_expire', '_MD_AM_SESSEXPIRE', '15', '_MD_AM_SESSEXPIREDSC', 'textbox', 'int', 22)");
+ $dbm->insert('config', " VALUES (12, 0, 1, 'banners', '_MD_AM_BANNERS', '0', '_MD_AM_BANNERSDSC', 'yesno', 'int', 26)");
+ $dbm->insert('config', " VALUES (13, 0, 1, 'debug_mode', '_MD_AM_DEBUGMODE', '1', '_MD_AM_DEBUGMODEDSC', 'select', 'int', 24)");
+ $dbm->insert('config', " VALUES (14, 0, 1, 'my_ip', '_MD_AM_MYIP', '127.0.0.1', '_MD_AM_MYIPDSC', 'textbox', 'text', 29)");
+ $dbm->insert('config', " VALUES (15, 0, 1, 'use_ssl', '_MD_AM_USESSL', '0', '_MD_AM_USESSLDSC', 'yesno', 'int', 30)");
+ $dbm->insert('config', " VALUES (16, 0, 1, 'session_name', '_MD_AM_SESSNAME', 'xoops_session', '_MD_AM_SESSNAMEDSC', 'textbox', 'text', 20)");
+ $dbm->insert('config', " VALUES (17, 0, 2, 'minpass', '_MD_AM_MINPASS', '5', '_MD_AM_MINPASSDSC', 'textbox', 'int', 1)");
+ $dbm->insert('config', " VALUES (18, 0, 2, 'minuname', '_MD_AM_MINUNAME', '3', '_MD_AM_MINUNAMEDSC', 'textbox', 'int', 2)");
+ $dbm->insert('config', " VALUES (19, 0, 2, 'new_user_notify', '_MD_AM_NEWUNOTIFY', '1', '_MD_AM_NEWUNOTIFYDSC', 'yesno', 'int', 4)");
+ $dbm->insert('config', " VALUES (20, 0, 2, 'new_user_notify_group', '_MD_AM_NOTIFYTO', ".$gruops['XOOPS_GROUP_ADMIN'].", '_MD_AM_NOTIFYTODSC', 'group', 'int', 6)");
+ $dbm->insert('config', " VALUES (21, 0, 2, 'activation_type', '_MD_AM_ACTVTYPE', '0', '_MD_AM_ACTVTYPEDSC', 'select', 'int', 8)");
+ $dbm->insert('config', " VALUES (22, 0, 2, 'activation_group', '_MD_AM_ACTVGROUP', ".$gruops['XOOPS_GROUP_ADMIN'].", '_MD_AM_ACTVGROUPDSC', 'group', 'int', 10)");
+ $dbm->insert('config', " VALUES (23, 0, 2, 'uname_test_level', '_MD_AM_UNAMELVL', '0', '_MD_AM_UNAMELVLDSC', 'select', 'int', 12)");
+ $dbm->insert('config', " VALUES (24, 0, 2, 'avatar_allow_upload', '_MD_AM_AVATARALLOW', '0', '_MD_AM_AVATARALWDSC', 'yesno', 'int', 14)");
+ $dbm->insert('config', " VALUES (27, 0, 2, 'avatar_width', '_MD_AM_AVATARW', '80', '_MD_AM_AVATARWDSC', 'textbox', 'int', 16)");
+ $dbm->insert('config', " VALUES (28, 0, 2, 'avatar_height', '_MD_AM_AVATARH', '80', '_MD_AM_AVATARHDSC', 'textbox', 'int', 18)");
+ $dbm->insert('config', " VALUES (29, 0, 2, 'avatar_maxsize', '_MD_AM_AVATARMAX', '35000', '_MD_AM_AVATARMAXDSC', 'textbox', 'int', 20)");
+ $dbm->insert('config', " VALUES (30, 0, 1, 'adminmail', '_MD_AM_ADMINML', '".addslashes($adminmail)."', '_MD_AM_ADMINMLDSC', 'textbox', 'text', 3)");
+ $dbm->insert('config', " VALUES (31, 0, 2, 'self_delete', '_MD_AM_SELFDELETE', '0', '_MD_AM_SELFDELETEDSC', 'yesno', 'int', 22)");
+ $dbm->insert('config', " VALUES (32, 0, 1, 'com_mode', '_MD_AM_COMMODE', 'nest', '_MD_AM_COMMODEDSC', 'select', 'text', 34)");
+ $dbm->insert('config', " VALUES (33, 0, 1, 'com_order', '_MD_AM_COMORDER', '0', '_MD_AM_COMORDERDSC', 'select', 'int', 36)");
+ $dbm->insert('config', " VALUES (34, 0, 2, 'bad_unames', '_MD_AM_BADUNAMES', '".addslashes(serialize(array('webmaster', '^xoops', '^admin')))."', '_MD_AM_BADUNAMESDSC', 'textarea', 'array', 24)");
+ $dbm->insert('config', " VALUES (35, 0, 2, 'bad_emails', '_MD_AM_BADEMAILS', '".addslashes(serialize(array('xoopscube.org$', 'xoopscube.jp$')))."', '_MD_AM_BADEMAILSDSC', 'textarea', 'array', 26)");
+ $dbm->insert('config', " VALUES (36, 0, 2, 'maxuname', '_MD_AM_MAXUNAME', '10', '_MD_AM_MAXUNAMEDSC', 'textbox', 'int', 3)");
+ $dbm->insert('config', " VALUES (37, 0, 1, 'bad_ips', '_MD_AM_BADIPS', '".addslashes(serialize(array('127.0.0.1')))."', '_MD_AM_BADIPSDSC', 'textarea', 'array', 42)");
+ $dbm->insert('config', " VALUES (38, 0, 3, 'meta_keywords', '_MD_AM_METAKEY', '', '_MD_AM_METAKEYDSC', 'textarea', 'text', 0)");
+ $dbm->insert('config', " VALUES (39, 0, 3, 'footer', '_MD_AM_FOOTER', 'Powered by XOOPS Cube 2.1 Alpha 1 © 2001-2006 The XOOPS Cube Project', '_MD_AM_FOOTERDSC', 'textarea', 'text', 20)");
+ $dbm->insert('config', " VALUES (40, 0, 4, 'censor_enable', '_MD_AM_DOCENSOR', '0', '_MD_AM_DOCENSORDSC', 'yesno', 'int', 0)");
+ $dbm->insert('config', " VALUES (41, 0, 4, 'censor_words', '_MD_AM_CENSORWRD', '".addslashes(serialize(array('fuck', 'shit')))."', '_MD_AM_CENSORWRDDSC', 'textarea', 'array', 1)");
+ $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '#OOPS#', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)");
+ $dbm->insert('config', " VALUES (43, 0, 3, 'meta_robots', '_MD_AM_METAROBOTS', 'index,follow', '_MD_AM_METAROBOTSDSC', 'select', 'text', 2)");
+ $dbm->insert('config', " VALUES (44, 0, 5, 'enable_search', '_MD_AM_DOSEARCH', '1', '_MD_AM_DOSEARCHDSC', 'yesno', 'int', 0)");
+ $dbm->insert('config', " VALUES (45, 0, 5, 'keyword_min', '_MD_AM_MINSEARCH', '5', '_MD_AM_MINSEARCHDSC', 'textbox', 'int', 1)");
+ $dbm->insert('config', " VALUES (46, 0, 2, 'avatar_minposts', '_MD_AM_AVATARMP', '0', '_MD_AM_AVATARMPDSC', 'textbox', 'int', 15)");
+ $dbm->insert('config', " VALUES (47, 0, 1, 'enable_badips', '_MD_AM_DOBADIPS', '0', '_MD_AM_DOBADIPSDSC', 'yesno', 'int', 40)");
+ $dbm->insert('config', " VALUES (48, 0, 3, 'meta_rating', '_MD_AM_METARATING', 'general', '_MD_AM_METARATINGDSC', 'select', 'text', 4)");
+ $dbm->insert('config', " VALUES (49, 0, 3, 'meta_author', '_MD_AM_METAAUTHOR', '', '_MD_AM_METAAUTHORDSC', 'textbox', 'text', 6)");
+ $dbm->insert('config', " VALUES (50, 0, 3, 'meta_copyright', '_MD_AM_METACOPYR', '', '_MD_AM_METACOPYRDSC', 'textbox', 'text', 8)");
+ $dbm->insert('config', " VALUES (51, 0, 3, 'meta_description', '_MD_AM_METADESC', '', '_MD_AM_METADESCDSC', 'textarea', 'text', 1)");
+ $dbm->insert('config', " VALUES (52, 0, 2, 'allow_chgmail', '_MD_AM_ALLWCHGMAIL', '0', '_MD_AM_ALLWCHGMAILDSC', 'yesno', 'int', 3)");
+ $dbm->insert('config', " VALUES (53, 0, 1, 'use_mysession', '_MD_AM_USEMYSESS', '0', '_MD_AM_USEMYSESSDSC', 'yesno', 'int', 19)");
+ $dbm->insert('config', " VALUES (54, 0, 2, 'reg_dispdsclmr', '_MD_AM_DSPDSCLMR', 1, '_MD_AM_DSPDSCLMRDSC', 'yesno', 'int', 30)");
+ $dbm->insert('config', " VALUES (55, 0, 2, 'reg_disclaimer', '_MD_AM_REGDSCLMR', '".addslashes(_INSTALL_DISCLMR)."', '_MD_AM_REGDSCLMRDSC', 'textarea', 'text', 32)");
+ $dbm->insert('config', " VALUES (56, 0, 2, 'allow_register', '_MD_AM_ALLOWREG', 1, '_MD_AM_ALLOWREGDSC', 'yesno', 'int', 0)");
+ $dbm->insert('config', " VALUES (57, 0, 1, 'theme_fromfile', '_MD_AM_THEMEFILE', '0', '_MD_AM_THEMEFILEDSC', 'yesno', 'int', 13)");
+ $dbm->insert('config', " VALUES (58, 0, 1, 'closesite', '_MD_AM_CLOSESITE', '0', '_MD_AM_CLOSESITEDSC', 'yesno', 'int', 26)");
+ $dbm->insert('config', " VALUES (59, 0, 1, 'closesite_okgrp', '_MD_AM_CLOSESITEOK', '".addslashes(serialize(array('1')))."', '_MD_AM_CLOSESITEOKDSC', 'group_multi', 'array', 27)");
+ $dbm->insert('config', " VALUES (60, 0, 1, 'closesite_text', '_MD_AM_CLOSESITETXT', '"._INSTALL_L165."', '_MD_AM_CLOSESITETXTDSC', 'textarea', 'text', 28)");
+ $dbm->insert('config', " VALUES (61, 0, 1, 'sslpost_name', '_MD_AM_SSLPOST', 'xoops_ssl', '_MD_AM_SSLPOSTDSC', 'textbox', 'text', 31)");
+ $dbm->insert('config', " VALUES (62, 0, 1, 'module_cache', '_MD_AM_MODCACHE', '', '_MD_AM_MODCACHEDSC', 'module_cache', 'array', 50)");
+ $dbm->insert('config', " VALUES (63, 0, 1, 'template_set', '_MD_AM_DTPLSET', 'default', '_MD_AM_DTPLSETDSC', 'tplset', 'other', 14)");
+
+ $dbm->insert('config', " VALUES (64,0,6,'mailmethod','_MD_AM_MAILERMETHOD','mail','_MD_AM_MAILERMETHODDESC','select','text',4)");
+ $dbm->insert('config', " VALUES (65,0,6,'smtphost','_MD_AM_SMTPHOST','a:1:{i:0;s:0:\"\";}', '_MD_AM_SMTPHOSTDESC','textarea','array',6)");
+ $dbm->insert('config', " VALUES (66,0,6,'smtpuser','_MD_AM_SMTPUSER','','_MD_AM_SMTPUSERDESC','textbox','text',7)");
+ $dbm->insert('config', " VALUES (67,0,6,'smtppass','_MD_AM_SMTPPASS','','_MD_AM_SMTPPASSDESC','password','text',8)");
+ $dbm->insert('config', " VALUES (68,0,6,'sendmailpath','_MD_AM_SENDMAILPATH','/usr/sbin/sendmail','_MD_AM_SENDMAILPATHDESC','textbox','text',5)");
+ $dbm->insert('config', " VALUES (69,0,6,'from','_MD_AM_MAILFROM','','_MD_AM_MAILFROMDESC','textbox','text', 1)");
+ $dbm->insert('config', " VALUES (70,0,6,'fromname','_MD_AM_MAILFROMNAME','','_MD_AM_MAILFROMNAMEDESC','textbox','text',2)");
+ $dbm->insert('config', " VALUES (71, 0, 1, 'sslloginlink', '_MD_AM_SSLLINK', 'https://', '_MD_AM_SSLLINKDSC', 'textbox', 'text', 33)");
+ $dbm->insert('config', " VALUES (72, 0, 1, 'theme_set_allowed', '_MD_AM_THEMEOK', '".serialize(array('default'))."', '_MD_AM_THEMEOKDSC', 'theme_multi', 'array', 13)");
+ // RMV-NOTIFY... Need to specify which user is sender of notification PM
+ $dbm->insert('config', " VALUES (73,0,6,'fromuid','_MD_AM_MAILFROMUID','1','_MD_AM_MAILFROMUIDDESC','user','int',3)");
+
+ // install modules
+ installModule($dbm, 1, "system", _MI_SYSTEM_NAME, $language, $gruops);
+
+ installModule($dbm, 2, "base", _MI_BASE_NAME, $language, $gruops, true);
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 2, 1, 'module_admin')");
+
+ installModule($dbm, 3, "legacyRender", _MI_LEGACYRENDER_NAME, $language, $gruops, true);
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 3, 1, 'module_admin')");
+
+ installModule($dbm, 4, "user", _MI_USER_NAME, $language, $gruops, true);
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 4, 1, 'module_admin')");
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 4, 1, 'module_read')");
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", 4, 1, 'module_read')");
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ANONYMOUS'].", 4, 1, 'module_read')");
+
+ installModule($dbm, 5, "pm", _MI_PM_NAME, $language, $gruops, true);
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 5, 1, 'module_admin')");
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 5, 1, 'module_read')");
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_USERS'].", 5, 1, 'module_read')");
+
+ installModule($dbm, 6, "stdCache", _MI_STDCACHE_NAME, $language, $gruops, true);
+ $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", 6, 1, 'module_admin')");
+
+ // data for table 'users'
+
+ $temp = md5($adminpass);
+ $regdate = time();
+ //$dbadminname= addslashes($adminname);
+ // RMV-NOTIFY (updated for extra columns in user table)
+ $dbm->insert('users', " VALUES (1,'','".addslashes($adminname)."','".addslashes($adminmail)."','".XOOPS_URL."/','blank.gif','".$regdate."','','','',1,'','','','','".$temp."',0,0,7,5,'default','".$time_diff."',".time().",'thread',0,1,0,'','','',0)");
+
+
+ // data for table 'block_module_link'
+
+ $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)");
+ }
+ }
+
+ return $gruops;
+}
+
+/**
+ *
+ * Install module by module's name, language and specified mid.
+ *
+ * @param $dbm object Database manager instance
+ * @param $mid int module's ID
+ * @param $module string module's name
+ * @param $language string language
+ * @param $grops array hash map
+ */
+function installModule(&$dbm, $mid, $module, $module_name, $language = 'english', &$groups) {
+ if ( file_exists("../modules/${module}/language/${language}/modinfo.php") ) {
+ include "../modules/${module}/language/${language}/modinfo.php";
+ } else {
+ include "../modules/${module}/language/english/modinfo.php";
+ $language = 'english';
+ }
+
+ $modversion = array();
+ require_once "../modules/${module}/xoops_version.php";
+ $time = time();
+
+ // RMV-NOTIFY (updated for extra column in table)
+ //
+ // TODO We should set hasconfig and more option values here.
+ //
+ $hasconfig = isset($modversion['config']) ? 1 : 0;
+ $hasmain = 0;
+ if (isset($modversion['hasMain']) && $modversion['hasMain'] == 1) {
+ $hasmain = 1;
+ }
+ $dbm->insert("modules", " VALUES (${mid}, '" . constant($module_name) . "', 100, ".$time.", 0, 1, '${module}', ${hasmain}, 1, 0, ${hasconfig}, 0, 0)");
+
+ //
+ // Database
+ // TODO Dependence on mysql, Now.
+ //
+ if (isset($modversion['sqlfile']['mysql'])) {
+ $dbm->queryFromFile("../modules/${module}/" . $modversion['sqlfile']['mysql']);
+ }
+
+ if (is_array($modversion['templates']) && count($modversion['templates']) > 0) {
+ foreach ($modversion['templates'] as $tplfile) {
+ if ($fp = fopen("../modules/${module}/templates/".$tplfile['file'], 'r')) {
+ $newtplid = $dbm->insert('tplfile', " VALUES (0, ${mid}, '${module}', 'default', '".addslashes($tplfile['file'])."', '".addslashes($tplfile['description'])."', ".$time.", ".$time.", 'module')");
+ //$newtplid = $xoopsDB->getInsertId();
+ if (filesize("../modules/${module}/templates/".$tplfile['file']) > 0) {
+ $tplsource = fread($fp, filesize("../modules/${module}/templates/".$tplfile['file']));
+ }
+ else {
+ $tplsource = "";
+ }
+ fclose($fp);
+ $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (".$newtplid.", '".addslashes($tplsource)."')");
+ }
+ }
+ }
+
+ if (is_array($modversion['blocks']) && count($modversion['blocks']) > 0) {
+ foreach ($modversion['blocks'] as $func_num => $newblock) {
+ if ($fp = fopen("../modules/${module}/templates/blocks/".$newblock['template'], 'r')) {
+ //
+ // The following checking is dependence on the structure of system module.
+ //
+ if (in_array($newblock['template'], array('system_block_user.html', 'system_block_login.html', 'system_block_mainmenu.html'))) {
+ $visible = 1;
+ } else {
+ $visible = 0;
+ }
+ $options = !isset($newblock['options']) ? '' : trim($newblock['options']);
+ $edit_func = !isset($newblock['edit_func']) ? '' : trim($newblock['edit_func']);
+ $newbid = $dbm->insert('newblocks', " VALUES (0, ${mid}, ".$func_num.", '".addslashes($options)."', '".addslashes($newblock['name'])."', '".addslashes($newblock['name'])."', '', 0, 0, ".$visible.", 'S', 'H', 1, '${module}', '".addslashes($newblock['file'])."', '".addslashes($newblock['show_func'])."', '".addslashes($edit_func)."', '".addslashes($newblock['template'])."', 0, ".$time.")");
+ //$newbid = $xoopsDB->getInsertId();
+ $newtplid = $dbm->insert('tplfile', " VALUES (0, ".$newbid.", '${module}', 'default', '".addslashes($newblock['template'])."', '".addslashes($newblock['description'])."', ".$time.", ".$time.", 'block')");
+ //$newtplid = $xoopsDB->getInsertId();
+ if (filesize("../modules/${module}/templates/blocks/".$newblock['template']) > 0) {
+ $tplsource = fread($fp, filesize("../modules/${module}/templates/blocks/".$newblock['template']));
+ }
+ else {
+ $tplsource = "";
+ }
+ fclose($fp);
+ $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (".$newtplid.", '".addslashes($tplsource)."')");
+
+ $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_ADMIN'].", ".$newbid.", 1, 'block_read')");
+ //$dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 'xoops_blockadmiin')");
+ $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_USERS'].", ".$newbid.", 1, 'block_read')");
+ $dbm->insert("group_permission", " VALUES (0, ".$groups['XOOPS_GROUP_ANONYMOUS'].", ".$newbid.", 1, 'block_read')");
+ }
+ }
+ }
+
+ //
+ // Install preferences
+ //
+ if (isset($modversion['config'])) {
+ $count = 0;
+ foreach ($modversion['config'] as $configInfo) {
+ //
+ // TODO We have to sanitize.
+ //
+ $name = $configInfo['name'];
+ $title = $configInfo['title'];
+ $desc = $configInfo['description'];
+ $formtype = $configInfo['formtype'];
+ $valuetype = $configInfo['valuetype'];
+ $default = $configInfo['default'];
+
+ if ($valuetype == "array") {
+ $default = serialize(explode('|', trim($default)));
+ }
+
+ $conf_id = $dbm->insert("config", " VALUES (0, ${mid}, 0, '${name}', '${title}', '${default}', '${desc}', '${formtype}', '${valuetype}', ${count})");
+
+ if (isset($configInfo['options']) && is_array($configInfo['options'])) {
+ foreach ($configInfo['options'] as $key => $value) {
+ $dbm->insert("configoption", " VALUES (0, '${key}', '${value}', ${conf_id})");
+ }
+ }
+
+ $count++;
+ }
+ }
+}
+
+?>
From nobunobu @ users.sourceforge.jp Tue Mar 7 22:11:40 2006
From: nobunobu @ users.sourceforge.jp (NobuNobu)
Date: Tue, 7 Mar 2006 22:11:40 +0900
Subject: [xoops-cvslog 2377] CVS update: xoops2jp/html/install/templates
Message-ID: <20060307131140.43B312AC037@users.sourceforge.jp>
Index: xoops2jp/html/install/templates/install_checkDB.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_checkDB.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_checkDB.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,10 @@
+
+
+v('checks') as $check) { ?>
+
+
+ |
+
+v('msgs') as $msg) { ?>
+
+
Index: xoops2jp/html/install/templates/install_createTables.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_createTables.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_createTables.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,6 @@
+
+v('reports') as $report) { ?>
+
+
+ |
+e('message')?>
Index: xoops2jp/html/install/templates/install_dbsave.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_dbsave.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_dbsave.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,8 @@
+
+
+v('reports') as $report) { ?>
+
+
+ |
+
+e('message')?>
Index: xoops2jp/html/install/templates/install_finish.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_finish.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_finish.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,3 @@
+
Index: xoops2jp/html/install/templates/install_initial.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_initial.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_initial.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,13 @@
+
Index: xoops2jp/html/install/templates/install_insertData.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_insertData.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_insertData.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,15 @@
+
+v('dbm_reports') as $report) { ?>
+
+
+ |
+
+v('cm_reports') as $report) { ?>
+
+
+ |
+
+v('mm_reports') as $report) { ?>
+
+
+ |
Index: xoops2jp/html/install/templates/install_langselect.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_langselect.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_langselect.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,6 @@
+
+
Index: xoops2jp/html/install/templates/install_mainfile.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_mainfile.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_mainfile.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,13 @@
+
+
+v('checks') as $check) { ?>
+
+
+
+ |
+
+
+
Index: xoops2jp/html/install/templates/install_modcheck.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_modcheck.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_modcheck.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,6 @@
+
+v('checks') as $check) { ?>
+
+
+ |
+e('message') ?>
Index: xoops2jp/html/install/templates/install_siteInit.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_siteInit.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_siteInit.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,7 @@
+
Index: xoops2jp/html/install/templates/install_start.tpl.php
diff -u /dev/null xoops2jp/html/install/templates/install_start.tpl.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/templates/install_start.tpl.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,3 @@
+
From nobunobu @ users.sourceforge.jp Tue Mar 7 22:11:40 2006
From: nobunobu @ users.sourceforge.jp (NobuNobu)
Date: Tue, 7 Mar 2006 22:11:40 +0900
Subject: [xoops-cvslog 2378] CVS update: xoops2jp/html/install/widzards
Message-ID: <20060307131140.8ED572AC037@users.sourceforge.jp>
Index: xoops2jp/html/install/widzards/install_checkDB.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_checkDB.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_checkDB.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,32 @@
+isConnectable()) {
+ $widzard->addArray('checks',_NGIMG._INSTALL_L106);
+ $widzard->addArray('msgs',_INSTALL_L107);
+ $widzard->setBack(array('start', _INSTALL_L103));
+ $widzard->setReload(true);
+ } else {
+ $widzard->addArray('checks',_OKIMG._INSTALL_L108);
+ if (! $dbm->dbExists()) {
+ $widzard->addArray('checks',_NGIMG.sprintf(_INSTALL_L109, XOOPS_DB_NAME));
+ $widzard->addArray('msgs',_INSTALL_L21.' '.XOOPS_DB_NAME.'');
+ $widzard->addArray('msgs',_INSTALL_L22);
+ } else {
+ $widzard->addArray('checks',_OKIMG.sprintf(_INSTALL_L110, XOOPS_DB_NAME));
+ if (!$dbm->tableExists('users')) {
+ $widzard->addArray('msgs',_INSTALL_L111);
+ $widzard->setNext(array('createTables', _INSTALL_L40));
+ } else if (!$dbm->tableExists('config')) {
+ $widzard->addArray('msgs',_INSTALL_L130);
+ $widzard->setNext(array('updateTables', _INSTALL_L14));
+ } else {
+ $widzard->addArray('checks',_NGIMG._INSTALL_L131);
+ $widzard->setNext('');
+ }
+ }
+ }
+ $widzard->render('install_checkDB.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_createDB.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_createDB.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_createDB.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,13 @@
+createDB()){
+ $widzard->setContent(''._INSTALL_L31.' ');
+ $widzard->setNext(array('checkDB', _INSTALL_L104));
+ $widzard->setBack(array('start', _INSTALL_L103));
+ } else {
+ $widzard->setContent(''.sprintf(_INSTALL_L43, XOOPS_DB_NAME).' ');
+ }
+ $widzard->render();
+?>
Index: xoops2jp/html/install/widzards/install_createTables.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_createTables.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_createTables.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,16 @@
+queryFromFile('./sql/'.XOOPS_DB_TYPE.'.structure.sql');
+ $widzard->assign('reports',$dbm->report());
+ if(! $result ){
+ $widzard->assign('message',_INSTALL_L114);
+ $widzard->setBack(array('start', _INSTALL_L103));
+ }else{
+ $widzard->assign('message',_INSTALL_L115);
+ }
+ $widzard->render('install_createTables.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_dbconfirm.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_dbconfirm.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_dbconfirm.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,14 @@
+checkData();
+ if (!empty($content)) {
+ $widzard->setTitle(_INSTALL_L93);
+ $widzard->setContent($content . $sm->editform());
+ $widzard->setNext(array('dbconfirm',_INSTALL_L91));
+ } else {
+ $widzard->setContent($sm->confirmForm());
+ }
+ $widzard->render();
+?>
Index: xoops2jp/html/install/widzards/install_dbform.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_dbform.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_dbform.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,8 @@
+readConstant();
+ $widzard->setContent($sm->editform());
+ $widzard->render();
+?>
Index: xoops2jp/html/install/widzards/install_dbsave.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_dbsave.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_dbsave.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,42 @@
+copyDistFile();
+ if(! $ret){
+ $widzard->setContent(_INSTALL_L60);
+ $widzard->error();
+ exit();
+ }
+
+ $mm->setRewrite('XOOPS_ROOT_PATH', $myts->stripSlashesGPC($_POST['root_path']));
+ $mm->setRewrite('XOOPS_URL', $myts->stripSlashesGPC($_POST['xoops_url']));
+ $mm->setRewrite('XOOPS_DB_TYPE', $myts->stripSlashesGPC($_POST['database']));
+ $mm->setRewrite('XOOPS_DB_PREFIX', $myts->stripSlashesGPC($_POST['prefix']));
+ $mm->setRewrite('XOOPS_DB_HOST', $myts->stripSlashesGPC($_POST['dbhost']));
+ $mm->setRewrite('XOOPS_DB_USER', $myts->stripSlashesGPC($_POST['dbuname']));
+ $mm->setRewrite('XOOPS_DB_PASS', $myts->stripSlashesGPC($_POST['dbpass']));
+ $mm->setRewrite('XOOPS_DB_NAME', $myts->stripSlashesGPC($_POST['dbname']));
+ $mm->setRewrite('XOOPS_DB_PCONNECT', intval($_POST['db_pconnect']));
+ $mm->setRewrite('XOOPS_GROUP_ADMIN', 1);
+ $mm->setRewrite('XOOPS_GROUP_USERS', 2);
+ $mm->setRewrite('XOOPS_GROUP_ANONYMOUS', 3);
+
+ // Check if XOOPS_CHECK_PATH should be initially set or not
+ $xoopsPathTrans = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_FILENAME'];
+ if ( DIRECTORY_SEPARATOR != '/' ) {
+ // IIS6 doubles the \ chars
+ $xoopsPathTrans = str_replace( strpos( $xoopsPathTrans, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsPathTrans);
+ }
+ $mm->setRewrite('XOOPS_CHECK_PATH', strcasecmp( substr($xoopsPathTrans, 0, strlen(XOOPS_ROOT_PATH)), $_POST['root_path']) ? 0 : 1 );
+
+ $ret = $mm->doRewrite();
+ if(! $ret){
+ $widzard->setContent(_INSTALL_L60);
+ $widzard->error();
+ exit();
+ }
+ $widzard->assign('reports', $mm->report());
+ $widzard->assign('message',_INSTALL_L62);
+ $widzard->render('install_dbsave.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_finish.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_finish.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_finish.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,5 @@
+assign('finish', $content);
+ $widzard->render('install_finish.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_initial.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_initial.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_initial.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,5 @@
+render('install_initial.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_insertData.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_insertData.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_insertData.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,58 @@
+stripSlashesGPC(trim($_POST['adminname']));
+ $adminpass = $myts->stripSlashesGPC($_POST['adminpass']);
+ $adminmail = $myts->stripSlashesGPC(trim($_POST['adminmail']));
+
+ if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i",$adminmail)) {
+ $widzard->setContent(''._INSTALL_L73.' ');
+ $widzard->setBack(array('', _INSTALL_L112));
+ $widzard->error();
+ exit();
+ }
+ if ( !isset($adminname) || !isset($adminpass) || !isset($adminmail) || $adminmail == "" || $adminname =="" || $adminpass =="" || $adminpass != $adminpass2) {
+ $widzard->setContent(''._INSTALL_L41.' ');
+ $widzard->setBack(array('', _INSTALL_L112));
+ $widzard->error();
+ exit();
+ }
+
+ include_once '../mainfile.php';
+ include_once './include/makedata.php';
+ include_once './class/dbmanager.php';
+ $dbm = new db_manager;
+ include_once './class/cachemanager.php';
+ $cm = new cache_manager;
+
+ $language = check_language($language);
+ if ( file_exists('./language/'.$language.'/install2.php') ) {
+ include_once './language/'.$language.'/install2.php';
+ } elseif ( file_exists('./language/english/install2.php') ) {
+ include_once './language/english/install2.php';
+ $language = 'english';
+ } else {
+ echo 'no language file (install2.php).';
+ exit();
+ }
+
+ //$tables = array();
+ $result = $dbm->queryFromFile('./sql/'.XOOPS_DB_TYPE.'.data.sql');
+
+ $result = $dbm->queryFromFile('./language/'.$language.'/'.XOOPS_DB_TYPE.'.lang.data.sql');
+
+ $group = make_groups($dbm);
+ $result = make_data($dbm, $cm, $adminname, $adminpass, $adminmail, $language, $group);
+
+ $widzard->assign('dbm_reports',$dbm->report());
+ $widzard->assign('cm_reports',$cm->report());
+
+ include_once './class/mainfilemanager.php';
+ $mm = new mainfile_manager('../mainfile.php');
+ foreach($group as $key => $val){
+ $mm->setRewrite($key, intval($val));
+ }
+ $result = $mm->doRewrite();
+ $widzard->assign('mm_reports',$mm->report());
+
+ setcookie('xoops_session', '', time() - 3600);
+ $widzard->render('install_insertData.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_langselect.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_langselect.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_langselect.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,15 @@
+addArray('languages', $lang);
+ if (strtolower($lang) == $language) {
+ $widzard->addArray('selected','selected="selected"');
+ } else {
+ $widzard->addArray('selected','');
+ }
+ }
+ $widzard->render('install_langselect.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_mainfile.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_mainfile.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_mainfile.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,30 @@
+addArray('checks', _NGIMG._INSTALL_L95);
+ } elseif ( XOOPS_ROOT_PATH != $detected ) {
+ $widzard->addArray('checks', _NGIMG.sprintf(_INSTALL_L96,$detected));
+ } else {
+ $widzard->addArray('checks', _OKIMG._INSTALL_L97);
+ }
+
+ if(!is_dir(XOOPS_ROOT_PATH)){
+ $widzard->addArray('checks', _NGIMG._INSTALL_L99);
+ }
+
+ if(preg_match('/^http[s]?:\/\/(.*)[^\/]+$/i',XOOPS_URL)){
+ $widzard->addArray('checks', _OKIMG._INSTALL_L100);
+ }else{
+ $widzard->addArray('checks', _NGIMG._INSTALL_L101);
+ }
+
+ $widzard->render('install_mainfile.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_modcheck.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_modcheck.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_modcheck.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,33 @@
+addArray('checks',_NGIMG.sprintf(_INSTALL_L83, $wok));
+ $error = true;
+ }else{
+ $widzard->addArray('checks',_OKIMG.sprintf(_INSTALL_L84, $wok));
+ }
+ }
+ } else {
+ @chmod('../'.$wok, 0777);
+ if (! is_writeable('../'.$wok)) {
+ $widzard->addArray('checks',_NGIMG.sprintf(_INSTALL_L85, $wok));
+ $error = true;
+ }else{
+ $widzard->addArray('checks',_OKIMG.sprintf(_INSTALL_L86, $wok));
+ }
+ }
+ }
+
+ if(! $error) {
+ $widzard->assign('message',_INSTALL_L87);
+ }else{
+ $widzard->assign('message',_INSTALL_L46);
+ $widzard->setReload(true);
+ }
+ $widzard->render('install_modcheck.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_siteInit.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_siteInit.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_siteInit.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,4 @@
+render('install_siteInit.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_start.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_start.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_start.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,5 @@
+assign('welcome', $content);
+ $widzard->render('install_start.tpl.php');
+?>
Index: xoops2jp/html/install/widzards/install_updateAvatars.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateAvatars.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateAvatars.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,5 @@
+'._INSTALL_L151.'';
+ $b_next = array('updateAvatars_go', _INSTALL_L139);
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateAvatars_go.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateAvatars_go.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateAvatars_go.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,57 @@
+query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='blank.gif'");
+ $avt_handler =& xoops_gethandler('avatar');
+ if (!defined('XOOPS_UPLOAD_PATH')) {
+ define('XOOPS_UPLOAD_PATH', '../uploads');
+ }
+ foreach ($avatars as $avatar_file) {
+ if (preg_match("/^([0-9]+)\.([a-zA-Z]+)$/", $avatar_file, $matched)) {
+ $user_id = intval($matched[1]);
+ if ($user_id > 0 && false != $fp = fopen('../images/avatar/users/'.$avatar_file, 'rb')) {
+ $binary = fread($fp, filesize('../images/avatar/users/'.$avatar_file));
+ fclose($fp);
+ $newavatar = uniqid('cavt').'.'.strtolower($matched[2]);
+ if (false != $fp = fopen(XOOPS_UPLOAD_PATH.'/'.$newavatar, 'wb')) {
+ if (-1 != fwrite($fp, $binary)) {
+ $error = false;
+ if (!$xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='".$newavatar."' WHERE uid=".$user_id)) {
+ $error = true;
+ } else {
+ $avatar =& $avt_handler->create();
+ $avatar->setVar('avatar_file', $newavatar);
+ $avatar->setVar('avatar_name', 'custom');
+ $avatar->setVar('avatar_mimetype', '');
+ $avatar->setVar('avatar_display', 1);
+ $avatar->setVar('avatar_type', 'C');
+ if(!$avt_handler->insert($avatar)) {
+ $error = true;
+ } else {
+ $avt_handler->addUser($avatar->getVar('avatar_id'), $user['uid']);
+ }
+ }
+ if (false != $error) {
+ $content .= _NGIMG.sprintf(_INSTALL_L153, $avatar_file).' ';
+ @unlink(XOOPS_UPLOAD_PATH.'/'.$newavatar);
+ } else {
+ $content .= _OKIMG.sprintf(_INSTALL_L154, $avatar_file).' ';
+ }
+ } else {
+ $content .= _NGIMG.sprintf(_INSTALL_L153, $avatar_file).' ';
+ $xoopsDB->query("UPDATE ".$xoopsDB->prefix('users')." SET user_avatar='blank.gif' WHERE uid=".$user_id);
+ }
+ fclose($fp);
+ }
+ } else {
+ $content .= _NGIMG.sprintf(_INSTALL_L152, $avatar_file).' ';
+ }
+ }
+ }
+
+ $b_next = array('finish', _INSTALL_L14);
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateComments.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateComments.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateComments.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,5 @@
+"._INSTALL_L149."\n";
+ $b_next = array('updateComments_go', _INSTALL_L138);
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateComments_go.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateComments_go.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateComments_go.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,47 @@
+ 'comments', 'xoopspoll' => 'xoopspollcomments');
+ $title = _INSTALL_L147;
+ $content = '';
+ foreach ($old_commentd_mods as $module => $com_table) {
+ $moduleobj =& $module_handler->getByDirname($module);
+ if (is_object($moduleobj)) {
+ $content .= ''.$moduleobj->getVar('name').'';
+ $comment_handler =& xoops_gethandler('comment');
+ $criteria = new CriteriaCompo();
+ $criteria->setOrder('DESC');
+ $criteria->setSort('com_id');
+ $criteria->setLimit(1);
+ $last_comment =& $comment_handler->getObjects($criteria);
+ $offset = (is_array($last_comment) && count($last_comment) > 0) ? $last_comment[0]->getVar('com_id') : 0;
+ $xc = new XoopsComments($xoopsDB->prefix($com_table));
+ $top_comments =& $xc->getAllComments(array('pid=0'));
+
+ foreach ($top_comments as $tc) {
+ $sql = sprintf("INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_ip, com_sig, com_itemid, com_rootid, com_status, dohtml, dosmiley, doxcode, doimage, dobr) VALUES (%u, %u, %u, '%s', '%s', '%s', %u, %u, %u, '%s', %u, %u, %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix('xoopscomments'), $tc->getVar('comment_id') + $offset, 0, $moduleobj->getVar('mid'), '', addslashes($tc->getVar('subject', 'n')), addslashes($tc->getVar('comment', 'n')), $tc->getVar('date'), $tc->getVar('date'), $tc->getVar('user_id'), $tc->getVar('ip'), 0, $tc->getVar('item_id'), $tc->getVar('comment_id') + $offset, XOOPS_COMMENT_ACTIVE, 0, 1, 1, 1, 1);
+
+ if (!$xoopsDB->query($sql)) {
+ $content .= _NGIMG.sprintf(_INSTALL_L146, $tc->getVar('comment_id') + $offset).' ';
+ } else {
+ $content .= _OKIMG.sprintf(_INSTALL_L145, $tc->getVar('comment_id') + $offset).' ';
+ $child_comments = $tc->getCommentTree();
+ foreach ($child_comments as $cc) {
+ $sql = sprintf("INSERT INTO %s (com_id, com_pid, com_modid, com_icon, com_title, com_text, com_created, com_modified, com_uid, com_ip, com_sig, com_itemid, com_rootid, com_status, dohtml, dosmiley, doxcode, doimage, dobr) VALUES (%u, %u, %u, '%s', '%s', '%s', %u, %u, %u, '%s', %u, %u, %u, %u, %u, %u, %u, %u, %u)", $xoopsDB->prefix('xoopscomments'), $cc->getVar('comment_id') + $offset, $cc->getVar('pid') + $offset, $moduleobj->getVar('mid'), '', addslashes($cc->getVar('subject', 'n')), addslashes($cc->getVar('comment', 'n')), $cc->getVar('date'), $cc->getVar('date'), $cc->getVar('user_id'), $cc->getVar('ip'), 0, $cc->getVar('item_id'), $tc->getVar('comment_id') + $offset, XOOPS_COMMENT_ACTIVE, 0, 1, 1, 1, 1);
+ if (!$xoopsDB->query($sql)) {
+ $content .= _NGIMG.sprintf(_INSTALL_L146, $cc->getVar('comment_id') + $offset).' ';
+ } else {
+ $content .= _OKIMG.sprintf(_INSTALL_L145, $cc->getVar('comment_id') + $offset).' ';
+ }
+ }
+ }
+ }
+ }
+ }
+ $xoopsDB->query('ALTER TABLE '.$xoopsDB->prefix('xoopscomments').' CHANGE com_id com_id mediumint(8) unsigned NOT NULL auto_increment PRIMARY KEY');
+ $b_next = array('updateSmilies', _INSTALL_L14);
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateConfig.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateConfig.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateConfig.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,5 @@
+"._INSTALL_L143."\n";
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateConfig_go.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateConfig_go.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateConfig_go.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,168 @@
+insert('config', " VALUES (1, 0, 1, 'sitename', '_MD_AM_SITENAME', '".addslashes($xoopsConfig['sitename'])."', '_MD_AM_SITENAMEDSC', 'textbox', 'text', 0)");
+ $dbm->insert('config', " VALUES (2, 0, 1, 'slogan', '_MD_AM_SLOGAN', '".addslashes($xoopsConfig['slogan'])."', '_MD_AM_SLOGANDSC', 'textbox', 'text', 2)");
+ $dbm->insert('config', " VALUES (3, 0, 1, 'language', '_MD_AM_LANGUAGE', '".$xoopsConfig['language']."', '_MD_AM_LANGUAGEDSC', 'language', 'other', 4)");
+ $dbm->insert('config', " VALUES (4, 0, 1, 'startpage', '_MD_AM_STARTPAGE', '--', '_MD_AM_STARTPAGEDSC', 'startpage', 'other', 6)");
+ $dbm->insert('config', " VALUES (5, 0, 1, 'server_TZ', '_MD_AM_SERVERTZ', '".addslashes($xoopsConfig['server_TZ'])."', '_MD_AM_SERVERTZDSC', 'timezone', 'float', 8)");
+ $dbm->insert('config', " VALUES (6, 0, 1, 'default_TZ', '_MD_AM_DEFAULTTZ', '".addslashes($xoopsConfig['default_TZ'])."', '_MD_AM_DEFAULTTZDSC', 'timezone', 'float', 10)");
+ $dbm->insert('config', " VALUES (7, 0, 1, 'theme_set', '_MD_AM_DTHEME', 'default', '_MD_AM_DTHEMEDSC', 'theme', 'other', 12)");
+ $dbm->insert('config', " VALUES (8, 0, 1, 'anonymous', '_MD_AM_ANONNAME', '".addslashes($xoopsConfig['anonymous'])."', '_MD_AM_ANONNAMEDSC', 'textbox', 'text', 15)");
+ $dbm->insert('config', " VALUES (9, 0, 1, 'gzip_compression', '_MD_AM_USEGZIP', '".intval($xoopsConfig['gzip_compression'])."', '_MD_AM_USEGZIPDSC', 'yesno', 'int', 16)");
+ $dbm->insert('config', " VALUES (10, 0, 1, 'usercookie', '_MD_AM_USERCOOKIE', '".addslashes($xoopsConfig['usercookie'])."', '_MD_AM_USERCOOKIEDSC', 'textbox', 'text', 18)");
+ $dbm->insert('config', " VALUES (11, 0, 1, 'session_expire', '_MD_AM_SESSEXPIRE', '15', '_MD_AM_SESSEXPIREDSC', 'textbox', 'int', 22)");
+ $dbm->insert('config', " VALUES (12, 0, 1, 'banners', '_MD_AM_BANNERS', '".intval($xoopsConfig['banners'])."', '_MD_AM_BANNERSDSC', 'yesno', 'int', 26)");
+ $dbm->insert('config', " VALUES (13, 0, 1, 'debug_mode', '_MD_AM_DEBUGMODE', '1', '_MD_AM_DEBUGMODEDSC', 'select', 'int', 24)");
+ $dbm->insert('config', " VALUES (14, 0, 1, 'my_ip', '_MD_AM_MYIP', '".addslashes($xoopsConfig['my_ip'])."', '_MD_AM_MYIPDSC', 'textbox', 'text', 29)");
+ $dbm->insert('config', " VALUES (15, 0, 1, 'use_ssl', '_MD_AM_USESSL', '0', '_MD_AM_USESSLDSC', 'yesno', 'int', 30)");
+ $dbm->insert('config', " VALUES (16, 0, 1, 'session_name', '_MD_AM_SESSNAME', 'xoops_session', '_MD_AM_SESSNAMEDSC', 'textbox', 'text', 20)");
+ $dbm->insert('config', " VALUES (17, 0, 2, 'minpass', '_MD_AM_MINPASS', '".intval($xoopsConfig['minpass'])."', '_MD_AM_MINPASSDSC', 'textbox', 'int', 1)");
+ $dbm->insert('config', " VALUES (18, 0, 2, 'minuname', '_MD_AM_MINUNAME', '5', '_MD_AM_MINUNAMEDSC', 'textbox', 'int', 2)");
+ $dbm->insert('config', " VALUES (19, 0, 2, 'new_user_notify', '_MD_AM_NEWUNOTIFY', '".intval($xoopsConfig['new_user_notify'])."', '_MD_AM_NEWUNOTIFYDSC', 'yesno', 'int', 4)");
+ $dbm->insert('config', " VALUES (20, 0, 2, 'new_user_notify_group', '_MD_AM_NOTIFYTO', ".intval($xoopsConfig['new_user_notify_group']).", '_MD_AM_NOTIFYTODSC', 'group', 'int', 6)");
+ $dbm->insert('config', " VALUES (21, 0, 2, 'activation_type', '_MD_AM_ACTVTYPE', '0', '_MD_AM_ACTVTYPEDSC', 'select', 'int', 8)");
+ $dbm->insert('config', " VALUES (22, 0, 2, 'activation_group', '_MD_AM_ACTVGROUP', ".XOOPS_GROUP_ADMIN.", '_MD_AM_ACTVGROUPDSC', 'group', 'int', 10)");
+ $dbm->insert('config', " VALUES (23, 0, 2, 'uname_test_level', '_MD_AM_UNAMELVL', '".intval($xoopsConfig['uname_test_level'])."', '_MD_AM_UNAMELVLDSC', 'select', 'int', 12)");
+ $dbm->insert('config', " VALUES (24, 0, 2, 'avatar_allow_upload', '_MD_AM_AVATARALLOW', '".intval($xoopsConfig['avatar_allow_upload'])."', '_MD_AM_AVATARALWDSC', 'yesno', 'int', 14)");
+ $dbm->insert('config', " VALUES (27, 0, 2, 'avatar_width', '_MD_AM_AVATARW', '".intval($xoopsConfig['avatar_width'])."', '_MD_AM_AVATARWDSC', 'textbox', 'int', 16)");
+ $dbm->insert('config', " VALUES (28, 0, 2, 'avatar_height', '_MD_AM_AVATARH', '".intval($xoopsConfig['avatar_height'])."', '_MD_AM_AVATARHDSC', 'textbox', 'int', 18)");
+ $dbm->insert('config', " VALUES (29, 0, 2, 'avatar_maxsize', '_MD_AM_AVATARMAX', '".intval($xoopsConfig['avatar_maxsize'])."', '_MD_AM_AVATARMAXDSC', 'textbox', 'int', 20)");
+ $dbm->insert('config', " VALUES (30, 0, 1, 'adminmail', '_MD_AM_ADMINML', '".addslashes($xoopsConfig['adminmail'])."', '_MD_AM_ADMINMLDSC', 'textbox', 'text', 3)");
+ $dbm->insert('config', " VALUES (31, 0, 2, 'self_delete', '_MD_AM_SELFDELETE', '".intval($xoopsConfig['self_delete'])."', '_MD_AM_SELFDELETEDSC', 'yesno', 'int', 22)");
+ $dbm->insert('config', " VALUES (32, 0, 1, 'com_mode', '_MD_AM_COMMODE', '".addslashes($xoopsConfig['com_mode'])."', '_MD_AM_COMMODEDSC', 'select', 'text', 34)");
+ $dbm->insert('config', " VALUES (33, 0, 1, 'com_order', '_MD_AM_COMORDER', '".intval($xoopsConfig['com_order'])."', '_MD_AM_COMORDERDSC', 'select', 'int', 36)");
+ $dbm->insert('config', " VALUES (34, 0, 2, 'bad_unames', '_MD_AM_BADUNAMES', '".addslashes(serialize(array('webmaster', '^xoops', '^admin')))."', '_MD_AM_BADUNAMESDSC', 'textarea', 'array', 24)");
+ $dbm->insert('config', " VALUES (35, 0, 2, 'bad_emails', '_MD_AM_BADEMAILS', '".addslashes(serialize(array('xoops.org$')))."', '_MD_AM_BADEMAILSDSC', 'textarea', 'array', 26)");
+ $dbm->insert('config', " VALUES (36, 0, 2, 'maxuname', '_MD_AM_MAXUNAME', '10', '_MD_AM_MAXUNAMEDSC', 'textbox', 'int', 3)");
+ $dbm->insert('config', " VALUES (37, 0, 1, 'bad_ips', '_MD_AM_BADIPS', '".addslashes(serialize(array('127.0.0.1')))."', '_MD_AM_BADIPSDSC', 'textarea', 'array', 42)");
+ $dbm->insert('config', " VALUES (38, 0, 3, 'meta_keywords', '_MD_AM_METAKEY', 'news, technology, headlines, xoops, xoop, nuke, myphpnuke, myphp-nuke, phpnuke, SE, geek, geeks, hacker, hackers, linux, software, download, downloads, free, community, mp3, forum, forums, bulletin, board, boards, bbs, php, survey, poll, polls, kernel, comment, comments, portal, odp, open, source, opensource, FreeSoftware, gnu, gpl, license, Unix, *nix, mysql, sql, database, databases, web site, weblog, guru, module, modules, theme, themes, cms, content management', '_MD_AM_METAKEYDSC', 'textarea', 'text', 0)");
+ $dbm->insert('config', " VALUES (39, 0, 3, 'footer', '_MD_AM_FOOTER', 'Powered by XOOPS 2.0 © 2001-2003 The XOOPS Project', '_MD_AM_FOOTERDSC', 'textarea', 'text', 20)");
+ $dbm->insert('config', " VALUES (40, 0, 4, 'censor_enable', '_MD_AM_DOCENSOR', '0', '_MD_AM_DOCENSORDSC', 'yesno', 'int', 0)");
+ $dbm->insert('config', " VALUES (41, 0, 4, 'censor_words', '_MD_AM_CENSORWRD', '".addslashes(serialize(array('fuck', 'shit')))."', '_MD_AM_CENSORWRDDSC', 'textarea', 'array', 1)");
+ $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '#OOPS#', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)");
+ $dbm->insert('config', " VALUES (43, 0, 3, 'meta_robots', '_MD_AM_METAROBOTS', 'index,follow', '_MD_AM_METAROBOTSDSC', 'select', 'text', 2)");
+ $dbm->insert('config', " VALUES (44, 0, 5, 'enable_search', '_MD_AM_DOSEARCH', '1', '_MD_AM_DOSEARCHDSC', 'yesno', 'int', 0)");
+ $dbm->insert('config', " VALUES (45, 0, 5, 'keyword_min', '_MD_AM_MINSEARCH', '5', '_MD_AM_MINSEARCHDSC', 'textbox', 'int', 1)");
+ $dbm->insert('config', " VALUES (46, 0, 2, 'avatar_minposts', '_MD_AM_AVATARMP', '0', '_MD_AM_AVATARMPDSC', 'textbox', 'int', 15)");
+ $dbm->insert('config', " VALUES (47, 0, 1, 'enable_badips', '_MD_AM_DOBADIPS', '0', '_MD_AM_DOBADIPSDSC', 'yesno', 'int', 40)");
+ $dbm->insert('config', " VALUES (48, 0, 3, 'meta_rating', '_MD_AM_METARATING', 'general', '_MD_AM_METARATINGDSC', 'select', 'text', 4)");
+ $dbm->insert('config', " VALUES (49, 0, 3, 'meta_author', '_MD_AM_METAAUTHOR', 'XOOPS', '_MD_AM_METAAUTHORDSC', 'textbox', 'text', 6)");
+ $dbm->insert('config', " VALUES (50, 0, 3, 'meta_copyright', '_MD_AM_METACOPYR', 'Copyright © 2001-2003', '_MD_AM_METACOPYRDSC', 'textbox', 'text', 8)");
+ $dbm->insert('config', " VALUES (51, 0, 3, 'meta_description', '_MD_AM_METADESC', 'XOOPS is a dynamic Object Oriented based open source portal script written in PHP.', '_MD_AM_METADESCDSC', 'textarea', 'text', 1)");
+ $dbm->insert('config', " VALUES (52, 0, 2, 'allow_chgmail', '_MD_AM_ALLWCHGMAIL', '0', '_MD_AM_ALLWCHGMAILDSC', 'yesno', 'int', 3)");
+ $dbm->insert('config', " VALUES (53, 0, 1, 'use_mysession', '_MD_AM_USEMYSESS', '0', '_MD_AM_USEMYSESSDSC', 'yesno', 'int', 19)");
+ $dbm->insert('config', " VALUES (54, 0, 2, 'reg_dispdsclmr', '_MD_AM_DSPDSCLMR', 1, '_MD_AM_DSPDSCLMRDSC', 'yesno', 'int', 30)");
+ $dbm->insert('config', " VALUES (55, 0, 2, 'reg_disclaimer', '_MD_AM_REGDSCLMR', '".addslashes(_INSTALL_DISCLMR)."', '_MD_AM_REGDSCLMRDSC', 'textarea', 'text', 32)");
+ $dbm->insert('config', " VALUES (56, 0, 2, 'allow_register', '_MD_AM_ALLOWREG', 1, '_MD_AM_ALLOWREGDSC', 'yesno', 'int', 0)");
+ $dbm->insert('config', " VALUES (57, 0, 1, 'theme_fromfile', '_MD_AM_THEMEFILE', '0', '_MD_AM_THEMEFILEDSC', 'yesno', 'int', 13)");
+ $dbm->insert('config', " VALUES (58, 0, 1, 'closesite', '_MD_AM_CLOSESITE', '0', '_MD_AM_CLOSESITEDSC', 'yesno', 'int', 26)");
+ $dbm->insert('config', " VALUES (59, 0, 1, 'closesite_okgrp', '_MD_AM_CLOSESITEOK', '".addslashes(serialize(array('1')))."', '_MD_AM_CLOSESITEOKDSC', 'group_multi', 'array', 27)");
+ $dbm->insert('config', " VALUES (60, 0, 1, 'closesite_text', '_MD_AM_CLOSESITETXT', '"._INSTALL_L165."', '_MD_AM_CLOSESITETXTDSC', 'textarea', 'text', 28)");
+ $dbm->insert('config', " VALUES (61, 0, 1, 'sslpost_name', '_MD_AM_SSLPOST', 'xoops_ssl', '_MD_AM_SSLPOSTDSC', 'textbox', 'text', 31)");
+ $dbm->insert('config', " VALUES (62, 0, 1, 'module_cache', '_MD_AM_MODCACHE', '', '_MD_AM_MODCACHEDSC', 'module_cache', 'array', 50)");
+ $dbm->insert('config', " VALUES (63, 0, 1, 'template_set', '_MD_AM_DTPLSET', 'default', '_MD_AM_DTPLSETDSC', 'tplset', 'other', 14)");
+ $dbm->insert('config', " VALUES (64,0,6,'mailmethod','_MD_AM_MAILERMETHOD','mail','_MD_AM_MAILERMETHODDESC','select','text',4)");
+ $dbm->insert('config', " VALUES (65,0,6,'smtphost','_MD_AM_SMTPHOST','a:1:{i:0;s:0:\"\";}', '_MD_AM_SMTPHOSTDESC','textarea','array',6)");
+ $dbm->insert('config', " VALUES (66,0,6,'smtpuser','_MD_AM_SMTPUSER','','_MD_AM_SMTPUSERDESC','textbox','text',7)");
+ $dbm->insert('config', " VALUES (67,0,6,'smtppass','_MD_AM_SMTPPASS','','_MD_AM_SMTPPASSDESC','password','text',8)");
+ $dbm->insert('config', " VALUES (68,0,6,'sendmailpath','_MD_AM_SENDMAILPATH','/usr/sbin/sendmail','_MD_AM_SENDMAILPATHDESC','textbox','text',5)");
+ $dbm->insert('config', " VALUES (69,0,6,'from','_MD_AM_MAILFROM','','_MD_AM_MAILFROMDESC','textbox','text',1)");
+ $dbm->insert('config', " VALUES (70,0,6,'fromname','_MD_AM_MAILFROMNAME','','_MD_AM_MAILFROMNAMEDESC','textbox','text',2)");
+ $dbm->insert('config', " VALUES (71, 0, 1, 'sslloginlink', '_MD_AM_SSLLINK', 'https://', '_MD_AM_SSLLINKDSC', 'textbox', 'text', 33)");
+ $dbm->insert('config', " VALUES (72, 0, 1, 'theme_set_allowed', '_MD_AM_THEMEOK', '".serialize(array('default'))."', '_MD_AM_THEMEOKDSC', 'theme_multi', 'array', 13)");
+ $dbm->insert('config', " VALUES (73,0,6,'fromuid','_MD_AM_MAILFROMUID','1','_MD_AM_MAILFROMUIDDESC','user','int',3)");
+
+
+ // default the default theme
+
+ $time = time();
+ $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Default Theme', '', ".$time.")");
+
+// include_once './class/cachemanager.php';
+// $cm = new cache_manager;
+// $skinfiles = array('1' => 'skin.html', '2' => 'style.css'
+// , '3' => 'styleNN.css','4' => 'styleMAC.css'
+// , '5' => 'skin_blockleft.html', '6' => 'skin_blockright.html'
+// , '7' => 'skin_blockcenter_l.html', '8' => 'skin_blockcenter_c.html'
+// , '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';
+?>
Index: xoops2jp/html/install/widzards/install_updateModules.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateModules.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateModules.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,5 @@
+"._INSTALL_L141."\n";
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateModules_go.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateModules_go.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateModules_go.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,248 @@
+getObjects(null, true);
+ foreach (array_keys($modules) as $mid) {
+ echo ''.$modules[$mid]->getVar('name').'';
+ $dirname = $modules[$mid]->getVar('dirname');
+ if (is_dir(XOOPS_ROOT_PATH.'/modules/'.$dirname)) {
+ $modules[$mid]->loadInfoAsVar($dirname, false);
+ if (!$module_handler->insert($modules[$mid])) {
+ echo 'Could not update '.$modules[$mid]->getVar('name').' ';
+ } else {
+ $newmid = $modules[$mid]->getVar('mid');
+ $msgs = array();
+ $msgs[] = 'Module data updated.';
+ $tplfile_handler =& xoops_gethandler('tplfile');
+ $templates = $modules[$mid]->getInfo('templates');
+ if ($templates != false) {
+ $msgs[] = 'Generating templates...';
+ foreach ($templates as $tpl) {
+ $tpl['file'] = trim($tpl['file']);
+ $tpldata =& xoops_module_gettemplate($dirname, $tpl['file']);
+ $tplfile =& $tplfile_handler->create();
+ $tplfile->setVar('tpl_refid', $newmid);
+ $tplfile->setVar('tpl_lastimported', 0);
+ $tplfile->setVar('tpl_lastmodified', time());
+ if (preg_match("/\.css$/i", $tpl['file'])) {
+ $tplfile->setVar('tpl_type', 'css');
+ } else {
+ $tplfile->setVar('tpl_type', 'module');
+ //if ($xoopsConfig['default_theme'] == 'default') {
+ // include_once XOOPS_ROOT_PATH.'/class/template.php';
+ // xoops_template_touch($tplfile->getVar('tpl_id'));
+ //}
+ }
+ $tplfile->setVar('tpl_source', $tpldata, true);
+ $tplfile->setVar('tpl_module', $dirname);
+ $tplfile->setVar('tpl_tplset', 'default');
+ $tplfile->setVar('tpl_file', $tpl['file'], true);
+ $tplfile->setVar('tpl_desc', $tpl['description'], true);
+ if (!$tplfile_handler->insert($tplfile)) {
+ $msgs[] = ' ERROR: Could not insert template '.$tpl['file'].' to the database.';
+ } else {
+ $msgs[] = ' Template '.$tpl['file'].' inserted to the database.';
+ }
+ unset($tpldata);
+ }
+ }
+ $blocks = $modules[$mid]->getInfo('blocks');
+ $msgs[] = 'Rebuilding blocks...';
+ $showfuncs = array();
+ $funcfiles = array();
+ if ($blocks != false) {
+ $count = count($blocks);
+ include_once(XOOPS_ROOT_PATH.'/class/xoopsblock.php');
+ for ( $i = 1; $i <= $count; $i++ ) {
+ if (isset($blocks[$i]['show_func']) && $blocks[$i]['show_func'] != '' && isset($blocks[$i]['file']) && $blocks[$i]['file'] != '') {
+ $editfunc = isset($blocks[$i]['edit_func']) ? $blocks[$i]['edit_func'] : '';
+ $showfuncs[] = $blocks[$i]['show_func'];
+ $funcfiles[] = $blocks[$i]['file'];
+ $template = '';
+ if ((isset($blocks[$i]['template']) && trim($blocks[$i]['template']) != '')) {
+ $content =& xoops_module_gettemplate($dirname, $blocks[$i]['template'], true);
+ $template = $blocks[$i]['template'];
+ }
+ if (!$content) {
+ $content = '';
+ }
+ $options = '';
+ if (isset($blocks[$i]['options']) && $blocks[$i]['options'] != '') {
+ $options = $blocks[$i]['options'];
+ }
+ $sql = "SELECT bid, name FROM ".$xoopsDB->prefix('newblocks')." WHERE mid=".$mid." AND func_num=".$i;
+ $fresult = $xoopsDB->query($sql);
+ $fcount = 0;
+ while ($fblock = $xoopsDB->fetchArray($fresult)) {
+ $fcount++;
+ $sql = "UPDATE ".$xoopsDB->prefix("newblocks")." SET name='".addslashes($blocks[$i]['name'])."', title='".addslashes($blocks[$i]['name'])."', dirname='".addslashes($dirname)."', func_file='".addslashes($blocks[$i]['file'])."', show_func='".addslashes($blocks[$i]['show_func'])."', template='".addslashes($template)."', edit_func='".addslashes($editfunc)."', options='".addslashes($options)."', content='', template='".$template."', last_modified=".time()." WHERE bid=".$fblock['bid'];
+ $result = $xoopsDB->query($sql);
+ if (!$result) {
+ $msgs[] = ' ERROR: Could not update '.$fblock['name'];
+ } else {
+ $msgs[] = ' Block '.$fblock['name'].' updated. Block ID: '.$fblock['bid'].'';
+ if ($template != '') {
+ $tplfile =& $tplfile_handler->create();
+ $tplfile->setVar('tpl_refid', $fblock['bid']);
+ $tplfile->setVar('tpl_source', $content, true);
+ $tplfile->setVar('tpl_tplset', 'default');
+ $tplfile->setVar('tpl_file', $blocks[$i]['template']);
+ $tplfile->setVar('tpl_module', $dirname);
+ $tplfile->setVar('tpl_type', 'block');
+ $tplfile->setVar('tpl_desc', $blocks[$i]['description'], true);
+ $tplfile->setVar('tpl_lastimported', 0);
+ $tplfile->setVar('tpl_lastmodified', time());
+ if (!$tplfile_handler->insert($tplfile)) {
+ $msgs[] = ' ERROR: Could not insert template '.$blocks[$i]['template'].' to the database.';
+ } else {
+ $msgs[] = ' Template '.$blocks[$i]['template'].' inserted to the database.';
+ //if ($xoopsConfig['default_theme'] == 'default') {
+ // if (!xoops_template_touch($tplfile[0]->getVar('tpl_id'))) {
+ // $msgs[] = ' ERROR: Could not recompile template '.$blocks[$i]['template'].'.';
+ // } else {
+ // $msgs[] = ' Template '.$blocks[$i]['template'].' recompiled.';
+ // }
+ //}
+ }
+ }
+ }
+ }
+ if ($fcount == 0) {
+ $newbid = $xoopsDB->genId($xoopsDB->prefix('newblocks').'_bid_seq');
+ $block_name = addslashes($blocks[$i]['name']);
+ $sql = "INSERT INTO ".$xoopsDB->prefix("newblocks")." (bid, mid, func_num, options, name, title, content, side, weight, visible, block_type, isactive, dirname, func_file, show_func, edit_func, template, last_modified) VALUES (".$newbid.", ".$mid.", ".$i.",'".addslashes($options)."','".$block_name."', '".$block_name."', '', 0, 0, 0, 'M', 1, '".addslashes($dirname)."', '".addslashes($blocks[$i]['file'])."', '".addslashes($blocks[$i]['show_func'])."', '".addslashes($editfunc)."', '".$template."', ".time().")";
+ $result = $xoopsDB->query($sql);
+ if (!$result) {
+ $msgs[] = ' ERROR: Could not create '.$blocks[$i]['name'];
+ } else {
+ if (empty($newbid)) {
+ $newbid = $xoopsDB->getInsertId();
+ }
+ if ($template != '') {
+ $tplfile =& $tplfile_handler->create();
+ $tplfile->setVar('tpl_module', $dirname);
+ $tplfile->setVar('tpl_refid', $newbid);
+ $tplfile->setVar('tpl_source', $content, true);
+ $tplfile->setVar('tpl_tplset', 'default');
+ $tplfile->setVar('tpl_file', $blocks[$i]['template'], true);
+ $tplfile->setVar('tpl_type', 'block');
+ $tplfile->setVar('tpl_lastimported', 0);
+ $tplfile->setVar('tpl_lastmodified', time());
+ $tplfile->setVar('tpl_desc', $blocks[$i]['description'], true);
+ if (!$tplfile_handler->insert($tplfile)) {
+ $msgs[] = ' ERROR: Could not insert template '.$blocks[$i]['template'].' to the database.';
+ } else {
+ $msgs[] = ' Template '.$blocks[$i]['template'].' inserted to the database.';
+ }
+ }
+ $msgs[] = ' Block '.$blocks[$i]['name'].' created. Block ID: '.$newbid.'';
+ }
+ }
+ }
+ }
+ }
+ $block_arr = XoopsBlock::getByModule($mid);
+ foreach ($block_arr as $block) {
+ if (!in_array($block->getVar('show_func'), $showfuncs) || !in_array($block->getVar('func_file'), $funcfiles)) {
+ $sql = sprintf("DELETE FROM %s WHERE bid = %u", $xoopsDB->prefix('newblocks'), $block->getVar('bid'));
+ if(!$xoopsDB->query($sql)) {
+ $msgs[] = ' ERROR: Could not delete block '.$block->getVar('name').'. Block ID: '.$block->getVar('bid').'';
+ } else {
+ $msgs[] = ' Block '.$block->getVar('name').' deleted. Block ID: '.$block->getVar('bid').'';
+ }
+ }
+ }
+
+ $configs = $modules[$mid]->getInfo('config');
+ if ($configs != false) {
+ if ($modules[$mid]->getVar('hascomments') != 0) {
+ include_once(XOOPS_ROOT_PATH.'/include/comment_constants.php');
+ array_push($configs, array('name' => 'com_rule', 'title' => '_CM_COMRULES', 'description' => '', 'formtype' => 'select', 'valuetype' => 'int', 'default' => 1, 'options' => array('_CM_COMAPPROVEALL' => XOOPS_COMMENT_APPROVEALL, '_CM_COMAPPROVEUSER' => XOOPS_COMMENT_APPROVEUSER, '_CM_COMAPPROVEADMIN' => XOOPS_COMMENT_APPROVEADMIN)));
+ array_push($configs, array('name' => 'com_anonpost', 'title' => '_CM_COMANONPOST', 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0));
+ }
+ } else {
+ if ($modules[$mid]->getVar('hascomments') != 0) {
+ $configs = array();
+ include_once(XOOPS_ROOT_PATH.'/include/comment_constants.php');
+ $configs[] = array('name' => 'com_rule', 'title' => '_CM_COMRULES', 'description' => '', 'formtype' => 'select', 'valuetype' => 'int', 'default' => 1, 'options' => array('_CM_COMAPPROVEALL' => XOOPS_COMMENT_APPROVEALL, '_CM_COMAPPROVEUSER' => XOOPS_COMMENT_APPROVEUSER, '_CM_COMAPPROVEADMIN' => XOOPS_COMMENT_APPROVEADMIN));
+ array_push($configs, array('name' => 'com_anonpost', 'title' => '_CM_COMANONPOST', 'description' => '', 'formtype' => 'yesno', 'valuetype' => 'int', 'default' => 0));
+ }
+ }
+ // RMV-NOTIFY
+ if ($modules[$mid]->getVar('hasnotification') != 0) {
+ if (empty($configs)) {
+ $configs = array();
+ }
+ include_once(XOOPS_ROOT_PATH.'/include/notification_constants.php');
+ $configs[] = array ('name' => 'notification_enabled', 'title' => '_NOT_CONFIG_ENABLED', 'description' => '_NOT_CONFIG_ENABLEDDSC', 'formtype' => 'select', 'valuetype' => 'int', 'default' => XOOPS_NOTIFICATION_ENABLEBOTH, 'options' => $options);
+ }
+
+ if ($configs != false) {
+ $msgs[] = 'Adding module config data...';
+ $config_handler =& xoops_gethandler('config');
+ $order = 0;
+ foreach ($configs as $config) {
+ $confobj =& $config_handler->createConfig();
+ $confobj->setVar('conf_modid', $newmid);
+ $confobj->setVar('conf_catid', 0);
+ $confobj->setVar('conf_name', $config['name']);
+ $confobj->setVar('conf_title', $config['title'], true);
+ $confobj->setVar('conf_desc', $config['description'], true);
+ $confobj->setVar('conf_formtype', $config['formtype']);
+ $confobj->setVar('conf_valuetype', $config['valuetype']);
+ $confobj->setVar('conf_value', $config['default'], true);
+ $confobj->setVar('conf_order', $order);
+ $confop_msgs = '';
+ if (isset($config['options']) && is_array($config['options'])) {
+ foreach ($config['options'] as $key => $value) {
+ $confop =& $config_handler->createConfigOption();
+ $confop->setVar('confop_name', $key, true);
+ $confop->setVar('confop_value', $value, true);
+ $confobj->setConfOptions($confop);
+ $confop_msgs .= ' Config option added. Name: '.$key.' Value: '.$value.'';
+ unset($confop);
+ }
+ }
+ $order++;
+ if ($config_handler->insertConfig($confobj) != false) {
+ $msgs[] = ' Config '.$config['name'].' added to the database.'.$confop_msgs;
+ } else {
+ $msgs[] = ' ERROR: Could not insert config '.$config['name'].' to the database.';
+ }
+ unset($confobj);
+ }
+ unset($configs);
+ }
+ foreach ($msgs as $msg) {
+ echo ''.$msg.' ';
+ }
+ }
+ // 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 ' ';
+ flush();
+ sleep(1);
+ }
+ $title = _INSTALL_L142;
+ $content = "\n";
+ $content .= ob_get_contents();
+ $content .= " | \n";
+ ob_end_clean();
+ $b_next = array('updateComments', _INSTALL_L14);
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateSmilies.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateSmilies.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateSmilies.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,5 @@
+'._INSTALL_L150.'';
+ $b_next = array('updateSmilies_go', _INSTALL_L140);
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateSmilies_go.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateSmilies_go.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateSmilies_go.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,55 @@
+query("SELECT * FROM ".$xoopsDB->prefix('smiles'));
+ $content = '';
+ $title = _INSTALL_L155;
+ if (!defined('XOOPS_UPLOAD_PATH')) {
+ define('XOOPS_UPLOAD_PATH', '../uploads');
+ }
+ while ($smiley = $xoopsDB->fetchArray($result)) {
+ if (file_exists('../images/smilies/'.$smiley['smile_url']) && false != $fp = fopen('../images/smilies/'.$smiley['smile_url'], 'rb')) {
+ $binary = fread($fp, filesize('../images/smilies/'.$smiley['smile_url']));
+ fclose($fp);
+ if (!preg_match("/\.([a-zA-Z0-9]+)$/", $smiley['smile_url'], $matched)) {
+ continue;
+ }
+ $newsmiley = uniqid('smil').'.'.strtolower($matched[1]);
+ if (false != $fp = fopen(XOOPS_UPLOAD_PATH.'/'.$newsmiley, 'wb')) {
+ if (-1 != fwrite($fp, $binary)) {
+ $xoopsDB->query("UPDATE ".$xoopsDB->prefix('smiles')." SET smile_url='".$newsmiley."' WHERE id=".$smiley['id']);
+ $content .= _OKIMG.sprintf(_INSTALL_L154, $smiley['smile_url']).' ';
+ } else {
+ $content .= _NGIMG.sprintf(_INSTALL_L153, $smiley['smile_url']).' ';
+ }
+ fclose($fp);
+ }
+ } else {
+ $content .= _OKIMG.sprintf(_INSTALL_L152, $smiley['smile_url']).' ';
+ }
+ }
+ $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix('ranks'));
+ while ($rank = $xoopsDB->fetchArray($result)) {
+ if (file_exists('../images/ranks/'.$rank['rank_image']) && false != $fp = fopen('../images/ranks/'.$rank['rank_image'], 'rb')) {
+ $binary = fread($fp, filesize('../images/ranks/'.$rank['rank_image']));
+ fclose($fp);
+ if (!preg_match("/\.([a-zA-Z0-9]+)$/", $rank['rank_image'], $matched)) {
+ continue;
+ }
+ $newrank = uniqid('rank').'.'.strtolower($matched[1]);
+ if (false != $fp = fopen(XOOPS_UPLOAD_PATH.'/'.$newrank, 'wb')) {
+ if (-1 != fwrite($fp, $binary)) {
+ $content .= _OKIMG.sprintf(_INSTALL_L154, $rank['rank_image']).' ';
+ $xoopsDB->query("UPDATE ".$xoopsDB->prefix('ranks')." SET rank_image='".$newrank."' WHERE rank_id=".$rank['rank_id']);
+ } else {
+ $content .= _NGIMG.sprintf(_INSTALL_L153, $rank['rank_image']).' ';
+ }
+ fclose($fp);
+ }
+ } else {
+ $content .= _OKIMG.sprintf(_INSTALL_L152, $rank['rank_image']).' ';
+ }
+ }
+ $b_next = array('updateAvatars', _INSTALL_L14);
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateTables.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateTables.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateTables.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,22 @@
+prefix('groups');
+ $result = $db->query($sql);
+ $content = ''._INSTALL_L157.'';
+ $content .= '';
+ $b_back = array();
+ $b_next = array('updateTables_go', _INSTALL_L132);
+ include 'install_tpl.php';
+?>
Index: xoops2jp/html/install/widzards/install_updateTables_go.inc.php
diff -u /dev/null xoops2jp/html/install/widzards/install_updateTables_go.inc.php:1.1.2.1
--- /dev/null Tue Mar 7 22:11:40 2006
+++ xoops2jp/html/install/widzards/install_updateTables_go.inc.php Tue Mar 7 22:11:40 2006
@@ -0,0 +1,44 @@
+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 .= ""._INSTALL_L135." \n";
+ $b_back = array();
+ } else {
+ $content .= ""._INSTALL_L136." \n";
+ $b_next = array('updateConfig', _INSTALL_L14);
+ }
+ include 'install_tpl.php';
+?>
From minahito @ users.sourceforge.jp Wed Mar 8 16:50:45 2006
From: minahito @ users.sourceforge.jp (Minahito)
Date: Wed, 8 Mar 2006 16:50:45 +0900
Subject: [xoops-cvslog 2379] CVS update: xoops2jp/html/modules/user/class
Message-ID: <20060308075045.BA5882AC0BD@users.sourceforge.jp>
Index: xoops2jp/html/modules/user/class/avatar_user_link.php
diff -u /dev/null xoops2jp/html/modules/user/class/avatar_user_link.php:1.1.2.1
--- /dev/null Wed Mar 8 16:50:45 2006
+++ xoops2jp/html/modules/user/class/avatar_user_link.php Wed Mar 8 16:50:45 2006
@@ -0,0 +1,38 @@
+initVar('avatar_id', XOBJ_DTYPE_INT, '0', true);
+ $this->initVar('user_id', XOBJ_DTYPE_INT, '0', true);
+ }
+}
+
+class UserAvatar_user_linkHandler extends XoopsObjectGenericHandler
+{
+ var $mTable = "avatar_user_link";
+ var $mPrimary = "";
+ var $mClass = "UserAvatar_user_linkObject";
+
+ function &get($id)
+ {
+ $ret = null;
+ return $ret;
+ }
+
+ function _update(&$obj)
+ {
+ return $this->_insert($obj);
+ }
+
+ function delete(&$obj, $force=false)
+ {
+ $id = $this->db->quoteString($obj->get('avatar_id'));
+ $sql = "DELETE FROM " . $this->mTable . " WHERE avatar_id=" . $obj->get('avatar_id') . " AND user_id=" . $obj->get('user_id');
+
+ return $force ? $this->db->queryF($sql) : $this->db->query($sql);
+ }
+}
+
+?>
From minahito @ users.sourceforge.jp Wed Mar 8 16:52:45 2006
From: minahito @ users.sourceforge.jp (Minahito)
Date: Wed, 8 Mar 2006 16:52:45 +0900
Subject: [xoops-cvslog 2380] CVS update: xoops2jp/html/modules/user/actions
Message-ID: <20060308075245.78E022AC0AC@users.sourceforge.jp>
Index: xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php
diff -u xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.1 xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.2
--- xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.1 Thu Jan 26 20:09:58 2006
+++ xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php Wed Mar 8 16:52:45 2006
@@ -66,6 +66,34 @@
return false;
}
+ function _doExecute()
+ {
+ if ($this->mObjectHandler->insert($this->mObject)) {
+
+ //
+ // Delete all of links about this user from avatar_user_link.
+ //
+ $linkHandler =& xoops_getmodulehandler('avatar_user_link');
+ $criteria =& new Criteria('user_id', $this->mObject->get('uid'));
+ $linkHandler->deleteAll($criteria);
+
+ //
+ // Insert new link.
+ //
+ $avatarHandler =& xoops_getmodulehandler('avatar');
+ $criteria =& new Criteria('avatar_file', $this->mObject->get('user_avatar'));
+ $avatarArr =& $avatarHandler->getObjects($criteria);
+ if (is_array($avatarArr) && is_object($avatarArr[0])) {
+ $link =& $linkHandler->create();
+ $link->set('avatar_id', $avatarArr[0]->get('avatar_id'));
+ $link->set('user_id', $this->mObject->get('uid'));
+ $linkHandler->insert($link);
+ }
+
+ return true;
+ }
+ }
+
/**
* This action always kicks out GET request.
*/
From minahito @ users.sourceforge.jp Wed Mar 8 19:19:20 2006
From: minahito @ users.sourceforge.jp (Minahito)
Date: Wed, 8 Mar 2006 19:19:20 +0900
Subject: [xoops-cvslog 2381] CVS update: xoops2jp/html/modules/user/actions
Message-ID: <20060308101920.C18CB2AC014@users.sourceforge.jp>
Index: xoops2jp/html/modules/user/actions/AvatarEditAction.class.php
diff -u xoops2jp/html/modules/user/actions/AvatarEditAction.class.php:1.1.2.2 xoops2jp/html/modules/user/actions/AvatarEditAction.class.php:1.1.2.3
--- xoops2jp/html/modules/user/actions/AvatarEditAction.class.php:1.1.2.2 Sat Jan 28 03:33:54 2006
+++ xoops2jp/html/modules/user/actions/AvatarEditAction.class.php Wed Mar 8 19:19:20 2006
@@ -153,10 +153,36 @@
}
if ($this->mActionForm->mOldAvatarFilename != null && $this->mActionForm->mOldAvatarFilename != "blank.gif") {
- @unlink(XOOPS_UPLOAD_PATH . "/" . $this->mActionForm->mOldAvatarFilename);
+ $avatarHandler =& xoops_getmodulehandler('avatar');
+ $criteria =& new Criteria('avatar_file', $this->mActionForm->mOldAvatarFilename);
+ $avatarArr =& $avatarHandler->getObjects($criteria);
+ if (count($avatarArr) > 0 && is_object($avatarArr[0]) && $avatarArr[0]->get('avatar_type') == 'C') {
+ $avatarHandler->delete($avatarArr[0]);
+ }
}
- return parent::_doExecute();
+ if (parent::_doExecute()) {
+ $avatar =& $this->mActionForm->createAvatar();
+ if ($avatar != null) {
+ $avatar->set('avatar_name', $this->mObject->get('uname'));
+ $avatarHandler =& xoops_getmodulehandler('avatar');
+ $avatarHandler->insert($avatar);
+
+ $linkHandler =& xoops_getmodulehandler('avatar_user_link');
+ $linkHandler->deleteAllByUser($this->mObject);
+
+ $link =& $linkHandler->create();
+ $link->set('user_id', $this->mObject->get('uid'));
+ $link->set('avatar_id', $avatar->get('avatar_id'));
+
+ $linkHandler->insert($link);
+ }
+
+ return true;
+ }
+ else {
+ return false;
+ }
}
function executeViewInput(&$controller,&$xoopsUser,&$render)
From minahito @ users.sourceforge.jp Wed Mar 8 19:20:22 2006
From: minahito @ users.sourceforge.jp (Minahito)
Date: Wed, 8 Mar 2006 19:20:22 +0900
Subject: [xoops-cvslog 2382] CVS update: xoops2jp/html/modules/user/actions
Message-ID: <20060308102022.9FD922AC014@users.sourceforge.jp>
Index: xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php
diff -u xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.2 xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.3
--- xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php:1.1.2.2 Wed Mar 8 16:52:45 2006
+++ xoops2jp/html/modules/user/actions/AvatarSelectAction.class.php Wed Mar 8 19:20:22 2006
@@ -9,6 +9,20 @@
*/
class User_AvatarSelectAction extends User_AbstractEditAction
{
+ var $mOldAvatar = null;
+
+ function prepare(&$controller, &$xoopsUser, &$moduleConfig)
+ {
+ parent::prepare($controller, $xoopsUser, $moduleConfig);
+
+ $handler =& xoops_getmodulehandler('avatar');
+ $criteria =& new Criteria('avatar_file', $xoopsUser->get('user_avatar'));
+ $avatarArr =& $handler->getObjects($criteria);
+ if (count($avatarArr) > 0) {
+ $this->mOldAvatar =& $avatarArr[0];
+ }
+ }
+
function _getId()
{
return isset($_REQUEST['uid']) ? intval($_REQUEST['uid']) : 0;
@@ -69,18 +83,24 @@
function _doExecute()
{
if ($this->mObjectHandler->insert($this->mObject)) {
+ $avatarHandler =& xoops_getmodulehandler('avatar');
+
+ //
+ // If old avatar is a cutom avatar, delete it.
+ //
+ if ($this->mOldAvatar != null && $this->mOldAvatar->get('avatar_type') == 'C') {
+ $avatarHandler->delete($this->mOldAvatar);
+ }
//
// Delete all of links about this user from avatar_user_link.
//
$linkHandler =& xoops_getmodulehandler('avatar_user_link');
- $criteria =& new Criteria('user_id', $this->mObject->get('uid'));
- $linkHandler->deleteAll($criteria);
+ $linkHandler->deleteAllByUser($this->mObject);
//
// Insert new link.
//
- $avatarHandler =& xoops_getmodulehandler('avatar');
$criteria =& new Criteria('avatar_file', $this->mObject->get('user_avatar'));
$avatarArr =& $avatarHandler->getObjects($criteria);
if (is_array($avatarArr) && is_object($avatarArr[0])) {
From minahito @ users.sourceforge.jp Wed Mar 8 19:21:28 2006
From: minahito @ users.sourceforge.jp (Minahito)
Date: Wed, 8 Mar 2006 19:21:28 +0900
Subject: [xoops-cvslog 2383] CVS update:
xoops2jp/html/modules/user/admin/actions
Message-ID: <20060308102128.E3A892AC063@users.sourceforge.jp>
Index: xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php
diff -u xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php:1.1.2.1 xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php:1.1.2.2
--- xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php:1.1.2.1 Thu Jan 19 21:05:35 2006
+++ xoops2jp/html/modules/user/admin/actions/AvatarDeleteAction.class.php Wed Mar 8 19:21:28 2006
@@ -22,6 +22,36 @@
$this->mActionForm->prepare();
}
+ function _doExecute()
+ {
+ $linkHandler =& xoops_getmodulehandler('avatar_user_link');
+ $criteria =& new Criteria('avatar_id', $this->mObject->get('avatar_id'));
+ $linkArr =& $linkHandler->getObjects($criteria);
+
+ if ($this->mObjectHandler->delete($this->mObject)) {
+ //
+ // Clear all user who set the avatar deleted with blank.gif
+ //
+ if (count($linkArr) > 0) {
+ $userHandler =& xoops_gethandler('user');
+ foreach ($linkArr as $link) {
+ $user =& $userHandler->get($link->get('user_id'));
+
+ if (is_object($user)) {
+ $user->set('user_avatar', 'blank.gif');
+ $userHandler->insert($user);
+ }
+ unset($user);
+ }
+ }
+
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
function executeViewInput(&$controller, &$xoopsUser, &$render)
{
$render->setTemplateName("avatar_delete.html");
From minahito @ users.sourceforge.jp Wed Mar 8 19:21:50 2006
From: minahito @ users.sourceforge.jp (Minahito)
Date: Wed, 8 Mar 2006 19:21:50 +0900
Subject: [xoops-cvslog 2384] CVS update:
xoops2jp/html/modules/user/admin/actions
Message-ID: <20060308102150.780B42AC014@users.sourceforge.jp>
Index: xoops2jp/html/modules/user/admin/actions/AvatarEditAction.class.php
diff -u xoops2jp/html/modules/user/admin/actions/AvatarEditAction.class.php:1.1.2.2 xoops2jp/html/modules/user/admin/actions/AvatarEditAction.class.php:1.1.2.3
--- xoops2jp/html/modules/user/admin/actions/AvatarEditAction.class.php:1.1.2.2 Thu Jan 26 20:11:18 2006
+++ xoops2jp/html/modules/user/admin/actions/AvatarEditAction.class.php Wed Mar 8 19:21:50 2006
@@ -29,10 +29,30 @@
if (!$this->mActionForm->mFormFile->saveAs(XOOPS_UPLOAD_PATH)) {
return false;
}
- }
-
- if ($this->mActionForm->mOldFileName != null && $this->mActionForm->mOldFileName != "blank.gif") {
+
+ if ($this->mActionForm->mOldFileName != null && $this->mActionForm->mOldFileName != "blank.gif") {
@unlink(XOOPS_UPLOAD_PATH . "/" . $this->mActionForm->mOldFileName);
+
+ //
+ // Change user_avatar of all users who are setting this avatar.
+ //
+ if (!$this->mObject->isNew()) {
+ $linkHandler =& xoops_getmodulehandler('avatar_user_link');
+ $criteria =& new Criteria('avatar_id', $this->mObject->get('avatar_id'));
+ $linkArr =& $linkHandler->getObjects($criteria);
+
+ $userHandler =& xoops_gethandler('user');
+ foreach ($linkArr as $link) {
+ $user =& $userHandler->get($link->get('user_id'));
+
+ if (is_object($user)) {
+ $user->set('user_avatar', $this->mObject->get('avatar_file'));
+ $userHandler->insert($user);
+ }
+ unset($user);
+ }
+ }
+ }
}
return parent::_doExecute();
From minahito @ users.sourceforge.jp Wed Mar 8 19:22:17 2006
From: minahito @ users.sourceforge.jp (Minahito)
Date: Wed, 8 Mar 2006 19:22:17 +0900
Subject: [xoops-cvslog 2385] CVS update:
xoops2jp/html/modules/user/admin/templates
Message-ID: <20060308102217.B618C2AC014@users.sourceforge.jp>
Index: xoops2jp/html/modules/user/admin/templates/avatar_delete.html
diff -u xoops2jp/html/modules/user/admin/templates/avatar_delete.html:1.1.2.2 xoops2jp/html/modules/user/admin/templates/avatar_delete.html:1.1.2.3
--- xoops2jp/html/modules/user/admin/templates/avatar_delete.html:1.1.2.2 Tue Jan 31 14:32:07 2006
+++ xoops2jp/html/modules/user/admin/templates/avatar_delete.html Wed Mar 8 19:22:17 2006
@@ -6,6 +6,8 @@
<{$smarty.const._AD_USER_LANG_AVATAR_DELETE}>
+<{$smarty.const._AD_USER_TIP_DELETE_AVATAR}>
+
- <{$smarty.const._AD_USER_MESSAGE_CONFIRM_DELETE}>
From minahito @ users.sourceforge.jp Wed Mar 8 19:23:15 2006
From: minahito @ users.sourceforge.jp (Minahito)
Date: Wed, 8 Mar 2006 19:23:15 +0900
Subject: [xoops-cvslog 2386] CVS update:
xoops2jp/html/modules/user/admin/templates
Message-ID: <20060308102315.B2F012AC014@users.sourceforge.jp>
Index: xoops2jp/html/modules/user/admin/templates/avatar_list.html
diff -u xoops2jp/html/modules/user/admin/templates/avatar_list.html:1.1.2.4 xoops2jp/html/modules/user/admin/templates/avatar_list.html:1.1.2.5
--- xoops2jp/html/modules/user/admin/templates/avatar_list.html:1.1.2.4 Tue Jan 31 15:44:42 2006
+++ xoops2jp/html/modules/user/admin/templates/avatar_list.html Wed Mar 8 19:23:15 2006
@@ -33,6 +33,7 @@
| <{$smarty.const._AD_USER_LANG_AVATAR_TYPE}>
" alt="<{$smarty.const._ASCENDING}>" />
" alt="<{$smarty.const._DESCENDING}>" /> |
+ <{$smarty.const._AD_USER_LANG_AVATAR_USING_COUNT}> |
<{$smarty.const._AD_USER_LANG_CONTROL}> |
<{foreach item=obj from=$objects}>
@@ -45,6 +46,7 @@