Пример #1
0
 public function init()
 {
     require_once INSTAGRATEPRO_PLUGIN_DIR . 'includes/admin/wp-settings-framework.php';
     $this->wpsf = new igpWordPressSettingsFramework(INSTAGRATEPRO_PLUGIN_DIR . 'includes/admin/igp-settings.php', '');
     add_filter($this->wpsf->get_option_group() . '_settings_validate', array($this, 'validate_settings'));
     $this->settings = wpsf_get_settings(INSTAGRATEPRO_PLUGIN_DIR . 'includes/admin/igp-settings.php');
 }
Пример #2
0
 function __construct()
 {
     global $dmspro_plugin_url;
     $this->plugin_path = plugin_dir_path(__FILE__);
     $this->plugin_url = plugin_dir_url(__FILE__);
     $dmspro_plugin_url = $this->plugin_url;
     $this->l10n = 'wp-settings-framework';
     $this->load_libs();
     add_action('admin_init', array($this, 'fix_wporg'), 9);
     add_action('admin_menu', array($this, 'admin_menu'), 99);
     add_action('template_redirect', array($this, 'section_cache'));
     add_action('template_redirect', array($this, 'browsercss'));
     add_action('init', array($this, 'memcheck'));
     add_action('init', array($this, 'actionmap'));
     add_action('init', array($this, 'lazyload'));
     add_action('init', array($this, 'load_overrides'));
     add_action('init', array($this, 'user_sections'));
     add_action('admin_init', array($this, 'bulk'));
     add_action('init', array($this, 'sections_admin'));
     add_action('init', array($this, 'gfonts'));
     add_filter('pagelines_global_notification', array($this, 'pro_nag'));
     $this->plpro = new WordPressSettingsFramework($this->plugin_path . 'settings/settings-general.php');
     $this->settings = wpsf_get_settings($this->plugin_path . 'settings/settings-general.php');
     add_filter($this->plpro->get_option_group() . '_settings_validate', array($this, 'validate_settings'));
     add_action('pre_post_update', 'dms_pro_cache_delete_all');
     // has to be mega early...
     if ('1' === $this->settings['settingsgeneral_cdn_cdn-enabled']) {
         define('WP_STACK_CDN_DOMAIN', $this->settings['settingsgeneral_cdn_cdn-url']);
         define('WP_STAGE', 'production');
         new PL_WP_Stack_CDN_Plugin();
     }
     new DMS_Hacks();
 }
 function __construct()
 {
     $this->plugin_path = plugin_dir_path(__FILE__);
     $this->plugin_url = plugin_dir_url(__FILE__);
     $this->plugin_version = '1.0.6';
     $this->plugin_l10n = 'wp-trello';
     $this->request_token_url = $this->api_base . 'OAuthGetRequestToken';
     $this->authorize_url = $this->api_base . 'OAuthAuthorizeToken';
     $this->access_token_url = $this->api_base . 'OAuthGetAccessToken';
     $this->callback_url = get_admin_url() . 'options-general.php?page=wp-trello';
     // Set up l10n
     load_plugin_textdomain($this->plugin_l10n, false, dirname(plugin_basename(__FILE__)) . '/lang');
     // Hooks and Filters
     add_action('admin_enqueue_scripts', array($this, 'add_admin_scripts'));
     add_action('admin_menu', array($this, 'add_settings_menu'));
     add_action('admin_init', array($this, 'trello_connect'));
     add_action('wp_ajax_wpt_get_objects', array($this, 'wpt_get_objects'));
     add_action('wp_ajax_wpt_disconnect', array($this, 'wpt_disconnect'));
     add_filter('plugin_action_links', array($this, 'plugin_settings_link'), 10, 2);
     add_action('wp_enqueue_scripts', array($this, 'custom_css'));
     add_shortcode('wp-trello', array($this, 'trello_data'));
     if ($this->is_connected()) {
         add_action('widgets_init', create_function('', 'register_widget( "wpt_widget" );'));
     }
     // oAuth
     require_once $this->plugin_path . 'includes/trello.php';
     // Settings
     require_once $this->plugin_path . 'includes/wp-settings-framework.php';
     $this->wpsf = new wpt_WordPressSettingsFramework($this->plugin_path . 'includes/wpt-settings.php');
     add_filter($this->wpsf->get_option_group() . '_settings_validate', array(&$this, 'validate_settings'));
     $this->settings = wpsf_get_settings($this->plugin_path . 'includes/wpt-settings.php');
 }
