当前位置: 首页>>代码示例>>PHP>>正文


PHP rtmedia_update_site_option函数代码示例

本文整理汇总了PHP中rtmedia_update_site_option函数的典型用法代码示例。如果您正苦于以下问题:PHP rtmedia_update_site_option函数的具体用法?PHP rtmedia_update_site_option怎么用?PHP rtmedia_update_site_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rtmedia_update_site_option函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: flush_rules

 function flush_rules()
 {
     $rtmedia_version = rtmedia_get_site_option("rtmedia_flush_rules_plugin_version");
     if (!$rtmedia_version) {
         $rtmedia_version = "0";
     }
     $plugin_data = get_plugin_data(RTMEDIA_PATH . 'index.php');
     $new_version = "0";
     if (isset($plugin_data) && isset($plugin_data['Version'])) {
         $new_version = $plugin_data['Version'];
     }
     if (version_compare($new_version, $rtmedia_version, '>')) {
         flush_rewrite_rules(false);
         rtmedia_update_site_option('rtmedia_flush_rules_plugin_version', $new_version);
     }
 }
开发者ID:fs-contributor,项目名称:rtMedia,代码行数:16,代码来源:RTMediaInteraction.php

示例2: return_migration

 function return_migration($media = false, $migrate = true)
 {
     $total = $this->get_total_count();
     $pending = $this->get_pending_count($media->id);
     $done = $total - $pending;
     if ($pending < 0) {
         $pending = 0;
         $done = $total;
     }
     if ($done > $total) {
         $done = $total;
     }
     rtmedia_update_site_option('rtmedia_media_size_import_pending_count', $pending);
     $pending_time = rtmedia_migrate_formatseconds($pending) . ' (estimated)';
     echo json_encode(array('status' => true, 'done' => $done, 'total' => $total, 'pending' => $pending_time, 'media_id' => $media->id, 'imported' => $migrate));
     die;
 }
开发者ID:fs-contributor,项目名称:rtMedia,代码行数:17,代码来源:RTMediaMediaSizeImporter.php

示例3: save_globals

 /**
  * Save global albums for newly added album
  *
  * @param type $album_ids
  *
  * @return boolean
  */
 function save_globals($album_ids = false)
 {
     if (!$album_ids) {
         return false;
     }
     $albums = self::get_globals();
     if (!$albums) {
         $albums = array();
     }
     if (!is_array($album_ids)) {
         $album_ids = array($album_ids);
     }
     $albums = array_merge($albums, $album_ids);
     rtmedia_update_site_option('rtmedia-global-albums', $albums);
 }
开发者ID:fs-contributor,项目名称:rtMedia,代码行数:22,代码来源:RTMediaAlbum.php

示例4: rtmedia_hide_template_override_notice

 function rtmedia_hide_template_override_notice()
 {
     if (rtmedia_update_site_option('rtmedia-update-template-notice-v3_9_4', 'hide')) {
         echo '1';
     } else {
         echo '0';
     }
     die;
 }
开发者ID:neerukoul,项目名称:rtMedia,代码行数:9,代码来源:RTMediaAdmin.php

示例5: migrate_encoding_options

 function migrate_encoding_options()
 {
     $encoding_mnigration_array = array('bp-media-encoding-api-key' => 'rtmedia-encoding-api-key', 'bp-media-encoding-usage-limit-mail' => 'rtmedia-encoding-usage-limit-mail', 'bp-media-encoding-usage' => 'rtmedia-encoding-usage', 'bpmedia_encoding_service_notice' => 'rtmedia-encoding-service-notice', 'bpmedia_encoding_expansion_notice' => 'rtmedia-encoding-expansion-notice', 'bp_media_ffmpeg_options' => 'rtmedia-ffmpeg-options', 'bp_media_kaltura_options' => 'rtmedia-kaltura-options');
     foreach ($encoding_mnigration_array as $key => $ma) {
         if (false !== ($value = rtmedia_get_site_option($key))) {
             rtmedia_update_site_option($ma, $value);
         }
     }
 }
开发者ID:fs-contributor,项目名称:rtMedia,代码行数:9,代码来源:RTMediaMigration.php

示例6: check_global_album

 function check_global_album()
 {
     //todo: Nonce required
     $album = new RTMediaAlbum();
     $global_album = $album->get_default();
     // @codingStandardsIgnoreStart
     //** Hack for plupload default name
     if (isset($_POST['action']) && isset($_POST['mode']) && 'file_upload' === sanitize_text_field($_POST['mode'])) {
         unset($_POST['name']);
     }
     // @codingStandardsIgnoreEnd
     //**
     global $rtmedia_error;
     if (isset($rtmedia_error) && true === $rtmedia_error) {
         return false;
     }
     if (!$global_album) {
         $global_album = $album->add_global(esc_html__('Wall Posts', 'buddypress-media'));
     }
     // fix multisite global album doesn't exist issue.
     if (is_multisite() && !rtmedia_get_site_option('rtmedia_fix_multisite_global_albums', false)) {
         $model = new RTMediaModel();
         $global_albums = rtmedia_global_albums();
         $album_objects = $model->get_media(array('id' => $global_albums), false, false);
         if (empty($album_objects)) {
             $global_album = $album->add_global(esc_html__('Wall Posts', 'buddypress-media'));
         }
         rtmedia_update_site_option('rtmedia_fix_multisite_global_albums', true);
     }
 }
开发者ID:rtCamp,项目名称:rtMedia,代码行数:30,代码来源:RTMedia.php

示例7: return_upgrade

 function return_upgrade($activity_data, $upgrade = true)
 {
     $total = $this->get_total_count();
     $pending = $this->get_pending_count($activity_data->activity_id);
     $done = $total - $pending;
     if ($pending < 0) {
         $pending = 0;
         $done = $total;
     }
     if ($done > $total) {
         $done = $total;
     }
     rtmedia_update_site_option('rtmedia_media_activity_upgrade_pending', $pending);
     $pending_time = rtmedia_migrate_formatseconds($pending) . ' (estimated)';
     echo wp_json_encode(array('status' => true, 'done' => $done, 'total' => $total, 'pending' => $pending_time, 'activity_id' => $activity_data->activity_id, 'imported' => $upgrade));
     die;
 }
开发者ID:rtCamp,项目名称:rtMedia,代码行数:17,代码来源:RTMediaActivityUpgrade.php

示例8: rtmedia_hide_template_override_notice

 function rtmedia_hide_template_override_notice()
 {
     if (check_ajax_referer('rtmedia_template_notice', '_rtm_nonce') && rtmedia_update_site_option('rtmedia-update-template-notice-v3_9_4', 'hide')) {
         echo '1';
     } else {
         echo '0';
     }
     die;
 }
开发者ID:rtCamp,项目名称:rtMedia,代码行数:9,代码来源:RTMediaAdmin.php

示例9: sanitize

 /**
  * Sanitizes the settings
  *
  * @access public
  * @global type $rtmedia_admin
  *
  * @param  type $input
  *
  * @return type $input
  */
 public function sanitize($input)
 {
     global $rtmedia_admin;
     if (isset($_POST['refresh-count'])) {
         if ($rtmedia_admin->update_count()) {
             if (is_multisite()) {
                 rtmedia_update_site_option('rtm-recount-success', __('Recounting of media files done successfully', 'rtmedia'));
             } else {
                 add_settings_error(__('Recount Success', 'rtmedia'), 'rtm-recount-success', __('Recounting of media files done successfully', 'rtmedia'), 'updated');
             }
         } else {
             if (is_multisite()) {
                 rtmedia_update_site_option('rtm-recount-fail', __('Recounting Failed', 'rtmedia'));
             } else {
                 add_settings_error(__('Recount Fail', 'rtmedia'), 'rtm-recount-fail', __('Recounting Failed', 'rtmedia'));
             }
         }
     }
     //            if (!isset($_POST['rtmedia_options']['enable_on_profile']) && !isset($_POST['rtmedia_options']['enable_on_group'])) {
     //                if (is_multisite())
     //                    update_site_option('rtm-media-enable', __('Enable BuddyPress Media on either User Profiles or Groups or both. Atleast one should be selected.', 'rtmedia'));
     //                else
     //                    add_settings_error(__('Enable BuddyPress Media', 'rtmedia'), 'rtm-media-enable', __('Enable BuddyPress Media on either User Profiles or Groups or both. Atleast one should be selected.', 'rtmedia'));
     //                $input['enable_on_profile'] = 1;
     //            }
     if (!isset($_POST['rtmedia_options']['videos_enabled']) && !isset($_POST['rtmedia_options']['audio_enabled']) && !isset($_POST['rtmedia_options']['images_enabled'])) {
         if (is_multisite()) {
             rtmedia_update_site_option('rtm-media-type', __('Atleast one Media Type Must be selected', 'rtmedia'));
         } else {
             add_settings_error(__('Media Type', 'rtmedia'), 'rtm-media-type', __('Atleast one Media Type Must be selected', 'rtmedia'));
         }
         $input['images_enabled'] = 1;
     }
     $input['default_count'] = intval($_POST['rtmedia_options']['default_count']);
     if (!is_int($input['default_count']) || $input['default_count'] < 0 || empty($input['default_count'])) {
         if (is_multisite()) {
             rtmedia_update_site_option('rtm-media-default-count', __('"Number of media" count value should be numeric and greater than 0.', 'rtmedia'));
         } else {
             add_settings_error(__('Default Count', 'rtmedia'), 'rtm-media-default-count', __('"Number of media" count value should be numeric and greater than 0.', 'rtmedia'));
         }
         $input['default_count'] = 10;
     }
     if (is_multisite()) {
         rtmedia_update_site_option('rtm-settings-saved', __('Settings saved.', 'rtmedia'));
     }
     do_action('rtmedia_sanitize_settings', $_POST, $input);
     return $input;
 }
