Changeset 10011


Ignore:
Timestamp:
04/03/11 12:03:09 (9 years ago)
Author:
mistic100
Message:

better compatibility test with SmiliesSupport

Location:
extensions/bbcode_bar
Files:
3 edited

Legend:

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

    r9965 r10011  
    44function set_bbcode_bar() 
    55{ 
    6         global $template, $conf, $lang, $user, $pwg_loaded_plugins, $page; 
     6        global $template, $conf, $pwg_loaded_plugins, $page; 
    77        load_language('plugin.lang', dirname(__FILE__) . '/'); 
    88        $conf_bbcode_bar = unserialize($conf['bbcode_bar']); 
     
    2828        $template->parse('bbcode_bar', true);            
    2929 
    30         // smilies support ## must be parsed avec bbcode_bar, because the javascript must be after bbc's one 
    31         if (isset($pwg_loaded_plugins['SmiliesSupport'])) 
    32         { 
    33                 set_smiliessupport(); 
     30        // smilies support >2.2.a ## must be parsed after bbcode_bar, because the javascript must be after bbc's one 
     31        if (isset($pwg_loaded_plugins['SmiliesSupport']) AND version_compare($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.a') != -1) { 
     32                        set_smiliessupport(); 
    3433        }        
    3534} 
  • extensions/bbcode_bar/main.inc.php

    r9965 r10011  
    4343                return $menu; 
    4444        } 
     45         
     46        // version 2.2.a or greater of SmiliesSupport is required 
     47        add_event_handler('loc_end_admin', 'bbcode_bar_check_smilies'); 
     48        function bbcode_bar_check_smilies() { 
     49                global $page, $template, $pwg_loaded_plugins; 
     50                 
     51                if ( 
     52                        ($_GET['page'] == 'plugins_list' OR $_GET['section'] == 'bbcode_bar/admin.php') 
     53                        AND isset($pwg_loaded_plugins['SmiliesSupport'])  
     54                        AND version_compare($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.a') == -1 
     55                ) { 
     56                        $page['warnings'][] = "BBCode Bar : SmiliesSupport has been detected, but is not up to date. Version 2.2.a or greater is required. Please update."; 
     57                        $template->assign('warnings', $page['warnings']); 
     58                } 
     59        } 
     60         
    4561} 
    4662 
    47  
    4863?> 
  • extensions/bbcode_bar/maintain.inc.php

    r9965 r10011  
    44function plugin_install() 
    55 
    6         global $conf, $default; 
     6        global $conf; 
    77         
    88        $BBcode_default = array( 
Note: See TracChangeset for help on using the changeset viewer.