Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Pagalbytes reiktu

Parašė bicas· 2009 Vas. 21 21:02:56
#1

Sveiki vyrukai, istiko problemele del smailu idejimo. I maincore.php faila surasiau visus smailus ir pakeiciau kodus, taciau kai nueinu i puslapi ir bandau juos parasyti man rodos tik 5 tuos defaultinius smailus. Gal galit padeti? Rasykit cia, o jeigu kas galetu ir issamiau paaiskinti gal ir skype paliksit? Dekui
Stai mano dalis is maincore.php, ja as redagavau:
// Parse smiley bbcode into HTML images
function parsesmileys($message) {
   $smiley = array(
      "#\:\)#si" => "<img src='".IMAGES."smiley/akiniuotas.gif' alt='smiley'>",
      "#\;\)#si" => "<img src='".IMAGES."smiley/banned.gif' alt='smiley'>",
      "#\:\(#si" => "<img src='".IMAGES."smiley/argue.gif' alt='smiley'>",
      "#\:\|#si" => "<img src='".IMAGES."smiley/blees.gif' alt='smiley'>",
      "#\:o#si" => "<img src='".IMAGES."smiley/closed.gif' alt='smiley'>",
      "#\:p#si" => "<img src='".IMAGES."smiley/computerman.gif' alt='smiley'>",
      "#b\)#si" => "<img src='".IMAGES."smiley/cool.gif' alt='smiley'>",
      "#\:\D#si" => "<img src='".IMAGES."smiley/devil.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/dont't.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/freedom.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/gunner.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/laught.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/lol.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/maistas.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/malkas pjauna.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/music.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/no!.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/off topic.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/rukymas.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/sad.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/scared.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/surender.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/sveikata.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/taip.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/think.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/winks.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/wohoo.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/yes sir.gif' alt='smiley'>",
      "#\:@#si" => "<img src='".IMAGES."smiley/die.gif' alt='smiley'>",

   );
   foreach($smiley as $key=>$smiley_img) $message = preg_replace($key, $smiley_img, $message);
   return $message;
}

// Show smiley icons in comments, forum and other post pages
function displaysmileys($textarea) {
   $smiles = "";
   $smileys = array (
      ":)" => "taip.gif",
      ";)" => "winks.gif",
      ":|" => "off topic.gif",
      ":(" => "sad.gif",
      ":o" => "rukymas.gif",
      ":p" => "surender.gif",
      "B)" => "akiniuotas.gif",
      ":D" => "laught.gif",
      ":/" => "no!.gif",
      ":die" => "die.gif",
      ":kompas" => "computerman.gif",
      ":rock" => "freedom.gif",
      ":maistas" => "maistas.gif",
      ":kunigas" => "bless.gif",
      ":ban" => "banned.gif",
      ":?" => "think.gif"
      
      
      
   );
   foreach($smileys as $key=>$smiley) $smiles .= "<img src='".IMAGES."smiley/$smiley' alt='smiley' onClick=\"insertText('$textarea', '$key');\">\n";
   return $smiles;
}

// Parse bbcode into HTML code
function parseubb($text) {
   $text = preg_replace('#\[b\](.*?)\[/b\]#si', '<b>\1</b>', $text);
   
   $text = preg_replace('#\[i\](.*?)\[/i\]#si', '<i>\1</i>', $text);
   $text = preg_replace('#\[u\](.*?)\[/u\]#si', '<u>\1</u>', $text);
   $text = preg_replace('#\[center\](.*?)\[/center\]#si', '<center>\1</center>', $text);
        $text = preg_replace('#\[video\](.*?)\[/video\]#si', '<script type="text/javascript" src="video.php?link=\1"></script>', $text);
   
   $text = preg_replace('#\[url\]([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\";\+]*?)([\r\n]*)\[/url\]#si', '<a href=\'\2\3\' target=\'_blank\'>\2\3</a>', $text);
   $text = preg_replace('#\[url\]([\r\n]*)([^\s\'\";\+]*?)([\r\n]*)\[/url\]#si', '<a href=\'http://\2\' target=\'_blank\'>\2</a>', $text);
   $text = preg_replace('#\[url=([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\";\+]*?)\](.*?)([\r\n]*)\[/url\]#si', '<a href=\'\2\3\' target=\'_blank\'>\4</a>', $text);
   $text = preg_replace('#\[url=([\r\n]*)([^\s\'\";\+]*?)\](.*?)([\r\n]*)\[/url\]#si', '<a href=\'http://\2\' target=\'_blank\'>\3</a>', $text);
   
   $text = preg_replace('#\[mail\]([\r\n]*)([^\s\'\";:\+]*?)([\r\n]*)\[/mail\]#si', '<a href=\'mailto:\2\'>\2</a>', $text);
   $text = preg_replace('#\[mail=([\r\n]*)([^\s\'\";:\+]*?)\](.*?)([\r\n]*)\[/mail\]#si', '<a href=\'mailto:\2\'>\3</a>', $text);
   
   $text = preg_replace('#\[small\](.*?)\[/small\]#si', '<span class=\'small\'>\1</span>', $text);
   $text = preg_replace('#\[color=(black|blue|brown|cyan|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|violet|white|yellow)\](.*?)\[/color\]#si', '<span style=\'color:\1\'>\2</span>', $text);
   
   $text = preg_replace('#\[flash width=([0-9]*?) height=([0-9]*?)\]([^\s\'\";:\+]*?)(\.swf)\[/flash\]#si', '<object classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase=\'http://active.macromedia.com/flash6/cabs/swflash.cab#version=6,0,0,0\' id=\'\3\4\' width=\'\1\' height=\'\2\'><param name=movie value=\'\3\4\'><param name=\'quality\' value=\'high\'><param name=\'bgcolor\' value=\'#ffffff\'><embed src=\'\3\4\' quality=\'high\' bgcolor=\'#ffffff\' width=\'\1\' height=\'\2\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object>', $text);
   $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie","'<img src=\'\\1'.str_replace(array('.php','?','&','='),'','\\3').'\\4\' style=\'border:0px\'>'",$text);

   $qcount = substr_count($text, "[quote]"); $ccount = substr_count($text, "[code]");
   for ($i=0;$i < $qcount;$i++) $text = preg_replace('#\[quote\](.*?)\[/quote\]#si', '<div class=\'quote\'>\1</div>', $text);
   for ($i=0;$i < $ccount;$i++) $text = preg_replace('#\[code\](.*?)\[/code\]#si', '<div class=\'quote\' style=\'width:400px;white-space:nowrap;overflow:auto\'><code style=\'white-space:nowrap\'>\1<br><br><br></code></div>', $text);

   $text = descript($text,false);

   return $text;
}



Redagavo bicas· 2009 Vas. 21 22:02:31