-1, 'codecount' => 0, 'codehtml' => array(), 'passwordlock' => array(), 'smiliesreplaced' => 0, 'seoarray' => array( 0 => '', 1 => $_SERVER['HTTP_HOST'], 2 => $_G['setting']['bbname'], 3 => str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']), 4 => $_G['setting']['seokeywords'], 5 => $_G['setting']['seodescription'] ) ); if(!isset($_G['cache']['bbcodes']) || !is_array($_G['cache']['bbcodes']) || !is_array($_G['cache']['smilies'])) { loadcache(array('bbcodes', 'smilies', 'smileytypes')); } function creditshide($creditsrequire, $message, $pid, $authorid) { global $_G; if($_G['member']['credits'] >= $creditsrequire || $_G['forum']['ismoderator'] || $_G['uid'] && $authorid == $_G['uid']) { return tpl_hide_credits($creditsrequire, str_replace('\\"', '"', $message)); } else { return tpl_hide_credits_hidden($creditsrequire); } } function expirehide($expiration, $creditsrequire, $message, $dateline) { $expiration = $expiration ? substr($expiration, 1) : 0; if($expiration && $dateline && (TIMESTAMP - $dateline) / 86400 > $expiration) { return str_replace('\\"', '"', $message); } return '[hide'.($creditsrequire ? "=$creditsrequire" : '').']'.str_replace('\\"', '"', $message).'[/hide]'; } function codedisp($code) { global $_G; $_G['forum_discuzcode']['pcodecount']++; $code = dhtmlspecialchars(str_replace('\\"', '"', $code)); $code = str_replace("\n", "
Flash: {url} ');
}
function discuzcode_callback_jammer($matches) {
return jammer();
}
function parseurl($url, $text, $scheme) {
global $_G;
if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches)) {
$url = $matches[0];
$length = 65;
if(strlen($url) > $length) {
$text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
}
return ''.$text.'';
} else {
$url = substr($url, 1);
if(substr(strtolower($url), 0, 4) == 'www.') {
$url = 'http://'.$url;
}
$url = !$scheme ? $_G['siteurl'].$url : $url;
return ''.$text.'';
}
}
function parseflash($w, $h, $url) {
$w = !$w ? 550 : $w;
$h = !$h ? 400 : $h;
preg_match("/((https?){1}:\/\/|www\.)[^\r\n\[\"'\?]+(\.swf|\.flv)(\?[^\r\n\[\"'\?]+)?/i", $url, $matches);
$url = $matches[0];
$randomid = 'swf_'.random(3);
if(fileext($url) != 'flv') {
return '';
} else {
return '';
}
}
function parseed2k($url) {
global $_G;
list(,$type, $name, $size,) = explode('|', $url);
$url = 'ed2k://'.$url.'/';
$name = addslashes($name);
if($type == 'file') {
$ed2kid = 'ed2k_'.random(3);
return ''.dhtmlspecialchars(urldecode($name)).' ('.sizecount($size).')';
} else {
return ''.$url.'';
}
}
function parseattachurl($aid, $ext, $ignoretid = 0) {
global $_G;
require_once libfile('function/attachment');
$_G['forum_skipaidlist'][] = $aid;
if(!empty($ext)) {
$attach = C::t('forum_attachment_n')->fetch('aid:'.$aid, $aid);
if(!in_array(attachtype(fileext($attach['filename'])."\t", 'id'), array(9, 10))) {
$ext = 0;
}
}
return $_G['siteurl'].'forum.php?mod=attachment&aid='.aidencode($aid, $ext, $ignoretid ? '' : $_G['tid']).($ext ? '&request=yes&_f=.'.$ext : '');
}
function parseemail($email, $text) {
$text = str_replace('\"', '"', $text);
if(!$email && preg_match("/\s*([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\s*/i", $text, $matches)) {
$email = trim($matches[0]);
return ''.$email.'';
} else {
return ''.$text.'';
}
}
function parsetable($width, $bgcolor, $message) {
if(strpos($message, '[/tr]') === FALSE && strpos($message, '[/td]') === FALSE) {
$rows = explode("\n", $message);
$s = !defined('IN_MOBILE') ? '| '.str_replace(array('\|', '|', '\n'), array('|', ' | ', "\n"), $row).' |