Hirdetés
- Megbüntették, ezért feloszlatná az EU-t Elon Musk
- Mobil flották
- Elindult a One UI 8.5 béta program
- iPhone topik
- Az igazi Nokia örökébe lép egy legendás európai okostelefon
- Amazfit Active 2 NFC - jó kör
- Samsung Galaxy S21 Ultra - vákuumcsomagolás
- Xiaomi 15 - kicsi telefon nagy energiával
- Samsung Galaxy S23 Ultra - non plus ultra
- Máris megvásárolható az Ulefone új RugKing szériája
Új hozzászólás Aktív témák
-
válasz
Sk8erPeter
#16288
üzenetére
A format_comment valójában arra van hogy a kettős pont D-ből ez legyen:

Tehát csak bizonyos helyeken van meghívva.
Igen, tehát a teljesítményt jó lenne ha nem fogná vissza.
De ez egy ilyen letöltött kód, tehát nem saját.Elég rosszul van megírva, de mutatok egy examplet.

function format_comment($text, $strip_html = true)
{
global $smilies, $TBDEV;
$s = $text;
unset($text);
// This fixes the extraneous ;) smilies problem. When there was an html escaped
// char before a closing bracket - like >), "), ... - this would be encoded
// to &xxx;), hence all the extra smilies. I created a new :wink: label, removed
// the ;) one, and replace all genuine ;) by :wink: before escaping the body.
// (What took us so long? :blush:)- wyz
$s = str_replace(";)", ":wink:", $s);
if ($strip_html)
$s = htmlsafechars( $s );
if( preg_match( "#function\s*\((.*?)\|\|#is", $s ) )
{
$s = str_replace( ":" , ":", $s );
$s = str_replace( "[" , "[", $s );
$s = str_replace( "]" , "]", $s );
$s = str_replace( ")" , ")", $s );
$s = str_replace( "(" , "(", $s );
$s = str_replace( "{" , "{", $s );
$s = str_replace( "}" , "}", $s );
$s = str_replace( "$" , "$", $s );
}
// [code] tag (do first to make sure we take it out of the equation
$s = preg_replace( "#\[code\](.+?)\[/code\]#ies", "code_tag( '\\1' )", $s );
// [list]
while( preg_match( "#\n?\[list\](.+?)\[/list\]\n?#ies" , $s ) )
{
$s = preg_replace( "#\n?\[list\](.+?)\[/list\]\n?#ies", "BB_list('\\1')" , $s );
}
while( preg_match( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#ies" , $s ) )
{
$s = preg_replace( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#ies", "BB_list('\\2','\\1')" , $s );
}
// [b]Bold[/b]
$s = preg_replace("#\[b\](.+?)\[/b\]#is", "<b>\\1</b>", $s);
// [i]Italic[/i]
$s = preg_replace("#\[i\](.+?)\[/i\]#is", "<i>\\1</i>", $s);
// [u]Underline[/u]
$s = preg_replace("#\[u\](.+?)\[/u\]#is", "<u>\\1</u>", $s);
$s = preg_replace( "#\[(left|right|center)\](.+?)\[/\\1\]#is" , "<div align=\"\\1\">\\2</div>", $s );
while( preg_match( "#\[indent\](.+?)\[/indent\]#is" , $s ) )
{
$s = preg_replace( "#\[indent\](.+?)\[/indent\]#is" , "<blockquote>\\1</blockquote>", $s );
}
$s = preg_replace( "#\(c\)#i", "©", $s );
$s = preg_replace( "#\(tm\)#i", "™", $s );
$s = preg_replace( "#\(r\)#i", "®" , $s );
// [img]http://www/image.gif[/img]
$s = preg_replace("/\[img\](http:\/\/[^\s'\"<>]+(\.(jpg|gif|png)))\[\/img\]/i", "<img border=\"0\" src=\"\\1\" alt='' />", $s);
// [img=http://www/image.gif]
$s = preg_replace("/\[img=(http:\/\/[^\s'\"<>]+(\.(gif|jpg|png)))\]/i", "<img border=\"0\" src=\"\\1\" alt='' />", $s);
// [color=blue]Text[/color]
$s = preg_replace("#\[color=([^\];\d\s]+)\](.+?)\[/color\]#is",
"<span style='color:\\1;'>\\2</span>", $s);
// [color=#ffcc99]Text[/color]
/* $s = preg_replace(
"/\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\]((\s|.)+?)\[\/color\]/i",
"<font color='\\1'>\\2</font>", $s);
*/
// [url=http://www.example.com]Text[/url]
$s = preg_replace(
"/\[url=([^()<>\s]+?)\](.+?)\[\/url\]/i",
"<a href=\"\\1\">\\2</a>", $s);
// [url]http://www.example.com[/url]
/* $s = preg_replace(
"/\[url\]([^()<>\s]+?)\[\/url\]/i",
"<a href=\"\\1\">\\1</a>", $s);
*/
// [size=4]Text[/size]
$s = preg_replace(
"#\[size=([1-4])\](.+?)\[/size\]#si",
"<span style='font-size:\\1em;line-height:100%'>\\2</span>", $s);
// [font=Arial]Text[/font]
$s = preg_replace(
"/\[font=([a-zA-Z ,]+)\](.+?)\[\/font\]/i",
"<span style='font-family:\\1;'>\\2</span>", $s);
// //[quote]Text[/quote]
// $s = preg_replace(
// "/\[quote\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i",
// "<p class=sub><b>Quote:</b></p><table class=main border=1 cellspacing=0 cellpadding=10><tr><td style='border: 1px black dotted'>\\1</td></tr></table><br />", $s);
// //[quote=Author]Text[/quote]
// $s = preg_replace(
// "/\[quote=(.+?)\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i",
// "<p class=sub><b>\\1 wrote:</b></p><table class=main border=1 cellspacing=0 cellpadding=10><tr><td style='border: 1px black dotted'>\\2</td></tr></table><br />", $s);
// Quotes
$s = format_quotes($s);
// URLs
$s = format_urls($s);
// $s = format_local_urls($s);
// Linebreaks
$s = nl2br($s);
// [pre]Preformatted[/pre]
$s = preg_replace("/\[pre\]((\s|.)+?)\[\/pre\]/i", "<tt><span style=\"white-space: nowrap;\">\\1</span></tt>", $s);
// [nfo]NFO-preformatted[/nfo]
$s = preg_replace("/\[nfo\]((\s|.)+?)\[\/nfo\]/i", "<tt><span style=\"white-space: nowrap;\"><font face='MS Linedraw' size='2' style='font-size: 10pt; line-height: " .
"10pt'>\\1</font></span></tt>", $s);
// Maintain spacing
$s = str_replace(" ", " ", $s);
foreach($smilies as $code => $url) {
$s = str_replace($code, "<img border='0' src=\"{$TBDEV['pic_base_url']}smilies/{$url}\" alt=\"" . htmlsafechars($code) . "\" />", $s);
}
return $s;
}És az a baj hogy lefut az összes elméletileg és azért lassul meg ilyen csúnya módon.
Új hozzászólás Aktív témák
- Katana GF66 11UE 15.6" FHD IPS i5-11400H RTX 3060 16GB 1TB NVMe magyar vbill gar
- ZBook Fury 17 G7 17.3" 4K IPS i7-10850H RTX 3000 32GB 512GB NVMe IR kam gar
- Hp 650 G5 i5-8265 15,6" FHD 1 év garancia, Magyar, számlával
- ÚJ! BONTATLAN! 2018-as Inteles i5-ös Mac Mini(6 magos) 8GB 256GB eladó
- Apple iPhone 13 128GB, Akku: 85%, Normál, Kártyafüggetlen, Töltővel, 1 Év Garanciával!
- Samsung Galaxy A23 5G 128GB, Kártyafüggetlen, 1 Év Garanciával
- Apple iPhone X Space Gray Ikonikus dizájn, Face ID, OLED kijelző 64 GB Használt, megkímélt ,100%
- Dell Inspiron 5559 /i5-6200U/8GB/240GB SSD/kisebb-nagyobb hibával/
- BESZÁMÍTÁS! MSI B450M R5 5600X 32GB DDR4 512GB SSD RX 6800 16GB Zalman Z1 PLUS Cooler Master 750W
- DELL Precision 5540 Workstation i7-9850H Nvidia Quadro T2000 32GB 512GB 15.6" 1év garancia
Állásajánlatok
Cég: ATW Internet Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest




