📄 ikon.lib
字号:
#############################################################
# Ikondiscussion v2.1
# Copyright 2000 Ikondiscussion.com - All Rights Reserved
# Ikondiscussion is a trademark of Ikondiscussion.com Group
#
# 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
$versionnumber = "v1.1 build0202a";
#############################################################
$filetoopen = "$ikondir" . "data/badwords.cgi";
open (FILE, "$filetoopen");
$badwords = <FILE>;
close (FILE);
sub checkVALIDITY {
$rm = $query->request_method();
$rr = $query->referer();
if (($rm eq 'POST') and ($rr !~ /$boardurl/i)) {
$timenow = time;
$longdate = &longdate("$timenow");
$shorttime = &shorttime("$timenow");
$filetoopen = "$ikondir" . "data/hacklog.cgi";
open(LOG, ">>$filetoopen");
print LOG qq~------Log Entry------\n~;
print LOG qq~<hr><b>日志记录</b> - $error<br><br>~;
print LOG qq~<b>发生时间</b> - $longdate, $shorttime<br><br>~;
print LOG qq~<b>详细资料已经记录。</b><br>~;
foreach (sort keys %ENV) {
chomp $_;
print LOG qq~<b>$_</b> = $ENV{$_}<br>~ unless (/password/i);
}
print LOG "<hr>\n";
close(LOG);
}
}
###########################
# system error
sub systemerror {
my $error = shift;
$timenow = time;
$longdate = &longdate("$timenow");
$shorttime = &shorttime("$timenow");
$filetoopen = "$ikondir" . "data/hacklog.cgi";
open(LOG, ">>$filetoopen");
print LOG qq~------Log Entry------\n~;
print LOG qq~<hr><b>日志记录</b> - $error<br><br>~;
print LOG qq~<b>发生时间</b> - $longdate, $shorttime<br><br>~;
print LOG qq~<b>详细资料已经记录。</b><br>~;
foreach (sort keys %ENV) {
chomp $_;
print LOG qq~<b>$_</b> = $ENV{$_}<br>~ unless (/password/i);
}
print LOG "<hr>\n";
close(LOG);
print header(-charset=>"gb2312");print start_html('系统出错!');
print qq~
<font face=宋体 color=#333333>
<h1>System error</h1>
<p>
错误原因:$error
<p>
请联系论坛坛主!
<br><br>
<b>为了更好的改进本论坛,下面的一些详细资料已经自动记录到论坛的日志文件中去了:</b>
<font color="#FF0000">
<hr><br>
~;
foreach (sort keys %ENV) {
print "<b>$_</b><br>" unless (/password/i);
}
print qq~
<hr>
<br>
<font color="#000000">
要注意的是,这些信息只能被论坛的坛主查看到!
~;
print end_html;
exit;
}
###########################
# Ikon Board Miscellaneous Header
sub mischeader {
local($misctype) = @_;
$filetoopen = "$ikondir" . "data/allforums.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen") or die "无法定位所需文件!";
flock(FILE, 2) if ($OS_USED eq "Unix");
@forums = <FILE>;
close(FILE);
foreach $forumline (@forums) { #start foreach @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 threadstate and topic title
$filetoopen = "$ikondir" . "forum$inforum/list.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen");
flock(FILE,2) if ($OS_USED eq "Unix");
@allthreads = <FILE>;
close(FILE);
foreach $line (@allthreads) { #start foreach @threads
($tempno, $trash) = split(/\|/, $line);
if ($intopic eq $tempno) {
($trash, $topictitle, $topicdescription, $threadstate, $trash) = split(/\|/,$line);
}
} # end foreach
if ($forumgraphic) {
$forumgraphic = qq~<a href="$forumsprog?forum=$inforum"><img src="$imagesurl/images/$forumgraphic" border=0></a>~;
}
else {
$forumgraphic = qq~<a href="$boardurl/$forumsummaryprog"><img src="$imagesurl/images/$boardlogo" border=0></a>~;
}
&title;
$inmembername =~ s/\_/ /g;
$output .= qq~
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth align=center>
<tr>
<td width=30% rowspan=2 valign=top>
$forumgraphic
</td>
<td valign=top align=left>
<font face=$font color=$fontcolormisc>
<img src="$imagesurl/images/closedfold.gif" border=0 width=15 height=11> <a href="$forumsummaryprog">$boardname</a>
<br>
<img src="$imagesurl/images/bar.gif" border=0 width=15 height=15><img src="$imagesurl/images/closedfold.gif" border=0 width=15 height=11> <a href="$forumsprog?forum=$inforum">$forumname</a>
<br>
<img src="$imagesurl/images/bar.gif" border=0 width=15 height=15><img src="$imagesurl/images/openfold.gif" border=0 width=15 height=11> $misctype
</td>
$usermenu
</tr>
</table>
<p>
~;
} # end misc header
###########################
# Ikon Board Header
sub title {
$newmail = "<p>";
if ($inmembername eq "" || $inmembername eq "客人") {
$inmembername = "客人";
$loggedinas = qq~<b>客人</b>: <a href="$loginprog">登陆</a> | <a href="$registerprog">注册</a> | <a href="$lostpasswordprog">忘记密码</a> | <a href="$onlineprog">在线用户</a> | <a href="$searchprog">搜索</a> | <a href="javascript:openScript('$helpprog',500,400)">帮助</a>~;
}
else {
$memberfilename = $inmembername;
$memberfilename =~ s/ /\_/g;
$filetoopen = "$ikondir". "messages/$memberfilename" . "_msg.cgi";
open (FILE, "$filetoopen");
@allmessages = <FILE>;
close (FILE);
$unread = 0;
foreach (@allmessages) {
($trash, $readstate) = split(/\|/,$_);
if ($readstate eq "no") {
$unread++;
}
}
$newmail = qq(<table width=$tablewidth cellpadding=2 cellspacing=0 align=center>
<tr>
<td align=right valign=middle>
<bgsound src="$imagesurl/images/mail.wav" border=0>
<a href="javascript:openScript('$messangerprog?action=inbox',600,400)"><img src="$imagesurl/images/newmail.gif" border=0>有新短消息</a>
</td>
</tr>
</table>) if $unread;
$loggedinas = qq~<b>$inmembername</b>: <a href="$loginprog">重登陆</a> | <a href="javascript:openScript('$messangerprog?action=inbox',600,400)">短消息</a> | <a href="$profileprog?action=modify&user=memberfilename">更改信息</a> | <a href="javascript:openScript('$boardurl/$newpostsprog',500,400)">检查新贴</a> | <a href="$onlineprog">在线用户</a> | <a href="$searchprog">搜索</a> | <a href="javascript:openScript('$helpprog',500,400)">帮助</a> | <a href="$loginprog?action=logout">退出</a> ~;
}
&getmember("$inmembername");
if ($membercode eq "ad") {
$loggedinas .= qq~
| <a href="$adminprog">管理中心</a>
~;
}
$output = qq~
<table width="$tablewidth" align="center" cellspacing="0" cellpadding="1" border="0" bgcolor=$titleborder>
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="4" border="0">
<tr>
<td bgcolor=$menubackground valign="middle" align=left>
<font face=$font color=$menufontcolor>
>> 欢迎您,$loggedinas
</font>
</td>
<td bgcolor=$menubackground valign="middle" align=right>
<font face=$font color=$titlefont><a href="$homeurl"><b>返回主页</B></a></font>
</td>
</tr>
</table>
</td>
</tr>
</table>
$newmail
~;
if ($forumlastvisit) {
$flv= $forumlastvisit + ($timedifferencevalue*3600) + ($timezone*3600);
$flongdate = &longdate("$flv");
$fshorttime = &shorttime("$flv");
$lastvisitdata = qq~ 最近访问论坛时间: $flongdate $fshorttime~;
}
else {
$lastvisitdata = qq~>> $forumname欢迎您的到来 <<~;
}
$uservisitdata = qq~
<tr>
<td valign=bottom align=right>
<font face=$font color=$menufontcolor>
<a href="$forumsprog?forum=$inforum&action=resetposts">标记所有论坛内容为已读</a> <a href="javascript:openScript('$helpprog?helpon=阅读标记',500,400)"><img src="$imagesurl/images/help_b.gif" border=0></a> <br>$lastvisitdata
</font>
</td>
</tr>
~;
}
###########################
# forummoderator routine
sub moderator {
$filetoopen = "$ikondir" . "data/allforums.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen") or die "无法定位所需文件!";
flock (FILE,2) if ($OS_USED eq "Unix");
@forums = <FILE>;
close(FILE);
foreach $forumline (@forums) { #start foreach @forums
($tempno, $trash) = split(/\|/,$forumline);
if ($inforum eq $tempno) {
($trash, $trash, $trash, $trash, $trash, $forummoderator ,$trash, $trash, $trash, $startnewthreads) = split(/\|/,$forumline);
}
}
$forummoderator =~ s/\, /\,/gi;
@forummodnames = split(/\,/, $forummoderator);
$totalmods = @forummodnames;
$modcount = 1;
$inmembmod = "no";
foreach $name (@forummodnames) {
chomp $name;
$cleanedmodname = $name;
$cleanedmodname =~ s/ /\_/g;
unless ($modcount eq $totalmods) {
$modoutput .= qq~<a href="$profileprog?action=show&member=$cleanedmodname">$name</a>, ~;
}
else {
$modoutput .= qq~<a href="$profileprog?action=show&member=$cleanedmodname">$name</a>~;
}
if ($inmembername eq $name) {
$inmembmod = "yes";
}
$modcount++
}
unless ($inmembmod eq "yes") { $inmembmod = "no"; }
}
###########################
# error routine
sub error {
my $errorinfo = shift;
($where, $errormsg) = split(/\&/, $errorinfo);
$inmembername = cookie("amembernamecookie");
$inpassword = cookie("apasswordcookie");
&title;
$output .= qq~
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth align=center>
<tr>
<td width=30% rowspan=2 valign=top><img src="$imagesurl/images/$boardlogo" border=0></td>
<td valign=top align=left><font face=$font color=$fontcolormisc>
<img src="$imagesurl/images/closedfold.gif" border=0 width=15 height=11> <a href="$forumsummaryprog">$boardname</a>
<br>
<img src="$imagesurl/images/bar.gif" border=0 width=15 height=15><img src="$imagesurl/images/openfold.gif" border=0 width=15 height=11> 错误: $where
</td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -