Ignore:
Timestamp:
Mar 19, 2011, 10:35:08 AM (13 years ago)
Author:
mistic100
Message:

[extentions] BBCode Bar

  • active for admin in the comments page
File:
1 edited

Legend:

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

    r9682 r9765  
    44function set_bbcode_bar()
    55{
    6         global $template, $conf, $lang, $user, $pwg_loaded_plugins;
     6        global $template, $conf, $lang, $user, $pwg_loaded_plugins, $page;
    77        load_language('plugin.lang', dirname(__FILE__) . '/');
    88        $conf_bbcode_bar = explode("," , $conf['bbcode_bar']);
     
    1010
    1111        // buttons
    12         for ($i=0; $i<=15; $i++)
    13         {
     12        for ($i=0; $i<=15; $i++) {
    1413                if ($conf_bbcode_bar[$i] == 1) $template->assign('BBCode_bar_button_'.sprintf("%02d", $i), true);
    1514        }
    1615        $template->assign('repicon', $conf_bbcode_bar[16]);
    1716       
    18         // edit field has a different id
    19         if (isset($_GET['action']) AND $_GET['action'] == 'edit_comment')
    20         {
     17        // edit field has different id
     18        if (
     19                (isset($_GET['action']) AND $_GET['action'] == 'edit_comment')
     20                OR (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage')
     21        ) {
    2122                $template->assign('form_name', 'editComment');
    22         }
    23         else
    24         {
     23        } else {
    2524                $template->assign('form_name', 'addComment');
    2625        }
    2726
    2827        // smilies support
    29         if (isset($pwg_loaded_plugins['SmiliesSupport']))
    30         {
     28        if (isset($pwg_loaded_plugins['SmiliesSupport'])) {
    3129                $template->assign('BBCode_bar_SmiliesSupport', array('SMILIESSUPPORT_PAGE' => SmiliesTable()));
    3230        }
     
    6664                                        while (($temp = array_pop($tags)))
    6765                                        {
    68                                                 if ($temp != $tag)
    69                                                 {
     66                                                if ($temp != $tag) {
    7067                                                        $before_tag.='[/'.$temp.']';
    71                                                 }
    72                                                 else
    73                                                 {
     68                                                } else {
    7469                                                        $before_tag.='[/'.$tag.']';
    7570                                                        break;
     
    7873                                        $end_pos += strlen($before_tag)+strlen($after_tag)-strlen($str);
    7974                                        $str = $before_tag.$after_tag;
    80                                 }
    81                                 else
    82                                 { // push stack
     75                                } else { // push stack
    8376                                        array_push($tags,$tag);
    8477                                }
     
    233226        return preg_replace($patterns, $replacements, $str);
    234227}
     228
    235229?>
Note: See TracChangeset for help on using the changeset viewer.