开发者ID:prdanielmota,项目名称:faama-site,代码行数:58,代码来源:RTMediaSettings.php

示例10: check_global_album

 function check_global_album()
 {
     $album = new RTMediaAlbum();
     $global_album = $album->get_default();
     //** Hack for plupload default name
     if (isset($_POST["action"]) && isset($_POST["mode"]) && $_POST["mode"] == "file_upload") {
         unset($_POST["name"]);
     }
     //**
     global $rtmedia_error;
     if (isset($rtmedia_error) && $rtmedia_error === true) {
         return false;
     }
     if (!$global_album) {
         $global_album = $album->add_global(__("Wall Posts", 'buddypress-media'));
     }
     // fix multisite global album doesn't exist issue.
     if (is_multisite() && !rtmedia_get_site_option('rtmedia_fix_multisite_global_albums', false)) {
         $model = new RTMediaModel();
         $global_albums = rtmedia_global_albums();
         $album_objects = $model->get_media(array('id' => $global_albums), false, false);
         if (empty($album_objects)) {
             $global_album = $album->add_global(__("Wall Posts", 'buddypress-media'));
         }
         rtmedia_update_site_option('rtmedia_fix_multisite_global_albums', true);
     }
 }
开发者ID:fs-contributor,项目名称:rtMedia,代码行数:27,代码来源:RTMedia.php

示例11: return_migration

 function return_migration($media, $migrate = true)
 {
     $total = $this->get_total_count();
     $pending = $this->get_pending_count($media->id);
     $done = $total - $pending;
     if ($pending < 0) {
         $pending = 0;
         $done = $total;
     }
     if ($done > $total) {
         $done = $total;
     }
     rtmedia_update_site_option('rtmedia_media_size_import_pending_count', $pending);
     $pending_time = rtmedia_migrate_formatseconds($pending) . " (estimated)";
     echo json_encode(array("status" => true, "done" => $done, "total" => $total, "pending" => $pending_time, "media_id" => $media->id, "imported" => $migrate));
     die;
 }
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:17,代码来源:RTMediaMediaSizeImporter.php

示例12: sanitize

 /**
  * Sanitizes the settings
  *
  * @access public
  * @global type $rtmedia_admin
  *
  * @param  type $input
  *
  * @return type $input
  */
 public function sanitize($input)
 {
     $rtmedia_options = filter_input(INPUT_POST, 'rtmedia-options', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
     if (!isset($rtmedia_options['videos_enabled']) && !isset($rtmedia_options['audio_enabled']) && !isset($rtmedia_options['images_enabled'])) {
         if (is_multisite()) {
             rtmedia_update_site_option('rtm-media-type', esc_html__('Atleast one Media Type Must be selected', 'buddypress-media'));
         } else {
             add_settings_error(esc_html__('Media Type', 'buddypress-media'), 'rtm-media-type', esc_html__('Atleast one Media Type Must be selected', 'buddypress-media'));
         }
         $input['images_enabled'] = 1;
     }
     $input['default_count'] = intval($rtmedia_options['default_count']);
     if (!is_int($input['default_count']) || $input['default_count'] < 0 || empty($input['default_count'])) {
         if (is_multisite()) {
             rtmedia_update_site_option('rtm-media-default-count', esc_html__('"Number of media" count value should be numeric and greater than 0.', 'buddypress-media'));
         } else {
             add_settings_error(esc_html__('Default Count', 'buddypress-media'), 'rtm-media-default-count', esc_html__('"Number of media" count value should be numeric and greater than 0.', 'buddypress-media'));
         }
         $input['default_count'] = 10;
     }
     if (is_multisite()) {
         rtmedia_update_site_option('rtm-settings-saved', esc_html__('Settings saved.', 'buddypress-media'));
     }
     do_action('rtmedia_sanitize_settings', $_POST, $input);
     // @codingStandardsIgnoreLine
     return $input;
 }
开发者ID:rtCamp,项目名称:rtMedia,代码行数:37,代码来源:RTMediaSettings.php

示例13: redirect_on_change_slug

 function redirect_on_change_slug()
 {
     $old_slugs = rtmedia_get_site_option("rtmedia_old_media_slug", false, true);
     $current_slugs = rtmedia_get_site_option("rtmedia_current_media_slug", false, false);
     if ($current_slugs === false) {
         rtmedia_update_site_option("rtmedia_current_media_slug", RTMEDIA_MEDIA_SLUG);
         return;
     }
     if ($current_slugs === RTMEDIA_MEDIA_SLUG) {
         return;
     }
     if ($old_slugs === false) {
         $old_slugs = array();
     }
     $old_slugs[] = $current_slugs;
     rtmedia_update_site_option("rtmedia_current_media_slug", RTMEDIA_MEDIA_SLUG);
 }
开发者ID:prdanielmota,项目名称:faama-site,代码行数:17,代码来源:RTMedia.php


注:本文中的rtmedia_update_site_option函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。