From e1692710d2765f15d0ba035dceed0901ae4103b6 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 1 Jun 2025 10:18:16 +0800 Subject: [PATCH 1/6] Create index_safe.php copied from inndex.php --- bbs/content/index_safe.php | 1094 ++++++++++++++++++++++++++++++++++++ 1 file changed, 1094 insertions(+) create mode 100644 bbs/content/index_safe.php diff --git a/bbs/content/index_safe.php b/bbs/content/index_safe.php new file mode 100644 index 0000000..5edc29e --- /dev/null +++ b/bbs/content/index_safe.php @@ -0,0 +1,1094 @@ +$bid,"tid"=>$tid,"ask"=>"getlznum")); + $floordata=$floordata[0]; + } + if(count($tdata)==0){ + $tdata=null; + } + else $tdata=$tdata[0]; + if ($floordata!="") { + $floors=intval($floordata['num']); + if ($floors!=0) + $tdata['reply']=$floors-1; + } + $bbsdata=mainfunc(array("ask"=>"bbsinfo")); + $bdata=array(); + foreach ($bbsdata as $dt) { + if (intval($dt['bid'])==$bid) + $bdata=$dt; + } + + $title=count($data)>0?$tdata['title']:"没有这个帖子= ="; + $lztitle="";if($see_lz!="") $lztitle="(只看楼主)  "; + function generateattach($name,$size,$price,$auth,$id,$free,$count){ + $extension=substr($name, strrpos($name, ".")+1); + $supportedExt=explode(" ", "bmp csv gif html jpg jpeg key mov mp3 mp4 numbers pages pdf png rtf tiff txt zip ipa ipsw doc docx ppt pptx xls avi wmv mkv mts"); + $imgsrc="file"; + if(in_array($extension, $supportedExt)){ + $imgsrc=$extension; + } + $imgsrc="../assets/fileicons/".$imgsrc.".png"; + $s='
'; + $s=$s.''; + $s=$s.'
'.$name.'
'; + $s=$s.''.packSize($size).'
'; + if($free){ + $s=$s.'您可以免费下载'; + }else{ + if($price==0){ + $s=$s.'免费'; + }else{ + $s=$s.'售价:'.$price."积分"; + } + } + if($count==0){ + $s=$s."(暂时无人下载)"; + }else{ + $s=$s."(下载次数:".$count.")"; + } + $s=$s."
"; + $s=$s.'
'; + return $s; + } + + function packSize($size){ + if($size<1024) return $size."字节"; + if($size<1024*1024) return round($size/1024,1)."KB"; + if($size<1024*1024*1024) return round($size/1024/1024,1)."MB"; + return round($size/1024/1024/1024,1)."GB"; + } +?> + + + + +<?php echo $title;?> + + + + + + + + +
+
+ + + + + 阅读 
+ 回复  +
+
+ +
+ + + $currentuser"); + $userinfo=mainfunc(array("view"=>$currentuser)); + $userinfo=$userinfo[0]; + $star=intval($userinfo['star']); + + $right=mainfunc(array("ask"=>"rights","bid"=> $bid)); + + $right=$right[0]['code']; + echo(""); + $msg=intval($userinfo['newmsg']); + if($msg==0){ + echo(" 个人中心"); + }else{ + echo(",您有 $msg 条未读消息"); + } + $nowurl=$_SERVER["PHP_SELF"]. "?".$_SERVER["QUERY_STRING"]; + $nowurl=urlencode($nowurl); + echo(" 注销"); + }else{ + $nowurl=$_SERVER["PHP_SELF"]. "?".$_SERVER["QUERY_STRING"]; + $nowurl=urlencode($nowurl); + $right=-1; + $currentuser=null; + echo("欢迎您,游客!登录 或者 注册"); + echo(""); + } + echo(""); + $boardinfo=mainfunc(array( + "ask"=>"bbsinfo", + "bid"=>$bid)); + $boardinfo=$boardinfo[0]; + $need=intval($boardinfo['need']); + $canreply=true; + if ($rights<=1 && $star<$need) $canreply=false; + ?> + + +
+ 您需要 登录 后才能查看本版面帖子内容;没有账号? 现在注册  +
'; + echo ''; + exit; +} +?> +
+
+
+ +1){ + echo(packjump(1,"首页")); + echo packjump($page-1,"上一页"); +} +$start=$page-4; +if($start<1) $start=1; +$end=$start+9; +if($end>$pages) $end=$pages; +for($i=$start;$i<=$end;$i++){ + echo(packjump($i,$i==$page?"plain":$i)); +} +if($page<$pages){ + echo(packjump($page+1,"下一页")); + echo(packjump($pages,"尾页")); +} +echo(" 跳转到:"); +?> +
+
+ + + +\n"); + + echo("\n"); + +} +?> +
\n"); + echo(""); + echo("
\n"); + echo("
\n"); + echo("

