function PostThumbAdmin()
 {
     global $wpdb;
     $this->settings = pt_GetStarterOptions();
     $this->table_pt_post = $wpdb->prefix . "pt_post";
     // add WP actions - not limited to is_admin() to be applied also in case of xmlrpc posts by external blogging application
     add_action('publish_post', array(&$this, 'savePostImage'));
     add_action('edit_post', array(&$this, 'savePostImage'));
     add_action('save_post', array(&$this, 'savePostImage'));
     add_action('wp_insert_post', array(&$this, 'savePostImage'));
     add_action('wp_insert_post', array(&$this, 'savePostImage'));
     add_action('private_to_published', array(&$this, 'savePostImage'));
     add_action('delete_post', array(&$this, 'deletePostImage'));
     // Header
     if ('deactivate' != $_GET['action']) {
         add_action('admin_head', 'pt_admin_include_header');
     }
     // Plugin activation
     add_action('activate_post-thumb/post-thumb.php', array(&$this, 'activate'));
     // add option screen menu
     add_action('admin_menu', array(&$this, 'options'));
     // check if we need to upgrade
     if ($this->settings['version'] < $this->PTRVERSION) {
         // Execute installation
         $this->install();
         // Update version number in the options
         $this->settings['version'] = $this->PTRVERSION;
     }
 }
 /**
  * PostThumbRevisited
  *
  * Constructor for the PostThumbRevisited class.
  */
 function PostThumbRevisited()
 {
     global $wpdb, $wp_query;
     $this->now = $this->date_expl(gmdate('Y-m-d H:i:59', time()));
     // Insert the menu and options
     add_option('post_thumbnail_settings', '', 'Post Thumb Revisited Options');
     $this->table_pt_post = $wpdb->prefix . "pt_post";
     $this->settings = pt_GetStarterOptions();
     $this->wt_path = $this->settings['wt_path'];
     // defines constants
     define('POSTTHUMB_URLPATH', str_replace($this->settings['full_domain_name'], '/', SITEURL) . '/wp-content/plugins/' . PT_PLUGIN_BASENAME . '/');
     define('POSTTHUMB_USE_HS', $this->settings['hs_use'] == 'true');
     define('POSTTHUMB_USE_TB', $this->settings['tb_use'] == 'true');
     define('POSTTHUMB_USE_SB', $this->settings['sb_use'] == 'true');
     // call classes
     if (POSTTHUMB_USE_HS) {
         require PT_ABSPATH . 'lib/post-thumb-highslide.php';
     }
     if (POSTTHUMB_USE_TB) {
         require PT_ABSPATH . 'lib/post-thumb-thickbox.php';
     }
     if (POSTTHUMB_USE_SB) {
         require PT_ABSPATH . 'lib/post-thumb-smoothbox.php';
     }
     // Wordtube initialization
     if ($this->settings['hs_wordtube'] == 'true' || $this->settings['wt_media'] == 'true') {
         $wpdb->wordtube = $wpdb->prefix . 'wordtube';
         $wpdb->wordtube_med2play = $wpdb->prefix . 'wordtube_med2play';
         $this->InitWordTube();
     }
     if (is_admin()) {
         include PT_ABSPATH . '/post-thumb-options.php';
         $PTAdmin = new PostThumbAdmin();
     } else {
         add_action('wp_head', array(&$this, 'include_header'));
         if (is_feed()) {
             $this->settings['hs_use'] = 'false';
             $this->settings['tb_use'] = 'false';
             $this->settings['hs_post'] = 'true';
         }
         $this->GetPostList();
     }
 }