⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vread.php

📁 make project on java
💻 PHP
字号:
<?php
function content($content)
{
    global $annex, $db_prefix, $myconn, $html, $tpp;
    if (!$html[0]) {
        $content = htmlspecialchars($content);
        if (!$html[3]) {
            $content = preg_replace("/\[code\](.+?)\[\/code\]/eis", "wkcode('\\1')", $content);
            $content = preg_replace("/\[quote\](.+?)\[\/quote\]/eis", "wkqoute('\\1')", $content);
            $content = str_replace('[u]', '<u>', $content);
            $content = str_replace('[/u]', '</u>', $content);
            $content = str_replace('[b]', '<b>', $content);
            $content = str_replace('[/b]', '</b>', $content);
            $content = str_replace('[i]', '<i>', $content);
            $content = str_replace('[/i]', '</i>', $content);
            $content = str_replace('[list]', '<ul>', $content);
            $content = str_replace('[list=1]', '<ol type=1>', $content);
            $content = str_replace('[list=a]', '<ol type=a>', $content);
            $content = str_replace('[list=A]', '<ol type=A>', $content);
            $content = str_replace('[*]', '<li>', $content);
            $content = str_replace('[/list]', '</ul>', $content);
            $content = preg_replace("/\[img\](.+?)\[\/img\]/eis", "wkpic('\\1')", $content);
            if ($tpp == 1 || $tpp == 2 || $tpp == 3) {
                $content = preg_replace("/\[vid\](\S+?)\[\/vid\]/eis", "wkurl('\\1')", $content);
            } else {
                $content = preg_replace("/\[vid\](\S+?)\[\/vid\]/is", wkvid('\\1'), $content);
            } 
            $content = preg_replace("/\s*\[table(=(\d{1,3}%?))?\][\n\r]*(.+?)[\n\r]*\[\/table\]\s*/ies", "wktable('\\2', '\\3')", $content);
            $content = preg_replace("/\s*\[table(=(\d{1,3}%?))?\][\n\r]*(.+?)[\n\r]*\[\/table\]\s*/ies", "wktable('\\2', '\\3')", $content);
            $content = preg_replace("/\[color=([^\[\<]+?)\]/i", "<font color='\\1'>", $content);
            $content = str_replace("[/color]", "</font>", $content);
            if (!$html[2]) {
                $content = preg_replace("/\[em([0-9]+)\]/eis", "wkemote('\\1')", $content);
            } 
			if (!$html[1]) {
			
			$content = preg_replace("/\[url=([^\[]*)\](.+?)\[\/url\]/eis", "wkurl('\\1','\\2')", $content);
			$content = preg_replace("/\[url\]([^\[]*)\[\/url\]/eis", "wkurl('\\1')", $content);

            } 
            
        } 
    } 
	if (SERVER_GHO) $content = str_replace('WEBURL', SERVER_NAME, $content);
	
    $content = str_replace("\r\n", "<br />", $content);
    if ($annex && !$html[3]) {
        $content = preg_replace("/\[ax([0-9]+)\]/eis", "annexx('\\1')", $content);
    } 
    if (!$html[1] && !$html[3]) {
        $content = str_replace(chr(0) . chr(0), "[", $content);
        $content = str_replace(chr(255) . chr(255), "]", $content);
    } 

    return $content;
} 

function wkemote($code)
{
    global $imagedir, $emotenum;
    if ($code > $emotenum) {
        return '[em' . $code . ']';
    } else {
        return '<img src="' . $imagedir . '/emote/em' . $code . '.gif" alt="" />';
    } 
} 

function wkcode($code)
{ 
    $code = str_replace('[', chr(0) . chr(0), $code);
    $code = str_replace(']', chr(255) . chr(255), $code);
    return '<div class="read-code">' . $code . '</div>';
} 

function wkpic($url)
{
    global $echoh, $in, $imagedir, $tab_class2, $html;
    return '<img src="' . $url . '" onload="javascript:MyImage2(this);"/>';
} 

function wkvid($url)
{
    global $echoh, $in, $imagedir, $tab_class2, $html;
    global $vid_ubb;
	
    $filetype = strtolower(str_replace('.', '', strrchr($url, '.')));
    if (!@in_array($filetype, $vid_ubb) || eregi("\"|'|>|<|\?", $url))  return '[url]' . $url . '[/url]';
    return '<table align="center"><tr><td><embed width="600px" height="450px" class="embed" src="'
     . $url . '"></td></tr></table>';
} 

function annexx($aid)
{
    global $annexs, $imagedir, $time, $upfiletype, $username, $softdir;
    global $_default, $abc, $wtype, $vid_ubb, $img_ubb, $softdir, $templatedir,$style_id;

    if (isset($annexs[$aid])) {
        $html = explode('|', $annexs[$aid]['type']);
        $a_title = htmlspecialchars($annexs[$aid]['title']);
        $filetype = $annexs[$aid]['filetype'];
        $content = $annexs[$aid]['content'];
        $type = $annexs[$aid]['code'];
        $size = $annexs[$aid]['size'];
        $downnum = $annexs[$aid]['downnum'];
        $downuser = $annexs[$aid]['downuser'];

        if ($type == 'txt') {
            $content = htmlspecialchars($content);
            $content = str_replace("\r\n", '<br />', $content);
            unset($annexs[$aid]);
            return '<div class="read-code">' . $content . '</div>';
        } else if ($type == 'url') {
            switch ($html[0]) {
                case 'a':
                    $anndi = $abc[0];
                    break;
                case 'b':
                    $anndi = $abc[1];
                    break;
                case 'c':
                    $anndi = $abc[2];
                    break;
                default:
                    $anndi = 'bad';
                    break;
            } 
            unset($annexs[$aid]);

            return tpl_fun_jjx11(array('title' => $a_title, 'aid' => $aid, 'templatedir' => $templatedir, 'downnum' => $downnum, 'money' => $html[1], 'anndi' => $anndi, 'size' => $size, 'anndiecho' => $html[1] > 0?'':'display: none;'));

        } elseif ($type == 'file') {
            switch ($html[0]) {
                case 'a':
                    $anndi = $abc[0];
                    break;
                case 'b':
                    $anndi = $abc[1];
                    break;
                case 'c':
                    $anndi = $abc[2];
                    break;
                default:
                    $anndi = 'bad';
                    break;
            } 
            if (in_array($filetype, $img_ubb) && (!$html[0] || ($username && !$html[1])))
                return '<img  class="read-img" src="' . $softdir . '/uploads/' . $content . '" alt="" onload="javascript:MyImage2(this);"/>';
            unset($annexs[$aid]);

            return tpl_fun_jjx12(array('title' => $a_title, 'aid' => $aid, 'templatedir' => $templatedir, 'downnum' => $downnum, 'money' => $html[1], 'anndi' => $anndi, 'size' => $size, 'anndiecho' => $html[1] > 0?'':'display: none;'));
        } else if ($type == 'poll') {
            $content = explode('|', htmlspecialchars($content));
            while (list($key, $val) = each($content)) {
                $poll = explode("\t", $val);
                $pollscontent[$key] = $poll[0];
                $polls[$key] = $poll[1];
            } 
            $pollnum = array_sum($polls);
            $polltype = $html[0]?'checkbox' : 'radio';
            $pollname = $html[0]?'poll[]' : 'poll';

            $downuser = explode(',', $downuser);
            if ($html[1]) {
                $qwer = ($username && @in_array($username, $downuser))?1 : 0;
            } else {
                $qwer = (in_array($_SERVER['REMOTE_ADDR'], $downuser))?1 : 0;
            } 
            if ($qwer) {
                while (list($key, $val) = each($polls)) {
                    $pollslist .= tpl_fun_jjx15(array('pcontent' => trim($pollscontent[$key]), 'polls' => $polls[$key], 'bkey' => @number_format($polls[$key] / $pollnum * 100, 1)));
                } 

                $html[1]?$downuser = implode(' ', $downuser):$usecho = 'display: none;';
                unset($annexs[$aid]);
                return tpl_fun_jjx13(array('downuser' => $downuser, 'usecho' => $usecho, 'r_echo' => $html[0]?'display: none;':'', 'c_echo' => $html[0]?'':'display: none;', 'pollnum' => $pollnum, 'title' => $a_title, 'jjx15' => $pollslist));
            } else {
                while (list($key, $val) = each($polls)) {
                    $pollslist .= tpl_fun_jjx16(array('pcontent' => trim($pollscontent[$key]), 'polltype' => $polltype, 'pollname' => $pollname, 'pkey' => $key));
                } 
                unset($annexs[$aid]);
                return tpl_fun_jjx14(array('aid' => $aid, 'usecho' => $usecho, 'r_echo' => $html[0]?'display: none;':'', 'c_echo' => $html[0]?'':'display: none;', 'pollnum' => $pollnum, 'title' => $a_title, 'jjx16' => $pollslist,'style_id'=>$style_id));
            } 
        } else {
            return '[ax' . $aid . ']';
        } 
    } 
    return '[ax' . $aid . ']';
} 

function wkqoute($code)
{
    $code = str_replace('[b]', '<b>', $code);
    $code = str_replace('[/b]', '</b>', $code);
    $code = str_replace('[', chr(0) . chr(0), $code);
    $code = str_replace(']', chr(255) . chr(255), $code);
    return '<div class="read-qoute">' . $code . '</div>';
} 

function wkurl($url, $name = false)
{
   $url = str_replace('\"', '"', $url);
   if ($name!=false) {
       $url = '<a href="' . $url . '" target="_blank">' . $name . '</a>';
	   
   } else {
       $url = '<a href="' . $url . '" target="_blank">' . $url . '</a>'; 
   }    
    return $url;
} 
function wktable($width, $message)
{

$message = str_replace('\"', '"', $message);
    $width = substr($width, -1) == '%'?(substr($width, 0, -1) <= 98?$width : '98%'): ($width <= 600?$width : '98%');
	
	$message=preg_replace("/\[td=(\d{1,2}),(\d{1,2})(,(\d{1,3}%?))?\]/is", "<td colspan='\\1' rowspan='\\2' width='\\4'>", $message);	
$message = str_replace('\"', '"', $message);

return '<table ' . ($width == ''?null : 'width="' . $width . '" ') . 'align="center" cellspacing="0" class="read-table">' . str_replace(array('[tr]', '[td]', '[/td]', '[/tr]'), array('<tr>', '<td>', '</td>', '</tr>'), $message) . '</table>';
} 

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -