Changeset 11377


Ignore:
Timestamp:
Jun 14, 2011, 8:29:09 PM (13 years ago)
Author:
mistic100
Message:

remove SmiliesSupport version test, allow 3 chars hexadecimal colors

Location:
extensions/bbcode_bar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/bbcode_bar/bbcode_bar.inc.php

    r11295 r11377  
    3636
    3737  // smilies support > 2.2.f ## must be parsed after bbcode_bar, because the javascript must be after bbc's one
    38   if (isset($pwg_loaded_plugins['SmiliesSupport']) AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.f') != -1) {
     38  if (isset($pwg_loaded_plugins['SmiliesSupport']))
     39  {
    3940    set_smiliessupport();
    4041  } 
     
    189190  {
    190191    //Images
    191     $patterns[] = "#\[img\](.*?)\[/img\]#si";
     192    $patterns[] = "#\[img\](.*?)\[/img\]#is";
    192193    $replacements[] = '<img src="\\1" />';
    193194  }
     
    227228  {
    228229    //Size
    229     $patterns[] = "#\[size=([1-2]?[0-9])\](.*?)\[/size\]#si";
     230    $patterns[] = "#\[size=([1-2]?[0-9])\](.*?)\[/size\]#is";
    230231    $replacements[] = '<span style="font-size: \\1px; line-height: normal">\\2</span>';
    231232  }
     
    233234  {
    234235    //Colours
    235     $patterns[] = "#\[color=(\#[0-9A-F]{6}|[a-z]+)\](.*?)\[/color\]#si";
     236    $patterns[] = "#\[color=(\#[0-9A-F]{6}|\#[0-9A-F]{3}|[a-z]+)\](.*?)\[/color\]#is";
    236237    $replacements[] = '<span style="color: \\1">\\2</span>';
    237238  }
  • extensions/bbcode_bar/main.inc.php

    r11295 r11377  
    4444    ));
    4545    return $menu;
    46   }
    47  
    48   // version 2.2.a or greater of SmiliesSupport is required
    49   add_event_handler('loc_end_admin', 'bbcode_bar_check_smilies');
    50   function bbcode_bar_check_smilies()
    51   {
    52     global $page, $template, $pwg_loaded_plugins;
    53 
    54     if (
    55       ( (isset($_GET['page']) AND $_GET['page'] == 'plugins_list') OR (isset($_GET['section']) AND $_GET['section'] == 'bbcode_bar/admin.php') )
    56       AND isset($pwg_loaded_plugins['SmiliesSupport']) AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.f') == -1
    57     ) {
    58       array_push($page['warnings'], "BBCode Bar : SmiliesSupport has been detected, but is not up to date. Version 2.2.a or greater is required. Please update.");
    59       $template->assign('warnings', $page['warnings']);
    60     }
    61   }
    62  
     46  }
    6347}
    6448
Note: See TracChangeset for help on using the changeset viewer.