Lightbox Evolution is a tool for displaying images, html content, maps, and videos in a "lightbox" style that floats overtop of web page. Using Lightbox Evolution, website authors can showcase a wide assortment of media in all major browsers without navigating users away from the linking page. Version: 1.4.5 Author: Eduardo Daniel Sada Author URI: http://codecanyon.net/user/aeroalquimia/portfolio */ $myplugin = array(); $myplugin['file'] = __FILE__; include("classes/aeropanel.php"); include("panel-config.php"); $lbe_panel->queue($lbe_panel->path() . "/js/aeropanel/themepreview.js", "script"); function lbe_myplugin_lightbox($content) { global $post, $lbe_panel; $autolightboxing = (int) $lbe_panel->get_option('autolightboxing'); $autogroup = (bool) $lbe_panel->get_option('autogroup') ? 'rel=\"gallery-'.$post->ID.'\"' : ''; if ($autolightboxing==3 || $autolightboxing==2) { $pattern['search'] = '/()/ie'; $pattern['replace'] = 'stripslashes(strstr("\2\5","class=") ? "\1" : "")'; $content = preg_replace($pattern['search'], $pattern['replace'], $content); } if ($autolightboxing==3 || $autolightboxing==1) { $videoregs['youtube'] = "youtube\.com\/watch"; $videoregs['metacafe'] = "metacafe\.com\/watch"; $videoregs['dailymotion'] = "dailymotion\.com\/video"; $videoregs['google'] = "google\.com\/videoplay"; $videoregs['vimeo'] = "vimeo\.com\/"; $videoregs['megavideo'] = "megavideo.com\/\?v"; $videoregs['gametrailers'] = "gametrailers.com\/"; $videoregs['collegehumor'] = "collegehumor.com\/video"; $videoregs['ustream'] = "ustream.tv"; $videoregs['twitvid'] = "twitvid.com\/"; $videoregs['vzaar'] = "vzaar.com\/videos"; $video_options = implode("|", $videoregs); $pattern['search'] = '/()/ie'; $pattern['replace'] = 'stripslashes(strstr("\2\5","class=") ? "\1" : "")'; $content = preg_replace($pattern['search'], $pattern['replace'], $content); } return $content; } add_filter('the_content', 'lbe_myplugin_lightbox', 12); function lbe_myplugin_lightbox_head() { global $lbe_panel; wp_deregister_script('jquery'); wp_register_script('jquery', $lbe_panel->path().'/js/jquery.min.js', false, '1.5.2'); echo ''; echo ''; echo ''; } add_action('wp_head', 'lbe_myplugin_lightbox_head', 1); function lbe_myplugin_lightbox_footer() { global $lbe_panel; $exec = trim($lbe_panel->get_option('exec')); $flash = ''; if ($lbe_panel->get_option('default_width') || $lbe_panel->get_option('default_height')) { $flash = 'jQuery.extend(jQuery.lightbox().options.flash, {'; if ($lbe_panel->get_option('default_width')) { $flash .= 'width: '.(int)$lbe_panel->get_option('default_width').','; } if ($lbe_panel->get_option('default_height')) { $flash .= 'height: '.(int)$lbe_panel->get_option('default_height').','; } $flash .= 'custom: 1'; $flash .= '});'; } echo ''; echo ''; echo ' '; } add_action('wp_footer', 'lbe_myplugin_lightbox_footer'); /*! * Gallery Shortcode * wp-includes/media.php */ function lbe_gallery_shortcode($attr) { global $post; static $instance = 0; $instance++; // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( !$attr['orderby'] ) unset( $attr['orderby'] ); } extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '' ), $attr)); $id = intval($id); if ( 'RAND' == $order ) $orderby = 'none'; if ( !empty($include) ) { $include = preg_replace( '/[^0-9,]+/', '', $include ); $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = array(); foreach ( $_attachments as $key => $val ) { $attachments[$val->ID] = $_attachments[$key]; } } elseif ( !empty($exclude) ) { $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } if ( empty($attachments) ) { return ''; } if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $id => $attachment ) { $output .= wp_get_attachment_link($id, $size, true) . "\n"; } return $output; } $listtag = tag_escape($listtag); $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $float = is_rtl() ? 'right' : 'left'; $selector = "gallery-{$instance}"; $output = apply_filters('gallery_style', " \n"; return $output; } remove_shortcode(gallery); add_shortcode('gallery', 'lbe_gallery_shortcode'); function lbe_lightbox_shortcode($atts, $content = null) { $options = array(); foreach ((array)$atts as $key=>$option) { if ($key != 'href' && $key != 'rel') { $options["lightbox[$key]"] = $option; } } $atts['href'] = do_shortcode($atts['href']); $content = do_shortcode($content); return ''.$content.''; } add_shortcode("lightbox", "lbe_lightbox_shortcode"); ?>