Changeset 1136
- Timestamp:
- 06/01/08 06:18:31 (6 months ago)
- Files:
-
- bb-lightbox2/trunk/bb-lightbox2.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-lightbox2/trunk/bb-lightbox2.php
r1135 r1136 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. 6 Version: 0.1 25 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/1 6 Version: 0.14 7 7 Author: A1ex 8 8 Author URI: http://bbpress.ru … … 26 26 27 27 function bb_preg_callback2($matches) { 28 return '<a href="'.$matches[2].'" rel="lightbox">'.'<img src="'.ImgTumb($matches).'" />'.'</a>'; 29 } 28 return '<a href="'.$matches[2].'" rel="lightbox">'.'<img src="'.ImgTumb($matches[2],$matches[4]).'" /></a>'; 29 } 30 31 function bb_preg_callback3($matches) { 32 return '<a href="'.$matches[2].'" rel="lightbox">'.'[img]'.ImgTumb($matches[2],$matches[3]).'[/img]</a>'; 33 } 30 34 31 35 function bb_removeLinks($content) { 32 36 33 $content = preg_replace_callback('@(]|<img.*src="(([^>"]*/)(.*[^"]))".[^<]*>)(?!<\/a>)@i', "bb_preg_callback2", $content); 34 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 35 40 return $content; 36 41 } … … 80 85 } 81 86 82 function ImgTumb($ matches)87 function ImgTumb($image_path, $image_file) 83 88 { 84 89 global $tumb_width, $tumb_height, $tumbs_path, $tumbs_url; … … 90 95 $tumbs_url = bb_get_option('uri').'tumbs/'; 91 96 } 92 $tumb_name = 'tumb_'.md5($ matches[2]).'_'.$matches[4];97 $tumb_name = 'tumb_'.md5($image_path).'_'.$image_file; 93 98 $tumb_path = $tumbs_path.$tumb_name; 94 99 $tumb_url = $tumbs_url.$tumb_name; … … 96 101 if(!is_file($tumb_path)) 97 102 { 98 $image = $ matches[2];103 $image = $image_path; 99 104 $this_type = GetImgType($image); 100 105 switch($this_type)
