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

📄 ikon.lib

📁 绿叶网络小学校园网-完全适合小学的网站
💻 LIB
📖 第 1 页 / 共 5 页
字号:
                    $memberoutput .= qq~<br>~;
                    $lengthmark = 0;
                }
            }
        }
} # end routine


###########################
# Forum Jump

sub forumjump {

$jumphtml .= qq~
<SCRIPT LANGUAGE="JavaScript">
<!-- 
function menu(){
var URL = document.jump.jumpto.options[document.jump.jumpto.selectedIndex].value;
top.location.href = URL; target = '_self';
}
// -->
</SCRIPT>
<form action="$boardurl/$forumsprog" method="post" name="jump">
<select name="jumpto" onchange="menu()">
<option value="$boardurl/$forumsummaryprog">跳转论坛
~;        

$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 $forum (@forums) { #start foreach @forums
    chomp $forum;
    ($forumid, $category, $categoryplace, $forumname, $forumdescription) = split(/\|/,$forum);
    $rearrange = ("$categoryplace|$category|$forumname|$forumdescription|$forumid");
    push (@rearrangedforums, $rearrange);

} # end foreach (@forums)

@finalsortedforums = sort(@rearrangedforums);

foreach $sortedforums (@finalsortedforums) { #start foreach 
    ($categoryplace, $category, $forumname, $forumdescription, $forumid) = split(/\|/,$sortedforums);
    
    if ($categoryplace ne $lastcategoryplace) { #start if $categoryplace
        $jumphtml .= "<option value=\"$boardurl/$forumsummaryprog\">\n";
        $jumphtml .= "<option value=\"$boardurl/$forumsummaryprog\">>>&nbsp;$category <<\n";
        $jumphtml .= "<option value=\"$boardurl/$forumsprog?forum=$forumid\" target=\"_self\"> $forumname\n";
        }
        else {
            $jumphtml .= "<option value=\"$boardurl/$forumsprog?forum=$forumid\" target=\"_self\"> $forumname\n";
            }
     $lastcategoryplace = $categoryplace;
     } # end foreach 
     
$jumphtml .= qq~</select>\n~;

} #end routine 


###########################
# Emoticon Swopper


sub doemoticons {
    
        my $post = shift;

        $dirtoopen = "$imagesdir" . "emot";
        opendir (DIR, "$dirtoopen") or die "表情图目录没有找到: $dirtoopen"; 
        @dirdata = readdir(DIR);
        closedir (DIR);

        @emoticondata = grep(/gif$/,@dirdata);
        
        foreach $picture (@emoticondata) {
            $smileyname = $picture;
            $smileyname =~ s/\.gif$//g;
            $post =~ s/\:$smileyname\:/\<img src=\"$imagesurl\/emot\/$picture\" border=\"0\">/g;
            }
        return $post;
        }

sub cleaninput {
my $text = shift;
$text =~ s/<!--(.|\n)*-->//g;
$text =~ s/<script>/\&lt;script\&gt;/g;
$text =~ s/\&nbsp;/ /g;
$text =~ s/\&/\&amp;/g;
$text =~ s/"/\&quot;/g;
$text =~ s/  / \&nbsp;/g;
$text =~ s/</\&lt;/g;
$text =~ s/>/\&gt;/g;
$text =~ s/\|/\&#0124;/g;
$text =~ s/\t//g;
$text =~ s/\r//g;
$text =~ s/  / /g;
$text =~ s/\n\n/<p>/g;
$text =~ s/\n/<br>/g;
return $text;
}

sub unHTML {
my $text = shift;
$text =~ s/<!--(.|\n)*-->//g;
$text =~ s/<script>/\&lt;script\&gt;/g;
$text =~ s/\&/\&amp;/g;
$text =~ s/"/\&quot;/g;
$text =~ s/  / \&nbsp;/g;
$text =~ s/</\&lt;/g;
$text =~ s/>/\&gt;/g;
$text =~ s/\|/\&#0124;/g;
return $text;
}

sub cleanarea {
my $text = shift;
$text =~ s/<!--(.|\n)*-->//g;   
$text =~ s/<script>/\&lt;script\&gt;/g;
$text =~ s/\&/\&amp;/g;
$text =~ s/"/\&quot;/g;
$text =~ s/  / \&nbsp;/g;
$text =~ s/</\&lt;/g;
$text =~ s/>/\&gt;/g;
$text =~ s/\|/\&#0124;/g;
$text =~ s/\t/ \&nbsp; \&nbsp; \&nbsp;/g;
$text =~ s/\t//g;
$text =~ s/\r//g;
$text =~ s/  / /g;
$text =~ s/\n\n/<p>/g;
$text =~ s/\n/<br>/g;
return $text;
}

