Changeset 9765 for extensions/bbcode_bar/bbcode_bar.inc.php
- Timestamp:
- Mar 19, 2011, 10:35:08 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/bbcode_bar/bbcode_bar.inc.php
r9682 r9765 4 4 function set_bbcode_bar() 5 5 { 6 global $template, $conf, $lang, $user, $pwg_loaded_plugins ;6 global $template, $conf, $lang, $user, $pwg_loaded_plugins, $page; 7 7 load_language('plugin.lang', dirname(__FILE__) . '/'); 8 8 $conf_bbcode_bar = explode("," , $conf['bbcode_bar']); … … 10 10 11 11 // buttons 12 for ($i=0; $i<=15; $i++) 13 { 12 for ($i=0; $i<=15; $i++) { 14 13 if ($conf_bbcode_bar[$i] == 1) $template->assign('BBCode_bar_button_'.sprintf("%02d", $i), true); 15 14 } 16 15 $template->assign('repicon', $conf_bbcode_bar[16]); 17 16 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 ) { 21 22 $template->assign('form_name', 'editComment'); 22 } 23 else 24 { 23 } else { 25 24 $template->assign('form_name', 'addComment'); 26 25 } 27 26 28 27 // smilies support 29 if (isset($pwg_loaded_plugins['SmiliesSupport'])) 30 { 28 if (isset($pwg_loaded_plugins['SmiliesSupport'])) { 31 29 $template->assign('BBCode_bar_SmiliesSupport', array('SMILIESSUPPORT_PAGE' => SmiliesTable())); 32 30 } … … 66 64 while (($temp = array_pop($tags))) 67 65 { 68 if ($temp != $tag) 69 { 66 if ($temp != $tag) { 70 67 $before_tag.='[/'.$temp.']'; 71 } 72 else 73 { 68 } else { 74 69 $before_tag.='[/'.$tag.']'; 75 70 break; … … 78 73 $end_pos += strlen($before_tag)+strlen($after_tag)-strlen($str); 79 74 $str = $before_tag.$after_tag; 80 } 81 else 82 { // push stack 75 } else { // push stack 83 76 array_push($tags,$tag); 84 77 } … … 233 226 return preg_replace($patterns, $replacements, $str); 234 227 } 228 235 229 ?>
Note: See TracChangeset
for help on using the changeset viewer.