- Hamarosan megkezdődik a nubia 2,8K-s táblagépének szállítása
- Barátokká váltak az eddig rivális AI-óriások
- ASUS blog: Ideális olcsó utazós gép lett az új Vivobook S14
- Az Aura Displays hordozható monitorhármasa jól felturbózhatja a produktivitást
- Dual Mode-os IPS monitorral adott magáról életjelet a Gigabyte
Új hozzászólás Aktív témák
-
tothjozsi96
addikt
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.
-
Des1gnR
őstag
válasz
Sk8erPeter #16288 üzenetére
Ilyet nem írtam
Szerk: Igen
Új hozzászólás Aktív témák
- sziku69: Szólánc.
- sziku69: Fűzzük össze a szavakat :)
- Luck Dragon: Asszociációs játék. :)
- Vicces képek
- One otthoni szolgáltatások (TV, internet, telefon)
- Milyen billentyűzetet vegyek?
- SD-kártyát vennél? Ezért ne csak a GB-ot nézd! – Tech Percek #9
- A fociról könnyedén, egy baráti társaságban
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Macron betiltatná az EU-ban a közösségi médiát a 15 év alattiaknak
- További aktív témák...
- Apple Ipad 10.generáció
- Új HP Pavilion x360 14-ek Érintős hajtogatós Laptop Tab 14" -35% i5-1335U 8/512 FHD IPS Iris Xe
- RTX 4080 SUPER,16GB. Ryzen 7 7800X3D, 32 RAM Fury RGB! Garancia!
- Asztali PC , i7 9700K , RX 5700 XT , 32GB DDR4 , 500GB NVME , 1TB HDD
- Dell Inspiron 5406 2-in-1i5-1135G7 16GB DDR4 3200 512GB NVME 14" FHD Érintőkijelző W11Pro
- Napi 1000 -ft tól elvihető RÉSZLETFIZETÉS BANKMENTES MSI Cyborg 15 A13VE
- LG 25GR75FG - E-Sport Monitor - FHD 360Hz 1ms - NVIDIA Reflex + G-sync - AMD FreeSync - HDR 400
- Update 06.13. Bomba árak 2025-ben is! Üzleti - Consumer laptopok DELL FUJITSU HP LENOVO
- Gamer laptop felvásárlás Magas áron, gyorsan és egyszerűen!
- ÁRGARANCIA!Épített KomPhone Ryzen 7 7800X3D 32/64GB RAM RTX 4070Ti Super GAMER PC termékbeszámítás
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: CAMERA-PRO Hungary Kft
Város: Budapest