Example #1
0
 function __construct($plugin_file)
 {
     # Read base
     $this->Load_Base_Url();
     # Template directory
     $this->template_dir = WP_CONTENT_DIR . '/fancy-gallery-templates';
     # Helper classes
     $this->gallery_post_type = new Gallery_Post_Type($this);
     $this->i18n = new I18n($this);
     $this->lightbox = new Lightbox($this);
     $this->mocking_bird = new Mocking_Bird($this);
     $this->options = new Options($this);
     $this->wpml = new WPML($this);
     # This Plugin supports post thumbnails
     Add_Theme_Support('post-thumbnails');
     # Set Hooks
     Register_Activation_Hook($plugin_file, array($this, 'Plugin_Activation'));
     Add_Filter('the_content', array($this, 'Filter_Content'), 11);
     Add_Filter('the_content_feed', array($this, 'Filter_Feed_Content'));
     Add_Filter('the_excerpt_rss', array($this, 'Filter_Feed_Content'));
     Add_Action('wp_enqueue_scripts', array($this, 'Enqueue_Frontend_Scripts'));
     Add_Action('widgets_init', array($this, 'Register_Widgets'));
     Add_Filter('post_class', array($this, 'Filter_Post_Class'));
     Add_ShortCode('gallery', array($this, 'ShortCode_Gallery'));
     if (!$this->options->Get('disable_excerpts')) {
         Add_Filter('get_the_excerpt', array($this, 'Filter_Excerpt'), 9);
     }
     # Add to GLOBALs
     $GLOBALS[__CLASS__] = $this;
 }
Example #2
0
 public function __construct($core)
 {
     $this->core = $core;
     # Define filters
     Add_Action('widgets_init', array($this, 'Find_WPML'));
     Add_Filter('gettext_with_context', array($this, 'Filter_Gettext_with_Context'), 1, 4);
 }
Example #3
0
 static function addOptionsPage()
 {
     $handle = Add_Options_Page(I18n::t('Glossary Options'), I18n::t('Glossary'), 'manage_options', self::$page_slug, array(__CLASS__, 'printOptionsPage'));
     # Add JavaScript to this handle
     Add_Action('load-' . $handle, array(__CLASS__, 'loadOptionsPage'));
     # Add option boxes
     self::addOptionBox(__('General'), Core::$plugin_folder . '/options-page/box-general.php');
     self::addOptionBox(I18n::t('Archive Url'), Core::$plugin_folder . '/options-page/box-archive-link.php', 'side');
 }
 public function __construct($core)
 {
     $this->core = $core;
     $this->post_type = $this->core->gallery_post_type->name;
     Add_Action('admin_init', array($this, 'checkCreatedPost'));
     Add_Action('untrash_post', array($this, 'checkUntrashedPost'));
     Add_Action('admin_footer', array($this, 'changeCreateGalleryLink'));
     Add_Action('admin_bar_menu', array($this, 'removeAdminBarCreateGalleryButton'), 999);
 }
Example #5
0
 static function Init($plugin_file)
 {
     self::$plugin_file = $plugin_file;
     self::$plugin_folder = DirName(self::$plugin_file);
     self::loadBaseURL();
     Register_Activation_Hook(self::$plugin_file, array(__CLASS__, 'installPlugin'));
     Add_Action('loop_start', array(__CLASS__, 'printPrefixFilter'));
     Add_Filter('the_content', array(__CLASS__, 'filterContent'));
 }
Example #6
0
 public function __construct($core)
 {
     $this->core = $core;
     $this->post_type = $this->core->gallery_post_type->name;
     Add_Action('admin_init', array($this, 'User_Creates_New_Post'));
     Add_Action('untrash_post', array($this, 'User_Untrashes_Post'));
     Add_Action('admin_footer', array($this, 'Change_Create_Post_Link'));
     Add_Action('admin_bar_menu', array($this, 'Filter_Admin_Bar_Menu'), 999);
 }
