Changeset 1137
- Timestamp:
- 06/01/08 07:22:49 (6 months ago)
- Files:
-
- bb-lightbox2/trunk/bb-lightbox2.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-lightbox2/trunk/bb-lightbox2.php
r1136 r1137 3 3 Plugin Name: bb-Lightbox2 4 4 Plugin URI: http://bbpress.ru/ 5 Description: Used to overlay images on the current page. Lightbox JS v2.2 by <a href="http://www.huddletogether.com/projects/lightbox2/" title="Lightbox JS v2.2 ">Lokesh Dhakar</a>. This plugin is based on "Lightbox 2" plugin for WordPress. Example: http://www.sablinov.ru/forums/topic/16 Version: 0.1 45 Description: Used to overlay images on the current page. Lightbox JS v2.2 by <a href="http://www.huddletogether.com/projects/lightbox2/" title="Lightbox JS v2.2 ">Lokesh Dhakar</a>. This plugin is based on "Lightbox 2" plugin for WordPress. 6 Version: 0.15 7 7 Author: A1ex 8 8 Author URI: http://bbpress.ru … … 29 29 } 30 30 31 function bb_preg_callback3($matches) {32 return '<a href="'.$matches[2].'" rel="lightbox">'.'[img]'.ImgTumb($matches[2],$matches[3]).'[/img]</a>';33 }34 35 31 function bb_removeLinks($content) { 36 32 37 $content = preg_replace_callback('@(<img.*src="(([^>"]*/)(.*[^"]))" .[^<]*>)(?!<\/a>)@i', "bb_preg_callback2", $content);38 $content = preg_replace_callback('@( \[img\](.*[^\[]*\/(.*))\[/img\])(?!<\/a>)@i', "bb_preg_callback3", $content);39 33 $content = preg_replace_callback('@(<img.*src="(([^>"]*/)(.*[^"]))"[^<]*>)(?!<\/a>)@i', "bb_preg_callback2", $content); 34 $content = preg_replace_callback('@(<img.*src=\'(([^>\']*/)(.*[^\']))\'[^<]*>)(?!<\/a>)@i', "bb_preg_callback2", $content); 35 40 36 return $content; 41 37 } … … 154 150 } 155 151 156 add_action(' get_post_text', 'bb_removeLinks');152 add_action('post_text', 'bb_removeLinks'); 157 153 158 154 /* we want to add the above xhtml to the header of our pages: */