Пример #4
0
 public function __construct_after_theme()
 {
     /* admin options */
     require_once $this->plugin_path . 'wp-settings-framework.php';
     $this->wpsf = new WordPressSettingsFramework($this->plugin_path . 'settings/sbrssfeed-cfg.php');
     /* load CFG */
     $this->CFG = wpsf_get_settings($this->plugin_path . 'settings/sbrssfeed-cfg.php');
     // print_r($this->CFG);
     // SET defaults if empty
     if (!isset($this->CFG['sbrssfeedcfg_tags_addTag_enclosure'])) {
         $this->CFG['sbrssfeedcfg_tags_addTag_enclosure'] = 1;
     }
     if (!isset($this->CFG['sbrssfeedcfg_tags_addTag_mediaContent'])) {
         $this->CFG['sbrssfeedcfg_tags_addTag_mediaContent'] = 1;
     }
     if (!isset($this->CFG['sbrssfeedcfg_tags_addTag_mediaThumbnail'])) {
         $this->CFG['sbrssfeedcfg_tags_addTag_mediaThumbnail'] = 1;
     }
     if (!isset($this->CFG['sbrssfeedcfg_description_extend_description'])) {
         $this->CFG['sbrssfeedcfg_description_extend_description'] = 1;
     }
     if (!isset($this->CFG['sbrssfeedcfg_description_extend_content'])) {
         $this->CFG['sbrssfeedcfg_description_extend_content'] = 1;
     }
     if (!isset($this->CFG['sbrssfeedcfg_signature_addSignature'])) {
         $this->CFG['sbrssfeedcfg_signature_addSignature'] = 0;
     }
     if (!isset($this->CFG['sbrssfeedcfg_fulltext_fulltext_override'])) {
         $this->CFG['sbrssfeedcfg_fulltext_fulltext_override'] = 0;
     }
     if (!isset($this->CFG['sbrssfeedcfg_fulltext_fulltext_add2description'])) {
         $this->CFG['sbrssfeedcfg_fulltext_fulltext_add2description'] = 0;
     }
     if ($this->CFG['sbrssfeedcfg_info_version'] == '') {
         // new install
     } else {
         if ($this->CFG['sbrssfeedcfg_info_version'] !== $this->cfg_version) {
             // show settings update warning...
             $this->update_warning = true;
             add_action('admin_notices', array($this, "addAdminAlert"));
         }
     }
     add_action('wpsf_before_settings_fields', array($this, 'update_current_version'));
     add_action('wpsf_after_settings', array($this, 'plugin_donation'));
     // add_action( "rss2_ns", array( $this, "feed_addNameSpace") );
     add_action("rss_item", array($this, "feed_addMeta"), 5, 1);
     add_action("rss2_item", array($this, "feed_addMeta"), 5, 1);
     if ($this->CFG['sbrssfeedcfg_description_extend_description'] == 1) {
         add_filter('the_excerpt_rss', array($this, "feed_update_content"));
     }
     if ($this->CFG['sbrssfeedcfg_description_extend_content'] == 1) {
         add_filter('the_content_feed', array($this, "feed_update_content"));
     }
     if ($this->CFG['sbrssfeedcfg_inrssAd_inrssAd_enabled'] == 1) {
         add_filter('the_content_feed', array($this, "feed_update_content_injectAd"));
     }
     if ($this->CFG['sbrssfeedcfg_fulltext_fulltext_override'] == 1) {
         $this->fulltext_override();
     }
 }
 function __construct()
 {
     include_once ABSPATH . 'wp-admin/includes/plugin.php';
     //Common used variables
     global $wpdb;
     $this->plugin_name = 'bbpress-like-button';
     $this->plugin_path = plugin_dir_path(__FILE__);
     $this->l10n = 'bbpl';
     $this->table_name = $wpdb->prefix . 'postmeta';
     //This plugin depends on bbPress
     if (!is_plugin_active('bbpress/bbpress.php')) {
         wp_die(__("bbPress Like Button needs bbPress installed and activated in order to work.", $this->l10n));
     }
     //Buddypress compatibility
     update_option('bbpl_buddypress', (int) is_plugin_active('buddypress/bp-loader.php'));
     //Include and create a new WordPressSettingsFramework
     require_once $this->plugin_path . 'wp-settings-framework.php';
     $this->wpsf = new WordPressSettingsFramework($this->plugin_path . 'settings/settings-bbpl.php');
     add_filter($this->wpsf->get_option_group() . '_settings_validate', array($this, 'settings_validate'));
     //Get plugin settings
     $this->settings = wpsf_get_settings($this->plugin_path . 'settings/settings-bbpl.php');
     if (!$this->settings) {
         //Defaults
         $this->settings = array('settingsbbpl_bbpl_general_autoembed' => 1, 'settingsbbpl_bbpl_general_show_number' => 0, 'settingsbbpl_bbpl_general_show_tooltip' => 1);
     }
     //Output
     if ((bool) $this->settings['settingsbbpl_bbpl_general_autoembed']) {
         add_action('bbp_theme_before_reply_admin_links', array($this, 'bbpl_show_button'));
     }
     //Inits and menus
     add_action('init', array($this, 'init'));
     add_action('admin_menu', array($this, 'admin_menu'));
     add_action('admin_init', array($this, 'admin_init'));
     //Scripts and Styles
     add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'public_enqueue_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'public_styles'));
     //Ajax requests
     add_action('wp_ajax_like_this', array($this, 'like_this'));
     add_action('wp_ajax_nopriv_like_this', array($this, 'like_this'));
     add_action('wp_ajax_delete_like', array($this, 'delete_like'));
     //Shortcodes
     add_shortcode('most_liked_users', array($this, 'get_most_liked_users_shortcode'));
     add_shortcode('most_liking_users', array($this, 'get_most_liking_users_shortcode'));
     add_shortcode('most_liked_posts', array($this, 'get_most_liked_posts_shortcode'));
     //Load text strings
     $this->load_labels();
     //Add settings link to plugins page
     add_filter('plugin_action_links', array($this, 'settings_link'), 10, 4);
 }
