<?php UPDATE_LanguageService::getInstance()->deleteLangKey('admin', 'input_settings_allow_photo_upload_label'); UPDATE_ConfigService::getInstance()->deleteConfig('base', 'tf_allow_pic_upload');
} } if (!Updater::getConfigService()->configExists('base', 'admin_cookie')) { Updater::getConfigService()->addConfig('base', 'admin_cookie', ''); } if (!Updater::getConfigService()->configExists('base', 'disable_mobile_context')) { Updater::getConfigService()->addConfig('base', 'disable_mobile_context', 0); } if (!Updater::getConfigService()->configExists('base', 'log_file_max_size_mb')) { Updater::getConfigService()->addConfig('base', 'log_file_max_size_mb', 20); } if (!Updater::getConfigService()->configExists('base', 'attch_file_max_size_mb')) { Updater::getConfigService()->addConfig('base', 'attch_file_max_size_mb', 2); } if (!UPDATE_ConfigService::getInstance()->configExists('base', 'users_on_page')) { UPDATE_ConfigService::getInstance()->addConfig('base', 'users_on_page', 12); } if (!Updater::getConfigService()->configExists('base', 'attch_ext_list')) { $ext = array('txt', 'doc', 'docx', 'sql', 'csv', 'xls', 'ppt', 'pdf', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'psd', 'ai', 'avi', 'wmv', 'mp3', '3gp', 'flv', 'mkv', 'mpeg', 'mpg', 'swf', 'zip', 'gz', 'tgz', 'gzip', '7z', 'bzip2', 'rar'); Updater::getConfigService()->addConfig('base', 'attch_ext_list', json_encode($ext)); } $preference = BOL_PreferenceService::getInstance()->findPreference('profile_details_update_stamp'); if (empty($preference)) { $preference = new BOL_Preference(); } $preference->key = 'profile_details_update_stamp'; $preference->sectionName = 'general'; $preference->defaultValue = 0; $preference->sortOrder = 1; BOL_PreferenceService::getInstance()->savePreference($preference); try {
/** * @return UPDATE_ConfigService */ public static function getConfigService() { return UPDATE_ConfigService::getInstance(); }
$db->query($query); } catch (Exception $e) { if (isset($logArray)) { $logArray[] = $e; } else { $errors[] = $e; } } } UPDATE_LanguageService::getInstance()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'base'); // add new configs if (!UPDATE_ConfigService::getInstance()->configExists('base', 'cachedEntitiesPostfix')) { UPDATE_ConfigService::getInstance()->addConfig('base', 'cachedEntitiesPostfix', '123'); } // favicon fix if (!file_exists(OW_DIR_USERFILES . 'plugins' . DS . 'base' . DS . 'favicon.ico')) { @copy(OW_DIR_STATIC . 'favicon.ico', OW_DIR_USERFILES . 'plugins' . DS . 'base' . DS . 'favicon.ico'); } UPDATE_ConfigService::getInstance()->saveConfig('base', 'favicon', file_exists(OW_DIR_USERFILES . 'plugins' . DS . 'base' . DS . 'favicon.ico')); // clean and rename custom css files $query = "SELECT * FROM `{$tblPrefix}base_theme`"; $themes = $db->queryForList($query); foreach ($themes as $theme) { if (empty($theme['customCssFileName'])) { continue; } $filePath = OW_DIR_USERFILES . 'themes' . DS . $theme['customCssFileName']; if (!file_exists($filePath)) { $db->query("UPDATE `{$tblPrefix}base_theme` SET `customCssFileName` = NULL WHERE `id` = :id", array('id' => $theme['id'])); } }
<?php try { UPDATE_ConfigService::getInstance()->addConfig('attachments', 'photo_share', '1', 'Add attached photos to user photos'); UPDATE_ConfigService::getInstance()->addConfig('attachments', 'video_share', '1', 'Add attached videos to user videos'); UPDATE_ConfigService::getInstance()->addConfig('attachments', 'link_share', '1', 'Add attached links to user links'); } catch (Exception $e) { } try { OW::getPluginManager()->addPluginSettingsRouteName('attachments', 'attachments-settings-page'); } catch (Exception $e) { } $updateDir = dirname(__FILE__) . DS; Updater::getLanguageService()->importPrefixFromZip($updateDir . 'langs.zip', 'attachments');
<?php $tblPrefix = OW_DB_PREFIX; $db = Updater::getDbo(); $logger = Updater::getLogger(); $queryList = array(); $queryList[] = "ALTER TABLE `{$tblPrefix}base_component_setting` ADD `type` VARCHAR( 20 ) NOT NULL DEFAULT 'string'"; $queryList[] = "ALTER TABLE `{$tblPrefix}base_component_entity_setting` ADD `type` VARCHAR( 20 ) NOT NULL DEFAULT 'string'"; foreach ($queryList as $query) { try { $db->query($query); } catch (Exception $e) { $logger->addEntry(json_encode($e)); } } try { Updater::getLanguageService()->deleteLangKey('base', 'questions_question_presentation_select_label'); Updater::getLanguageService()->deleteLangKey('base', 'questions_question_presentation_radio_label'); Updater::getLanguageService()->deleteLangKey('base', 'questions_question_presentation_age_label'); Updater::getLanguageService()->deleteLangKey('base', 'questions_question_presentation_birthdate_label'); // Updater::getLanguageService()->deleteLangKey('base','local_page_meta_tags_page-119658'); } catch (Exception $e) { $logger->addEntry(json_encode($e)); } if (!UPDATE_ConfigService::getInstance()->configExists('base', 'user_invites_limit')) { UPDATE_ConfigService::getInstance()->addConfig('base', 'user_invites_limit', 50); } Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'base');