Changeset 4337 in subversion


Ignore:
Timestamp:
Dec 10, 2010 7:49:24 AM (3 years ago)
Author:
alec
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/emoticons/emoticons.php

    r4213 r4337  
    66 * Sample plugin to replace emoticons in plain text message body with real icons 
    77 * 
    8  * @version 1.2.0 
     8 * @version 1.3 
    99 * @author Thomas Bruederli 
    1010 * @author Aleksander Machniak 
     
    3636        // map of emoticon replacements 
    3737        $map = array( 
    38             '/:\)/' => html::img(array( 
    39                 'src'   => './program/js/tiny_mce/plugins/emotions/img/smiley-smile.gif', 
    40                 'title' => ':)' 
    41             )), 
    42             '/:-\)/' => html::img(array( 
    43                 'src'   => './program/js/tiny_mce/plugins/emotions/img/smiley-smile.gif', 
    44                 'title' => ':-)' 
    45             )), 
    46             '/(?<!mailto):D/' => html::img(array( 
    47                 'src'   => './program/js/tiny_mce/plugins/emotions/img/smiley-laughing.gif', 
    48                 'title' => ':D' 
    49             )), 
    50             '/:-D/' => html::img(array( 
    51                 'src'   => './program/js/tiny_mce/plugins/emotions/img/smiley-laughing.gif', 
    52                 'title' => ':-D' 
    53             )), 
    54             '/:\(/' => html::img(array( 
    55                 'src'   => './program/js/tiny_mce/plugins/emotions/img/smiley-frown.gif', 
    56                 'title' => ':(' 
    57             )), 
    58             '/:-\(/' => html::img(array( 
    59                 'src'   => './program/js/tiny_mce/plugins/emotions/img/smiley-frown.gif', 
    60                 'title' => ':-(' 
    61             )), 
    62             '/'.$entity.';\)/' => html::img(array( 
    63                 'src'   => './program/js/tiny_mce/plugins/emotions/img/smiley-wink.gif', 
    64                 'title' => ';)' 
    65             )), 
    66             '/'.$entity.';-\)/' => html::img(array( 
    67                 'src'   => './program/js/tiny_mce/plugins/emotions/img/smiley-wink.gif', 
    68                 'title' => ';-)' 
    69             )), 
     38            '/:\)/'             => $this->img_tag('smiley-smile.gif',       ':)'    ), 
     39            '/:-\)/'            => $this->img_tag('smiley-smile.gif',       ':-)'   ), 
     40            '/(?<!mailto):D/'   => $this->img_tag('smiley-laughing.gif',    ':D'    ), 
     41            '/:-D/'             => $this->img_tag('smiley-laughing.gif',    ':-D'   ), 
     42            '/:\(/'             => $this->img_tag('smiley-frown.gif',       ':('    ), 
     43            '/:-\(/'            => $this->img_tag('smiley-frown.gif',       ':-('   ), 
     44            '/'.$entity.';\)/'  => $this->img_tag('smiley-wink.gif',        ';)'    ), 
     45            '/'.$entity.';-\)/' => $this->img_tag('smiley-wink.gif',        ';-)'   ), 
     46            '/8\)/'             => $this->img_tag('smiley-cool.gif',        '8)'    ), 
     47            '/8-\)/'            => $this->img_tag('smiley-cool.gif',        '8-)'   ), 
     48            '/(?<!mailto):O/i'  => $this->img_tag('smiley-surprised.gif',   ':O'    ), 
     49            '/(?<!mailto):-O/i' => $this->img_tag('smiley-surprised.gif',   ':-O'   ), 
     50            '/(?<!mailto):P/i'  => $this->img_tag('smiley-tongue-out.gif',  ':P'    ), 
     51            '/(?<!mailto):-P/i' => $this->img_tag('smiley-tongue-out.gif',  ':-P'   ), 
     52            '/(?<!mailto):@/i'  => $this->img_tag('smiley-yell.gif',        ':@'    ), 
     53            '/(?<!mailto):-@/i' => $this->img_tag('smiley-yell.gif',        ':-@'   ), 
     54            '/O:\)/i'           => $this->img_tag('smiley-innocent.gif',    'O:)'   ), 
     55            '/O:-\)/i'          => $this->img_tag('smiley-innocent.gif',    'O:-)'  ), 
     56            '/(?<!mailto):$/'   => $this->img_tag('smiley-embarassed.gif',  ':$'    ), 
     57            '/(?<!mailto):-$/'  => $this->img_tag('smiley-embarassed.gif',  ':-$'   ), 
     58            '/(?<!mailto):\*/i'  => $this->img_tag('smiley-kiss.gif',       ':*'    ), 
     59            '/(?<!mailto):-\*/i' => $this->img_tag('smiley-kiss.gif',       ':-*'   ), 
     60            '/(?<!mailto):S/i'  => $this->img_tag('smiley-undecided.gif',   ':S'    ), 
     61            '/(?<!mailto):-S/i' => $this->img_tag('smiley-undecided.gif',   ':-S'   ), 
    7062        ); 
    7163 
     
    7870    } 
    7971 
     72    private function img_tag($ico, $title) 
     73    {  
     74        $path = './program/js/tiny_mce/plugins/emotions/img/'; 
     75        return html::img(array('src' => $path.$ico, 'title' => $title)); 
     76    } 
    8077} 
Note: See TracChangeset for help on using the changeset viewer.