コード例 #1
0
 $handle = fopen('site.config.php', 'w');
 fwrite($handle, $config);
 fclose($handle);
 // do dbstuff
 try {
     $config = new config();
     loaddbclass($_POST['databasetype']);
     $database = new database($config, 'site.config.php');
     $database->connect();
     $queries = file_get_contents('kernel/sql/users.sql');
     $queries .= file_get_contents('kernel/sql/news.sql');
     $queries .= file_get_contents('kernel/sql/polls.sql');
     $queries .= file_get_contents('kernel/sql/basic.sql');
     $queries .= file_get_contents('kernel/sql/help.sql');
     // TODO
     $languages = languagesinstalled();
     foreach ($languages as $language) {
         echo $language;
         $lang = loadlang($language);
         $tmpquery = file_get_contents('kernel/sql/basicpages.sql');
         $tmpquery = ereg_replace('%language%', $language, $tmpquery);
         $tmpquery = ereg_replace('%shown_logout%', $lang->translate('logout'), $tmpquery);
         $tmpquery = ereg_replace('%shown_index%', $lang->translate('Home'), $tmpquery);
         $tmpquery = ereg_replace('%shown_registerform%', $lang->translate('Register'), $tmpquery);
         $tmpquery = ereg_replace('%shown_sendpasswordform%', $lang->translate('Lost Password'), $tmpquery);
         $tmpquery = ereg_replace('%shown_changeoptionsform%', $lang->translate('Edit Settings'), $tmpquery);
         $tmpquery = ereg_replace('%shown_viewuserlist%', $lang->translate('Userlist'), $tmpquery);
         $queries .= $tmpquery;
     }
     $queries = ereg_replace('%show_logout_in_nav%', Yes, $queries);
     $queries = ereg_replace('%show_index_in_nav%', Yes, $queries);
コード例 #2
0
function isinstalled()
{
    if (file_exists('site.config.php')) {
        if (count(databasesinstalled()) != 0) {
            if (count(languagesinstalled()) != 0) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    } else {
        return false;
    }
}
コード例 #3
0
 function replace_all($page)
 {
     //global $GLOBALS['lang'];
     $output = $page;
     $output = ereg_replace('%css', 'themes/' . $this->themedir . '/standard.css', $output);
     $output = ereg_replace('%databasetype.lang', $this->lang->translate('type'), $output);
     $output = ereg_replace('%databasehost.lang', $this->lang->translate('host'), $output);
     $output = ereg_replace('%databasename.lang', $this->lang->translate('name'), $output);
     $output = ereg_replace('%databasepassword.lang', $this->lang->translate('password'), $output);
     $output = ereg_replace('%installation.lang', $this->lang->translate('Install'), $output);
     $output = ereg_replace('%install.lang', $this->lang->translate('Install!!'), $output);
     $output = ereg_replace('%installscript.method', 'post', $output);
     $output = ereg_replace('%installscript.action', 'install.php', $output);
     $output = ereg_replace('%database.options', $this->options(databasesinstalled(), $this->database_option, $this->config->getConfigByNameType('general/databasetype', TYPE_STRING)), $output);
     $output = ereg_replace('%copyright.site.text', COPYRIGHT, $output);
     $output = ereg_replace('%copyright.site.link', 'about.php', $output);
     $output = ereg_replace('%copyright.theme.text', $this->copyright, $output);
     $output = ereg_replace('%copyright.theme.link', $this->themelink, $output);
     $output = ereg_replace('%navigation.lang', $this->lang->translate('Navigation'), $output);
     $output = ereg_replace('%register.lang', $this->lang->translate('Register'), $output);
     $output = ereg_replace('%register.error', $this->get(get_registererror, 'error'), $output);
     $output = ereg_replace('%email.formname', POST_EMAIL, $output);
     $output = ereg_replace('%password1.formname', POST_PASSWORD1, $output);
     $output = ereg_replace('%password2.formname', POST_PASSWORD2, $output);
     $output = ereg_replace('%user.formname', POST_NAME, $output);
     $output = ereg_replace('%databaseuser.lang', $this->lang->translate('usernmae'), $output);
     $output = ereg_replace('%sendpassword.lang', $this->lang->translate('Forgot your password?'), $output);
     $output = ereg_replace('%sendpassword.error', $this->get(get_sendpassworderror, 'error'), $output);
     $output = ereg_replace('%or.lang', $this->lang->translate('or'), $output);
     $output = ereg_replace('%sendpassword.action', sendpassword_action, $output);
     $output = ereg_replace('%sendpassword.method', form_method, $output);
     $output = ereg_replace('%username.lang', $this->lang->translate('username'), $output);
     $output = ereg_replace('%password1.lang', $this->lang->translate('password'), $output);
     $output = ereg_replace('%password2.lang', $this->lang->translate('repeat your password'), $output);
     $output = ereg_replace('%email.lang', $this->lang->translate('e-mail'), $output);
     $output = ereg_replace('%registerform.action', registerform_action, $output);
     $output = ereg_replace('%registerform.method', form_method, $output);
     $output = ereg_replace('%postnews.method', form_method, $output);
     $output = ereg_replace('%changeoptions.method', form_method, $output);
     $output = ereg_replace('%postnews.action', 'news.php?action=postnews', $output);
     $output = ereg_replace('%postcomment.method', form_method, $output);
     $output = ereg_replace('%postcomment.action', 'news.php?action=postcomment', $output);
     $output = ereg_replace('%on_news.value', $this->get('id_news', 'empty'), $output);
     $output = ereg_replace('%on_comment.value', $this->on_comment(), $output);
     $output = ereg_replace('%postnews.lang', $this->lang->translate('Post a news'), $output);
     $output = ereg_replace('%subject.lang', $this->lang->translate('Subject'), $output);
     $output = ereg_replace('%newsmessage.lang', $this->lang->translate('Message'), $output);
     $output = ereg_replace('%category.lang', $this->lang->translate('Category'), $output);
     $output = ereg_replace('%post.lang', $this->lang->translate('Post!!'), $output);
     $output = ereg_replace('%logout.lang', $this->lang->translate('Logout'), $output);
     $output = ereg_replace('%logout.link', 'users.php?action=logout', $output);
     $output = ereg_replace('%timezone.lang', $this->lang->translate('timezone'), $output);
     $output = ereg_replace('%timeformat.lang', $this->lang->translate('timeformat'), $output);
     $output = ereg_replace('%valueheadlines.lang', $this->lang->translate('Number of headlines visible'), $output);
     $output = ereg_replace('%headlines.lang', $this->lang->translate('Headlines'), $output);
     $output = ereg_replace('%comments_on_news.lang', $this->lang->translate('Comments on newsmessage'), $output);
     $output = ereg_replace('%postsonpage.lang', $this->lang->translate('Number of posts visible'), $output);
     $output = ereg_replace('%threaded.lang', $this->lang->translate('View comments threaded'), $output);
     $output = ereg_replace('%theme.lang', $this->lang->translate('theme'), $output);
     $output = ereg_replace('%language.lang', $this->lang->translate('language'), $output);
     $output = ereg_replace('%postcomment.lang', $this->lang->translate('Post a comment'), $output);
     $output = ereg_replace('%new_password1.lang', $this->lang->translate('Type a new password'), $output);
     $output = ereg_replace('%new_password2.lang', $this->lang->translate('Retype your new password'), $output);
     $output = ereg_replace('%poll.action', POLLS_VOTE_ACTION, $output);
     $output = ereg_replace('%poll.method', 'post', $output);
     $output = ereg_replace('%viewallpols.lang', $this->lang->translate('View all polls'), $output);
     $output = ereg_replace('%profile.lang', $this->lang->translate('Profile'), $output);
     $output = ereg_replace('%job.lang', $this->lang->translate('Job'), $output);
     $output = ereg_replace('%intrests.lang', $this->lang->translate('Intrests'), $output);
     $output = ereg_replace('%icq.lang', $this->lang->translate('ICQ'), $output);
     $output = ereg_replace('%aim.lang', $this->lang->translate('AIM'), $output);
     $output = ereg_replace('%yahoo.lang', $this->lang->translate('Yahoo'), $output);
     $output = ereg_replace('%website.lang', $this->lang->translate('Site'), $output);
     $output = ereg_replace('%adress.lang', $this->lang->translate('Adress'), $output);
     $output = ereg_replace('%msn.lang', $this->lang->translate('MSN'), $output);
     $output = ereg_replace('%jabber.lang', $this->lang->translate('Jabber'), $output);
     $timezone = $this->config->getConfigByNameType('general/timezone', TYPE_INT);
     $timeformat = $this->config->getConfigByNameType('general/timeformat', TYPE_STRING);
     $headlines = $this->config->getConfigByNameType('news/headlines', TYPE_INT);
     $postsonpage = $this->config->getConfigByNameType('news/postsonpage', TYPE_INT);
     $threaded = $this->config->getConfigByNameType('news/threaded', TYPE_BOOL);
     $theme = $this->config->getConfigByNameType('general/theme', TYPE_STRING);
     $email = $this->config->getConfigByNameType('user/email', TYPE_STRING);
     $name = $this->config->getConfigByNameType('user/name', TYPE_STRING);
     $language = $this->config->getConfigByNameType('general/language', TYPE_STRING);
     $userprofile = $this->user->getotherprofile($name);
     $pagename = $_SERVER['PHP_SELF'];
     if (ereg('news.php', $pagename) and !empty($_GET['action'])) {
         if ($_GET['action'] == 'viewcomments') {
             if ($this->config->getConfigByNameType('news/threaded', TYPE_BOOL) == false) {
                 $output = ereg_replace('%commentnavigator.html', $this->commentnavigator(), $output);
             } else {
                 $output = ereg_replace('%commentnavigator.html', '', $output);
             }
         }
     }
     $output = ereg_replace('%timezone.timezone', strval($timezone), $output);
     $output = ereg_replace('%timeformat.timeformat', $timeformat, $output);
     $output = ereg_replace('%headlines.headlines', strval($headlines), $output);
     $output = ereg_replace('%postsonpage.postsonpage', strval($postsonpage), $output);
     $output = ereg_replace('%email.email', $email, $output);
     $output = ereg_replace('%username.user', $name, $output);
     $output = ereg_replace('%aim.aim', $userprofile[FIELD_USERS_PROFILE_AIM], $output);
     $output = ereg_replace('%aim.name', 'newaim', $output);
     $output = ereg_replace('%icq.icq', $userprofile[FIELD_USERS_PROFILE_ICQ], $output);
     $output = ereg_replace('%icq.name', 'newicq', $output);
     $output = ereg_replace('%msn.msn', $userprofile[FIELD_USERS_PROFILE_MSN], $output);
     $output = ereg_replace('%msn.name', 'newmsn', $output);
     $output = ereg_replace('%jabber.jabber', $userprofile[FIELD_USERS_PROFILE_JABBER], $output);
     $output = ereg_replace('%jabber.name', 'newjabber', $output);
     $output = ereg_replace('%adress.adress', $userprofile[FIELD_USERS_PROFILE_ADRESS], $output);
     $output = ereg_replace('%adress.name', 'newadress', $output);
     $output = ereg_replace('%website.website', $userprofile[FIELD_USERS_PROFILE_WEBSITE], $output);
     $output = ereg_replace('%website.name', 'newwebsite', $output);
     $output = ereg_replace('%yahoo.yahoo', $userprofile[FIELD_USERS_PROFILE_YAHOO], $output);
     $output = ereg_replace('%yahoo.name', 'newyahoo', $output);
     $output = ereg_replace('%job.job', $userprofile[FIELD_USERS_PROFILE_JOB], $output);
     $output = ereg_replace('%job.name', 'newjob', $output);
     $output = ereg_replace('%intrests.intrests', $userprofile[FIELD_USERS_PROFILE_INTRESTS], $output);
     $output = ereg_replace('%intrests.name', 'newintrests', $output);
     $output = ereg_replace('%language.options', $this->options(languagesinstalled(), $this->language_option, $language), $output);
     $boolthreaded = $this->config->getConfigByNameType('news/threaded', TYPE_BOOL);
     convertToDatabase($boolthreaded);
     $output = ereg_replace('%threaded.options', $this->options(array(NO, YES), $this->threaded_option, $boolthreaded), $output);
     $output = ereg_replace('%theme.options', $this->options(themesinstalled(), $this->theme_option, $theme), $output);
     $output = ereg_replace('%databasename.name', 'name', $output);
     $output = ereg_replace('%databasepassword.name', 'password', $output);
     $output = ereg_replace('%databaseuser.name', 'user', $output);
     $output = ereg_replace('%databasehost.name', 'host', $output);
     $output = ereg_replace('%database.name', 'type', $output);
     $output = ereg_replace('%timezone.name', POST_TIMEZONE, $output);
     $output = ereg_replace('%timeformat.name', POST_TIMEFORMAT, $output);
     $output = ereg_replace('%headlines.name', POST_HEADLINES, $output);
     $output = ereg_replace('%postsonpage.name', POST_POSTSONPAGE, $output);
     $output = ereg_replace('%threaded.name', POST_THREADED, $output);
     $output = ereg_replace('%theme.name', POST_THEME, $output);
     $output = ereg_replace('%email.name', POST_EMAIL, $output);
     $output = ereg_replace('%language.name', POST_LANGUAGE, $output);
     $output = ereg_replace('%new_password1.name', POST_NEW_PASSWORD1, $output);
     $output = ereg_replace('%new_password2.name', POST_NEW_PASSWORD2, $output);
     $output = ereg_replace('%changeoptionsform.lang', $this->lang->translate('edit your options'), $output);
     $output = ereg_replace('%changeoptionsform.submit', $this->lang->translate('save your options'), $output);
     $output = ereg_replace('%changeoptionsform.action', changeoptions_action, $output);
     $output = ereg_replace('%changeoptionsform.action', changeoptions_action, $output);
     //$output = ereg_replace ( '%showlinksallpolls',$this->showallpolls ($GLOBALS['poll']->getallpollsbylanguage ($this->config->getConfigByNameType('general/language',TYPE_STRING)),$output);
     $output = ereg_replace('%showselectedpoll', $this->showpoll(), $output);
     $output = ereg_replace('%user.links', $this->loaduserlinks(), $output);
     $output = ereg_replace('%viewusers.list', $this->viewuserlist(), $output);
     $output = ereg_replace('%description%', $this->config->getConfigByNameType('general/description', TYPE_STRING), $output);
     $output = ereg_replace('%editcommentform.lang', $this->lang->translate('Edit this comment'), $output);
     $output = ereg_replace('%editcomment.lang', $this->lang->translate('Edit!!'), $output);
     $output = ereg_replace('%poll.language', $this->lang->translate('Poll'), $output);
     $output = ereg_replace('%vote.lang', $this->lang->translate('Vote!!'), $output);
     $output = $this->replaceimages($output);
     return $output;
 }