Пример #6
0
 function __construct()
 {
     global $wp_scripts, $dmspro_plugin_url;
     // no dms? OH NOES!
     if (!function_exists('pl_detect_ie')) {
         return false;
     }
     $this->urls = array($dmspro_plugin_url . 'libs/js/html5.min.js', $dmspro_plugin_url . 'libs/js/respond.min.js', $dmspro_plugin_url . 'libs/js/selectivizr-min.js');
     $this->ie_ver = pl_detect_ie();
     $this->useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
     $settings = wpsf_get_settings('../settings/settings-general.php');
     if (isset($settings['settingsgeneral_browsercss_css-type']) && 'js' == $settings['settingsgeneral_browsercss_css-type']) {
         wp_register_script('browser-detect', $dmspro_plugin_url . 'libs/js/browser.js', array('jquery'));
         wp_enqueue_script('browser-detect');
         add_action('wp_head', array($this, 'hack_scripts'), 25);
     } else {
         add_filter('body_class', array(&$this, 'body_class'));
         add_action('the_html_tag', array($this, 'add_ie_class'));
         add_action('wp_head', array($this, 'hack_scripts'), 25);
     }
 }
Пример #7
0
 public static final function get_settings()
 {
     return wp_parse_args(wpsf_get_settings(BP_PLUGIN_DIR . '/bp-links-settings.php', self::OPTION_GROUP), self::get_defaults());
 }
Пример #8
0
<?php

