コード例 #1
0
ファイル: upgrade.php プロジェクト: gillima/phplist3
 ## #17328 - remove list categories with quotes
 Sql_Query(sprintf("update %s set category = replace(category,\"\\\\'\",\" \")", $tables['list']));
 ## longblobs are better at mixing character encoding. We don't know the encoding of anything we may want to store in cache
 ## before converting, it's quickest to clear the cache
 clearPageCache();
 Sql_Query(sprintf('alter table %s change column content content longblob', $tables['urlcache']));
 # mark the database to be our current version
 if ($success) {
     SaveConfig('version', VERSION, 0);
     # mark now to be the last time we checked for an update
     SaveConfig('updatelastcheck', date('Y-m-d H:i:s', time()), 0, true);
     ## also clear any possible value for "updateavailable"
     Sql_Query(sprintf('delete from %s where item = "updateavailable"', $tables['config']));
     Info(s('Success'), 1);
     upgradePlugins(array_keys($GLOBALS['plugins']));
     print subscribeToAnnouncementsForm();
     ##  check for old click track data
     $num = Sql_Fetch_Row_Query(sprintf('select count(*) from %s', $GLOBALS['tables']['linktrack']));
     if ($num[0] > 0) {
         print '<p class="information">' . $GLOBALS['I18N']->get('The clicktracking system has changed') . '</p>';
         printf($GLOBALS['I18N']->get('You have %s entries in the old statistics table'), $num[0]) . ' ';
         print ' ' . PageLinkButton('convertstats', $GLOBALS['I18N']->get('Convert Old data to new'));
     }
     if ($GLOBALS['commandline']) {
         output($GLOBALS['I18N']->get('Upgrade successful'));
     }
 } else {
     Error('An error occurred while upgrading your database');
     if ($GLOBALS['commandline']) {
         output($GLOBALS['I18N']->get('Upgrade failed'));
     }
コード例 #2
0
ファイル: initialise.php プロジェクト: MarcelvC/phplist3
    # add a testlist
    $info = $GLOBALS['I18N']->get('List for testing');
    $result = Sql_query("insert into {$tables['list']} (name,description,entered,active,owner) values(\"test\",\"{$info}\",now(),0,1)");
    $info = s('Sign up to our newsletter');
    $result = Sql_query("insert into {$tables['list']} (name,description,entered,active,owner) values(\"newsletter\",\"{$info}\",now(),1,1)");
    ## add the admin to the lists
    Sql_Query(sprintf('insert into %s (listid, userid, entered) values(%d,%d,now())', $tables['listuser'], 1, $userid));
    Sql_Query(sprintf('insert into %s (listid, userid, entered) values(%d,%d,now())', $tables['listuser'], 2, $userid));
    $uri = $_SERVER['REQUEST_URI'];
    $uri = str_replace('?' . $_SERVER['QUERY_STRING'], '', $uri);
    $body = '
    Version: ' . VERSION . "\r\n" . ' Url: ' . $_SERVER['SERVER_NAME'] . $uri . "\r\n";
    printf('<p class="information">' . $GLOBALS['I18N']->get('Success') . ': <a class="button" href="mailto:info@phplist.com?subject=Successful installation of phplist&amp;body=%s">' . $GLOBALS['I18N']->get('Tell us about it') . '</a>. </p>', $body);
    //printf('<p class="information">
    //'.$GLOBALS['I18N']->get("Please make sure to read the file README.security that can be found in the zip file.").'</p>');
    print subscribeToAnnouncementsForm($_REQUEST['adminemail']);
    if (ENCRYPT_ADMIN_PASSWORDS && !empty($adminid)) {
        print sendAdminPasswordToken($adminid);
    }
    # make sure the 0 template has the powered by image
    $query = sprintf('insert into %s (template, mimetype, filename, data, width, height) values (0, "image/png", "powerphplist.png", "%s", 70, 30)', $GLOBALS['tables']['templateimage'], $newpoweredimage);
    Sql_Query($query);
    print '<div id="continuesetup" style="display:none;" class="fleft">' . $GLOBALS['I18N']->get('Continue with') . ' ' . PageLinkButton('setup', $GLOBALS['I18N']->get('phpList Setup')) . '</div>';
    unset($_SESSION['hasI18Ntable']);
    ## load language files
    # this is too slow
    $GLOBALS['I18N']->initFSTranslations();
} else {
    print '<div class="initialiseOptions"><ul><li>' . s('Maybe you want to') . ' ' . PageLinkButton('upgrade', s('Upgrade')) . ' ' . s('instead?') . '</li>
    <li>' . PageLinkButton('initialise', s('Force Initialisation'), 'force=yes') . ' ' . s('(will erase all data!)') . ' ' . "</li></ul></div>\n";
}