sub stripMETA {
my $file = shift;
$file =~ s/\&//g;
$file =~ s/\;//g;  
$file =~ s/\`//g;
$file =~ s/\'//g;
$file =~ s/"//g;
$file =~ s/\|//g;
$file =~ s/\*//g;
$file =~ s/\?//g;
$file =~ s/<//g;
$file =~ s/>//g;
$file =~ s/\^//g;
$file =~ s/\(//g;
$file =~ s/\)//g;
$file =~ s/\[//g;
$file =~ s/\]//g;
$file =~ s/\{//g;
$file =~ s/\}//g;
$file =~ s/\$//g;
$file =~ s/\n//g;
$file =~ s/\r//g;
return $file;
}

sub dateformat {
    my $time = shift;
    (my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
    my @months = ('01','02','03','04','05','06','07','08','09','10','11','12');
    $mon = $months[$mon];
    my $ampm = "am";
    if ($hour > 11) {  $ampm = "pm"; }
    if ($hour > 12) { $hour = $hour - 12; }
    if ($hour == 0) { $hour = 12; }
    if ($hour < 10) { $hour = "0$hour"; }
    if ($min < 10) { $min = "0$min"; }
    if ($sec < 10) { $sec = "0$sec"; }
    if ($mday < 10) { $mday = "0$mday"; }
    $year = $year + 1900;
    return "$year/$mon/$mday $hour:$min$ampm";
    }

sub longdate {
    my $time = shift;
    (my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
    my @months = ('01','02','03','04','05','06','07','08','09','10','11','12');
    $year = $year + 1900;
    if ($mday < 10) { $mday = "0$mday"; }
    return "$year年$months[$mon]月$mday日";
    }

sub shortdate {
    my $time = shift;
    (my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
    $mon++;
    if ($mon < 10) { $mon = "0$mon"; }
    if ($mday < 10) { $mday = "0$mday"; }
    $year = $year + 1900;
#    $year =~ s/20//isg;
    return "$year/$mon/$mday";
    }

sub shorttime {
    my $time = shift;
    (my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
    $mon++;
    my $ampm = "am";
    if ($hour > 11) {  $ampm = "pm"; }
    if ($hour > 12) { $hour = $hour - 12; }
    if ($hour == 0) { $hour = 12; }
    if ($hour < 10) { $hour = "0$hour"; }
    if ($min < 10) { $min = "0$min"; }
    if ($sec < 10) { $sec = "0$sec"; }
    return "$hour:$min$ampm";
    }

sub dateformatshort {
    my $time = shift;
    (my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
    my @months = ('01','02','03','04','05','06','07','08','09','10','11','12');
    $mon = $months[$mon];
    if ($hour < 10) { $hour = "0$hour"; }
    if ($mday < 10) { $mday = "0$mday"; }
    if ($min < 10) { $min = "0$min"; }
    if ($sec < 10) { $sec = "0$sec"; }
    $year = $year + 1900;
    return "$year年$mon月$mday日 $hour:$min";
    }

sub joineddate {
    my $time = shift;
    (my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
    my @months = ('01','02','03','04','05','06','07','08','09','10','11','12');
    $year = $year + 1900;
    if ($mday < 10) { $mday = "0$mday"; }
    return " $year/$months[$mon]/$mday";
    }

sub printmessanger {

   my %args = (
   -Title        => "", 
   -ToPrint      => "",
   -Version      => "", 
   @_, 
   ); 

   my $title         = $args{-Title}; 
   my $output        = $args{-ToPrint}; 
   my $versionnumber = $args{-Version};

    
    print qq~
    <html>
    <head>
    <title>$title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <SCRIPT>
    <!--
    function openwin(url, width, height) {
        var Win = window.open(url,"openwin",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes' );
        }
    //-->
    </SCRIPT>
    
    <style type="text/css">
    <!--
		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 bgcolor=#ffffff topmargin=0 leftmargin=5>
    ~;


print qq~$output\n~;
print qq~<font face=宋体 color="$fontcolormisc"><br><br><center>中文版权所有: <a href="http://www.cgier.com/" target=_blank>CGI 编程者之家</a></center></body></html>~;
exit;

}


sub messangererror {
local($errorinfo) = @_;
($where, $errormsg) = split(/\&/, $errorinfo);

$output = qq~
<table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=$tablebordercolor align=center>
	<tr>	
		<td>
		<table cellpadding=6 cellspacing=1 border=0 width=100%>
		<tr>
   			<td bgcolor=$miscbacktwo valign=middle align=center><font face=$font color=$fontcolormisc><b>错误: $where</b></font></td></tr>
   			<tr>
   				<td bgcolor=$miscbackone valign=middle><font face=$font color=$fontcolormisc>
   				<b>关于 $where 的详细错误原因</b>
   				<ul>
   				<li><b>$errormsg</b>
   				<li>你是否仔细阅读了<a href="$helpprog">帮助文件</a>?
   				</ul>
		                <b>产生 $where 错误可能的原因:</b>
                		<ul>
		                <li>密码错误
                		<li>用户名错误
		                <li>用户没有<a href="$registerprog">注册</a>
   				</ul>
   				</tr>
   				</td></tr>

⌨️ 快捷键说明

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