예제 #1
0
 $phpAds_config['tbl_acls'] = $installvars['tbl_acls'] = $table_prefix . 'acls';
 $phpAds_config['tbl_session'] = $installvars['tbl_session'] = $table_prefix . 'session';
 $phpAds_config['tbl_zones'] = $installvars['tbl_zones'] = $table_prefix . 'zones';
 $phpAds_config['tbl_config'] = $installvars['tbl_config'] = $table_prefix . 'config';
 $phpAds_config['tbl_affiliates'] = $installvars['tbl_affiliates'] = $table_prefix . 'affiliates';
 $phpAds_config['tbl_images'] = $installvars['tbl_images'] = $table_prefix . 'images';
 $phpAds_config['tbl_userlog'] = $installvars['tbl_userlog'] = $table_prefix . 'userlog';
 $phpAds_config['tbl_cache'] = $installvars['tbl_cache'] = $table_prefix . 'cache';
 $phpAds_config['tbl_targetstats'] = $installvars['tbl_targetstats'] = $table_prefix . 'targetstats';
 if (phpAds_checkDatabaseExists()) {
     $errormessage[1][] = $strTableInUse;
 } else {
     if (phpAds_isConfigWritable()) {
         // Connect
         if (phpAds_dbConnect()) {
             if (phpAds_createDatabase($phpAds_config['table_type'])) {
                 // Insert basic settings into database and config file
                 phpAds_SettingsWriteAdd('config_version', $phpAds_version);
                 phpAds_SettingsWriteAdd('instance_id', phpAds_ConfigGenerateId());
                 phpAds_SettingsWriteAdd('dblocal', $installvars['dblocal']);
                 phpAds_SettingsWriteAdd('dbhost', $installvars['dbhost']);
                 phpAds_SettingsWriteAdd('dbport', $installvars['dbport']);
                 phpAds_SettingsWriteAdd('dbuser', $installvars['dbuser']);
                 phpAds_SettingsWriteAdd('dbpassword', $installvars['dbpassword']);
                 phpAds_SettingsWriteAdd('dbname', $installvars['dbname']);
                 phpAds_SettingsWriteAdd('table_prefix', $installvars['table_prefix']);
                 phpAds_SettingsWriteAdd('table_type', $installvars['table_type']);
                 phpAds_SettingsWriteAdd('mysql4_compatibility', $installvars['mysql4_compatibility']);
                 phpAds_SettingsWriteAdd('tbl_clients', $installvars['tbl_clients']);
                 phpAds_SettingsWriteAdd('tbl_banners', $installvars['tbl_banners']);
                 phpAds_SettingsWriteAdd('tbl_adstats', $installvars['tbl_adstats']);
예제 #2
0
     echo "</form>";
 } elseif ($upgrade && $step == 2) {
     // Setup busy indicator
     phpAds_PageHeader("1");
     echo "<br><br><img src='images/install-busy.gif' align='absmiddle'>&nbsp;";
     echo "<span class='install'>" . $strSystemUpgradeBusy . "</span>";
     phpAds_PageFooter();
     // Send the output to the browser
     flush();
     // Determine table type
     $table_type = isset($phpAds_config['table_type']) ? $phpAds_config['table_type'] : '';
     // Upgrade database
     if (phpAds_databaseUpgradeSupported) {
         $result = phpAds_upgradeDatabase($table_type);
     } else {
         $result = phpAds_createDatabase($table_type);
     }
     // Check if database is valid
     if (phpAds_databaseCheckSupported) {
         $continue = phpAds_checkDatabaseValid();
     } else {
         $continue = true;
     }
     if ($continue) {
         phpAds_upgradeData();
         // Go to the next step
         echo "<meta http-equiv='refresh' content='0;URL=upgrade.php?step=5'>";
         exit;
     } else {
         // Raise error
         echo "<meta http-equiv='refresh' content='0;URL=upgrade.php?step=3'>";