Example #7
0
 public function Add_Options_Page()
 {
     $handle = Add_Options_Page($this->t('Fancy Gallery Options'), $this->t('Fancy Gallery'), 'manage_options', __CLASS__, array($this, 'Print_Options_Page'));
     # Add JavaScript to this handle
     Add_Action('load-' . $handle, array($this, 'Load_Options_Page'));
     # Add option boxes
     $this->Add_Option_Box($this->t('Lightbox'), DirName(__FILE__) . '/options-page/lightbox.php');
     $this->Add_Option_Box($this->t('Templates'), DirName(__FILE__) . '/options-page/templates.php', 'main', 'closed');
     $this->Add_Option_Box($this->t('User rights'), DirName(__FILE__) . '/options-page/user-rights.php', 'main', 'closed');
     $this->Add_Option_Box($this->t('Taxonomies'), DirName(__FILE__) . '/options-page/taxonomies.php', 'side');
     $this->Add_Option_Box($this->t('Gallery "Excerpts"'), DirName(__FILE__) . '/options-page/excerpt.php', 'side');
     $this->Add_Option_Box($this->t('Archive Url'), DirName(__FILE__) . '/options-page/archive-link.php', 'side');
 }
Example #8
0
 public function Add_Options_Page()
 {
     $handle = Add_Options_Page(I18n::t('Fancy Gallery Options'), I18n::t('Fancy Gallery'), 'manage_options', $this->page_slug, array($this, 'Print_Options_Page'));
     # Add JavaScript to this handle
     Add_Action('load-' . $handle, array($this, 'Load_Options_Page'));
     # Add option boxes
     $this->Add_Option_Box(I18n::t('Lightbox'), Core::$plugin_folder . '/options-page/lightbox.php');
     $this->Add_Option_Box(I18n::t('Templates'), Core::$plugin_folder . '/options-page/templates.php', 'main', 'closed');
     $this->Add_Option_Box(I18n::t('User rights'), Core::$plugin_folder . '/options-page/user-rights.php', 'main', 'closed');
     $this->Add_Option_Box(I18n::t('Taxonomies'), Core::$plugin_folder . '/options-page/taxonomies.php', 'side');
     $this->Add_Option_Box(I18n::t('Gallery "Excerpts"'), Core::$plugin_folder . '/options-page/excerpt.php', 'side');
     $this->Add_Option_Box(I18n::t('Archive Url'), Core::$plugin_folder . '/options-page/archive-link.php', 'side');
 }
Example #9
0
 function __construct()
 {
     if (Is_Admin() && !$this->Validate_Licence()) {
         $this->base_url = get_bloginfo('wpurl') . '/' . Str_Replace("\\", '/', SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH)));
         Add_Action('admin_init', array($this, 'Load_TextDomain'));
         Add_Action('admin_init', array($this, 'Add_Contribution_Code_Field'));
         Add_Action('admin_print_footer_scripts', array($this, 'Print_Contribution_JS'), 99);
         Add_Action('admin_notices', array($this, 'Print_Contribution_Form'), 1);
         Add_Action('wp_dashboard_setup', array($this, 'Register_Dashboard_Widget'), 9);
         Add_Action('donation_message', array($this, 'Print_Contribution_Message'));
         Add_Action('dh_contribution_message', array($this, 'Print_Contribution_Message'));
     }
     $this->Check_Remote_Activation();
 }
 function __construct()
 {
     // Read base
     $this->base_url = get_bloginfo('wpurl') . '/' . Str_Replace("\\", '/', SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH)));
     // Get ready to translate
     $this->Load_TextDomain();
     // Set Hooks
     if (Is_Admin()) {
         Add_Action('admin_menu', array($this, 'add_options_page'));
         Add_Action('admin_head', array($this, 'print_admin_header'));
     } else {
         Add_Action('wp_head', array($this, 'print_header'));
         Add_ShortCode('gallery', array($this, 'gallery_shortcode'));
     }
     // Add jQuery
     wp_enqueue_script('jquery');
 }
