本文整理汇总了PHP中osc_set_preference函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_set_preference函数的具体用法?PHP osc_set_preference怎么用?PHP osc_set_preference使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_set_preference函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: theme_install
function theme_install()
{
$categories = osc_get_categories();
$categories_ids = array();
addSubCategoories($categories, $categories_ids);
if (!osc_get_preference('keyword_placeholder', 'seeker')) {
osc_set_preference('keyword_placeholder', __('ie. PHP Programmer'), 'seeker');
}
if (!Field::newInstance()->findBySlug('s_department')) {
Field::newInstance()->insertField(__('Department or Unit', 'seeker'), 'TEXT', 's_department', 0, '', $categories_ids);
}
if (!Field::newInstance()->findBySlug('s_position_type')) {
Field::newInstance()->insertField(__('Employment Type', 'seeker'), 'DROPDOWN', 's_position_type', 0, __('Full Time', 'seeker') . ',' . __('Part Time', 'seeker') . ',' . __('Part Time to Full Time', 'seeker') . ',' . __('Temporary', 'seeker') . ',' . __('Temporary to Full Time', 'seeker') . ',' . __('Full Time', 'seeker') . ',' . __('Contracted', 'seeker') . ',' . __('Contracted to Full Time', 'seeker') . ',' . __('Internship', 'seeker') . ',' . __('Internship to Full Time', 'seeker') . ',' . __('Seasonal', 'seeker') . ',' . __('Volunteer', 'seeker'), $categories_ids);
}
if (!Field::newInstance()->findBySlug('s_job_experience')) {
Field::newInstance()->insertField(__('Minimum Experience', 'seeker'), 'DROPDOWN', 's_job_experience', 0, __('Student (High School)', 'seeker') . ',' . __('Student (College)', 'seeker') . ',' . __('Entry Level', 'seeker') . ',' . __('Mid Level', 'seeker') . ',' . __('Experienced', 'seeker') . ',' . __('Manager/Supervisor', 'seeker') . ',' . __('Senior Manager/Supervisor', 'seeker') . ',' . __('Executive', 'seeker') . ',' . __('Senior Executive'), $categories_ids);
}
if (!Field::newInstance()->findBySlug('s_number_positions')) {
Field::newInstance()->insertField(__('Number of positions', 'seeker'), 'TEXT', 's_number_positions', 0, '', $categories_ids);
}
if (!Field::newInstance()->findBySlug('s_salary')) {
Field::newInstance()->insertField(__('Salary', 'seeker'), 'TEXT', 's_salary', 0, '', $categories_ids);
}
$version = theme_version_info();
//Save that theme has installed
osc_set_preference($version['name'], $version['version'], 'seeker');
}
开发者ID:ricktaylord,项目名称:osclass-themes,代码行数:27,代码来源:functions.php
示例2: doModel
function doModel()
{
switch ($this->action) {
case 'latestsearches':
//calling the comments settings view
$this->doView('settings/searches.php');
break;
case 'latestsearches_post':
// updating comment
osc_csrf_check();
if (Params::getParam('save_latest_searches') == 'on') {
osc_set_preference('save_latest_searches', 1);
} else {
osc_set_preference('save_latest_searches', 0);
}
if (Params::getParam('customPurge') == '') {
osc_add_flash_error_message(_m('Custom number could not be left empty'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=latestsearches');
} else {
osc_set_preference('purge_latest_searches', Params::getParam('customPurge'));
osc_add_flash_ok_message(_m('Last search settings have been updated'), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=latestsearches');
}
break;
}
}
开发者ID:mylastof,项目名称:os-class,代码行数:26,代码来源:latestsearches.php
示例3: classified_theme_install
function classified_theme_install()
{
osc_set_preference('keyword_placeholder', __('ie. PHP Programmer', 'classified'), 'classified');
osc_set_preference('version', '1.0.0', 'classified');
osc_set_preference('default_logo', '1', 'classified');
osc_reset_preferences();
}
开发者ID:Ashishr2,项目名称:Kathmandu,代码行数:7,代码来源:functions.php
示例4: youtube_update
function youtube_update()
{
// convert version
$version = osc_get_preference('youtube_version', 'youtube');
if ($version == '') {
$version = 12;
}
if ($version < 200) {
$conn = DBConnectionClass::newInstance();
$data = $conn->getOsclassDb();
$dbCommand = new DBCommandClass($data);
$dbCommand->query(sprintf('ALTER TABLE %s ADD COLUMN s_id VARCHAR(15) NOT NULL DEFAULT \'-no-id-\' AFTER s_youtube', YOUTUBE_TABLE));
// update s_id
$dbCommand->select();
$dbCommand->from(YOUTUBE_TABLE);
$rs = $dbCommand->get();
if ($rs !== false) {
$result = $rs->result();
foreach ($result as $video) {
$video_code = youtube_get_code_from_url($video['s_youtube']);
$dbCommand->update(YOUTUBE_TABLE, array('s_id' => $video_code), array('fk_i_item_id' => $video['fk_i_item_id']));
}
}
osc_set_preference('youtube_version', '200', 'youtube', 'STRING');
osc_reset_preferences();
}
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:27,代码来源:index.php
示例5: __construct
function __construct()
{
parent::__construct();
osc_run_hook('init_admin');
// check if exist a new version each day
if (time() - osc_last_version_check() > 24 * 3600) {
$data = osc_file_get_contents('http://osclass.org/latest_version.php?callback=?');
$data = preg_replace('|^\\?\\((.*?)\\);$|', '$01', $data);
$json = json_decode($data);
if ($json->version > osc_version()) {
osc_set_preference('update_core_json', $data);
} else {
osc_set_preference('update_core_json', '');
}
osc_set_preference('last_version_check', time());
osc_reset_preferences();
}
$config_version = str_replace('.', '', OSCLASS_VERSION);
$config_version = preg_replace('|-.*|', '', $config_version);
if ($config_version > Preference::newInstance()->get('version')) {
if (get_class($this) == 'CAdminTools') {
} else {
if (get_class($this) != 'CAdminUpgrade') {
$this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
}
}
}
}
开发者ID:randomecho,项目名称:OSClass,代码行数:28,代码来源:AdminSecBaseModel.php
示例6: doModel
function doModel()
{
switch ($this->action) {
case 'advanced':
//calling the advanced settings view
$this->doView('settings/advanced.php');
break;
case 'advanced_post':
// updating advanced settings
if (defined('DEMO')) {
osc_add_flash_warning_message(_m("This action can't be done because it's a demo site"), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=advanced');
}
osc_csrf_check();
$subdomain_type = Params::getParam('e_type');
if (!in_array($subdomain_type, array('category', 'country', 'region', 'city', 'user'))) {
$subdomain_type = '';
}
$iUpdated = osc_set_preference('subdomain_type', $subdomain_type);
$iUpdated += osc_set_preference('subdomain_host', Params::getParam('s_host'));
if ($iUpdated > 0) {
osc_add_flash_ok_message(_m("Advanced settings have been updated"), 'admin');
}
osc_calculate_location_slug(osc_subdomain_type());
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=advanced');
break;
case 'advanced_cache_flush':
osc_cache_flush();
osc_add_flash_ok_message(_m("Cache flushed correctly"), 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=advanced');
break;
}
}
开发者ID:oanav,项目名称:closetshare,代码行数:33,代码来源:advanced.php
示例7: allSeo_call_after_install
function allSeo_call_after_install()
{
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/robots.txt")) {
$rob = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/robots.txt");
} else {
$rob = '';
}
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.htaccess")) {
$hta = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.htaccess");
} else {
$hta = '';
}
ModelSeo::newInstance()->import('all_in_one/model/struct.sql');
osc_set_preference('allSeo_description', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_keywords', 'classified, free classified, classified web, free listings, cars for sale, sale', 'plugin-all_in_one', 'STRING');
osc_set_preference('allSeo_title_first', '0', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_robots', $rob, 'plugin-all_in_one', 'STRING');
osc_set_preference('allSeo_robots_enabled', '0', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_htaccess', $hta, 'plugin-all_in_one', 'STRING');
osc_set_preference('allSeo_htaccess_enabled', '0', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_delimiter', '|', 'plugin-all_in_one', 'STRING');
osc_set_preference('allSeo_city_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_city_order', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_region_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_region_order', '2', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_country_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_country_order', '3', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_category_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_category_order', '4', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_title_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_title_order', '5', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_body_order', '6', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_page_title', '', 'plugin-all_in_one', 'STRING');
osc_set_preference('allSeo_search_city_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_city_order', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_region_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_region_order', '2', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_country_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_country_order', '3', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_category_order', '4', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_pattern_order', '6', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_title_show', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_title_order', '5', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_search_page_title', '', 'plugin-all_in_one', 'STRING');
osc_set_preference('allSeo_search_improve_desc', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_other_page_title', '', 'plugin-all_in_one', 'STRING');
osc_set_preference('allSeo_sitemap_freq', 'weekly', 'plugin-all_in_one', 'STRING');
osc_set_preference('allSeo_links_footer', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_sitemap_items', '1', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_sitemap_items_limit', '1000', 'plugin-all_in_one', 'INTEGER');
osc_set_preference('allSeo_allow_custom_meta', '1', 'plugin-all_in_one', 'INTEGER');
//upload email templates
foreach (osc_listLocales() as $loc) {
//bo_mgr_email_expired template
$des_link[$loc['code']]['s_title'] = '{WEB_TITLE} - There is problem with backlink placed on your site';
$des_link[$loc['code']]['s_text'] = '<p>Dear Partner!</p> <p>Let us inform you, that we were not able to find link referring to our site: <strong>{LINK_TO}</strong> on your website <strong>{LINK_FROM}</strong>.</p> <p>Please add our link to your site or our cooperation in backlink building will be cancelled. If reason of removing link is maintenance or similar, please inform us about this.</p> <p>Regards, <br />{WEB_TITLE}</p>';
}
Page::newInstance()->insert(array('s_internal_name' => 'seo_link_problem', 'b_indelible' => '1'), $des_link);
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:59,代码来源:index.php
示例8: digitalgoods_install
function digitalgoods_install()
{
DGModel::newInstance()->import('digitalgoods/struct.sql');
@mkdir(osc_content_path() . 'uploads/digitalgoods/');
osc_set_preference('upload_path', osc_content_path() . 'uploads/digitalgoods/', 'digitalgoods', 'STRING');
osc_set_preference('max_files', '1', 'digitalgoods', 'INTEGER');
osc_set_preference('allowed_ext', 'zip,rar,tgz', 'digitalgoods', 'INTEGER');
}
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:8,代码来源:index.php
示例9: modern_compactmode_actions
function modern_compactmode_actions(){
$compactMode = osc_get_preference('compact_mode','modern_admin_theme');
$modeStatus = array('compact_mode'=>true);
if($compactMode == true){
$modeStatus['compact_mode'] = false;
}
osc_set_preference('compact_mode', $modeStatus['compact_mode'], 'modern_admin_theme');
echo json_encode($modeStatus);
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:9,代码来源:functions.php
示例10: qrcode_install
function qrcode_install()
{
@mkdir(osc_content_path() . 'uploads/qrcode/');
$conn = getConnection();
osc_set_preference('upload_path', osc_content_path() . 'uploads/qrcode/', 'qrcode', 'STRING');
osc_set_preference('upload_url', osc_base_url() . 'oc-content/uploads/qrcode/', 'qrcode', 'STRING');
osc_set_preference('code_size', '2', 'qrcode', 'INTEGER');
$conn->commit();
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:9,代码来源:index.php
示例11: __construct
function __construct()
{
parent::__construct();
// check if is moderator and can enter to this page
if ($this->isModerator()) {
if (!in_array($this->page, array('items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats', ''))) {
osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
$this->redirectTo(osc_admin_base_url());
}
}
osc_run_hook('init_admin');
// check if exist a new version each day
if (time() - osc_last_version_check() > 24 * 3600) {
$data = osc_file_get_contents('http://osclass.org/latest_version.php?callback=?');
$data = preg_replace('|^\\?\\((.*?)\\);$|', '$01', $data);
$json = json_decode($data);
if ($json->version > osc_version()) {
osc_set_preference('update_core_json', $data);
} else {
osc_set_preference('update_core_json', '');
}
osc_set_preference('last_version_check', time());
osc_reset_preferences();
}
$config_version = str_replace('.', '', OSCLASS_VERSION);
$config_version = preg_replace('|-.*|', '', $config_version);
if ($config_version > Preference::newInstance()->get('version')) {
if (get_class($this) == 'CAdminTools') {
} else {
if (get_class($this) != 'CAdminUpgrade') {
$this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
}
}
}
// show messages subscribed
$status_subscribe = Params::getParam('subscribe_osclass');
if ($status_subscribe != '') {
switch ($status_subscribe) {
case -1:
osc_add_flash_error_message(_m('Entered an invalid email'), 'admin');
break;
case 0:
osc_add_flash_warning_message(_m("You're already subscribed"), 'admin');
break;
case 1:
osc_add_flash_ok_message(_m('Subscribed correctly'), 'admin');
break;
default:
osc_add_flash_warning_message(_m("Error subscribing"), 'admin');
break;
}
}
// show donation successful
if (Params::getParam('donation') == 'successful') {
osc_add_flash_ok_message(_m('Thank you very much for your donation'), 'admin');
}
}
开发者ID:semul,项目名称:Osclass,代码行数:57,代码来源:AdminSecBaseModel.php
示例12: voting_install
/**
* Set plugin preferences
*/
function voting_install()
{
ModelVoting::newInstance()->import('voting/struct.sql');
// vote items
osc_set_preference('item_voting', '1', 'voting', 'BOOLEAN');
osc_set_preference('open', '1', 'voting', 'BOOLEAN');
// vote users
osc_set_preference('user', '0', 'voting', 'BOOLEAN');
osc_set_preference('user_voting', '0', 'voting', 'BOOLEAN');
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:13,代码来源:index.php
示例13: moreedit_install
function moreedit_install()
{
osc_set_preference('moderate_all', '0', 'moreedit', 'BOOLEAN');
osc_set_preference('moderate_edit', '0', 'moreedit', 'BOOLEAN');
osc_set_preference('disable_edit', '0', 'moreedit', 'BOOLEAN');
osc_set_preference('max_ads_week', '0', 'moreedit', 'INTEGER');
osc_set_preference('max_ads_month', '0', 'moreedit', 'INTEGER');
osc_set_preference('notify_edit', '0', 'moreedit', 'INTEGER');
ModelMoreedit::newInstance()->install();
}
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:10,代码来源:index.php
示例14: payment_pro_blockchain_conf_save
function payment_pro_blockchain_conf_save()
{
osc_set_preference('blockchain_btc_address', Params::getParam("blockchain_btc_address") ? Params::getParam("blockchain_btc_address") : '', 'payment_pro', 'STRING');
osc_set_preference('blockchain_confirmations', is_numeric(Params::getParam("blockchain_confirmations")) ? Params::getParam("blockchain_confirmations") : '6', 'payment_pro', 'INTEGER');
osc_set_preference('blockchain_enabled', Params::getParam("blockchain_enabled") ? Params::getParam("blockchain_enabled") : '0', 'payment_pro', 'BOOLEAN');
if (Params::getParam("blockchain_enabled") == 1) {
payment_pro_register_service('Blockchain', __FILE__);
} else {
payment_pro_unregister_service('Blockchain');
}
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:11,代码来源:load.php
示例15: item_success_update_version
function item_success_update_version()
{
$version = osc_get_preference('item_success_version', 'item_success');
if ($version == '') {
$version = 0;
}
if ($version < 110) {
osc_set_preference('item_success_add_meta_og', 'true', 'item_success', 'BOOLEAN');
osc_set_preference('item_success_version', '110', 'item_success', 'STRING');
osc_reset_preferences();
}
}
开发者ID:oanav,项目名称:closetshare,代码行数:12,代码来源:index.php
示例16: payment_pro_ccavenue_conf_save
function payment_pro_ccavenue_conf_save()
{
osc_set_preference('ccavenue_merchant_id', payment_pro_crypt(Params::getParam("ccavenue_merchant_id")), 'payment_pro', 'STRING');
osc_set_preference('ccavenue_working_key', payment_pro_crypt(Params::getParam("ccavenue_working_key")), 'payment_pro', 'STRING');
osc_set_preference('ccavenue_sandbox', Params::getParam("ccavenue_sandbox") ? Params::getParam("ccavenue_sandbox") : '0', 'payment_pro', 'BOOLEAN');
osc_set_preference('ccavenue_enabled', Params::getParam("ccavenue_enabled") ? Params::getParam("ccavenue_enabled") : '0', 'payment_pro', 'BOOLEAN');
if (Params::getParam("ccavenue_enabled") == 1) {
payment_pro_register_service('Ccavenue', __FILE__);
} else {
payment_pro_unregister_service('Ccavenue');
}
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:12,代码来源:load.php
示例17: nm_copypaste_plugin_actions
function nm_copypaste_plugin_actions()
{
$dao_preference = new Preference();
$option = Params::getParam('nomoreoption');
if (Params::getParam('file') != 'nm_copypaste_plugin/admin/settings.php') {
return '';
}
if ($option == 'nomoresettings') {
osc_set_preference('nm_id', Params::getParam("nm_id") ? Params::getParam("nm_id") : '0', 'nm_copypaste_plugin', 'STRING');
osc_add_flash_ok_message(__('Nomore copy/paste settings has been updated', 'nm_copypaste_plugin'), 'admin');
osc_redirect_to(osc_admin_render_plugin_url('nm_copypaste_plugin/admin/settings.php'));
}
}
开发者ID:krahamath,项目名称:nm_copypaste_plugin,代码行数:13,代码来源:index.php
示例18: osclass_pm_install
function osclass_pm_install()
{
ModelPM::newInstance()->import('osclass_pm/struct.sql');
osc_set_preference('sendEmail', '1', 'plugin-osclass_pm', 'INTEGER');
osc_set_preference('maxPMs', '100', 'plugin-osclass_pm', 'INTEGER');
osc_set_preference('deletePM', '3', 'plugin-osclass_pm', 'INTEGER');
osc_set_preference('pmBlocking', '1', 'plugin-osclass_pm', 'INTEGER');
osc_set_preference('pmDrafts', '0', 'plugin-osclass_pm', 'INTEGER');
osc_set_preference('pmSent', '1', 'plugin-osclass_pm', 'INTEGER');
osc_set_preference('pmAdmin', 'Admin', 'plugin-osclass_pm', 'STRING');
ModelPM::newInstance()->insertUsersPmSettings();
ModelPM::newInstance()->insertEmailTemplates();
}
开发者ID:oanav,项目名称:closetshare,代码行数:13,代码来源:index.php
示例19: doModel
function doModel()
{
switch ($this->action) {
case 'spamNbots':
// calling the spam and bots view
$akismet_key = osc_akismet_key();
$akismet_status = 3;
if ($akismet_key != '') {
require_once osc_lib_path() . 'Akismet.class.php';
$akismet_obj = new Akismet(osc_base_url(), $akismet_key);
$akismet_status = 2;
if ($akismet_obj->isKeyValid()) {
$akismet_status = 1;
}
}
View::newInstance()->_exportVariableToView('akismet_status', $akismet_status);
$this->doView('settings/spamNbots.php');
break;
case 'akismet_post':
// updating spam and bots option
osc_csrf_check();
$updated = 0;
$akismetKey = Params::getParam('akismetKey');
$akismetKey = trim($akismetKey);
$updated = osc_set_preference('akismetKey', $akismetKey);
if ($akismetKey == '') {
osc_add_flash_info_message(_m('Your Akismet key has been cleared'), 'admin');
} else {
osc_add_flash_ok_message(_m('Your Akismet key has been updated'), 'admin');
}
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=spamNbots');
break;
case 'recaptcha_post':
// updating spam and bots option
osc_csrf_check();
$iUpdated = 0;
$recaptchaPrivKey = Params::getParam('recaptchaPrivKey');
$recaptchaPrivKey = trim($recaptchaPrivKey);
$recaptchaPubKey = Params::getParam('recaptchaPubKey');
$recaptchaPubKey = trim($recaptchaPubKey);
$iUpdated += osc_set_preference('recaptchaPrivKey', $recaptchaPrivKey);
$iUpdated += osc_set_preference('recaptchaPubKey', $recaptchaPubKey);
if ($recaptchaPubKey == '') {
osc_add_flash_info_message(_m('Your reCAPTCHA key has been cleared'), 'admin');
} else {
osc_add_flash_ok_message(_m('Your reCAPTCHA key has been updated'), 'admin');
}
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=spamNbots');
break;
}
}
开发者ID:oanav,项目名称:closetshare,代码行数:51,代码来源:spamnbots.php
示例20: doModel
function doModel()
{
switch ($this->action) {
case 'comments':
//calling the comments settings view
$this->doView('settings/comments.php');
break;
case 'comments_post':
// updating comment
osc_csrf_check();
$iUpdated = 0;
$enabledComments = Params::getParam('enabled_comments');
$enabledComments = $enabledComments != '' ? true : false;
$moderateComments = Params::getParam('moderate_comments');
$moderateComments = $moderateComments != '' ? true : false;
$numModerateComments = Params::getParam('num_moderate_comments');
$commentsPerPage = Params::getParam('comments_per_page');
$notifyNewComment = Params::getParam('notify_new_comment');
$notifyNewComment = $notifyNewComment != '' ? true : false;
$notifyNewCommentUser = Params::getParam('notify_new_comment_user');
$notifyNewCommentUser = $notifyNewCommentUser != '' ? true : false;
$regUserPostComments = Params::getParam('reg_user_post_comments');
$regUserPostComments = $regUserPostComments != '' ? true : false;
$msg = '';
if (!osc_validate_int(Params::getParam("num_moderate_comments"))) {
$msg .= _m("Number of moderate comments must only contain numeric characters") . "<br/>";
}
if (!osc_validate_int(Params::getParam("comments_per_page"))) {
$msg .= _m("Comments per page must only contain numeric characters") . "<br/>";
}
if ($msg != '') {
osc_add_flash_error_message($msg, 'admin');
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=comments');
}
$iUpdated += osc_set_preference('enabled_comments', $enabledComments);
if ($moderateComments) {
$iUpdated += osc_set_preference('moderate_comments', $numModerateComments);
} else {
$iUpdated += osc_set_preference('moderate_comments', '-1');
}
$iUpdated += osc_set_preference('notify_new_comment', $notifyNewComment);
$iUpdated += osc_set_preference('notify_new_comment_user', $notifyNewCommentUser);
$iUpdated += osc_set_preference('comments_per_page', $commentsPerPage);
$iUpdated += osc_set_preference('reg_user_post_comments', $regUserPostComments);
if ($iUpdated > 0) {
osc_add_flash_ok_message(_m("Comment settings have been updated"), 'admin');
}
$this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=comments');
break;
}
}
开发者ID:oanav,项目名称:closetshare,代码行数:51,代码来源:comments.php
注:本文中的osc_set_preference函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论