settings(); add_action( 'admin_menu', array( &$this, 'admin_menu')); 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_enqueue_scripts', array( &$this, 'init_scripts') ); 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', ); /* Install default options */ if ( is_multisite() ) { if ( !get_site_option( 'aspexifblikebox_options' ) ) { add_site_option( 'aspexifblikebox_options', $cf_default, '', 'yes' ); } } else { if ( !get_option( 'aspexifblikebox_options' ) ) add_option( 'aspexifblikebox_options', $cf_default, '', 'yes' ); } /* Get options from the database */ if ( is_multisite() ) $this->cf = get_site_option( 'aspexifblikebox_options' ); else $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' ); } } } 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 Facebook Like Box', 'aspexifblikebox' ), __( 'Facebook Like Box', 'aspexifblikebox' ), 'manage_options', 'aspexi-facebook-like-box.php', 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; // 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', 'Albanian' => 'sq_AL', 'Arabic' => 'ar_AR', 'Armenian' => 'hy_AM', 'Aymara' => 'ay_BO', 'Azeri' => 'az_AZ', 'Basque' => 'eu_ES', 'Belarusian' => 'be_BY', 'Bengali' => 'bn_IN', 'Bosnian' => 'bs_BA', 'Bulgarian' => 'bg_BG', 'Catalan' => 'ca_ES', 'Cherokee' => 'ck_US', 'Croatian' => 'hr_HR', 'Czech' => 'cs_CZ', 'Danish' => 'da_DK', 'Dutch' => 'nl_NL', 'Dutch (Belgium)' => 'nl_BE', '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', 'Finnish (test)' => 'fb_FI', 'French (Canada)' => 'fr_CA', 'French (France)' => 'fr_FR', 'Galician' => 'gl_ES', 'Georgian' => 'ka_GE', 'German' => 'de_DE', 'Greek' => 'el_GR', 'Guaran' => 'gn_PY', 'Gujarati' => 'gu_IN', 'Hebrew' => 'he_IL', 'Hindi' => 'hi_IN', 'Hungarian' => 'hu_HU', 'Icelandic' => 'is_IS', 'Indonesian' => 'id_ID', 'Irish' => 'ga_IE', 'Italian' => 'it_IT', 'Japanese' => 'ja_JP', 'Javanese' => 'jv_ID', 'Kannada' => 'kn_IN', 'Kazakh' => 'kk_KZ', 'Khmer' => 'km_KH', 'Klingon' => 'tl_ST', 'Korean' => 'ko_KR', 'Kurdish' => 'ku_TR', 'Latin' => 'la_VA', 'Latvian' => 'lv_LV', 'Leet Speak' => 'fb_LT', 'Limburgish' => 'li_NL', 'Lithuanian' => 'lt_LT', 'Macedonian' => 'mk_MK', 'Malagasy' => 'mg_MG', 'Malay' => 'ms_MY', 'Malayalam' => 'ml_IN', 'Maltese' => 'mt_MT', 'Marathi' => 'mr_IN', 'Mongolian' => 'mn_MN', 'Nepali' => 'ne_NP', 'Northern Sami' => 'se_NO', 'Norwegian (bokmal)' => 'nb_NO', 'Norwegian (nynorsk)' => 'nn_NO', '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', 'Serbian' => 'sr_RS', 'Simplified Chinese (China)' => 'zh_CN', 'Slovak' => 'sk_SK', 'Slovenian' => 'sl_SI', 'Somali' => 'so_SO', 'Spanish' => 'es_LA', 'Spanish (Chile)' => 'es_CL', 'Spanish (Colombia)' => 'es_CO', 'Spanish (Mexico)' => 'es_MX', 'Spanish (Spain)' => 'es_ES', 'Spanish (Venezuela)' => 'es_VE', 'Swahili' => 'sw_KE', 'Swedish' => 'sv_SE', 'Syriac' => 'sy_SY', 'Tajik' => 'tg_TJ', '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', 'Ukrainian' => 'uk_UA', 'Urdu' => 'ur_PK', 'Uzbek' => 'uz_UZ', 'Vietnamese' => 'vi_VN', 'Welsh' => 'cy_GB', 'Xhosa' => 'xh_ZA', 'Yiddish' => 'yi_DE', 'Zulu' => 'zu_ZA' ); $locales_input = ''; // show form ?>

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(); ?>


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

 get_pro_link(); ?>

get_pro_link(); ?>
 
   px get_pro_link(); ?>
get_pro_link(); ?>
get_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(); ?>
get_pro_link(); ?>

Made by

init_scripts(); echo $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 = 285; $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 5px 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/aspexi-facebook-like-box/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 = ''; $output .= '
'; $output = apply_filters( 'aspexifblikebox_output', $output ); echo $output; } public function init_scripts() { $width = 245; $placement = 'right'; $slideon = 'hover'; 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 ) ); } public static function uninstall() { if ( !is_multisite() ) delete_option( 'aspexifblikebox_options' ); else { global $wpdb; $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); $original_blog_id = get_current_blog_id(); foreach ( $blog_ids as $blog_id ) { switch_to_blog( $blog_id ); delete_option( 'aspexifblikebox_options' ); } switch_to_blog( $original_blog_id ); delete_site_option( 'aspexifblikebox_options' ); } } public function admin_scripts() { // premium only 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; } } /* Let's start the show */ global $aspexifblikebox; $aspexifblikebox = new AspexiFBlikebox(); }