settings(); add_action( 'admin_menu', array( &$this, 'admin_menu')); add_action( 'admin_notices', array( &$this, 'admin_notices')); add_action( 'init', array( &$this, 'init' ), 10 ); add_action( 'wp_footer', array( &$this, 'get_html' ), 21 ); add_action( 'admin_enqueue_scripts',array( &$this, 'admin_scripts') ); add_action( 'wp_ajax_afbl_hide_notice', array( &$this, 'admin_notices_handle') ); add_action( 'wp_enqueue_scripts', array( &$this, 'init_scripts') ); add_filter( 'plugin_action_links', array( &$this, 'settings_link' ), 10, 2); register_uninstall_hook( __FILE__, array( 'AspexiFBlikebox', 'uninstall' ) ); } /* WP init action */ public function init() { /* Internationalization */ load_plugin_textdomain( 'aspexifblikebox', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); /* Exras */ $this->extras_init(); } public function settings() { /* Defaults */ $cf_default = array( 'aspexifblikebox_version' => ASPEXIFBLIKEBOX_VERSION, 'url' => '', 'locale' => 'en_GB', 'status' => 'enabled', 'page_plugin' => 'enabled', 'hide_notice' => '0' ); if ( !get_option( 'aspexifblikebox_options' ) ) add_option( 'aspexifblikebox_options', $cf_default, '', 'yes' ); $this->cf = get_option( 'aspexifblikebox_options' ); /* Upgrade */ if( $this->cf['aspexifblikebox_version'] != ASPEXIFBLIKEBOX_VERSION ) { switch( $this->cf['aspexifblikebox_version'] ) { case '1.0.0': $this->cf['status'] = 'enabled'; $this->cf['aspexifblikebox_version'] = ASPEXIFBLIKEBOX_VERSION; update_option( 'aspexifblikebox_options', $this->cf, '', 'yes' ); break; default: $this->cf = array_merge( $cf_default, (array)$this->cf ); $this->cf['aspexifblikebox_version'] = ASPEXIFBLIKEBOX_VERSION; update_option( 'aspexifblikebox_options', $this->cf, '', 'yes' ); } } } public function settings_link( $action_links, $plugin_file ){ if( $plugin_file == plugin_basename(__FILE__) ) { $pro_link = $this->get_pro_link(); array_unshift( $action_links, $pro_link ); $settings_link = '' . __("Settings") . ''; array_unshift( $action_links, $settings_link ); } return $action_links; } private function add_message( $message ) { $message = trim( $message ); if( strlen( $message ) ) $this->messages[] = $message; } private function add_error( $error ) { $error = trim( $error ); if( strlen( $error ) ) $this->errors[] = $error; } public function has_errors() { return count( $this->errors ); } public function display_admin_notices( $echo = false ) { $ret = ''; foreach( (array)$this->errors as $error ) { $ret .= '

'.$error.'

'; } foreach( (array)$this->messages as $message ) { $ret .= '

'.$message.'

'; } if( $echo ) echo $ret; else return $ret; } public function admin_menu() { add_submenu_page( 'themes.php', __( 'Aspexi Like Box Slider', 'aspexifblikebox' ), __( 'Aspexi Like Box Slider', 'aspexifblikebox' ), 'manage_options', basename(__FILE__), array( &$this, 'admin_page') ); } public function admin_page() { if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } $preview = false; if( isset( $_REQUEST['pp'] ) && check_admin_referer( 'page_plugin_toggle' ) ) { if( 'enabled' == $this->is_pp() && 'disable' == $_REQUEST['pp']) { $this->cf['page_plugin'] = 'disabled'; update_option( 'aspexifblikebox_options', $this->cf, '', 'yes' ); } } // request action if ( isset( $_REQUEST['afblb_form_submit'] ) && check_admin_referer( plugin_basename(__FILE__), 'afblb_nonce_name' ) ) { if( !in_array( $_REQUEST['afblb_status'], array('enabled','disabled') ) ) $this->add_error( __( 'Wrong or missing status. Available statuses: enabled and disabled. Settings not saved.', 'aspexifblikebox' ) ); if( !$this->has_errors() ) { $aspexifblikebox_request_options = array(); $aspexifblikebox_request_options['url'] = isset( $_REQUEST['afblb_url'] ) ? trim( $_REQUEST['afblb_url'] ) : ''; $aspexifblikebox_request_options['locale'] = isset( $_REQUEST['afblb_locale'] ) ? $_REQUEST['afblb_locale'] : ''; $aspexifblikebox_request_options['status'] = isset( $_REQUEST['afblb_status'] ) ? $_REQUEST['afblb_status'] : ''; $this->cf = array_merge( (array)$this->cf, $aspexifblikebox_request_options ); update_option( 'aspexifblikebox_options', $this->cf, '', 'yes' ); $this->add_message( __( 'Settings saved.', 'aspexifblikebox' ) ); } // Preview maybe if( @$_REQUEST['preview'] ) $preview = true; else $preview = false; } // Locale $locales = array( 'Afrikaans' => 'af_ZA', 'Akan' => 'ak_GH', 'Albanian' => 'sq_AL', 'Amharic' => 'am_ET', 'Arabic' => 'ar_AR', 'Armenian' => 'hy_AM', 'Assamese' => 'as_IN', 'Aymara' => 'ay_BO', 'Azerbaijani' => 'az_AZ', 'Basque' => 'eu_ES', 'Belarusian' => 'be_BY', 'Bengali' => 'bn_IN', 'Bosnian' => 'bs_BA', 'Breton' => 'br_FR', 'Bulgarian' => 'bg_BG', 'Burmese' => 'my_MM', 'Catalan' => 'ca_ES', 'Cebuano' => 'cx_PH', 'Cherokee' => 'ck_US', 'Chewa' => 'ny_MW', 'Classical Greek' => 'gx_GR', 'Corsican' => 'co_FR', 'Croatian' => 'hr_HR', 'Czech' => 'cs_CZ', 'Danish' => 'da_DK', 'Dutch (België)' => 'nl_BE', 'Dutch' => 'nl_NL', 'English (India)' => 'en_IN', 'English (Pirate)' => 'en_PI', 'English (UK)' => 'en_GB', 'English (Upside Down)' => 'en_UD', 'English (US)' => 'en_US', 'Esperanto' => 'eo_EO', 'Estonian' => 'et_EE', 'Faroese' => 'fo_FO', 'Filipino' => 'tl_PH', 'Finnish' => 'fi_FI', 'French (Canada)' => 'fr_CA', 'French (France)' => 'fr_FR', 'Frisian' => 'fy_NL', 'Fulah' => 'ff_NG', 'Galician' => 'gl_ES', 'Ganda' => 'lg_UG', 'Georgian' => 'ka_GE', 'German' => 'de_DE', 'Greek' => 'el_GR', 'Guarani' => 'gn_PY', 'Gujarati' => 'gu_IN', 'Hausa' => 'ha_NG', 'Hebrew' => 'he_IL', 'Hindi' => 'hi_IN', 'Hungarian' => 'hu_HU', 'Icelandic' => 'is_IS', 'Igbo' => 'ig_NG', 'Indonesian' => 'id_ID', 'Irish' => 'ga_IE', 'Italian' => 'it_IT', 'Japanese (Kansai)' => 'ja_KS', 'Japanese' => 'ja_JP', 'Javanese' => 'jv_ID', 'Kannada' => 'kn_IN', 'Kazakh' => 'kk_KZ', 'Khmer' => 'km_KH', 'Kinyarwanda' => 'rw_RW', 'Klingon' => 'tl_ST', 'Korean' => 'ko_KR', 'Kurdish (Kurmanji)' => 'ku_TR', 'Lao' => 'lo_LA', 'Latin' => 'la_VA', 'Latvian' => 'lv_LV', 'Leet Speak' => 'fb_LT', 'Limburgish' => 'li_NL', 'Lingala' => 'ln_CD', 'Lithuanian' => 'lt_LT', 'Macedonian' => 'mk_MK', 'Malagasy' => 'mg_MG', 'Malay' => 'ms_MY', 'Malayalam' => 'ml_IN', 'Maltese' => 'mt_MT', 'Marathi' => 'mr_IN', 'Mongolian' => 'mn_MN', 'Ndebele' => 'nd_ZW', 'Nepali' => 'ne_NP', 'Northern Sámi' => 'se_NO', 'Norwegian (bokmal)' => 'nb_NO', 'Norwegian (nynorsk)' => 'nn_NO', 'Oriya' => 'or_IN', 'Pashto' => 'ps_AF', 'Persian' => 'fa_IR', 'Polish' => 'pl_PL', 'Portuguese (Brazil)' => 'pt_BR', 'Portuguese (Portugal)' => 'pt_PT', 'Punjabi' => 'pa_IN', 'Quechua' => 'qu_PE', 'Romanian' => 'ro_RO', 'Romansh' => 'rm_CH', 'Russian' => 'ru_RU', 'Sanskrit' => 'sa_IN', 'Sardinian' => 'sc_IT', 'Serbian' => 'sr_RS', 'Shona' => 'sn_ZW', 'Silesian' => 'sz_PL', 'Simplified Chinese (China)' => 'zh_CN', 'Sinhala' => 'si_LK', 'Slovak' => 'sk_SK', 'Slovenian' => 'sl_SI', 'Somali' => 'so_SO', 'Sorani Kurdish' => 'cb_IQ', 'Spanish (Colombia)' => 'es_CO', 'Spanish (Spain)' => 'es_ES', 'Spanish' => 'es_LA', 'Swahili' => 'sw_KE', 'Swedish' => 'sv_SE', 'Syriac' => 'sy_SY', 'Tajik' => 'tg_TJ', 'Tamazight' => 'tz_MA', 'Tamil' => 'ta_IN', 'Tatar' => 'tt_RU', 'Telugu' => 'te_IN', 'Thai' => 'th_TH', 'Traditional Chinese (Hong Kong)' => 'zh_HK', 'Traditional Chinese (Taiwan)' => 'zh_TW', 'Turkish' => 'tr_TR', 'Turkmen' => 'tk_TM', 'Ukrainian' => 'uk_UA', 'Urdu' => 'ur_PK', 'Uzbek' => 'uz_UZ', 'Vietnamese' => 'vi_VN', 'Welsh' => 'cy_GB', 'Wolof' => 'wo_SN', 'Xhosa' => 'xh_ZA', 'Yiddish' => 'yi_DE', 'Yoruba' => 'yo_NG', 'Zazaki' => 'zz_TR', 'Zulu' => 'zu_ZA' ); $locales_input = ''; ?>

display_admin_notices( true ); ?>

http://www.facebook.com/ 
 pxget_pro_link(); ?>
 pxget_pro_link(); ?>
get_pro_link(); ?>
get_pro_link(); ?>
get_pro_link(); ?>

get_pro_link(); ?>

get_pro_link(); ?>

get_pro_link(); ?>

get_pro_link(); ?>
get_pro_link(); ?>

get_pro_link(); ?>


 pxget_pro_link(); ?>
 
 
 
   px get_pro_link(); ?>
   get_pro_link(); ?>

 get_pro_link(); ?>

0 ) : ?>
  get_pro_link(); ?>
get_pro_link(); ?>
 
   px get_pro_link(); ?>
get_pro_link(); ?>
 pxget_pro_link(); ?>
get_pro_link(); ?>
 get_pro_link(); ?>
get_pro_link(); ?>
   (1000 milliseconds = 1 second)
get_pro_link(); ?>
   (1000 milliseconds = 1 second)
get_pro_link(); ?>

px from:
get_pro_link(); ?>


get_pro_link(); ?>

get_pro_link(); ?>


get_pro_link(); ?>
get_pro_link(); ?>
get_pro_link(); ?>
get_pro_link(); ?>
' . $post_type . '
'; } ?> get_pro_link(); ?>
get_pro_link(); ?>

get_pro_link(); ?>

get_pro_link(); ?>
get_pro_link(); ?>
get_pro_link(); ?>
get_pro_link(); ?>

Check out now.'); ?>

init_scripts(); $this->get_html($preview); } } public function get_pro_url() { return 'http://aspexi.com/downloads/aspexi-facebook-like-box-slider-hd/?src=free_plugin'; } public function get_pro_link() { $ret = ''; $ret .= '   '.__( 'Get PRO version', 'aspexifblikebox' ).''; return $ret; } public function get_html( $preview = false ) { $url = apply_filters( 'aspexifblikebox_url', $this->cf['url'] ); $status = apply_filters( 'aspexifblikebox_status', $this->cf['status'] ); // Disable maybe if( ( !strlen( $url ) || 'enabled' != $status ) && !$preview ) return; // Options $locale = apply_filters( 'aspexifblikebox_locale', $this->cf['locale'] ); $height = 234; $width = 245; $placement = 'right'; $btspace = 0; $btimage = 'fb1-right.png'; $bordercolor = '#3B5998'; $borderwidth = 2; $bgcolor = '#ffffff'; $css_placement = array(); if( 'left' == $placement ) { $css_placement[0] = 'right'; $css_placement[1] = '0 '.(48+$btspace).'px 0 5px'; } else { $css_placement[0] = 'left'; $css_placement[1] = '0 0 0 '.(48+$btspace).'px'; } $css_placement[2] = '50%;margin-top:-'.floor($height/2).'px'; $smallscreenscss = ''; if( $width > 0 ) { $widthmax = (int)($width + 48 + $borderwidth + 10); $smallscreenscss = '@media (max-width: '.$widthmax.'px) { .aspexifblikebox { display: none; } }'; } $stream = 'false'; $header = 'false'; // Facebook button image (check in THEME CHILD -> THEME PARENT -> PLUGIN DIR) // TODO: move this to admin page $users_button_custom = '/plugins/'.basename( dirname( __FiLE__ ) ).'/images/aspexi-fb-custom.png'; $users_button_template = get_template_directory() . $users_button_custom; $users_button_child = get_stylesheet_directory() . $users_button_custom; $button_uri = ''; if( file_exists( $users_button_child ) ) $button_uri = get_stylesheet_directory_uri() . $users_button_custom; elseif( file_exists( $users_button_template ) ) $button_uri = get_template_directory_uri() . $users_button_custom; elseif( file_exists( plugin_dir_path( __FILE__ ).'images/'.$btimage ) ) $button_uri = ASPEXIFBLIKEBOX_URL.'images/'.$btimage; if( '' == $button_uri ) { $button_uri = ASPEXIFBLIKEBOX_URL.'images/fb1-right.png'; } $button_uri = apply_filters( 'aspexifblikebox_button_uri', $button_uri ); $output = ''; $page_url = 'https://www.facebook.com/'.$url; $output .= '
'; $output = apply_filters( 'aspexifblikebox_output', $output ); echo $output; } public function init_scripts() { $width = 245; $placement = 'right'; $slideon = 'hover'; $ismobile = wp_is_mobile(); wp_enqueue_script( 'aspexi-facebook-like-box', ASPEXIFBLIKEBOX_URL . 'js/aflb.js', array( 'jquery' ), false, true ); wp_localize_script( 'aspexi-facebook-like-box', 'aflb', array( 'slideon' => $slideon, 'placement' => $placement, 'width' => (int)$width, 'ismobile' => $ismobile ) ); } public static function uninstall() { delete_option( 'aspexifblikebox_options' ); } public function admin_scripts() { wp_enqueue_script( 'aspexi-facebook-like-box-admin', ASPEXIFBLIKEBOX_URL . 'js/aflb-admin.js', array( 'jquery' ), false, true ); wp_localize_script( 'aspexi-facebook-like-box-admin', 'aflb_admin', array( 'nonce' => wp_create_nonce( "afblhidenotice-nonce" ) ) ); return; } public function extras_init() { /* qTranslate */ add_filter( 'aspexifblikebox_admin_settings', array( &$this, 'extras_qtranslate_admin' ) ); add_filter( 'aspexifblikebox_admin_settings', array( &$this, 'extras_polylang_admin' ) ); } public function extras_qtranslate_detect() { global $q_config; return (isset($q_config) && !empty($q_config)); } public function extras_qtranslate_admin( $extra_admin_content ) { $qtranslate_locale = $this->extras_qtranslate_detect(); if( $qtranslate_locale ) { $extra_admin_content .= ' '.__('qTranslate/mqTranslate', 'aspexifblikebox').'
'.__('Try to detect qTranslate/mqTranslate language and force it instead of language set in Localization.', 'aspexifblikebox').' '.$this->get_pro_link().' '; } return $extra_admin_content; } public function extras_polylang_admin( $extra_admin_content ) { if(function_exists('pll_current_language')) { $extra_admin_content .= ' '.__('Polylang', 'aspexifblikebox').'
'.__('Try to detect Polylang language and force it instead of language set in Localization.', 'aspexifblikebox').' '.$this->get_pro_link().' '; } return $extra_admin_content; } // Check if Page Plugin is enabled public function is_pp() { return $this->cf['page_plugin']; } public function admin_notices() { if( !isset($this->cf['hide_notice']) || @$this->cf['hide_notice'] != '1' ) { ?>

ASecure.me services.', 'aspexifblikebox' ); ?>

cf['hide_notice'] = '1'; update_option( 'aspexifblikebox_options', $this->cf, '', 'yes' ); die(); } } /* Let's start the show */ global $aspexifblikebox; $aspexifblikebox = new AspexiFBlikebox(); }