Changeset 15997


Ignore:
Timestamp:
06/24/12 15:07:53 (7 years ago)
Author:
mistic100
Message:

move some code from Comments on Albums and compatible with GuestBook

Location:
extensions/SmiliesSupport
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmiliesSupport/main.inc.php

    r14526 r15997  
    2323   
    2424  // if BBCodeBar is installed let him manage smilies 
    25   if ( isset($page['body_id']) AND $page['body_id'] == 'thePicturePage' 
    26     AND !isset($pwg_loaded_plugins['bbcode_bar']) 
    27   ) { 
    28     set_smiliessupport(); 
     25  if (isset($pwg_loaded_plugins['bbcode_bar'])) return; 
     26   
     27  if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage')  
     28  { 
     29    $prefilter = 'picture'; 
     30  } 
     31  else if ( 
     32    script_basename() == 'index' and isset($pwg_loaded_plugins['Comments_on_Albums']) 
     33    and isset($page['section']) and $page['section'] == 'categories' and isset($page['category']) 
     34    )  
     35  { 
     36    $prefilter = 'comments_on_albums'; 
     37  } 
     38  else if (isset($_GET['/guestbook']))  
     39  { 
     40    $prefilter = 'index'; 
     41  } 
     42   
     43  if (isset($prefilter)) 
     44  { 
     45    set_smiliessupport($prefilter); 
    2946  } 
    3047} 
  • extensions/SmiliesSupport/smiliessupport.inc.php

    r14526 r15997  
    33 
    44// add smilies button to the comment field 
    5 function set_smiliessupport() 
     5function set_smiliessupport($prefilter='picture') 
    66{ 
    77  global $conf, $template, $page; 
     
    1616  )); 
    1717   
    18   $template->set_prefilter('picture', 'set_smiliessupport_prefilter');   
     18  $template->set_prefilter($prefilter, 'set_smiliessupport_prefilter');   
    1919} 
    2020 
    2121function set_smiliessupport_prefilter($content, &$smarty) 
    2222{ 
    23   $search = '<div id="commentAdd">'; 
    24   $replace = file_get_contents(SMILIES_PATH.'/template/smiliessupport_page.tpl').$search; 
    25   return str_replace($search, $replace, $content); 
     23  $search = '#(<div id="guestbookAdd">|<div id="commentAdd">)#'; 
     24  $replace = file_get_contents(SMILIES_PATH.'/template/smiliessupport_page.tpl').'$1'; 
     25  return preg_replace($search, $replace, $content); 
    2626} 
    2727 
  • extensions/SmiliesSupport/template/markitup/style.markitup.css

    r15110 r15997  
    1919  font:12px 'Courier New', Courier, monospace; 
    2020  padding:5px; 
    21   clear:both; 
    2221  overflow:auto; 
    2322} 
Note: See TracChangeset for help on using the changeset viewer.