コード例 #1
0
ファイル: admin.php プロジェクト: hewu/blogwp
 /**
  * Setup WordPress backend
  *
  * @return none
  * @since 0.1
  */
 function __construct()
 {
     VisitorMoviesWordPress::__construct();
     $this->check_upgrade();
     // Full path to main file
     $this->plugin_file = dirname(dirname(__FILE__)) . '/visitor-movies.php';
     // Load localizations if available
     load_plugin_textdomain('visitor-movies', false, 'visitor-movies/translations');
     // Activation hook
     register_activation_hook($this->plugin_file, array(&$this, 'init'));
     // Whitelist options
     add_action('admin_init', array(&$this, 'register_settings'));
     // Activate the options page
     add_action('admin_menu', array(&$this, 'add_page'));
     // Enable ajax handlers
     global $VisitorMoviesAdmin;
     add_action('wp_ajax_visitor_movies_log_get', array(&$VisitorMoviesAdmin, 'log_get'));
     add_action('wp_ajax_nopriv_visitor_movies_log', array(&$VisitorMoviesAdmin, 'log'));
     wp_register_script('tablesorter', plugins_url('visitor-movies/js/jquery.tablesorter.min.js'), array('jquery'), '2.0.3', true);
 }
コード例 #2
0
ファイル: frontend.php プロジェクト: hewu/blogwp
 /**
  * Setup WordPress frontend 
  *
  * @return none
  * @since 0.1
  */
 function __construct()
 {
     VisitorMoviesWordPress::__construct();
     if (!empty($this->options)) {
         if ($this->get_option('enable') != '1') {
             return;
         }
         wp_register_style('visitor-movies-playback', plugins_url('visitor-movies/css/visitor-movies.css'));
         wp_register_script('visitor-movies-playback', plugins_url('visitor-movies/js/visitor-movies-playback.js'), array('jquery'), '0.2.0.2', true);
         wp_register_script('visitor-movies-log', plugins_url('visitor-movies/js/visitor-movies-log.js'), array('jquery'), '0.2.0.2', true);
         if ($_GET['playback'] == 'true') {
             $this->enable_playback();
         } else {
             if ($this->get_option('enableeverywhere') == '1') {
                 $this->enable_log();
             }
         }
         // shortcode active during playback to hide it
         add_shortcode('visitor-movies', array(&$this, 'enable_log'));
     }
 }