AL8 Forum
   登錄註冊幫助


標題: [D4.0 & 4.1] [原創]IFRAME嵌入網站(逸風版)_前台有按鈕+後台獨立設定組別使用權限,4/4.1都可用
  本主題被作者加入到個人文集中  
 luckavi
 0040724
Rank: 1

頭銜: Newbie

帖子: 3

精華: 0

積分: 30 點

現金: 100 元

存款: 0 元

閱讀權限: 10

註冊: 2006-2-28

狀態: 離線
 
發表於 2006-4-14 07:50  資料  個人空間  短消息  加為好友 
這模好的插件就是沒4.1版的真可惜~肯求大大推出4.1版本




 AL8 Forum © All rights reserved.
頂部
 monthday
 0035507
Rank: 1

頭銜: Newbie

帖子: 40

精華: 0

積分: 520 點

現金: 0 元

存款: 88 元

閱讀權限: 10

註冊: 2005-11-23

狀態: 離線
 
發表於 2006-4-16 20:38  資料  個人空間  主頁 短消息  加為好友 
我按了BBCODE的按鍵無法跳出視窗
只能自己用打的[irfame]http://hp.114jb.com/bbs[/iframe]
其他的按鍵也是一樣情形~未裝此插件是可以用的
有誰可以幫我看一下嗎

[ 本帖最後由 monthday 於 2006-4-16 21:06 編輯 ]




 AL8 Forum © All rights reserved.
頂部
 windheart
 0005178
Rank: 3Rank: 3Rank: 3
點擊查看 windheart 的詳細資料

頭銜: Conqueror

帖子: 254

精華: 2

積分: 4080 點

現金: 364 元

存款: 36402 元

閱讀權限: 20

註冊: 2004-8-8

來自: 鐵心論壇

狀態: 離線
 
發表於 2006-4-29 12:08  資料  個人空間  主頁 短消息  加為好友 
QUOTE:
原帖由 monthday 於 2006-4-16 20:38 發表。 
我按了BBCODE的按鍵無法跳出視窗
只能自己用打的[irfame]http://hp.114jb.com/bbs[/iframe]
其他的按鍵也是一樣情形~未裝此插件是可以用的
有誰可以幫我看一下嗎


把你的 discuzcode.func.php 放上來看看




Discuz進階之路:沒有捷徑, 看所有文件+裝風格插件+學php語言,想美化再學htm,dreamweaver,photoshop
 AL8 Forum © All rights reserved.
頂部
 windheart
 0005178
Rank: 3Rank: 3Rank: 3
點擊查看 windheart 的詳細資料

頭銜: Conqueror

帖子: 254

精華: 2

積分: 4080 點

現金: 364 元

存款: 36402 元

閱讀權限: 20

註冊: 2004-8-8

來自: 鐵心論壇

狀態: 離線
 
發表於 2006-4-29 12:08  資料  個人空間  主頁 短消息  加為好友 
QUOTE:
原帖由 luckavi 於 2006-4-14 07:50 發表。 
這模好的插件就是沒4.1版的真可惜~肯求大大推出4.1版本


這幾天會研究.




Discuz進階之路:沒有捷徑, 看所有文件+裝風格插件+學php語言,想美化再學htm,dreamweaver,photoshop
 AL8 Forum © All rights reserved.
頂部
 windheart
 0005178
Rank: 3Rank: 3Rank: 3
點擊查看 windheart 的詳細資料

頭銜: Conqueror

帖子: 254

精華: 2

積分: 4080 點

現金: 364 元

存款: 36402 元

閱讀權限: 20

註冊: 2004-8-8

來自: 鐵心論壇

狀態: 離線
 
發表於 2006-4-29 18:17  資料  個人空間  主頁 短消息  加為好友 
2006-4-27補充 : 已修正本hack, 現在同時可用在D4.0及D4.1




Discuz進階之路:沒有捷徑, 看所有文件+裝風格插件+學php語言,想美化再學htm,dreamweaver,photoshop
 AL8 Forum © All rights reserved.
頂部
 luckavi
 0040724
Rank: 1

頭銜: Newbie

帖子: 3

精華: 0

積分: 30 點

現金: 100 元

存款: 0 元

閱讀權限: 10

註冊: 2006-2-28

狀態: 離線
 
發表於 2006-5-17 04:38  資料  個人空間  短消息  加為好友 
有個問題想請教~下面這一段共有3個 ies
是3行的ies都要改嗎??

if(empty($discuzcodes['searcharray']['imgcode'])) {
                        $discuzcodes['searcharray']['imgcode'] = array(
                                "/\[swf\]\s*([^\[\<\r\n]+?)\s*\[\/swf\]/ies",
                                "/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies",
                                "/\[img=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies"




 AL8 Forum © All rights reserved.
頂部
 windheart
 0005178
Rank: 3Rank: 3Rank: 3
點擊查看 windheart 的詳細資料

頭銜: Conqueror

帖子: 254

精華: 2

積分: 4080 點

現金: 364 元

存款: 36402 元

閱讀權限: 20

註冊: 2004-8-8

來自: 鐵心論壇

狀態: 離線
 
發表於 2006-5-19 03:23  資料  個人空間  主頁 短消息  加為好友 
QUOTE:
原帖由 luckavi 於 2006-5-17 04:38 發表。&nbsp;
有個問題想請教~下面這一段共有3個 ies
是3行的ies都要改嗎??
[code]if(empty($discuzcodes['searcharray']['imgcode'])) {
                        $discuzcodes['searcharray']['imgcode'] = array(
    ...


在最後的ies"




Discuz進階之路:沒有捷徑, 看所有文件+裝風格插件+學php語言,想美化再學htm,dreamweaver,photoshop
 AL8 Forum © All rights reserved.
頂部
 leslie
 0045252
Rank: 1

頭銜: Newbie

帖子: 7

精華: 0

積分: 70 點

現金: 100 元

存款: 0 元

閱讀權限: 10

註冊: 2006-5-19

狀態: 離線
 
發表於 2006-5-19 11:10  資料  個人空間  短消息  加為好友 
樓主,妳好,妳的帖子我參炤脩改暸,但是有這樣的問題:
我可以插入網頁,也在BBCODE出现了提示输入对话框(如附件1),但是我提交编辑后之后在论坛就是不显示,而是一片空白(如附件2),请问是怎么回事呢?

[ 本帖最後由 leslie 於 2006-5-19 11:17 編輯 ]



 附件: 您所在的用戶組無法下載或查看附件



 AL8 Forum © All rights reserved.
頂部
 windheart
 0005178
Rank: 3Rank: 3Rank: 3
點擊查看 windheart 的詳細資料

頭銜: Conqueror

帖子: 254

精華: 2

積分: 4080 點

現金: 364 元

存款: 36402 元

閱讀權限: 20

註冊: 2004-8-8

來自: 鐵心論壇

狀態: 離線
 
發表於 2006-5-19 14:09  資料  個人空間  主頁 短消息  加為好友 
回覆第 28 帖由 leslie 所發的帖子

你有升級數據庫嗎?
有在後台用戶群組設定iframe使用權限嗎?




Discuz進階之路:沒有捷徑, 看所有文件+裝風格插件+學php語言,想美化再學htm,dreamweaver,photoshop
 AL8 Forum © All rights reserved.
頂部
 leslie
 0045252
Rank: 1

頭銜: Newbie

帖子: 7

精華: 0

積分: 70 點

現金: 100 元

存款: 0 元

閱讀權限: 10

註冊: 2006-5-19

狀態: 離線
 
發表於 2006-5-19 14:11  資料  個人空間  短消息  加為好友 
QUOTE:
原帖由 windheart 於 2006-5-19 14:09 發表。&nbsp;
你有升級數據庫嗎?
有在後台用戶群組設定iframe使用權限嗎?


数据库升级了。按照楼主的帖子进行升级的。。
如果不设定权限的话我是不能发这个代码的。。




 AL8 Forum © All rights reserved.
頂部
 windheart
 0005178
Rank: 3Rank: 3Rank: 3
點擊查看 windheart 的詳細資料

頭銜: Conqueror

帖子: 254

精華: 2

積分: 4080 點

現金: 364 元

存款: 36402 元

閱讀權限: 20

註冊: 2004-8-8

來自: 鐵心論壇

狀態: 離線
 
發表於 2006-5-19 14:44  資料  個人空間  主頁 短消息  加為好友 
回覆第 30 帖由 leslie 所發的帖子

請把以下兩個檔放上來給我看看.

include/discuzcode.func.php
post.php




Discuz進階之路:沒有捷徑, 看所有文件+裝風格插件+學php語言,想美化再學htm,dreamweaver,photoshop
 AL8 Forum © All rights reserved.
頂部
 leslie
 0045252
Rank: 1

頭銜: Newbie

帖子: 7

精華: 0

積分: 70 點

現金: 100 元

存款: 0 元

閱讀權限: 10

註冊: 2006-5-19

狀態: 離線
 
發表於 2006-5-19 15:22  資料  個人空間  短消息  加為好友 
回覆第 31 帖由 windheart 所發的帖子

discuzcode.func.php


<?php

/*
        [Discuz!] (C)2001-2006 Comsenz Inc.
        This is NOT a freeware, use is subject to license terms

        $RCSfile: discuzcode.func.php,v $
        $Revision: 1.10 $
        $Date: 2006/02/23 13:44:02 $
*/

if(!defined('IN_DISCUZ')) {
        exit('Access Denied');
}

$discuzcodes = array
        (
        'pcodecount' => -1,
        'codecount' => 0,
        'codehtml' => '',
        'searcharray' => array(),
        'replacearray' => array(),
        'seoarray' => array
                (
                0 => '',
                1 => $_SERVER['HTTP_HOST'],
                2 => $bbname,
                3 => $seotitle,
                4 => $seokeywords,
                5 => $seodescription
                )
        );

if(!is_array($_DCACHE['bbcodes']) || !is_array($_DCACHE['smilies'])) {
        @include DISCUZ_ROOT.'./forumdata/cache/cache_bbcodes.php';
}

foreach($_DCACHE['smilies']['replacearray'] as $key => $smiley) {
        $_DCACHE['smilies']['replacearray'][$key] = '<img src="'.SMDIR.'/'.$smiley.'" align="absmiddle" border="0">';
}

mt_srand((double)microtime() * 1000000);

function attachtag($pid, $aid) {
        global $language, $postlist, $attachrefcheck, $attachurl;
        if(isset($postlist[$pid]['attachments'][$aid])) {
                include_once language('misc');
                $attach = $postlist[$pid]['attachments'][$aid];
                unset($postlist[$pid]['attachments'][$aid]);

                $replacement = "<br><br>$attach[attachicon] ";
                if($attach['attachimg']) {
                        $replacement .= "<a href=\"member.php?action=credits&view=getattach\" title=\"$language[attach_credits_policy]\" target=\"_blank\">$language[attach_img]</a>: ".
                                ($attach['readperm'] ? ", $language[attach_readperm] $attach[readperm]" : '').
                                ($attach['description'] ? "[{$attach[description]}]" : '').
                                " <a href=\"attachment.php?aid=$attach[aid]\" target=\"_blank\" class=\"bold\">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br><br>".
                                ($attachrefcheck ? "<img src=\"attachment.php?aid=$attach[aid]&noupdate=yes\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='$language[attach_img_zoom]';}\" onmouseover=\"if(this.resized) this.style.cursor='hand';\" onclick=\"if(!this.resized) {return false;} else {window.open('attachment.php?aid=$attach[aid]');}\" onmousewheel=\"return imgzoom(this);\">" : "<img src=\"$attachurl/$attach[attachment]\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='$language[attach_img_zoom]';}\" onmouseover=\"if(this.resized) this.style.cursor='hand';\" onclick=\"if(!this.resized) {return false;} else {window.open('".addslashes("$attachurl/$attach[attachment]")."');}\" onmousewheel=\"return imgzoom(this);\">");
                } else {
                        $replacement .= "<a href=\"member.php?action=credits&view=getattach\" title=\"$language[attach_credits_policy]\" target=\"_blank\">$language[attach]</a>: ".
                                        ($attach['description'] ? "[{$attach[description]}]" : '').
                                        " <a href=\"attachment.php?aid=$attach[aid]\" target=\"_blank\" class=\"bold\">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br><span class=\"smalltxt\">$language[attach_download_count] $attach[downloads]".
                                        ($attach['readperm'] ? ", $language[attach_readperm] $attach[readperm]" : '').
                                        "</span><br>";
                }

                return $replacement;
        } else {
                return '<strike>[attach]'.$aid.'[/attach]</strike>';
        }
}

function censor($message) {
        global $_DCACHE;
        require_once(DISCUZ_ROOT.'/forumdata/cache/cache_censor.php');

        if($_DCACHE['censor']['banned'] && preg_match($_DCACHE['censor']['banned'], $message)) {
                showmessage('word_banned');
        } else {
                return empty($_DCACHE['censor']['filter']) ? $message :
                        @preg_replace($_DCACHE['censor']['filter']['find'], $_DCACHE['censor']['filter']['replace'], $message);
        }
}

function censormod($message) {
        global $_DCACHE;
        require_once(DISCUZ_ROOT.'/forumdata/cache/cache_censor.php');
        return $_DCACHE['censor']['mod'] && preg_match($_DCACHE['censor']['mod'], $message);
}

function creditshide($creditsrequire, $message) {
        global $language;
        include_once language('misc');

        if($GLOBALS['credits'] < $creditsrequire && !$GLOBALS['forum']['ismoderator']) {
                return '<b>'.eval("return \"$language[post_hide_credits_hidden]\";").'</b>';
        } else {
                return '<b>'.eval("return \"$language[post_hide_credits]\";").'</b><br>'.
                        '==============================<br><br>'.
                        str_replace('\\"', '"', $message).'<br><br>'.
                        '==============================';
        }
}

function codedisp($code) {
        global $discuzcodes;
        $discuzcodes['pcodecount']++;
        $code = htmlspecialchars(str_replace('\\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)));
        $discuzcodes['codehtml'][$discuzcodes['pcodecount']] = "<br><br><div class=\"smalltxt\" style=\"margin-left: 2em; margin-right: 2em; font-weight: bold\"><div style=\"float: left\">CODE:</div><div style=\"text-align: right; float: right\"><a href=\"###\" class=\"smalltxt\" onclick=\"copycode(findobj('code$discuzcodes[codecount]'));\">[Copy to clipboard]</a></div></div><div class=\"altbg2\" style=\"margin: 2em; margin-top: 3px; clear: both; padding: 10px; padding-top: 5px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all\" id=\"code$discuzcodes[codecount]\">$code</div>";
        $discuzcodes['codecount']++;
        return "[\tDISCUZ_CODE_$discuzcodes[pcodecount]\t]";
}

function karmaimg($rate, $ratetimes) {
        $karmaimg = '';
        if($rate && $ratetimes) {
                $image = $rate > 0 ? 'agree.gif' : 'disagree.gif';
                for($i = 0; $i < ceil(abs($rate) / $ratetimes); $i++) {
                        $karmaimg .= '<img src="'.IMGDIR.'/'.$image.'" border="0" align="right">';
                }
        }
        return $karmaimg;
}

function parseurl($message) {
        return preg_match("/\[code\].+?\[\/code\]/is", $message) ? $message :
                substr(preg_replace(        array(
                                                "/(?<=[^\]a-z0-9-=\"'\\/])(http:\/\/[a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+\.(jpg|gif|png|bmp))/i",
                                                "/(?<=[^\]\)a-z0-9-=\"'\\/])((https?|ftp|gopher|news|telnet|rtsp|mms|callto):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i",
                                                "/(?<=[^\]\)a-z0-9\/\-_.~?=:.])([_a-z0-9-+]+(\.[_a-z0-9-+]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/i"
                                        ), array(
                                                "",
                                                "[url]\\1\\3[/url]",
                                                "[email]\\0[/email]"
                                        ), ' '.$message), 1);
}

function discuzcode($message, $smileyoff, $bbcodeoff, $htmlon = 0, $allowsmilies = 1, $allowbbcode = 1, $allowimgcode = 1, $allowhtml = 0, $jammer = 0) {
        global $discuzcodes, $credits, $tid, $discuz_uid, $highlight, $maxsmilies, $db, $tablepre;

        if(!$bbcodeoff && $allowbbcode) {
                $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);
        }

        if(!$htmlon && !$allowhtml) {
                $message = $jammer ? preg_replace("/\r\n|\n|\r/e", "jammer()", dhtmlspecialchars($message)) : dhtmlspecialchars($message);
        }

        if(!$smileyoff && $allowsmilies && !empty($GLOBALS['_DCACHE']['smilies']) && is_array($GLOBALS['_DCACHE']['smilies'])) {
                $message = preg_replace($GLOBALS['_DCACHE']['smilies']['searcharray'], $GLOBALS['_DCACHE']['smilies']['replacearray'], $message, $maxsmilies);
        }

        if(!$bbcodeoff && $allowbbcode) {

                if(empty($discuzcodes['searcharray'])) {
                        $discuzcodes['searcharray']['bbcode_regexp'] = array(
                                "/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is",
                                "/\s*\[free\][\n\r]*(.+?)[\n\r]*\[\/free\]\s*/is",
                                "/\[url\]\s*(www.|https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/|callto:\/\/|ed2k:\/\/){1}([^\[\"']+?)\s*\[\/url\]/ie",
                                "/\[url=www.([^\[\"']+?)\](.+?)\[\/url\]/is",
                                "/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|ed2k){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/is",
                                "/\[email\]\s*([a-z0-9\-_.+]+)@([a-z0-9\-_]+[.][a-z0-9\-_.]+)\s*\[\/email\]/i",
                                "/\[email=([a-z0-9\-_.+]+)@([a-z0-9\-_]+[.][a-z0-9\-_.]+)\](.+?)\[\/email\]/is",
                                "/\[color=([^\[\<]+?)\]/i",
                                "/\[size=([^\[\<]+?)\]/i",
                                "/\[font=([^\[\<]+?)\]/i",
                                "/\[align=([^\[\<]+?)\]/i"
                        );
                        $discuzcodes['replacearray']['bbcode_regexp'] = array(
                                "<br><br><div class=\"smalltxt\" style=\"margin-left: 2em; font-weight: bold\">QUOTE:</div><div class=\"altbg2\" style=\"margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all\">\\1</div>",
                                "<br><br><div class=\"smalltxt\" style=\"margin-left: 2em; font-weight: bold\">FREE:</div><div class=\"altbg2\" style=\"margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all\">\\1</div>",
                                "cuturl('\\1\\2')",
                                "<a href=\"http://www.\\1\" target=\"_blank\">\\2</a>",
                                "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>",
                                "<a href=\"mailto:\\1@\\2\">\\1@\\2</a>",
                                "<a href=\"mailto:\\1@\\2\">\\3</a>",
                                "<font color=\"\\1\">",
                                "<font size=\"\\1\">",
                                "<font face=\"\\1\">",
                                "<p align=\"\\1\">"
                        );

                        $discuzcodes['searcharray']['bbcode_regexp'] = array_merge($discuzcodes['searcharray']['bbcode_regexp'], $discuzcodes['searcharray']['bbcode_regexp']);
                        $discuzcodes['replacearray']['bbcode_regexp'] = array_merge($discuzcodes['replacearray']['bbcode_regexp'], $discuzcodes['replacearray']['bbcode_regexp']);

                        $discuzcodes['searcharray']['bbcode_regexp'][] = "/\[payto\]\s*\(seller\)(.*)\(\/seller\)\s*(\(subject\)(.*)\(\/subject\))?\s*(\(body\)(.*)\(\/body\))?\s*(\(gross\)(.*)\(\/gross\))?\s*(\(price\)(.*)\(\/price\))?\s*(\(url\)(.*)\(\/url\))?\s*(\(type\)(.*)\(\/type\))?\s*(\(transport\)(.*)\(\/transport\))?\s*(\(ordinary_fee\)(.*)\(\/ordinary_fee\))?\s*(\(express_fee\)(.*)\(\/express_fee\))?\s*\[\/payto\]/iesU";
                        $discuzcodes['replacearray']['bbcode_regexp'][] = "payto('\\1',array('subject'=>'\\3','body'=>'\\5','price'=>'\\7','price'=>'\\9','url'=>'\\11','type'=>'\\13','transport'=>'\\15','ordinary_fee'=>'\\17','express_fee'=>'\\19'))";

                        $discuzcodes['searcharray']['bbcode_str'] = array(
                                '', '', '', '
', '', '',
                                '', '', '', '', '
    ', '
      ', '
        ',
                                        '
          ', '
        • ', '
        '
                                );

                                $discuzcodes['replacearray']['bbcode_str'] = array(
                                        '</font>', '</font>', '</font>', '</p>', '<b>', '</b>', '<i>',
                                        '</i>', '<u>', '</u>', '<ul>', '<ol type=1>', '<ol type=a>',
                                        '<ol type=A>', '<li>', '</ul></ol>'
                                );
                        }               

                        @$message = str_replace($discuzcodes['searcharray']['bbcode_str'], $discuzcodes['replacearray']['bbcode_str'],
                                        preg_replace(
                                                ($allowbbcode == 2 && $GLOBALS['_DCACHE']['bbcodes'] ? array_merge($discuzcodes['searcharray']['bbcode_regexp'], $GLOBALS['_DCACHE']['bbcodes']['searcharray']) : $discuzcodes['searcharray']['bbcode_regexp']),
                                                ($allowbbcode == 2 && $GLOBALS['_DCACHE']['bbcodes'] ? array_merge($discuzcodes['replacearray']['bbcode_regexp'], $GLOBALS['_DCACHE']['bbcodes']['replacearray']) : $discuzcodes['replacearray']['bbcode_regexp']),
                                                $message));

                        if(preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", $message)) {
                                if(stristr($message, '[hide]')) {
                                        global $language;
                                        include_once language('misc');

                                        $query = $db->query("SELECT pid FROM {$tablepre}posts WHERE tid='$tid' AND authorid='$discuz_uid' LIMIT 1");
                                        if($GLOBALS['forum']['ismoderator'] || $db->result($query, 0)) {
                                                $message = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/is",
                                                        '<span class="bold">'.$language['post_hide_reply'].'</span><br>'.
                                                        '==============================<br><br>'.
                                                        '\\1<br><br>'.
                                                        '==============================',
                                                        $message);
                                        } else {
                                                $message = preg_replace("/\[hide\](.+?)\[\/hide\]/is", '<b>'.$language['post_hide_reply_hidden'].'</b>', $message);
                                        }
                                }
                                $message = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", "creditshide(\\1,'\\2')", $message);
                        }
                }

                if(!$bbcodeoff && $allowimgcode) {
                        if(empty($discuzcodes['searcharray']['imgcode'])) {
                                $discuzcodes['searcharray']['imgcode'] = array(
                                        "/\[swf\]\s*([^\[\<\r\n]+?)\s*\[\/swf\]/ies",
                                        "/\[img\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies",
                                        "/\[img=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[\<\r\n]+?)\s*\[\/img\]/ies",
                                        "/\[iframe\]\s*(.+?)\s*\[\/iframe\]/ies"
                                );
                                $discuzcodes['replacearray']['imgcode'] = array(
                                        "bbcodeurl('\\1', ' <img src=\"images/attachicons/flash.gif\" align=\"absmiddle\"> <a href=\"%s\" target=\"_blank\">Flash: %s</a> ')",
                                        "bbcodeurl('\\1', '<img src=\"%s\" border=\"0\" onload=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}\" onclick=\"if(!this.resized) {return true;} else {window.open(\'%s\');}\" onmousewheel=\"return imgzoom(this);\">')",
                                        "bbcodeurl('\\3', '<img width=\"\\1\" height=\"\\2\" src=\"%s\" border=\"0\">')",
                                        "bbcodeurl('\\1', '<a href=\"%s\" target=\"_blank\">按此开新视窗</a><br><br><iframe src=\"%s\" frameborder=\"0\" allowtransparency=\"true\" scrolling=\"yes\" width=\"97%%\" height=\"480\"></iframe>')"
                                );
                        }
                        $message = preg_replace($discuzcodes['searcharray']['imgcode'], $discuzcodes['replacearray']['imgcode'], $message);
                }

                for($i = 0; $i <= $discuzcodes['pcodecount']; $i++) {
                        $message = str_replace("[\tDISCUZ_CODE_$i\t]", $discuzcodes['codehtml'][$i], $message);
                }

                if($highlight) {
                        foreach(explode('+', $highlight) as $ret) {
                                if($ret) {
                                        $message = preg_replace("/(?<=[\s\"\]>()]|[\x7f-\xff]|^)(".preg_quote($ret, '/').")(([.,:;-?!()\s\"<\[]|[\x7f-\xff]|$))/siU", "<u><b><font color=\"#FF0000\">\\1</font></b></u>\\2", $message);
                                }
                        }
                }

                return $htmlon || $allowhtml ? $message : nl2br(str_replace(array("\t", '   ', '  '), array('&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;'), $message));
        }

        function cuturl($url) {
                $length = 65;
                $urllink = "<a href=\"".(substr(strtolower($url), 0, 4) == 'www.' ? "http://$url" : $url).'" target="_blank">';
                if(strlen($url) > $length) {
                        $url = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
                }
                $urllink .= $url.'</a>';
                return $urllink;
        }

        function bbcodeurl($url, $tags) {
                if(!preg_match("/<.+?>/s", $url)) {
                        if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'ftp://', 'rtsp:/', 'mms://'))) {
                                $url = 'http://'.$url;
                        }
                        return str_replace(array('submit', 'logging.php'), array('', ''), sprintf($tags, $url, addslashes($url)));
                } else {
                        return '&nbsp;'.$url;
                }
        }

        function jammer() {
                $randomstr = '';
                for($i = 0; $i < mt_rand(5, 15); $i++) {
                        $randomstr .= chr(mt_rand(0, 59)).chr(mt_rand(63, 126));
                }
                if($GLOBALS['thisbg'] == 'altbg1') {
                        $thisbg = ALTBG1;
                } elseif($GLOBALS['thisbg'] == 'altbg2') {
                        $thisbg = ALTBG2;
                } else {
                        $thisbg = $GLOBALS['thisbg'];
                }
                return mt_rand(0, 1) ? '<font style="font-size:0px;color:'.$thisbg.'">'.$GLOBALS['discuzcodes']['seoarray'][mt_rand(0, 5)].$randomstr.'</font>'."\r\n" :
                        "\r\n".'<span style="display:none">'.$randomstr.$GLOBALS['discuzcodes']['seoarray'][mt_rand(0, 5)].'</span>';
        }

        ?>



 AL8 Forum © All rights reserved.
頂部
 leslie
 0045252
Rank: 1

頭銜: Newbie

帖子: 7

精華: 0

積分: 70 點

現金: 100 元

存款: 0 元

閱讀權限: 10

註冊: 2006-5-19

狀態: 離線
 
發表於 2006-5-19 15:23  資料  個人空間  短消息  加為好友 
post.php


<?php

/*
        [Discuz!] (C)2001-2006 Comsenz Inc.
        This is NOT a freeware, use is subject to license terms

        $RCSfile: post.php,v $
        $Revision: 1.7 $
        $Date: 2006/02/23 13:44:02 $
*/

define('CURSCRIPT', 'post');

require_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
require_once DISCUZ_ROOT.'./include/post.func.php';

if(empty($action)) {
        showmessage('undefined_action', NULL, 'HALTED');
} elseif($action == 'smilies' && $smileyinsert) {
        foreach($_DCACHE['smilies_display'] as $key => $smiley) {
                $_DCACHE['smilies_display'][$key]['codeinsert'] = addcslashes($smiley['code'], '\\\'');
        }
        include template('post_smilies');
        dexit();
}

periodscheck('postbanperiods');

$allowpostattach = !empty($forum['allowpostattach']) || (!$forum['postattachperm'] && $allowpostattach) || ($forum['postattachperm'] && forumperm($forum['postattachperm']));
$attachextensions = $forum['attachextensions'] ? $forum['attachextensions'] : $attachextensions;
$allowanonymous = $forum['allowanonymous'] || $allowanonymous ? 1 : 0;

$postcredits = $forum['postcredits'] ? $forum['postcredits'] : $creditspolicy['post'];
$replycredits = $forum['replycredits'] ? $forum['replycredits'] : $creditspolicy['reply'];

$maxprice = isset($extcredits[$creditstrans]) ? $maxprice : 0;

if(!empty($tid) && !empty($fid)) {
        $query = $db->query("SELECT * FROM {$tablepre}threads WHERE tid='$tid' AND displayorder>='0'");
        $thread = $db->fetch_array($query);
        $fid = $thread['fid'];
        $navigation = "&raquo; <a href=\"viewthread.php?tid=$tid\">$thread[subject]</a>";
        $navtitle = " - $thread[subject]";

        if($thread['readperm'] && $thread['readperm'] > $readaccess && !$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
                showmessage('thread_nopermission', NULL, 'NOPERM');
        }
}

$navigation = "&raquo; <a href=\"forumdisplay.php?fid=$fid".($extra ? '&'.preg_replace("/^(&)*/", '', $extra) : '')."\">$forum[name]</a> $navigation";
$navtitle = ' - '.strip_tags($forum['name']).$navtitle;
if($forum['type'] == 'sub') {
        $query = $db->query("SELECT name, fid FROM {$tablepre}forums WHERE fid='$forum[fup]'");
        $fup = $db->fetch_array($query);
        $navigation = "&raquo; <a href=\"forumdisplay.php?fid=$fup[fid]\">$fup[name]</a> $navigation";
        $navtitle = ' - '.strip_tags($fup['name']).$navtitle;
}

if(empty($forum['allowview'])) {
        if(!$forum['viewperm'] && !$readaccess) {
                showmessage('group_nopermission', NULL, 'NOPERM');
        } elseif($forum['viewperm'] && !forumperm($forum['viewperm'])) {
                showmessage('forum_nopermission', NULL, 'NOPERM');
        }
}

if(empty($bbcodeoff) && !$allowhidecode && preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", preg_replace("/(\[code\](.+?)\[\/code\])/is", ' ', $message))) {
        showmessage('post_hide_nopermission');
}

if(empty($bbcodeoff) && !$allowiframecode && preg_match("/\[iframe=?\d*\].+?\[\/iframe\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
        showmessage('post_iframe_nopermission');
}

if(!$adminid && $newbiespan && (!$lastpost || $timestamp - $lastpost < $newbiespan * 3600)) {
        $query = $db->query("SELECT regdate FROM {$tablepre}members WHERE uid='$discuz_uid'");
        if($timestamp - ($db->result($query, 0)) < $newbiespan * 3600) {
                showmessage('post_newbie_span');
        }
}

$extra = rawurlencode($extra);
$blogcheck = empty($isblog) && empty($addtoblog) ? '' : 'checked';
$notifycheck = empty($emailnotify) ? '' : 'checked';
$stickcheck = empty($sticktopic) ? '' : 'checked';
$digestcheck = empty($addtodigest) ? '' : 'checked';

if(periodscheck('postmodperiods', 0)) {
        $modnewthreads = $modnewreplies = 1;
} else {
        $censormod = censormod($subject."\t".$message);
        $modnewthreads = (!$allowdirectpost || $allowdirectpost == 1) && ($forum['modnewposts'] || $censormod) ? 1 : 0;
        $modnewreplies = (!$allowdirectpost || $allowdirectpost == 2) && ($forum['modnewposts'] == 2 || $censormod) ? 1 : 0;
}

$subject = isset($subject) ? dhtmlspecialchars(censor(trim($subject))) : '';
$message = isset($message) ? censor(trim($message)) : '';
$readperm = isset($readperm) ? intval($readperm) : 0;
$price = isset($price) ? intval($price) : 0;

$urloffcheck = $usesigcheck = $smileyoffcheck = $codeoffcheck = $htmloncheck = $emailcheck = '';

$enctype = $allowpostattach ? 'enctype="multipart/form-data"' : '';
$maxattachsize_kb = $maxattachsize / 1000;

//get secure code checking status (pos. -3)
$seccodecheck = substr(sprintf('%05b', $seccodestatus), -3, 1);

//get trade thread status (pos. -1)
$allowposttrade = substr(sprintf('%02b', $forum['allowtrade']), -1, 1);

if(!empty($previewpost) || (empty($previewpost) && empty($topicsubmit) && empty($replysubmit) && empty($editsubmit))) {

        $typeid = preg_replace("/.*typeid%3D(\d+).*/", "\\1", $extra);

        $smilies = '';
        $moresmilies = 0;
        if($smileyinsert && is_array($_DCACHE['smilies_display'])) {
                $smileyinsert = 1;
                $smcols = $smcols ? $smcols : 3;
                $smilies .= '<tr align="center">';
                foreach($_DCACHE['smilies_display'] as $key => $smiley) {
                        if($key >= $smcols * 6) {
                                $moresmilies = 1;
                                break;
                        }
                        $smilies .= '<td valign="top"><img src="'.SMDIR.'/'.$smiley['url'].'" border="0" onmouseover="this.style.cursor=\'hand\';" onclick="AddText(\''.addcslashes($smiley['code'], '\\\'').'\');"></td>'."\n";
                        $smilies .= !(++$key % $smcols) ? '</tr><tr align="center">' : '';
                }
        } else {
                $smileyinsert = 0;
        }

        if($discuz_uid && $sigstatus && !$usesigcheck) {
                $usesigcheck = 'checked';
        }

        if(!empty($trade)) {
                if(isset($seller)) {
                        $seller = dhtmlspecialchars(stripslashes($seller));
                } else {
                        $query = $db->query(&qu