Go ahead and start typing.'; $preview .= $awpall['live_preview_after']; }else{ $preview .= '
'; $preview .= $awpall['comment_all_tag']; $preview .= str_replace(array('%ID','%alt','%auth'),'',$awpall['comment_tag']); $preview .= $awpall['comment_title_tag']; $preview .= __('You will post the following soon.','awp'); $preview .= $awpall['comment_title_tag_end']; $preview .= '
'; $preview .= __('Go ahead and start typing.','awp'); $preview .= '
'; $preview .= $awpall['comment_tag_end']; $preview .= $awpall['comment_all_tag_end']; $preview .= '
'; } if($return == 1){ return $preview; }else{ echo $preview; } } /** Smilies **/ function vars(){ global $smilie_url; if(function_exists('csm_convert')){ global $wpdb, $table_prefix; // Get emoticons from DB, order by length $result = $wpdb->get_results("SELECT * FROM `{$table_prefix}smileys` ORDER BY length(Emot) DESC"); // Find and Replace foreach ( $result as $object ) { $smilies .= "'".$object->Emot."',"; $files .= "'".$object->File."',"; } echo 'var smilies = ['.$smilies.'];'; echo 'var smiliesfiles = ['.$files.'];'; echo 'var smiliesalt = ['.$smilies.'];'; $smilie_url = get_option("csm_path").'/'; }else{ $smilie_url = 'smilies/icon_'; ?> var smilies = [':mrgreen:', ':neutral:', ':twisted:', ':arrow:', ':shock:', ':smile:', ':???:', ':cool:', ':evil:', ':grin:', ':idea:', ':oops:', ':razz:', ':roll:', ':wink:', ':cry:', ':eek:', ':lol:', ':mad:', ':sad:', '8-/?)', '8-/?O', ':-/?(', ':-/?)', ':-/??', ':-/?D', ':-/?P', ':-/?o', ':-/?x', ':-/?|', ';-/?)', ':!:', ':?:']; var smiliesfiles = ['mrgreen', 'neutral', 'twisted', 'arrow', 'eek', 'smile', 'confused', 'cool', 'evil', 'biggrin', 'idea', 'redface', 'razz', 'rolleyes', 'wink', 'cry', 'surprised', 'lol', 'mad', 'sad', 'cool', 'eek', 'sad', 'smile', 'confused', 'biggrin', 'razz', 'surprised', 'mad', 'neutral', 'wink', 'exclaim', 'question']; var smiliesalt = [':mrgreen:', ':neutral:', ':twisted:', ':arrow:', ':shock:', ':smile:', ':???:', ':cool:', ':evil:', ':grin:', ':idea:', ':oops:', ':razz:', ':roll:', ':wink:', ':cry:', ':eek:', ':lol:', ':mad:', ':sad:', '8-)', '8-O', ':-(', ':-)', ':-?', ':-D', ':-P', ':-o', ':-x', ':-|', ';-)', ':!:', ':?:']; var smiliescount = 0; var x = smiliescount = smilies.length; var smil_reg = []; while(x--){ smilies[x] = smilies[x].replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1"); smilies[x] = smilies[x].replace(/(\/\\?)/g,"?"); smil_reg[x] = new RegExp('(>|\\s|^)'+smilies[x]+'(\\s|$|<)', "gm"); } comment = _convertsmilies(comment); var _convertsmilies = function(text){ var x = smiliescount; while(x--){ if(text.match(smil_reg[x])){ text = text.replace(smil_reg[x],'$1'+smiliesalt[x]+'$2'); } } return text; }; <?php _e('Live Preview Options','awp');?> awp_livepreview_admin_options