suslik_s_gitaroy
Хомяк под кайфом | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору 123qaz74 Код: #!/usr/bin/perl ########################################################## # Ikonboard Active Topics # ########################################################## # Author: ST8 <st8@q3f.net> # # Date: 18 April 2001 # ########################################################## # Lists active threads from the day # ########################################################## 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 $CGI::HEADERS_ONCE = 1; # Kill redundant headers eval { ($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1"); ($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1"); require "ipban.cgi"; 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 }; 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(); print start_html(-title=>"Ikonboard Error!"); print "Could not find these files: $@\nIf you are running NT you may need to enter the full path in each require statement in each script"; print end_html; exit; } ########################################################## # Configuration # List all forums in this array that u wish to be checked for active topics my @fnumbers = (1,2,3,4,5,6,7,8,9,10,11); # Max Number of threads to display my $maxthreads = 100; # Summary View set to yes to only display an overview rather than entire thread (yes/no) my $summary = "yes"; ########################################################## my $q = new CGI; $action = $q->param("action"); $inmembername = cookie("amembernamecookie"); if ($inmembername eq "") { $inmembername = "Guest"; } &whosonline("$inmembername|Просматривает <a href=$boardurl/active.cgi>Активные темы</a>|none"); &title; $output .= qq~ <table cellpadding=3 cellspacing=1 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center> <tr bgcolor=#FEFDF1> <td align=left valign=top><b><font face="$font" color=$fontcolormisc size=$dfontsize2> <a href="$forumsummaryprog">$boardname</a></font></b><font face="verdana" color=#333333 size=2><b> » </b></font><font face="$font" color=$fontcolormisc size=$dfontsize2> Свежие $maxthreads тем за сегодня </td> </tr> </tr> </table> <br> <table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center> <tr> <td> <table cellpadding=3 cellspacing=1 border=0 width=100%> <tr> <td bgcolor=$menubackground width="45%"><font face="$font" color=$forumfontcolor size=2><center><b>Тема</b></center></td> <td bgcolor=$menubackground><font face="$font" color=$forumfontcolor size=2><center><b>Форум</b></center></td> <td bgcolor=$menubackground><font face="$font" color=$forumfontcolor size=2 colspan=3><center><b>Ответы</b></center></td> <td bgcolor=$menubackground><font face="$font" color=$forumfontcolor size=2 colspan=3><center><b>Автор</b></center></td> <td bgcolor=$menubackground><font face="$font" color=$forumfontcolor size=2 colspan=3><center><b>Обновление</b></center></td> </tr> ~; foreach $number (@fnumbers) { opendir(THREADS, "$ikondir/forum$number"); my @threads = readdir(THREADS); closedir(THREADS); @unsortedthreads = grep(/\w+.pl/, @threads); @thethreads = sort {$b <=> $a} @unsortedthreads; $maxt = $maxthreads; $tcount = 0; (my $sec,my $min,my $hour,my $day,my $month,my $year,my $wday,my $yday,my $isdst) = localtime(); foreach $thread (@thethreads) { $tcount++; if ($tcount < $maxt) { open(DETAILS,"$ikondir/forum$number/$thread"); $details = <DETAILS>; close(DETAILS); # 1|FlipCom Interface Script|Script to work with the Flipcom irc/icq program.|open|0|1|ST8|980109695|ST8|980109695 ($tno,$title,$desc,$status,$replies,$views,$poster,$postdate,$lastrep,$lastrepdate) = split(/\|/,$details); open(TDETAILS,"$ikondir/forum$number/$tno.thd"); $Tdetails = <TDETAILS>; close(TDETAILS); # ST8|FlipCom Interface Script|213.1.155.243|yes|yes|980109695|bleh ($user,$title,$ip,$smilies,$signature,$postdate,$thread) = split(/\|/,$Tdetails); ($trash,$trash,$trash,$postday,$postmonth,$postyear,$trash,$trash,$trash) = localtime($lastrepdate); if (($day eq $postday) && ($month eq $postmonth) && ($year eq $postyear)) { $gubbins = qq~$lastrepdate|$lastrep|$poster|$title|$desc|$thread|$postdate|$replies|$number|$tno~; push(@finishedthreads2, $gubbins); } } } } @finishedthreads2 = sort {$b <=> $a} @finishedthreads2; $maxout = $maxthreads; $toutcount = 0; foreach $outthread (@finishedthreads2) { $toutcount++; if ($toutcount < $maxout) { ($lastrepdate,$lastrep,$poster,$title,$desc,$thread,$postdate,$replies,$number,$tno) = split(/\|/,$outthread); $postdate = $postdate + ($timedifferencevalue*3600) + ($timezone*3600); $postdate = &dateformat("$postdate"); $lastrepdate = $lastrepdate + ($timedifferencevalue*3600) + ($timezone*3600); $lastrepdate = &dateformat("$lastrepdate"); &getforum("$number"); if ($desc) { $desc = qq~ »$desc~; }else{ $desc = qq~<br>~; } $output .= qq~ <tr> <td bgcolor=$forumcolortwo width="45%"><font face="$font" color=$forumfontcolor size=2><a href="$boardurl/topic.cgi?forum=$number&topic=$tno" target="_blank">$title</a><br><font size=1>$desc</font></td> <td bgcolor=$forumcolortwo width="15%"><font face="$font" color=$forumfontcolor size=1><a href="$boardurl/forums.cgi?forum=$number" target="_source"><center>$forumname</center></a></td> <td bgcolor=$forumcolortwo><font face="$font" color=$forumfontcolor size=2 colspan=3><center>$replies</center></td> <td bgcolor=$forumcolortwo><font face="$font" color=$forumfontcolor size=1 colspan=3><a href="$profileprog?action=show&member=$lastposter"><center>$lastrep</center></a></td> <td bgcolor=$forumcolortwo><font face="$font" color=$forumfontcolor size=1 colspan=3><center>$lastrepdate</center></td> </tr> ~; } } $output .= qq~ </table></td></tr></table> ~; print header(); &output( -Title => "$boardname - Активные темы", -ToPrint => $output, -Version => $versionnumber ); |
|