Example #11
0
 function __construct($plugin_file)
 {
     self::$plugin_file = $plugin_file;
     self::$plugin_folder = DirName(self::$plugin_file);
     # Read base
     $this->Load_Base_Url();
     # Template directory
     $this->template_dir = WP_CONTENT_DIR . '/fancy-gallery-templates';
     # Helper classes
     #I18n::Load_TextDomain();
     $this->options = new Options($this);
     $this->gallery_post_type = new Gallery_Post_Type($this);
     if ($this->options->Get('lightbox') == 'on') {
         $this->lightbox = new Lightbox($this);
     }
     $this->mocking_bird = new Mocking_Bird($this);
     # This Plugin supports post thumbnails
     Add_Theme_Support('post-thumbnails');
     # Set Hooks
     Register_Activation_Hook(self::$plugin_file, array($this, 'Plugin_Activation'));
     Add_Filter('the_content', array($this, 'Filter_Content'), 11);
     Add_Filter('the_content_feed', array($this, 'Filter_Feed_Content'));
     Add_Filter('the_excerpt_rss', array($this, 'Filter_Feed_Content'));
     Add_Action('wp_enqueue_scripts', array($this, 'Enqueue_Frontend_Scripts'));
     Add_Action('widgets_init', array($this, 'Register_Widgets'));
     Add_Filter('post_class', array($this, 'Filter_Post_Class'));
     Add_Action('pre_get_posts', array($this, 'Filter_Attachment_Query'));
     Add_Filter('get_the_categories', array($this, 'Filter_Get_The_Categories'));
     Add_Filter('the_category', array($this, 'Filter_The_Category'), 10, 3);
     Add_Filter('get_the_tags', array($this, 'Filter_Get_The_Tags'));
     Add_Filter('the_tags', array($this, 'Filter_The_Tags'), 10, 5);
     Add_ShortCode('gallery', array($this, 'ShortCode_Gallery'));
     if (!$this->options->Get('disable_excerpts')) {
         Add_Filter('get_the_excerpt', array($this, 'Filter_Excerpt'), 9);
     }
     # Add to GLOBALs
     $GLOBALS[__CLASS__] = $this;
 }
Example #12
0
 function __construct()
 {
     // If we are not in admin panel. We bail out.
     if (!Is_Admin()) {
         return False;
     }
     // Load Text Domain
     $this->Load_TextDomain();
     // Register the Misc Setting if a user donated
     Add_Action('admin_menu', array($this, 'add_settings_field'));
     // Check if the user has already donated
     if (get_option('donated_to_dennis_hoppe') == 'yes') {
         return False;
     }
     // Add some Js for the donation buttons to the admin header
     Add_Action('admin_head', array($this, 'print_donation_js'));
     // Hide the donation form to the footer
     Add_Action('admin_notices', array($this, 'print_donation_form'), 1);
     // Register the Dashboard Widget
     Add_Action('wp_dashboard_setup', array($this, 'register_widget'));
     // Register donation message
     Add_Action('donation_message', array($this, 'print_message'));
 }
Example #13
0
 static function Init()
 {
     Add_Action('init', array(__CLASS__, 'loadGlossaryType'));
 }
Example #14
0
 static function Init()
 {
     Add_Filter('post_updated_messages', array(__CLASS__, 'filterUpdatedMessages'));
     Add_Action('init', array(__CLASS__, 'registerPostType'), 11);
 }
            unset($settings);
            // Get random images
            $arr_images = $this->Get_Fancy_Images('ID', 'RAND', $this->get_option('limit'));
            if (empty($arr_images)) {
                return False;
            } else {
                foreach ($arr_images as &$image) {
                    $include .= $image->ID . ',';
                    $this->Get_Option('link_target') == 'gallery' ? $image->href = Get_Permalink($image->gallery_id) : '';
                }
            }
            // Generate Attributes
            $attributes = $this->fancy_gallery->Generate_Gallery_Attributes(array('include' => $include, 'thumb_width' => $this->Get_Option('thumb_width'), 'thumb_height' => $this->Get_Option('thumb_height'), 'thumb_grayscale' => $this->Get_Option('thumb_grayscale'), 'thumb_negate' => $this->Get_Option('thumb_negate')));
            // Build Gallery
            $this->fancy_gallery->Build_Gallery($arr_images, $attributes);
            // Display Widget
            echo $args['before_widget'];
            echo $args['before_title'] . Apply_Filters('widget_title', $this->get_option('title'), $settings, $this->id_base) . $args['after_title'];
            echo $this->fancy_gallery->Render_Gallery($this->get_option('template'));
            echo $args['after_widget'];
        }
        function Update($new_settings, $old_settings)
        {
            return $new_settings;
        }
    }
    /* End of Class */
    Add_Action('widgets_init', Create_Function('', 'Register_Widget(\'wp_widget_fancy_random_images\');'));
}
/* End of If-Class-Exists-Condition */
/* End of File */
Example #16
0
<?php

