WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/12/2007 09:31:24 PM (14 years ago)
Author:
ryan
Message:

Move smilies init to function and trigger from init. Props rob1n. fixes #1721

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/vars.php

    r5024 r5032  
    3636$is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) ? true : false;
    3737
    38 // if the config file does not provide the smilies array, let's define it here
    39 if (!isset($wpsmiliestrans)) {
    40     $wpsmiliestrans = array(
    41     ':mrgreen:' => 'icon_mrgreen.gif',
    42     ':neutral:' => 'icon_neutral.gif',
    43     ':twisted:' => 'icon_twisted.gif',
    44       ':arrow:' => 'icon_arrow.gif',
    45       ':shock:' => 'icon_eek.gif',
    46       ':smile:' => 'icon_smile.gif',
    47         ':???:' => 'icon_confused.gif',
    48        ':cool:' => 'icon_cool.gif',
    49        ':evil:' => 'icon_evil.gif',
    50        ':grin:' => 'icon_biggrin.gif',
    51        ':idea:' => 'icon_idea.gif',
    52        ':oops:' => 'icon_redface.gif',
    53        ':razz:' => 'icon_razz.gif',
    54        ':roll:' => 'icon_rolleyes.gif',
    55        ':wink:' => 'icon_wink.gif',
    56         ':cry:' => 'icon_cry.gif',
    57         ':eek:' => 'icon_surprised.gif',
    58         ':lol:' => 'icon_lol.gif',
    59         ':mad:' => 'icon_mad.gif',
    60         ':sad:' => 'icon_sad.gif',
    61           '8-)' => 'icon_cool.gif',
    62           '8-O' => 'icon_eek.gif',
    63           ':-(' => 'icon_sad.gif',
    64           ':-)' => 'icon_smile.gif',
    65           ':-?' => 'icon_confused.gif',
    66           ':-D' => 'icon_biggrin.gif',
    67           ':-P' => 'icon_razz.gif',
    68           ':-o' => 'icon_surprised.gif',
    69           ':-x' => 'icon_mad.gif',
    70           ':-|' => 'icon_neutral.gif',
    71           ';-)' => 'icon_wink.gif',
    72            '8)' => 'icon_cool.gif',
    73            '8O' => 'icon_eek.gif',
    74            ':(' => 'icon_sad.gif',
    75            ':)' => 'icon_smile.gif',
    76            ':?' => 'icon_confused.gif',
    77            ':D' => 'icon_biggrin.gif',
    78            ':P' => 'icon_razz.gif',
    79            ':o' => 'icon_surprised.gif',
    80            ':x' => 'icon_mad.gif',
    81            ':|' => 'icon_neutral.gif',
    82            ';)' => 'icon_wink.gif',
    83           ':!:' => 'icon_exclaim.gif',
    84           ':?:' => 'icon_question.gif',
    85     );
    86 }
    87 
    88 // generates smilies' search & replace arrays
    89 foreach ( (array) $wpsmiliestrans as $smiley => $img ) {
    90     $wp_smiliessearch[] = '/(\s|^)'.preg_quote($smiley, '/').'(\s|$)/';
    91     $smiley_masked = htmlspecialchars(trim($smiley), ENT_QUOTES);
    92     $wp_smiliesreplace[] = " <img src='" . get_option('siteurl') . "/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";
    93 }
    94 
    9538?>
Note: See TracChangeset for help on using the changeset viewer.