예제 #1
0
파일: backend.php 프로젝트: ryan2407/Vision
function fv_wp_flowplayer_admin_init()
{
    if (isset($_GET['type'])) {
        if ($_GET['type'] == 'fvplayer_video' || $_GET['type'] == 'fvplayer_video_1' || $_GET['type'] == 'fvplayer_video_2' || $_GET['type'] == 'fvplayer_mobile') {
            $_GET['post_mime_type'] = 'video';
        } else {
            if ($_GET['type'] == 'fvplayer_splash' || $_GET['type'] == 'fvplayer_logo') {
                $_GET['post_mime_type'] = 'image';
            }
        }
    }
    if (isset($_POST['fv-wp-flowplayer-submit'])) {
        check_admin_referer('fv_flowplayer_settings_nonce', 'fv_flowplayer_settings_nonce');
        global $fv_fp;
        if (method_exists($fv_fp, '_set_conf')) {
            $fv_fp->_set_conf();
        } else {
            echo 'Error saving FV Flowplayer options.';
        }
    }
    if (isset($_GET['fv-licensing']) && $_GET['fv-licensing'] == "check") {
        delete_option("fv_wordpress_flowplayer_persistent_notices");
        //license will expire in 5 seconds in the function:
        fv_wp_flowplayer_admin_key_update();
    }
    global $fv_fp;
    global $fv_wp_flowplayer_ver, $fv_wp_flowplayer_core_ver;
    if (preg_match('!^\\$\\d+!', $fv_fp->conf['key']) && (isset($fv_fp->conf['key_automatic']) && $fv_fp->conf['key_automatic'] == 'true' || isset($fv_fp->conf['video_checker_agreement']) && $fv_fp->conf['video_checker_agreement'] == 'true')) {
        $version = get_option('fvwpflowplayer_core_ver');
        if (version_compare($fv_wp_flowplayer_core_ver, $version) == 1) {
            fv_wp_flowplayer_admin_key_update();
            fv_wp_flowplayer_delete_extensions_transients();
        }
    }
    if (isset($fv_fp->conf['disable_videochecker']) && $fv_fp->conf['disable_videochecker'] == 'false' && (!isset($fv_fp->conf['video_checker_agreement']) || $fv_fp->conf['video_checker_agreement'] != 'true') && (!isset($fv_fp->conf['key_automatic']) || $fv_fp->conf['key_automatic'] != 'true')) {
        $fv_fp->pointer_boxes['fv_flowplayer_video_checker_service'] = array('id' => '#wp-admin-bar-new-content', 'pointerClass' => 'fv_flowplayer_video_checker_service', 'heading' => __('FV Player Video Checker', 'fv_flowplayer'), 'content' => __("<p>FV Player includes a free video checker which will check your videos for any encoding errors and helps ensure smooth playback of all your videos. To work its magic, our video checker must contact our server.</p><p>Would you like to enable the video encoding checker?</p>", 'fv_flowplayer'), 'position' => array('edge' => 'top', 'align' => 'center'), 'button1' => __('Allow', 'fv_flowplayer'), 'button2' => __('Disable the video checker', 'fv_flowplayer'));
    } else {
        if (preg_match('!^\\$\\d+!', $fv_fp->conf['key']) && version_compare($fv_wp_flowplayer_core_ver, get_option('fvwpflowplayer_core_ver')) !== 0 && (!isset($fv_fp->conf['key_automatic']) || $fv_fp->conf['key_automatic'] != 'true') && (!isset($fv_fp->conf['video_checker_agreement']) || $fv_fp->conf['video_checker_agreement'] != 'true')) {
            $fv_fp->pointer_boxes['fv_flowplayer_key_automatic'] = array('id' => '#wp-admin-bar-new-content', 'pointerClass' => 'fv_flowplayer_key_automatic', 'pointerWidth' => 340, 'heading' => __('FV Flowplayer License Update', 'fv_flowplayer'), 'content' => __('New version of FV Flowplayer core has been installed for your licensed website. Please accept the automatic license key updating (connects to Foliovision servers) or update the key manually by loggin into your Foliovision account.', 'fv_flowplayer'), 'position' => array('edge' => 'top', 'align' => 'center'), 'button1' => __('Always auto-update', 'fv_flowplayer'), 'button2' => __("I'll update it manually", 'fv_flowplayer'));
        } else {
            if (version_compare($fv_wp_flowplayer_core_ver, get_option('fvwpflowplayer_core_ver')) !== 0 && preg_match('!^\\$\\d+!', $fv_fp->conf['key']) == 0) {
                update_option('fvwpflowplayer_core_ver', $fv_wp_flowplayer_core_ver);
            }
        }
    }
    if ((stripos($_SERVER['REQUEST_URI'], '/plugins.php') !== false || $_GET['page'] === 'fvplayer') && ($pnotices = get_option('fv_wordpress_flowplayer_persistent_notices'))) {
        $fv_fp->pointer_boxes['fv_flowplayer_license_expired'] = array('id' => '#wp-admin-bar-new-content', 'pointerClass' => 'fv_flowplayer_license_expired', 'pointerWidth' => 340, 'heading' => __('FV Flowplayer License Expired', 'fv_flowplayer'), 'content' => __($pnotices), 'position' => array('edge' => 'top', 'align' => 'center'), 'button1' => __('Hide this notice', 'fv_flowplayer'), 'button2' => __('I\'ll check this later', 'fv_flowplayer'));
    }
    $aOptions = get_option('fvwpflowplayer');
    if (!isset($aOptions['version']) || version_compare($fv_wp_flowplayer_ver, $aOptions['version'])) {
        //update_option( 'fv_wordpress_flowplayer_deferred_notices', 'FV Flowplayer upgraded - please click "Check template" and "Check videos" for automated check of your site at <a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer">the settings page</a> for automated checks!' );
        $aOptions['version'] = $fv_wp_flowplayer_ver;
        update_option('fvwpflowplayer', $aOptions);
        $fv_fp->css_writeout();
        fv_wp_flowplayer_delete_extensions_transients();
        delete_option('fv_flowplayer_extension_install');
    }
    if (isset($_GET['page']) && $_GET['page'] == 'fvplayer') {
        wp_enqueue_script('common');
        wp_enqueue_script('wp-lists');
        wp_enqueue_script('postbox');
    }
    if (flowplayer::is_licensed()) {
        if (false === ($aCheck = get_transient('fv_flowplayer_license'))) {
            $aCheck = fv_wp_flowplayer_license_check(array('action' => 'check'));
            if ($aCheck) {
                set_transient('fv_flowplayer_license', $aCheck, 60 * 60 * 24);
            } else {
                set_transient('fv_flowplayer_license', json_decode(json_encode(array('error' => 'Error checking license')), FALSE), 60 * 60 * 24);
            }
        }
        $aCheck = get_transient('fv_flowplayer_license');
        $aInstalled = get_option('fv_flowplayer_extension_install');
        if (isset($aCheck->valid) && $aCheck->valid) {
            if (!isset($aInstalled['fv_player_pro']) || isset($_REQUEST['nonce_fv_player_pro_install']) && wp_verify_nonce($_REQUEST['nonce_fv_player_pro_install'], 'fv_player_pro_install')) {
                fv_wp_flowplayer_install_extension('fv_player_pro');
            }
            delete_option('fv_wordpress_flowplayer_persistent_notices');
        }
    }
}
예제 #2
0
function fv_flowplayer_admin_pro()
{
    global $fv_fp;
    if (flowplayer::is_licensed()) {
        $aCheck = get_transient('fv_flowplayer_license');
    }
    if (isset($aCheck->valid) && $aCheck->valid) {
        ?>
  
    <p>Valid license found, click the button at the top of the screen to install FV Player Pro!</p>
  <?php 
    } else {
        ?>
    <p><a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download">Purchase FV Flowplayer license</a> to enable Pro features!</p>
  <?php 
    }
    ?>
  <table class="form-table2">
    <tr>
      <td><label>Advanced Vimeo embeding:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" checked="checked" disabled="true" />
          Use Vimeo as your video host and use all of FV Flowplayer features.
        </p>
      </td>
    </tr>
    <tr>
      <td><label>Advanced Youtube embeding:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" checked="checked" disabled="true" />
          Use Youtube as your video host and use all of FV Flowplayer features.
        </p>
      </td>
    </tr>
    <tr>
      <td><label>Enable user defined AB loop:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" checked="checked" disabled="true" />
          Let your users repeat the parts of the video which they like!
        </p>
      </td>
    </tr>    
    <tr>
      <td><label>Enable video lightbox:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" checked="checked" disabled="true" />
          Enables Lightbox video gallery to show videos in a lightbox popup!
        </p>
      </td>
    </tr>
    <tr>
      <td><label>Enable quality switching:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" checked="checked" disabled="true" />
          Upload your videos in multiple quality for best user experience with Youtube-like quality switching!
        </p>
      </td>
    </tr>
    <tr>
      <td><label>Amazon CloudFront protected content:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" checked="checked" disabled="true" />
          Protect your Amazon CDN hosted videos.
        </p>
      </td>
    </tr>        
    <tr>
      <td><label>Use video lightbox for images as well:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" disabled="true" />
          Will group images as well as videos into the same lightbox gallery.
        </p>
      </td>
    </tr>
    <tr>
      <td><label>Autoplay just once:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" disabled="true" />
          Makes sure each video autoplays only once for each visitor.
        </p>
      </td>
    </tr>    
  </table>
  <p>Upcoming pro features:</p>
  <table class="form-table2">
    <tr>
      <td><label>Enable PayWall:</label></td>
      <td>
        <p class="description">
          <input type="checkbox" checked="checked" disabled="true" />
          Monetize the video content on your membership site.
        </p>
      </td>
    </tr>  
  </table>  
  <?php 
}