global $wpsf_settings, $SB_RSS_feed_plus;
$CFG = wpsf_get_settings($SB_RSS_feed_plus->plugin_path . 'settings/sbrssfeed-cfg.php');
$thumbs = array('full' => __('= Full size =', 'SB_RSS_feed_plus'));
$thumbs_raw = get_intermediate_image_sizes();
foreach ($thumbs_raw as $th) {
    $thumbs[$th] = __($th, 'SB_RSS_feed_plus');
}
$wpsf_settings[] = array('section_id' => 'tags', 'section_title' => __('Add Image RSS Feed tags', 'SB_RSS_feed_plus'), 'section_description' => __('"enclosure" and "media:content" / "media:thumbnail" tags in RSS feed are used to tell RSS parser about post thumbnail.', 'SB_RSS_feed_plus'), 'section_order' => 10, 'fields' => array(array('id' => 'addTag_enclosure', 'title' => __('Add "enclosure" tag', 'SB_RSS_feed_plus'), 'desc' => '', 'type' => 'checkbox', 'std' => 1), array('id' => 'addTag_mediaContent', 'title' => __('Add "media:content" tag', 'SB_RSS_feed_plus'), 'desc' => '', 'type' => 'checkbox', 'std' => 1), array('id' => 'addTag_mediaContent_size', 'title' => __(' - image size', 'SB_RSS_feed_plus'), 'type' => 'select', 'type' => 'select', 'choices' => $thumbs), array('id' => 'addTag_mediaThumbnail', 'title' => __('Add "media:thumbnail" tag', 'SB_RSS_feed_plus'), 'desc' => '', 'type' => 'checkbox', 'std' => 1), array('id' => 'addTag_mediaThumbnail_size', 'title' => __(' - image size', 'SB_RSS_feed_plus'), 'type' => 'select', 'type' => 'select', 'choices' => $thumbs)));
$wpsf_settings[] = array('section_id' => 'description', 'section_title' => __('Extend HTML content', 'SB_RSS_feed_plus'), 'section_description' => __('This will extend the HTML code of "description" and "content:encoded" tags with 90% wide image before the text.', 'SB_RSS_feed_plus'), 'section_order' => 20, 'fields' => array(array('id' => 'extend_description', 'title' => __('Extend "description" (excerpt)', 'SB_RSS_feed_plus'), 'desc' => '', 'type' => 'checkbox', 'std' => 1), array('id' => 'extend_content', 'title' => __('Extend "content:encoded" HTML', 'SB_RSS_feed_plus'), 'desc' => '', 'type' => 'checkbox', 'std' => 1), array('id' => 'extend_content_size', 'title' => __(' - image size', 'SB_RSS_feed_plus'), 'type' => 'select', 'type' => 'select', 'choices' => $thumbs)));
$rss_use_excerpt = get_option('rss_use_excerpt');
$rss_fulltext_link = site_url() . '/feed/?fsk=';
$CFG['sbrssfeedcfg_fulltext_fulltext_override_secrete'] ? $rss_fulltext_link .= $CFG['sbrssfeedcfg_fulltext_fulltext_override_secrete'] : ($rss_fulltext_link .= '-NOT-SET-');
$wpsf_settings[] = array('section_id' => 'fulltext', 'section_title' => __('RSS Feed fulltext override', 'SB_RSS_feed_plus'), 'section_description' => __('Override "excerpt only" RSS feed when requested with "secret" key.', 'SB_RSS_feed_plus'), 'section_order' => 25, 'fields' => array(array('id' => 'fulltext_wp_option', 'title' => __('WordPress RSS Feed mode', 'SB_RSS_feed_plus'), 'desc' => '', 'type' => 'custom', 'std' => $rss_use_excerpt ? __('Excerpt only - there is only excerpt in the standard RSS Feed...<br />However, requesting feed url with special "secret key" will display full content of each post (great for services like Google Currents).', 'SB_RSS_feed_plus') : __('Fulltext - your feed already contains whole post content.', 'SB_RSS_feed_plus')), array('id' => 'fulltext_override', 'title' => __('Enable fulltext override', 'SB_RSS_feed_plus'), 'desc' => $rss_use_excerpt ? '<em>' . __('When enabled, you can request RSS Feed with full post content with special URL (added query string <strong>?fsk=</strong>)', 'SB_RSS_feed_plus') . '</em>' : '<em>' . __('You don\'t need to override WordPress settings - your feed already contains full post content.', 'SB_RSS_feed_plus') . '</em>', 'type' => 'checkbox', 'std' => 0), array('id' => 'fulltext_add2description', 'title' => __('Fulltext in &lt;description&gt; tag ', 'SB_RSS_feed_plus'), 'desc' => '<em>' . __('When enabled, &lt;description&gt; tag in RSS feed will be replaced with full article (only when called with query string <strong>?fsk=</strong>).', 'SB_RSS_feed_plus') . '</em>', 'type' => 'checkbox', 'std' => 0), array('id' => 'fulltext_override_secrete', 'title' => __('Override "secret" key (?fsk= param)', 'SB_RSS_feed_plus'), 'desc' => __('Fulltext RSS Feed:', 'SB_RSS_feed_plus') . ' <a href="' . $rss_fulltext_link . '" target="_blank">' . $rss_fulltext_link . '</a>', 'type' => 'text', 'std' => uniqid())));
$wpsf_settings[] = array('section_id' => 'metaExtension', 'section_title' => __('RSS and Image extra meta data', 'SB_RSS_feed_plus'), 'section_description' => __('', 'SB_RSS_feed_plus'), 'section_order' => 28, 'fields' => array(array('id' => 'addMediaMetaCopyright', 'title' => __('Remove copyright meta', 'SB_RSS_feed_plus'), 'desc' => 'tags "media:copyright", "media:title" and "media:description"', 'type' => 'checkbox', 'std' => 0)));
$wpsf_settings[] = array('section_id' => 'signature', 'section_title' => __('RSS Feed signature', 'SB_RSS_feed_plus'), 'section_description' => __('Add "Source: XYZ" text to end of the content of each feed item.', 'SB_RSS_feed_plus'), 'section_order' => 30, 'fields' => array(array('id' => 'addSignature', 'title' => __('Add signature', 'SB_RSS_feed_plus'), 'desc' => '', 'type' => 'checkbox', 'std' => 0)));
$wpsf_settings[] = array('section_id' => 'inrssAd', 'section_title' => __('RSS Feed advertisement', 'SB_RSS_feed_plus'), 'section_description' => __('Inject "ad" to RSS feed items (image with link). Ad will be inserted only to full text "content:encoded" tag.', 'SB_RSS_feed_plus'), 'section_order' => 40, 'fields' => array(array('id' => 'inrssAd_enabled', 'title' => __('Inject ad to feed posts', 'SB_RSS_feed_plus'), 'desc' => '', 'type' => 'checkbox', 'std' => 0), array('id' => 'inrssAd_img', 'title' => __('Ad image', 'SB_RSS_feed_plus'), 'desc' => __('image will be stretched up to 700px of width', 'SB_RSS_feed_plus'), 'type' => 'file', 'std' => ''), array('id' => 'inrssAd_title', 'title' => __('Ad title', 'SB_RSS_feed_plus'), 'type' => 'text'), array('id' => 'inrssAd_link', 'title' => __('Ad target link', 'SB_RSS_feed_plus'), 'desc' => __('Recommendation: use bit.ly or similar service to track clicks...', 'SB_RSS_feed_plus'), 'type' => 'text'), array('id' => 'inrssAd_injectAfter', 'title' => __('Inject ad after nth paragraph', 'SB_RSS_feed_plus'), 'type' => 'select', 'type' => 'select', 'std' => '2', 'choices' => array('1' => __('1st paragraph', 'SB_RSS_feed_plus'), '2' => __('2nd paragraph', 'SB_RSS_feed_plus'), '3' => __('3rd paragraph', 'SB_RSS_feed_plus'), '4' => __('4th paragraph', 'SB_RSS_feed_plus'), '5' => __('5th paragraph', 'SB_RSS_feed_plus'), '6' => __('6th paragraph', 'SB_RSS_feed_plus'), '7' => __('7th paragraph', 'SB_RSS_feed_plus')))));