@anywhere javascript code to your blog. Built by @TheFrosty. * Version: 0.2.5.1 * Author: Austin Passy * Author URI: http://frostywebdesigns.com * * @copyright 2010 * @author Austin Passy * @link http://frostywebdesigns.com/ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * @package Anywhere */ /** * Version 3.0 checker * @since 0.1 */ global $wp_db_version; $version = 'false'; if ( $wp_db_version > 13000 ) { $version = 'true'; //Version 3.0 or greater! } /** * Make sure we get the correct directory. * @since 0.1 */ if ( !defined( 'WP_CONTENT_URL' ) ) define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); if ( !defined( 'WP_CONTENT_DIR' ) ) define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); if ( !defined( 'WP_PLUGIN_URL' ) ) define('WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' ); if ( !defined( 'WP_PLUGIN_DIR' ) ) define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); /** * Define constant paths to the plugin folder. * @since 0.1 */ define( ANYWHERE, WP_PLUGIN_DIR . '/anywhere' ); define( ANYWHERE_URL, WP_PLUGIN_URL . '/anywhere' ); define( ANYWHERE_ADMIN, WP_PLUGIN_DIR . '/anywhere/library/admin' ); define( ANYWHERE_INCLUDES, WP_PLUGIN_DIR . '/anywhere/library/includes' ); define( ANYWHERE_CSS, WP_PLUGIN_URL . '/anywhere/library/css' ); define( ANYWHERE_JS, WP_PLUGIN_URL . '/anywhere/library/js' ); /** * Add the settings page to the admin menu. * @since 0.1 */ add_action( 'init', 'anywhere_admin_warnings' ); add_action( 'admin_init', 'anywhere_admin_init' ); add_action( 'admin_menu', 'anywhere_add_pages' ); add_action( 'wp_print_scripts', 'anywhere_script' ); add_action( 'wp_head', 'anywhere_options' ); add_action( 'wp_head', 'anywhere_tweet_box' ); /** * Filters. * @since 0.1 */ add_filter( 'plugin_action_links', 'anywhere_plugin_actions', 10, 2 ); //Add a settings page to the plugin menu add_filter( 'the_content', 'anywhere_tweet_box_div' ); /** * Load the admin files. * @since 0.1 */ if ( is_admin() ) : require_once( ANYWHERE_ADMIN . '/settings-admin.php' ); require_once( ANYWHERE_ADMIN . '/dashboard.php' ); endif; /** * Load external files */ require_once( ANYWHERE_INCLUDES . '/shortcodes.php' ); /** * Load the settings from the database. * @since 0.1 */ $anywhere = get_option( 'anywhere_settings' ); /** * Load the stylesheet * @since 0.1 */ function anywhere_admin_init() { wp_register_style( 'anywhere-tabs', ANYWHERE_CSS . '/tabs.css' ); wp_register_style( 'anywhere-admin', ANYWHERE_CSS . '/anywhere-admin.css' ); } /** * Function to add the settings page * @since 0.1 */ function anywhere_add_pages() { if ( function_exists( 'add_options_page' ) ) $page = add_options_page( 'Anywhere Settings', '@Anywhere', 10, 'anywhere.php', anywhere_page ); add_action( 'admin_print_styles-' . $page, 'anywhere_admin_style' ); add_action( 'admin_print_scripts-' . $page, 'anywhere_admin_script' ); } /** * Function to add the style to the settings page * @since 0.1 */ function anywhere_admin_style() { wp_enqueue_style( 'thickbox' ); wp_enqueue_style( 'anywhere-tabs' ); wp_enqueue_style( 'anywhere-admin' ); } /** * Function to add the script to the settings page * @since 0.1 */ function anywhere_admin_script() { wp_enqueue_script( 'thickbox' ); wp_enqueue_script( 'theme-preview' ); wp_enqueue_script( 'anywhere-admin', ANYWHERE_JS . '/anywhere.js', array( 'jquery' ), '0.1', false ); } /** * Adds the @anywhere script * @since 0.1 */ function anywhere_script() { global $anywhere; $api = $anywhere['api']; $v = $anywhere['version']; if ( $api != '' && !is_admin() ) wp_enqueue_script( 'anywhere', 'http://platform.twitter.com/anywhere.js?id=' . $api . '&v=' . $v . '', false, $v, false ); } /** * Adds @anywhere options * @since 0.1 */ function anywhere_options() { global $anywhere; $api = $anywhere['api']; $users = $anywhere['linkifyusers']; $cards = $anywhere['hovercards']; if ( $api != '' && ( $users != false || $cards != false ) ) : ?> ID); $url = url_to_postid($ID); $short = get_bloginfo('url') . '/?p=' . $url; $v = $anywhere['version']; $box = $anywhere['tweetbox']; $label = $anywhere['tweetbox_label']; $usebox = $anywhere['use_tweetbox_content']; $tcontent = $anywhere['tweetbox_content']; $via = $anywhere['twitter_handle']; $height = $anywhere['tweetbox_height']; $width = $anywhere['tweetbox_width']; if ( $box != false ) : ?> @Anywhere plugin made by @TheFrosty'; else $ll = false; if ( $box != false ) : $tb = '
'; if ( is_singular() && !is_page() ) : if ( $placement == 'before' ) return $tb.$ll.$content; elseif ( $placement == 'after' ) return $content.$tb.$ll; elseif ( $placement == 'manual' ) return $content; else return $content; else : return $content; endif; else : return $content; endif; } /** * RSS WPCult Feed * @since 0.1 * @package Admin */ if ( !function_exists( 'thefrosty_network_feed' ) ) : function thefrosty_network_feed( $attr, $count ) { global $wpdb; include_once( ABSPATH . WPINC . '/rss.php' ); $rss = fetch_rss( $attr ); $items = array_slice( $rss->items, 0, '3' ); echo '@anywhere plugin is not configured yet. It will not load until you enter your api.
You′ve just hid the ad. Thanks for donating!