Вы не зашли.
Главная » PHP » Общие вопросы по PHP
#241. TLENS Off (14)
Moderator
2011.09.26 21:09
Код:
lt;?$count_smiles = 3;/** * Замена по ограничению * @return (string) * By TLENS 26.09.2011 */function my_replace($var1, $var2, $str, $count = 0){ if ($count <= 0) { return str_replace($var1, $var2, $str); } $arr = explode($var1, $str); $c = sizeof($arr); if ($c <= $count) { return str_replace($var1, $var2, $str); } $result = (string)''; for ($i = 0; $i<$c; $i++) { if ($i < $count) { $result .= $arr[$i] . $var2; } else { $result .= $arr[$i] . ((($i + 1) < $c) ? $var1 : ''); } } return $result;}//-------------------------------------//function smiles($msg){ global $db, $set,$user, $count_smiles; $f_smiles=file(H."smiles/smiles.txt"); for ($i=0;$i<count($f_smiles);$i++) { $str_sm=explode(' ',trim($f_smiles[$i])); $str_sm2=''; for ($z=1;$z<count($str_sm);$z++) { if ($z>1){$str_sm2.=' ';} $str_sm2.=$str_sm[$z]; } $str_sm2=explode(',',$str_sm2); for ($i2=0;$i2<count($str_sm2);$i2++) { $str_sm2[$i2]=stripcslashes(htmlspecialchars($str_sm2[$i2])); $msg=str_replace("$str_sm2[$i2]", "<img src=\"/smiles/$str_sm[0].gif\" alt=\"\" />", $msg); } } $q=mysql_query("SELECT * FROM `user_smiles_spis`"); //Личные смайлы while($post = mysql_fetch_array($q)){ $msg = str_replace($post['sim'], '<a><img src="/smiles/usersmiles/'.$post['name'].'.gif" alt="'.$post['name'].'"/></a>', $msg); } if ($user['level']>3){ $f_smiles=file(H."smiles/smiles_mod.txt"); for ($i=0;$i<count($f_smiles);$i++) { $str_sm=explode(' ',trim($f_smiles[$i])); $str_sm2=''; for ($z=1;$z<count($str_sm);$z++) { if ($z>1){$str_sm2.=' ';} $str_sm2.=$str_sm[$z]; } $str_sm2=explode(',',$str_sm2); for ($i2=0;$i2<count($str_sm2);$i2++) { $str_sm2[$i2]=stripcslashes(htmlspecialchars($str_sm2[$i2])); $msg=my_replace("$str_sm2[$i2]", "<img src=\"/smiles/$str_sm[0].gif\" alt=\"\" />", $msg, $count_smiles); } }} return $msg;}function links_preg1($arr){return '<a href="'.$arr[1].'">'.$arr[2].'</a>';}function links_preg2($arr){return $arr[1].'<a href="'.$arr[2].'">'.$arr[2].'</a>'.$arr[4];}function links($msg){$msg=preg_replace_callback('~\[url=([^ \r\n\t`\'"]+)\](.*?)\[/url\]~iu', 'links_preg1', $msg);$msg=preg_replace_callback('~(^|\s)([a-z]+://([^ \r\n\t`\'"]+))(\s|$)~iu', 'links_preg2', $msg);return $msg;}$versiya = '4.0';function bbcodehightlight($arr){$arr[0]=html_entity_decode($arr[0], ENT_QUOTES, 'UTF-8');$arr[0]=preg_replace('#<img src="(.*?)" alt="(.*?)" />#sui', '\\2', $arr[0]);return '<div class="" style="overflow:scroll;clip:auto;max-width:480px;">'.preg_replace('#<code>(.*?)</code>#si', '\\1' ,highlight_string($arr[0],1)).'</div>'."\n";}function BBcode($msg){$msg=preg_replace('#\[b\](.*?)\[/b\]#si', '<span style="font-weight: bold;">\1</span>', $msg);$msg=preg_replace('#\[i\](.*?)\[/i\]#si', '<span style="font-style: italic;">\1</span>', $msg);$msg=preg_replace('#\[u\](.*?)\[/u\]#si', '<span style="text-decoration: underline;">\1</span>', $msg);$msg=preg_replace('#\[b\](.*?)\[/b\]#si', '<span style="font-weight: bold;">\1</span>', $msg);$msg=preg_replace('#\[i\](.*?)\[/i\]#si', '<span style="font-style: italic;">\1</span>', $msg);$msg=preg_replace('#\[q\](.*?)\[/q\]#si', '<span style="text-decoration: underline;">\1</span>', $msg);$msg=preg_replace('#\[del\](.*?)\[/del\]#si', '<del>\1</del>', $msg);$msg=preg_replace('#\[small\](.*?)\[/small\]#si', '<span style="font-size: small;">\1</span>', $msg);$msg=preg_replace('#\[big\](.*?)\[/big\]#si', '<span style="font-size: large;">\1</span>', $msg);$msg=preg_replace('#\[blink\](.*?)\[/blink\]#si', '<blink>\1</blink>', $msg);$msg=preg_replace('#\[red\](.*?)\[/red\]#si', '<span style="color:#FF0000;">\1</span>', $msg);$msg=preg_replace('#\[green\](.*?)\[/green\]#si', '<span style="color:#00FF00;">\1</span>', $msg);$msg=preg_replace('#\[blue\](.*?)\[/blue\]#si', '<span style="color:#0000FF;">\1</span>', $msg);$msg=preg_replace('#\[yellow\](.*?)\[/yellow\]#si', '<span style="color:#ffff22;">\1</span>', $msg);$msg=preg_replace('#\[fea\](.*?)\[/fea\]#si', '<span style="color:#FF00FF;">\1</span>', $msg);return $msg;}define('vb12', true);function br($msg,$br='<br />'){$msg=eregi_replace("((<br( ?/?)>)|\n|\r)+",$br, $msg);return $msg;}function page2($page2){$page2=str_replace('</body>','<div align="center"><small><a href="http://masteram.us">© -=ШАХТЕР=-</a></small></div></body>',$page2);$page2=str_replace('</card>','<div align="center"><small><a href="http://masteram.us">© -=ШАХТЕР=-</a></small></div></card>',$page2);return $page2;}if ((eregi('^/enter\.php',$_SERVER['SCRIPT_NAME']))||(eregi('^/index\.php',$_SERVER['SCRIPT_NAME']))){ob_start(page2);define('set2.0', true);}else if ((eregi('^'.dirname($_SERVER['PHP_SELF']).'/enter\.php',$_SERVER['SCRIPT_NAME']))||(eregi('^'.dirname($_SERVER['PHP_SELF']).'/index\.php',$_SERVER['SCRIPT_NAME']))){ob_start(page2);}function esc($text,$br=NULL){if ($br!=NULL)for ($i=0;$i<=31;$i++)$text=str_replace(chr($i), NULL, $text);else{for ($i=0;$i<10;$i++)$text=str_replace(chr($i), NULL, $text);for ($i=11;$i<20;$i++)$text=str_replace(chr($i), NULL, $text);for ($i=21;$i<=31;$i++)$text=str_replace(chr($i), NULL, $text);}return $text;}function text($str,$br=true,$html=true,$smiles=true,$links=true,$bbcode=true){if ($html==true)if ($smiles==true)$str=smiles($str);if ($links==true)$str=links($str);if ($bbcode==true)$str=bbcode($str);if ($br==true){$str=br($str);$str=esc($str);}else{$str=esc($str);}return $str;}function color_msg($text){global $db, $set,$user, $msg;if ($msg['color']==1)$text = '[red]'.$msg['msg'].'[/red]';elseif ($msg['color']==2)$text = '[blue]'.$msg['msg'].'[/blue]';elseif ($msg['color']==3)$text = '[fea]'.$msg['msg'].'[/fea]';elseif ($msg['color']==4)$text = '[green]'.$msg['msg'].'[/green]';return $text;}function bb_msg($text){global $db, $set,$user, $msg;if ($msg['bb']==1)$text = '[i]'.$text.'[/i]';elseif ($msg['bb']==2)$text = '[u]'.$text.'[/u]';elseif ($msg['bb']==3)$text = '[i][u]'.$text.'[/u][/i]';elseif ($msg['bb']==4)$text = '[b]'.$text.'[/b]';elseif ($msg['bb']==5)$text = '[i][b]'.$text.'[/b][/i]';elseif ($msg['bb']==6)$text = '[big]'.$text.'[/big]';return $text;}function emo_msg($text){global $db, $set,$user, $msg;if ($msg['emo']==1) $text = '[Радостно] '.$text;elseif ($msg['emo']==2) $text = '[Печально] '.$text;elseif ($msg['emo']==3) $text = '[Удивленно] '.$text;elseif ($msg['emo']==4) $text = '[Ласково] '.$text;elseif ($msg['emo']==5) $text = '[Смущенно] '.$text;elseif ($msg['emo']==6) $text = '[Кокетливо] '.$text;elseif ($msg['emo']==7) $text = '[Обиженно] '.$text;elseif ($msg['emo']==8) $text = '[Настойчиво] '.$text;elseif ($msg['emo']==9) $text = '[Шепотом] '.$text;elseif ($msg['emo']==10) $text = '[Задумчиво] '.$text;elseif ($msg['emo']==11) $text = '[Злобно] '.$text;return $text;}function antir($msg){global $db, $set,$user;$msg = str_replace("((http://))((([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z;]{2,3}))|(([0-9]{1,3}\.){3}([0-9]{1,3})))((/|\?)[a-z0-9~#%&'_\+=:;\?\.-]*)*)", "".$set['antir']."", $msg);$msg=str_replace(".wab.","".$set['antir']."",$msg);$msg=str_replace(".com","".$set['antir']."",$msg);$msg=str_replace(".net","".$set['antir']."",$msg);$msg=str_replace(".org","".$set['antir']."",$msg);$msg=str_replace(".kz","".$set['antir']."",$msg);$msg=str_replace(".ua","".$set['antir']."",$msg);$msg=str_replace(".ru","".$set['antir']."",$msg);$msg=str_replace(",ru","".$set['antir']."",$msg);$msg=str_replace("-ru","".$set['antir']."",$msg);$msg=str_replace("-ru","".$set['antir']."",$msg);$msg=str_replace("_ru","".$set['antir']."",$msg);$msg=str_replace("-net","".$set['antir']."",$msg);$msg=str_replace(",net","".$set['antir']."",$msg);$msg=str_replace("-su","".$set['antir']."",$msg);$msg=str_replace("_su","".$set['antir']."",$msg);$msg=str_replace(".su","".$set['antir']."",$msg);$msg=str_replace(",su","".$set['antir']."",$msg);$msg=str_replace("-mobi","".$set['antir']."",$msg);$msg=str_replace("_mobi","".$set['antir']."",$msg);$msg=str_replace(".mobi","".$set['antir']."",$msg);$msg=str_replace(",mobi","".$set['antir']."",$msg);$msg=str_replace("-info","".$set['antir']."",$msg);$msg=str_replace("_info","".$set['antir']."",$msg);$msg=str_replace(".info","".$set['antir']."",$msg);$msg=str_replace(",info","".$set['antir']."",$msg);$msg=str_replace("-com","".$set['antir']."",$msg);$msg=str_replace("_com","".$set['antir']."",$msg);$msg=str_replace(".com","".$set['antir']."",$msg);$msg=str_replace(",com","".$set['antir']."",$msg);$msg=str_replace("-msk","".$set['antir']."",$msg);$msg=str_replace("_msk","".$set['antir']."",$msg);$msg=str_replace(".msk","".$set['antir']."",$msg);$msg=str_replace(",msk","".$set['antir']."",$msg);$msg=str_replace("-tk","".$set['antir']."",$msg);$msg=str_replace("_tk","".$set['antir']."",$msg);$msg=str_replace(".tk","".$set['antir']."",$msg);$msg=str_replace(",tk","".$set['antir']."",$msg);$msg=str_replace(".in","".$set['antir']."",$msg);$msg=str_replace("-cn","".$set['antir']."",$msg);$msg=str_replace("_cn","".$set['antir']."",$msg);$msg=str_replace(".cn","".$set['antir']."",$msg);$msg=str_replace(",cn","".$set['antir']."",$msg);$msg=str_replace("-biz","".$set['antir']."",$msg);$msg=str_replace("_biz","".$set['antir']."",$msg);$msg=str_replace(".biz","".$set['antir']."",$msg);$msg=str_replace(",biz","".$set['antir']."",$msg);$msg=str_replace("-h2m","".$set['antir']."",$msg);$msg=str_replace("_h2m","".$set['antir']."",$msg);$msg=str_replace(".h2m","".$set['antir']."",$msg);$msg=str_replace(",h2m","".$set['antir']."",$msg);$msg=str_replace("-wen","".$set['antir']."",$msg);$msg=str_replace("_wen","".$set['antir']."",$msg);$msg=str_replace(".wen","".$set['antir']."",$msg);$msg=str_replace(",wen","".$set['antir']."",$msg);$msg=str_replace("-ua","".$set['antir']."",$msg);$msg=str_replace("_ua","".$set['antir']."",$msg);$msg=str_replace(".ua","".$set['antir']."",$msg);$msg=str_replace(",ua","".$set['antir']."",$msg);return $msg;}function antim($text){$text=strtr($text,array('сука'=>'***','блядь'=>'***','блядь'=>'***','хуй'=>'***','пизда'=>'***','сучка'=>'***','пидор'=>'***','пидар'=>'***','пидор'=>'***','пидрила'=>'***','чмо'=>'***','ебать'=>'***','бля'=>'***'));return $text;}function url_replace($m) {if( !isset($m[3]) ) {return '<a href="' . $m[1] . '">' . $m[2] . '</a>';} else {return '<a href="' . $m[3] . '">' . $m[3] . '</a>';}}function img_replace($m) {if( !isset($m[3]) ) {return '<img src="' . $m[1] . '" alt="' . $m[2] . '">';} else {return '<img src="' . $m[3] . '" alt="' . $m[3] . '">';}}//------------------ Функция вставки BB-кода --------------------//function bb2($text){$text = preg_replace_callback('~\\[link=(http://.+?)\\](.+?)\\[/link\\]|(http://(www.)?[0-9a-z\.-]+\.[0-9a-z]{2,6}[0-9a-zA-Z/\?\.\~&amp;_=/%-:#]*)~', 'url_replace', $text);$text = preg_replace_callback('~\\[imgs=(.+?)\\](.+?)\\[/imgs\\]|((www.)?[0-9a-z\.-]+\.[0-9a-z]{2,6}[0-9a-zA-Z/\?\.\~&amp;_=/%-:#]*)~', 'img_replace', $text);return $text;}?>
Код ужасный. Даж я такого в детстве не писал. Думал подправить потом плюнул
Добавлено спустя    57 секунд:
вверху настройка количества
Отредактировано TLENS (2011.09.26 21:09)
#242. POFIGISST Off (6)
Участник
2011.09.26 21:09
TLENS
с этим кодом весь чат не работает,просто белая страница(((
#243. TLENS Off (14)
Moderator
2011.09.26 21:09
Включи показ ошибок
#244. POFIGISST Off (6)
Участник
2011.09.26 21:09
не показывает((или я не правильно включаю,хотя вот error_reporting(-1); должно выводить ошибки((
Добавлено спустя   2 минуты  17 секунд:
error_reporting (E_ALL); и так включить пытался((нифига(((
#245. TLENS Off (14)
Moderator
2011.09.26 21:09
Попробуй поставить в самом начале ведь этот инклюдится куда то
error_reporting(E_ALL);
ini_set("display_errors", 1);
Добавлено спустя   1 минуту  2 секунды:
В общем код дал рабочий. Ничего в нем не менял кроме одной функции она работает разбирайся сам. Включай мозги
Отредактировано TLENS (2011.09.26 21:09)
#246. Gemorroj Off (107)
Administrator
2011.09.26 22:10
замени <? на
<?php
#247. POFIGISST Off (6)
Участник
2011.09.26 22:10
TLENS
спасибо Дим,это с самим файлом хуйня какая-то,хотя раньше норм вродь работал((
Добавлено спустя   2 минуты  12 секунд:
Gemorroj написал:
замени <? на
<?php
спасиб Паш,забываю это исправлять когда редачу файлы((
#248. POFIGISST Off (6)
Участник
2011.09.26 22:10
а если вот так

Код:
span style="color: #0000BB"><?phpdefine('MAX_SMILES',2); // Максимальное количество смайлов$cache_sml;$cache_pat;$n = 0;function sml_replace_callback($match){global $cache_sml,$n; if($n == MAX_SMILES)return '';$n++;return $cache_sml[$match[1]];}function smiles($msg){global $cache_pat,$cache_sml,$user,$n;if(empty($cache_sml) or empty($cache_pat)){$file = file_get_contents(H.'smiles/smiles.txt');preg_match_all('%(.+) (.+)%',$file,$arr);$cache_pat = array_map('sml_mk_pat',$arr[2]);$arr[1] = array_map('sml_mk_img',$arr[1]);$cache_sml = array_combine($arr[2],$arr[1]);}$q=mysql_query("SELECT * FROM `user_smiles_spis`"); //Личные смайлы while($post = mysql_fetch_array($q)){$msg = str_replace($post['sim'],'<a><img src= "/smiles/usersmiles/'.$pot['name'].'.gif" alt="'.$post['name'].'"/></a>',$msg);}$msg = preg_replace_callback($cache_pat,'sml_replace_callback',$msg);$n = 0;return $msg;}function sml_mk_pat($sml){return '%('.preg_quote($sml).')%';}function sml_mk_img($sml){return '<img src="/smiles/'.$sml.'.gif"/>';}function links_preg1($arr){return '<a href="'.$arr[1].'">'.$arr[2].'</a>';}function links_preg2($arr){return $arr[1].'<a href="'.$arr[2].'">'.$arr[2].'</a>'.$arr[4];}function links($msg){$msg=preg_replace_callback('~\[url=([^ \r\n\t`\'"]+)\](.*?)\[/url\]~iu', 'links_preg1', $msg);$msg=preg_replace_callback('~(^|\s)([a-z]+://([^ \r\n\t`\'"]+))(\s|$)~iu', 'links_preg2', $msg);return $msg;}$versiya = '4.0 Лицензионная';function bbcodehightlight($arr){$arr[0]=html_entity_decode($arr[0], ENT_QUOTES, 'UTF-8');$arr[0]=preg_replace('#<img src="(.*?)" alt="(.*?)" />#sui', '\\2', $arr[0]);return '<div class="" style="overflow:scroll;clip:auto;max-width:480px;">'.preg_replace('#<code>(.*?)</code>#si', '\\1' ,highlight_string($arr[0],1)).'</div>'."\n";}function BBcode($msg){$msg=preg_replace('#\[b\](.*?)\[/b\]#si', '<span style="font-weight: bold;">\1</span>', $msg);$msg=preg_replace('#\[i\](.*?)\[/i\]#si', '<span style="font-style: italic;">\1</span>', $msg);$msg=preg_replace('#\[u\](.*?)\[/u\]#si', '<span style="text-decoration: underline;">\1</span>', $msg);$msg=preg_replace('#\[b\](.*?)\[/b\]#si', '<span style="font-weight: bold;">\1</span>', $msg);$msg=preg_replace('#\[i\](.*?)\[/i\]#si', '<span style="font-style: italic;">\1</span>', $msg);$msg=preg_replace('#\[q\](.*?)\[/q\]#si', '<span style="text-decoration: underline;">\1</span>', $msg);$msg=preg_replace('#\[del\](.*?)\[/del\]#si', '<del>\1</del>', $msg);$msg=preg_replace('#\[small\](.*?)\[/small\]#si', '<span style="font-size: small;">\1</span>', $msg);$msg=preg_replace('#\[big\](.*?)\[/big\]#si', '<span style="font-size: large;">\1</span>', $msg);$msg=preg_replace('#\[blink\](.*?)\[/blink\]#si', '<blink>\1</blink>', $msg);$msg=preg_replace('#\[red\](.*?)\[/red\]#si', '<span style="color:#FF0000;">\1</span>', $msg);$msg=preg_replace('#\[green\](.*?)\[/green\]#si', '<span style="color:#00FF00;">\1</span>', $msg);$msg=preg_replace('#\[blue\](.*?)\[/blue\]#si', '<span style="color:#0000FF;">\1</span>', $msg);$msg=preg_replace('#\[yellow\](.*?)\[/yellow\]#si', '<span style="color:#ffff22;">\1</span>', $msg);$msg=preg_replace('#\[fea\](.*?)\[/fea\]#si', '<span style="color:#FF00FF;">\1</span>', $msg);return $msg;}define('vb3', true);function br($msg,$br='<br />'){$msg=eregi_replace("((<br( ?/?)>)|\n|\r)+",$br, $msg);return $msg;}function esc($text,$br=NULL){if ($br!=NULL)for ($i=0;$i<=31;$i++)$text=str_replace(chr($i), NULL, $text);else{for ($i=0;$i<10;$i++)$text=str_replace(chr($i), NULL, $text);for ($i=11;$i<20;$i++)$text=str_replace(chr($i), NULL, $text);for ($i=21;$i<=31;$i++)$text=str_replace(chr($i), NULL, $text);}return $text;}function text($str,$br=true,$html=true,$smiles=true,$links=true,$bbcode=true){if ($html==true)if ($smiles==true)$str=smiles($str);if ($links==true)$str=links($str);if ($bbcode==true)$str=bbcode($str);if ($br==true){$str=br($str);$str=esc($str);}else{$str=esc($str);}return $str;}function color_msg($text){global $db, $set,$user, $msg;if ($msg['color']==1)$text = '[red]'.$msg['msg'].'[/red]';elseif ($msg['color']==2)$text = '[blue]'.$msg['msg'].'[/blue]';elseif ($msg['color']==3)$text = '[fea]'.$msg['msg'].'[/fea]';elseif ($msg['color']==4)$text = '[green]'.$msg['msg'].'[/green]';return $text;}function bb_msg($text){global $db, $set,$user, $msg;if ($msg['bb']==1)$text = '[i]'.$text.'[/i]';elseif ($msg['bb']==2)$text = '[u]'.$text.'[/u]';elseif ($msg['bb']==3)$text = '[i][u]'.$text.'[/u][/i]';elseif ($msg['bb']==4)$text = '[b]'.$text.'[/b]';elseif ($msg['bb']==5)$text = '[i][b]'.$text.'[/b][/i]';elseif ($msg['bb']==6)$text = '[big]'.$text.'[/big]';return $text;}function emo_msg($text){global $db, $set,$user, $msg;if ($msg['emo']==1) $text = '[Радостно] '.$text;elseif ($msg['emo']==2) $text = '[Печально] '.$text;elseif ($msg['emo']==3) $text = '[Удивленно] '.$text;elseif ($msg['emo']==4) $text = '[Ласково] '.$text;elseif ($msg['emo']==5) $text = '[Смущенно] '.$text;elseif ($msg['emo']==6) $text = '[Кокетливо] '.$text;elseif ($msg['emo']==7) $text = '[Обиженно] '.$text;elseif ($msg['emo']==8) $text = '[Настойчиво] '.$text;elseif ($msg['emo']==9) $text = '[Шепотом] '.$text;elseif ($msg['emo']==10) $text = '[Задумчиво] '.$text;elseif ($msg['emo']==11) $text = '[Злобно] '.$text;return $text;}function antir($msg){global $db, $set,$user;$msg = str_replace("((http://))((([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z;]{2,3}))|(([0-9]{1,3}\.){3}([0-9]{1,3})))((/|\?)[a-z0-9~#%&'_\+=:;\?\.-]*)*)", "".$set['antir']."", $msg);$msg=str_replace(".wab.","".$set['antir']."",$msg);$msg=str_replace(".com","".$set['antir']."",$msg);$msg=str_replace(".net","".$set['antir']."",$msg);$msg=str_replace(".org","".$set['antir']."",$msg);$msg=str_replace(".kz","".$set['antir']."",$msg);$msg=str_replace(".ua","".$set['antir']."",$msg);$msg=str_replace(".ru","".$set['antir']."",$msg);$msg=str_replace(",ru","".$set['antir']."",$msg);$msg=str_replace("-ru","".$set['antir']."",$msg);$msg=str_replace("-ru","".$set['antir']."",$msg);$msg=str_replace("_ru","".$set['antir']."",$msg);$msg=str_replace("-net","".$set['antir']."",$msg);$msg=str_replace(",net","".$set['antir']."",$msg);$msg=str_replace("-su","".$set['antir']."",$msg);$msg=str_replace("_su","".$set['antir']."",$msg);$msg=str_replace(".su","".$set['antir']."",$msg);$msg=str_replace(",su","".$set['antir']."",$msg);$msg=str_replace("-mobi","".$set['antir']."",$msg);$msg=str_replace("_mobi","".$set['antir']."",$msg);$msg=str_replace(".mobi","".$set['antir']."",$msg);$msg=str_replace(",mobi","".$set['antir']."",$msg);$msg=str_replace("-info","".$set['antir']."",$msg);$msg=str_replace("_info","".$set['antir']."",$msg);$msg=str_replace(".info","".$set['antir']."",$msg);$msg=str_replace(",info","".$set['antir']."",$msg);$msg=str_replace("-com","".$set['antir']."",$msg);$msg=str_replace("_com","".$set['antir']."",$msg);$msg=str_replace(".com","".$set['antir']."",$msg);$msg=str_replace(",com","".$set['antir']."",$msg);$msg=str_replace("-msk","".$set['antir']."",$msg);$msg=str_replace("_msk","".$set['antir']."",$msg);$msg=str_replace(".msk","".$set['antir']."",$msg);$msg=str_replace(",msk","".$set['antir']."",$msg);$msg=str_replace("-tk","".$set['antir']."",$msg);$msg=str_replace("_tk","".$set['antir']."",$msg);$msg=str_replace(".tk","".$set['antir']."",$msg);$msg=str_replace(",tk","".$set['antir']."",$msg);$msg=str_replace(".in","".$set['antir']."",$msg);$msg=str_replace("-cn","".$set['antir']."",$msg);$msg=str_replace("_cn","".$set['antir']."",$msg);$msg=str_replace(".cn","".$set['antir']."",$msg);$msg=str_replace(",cn","".$set['antir']."",$msg);$msg=str_replace("-biz","".$set['antir']."",$msg);$msg=str_replace("_biz","".$set['antir']."",$msg);$msg=str_replace(".biz","".$set['antir']."",$msg);$msg=str_replace(",biz","".$set['antir']."",$msg);$msg=str_replace("-h2m","".$set['antir']."",$msg);$msg=str_replace("_h2m","".$set['antir']."",$msg);$msg=str_replace(".h2m","".$set['antir']."",$msg);$msg=str_replace(",h2m","".$set['antir']."",$msg);$msg=str_replace("-wen","".$set['antir']."",$msg);$msg=str_replace("_wen","".$set['antir']."",$msg);$msg=str_replace(".wen","".$set['antir']."",$msg);$msg=str_replace(",wen","".$set['antir']."",$msg);$msg=str_replace("-ua","".$set['antir']."",$msg);$msg=str_replace("_ua","".$set['antir']."",$msg);$msg=str_replace(".ua","".$set['antir']."",$msg);$msg=str_replace(",ua","".$set['antir']."",$msg);return $msg;}function antim($text){$text=strtr($text,array('сука'=>'***','блядь'=>'***','блядь'=>'***','хуй'=>'***','пизда'=>'***','сучка'=>'***','пидор'=>'***','пидар'=>'***','пидор'=>'***','пидрила'=>'***','чмо'=>'***','ебать'=>'***','бля'=>'***'));return $text;}function url_replace($m) {if( !isset($m[3]) ) {return '<a href="' . $m[1] . '">' . $m[2] . '</a>';} else {return '<a href="' . $m[3] . '">' . $m[3] . '</a>';}}function img_replace($m) {if( !isset($m[3]) ) {return '<img src="' . $m[1] . '" alt="' . $m[2] . '">';} else {return '<img src="' . $m[3] . '" alt="' . $m[3] . '">';}}//------------------ Функция вставки BB-кода --------------------//function bb2($text){$text = preg_replace_callback('~\\[link=(http://.+?)\\](.+?)\\[/link\\]|(http://(www.)?[0-9a-z\.-]+\.[0-9a-z]{2,6}[0-9a-zA-Z/\?\.\~&amp;_=/%-:#]*)~', 'url_replace', $text);$text = preg_replace_callback('~\\[imgs=(.+?)\\](.+?)\\[/imgs\\]|((www.)?[0-9a-z\.-]+\.[0-9a-z]{2,6}[0-9a-zA-Z/\?\.\~&amp;_=/%-:#]*)~', 'img_replace', $text);return $text;}?>
сделать? но так почему то не выводит лычный смайл,вернее показывает что должна быть картинка,но её нету,оно имя из базы не тянет,по исходному коду показывает вот так

<a><img src= "/smiles/usersmiles/.gif" alt="222"/>


имя не берет почему то((
#249. WapStyle Off (3)
Участник
2011.09.26 22:10
Код:
function links_preg1($arr)
{
return '<a href="'.$arr[1].'">'.$arr[2].'</a>';
}
function links_preg2($arr)
{
return $arr[1].'<a href="'.$arr[2].'">'.$arr[2].'</a>'.$arr[4];
}
Это часть кода...

Жгёш пополной big_smile
Отредактировано WapStyle (2011.09.26 22:10)
#250. POFIGISST Off (6)
Участник
2011.09.26 22:10
WapStyle написал:
Код:
function links_preg1($arr)
{
return '<a href="'.$arr[1].'">'.$arr[2].'</a>';
}
function links_preg2($arr)
{
return $arr[1].'<a href="'.$arr[2].'">'.$arr[2].'</a>'.$arr[4];
}
Это часть кода...

Жгёш пополной big_smile
чесн сказать,я сам даже такого не напишу((
Страниц: 123 24 25 26 27118 Все
Главная
WEB
PunBB Mod v0.6.2
0.041 s