coincoins

coincoins.inc

  1. <?php
  2. // vim:filetype=php expandtab tabstop=2 softtabstop=2 shiftwidth=2 autoindent smartindent
  3. // $Id: totoz.inc,v 1.9 2008/08/30 22:51:38 seeschloss Exp $
  4.  
  5. function tribune_coincoins_info() {
  6.   $info = array(
  7.     'description' => t("Highlights virtual ducks for more visibility"),
  8.   );
  9.  
  10.   return $info;
  11. }
  12.  
  13. function tribune_coincoins_filter_after(&$post, &$help) {
  14.   // if using the filter_after hook, the filter will be executed after the
  15.   // message is parsed, and will be able to add arbitrary HTML. The filter
  16.   // will also be executed when the admin hits the "Parse visible messages
  17.   // again" button and will not be able to post new messages.
  18.  
  19.   // since this filter executes after a message is parsed, it has to use
  20.   // the 'parsed' index instead of the 'message' one.
  21.   $post['parsed'] = preg_replace(":((\\\\_([o0O@]|(&ocirc;)|(&deg;)|(&oslash;)|(&ograve;)|(&oacute;)|ô|°|ø|ò|ó)&lt;)|(&gt;([o0O@]|(&ocirc;)|(&deg;)|(&oslash;)|(&ograve;)|(&oacute;)|ô|°|ø|ò|ó)_/)|(coin ?! ?coin ?!)):",
  22.     "<em class='coincoin'>$1</em>",
  23.     $post['parsed']
  24.   );
  25. }
  26.  
  27.  
  28. function tribune_coincoins_help() {
  29.   drupal_add_css(drupal_get_path('module', 'tribune') .'/filters/coincoins.css');
  30.   return '';
  31. }
  32.