".userhrefbig($floor['author'])."

\n"); + + echo("
\n"); + $userinfo=mainfunc(array("view"=>$floor['author'])); + $userinfo=@$userinfo[0]; + echo(""); + echo "

"; + for ($k=1;$k<=intval($userinfo['star']);$k++) + echo ""; + echo "

"; + echo("
".$userinfo['post']."
主题
".$userinfo['reply']."
回帖
".$userinfo['sign']."
签到
\n"); + echo("
\n"); + echo("
\n"); + echo("
\n"); + echo("
\n"); + echo("星数:".$userinfo['star']."
\n"); + echo("精品:".$userinfo['extr']."
\n"); + echo("灌水:".$userinfo['water']."
\n"); + echo("权限:".$userinfo['rights']."
\n"); + echo("最近:".$userinfo['lastdate']."
\n"); + echo "IP:"; + if($rights>=1|| $floor['author']==$currentuser) + echo $userinfo['lastip']; + else echo '*.*.*.*'; + echo "

\n"; + echo(" 发消息\n"); + echo("
\n"); + echo("
\n"); + echo("
\n"); + $time=$floor['replytime']; + echo("
发表于 ".formatstamp($time)); + if($floor['updatetime']!=$floor['replytime']){ + echo("   最后编辑于 ".formatstamp($floor['updatetime'])); + } + echo("".transfloornum($floor['pid'])."\n"); + echo("
\n"); + $translated=translate($floor['text'],$floor['ishtml']=="YES"); + #$translated=$floor['text']; + $translatedforquote=translateforquote($floor['text'],$floor['ishtml']=="YES"); + #echo("
$translated
\n"); + print "
$translated
\n"; + if($floor['attachs']){ + echo('本帖包含如下的附件:'); + echo("
\n"); + $atts=explode(" ", $floor['attachs']); + foreach($atts as $value){ + $nowa=mainfunc(array("ask"=>"attachinfo","id"=>$value)); + $nowa=$nowa[0]; + echo generateattach(@$nowa['name'],@$nowa['size'],@$nowa['price'],@$nowa['auth'],@$nowa['id'],@$nowa['isAuthor']=='YES'||@$nowa['hasPurchased']=='YES',@$nowa['count']); + } + echo("
\n"); + } + if(@$userinfo['sig'.$floor['sig']]){ + echo("
\n"); + echo("--------\n"); + echo("
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"); + echo("
"); + } + $lzl=mainfunc(array( + "ask"=>"lzl", + "method"=>"ask", + "fid"=> $floor['fid'] + )); + if(count($lzl)==0){ + ?> + + + + + + + $author)); + $authorinfo=$authorinfo[0]; + echo('"); + } + ?> + +
'); + echo('
'); + echo('
'.userhref($author).': '.htmlspecialchars($lzl[$j]['text']).'
'); + echo(''.formatstamp($lzl[$j]['time'])); + if ($canreply) echo ' 回复'; + if($right>=1|| $author==$currentuser){ + echo(' 删除'); + } + echo(""); + echo("
+ 我也说一句 + ';?> +
+ \n"); + echo("
\n"); + $ip="*.*.*.*"; + if($rights>=1|| $floor['author']==$currentuser) + $ip=$floor['ip']; + echo " $ip"; + $os=$floor['type']; + if ($os=="android") { + echo "来自于Android客户端"; + } + else if ($os=="ios") { + echo "来自于iOS客户端"; + } + if($right>=1|| $floor['author']==$currentuser){ + echo("删除\n"); + echo("编辑\n"); + } + if ($canreply) { + echo("回复\n"); + echo(" 引用"); +} + echo("
\n"); + echo("
\n"); + echo("\n"); + + echo("
+
+
+
+ +1){ + echo(packjump(1,"首页")); + echo packjump($page-1,"上一页"); +} +$start=$page-4; +if($start<1) $start=1; +$end=$start+9; +if($end>$pages) $end=$pages; +for($i=$start;$i<=$end;$i++){ + echo(packjump($i,$i==$page?"plain":$i)); +} +if($page<$pages){ + echo(packjump($page+1,"下一页")); + echo(packjump($pages,"尾页")); +} +echo(" 跳转到:"); +function packjump($p,$text){ + $lz=""; + if (@$_GET['see_lz']!="") + $lz="&see_lz=1"; + if($text=="plain") return "$p"; + return "$text"; +} +?> + +
+
+ +
+
+
+'; +if ($rights>=0 || $star>=0) echo ' +
添加附件
+ '; +echo ' + + 选择签名档: + 不使用 + 1 + 2 + 3 +
发表回复
+


