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

📄 ikon.lib

📁 绿叶网络小学校园网-完全适合小学的网站
💻 LIB
📖 第 1 页 / 共 5 页
字号:
	   $post = &smilecode("$post");
    }

    &mischeader("回复预览");

    $output .= qq~
    <table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
        <tr><td>
        <table cellpadding=4 cellspacing=1 border=0 width=100%>
        <tr>
            <td bgcolor=$titlecolor colspan=3 width=100%><font face="$font" color=$titlefontcolor>预览</td>
        </tr>
        <tr>
            <td bgcolor="$postbackcolor" rowspan=3 valign="top" width=20%><font face=$posternamefont color=$posternamecolor>
            <b>$inmembername</b></font></td>
            <td bgcolor="$postbackcolor" colspan=2><font face="$font" color=$postfontcolor><b>预览</b> </td></tr>
        <tr>
            <td colspan=2 bgcolor="$postbackcolor"><font face="$font" color=$postfontcolor>$post</td></tr></table></td>
            </tr></table>
        <p>
        ~;
    }

sub getforum {

my $inforum = shift;

$filetoopen = "$ikondir" . "data/allforums.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen") or die "文件 allforums.cgi 不存在!";
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);
      }
   }

}

sub rebuildLIST {
    
    my %IN = (
        -Forum        => "",
        @_, 
        ); 
 
    $dirtoopen = "$ikondir" . "forum$IN{-Forum}";
    opendir (DIR, "$dirtoopen"); 
    @dirdata = readdir(DIR);
    closedir (DIR);

    @entry = grep(/pl$/,@dirdata);

    foreach (@entry) {
        ($id, $tr) = split(/\./,$_);
        my $file = "$ikondir" . "forum$IN{-Forum}/$id.pl";
        open (TMP, "$file");
        flock (TMP, 2) if ($OS_USED eq "Unix");
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate,$posticon) = split (/\|/,<TMP>);
        close (TMP);
        my $file1 = "$ikondir" . "forum$IN{-Forum}/$id.thd";
        open (TMP1, "$file1");
        flock (TMP1, 2) if ($OS_USED eq "Unix");
        ($membername, $topictitle, $postipaddress, $showemoticons, $showsignature ,$postdate, $post, $posticon) = split(/\|/,<TMP1>);
        close (TMP);
        $rr = ("$lastpostdate|$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$posticon|");
        push (@dat, $rr);
        }

        @sortdat = sort(@dat); undef @dat;
        @sortdat = reverse(@sortdat);
        my $file = "$ikondir" . "forum$IN{-Forum}/list.cgi";
        open (LIST, ">$file");
        flock (LIST, 2) if ($OS_USED eq "Unix");
        foreach (@sortdat) {
            chomp $_;
            ($lastpostdate, $topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $posticon) = split (/\|/,$_);    
            print LIST "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate|$posticon|\n" unless (!$topictitle);
            }
        close (LIST);
        undef @sortdat;
}

sub openFILE {

    my %args = (-FH=>"",-FN=>"",-MD=>"",@_,); 
    my $FILEHANDLE   = $args{-FH}; 
    my $filename     = $args{-FN}; 
    my $method       = $args{-MD};

    $filename = &stripMETA($filename);

    if ($method eq 'r') {
        open ($FILEHANDLE, $filename);
        }
    if ($method eq 'wr') {
        open ($FILEHANDLE, ">$filename");
        flock ($FILEHANDLE, 2) if ($OS_USED eq "Unix");
        }
    if ($method eq 'wrx') {
        open ($FILEHANDLE, ">$filename") or die "文件没有找到: $!";
        flock ($FILEHANDLE, 2) if ($OS_USED eq "Unix");
        }
    if ($method eq 'ap') {
        open ($FILEHANDLE, ">>$filename") or die "文件没有找到: $!";
        flock ($FILEHANDLE, 2) if ($OS_USED eq "Unix");
        }

    }

sub ipwhere {

    my $fromwhere = shift;    

    $datapath="$ikondir"."data";

    ($ip1,$ip2,$ip3,$ip4)=split(/\./,$fromwhere);
    $ips=$ip1*1000000000+$ip2*1000000+$ip3*1000+$ip4;

    $ip1=int($ip1);

    if (-f "$datapath/$ip1.txt") {
        $datafile=$datapath."/".$ip1.".txt";
    }
    else {
        $datafile=$datapath."/other.txt"; 
    }
    $from1='';
    $from2='';
    open(ipfile,"$datafile");
    @ipdata=<ipfile>;
    close(ipfile);
    for ($i=0;$i<@ipdata;$i++){
        ($ip1,$ip2,$from1,$from2)=split(/__/,$ipdata[$i]);
        ($ipa1,$ipa2,$ipa3,$ipa4)=split(/\./,$ip1);
        ($ipb1,$ipb2,$ipb3,$ipb4)=split(/\./,$ip2);
        $ipbegin =$ipa1*1000000000+$ipa2*1000000+$ipa3*1000+$ipa4;
        $ipend =$ipb1*1000000000+$ipb2*1000000+$ipb3*1000+$ipb4;

        if (($ips<=$ipend)&&($ips>=$ipbegin)) {
            last;
        }
    } 
    if ($from1 eq "") { $fromwhere="未知地区"; }
    else {$fromwhere="$from1$from2";}
    return $fromwhere;
    
}

# 计算用户操作系统类型
sub osinfo {
   local $os="",$Agent;
   $Agent = $ENV{'HTTP_USER_AGENT'};
   if (($Agent =~ /win/i)&&($Agent =~ /95/i)) {
      $os="Windows 95";
   }
   elsif (($Agent =~ /win 9x/i)&&($Agent =~ /4.90/i)) {
      $os="Windows ME";
   }
   elsif (($Agent =~ /win/i)&&($Agent =~ /98/i)) {
      $os="Windows 98";
   }
   elsif (($Agent =~ /win/i)&&($Agent =~ /nt 5/i)) {
      $os="Windows 2000";
   }
   elsif (($Agent =~ /win/i)&&($Agent =~ /nt/i)) {
      $os="Windows NT";
   }
   elsif (($Agent =~ /win/i)&&($Agent =~ /32/i)) {
      $os="Windows 32";
   }
   elsif ($Agent =~ /linux/i) {
      $os="Linux";
   }
   elsif ($Agent =~ /unix/i) {
      $os="Unix";
   }
   elsif (($Agent =~ /sun/i)&&($Agent =~ /os/i)) {
      $os="SunOS";
   }
   elsif (($Agent =~ /ibm/isg)&&($Agent =~ /os/isg)) {
      $os="IBM OS/2";
   }
   elsif (($Agent =~ /Mac/i)&&($Agent =~ /PC/i)) {
      $os="Macintosh";
   }
   elsif ($Agent =~ /FreeBSD/i) {
      $os="FreeBSD";
   }
   elsif ($Agent =~ /PowerPC/i) {
      $os="PowerPC";
   }
   elsif ($Agent =~ /AIX/i) {
      $os="AIX";
   }
   elsif ($Agent =~ /HPUX/i) {
      $os="HPUX";
   }
   elsif ($Agent =~ /NetBSD/i) {
      $os="NetBSD";
   }
   elsif ($Agent =~ /BSD/i) {
      $os="BSD";
   }
   elsif ($Agent =~ /OSF1/i) {
      $os="OSF1";
   }
   elsif ($Agent =~ /IRIX/i) {
      $os="IRIX";
   }
  $os = "Unknown"  if ($os eq '');
  return $os;
}

# 返回用户浏览器类型
sub browseinfo {
   local $browser="",$browserver="",@Browsers = ("Lynx","MOSAIC","AOL","Opera","JAVA","MacWeb","WebExplorer","OmniWeb"),$Agent,$Part;
   $Agent = $ENV{'HTTP_USER_AGENT'};
   for (@Browsers) {
      if ($Agent =~/$_/i) {
         $browser = $_;
         $browserver ="";
      }
   }
   if (($Agent =~ "Mozilla")&&($Agent !~ "MSIE")) {
      $Part =(split(/\(/, $Agent))[0];
      $browserver = (split(/\//, $Part))[1];
      $browserver = (split(/ /,$browserver))[0];
      $browserver =~ s/([\d\.]+)/$1/isg;
      $browserver = " $browserver";
      $browser = "Netscape Navigator";
   }
   if (($Agent =~ "Mozilla")&&($Agent =~ "Opera")) {
      $Part =(split(/\(/, $Agent))[1];
      $browserver = (split(/\)/, $Part))[1];
      $browserver = (split(/ /,$browserver))[2];
      $browserver =~ s/([\d\.]+)/$1/isg;
      $browserver = " $browserver";
      $browser = "Opera";
   }
   if (($Agent =~ "Mozilla")&&($Agent =~ "MSIE")) {
      $Part = (split(/\(/, $Agent))[1];
      $Part = (split(/\;/,$Part))[1];
      $browserver = (split(/ /,$Part))[2];
      $browserver =~ s/([\d\.]+)/$1/isg;
      $browserver = " $browserver";
      $browser = "Internet Explorer";
   }
  if ($browser ne '') {
      $browseinfo = "$browser$browserver";
  }
  else {
      $browseinfo = "Unknown";
  }
  return $browseinfo;
}

sub smilecode {
    my $post = shift;    
    $post = $post."\n";
    $post =~ s/\s\:\)\s/<img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\:\)\s/<img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\:\)\s/<br><img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\:-\)\s/<img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\:-\)\s/<img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\:-\)\s/<br><img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s8\)\s/<img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^8\)\s/<img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>8\)\s/<br><img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s8-\)\s/<img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^8-\)\s/<img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>8-\)\s/<br><img src=\"$imagesurl\/emoticons\/smile.gif\" border=\"0\" width=16 height=16>/isg;

    $post =~ s/\s\;\)\s/<img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\;\)\s/<img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\;\)\s/<br><img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\;P\s/<img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\;P\s/<img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\;P\s/<br><img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\;-\)\s/<img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\;-\)\s/<img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\;-\)\s/<br><img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\;-P\s/<img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\;-P\s/<img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\;-P\s/<br><img src=\"$imagesurl\/emoticons\/wink.gif\" border=\"0\" width=16 height=16>/isg;

    $post =~ s/\s\;\(\s/<img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\;\(\s/<img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\;\(\s/<br><img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\:\(\s/<img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\:\(\s/<img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\:\(\s/<br><img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\;-\(\s/<img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\;-\(\s/<img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\;-\(\s/<br><img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\:-\(\s/<img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\:-\(\s/<img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\:-\(\s/<br><img src=\"$imagesurl\/emoticons\/sad.gif\" border=\"0\" width=16 height=16>/isg;

    $post =~ s/\s\:-\?\s/<img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;
    $post =~ s/^\:-\?\s/<img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;
    $post =~ s/<br>\:-\?\s/<br><img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;
    $post =~ s/\s\?\:\(\s/<img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;
    $post =~ s/^\\?\:\(\s/<img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;
    $post =~ s/<br>\?\:\(\s/<br><img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;
    $post =~ s/\s\?\:-\(\s/<img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;
    $post =~ s/^\\?\:-\(\s/<img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;
    $post =~ s/<br>\?\:-\(\s/<br><img src=\"$imagesurl\/emoticons\/confused.gif\" border=\"0\" width=15 height=22>/isg;

    $post =~ s/\s\:D\s/<img src=\"$imagesurl\/emoticons\/biggrin.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\:D\s/<img src=\"$imagesurl\/emoticons\/biggrin.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\:D\s/<br><img src=\"$imagesurl\/emoticons\/biggrin.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\;D\s/<img src=\"$imagesurl\/emoticons\/biggrin.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\;D\s/<img src=\"$imagesurl\/emoticons\/biggrin.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/<br>\;D\s/<br><img src=\"$imagesurl\/emoticons\/biggrin.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/\s\:-D\s/<img src=\"$imagesurl\/emoticons\/biggrin.gif\" border=\"0\" width=16 height=16>/isg;
    $post =~ s/^\:-D\s/<img src=\"$imagesurl\/emoticons\/biggrin.gif\" border=\"0\" width=16 height=16>/isg;
    $post =

⌨️ 快捷键说明

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