outputGringJS(); } exit(0); } $bb_smiliestrans = array( ':)' => '1.gif', #1 //Begin Yahoo ':(' => '2.gif', #2 ';)' => '3.gif', #3 ':D' => '4.gif', #4 # ',,)' => '5.gif', #5 # '>:-D<' => '6.gif', #6 ':-/' => '7.gif', #7 ':x' => '8.gif', #8 # ':#>' => '9.gif', #9 ':P' => '10.gif', #10 # ':-*' => '11.gif', #11 # '=>((' => '12.gif', #12 ':-O' => '13.gif', #13 # 'X(' => '14.gif', #14 ':>' => '15.gif', #15 # 'B-)' => '16.gif', #16 # ':-S' => '17.gif', #17 # '#:-S' => '18.gif', #18 # '>:)' => '19.gif', #19 ':((' => '20.gif', #20 ':))' => '21.gif', #21 ':|' => '22.gif', #22 '/:)' => '23.gif', #23 # '=>))' => '24.gif', #24 # 'O:)' => '25.gif', #25 # ':-B' => '26.gif', #26 # '=>,' => '27.gif', #27 # ':-c' => '101.gif',#28 # ':)' => '100.gif',#29 '~X(' => '102.gif',#30 # ':-h' => '103.gif',#31 # ':-t' => '104.gif',#32 # '8->' => '105.gif',#33 # 'I-|' => '28.gif', #34 '8-|' => '29.gif', #35 # 'L-)' => '30.gif', #36 # ':-G' => '31.gif', #37 # ':-$' => '32.gif', #38 # '[-(' => '33.gif', #39 # ':O)' => '34.gif', #40 # '8-}' => '35.gif', #41 # '<:-P' => '36.gif', #42 # '(:|' => '37.gif', #43 # '=>P~' => '38.gif', #44 ':-?' => '39.gif', #45 '#-o' => '40.gif', #46 # '=>D>' => '41.gif', #47 ':-SS' => '42.gif', #48 # '@-)' => '43.gif', #49 # ':^o' => '44.gif', #50 # ':-w' => '45.gif', #51 # ':-<' => '46.gif', #52 # '>:P' => '47.gif', #53 # '<):)' => '48.gif', #54 ':-??' => '106.gif',#55 # '%-(' => '107.gif',#56 # ':@)' => '49.gif', #57 # '3:-O' => '50.gif', #58 # ':(|)' => '51.gif', #59 # '~:>' => '52.gif', #60 '@},-' => '53.gif', #61 # '%%' => '54.gif', #62 # '**=>=>' => '55.gif', #63 # '(~~)' => '56.gif', #64 '~O)' => '57.gif', #65 '*-:)' => '58.gif', #66 # '8-X' => '59.gif', #67 # '=>:)' => '60.gif', #68 # '>-)' => '61.gif', #69 # ':-L' => '62.gif', #70 # '[-O<' => '63.gif', #71 # '$-)' => '64.gif', #72 # ':-#' => '65.gif', #73 # 'b-(' => '66.gif', #74 # ':)>-' => '67.gif', #75 '[-X' => '68.gif', #76 # '\:D/' => '69.gif', #77 # '>:/' => '70.gif', #78 # ',))' => '71.gif', #79 # ':-@' => '76.gif', #80 # '^:)^' => '77.gif', #81 # ':-j' => '78.gif' #82 # '(*)' => '79.gif', #83 # 'o->' => '72.gif', #84 # 'o=>>' => '73.gif', #85 # 'o-+' => '74.gif', #86 # '(%)' => '75.gif', #87 //End Yahoo # '<3' => 'heart.gif', #1 # ':(|)' => 'monkey.gif', #1 # '\m/' => 'rockout.gif', #1 ':-o' => 'shocked.gif', #2 ':D' => 'grin.gif', #3 ':(' => 'frown.gif', #4 'x-(' => 'angry.gif', #5 'B-)' => 'cool.gif', #6 ':-((' => 'cry.gif', #7 '=D' => 'equal_grin.gif', #8 ';)' => 'wink.gif', #9 ':-|' => 'straightface.gif', #10 '=)' => 'equal_smile.gif', #11 ';^)' => 'nose_grin.gif', #12 ';-)' => 'wink_big_nose.gif', #13 ':-)' => 'wink_nose.gif', #14 ':-/' => 'slant.gif', #15 ':-P' => 'tongue.gif', #16 '>.<' => 'wince1.gif', #16 # '+/'\' => 'cowbell.gif', #16 '}:-)' => 'devil.gif', #16 ); foreach($bb_smiliestrans as $smiley => $img) { $this->bb_smiliessearch[] = $smiley; $smiley_masked = htmlspecialchars(trim($smiley), ENT_QUOTES); $this->bb_smiliesreplace[] = " $smiley_masked "; } $this->grins = ''; $smiled = array(); foreach ($bb_smiliestrans as $tag => $grin) { if (!in_array($grin, $smiled)) { $smiled[] = $grin; $tag = str_replace(' ', '', $tag); $this->grins .= '' .$tag .
' '; } } } /** * post_text filter * * @param $text * @return $output */ function convert_smilies($text) { $prep_search = array_map('prepSmilies', $wp_smiliessearch); $output = ''; $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); $stop = count($textarr); for($i=0; $i<$stop; $i++) { $content = $textarr[$i]; if((strlen($content) > 0) && ('<' != $content{0})) { $content = preg_replace($prep_search, $wp_smiliesreplace, $content); $this->bb_smiliessearch, $this->bb_smiliesreplace, $content); } $output .= $content; } return $output; } /** * bb_grins action * * @param none * @return none */ function bb_grins() { echo '
' . $this->grins . '
'; } /** * bb_head action * * @param none * @return none */ function bb_grins_head() { echo '' . "\n"; } /** * Output Grins JavaScript * * @param none * @return none */ function outputGringJS() { ?> function grin(tag) { var myField; if (document.getElementById('post_content') && document.getElementById('post_content').type == 'textarea') { myField = document.getElementById('post_content'); } else if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') { myField = document.getElementById('comment'); } else { return false; } if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = tag; myField.focus(); } else if (myField.selectionStart || myField.selectionStart == '0') { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; var cursorPos = endPos; myField.value = myField.value.substring(0, startPos) + tag + myField.value.substring(endPos, myField.value.length); cursorPos += tag.length; myField.focus(); myField.selectionStart = cursorPos; myField.selectionEnd = cursorPos; } else { myField.value += tag; myField.focus(); } }