+ +
+ +
+ +
+ +
+ +';} +else echo ' +
+ 在本版发帖或回复至少需要 '.$need.' 星 +
+'; +} +else echo ' +
+ 您需要 登录 后回复此贴;没有账号? 现在注册  +
';?> + + +
+
+ 为此附件填写阅读权限与下载售价:

+ 阅读权限: +  积分不少于此数值才能浏览附件
+ 下载售价: +  每位下载者需向您支付的积分数

+ +
+
+ +
+
+ 您要对  说:

+

+   +
+
+ + +
+ + + + + + + + +
+ + + + From 0224ca50d6971753d203e85a8c7b095e88eb8c1a Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 1 Jun 2025 10:59:04 +0800 Subject: [PATCH 2/6] test iframe wrapping --- bbs/content/index_safe.php | 60 +++++++++++++++++++++++++++++--------- bbs/lib/mainfunc.php | 31 ++++++++++++++++++++ 2 files changed, 77 insertions(+), 14 deletions(-) diff --git a/bbs/content/index_safe.php b/bbs/content/index_safe.php index 5edc29e..d38c6f9 100644 --- a/bbs/content/index_safe.php +++ b/bbs/content/index_safe.php @@ -307,6 +307,14 @@ function packSize($size){ $translatedforquote=translateforquote($floor['text'],$floor['ishtml']=="YES"); #echo("
$translated
\n"); print "
$translated
\n"; + $wrappedcontennt="
$translated
\n"; + if(@$userinfo['sig'.$floor['sig']]){ + $wrappedcontennt.="
\n"; + $wrappedcontennt.="--------\n"; + $wrappedcontennt.="
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"; + $wrappedcontennt.="
"; + } + print wraphtmltoiframe($wrappedcontennt); if($floor['attachs']){ echo('本帖包含如下的附件:'); echo("
\n"); @@ -318,12 +326,12 @@ function packSize($size){ } echo("
\n"); } - if(@$userinfo['sig'.$floor['sig']]){ - echo("
\n"); - echo("--------\n"); - echo("
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"); - echo("
"); - } + // if(@$userinfo['sig'.$floor['sig']]){ + // echo("
\n"); + // echo("--------\n"); + // echo("
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"); + // echo("
"); + // } $lzl=mainfunc(array( "ask"=>"lzl", "method"=>"ask", @@ -563,14 +571,38 @@ function packjump($p,$text){ ?> refreshAttach(); $(window).load(function() { - $(".textblock").each(function() { - var text=$(this); - text.find("img").each(function() { - var img=$(this); - var width=parseInt(img.css("width")); - width=(width>700)?700:width; - img.css("width",width); - }); + // 已经用css实现 + // $(".textblock").each(function() { + // var text=$(this); + // text.find("img").each(function() { + // var img=$(this); + // var width=parseInt(img.css("width")); + // width=(width>700)?700:width; + // img.css("width",width); + // }); + // }); + $('iframe').each(function() { + const iframe=$(this); + iframe.onload = () => { + try { + const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; + + // 创建观察器 + const resizeObserver = new ResizeObserver(entries => { + const height = entries[0].target.scrollHeight; + // 设置高度 + iframe.style.height = height + 'px'; + }); + + // 观察iframe内容 + resizeObserver.observe(iframeDoc.documentElement); + + // 初始设置高度 + iframe.style.height = iframeDoc.documentElement.scrollHeight + 'px'; + } catch (e) { + console.error("ResizeObserver 错误:", e); + } + }; }); }); function deletepid(pid){ diff --git a/bbs/lib/mainfunc.php b/bbs/lib/mainfunc.php index 3dc95a8..c4466e4 100644 --- a/bbs/lib/mainfunc.php +++ b/bbs/lib/mainfunc.php @@ -138,4 +138,35 @@ function translate($raw,$ishtml,$space=true){ $html=preg_replace("#(\\[i])(.+?)(\\[/i])#", "$2", $html); return $html; } +function wraphtmltoiframe($text, $id = '') { + $jQueryScript = ''; + // innject jquery if the html contains script + if (strpos($text, '') !== false) { + $jQueryScript = ""; + } + + $innerHtml = sprintf( + " + + %s + + +
%s
+ ", + $jQueryScript, + $text + ); + + return sprintf( + "", + $$id ? sprintf("id=\"%s\"", htmlspecialchars($id, ENT_QUOTES)) : '', + htmlspecialchars($innerHtml, ENT_QUOTES | ENT_HTML5) + ); +} ?> From 3481251d367eb0c9487cbf6acbb62c81ac2bc9f6 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 1 Jun 2025 14:17:43 +0800 Subject: [PATCH 3/6] nits --- bbs/content/index_safe.php | 22 ++++++++++++---------- bbs/content/style.css | 10 +++++++++- bbs/lib/mainfunc.php | 2 +- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/bbs/content/index_safe.php b/bbs/content/index_safe.php index d38c6f9..001d96b 100644 --- a/bbs/content/index_safe.php +++ b/bbs/content/index_safe.php @@ -306,15 +306,15 @@ function packSize($size){ #$translated=$floor['text']; $translatedforquote=translateforquote($floor['text'],$floor['ishtml']=="YES"); #echo("
$translated
\n"); - print "
$translated
\n"; - $wrappedcontennt="
$translated
\n"; + // print "
$translated
\n"; + $wrappedcontennt="
$translated
\n"; if(@$userinfo['sig'.$floor['sig']]){ $wrappedcontennt.="
\n"; $wrappedcontennt.="--------\n"; $wrappedcontennt.="
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"; $wrappedcontennt.="
"; } - print wraphtmltoiframe($wrappedcontennt); + print wraphtmltoiframe($wrappedcontennt, 'floor'.$i); if($floor['attachs']){ echo('本帖包含如下的附件:'); echo("
\n"); @@ -582,8 +582,8 @@ function packjump($p,$text){ // }); // }); $('iframe').each(function() { - const iframe=$(this); - iframe.onload = () => { + const iframe = this; // `this` is the raw DOM element + $(iframe).on('load', function() { try { const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; @@ -602,7 +602,7 @@ function packjump($p,$text){ } catch (e) { console.error("ResizeObserver 错误:", e); } - }; + }); }); }); function deletepid(pid){ @@ -986,15 +986,17 @@ function quote(who, num) { what = selectedText; } else { // If not, try to get the specified post - var data = $("#floor" + num).html(); + const $iframe = $("#floor" + num); + const $textblock = $iframe.contents().find(".textblock"); + var data = $textblock.html(); - $("#floor" + num) + $textblock .find(".quotel") .each(function() { $(this).remove(); }); - what = $("#floor" + num).html(); - $("#floor" + num).html(data); + what = $textblock.html(); + $textblock.html(data); if (what.length >= 133) what = what.substr(0, 130) + "..."; diff --git a/bbs/content/style.css b/bbs/content/style.css index 6a5bab2..b1035d9 100755 --- a/bbs/content/style.css +++ b/bbs/content/style.css @@ -139,10 +139,12 @@ a.message{ -webkit-border-radius:10px; border-radius:10px; background-color: white; -} +} +/* The following is not useful after safe iframe */ .textblock img { max-width:100%; } +/* The following is not useful after safe iframe */ .sigblock img { max-width:100%; } @@ -190,6 +192,7 @@ a.message{ .report{ float: right; } +/* The following is not useful after safe iframe */ .quotel{ background-color: #F9F9F9; background-image: url("quotel.png"); @@ -200,6 +203,7 @@ a.message{ color: #666666; font-size: 14px; } +/* The following is not useful after safe iframe */ .quoter{ background-image: url("quoter.png"); background-repeat: no-repeat; @@ -207,10 +211,12 @@ a.message{ background-size: 30px 30px; padding-right: 50px; } +/* The following is not useful after safe iframe */ span.sigtip{ color: gray; font-size: 14px; } +/* The following is not useful after safe iframe */ div.sig{ color: #999999; font-size: 14px; @@ -239,6 +245,7 @@ span.page{ a:hover{ text-decoration: underline; } +/* The following is not useful after safe iframe */ div.textblock{ width: 96%; margin-left: 2%; @@ -249,6 +256,7 @@ div.textblock{ color: #444444; line-height: 160% !important; } +/* The following is not useful after safe iframe */ div.sigblock{ width: 98%; margin-left: 2%; diff --git a/bbs/lib/mainfunc.php b/bbs/lib/mainfunc.php index c4466e4..1b4771d 100644 --- a/bbs/lib/mainfunc.php +++ b/bbs/lib/mainfunc.php @@ -152,7 +152,7 @@ function wraphtmltoiframe($text, $id = '') { From 97f6449e902cde5a8232e21649a5317733818a35 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 1 Jun 2025 14:47:52 +0800 Subject: [PATCH 4/6] change file structure --- bbs/content/index.php | 70 ++++++++++++++----- .../{index_safe.php => index_backup.php} | 70 +++++-------------- 2 files changed, 70 insertions(+), 70 deletions(-) rename bbs/content/{index_safe.php => index_backup.php} (94%) diff --git a/bbs/content/index.php b/bbs/content/index.php index 5edc29e..001d96b 100644 --- a/bbs/content/index.php +++ b/bbs/content/index.php @@ -306,7 +306,15 @@ function packSize($size){ #$translated=$floor['text']; $translatedforquote=translateforquote($floor['text'],$floor['ishtml']=="YES"); #echo("
$translated
\n"); - print "
$translated
\n"; + // print "
$translated
\n"; + $wrappedcontennt="
$translated
\n"; + if(@$userinfo['sig'.$floor['sig']]){ + $wrappedcontennt.="
\n"; + $wrappedcontennt.="--------\n"; + $wrappedcontennt.="
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"; + $wrappedcontennt.="
"; + } + print wraphtmltoiframe($wrappedcontennt, 'floor'.$i); if($floor['attachs']){ echo('本帖包含如下的附件:'); echo("
\n"); @@ -318,12 +326,12 @@ function packSize($size){ } echo("
\n"); } - if(@$userinfo['sig'.$floor['sig']]){ - echo("
\n"); - echo("--------\n"); - echo("
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"); - echo("
"); - } + // if(@$userinfo['sig'.$floor['sig']]){ + // echo("
\n"); + // echo("--------\n"); + // echo("
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"); + // echo("
"); + // } $lzl=mainfunc(array( "ask"=>"lzl", "method"=>"ask", @@ -563,13 +571,37 @@ function packjump($p,$text){ ?> refreshAttach(); $(window).load(function() { - $(".textblock").each(function() { - var text=$(this); - text.find("img").each(function() { - var img=$(this); - var width=parseInt(img.css("width")); - width=(width>700)?700:width; - img.css("width",width); + // 已经用css实现 + // $(".textblock").each(function() { + // var text=$(this); + // text.find("img").each(function() { + // var img=$(this); + // var width=parseInt(img.css("width")); + // width=(width>700)?700:width; + // img.css("width",width); + // }); + // }); + $('iframe').each(function() { + const iframe = this; // `this` is the raw DOM element + $(iframe).on('load', function() { + try { + const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; + + // 创建观察器 + const resizeObserver = new ResizeObserver(entries => { + const height = entries[0].target.scrollHeight; + // 设置高度 + iframe.style.height = height + 'px'; + }); + + // 观察iframe内容 + resizeObserver.observe(iframeDoc.documentElement); + + // 初始设置高度 + iframe.style.height = iframeDoc.documentElement.scrollHeight + 'px'; + } catch (e) { + console.error("ResizeObserver 错误:", e); + } }); }); }); @@ -954,15 +986,17 @@ function quote(who, num) { what = selectedText; } else { // If not, try to get the specified post - var data = $("#floor" + num).html(); + const $iframe = $("#floor" + num); + const $textblock = $iframe.contents().find(".textblock"); + var data = $textblock.html(); - $("#floor" + num) + $textblock .find(".quotel") .each(function() { $(this).remove(); }); - what = $("#floor" + num).html(); - $("#floor" + num).html(data); + what = $textblock.html(); + $textblock.html(data); if (what.length >= 133) what = what.substr(0, 130) + "..."; diff --git a/bbs/content/index_safe.php b/bbs/content/index_backup.php similarity index 94% rename from bbs/content/index_safe.php rename to bbs/content/index_backup.php index 001d96b..5edc29e 100644 --- a/bbs/content/index_safe.php +++ b/bbs/content/index_backup.php @@ -306,15 +306,7 @@ function packSize($size){ #$translated=$floor['text']; $translatedforquote=translateforquote($floor['text'],$floor['ishtml']=="YES"); #echo("
$translated
\n"); - // print "
$translated
\n"; - $wrappedcontennt="
$translated
\n"; - if(@$userinfo['sig'.$floor['sig']]){ - $wrappedcontennt.="
\n"; - $wrappedcontennt.="--------\n"; - $wrappedcontennt.="
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"; - $wrappedcontennt.="
"; - } - print wraphtmltoiframe($wrappedcontennt, 'floor'.$i); + print "
$translated
\n"; if($floor['attachs']){ echo('本帖包含如下的附件:'); echo("
\n"); @@ -326,12 +318,12 @@ function packSize($size){ } echo("
\n"); } - // if(@$userinfo['sig'.$floor['sig']]){ - // echo("
\n"); - // echo("--------\n"); - // echo("
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"); - // echo("
"); - // } + if(@$userinfo['sig'.$floor['sig']]){ + echo("
\n"); + echo("--------\n"); + echo("
".translate($userinfo['sig'.$floor['sig']],false,false)."


"."
\n"); + echo("
"); + } $lzl=mainfunc(array( "ask"=>"lzl", "method"=>"ask", @@ -571,37 +563,13 @@ function packjump($p,$text){ ?> refreshAttach(); $(window).load(function() { - // 已经用css实现 - // $(".textblock").each(function() { - // var text=$(this); - // text.find("img").each(function() { - // var img=$(this); - // var width=parseInt(img.css("width")); - // width=(width>700)?700:width; - // img.css("width",width); - // }); - // }); - $('iframe').each(function() { - const iframe = this; // `this` is the raw DOM element - $(iframe).on('load', function() { - try { - const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; - - // 创建观察器 - const resizeObserver = new ResizeObserver(entries => { - const height = entries[0].target.scrollHeight; - // 设置高度 - iframe.style.height = height + 'px'; - }); - - // 观察iframe内容 - resizeObserver.observe(iframeDoc.documentElement); - - // 初始设置高度 - iframe.style.height = iframeDoc.documentElement.scrollHeight + 'px'; - } catch (e) { - console.error("ResizeObserver 错误:", e); - } + $(".textblock").each(function() { + var text=$(this); + text.find("img").each(function() { + var img=$(this); + var width=parseInt(img.css("width")); + width=(width>700)?700:width; + img.css("width",width); }); }); }); @@ -986,17 +954,15 @@ function quote(who, num) { what = selectedText; } else { // If not, try to get the specified post - const $iframe = $("#floor" + num); - const $textblock = $iframe.contents().find(".textblock"); - var data = $textblock.html(); + var data = $("#floor" + num).html(); - $textblock + $("#floor" + num) .find(".quotel") .each(function() { $(this).remove(); }); - what = $textblock.html(); - $textblock.html(data); + what = $("#floor" + num).html(); + $("#floor" + num).html(data); if (what.length >= 133) what = what.substr(0, 130) + "..."; From 4fb54b62ade971cff15ad19c51df1b12f14fde02 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 3 Jun 2025 23:07:44 -0700 Subject: [PATCH 5/6] nits --- bbs/lib/mainfunc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bbs/lib/mainfunc.php b/bbs/lib/mainfunc.php index 1b4771d..656bf9e 100644 --- a/bbs/lib/mainfunc.php +++ b/bbs/lib/mainfunc.php @@ -151,10 +151,11 @@ function wraphtmltoiframe($text, $id = '') { %s
%s
From 0435b5c95e75f5e040c3420efdde092b2c8e356e Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 3 Jun 2025 23:39:15 -0700 Subject: [PATCH 6/6] nits --- bbs/lib/mainfunc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bbs/lib/mainfunc.php b/bbs/lib/mainfunc.php index 656bf9e..1572817 100644 --- a/bbs/lib/mainfunc.php +++ b/bbs/lib/mainfunc.php @@ -152,13 +152,13 @@ function wraphtmltoiframe($text, $id = '') { -
%s
+
%s
", $jQueryScript, $text