<?php
//修改评论表情调用路径
add_filter('smilies_src','custom_smilies_src',1,10);
function custom_smilies_src ($img_src,$img,$siteurl){
return get_bloginfo('template_directory').'/images/smilies/'.$img;
}
function wp_smilies(){
$a = array( 'good','tear','spit','reluctantly','doubt','haha','surprised','anger','tongue','theblackline','smilingeyes','spray','surprised2','Happy','rmb','Grievance','han','ku','bbd','se','shui','huaji' );
$b = array( 'good','tear','spit','reluctantly','doubt','haha','surprised','anger','tongue','theblackline','smilingeyes','spray','surprised2','Happy','rmb','Grievance','han','ku','bbd','se','shui','huaji' );
for( $i=0;$i<22;$i++ ){
echo '<a title="'.$a[$i].'" href="javascript:grin('."'".$a[$i]."'".')"><img src="'.get_bloginfo('template_directory').'/dist/assets/images/smilies/icon_'.$b[$i].'.gif" /></a>';
}
}
function smilies_reset() {
global $wpsmiliestrans;
// don't bother setting up smilies if they are disabled
if ( !get_option( 'use_smilies' ) )
return;

$wpsmiliestrans = array(
':good:' => 'icon_good.gif',
':han:' => 'icon_han.gif',
':spray:' => 'icon_spray.gif',
':Grievance:' => 'icon_Grievance.gif',
':shui:' => 'icon_shui.gif',
':reluctantly:' => 'icon_reluctantly.gif',
':anger:' => 'icon_anger.gif',
':tongue:' => 'icon_tongue.gif',
':se:' => 'icon_se.gif',
':haha:' => 'icon_haha.gif',
':rmb:' => 'icon_rmb.gif',
':doubt:' => 'icon_doubt.gif',
':tear:' => 'icon_tear.gif',
':surprised2:' => 'icon_surprised2.gif',
':Happy:' => 'icon_Happy.gif',
':ku:' => 'icon_ku.gif',
':surprised:' => 'icon_surprised.gif',
':theblackline:' => 'icon_theblackline.gif',
':smilingeyes:' => 'icon_smilingeyes.gif',
':spit:' => 'icon_spit.gif',
'8-)' => 'icon_cool.gif',
'8-O' => 'icon_eek.gif',
':-(' => 'icon_sad.gif',
':-)' => 'icon_smile.gif',
':-?' => 'icon_confused.gif',
':-D' => 'icon_biggrin.gif',
':-P' => 'icon_razz.gif',
':-o' => 'icon_surprised.gif',
':-x' => 'icon_mad.gif',
':-|' => 'icon_neutral.gif',
';-)' => 'icon_wink.gif',
'8O' => 'icon_eek.gif',
':(' => 'icon_sad.gif',
':)' => 'icon_smile.gif',
':?' => 'icon_confused.gif',
':D' => 'icon_biggrin.gif',
':P' => 'icon_razz.gif',
':o' => 'icon_surprised.gif',
':x' => 'icon_mad.gif',
':|' => 'icon_neutral.gif',
';)' => 'icon_wink.gif',
':huaji:' => 'icon_huaji.gif',
':bbd:' => 'icon_bbd.gif',
);
}
smilies_reset();