📄 printpage.cgi
字号:
#!/usr/bin/perl
#############################################################
# Ikonboard v2.1
# Copyright 2000 Ikondiscussion.com - All Rights Reserved
# Ikondiscussion is a trademark of Ikondiscussion.com
#
# Software Distributed by: Ikondiscussion.com
# Visit us online at http://www.ikondiscussion.com
# Email us on boards@ikondiscussion.com
#
# All files written by Matthew Mecham
#############################################################
#use CGI::Carp "fatalsToBrowser"; # Output errors to browser
use CGI qw(:standard); # Saves loads of work
$CGI::POST_MAX=1024 * 150; # limit post data
$CGI::DISABLE_UPLOADS = 1; # Disable uploads
eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "ikon.lib"; # Require ikonboard ()
require "data/progs.cgi"; # Require prog names
require "data/boardinfo.cgi";# Require board info
require "data/styles.cgi"; # Require styles info
};
if ($@) {
print header(-charset=>"gb2312"); print start_html(-title=>"ib2000 出错!");
print "不能够找到文件:$@\n如果您使用的是 Windows 类操作系统,请在每一个程序中更改 require 的设置,填入绝对路径!";
print end_html; exit;
}
$|++; # Unbuffer the output
#################--- Begin the program ---###################
$thisprog = "printpage.cgi";
$query = new CGI;
$boardurltemp =$boardurl;
$boardurltemp =~ s/http\:\/\/(\S+?)\/(.*)/\/$2/;
$cookiepath = $boardurltemp;
$cookiepath =~ s/$thisprog//sg;
$inforum = $query -> param('forum');
$intopic = $query -> param('topic');
print header(-charset=>"gb2312");
if (($inforum) && ($inforum !~ /^[0-9]+$/)) { &error("普通&请不要修改生成的 URL!"); }
if (($intopic ) && ($intopic !~ /^[0-9]+$/)) { &error("普通&请不要修改生成的 URL!"); }
if (($number) && ($number !~ /^[0-9]+$/)) { &error("普通&请不要修改生成的 URL!"); }
if (! $inmembername) { $inmembername = cookie("amembernamecookie"); }
if (! $inpassword) { $inpassword = cookie("apasswordcookie"); }
if ($inmembername eq "" || $inmembername eq "客人" ) {
$inmembername = "客人";
}
else {
&getmember("$inmembername");
if (($allowedentry{$inforum} eq "yes")||($membercode eq "ad")) { $allowed = "yes"; } else { $allowed = "no"; }
&getmemberstime("$inmembername");
&getlastvisit;
$forumlastvisit = $lastvisitinfo{$inforum};
$currenttime = time;
&setlastvisit("$inforum,$currenttime");
}
$filetoopen = "$ikondir" . "data/allforums.cgi";
open(FILE, "$filetoopen");
flock(FILE, 2) if ($OS_USED eq "Unix");
@forums = <FILE>;
close(FILE);
foreach $forumline (@forums) {
($tempno, $trash) = split(/\|/,$forumline);
if ($inforum eq $tempno) {
($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic) = split(/\|/,$forumline);
}
}
### Grab the topic title
$filetoopen = "$ikondir" . "forum$inforum/$intopic.thd";
open(FILE, "$filetoopen");
@threads = <FILE>;
close(FILE);
($trash, $topictitle, $trash) = split(/\|/, @threads[0]);
$postdate = &dateformat($postdate + ($timedifferencevalue*3600) + ($timezone*3600));
if (("$privateforum" eq "yes") && ("$allowed" ne "yes")) {
&error("进入私密论坛&对不起,你无权访问这个论坛!");
}
else {
&whosonline("$inmembername|<a href=\"$forumsprog?forum=$inforum\"><b>$forumname</b></a>|none|浏览<a href=\"$threadprog?forum=$inforum&topic=$intopic\"><b>$topictitle</b></a>(文本方式)|") if ($privateforum ne "yes");
&whosonline("$inmembername|<a href=\"$forumsprog?forum=$inforum\"><b>$forumname</b></a>(密)|none|浏览保密贴子(文本方式)|");
}
### Print the header
if ($badwords) {
@pairs = split(/\&/,$badwords);
foreach (@pairs) {
($bad, $good) = split(/=/,$_);
chop $good;
$topictitle=~ s/$bad/$good/isg;
}
}
$output .= qq~
<html><head><title>$boardname</title>
<style>
A:visited { TEXT-DECORATION: none }
A:active { TEXT-DECORATION: none }
A:hover { TEXT-DECORATION: underline overline }
A:link { text-decoration: none;}
A:visited { text-decoration: none;}
A:active { TEXT-DECORATION: none;}
A:hover { TEXT-DECORATION: underline overline}
.t { LINE-HEIGHT: 1.4 }
BODY { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
TD { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
SELECT { FONT-FAMILY: 宋体; FONT-SIZE: 9pt; }
INPUT { FONT-FAMILY: 宋体; FONT-SIZE: 9pt; height:22px; }
TEXTAREA{ FONT-FAMILY: 宋体; FONT-SIZE: 9pt; }
DIV { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
FORM { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
OPTION { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
P { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
TD { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
BR { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
</style>
</head>
<body topmargin=10 leftmargin=0>
<table cellpadding=0 cellspacing=0 border=0 width=90% align=center>
<tr>
<td>
<p><b>以文本方式查看主题</b><p>
<b>- $boardname</b> ($boardurl/$forumsummaryprog)<br>
<b>-- $forumname</b> ($boardurl/$forumsprog?forum=$inforum)<br>
<b>--- $topictitle</b> ($boardurl/$forumsprog?forum=$inforum&topic=$intopic)
</tr>
</table>
<p><p><p>
<table cellpadding=0 cellspacing=0 border=0 width=90% align=center>
<tr>
<td>
~;
foreach $line (@threads) {
($postermembername, $topictitle, $postipaddress, $showemoticons, $showsignature, $postdate, $post) = split(/\|/,$line);
$post = &ikoncode("$post");
$post =~ s/<\;/\</g;
$post =~ s/>\;/\>/g;
$post =~ s/"\;/\"/g;
$postdate = &dateformat($postdate + ($timedifferencevalue*3600) + ($timezone*3600));
if ($badwords) {
@pairs = split(/\&/,$badwords);
foreach (@pairs) {
($bad, $good) = split(/=/,$_);
chop $good;
$post=~ s/$bad/$good/isg;
}
}
$output .= qq~
<p>
<hr><p>
-- 作者: $postermembername<BR>
-- 发布时间: $postdate<p>
$post
<p><p>
~;
} # end foreach
$output .= qq~
</td></tr></table><center><hr><p>$boardname<br>© 2000 cgier.com</center>
</body></html>
~;
print $output;
exit;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -