Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!defined('BASEPATH')){
- exit('No direct script access allowed');
- }
- // ------------------------------------------------------------------------
- /**
- * mencetak ke layar dan mengubah format URL + emo
- *
- * @access public
- * @param string
- * @param number (1 or 0)
- * @return echo string
- */
- if (!function_exists('__e')){
- function __e($input,$compress=1){
- $cdnURL = "http://".domainCDN;
- // replace key URL to URL
- $output = str_replace("http://imgURL/","$cdnURL/images/", $input); // IMG for CDN
- $output = str_replace("http://emoURL/","$cdnURL/smiles/", $output); // EMOTICON
- $output = str_replace("http://photoURL/","$cdnURL/photos/", $output); // PHOTO
- $output = str_replace("http://fileURL/","$cdnURL/file/get/", $output); // file download
- $output = str_replace("http://avaURL/","$cdnURL/ava/", $output); // avatar (profile photo)
- $output = str_replace("http://demoURL/","http://".domainDEMO.'/', $output); // demo
- // replace key domain to domain name
- $output = str_replace("domainWWW",domainWWW, $output);
- $output = str_replace("domainBLOG",domainBLOG, $output);
- $output = str_replace("domainFACEBOOK",domainFACEBOOK, $output);
- $output = str_replace("domainPERSONALWEB",domainPERSONALWEB, $output);
- $output = str_replace("domainCDN",domainCDN, $output);
- // replace smile
- $emoURL = "$cdnURL/smiles";
- $output = str_replace("[^_^]"," <img src=\"$emoURL/fb_squint.gif\" title=\"^_^\" alt=\"^_^\" height=14 />", $output);
- $output = str_replace("[:)]"," <img src=\"$emoURL/smile.gif\" title=\":)\" alt=\":)\" height=14 />", $output);
- $output = str_replace("[;)]"," <img src=\"$emoURL/wink.gif\" title=\";)\" alt=\";)\" height=14 />", $output);
- $output = str_replace("[:(]"," <img src=\"$emoURL/sad.gif\" title=\":(\" alt=\":(\" height=14 />", $output);
- $output = str_replace(array("[:D]","[:d]")," <img src=\"$emoURL/grin.gif\" title=\":D\" alt=\":D\" height=14 />", $output);
- $output = str_replace(array("[:P]","[:p]")," <img src=\"$emoURL/tongue.gif\" title=\":p\" alt=\":p\" height=14 />", $output);
- $output = str_replace(array("[O.o]","[o.O]")," <img src=\"$emoURL/fb_confused.gif\" title=\"o.O\" alt=\"o.O\" height=14 />", $output);
- $output = str_replace("[<3]"," <img src=\"$emoURL/loveface.gif\" title=\"<3\" alt=\"<3\" height=14 />", $output);
- $output = str_replace("[:'(]"," <img src=\"$emoURL/cry.gif\" title=\":'(\" alt=\":'(\" height=14 />", $output);
- $output = str_replace("[8)]"," <img src=\"$emoURL/cool.gif\" title=\"8)\" alt=\"8)\" height=14 />", $output);
- $output = str_replace(array("[:o]","[:O]")," <img src=\"$emoURL/shock.gif\" title=\":O\" alt=\":O\" height=14 />", $output);
- $output = str_replace("[:*]"," <img src=\"$emoURL/kissing.gif\" title=\":*\" alt=\":*\" height=14 />", $output);
- $output = str_replace("[LOL]"," <img src=\"$emoURL/LOL.gif\" title=\"LOL\" alt=\"LOL\" height=14 />", $output);
- $output = str_replace("[WOW]"," <img src=\"h$emoURL/wow.gif\" title=\"WOW\" alt=\"WOW\" height=14 />", $output);
- $output = str_replace("[hehe]"," <img src=\"$emoURL/hehe.gif\" title=\"hehe\" alt=\"hehe\" height=14 />", $output);
- if($compress==1){
- $output = str_replace(array("\r\n\r\n","\r\n","\r","\n","\t","\v"),"",$output);
- $output = trim(str_replace(" "," ",$output));
- $output = trim(str_replace(" "," ",$output));
- $output = str_replace(array("> <","> <"),"><",$output);
- }
- echo $output;
- }
- }
- /* End of file string_parser_helper.php */
- /* Location: app/helpers/string_parser_helper.php */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement