Changeset 1137

Show
Ignore:
Timestamp:
06/01/08 07:22:49 (6 months ago)
Author:
A1ex
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bb-lightbox2/trunk/bb-lightbox2.php

    r1136 r1137  
    33Plugin Name: bb-Lightbox2 
    44Plugin 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/1 
    6 Version: 0.14 
     5Description: 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. 
     6Version: 0.15 
    77Author: A1ex 
    88Author URI: http://bbpress.ru 
     
    2929} 
    3030 
    31 function bb_preg_callback3($matches) { 
    32   return '<a href="'.$matches[2].'" rel="lightbox">'.'[img]'.ImgTumb($matches[2],$matches[3]).'[/img]</a>'; 
    33 } 
    34  
    3531function bb_removeLinks($content) { 
    3632 
    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         
    4036  return $content; 
    4137}  
     
    154150} 
    155151 
    156 add_action('get_post_text', 'bb_removeLinks'); 
     152add_action('post_text', 'bb_removeLinks'); 
    157153 
    158154/* we want to add the above xhtml to the header of our pages: */