$param, 'caller' => 'discuzcode'), 'discuzcode'); } $_G['delattach'] = array(); $message = fparsesmiles($message); if(strpos($msglower, 'attach://') !== FALSE) { $message = preg_replace("/attach:\/\/(\d+)\.?(\w*)/i", '', $message); } if(strpos($msglower, 'ed2k://') !== FALSE) { $message = preg_replace("/ed2k:\/\/(.+?)\//", '', $message); } if(strpos($msglower, '[/i]') !== FALSE) { $message = preg_replace("/\s*\[i=s\][\n\r]*(.+?)[\n\r]*\[\/i\]\s*/is", '', $message); } $message = str_replace('[/p]', "\n", $message); $message = str_replace(array( '[/color]', '[/backcolor]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', '[s]', '[/s]', '[hr]', '[i=s]', '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', '[list=A]', "\r\n[*]", '[*]', '[/list]', '[indent]', '[/indent]', '[/float]' ), '', preg_replace(array( "/\[color=([#\w]+?)\]/i", "/\[color=((rgb|rgba)\([\d\s,]+?\))\]/i", "/\[backcolor=([#\w]+?)\]/i", "/\[backcolor=((rgb|rgba)\([\d\s,]+?\))\]/i", "/\[size=(\d{1,2}?)\]/i", "/\[size=(\d{1,2}(\.\d{1,2}+)?(px|pt)+?)\]/i", "/\[font=([^\[\<]+?)\]/i", "/\[align=(left|center|right)\]/i", "/\[float=left\]/i", "/\[float=right\]/i" ), '', $message)); if(strpos($msglower, '[/p]') !== FALSE) { $message = preg_replace("/\[p=(\d{1,2}|null), (\d{1,2}|null), (left|center|right)\]/i", "
", $message); $message = str_replace('[/p]', '
', $message); } if(strpos($msglower, '[/quote]') !== FALSE) { $message = preg_replace("/\s?\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s?/is", '', $message); } if(strpos($msglower, '[/free]') !== FALSE) { $message = preg_replace("/\s*\[free\][\n\r]*(.+?)[\n\r]*\[\/free\]\s*/is", '', $message); } if(isset($_G['cache']['bbcodes'][-$allowbbcode])) { $message = preg_replace($_G['cache']['bbcodes'][-$allowbbcode]['searcharray'], '', $message); } if(strpos($msglower, '[/hide]') !== FALSE) { preg_replace_callback("/\[hide.*?\]\s*(.*?)\s*\[\/hide\]/is", 'followcode_callback_hideattach_1', $message); if(strpos($msglower, '[hide]') !== FALSE) { $message = preg_replace("/\[hide\]\s*(.*?)\s*\[\/hide\]/is", '', $message); } if(strpos($msglower, '[hide=') !== FALSE) { $message = preg_replace("/\[hide=(d\d+)?[,]?(\d+)?\]\s*(.*?)\s*\[\/hide\]/is", '', $message); } } if(strpos($msglower, '[/url]') !== FALSE) { $message = preg_replace_callback("/\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:)?([^\r\n\[\"']+?))?\](.+?)\[\/url\]/is", 'followcode_callback_fparseurl_152', $message); } if(strpos($msglower, '[/email]') !== FALSE) { $message = preg_replace_callback("/\[email(=([a-z0-9\-_.+]+)@([a-z0-9\-_]+[.][a-z0-9\-_.]+))?\](.+?)\[\/email\]/is", 'followcode_callback_fparseemail_14', $message); } $nest = 0; while(strpos($msglower, '[table') !== FALSE && strpos($msglower, '[/table]') !== FALSE){ $message = preg_replace_callback("/\[table(?:=(\d{1,4}%?)(?:,([\(\)%,#\w ]+))?)?\]\s*(.+?)\s*\[\/table\]/is", 'followcode_callback_fparsetable_123', $message); if(++$nest > 4) break; } if(strpos($msglower, '[/media]') !== FALSE) { $message = preg_replace_callback("/\[media=([\w,]+)\]\s*([^\[\<\r\n]+?)\s*\[\/media\]/is", 'followcode_callback_fparsemedia_12', $message); } if(strpos($msglower, '[/audio]') !== FALSE) { $message = preg_replace_callback("/\[audio(=1)*\]\s*([^\[\<\r\n]+?)\s*\[\/audio\]/is", 'followcode_callback_fparseaudio_2', $message); } if(strpos($msglower, '[/flash]') !== FALSE) { $message = preg_replace_callback("/\[flash(=(\d+),(\d+))?\]\s*([^\[\<\r\n]+?)\s*\[\/flash\]/is", 'followcode_callback_fparseflash_4', $message); } if($parsetype != 1 && strpos($msglower, '[swf]') !== FALSE) { $message = preg_replace_callback("/\[swf\]\s*([^\[\<\r\n]+?)\s*\[\/swf\]/is", 'followcode_callback_bbcodeurl_1', $message); } $flag = $length ? 1 : 0; if($tid) { $extra = "onclick=\"changefeed($tid, $pid, $flag, this)\""; } if(strpos($msglower, '[/img]') !== FALSE) { $message = preg_replace_callback("/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", create_function('$matches', 'return '.intval($allowimg).' ? fparseimg($matches[1], \''.addslashes($extra).'\') : \'\';'), $message); $message = preg_replace_callback("/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/is", create_function('$matches', 'return '.intval($allowimg).' ? fparseimg($matches[3], \''.addslashes($extra).'\') : \'\';'), $message); } if($tid && $pid) { $_G['post_attach'] = C::t('forum_attachment_n')->fetch_all_by_id(getattachtableid($tid), 'pid', $pid); foreach($_G['post_attach'] as $aid => $attach) { if(!empty($_G['delattach']) && in_array($aid, $_G['delattach'])) { continue; } $message .= "[attach]$attach[aid][/attach]"; $message = preg_replace("/\[attach\]$attach[aid]\[\/attach\]/i", fparseattach($attach['aid'], $length, $extra), $message, 1); } } if(strpos($msglower, '[/attach]') !== FALSE) { $message = preg_replace("/\[attach\]\s*([^\[\<\r\n]+?)\s*\[\/attach\]/is", '', $message); } $message = clearnl($message); if($length) { $sppos = strpos($message, chr(0).chr(0).chr(0)); if($sppos !== false) { $message = substr($message, 0, $sppos); } $checkstr = cutstr($message, $length, ''); if(strpos($checkstr, '[') && strpos(strrchr($checkstr, "["), ']') === FALSE) { $length = strpos($message, ']', strrpos($checkstr, strrchr($checkstr, "["))); } $message = cutstr($message, $length+1, ' '.lang('space', 'follow_view_fulltext').''); } elseif($allowimg && !empty($extra)) { $message .= ''; } for($i = 0; $i <= $_G['forum_discuzcode']['pcodecount']; $i++) { $code = ''; if(isset($_G['forum_discuzcode']['codehtml'][$i]) && !empty($_G['forum_discuzcode']['codehtml'][$i])) { $code = $_G['forum_discuzcode']['codehtml'][$i]; } elseif(!$length) { if(isset($_G['forum_discuzcode']['audio'][$i]) && !empty($_G['forum_discuzcode']['audio'][$i])) { $code = $_G['forum_discuzcode']['audio'][$i]; } elseif(isset($_G['forum_discuzcode']['video'][$i]) && !empty($_G['forum_discuzcode']['video'][$i])) { $code = $_G['forum_discuzcode']['video'][$i]; } elseif(isset($_G['forum_discuzcode']['media'][$i]) && !empty($_G['forum_discuzcode']['media'][$i])) { $code = $_G['forum_discuzcode']['media'][$i]; } elseif(isset($_G['forum_discuzcode']['image'][$i]) && !empty($_G['forum_discuzcode']['image'][$i])) { $code = $_G['forum_discuzcode']['image'][$i]; } elseif(isset($_G['forum_discuzcode']['attach'][$i]) && !empty($_G['forum_discuzcode']['attach'][$i])) { $code = $_G['forum_discuzcode']['attach'][$i]; } } $message = str_replace("[\tD_$i\t]", $code, $message); } $message = clearnl($message); if(!empty($_GET['highlight'])) { $highlightarray = explode('+', $_GET['highlight']); $sppos = strrpos($message, chr(0).chr(0).chr(0)); if($sppos !== FALSE) { $specialextra = substr($message, $sppos + 3); $message = substr($message, 0, $sppos); } followcode_callback_highlightword_21($highlightarray, 1); $message = preg_replace_callback("/(^|>)([^<]+)(?=<|$)/sU", 'followcode_callback_highlightword_21', $message); $message = preg_replace("/'.str_replace(array('\|', '|', '\n'), array('|', ' | ', "\n"), $row).' |