liberty
[ class tree: liberty ] [ index: liberty ] [ all elements ]

Source for file filter.smileys.php

Documentation is available at filter.smileys.php

  1. <?php
  2. /**
  3.  * @version  $Header$
  4.  * @package  liberty
  5.  * @subpackage plugins_filter
  6.  */
  7.  
  8. /**
  9.  * definitions ( guid character limit is 16 chars )
  10.  */
  11. define'PLUGIN_GUID_FILTERSMILEYS''filtersmileys' );
  12.  
  13. global $gLibertySystem$gBitSystem;
  14.  
  15. $pluginParams array(
  16.     'title'              => 'Smileys',
  17.     'description'        => 'If you are using the smileys package, you need to enable this filter to insert smileys where needed.',
  18.     'auto_activate'      => TRUE,
  19.     'plugin_type'        => FILTER_PLUGIN,
  20.  
  21.     // filter functions
  22.     'presplit_function'  => 'smileys_filter',
  23.     'postparse_function' => 'smileys_filter',
  24. );
  25. $gLibertySystem->registerPluginPLUGIN_GUID_FILTERSMILEYS$pluginParams );
  26.  
  27. function smileys_filter&$pData&$pFilterHash {
  28.     global $gBitSystem$gBitSmarty;
  29.     if$gBitSystem->isPackageActive'smileys' ) ) {
  30.         preg_match_all"/\(:([^:]+):\)/"$pData$smileys );
  31.         $smileys[0array_unique$smileys[0);
  32.         $smileys[1array_unique$smileys[1);
  33.  
  34.         if!empty$smileys[1) ) {
  35.             $gBitSmarty->loadPlugin'smarty_function_biticon' );
  36.             foreach$smileys[1as $key => $smiley {
  37.                 $biticon array(
  38.                     'ipackage' => 'smileys',
  39.                     'iname' => $smiley,
  40.                     'iexplain' => $smiley,
  41.                     'iforce' => 'icon',
  42.                 );
  43.                 $pData preg_replace"/".preg_quote$smileys[0][$key)."/"smarty_function_biticon$biticon$gBitSmarty )$pData );
  44.             }
  45.         }
  46.     }
  47. }
  48. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:30 +0000 by phpDocumentor 1.5.0-lsces