/*
Plugin Name: Fancy Gallery Lite
Plugin URI: http://dennishoppe.de/en/wordpress-plugins/fancy-gallery
Description: Fancy Gallery enables you to create and manage galleries and converts your galleries in post and pages to valid HTML5 blocks and associates linked images with a nice and responsive lightbox.
Version: 1.5.9
Author: Dennis Hoppe
Author URI: http://DennisHoppe.de
*/
if (Version_Compare(PHP_VERSION, '5.3.0', '<')) {
    # Add PHP Version warning to the dashboard
    Add_Action('admin_notices', 'Fancy_Gallery_PHP53_Version_Warning');
    function Fancy_Gallery_PHP53_Version_Warning()
    {
        ?>
    <div class="error">
      <p><?php 
        PrintF('<strong>%1$s:</strong> You need at least <strong>PHP 5.3</strong> or higher to use %1$s. You have PHP %2$s installed. Please ask your hoster for an upgrade.', 'Fancy Gallery', PHP_VERSION);
        ?>
</p>
    </div><?php 
    }
} else {
    # Load core classes
    include DirName(__FILE__) . '/class.core.php';
    include DirName(__FILE__) . '/class.gallery-post-type.php';
    include DirName(__FILE__) . '/class.lightbox.php';
    include DirName(__FILE__) . '/class.i18n.php';
    include DirName(__FILE__) . '/class.mocking-bird.php';
    include DirName(__FILE__) . '/class.options.php';
 function Add_Taxonomy_Archive_Urls()
 {
     foreach (Get_Object_Taxonomies($this->name) as $taxonomy) {
         /*$taxonomy = Get_Taxonomy($taxonomy)*/
         Add_Action($taxonomy . '_edit_form_fields', array($this, 'Print_Taxonomy_Archive_Urls'), 10, 3);
     }
 }
Example #18
0
 public function __construct()
 {
     Add_Action('widgets_init', array($this, 'Load_TextDomain'));
 }
Example #19
0
 static function Init()
 {
     Add_Filter('admin_init', array(__CLASS__, 'defineRewriteRules'));
     Add_Filter('rewrite_rules_array', array(__CLASS__, 'addRewriteRules'));
     Add_Action('admin_init', array(__CLASS__, 'flushRewriteRules'));
 }
Example #20
0
 public function __construct($core)
 {
     $this->core = $core;
     Add_Action('wp_enqueue_scripts', array($this, 'Enqueue_Frontend_Styles'));
     Add_Action('wp_footer', array($this, 'WP_Footer'));
 }
    </p>

    <?php 
        }
        function Widget($args, $settings)
        {
            // Load options
            $this->load_options($settings);
            unset($settings);
            // Check if the Taxonomy is alive
            if (!Taxonomy_Exists($this->Get_Option('taxonomy'))) {
                return False;
            }
            // Display Widget
            echo $args['before_widget'];
            echo $args['before_title'] . Apply_Filters('widget_title', $this->get_option('title'), $settings, $this->id_base) . $args['after_title'];
            echo '<ul>';
            WP_List_Categories(array('taxonomy' => $this->Get_Option('taxonomy'), 'show_count' => $this->Get_Option('count'), 'number' => $this->Get_Option('number'), 'order' => $this->Get_Option('order'), 'orderby' => $this->Get_Option('orderby'), 'exclude' => $this->Get_Option('exclude'), 'title_li' => ''));
            echo '</ul>';
            echo $args['after_widget'];
        }
        function Update($new_settings, $old_settings)
        {
            return $new_settings;
        }
    }
    /* End of Class */
    Add_Action('widgets_init', Create_Function('', 'Register_Widget(\'wp_widget_fancy_taxonomies\');'));
}
/* End of If-Class-Exists-Condition */
/* End of File */
 function __construct()
 {
     // Add the CatchUpload Hook as early as possible
     Add_Action('add_attachment', array($this, 'CatchUpload'), 1);
 }