#!/usr/bin/perl use DBI; use CGI::Carp qw(fatalsToBrowser); use lib "./packages"; require "./packages/local.pm"; use arrays qw{@SSI_FILES}; use requests qw{%Request_}; print "Content-type: text/html; charset=utf-8\n\n"; my $PPPC=$Request_{'p'}; my $CountRating=0; &UpdateRatings; sub UpdateRatings { $host=$Local::local_host; $database=$Local::local_database; $user=$Local::local_user; $password=$Local::local_password; $dbh = DBI->connect("DBI:mysql:$database;$host:3306", $user, $password); $statement="SELECT count FROM rating where id=$PPPC"; $sth = $dbh->prepare($statement); $sth->execute(); my $table = $sth->fetchall_arrayref ; if($table->[0][0]>0) { $CountRating=$table->[0][0]; $CountRating +=1; &UpdateRating; } else { &InsertRating; $CountRating=1; } my($i, $j); my $count=0; my $color="forumRow"; } sub UpdateRating { $host=$Local::local_host; $database=$Local::local_database; $user=$Local::local_user; $password=$Local::local_password; $dbh = DBI->connect("DBI:mysql:$database;$host:3306", $user, $password); $new_id = $sth->{insertid}; $statement="update rating set count=$CountRating where id=$PPPC"; $rv = $dbh->do($statement) ; } sub InsertRating { $host=$Local::local_host; $database=$Local::local_database; $user=$Local::local_user; $password=$Local::local_password; $dbh = DBI->connect("DBI:mysql:$database;$host:3306", $user, $password); $new_id = $sth->{insertid}; $statement="insert into rating (id,count) values ($PPPC,1)"; $rv = $dbh->do($statement) ; } 1; #!/usr/bin/perl use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); package interface; use tree_draw qw(&InterMenu1 &InterMenu2 &InterMenu0); use tree_globals qw{&InterChangePlusMinus}; use arrays qw{@Level_01}; use rating qw{$RatingContent}; use requests qw{%Request_}; use POSIX qw(setlocale LC_ALL LC_CTYPE LC_NUMERIC); setlocale(LC_CTYPE, 'ru_RU.UTF-8'); print "Content-type: text/html; charset=utf-8\n\n"; $InterfacePathInfo=""; $PinHref=""; $radio_search1=" checked=yes "; $radio_search2=""; $InterfacePathInfo = $ENV{'PATH_INFO'}; if ($Request_{'radio_search'} eq "1"){ $radio_search1=" checked=yes ";$radio_search2="";} if ($Request_{'radio_search'} eq "2"){ $radio_search2=" checked=yes ";$radio_search1="";} $search2_value = $Request_{'search2'}; if (($Request_{'m'} eq '') and ($Request_{'p'} eq '')){ InterfaceWithMenu() } elsif ($Request_{'m'} eq "1"){ InterfaceWithMenu()} else{ InterfaceWithoutMenu()} sub InterfaceHeader { if ($Request_{'l1'} ne '') {$PinHref="$PinHref&l1=$Request_{'l1'}";} print ""; print ""; print ""; print "
"; print ""; print ""; print ""; print ""; print ""; print "
"; print ""; print ""; print ""; print ""; print " "; print "
"; print " "; ####################################### SEARCH FORM ############################## print "\n"; print "\n"; print "\n
"; print "\n
"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print ""; print "
Search    or:". "    and:". "
"; print "
"; print "
"; print "
"; print ""; print "\n"; InterfaceHeader2(); print "\n"; } sub InterfaceWithMenu { ShowPinguinWithMenu(); InterChangePlusMinus($Request_{'p'}); InterfaceHeader(); print " \n"; } sub InterfaceHeader2() { print "
"; ################################## MENU ################################### print ""; print ""; print "
"; print ""; print ""; print "
"; print ""; print "\n"; print "
 www.iakovlev.org 
"; print ""; if ($Request_{'l1'} eq '') {InterMenu0($Request_{'p'});} elsif ($Request_{'l1'} eq '1') {InterMenu1($Request_{'p'});} else {InterMenu2($Request_{'p'},$Request_{'l1'});} print "
"; print "
"; print "
"; ############################### NEWS ######################################## print "
"; print "
"; print ""; print ""; print "
"; print ""; print ""; print "
"; print ""; print "\n"; print "
NEWS
"; print ""; print ""; print "
"; print ""; print ""; print "
"; print "Последние статьи :"; print "
"; print "
"; @NNEWS=( ["p=1431&m=1&l1=4","SQL","30.07"], ["p=999&m=1&l1=3","JFS","10.06"], ["p=998&m=1&l1=3","B-trees","01.06"], ["p=997&m=1&l1=3","BTRFS","27.05"], ["p=996&m=1&l1=3","BFS","26.05"], ["p=659&t=0&m=1&l1=6","Test Python","12.10"], ["p=579&m=1&l1=2","Twisted","10.10"], ["p=578&m=1&l1=2","Django","01.10"], ["p=2292&m=1&l1=2","Pusher","14.09"], ["p=658&t=0&m=1&l1=6","Test Kernel","14.08"], ); local $count=1; foreach $nnews (@NNEWS) { print ""; print ""; print "
"; print ""; if(($count == 5 ) or ($count == 9 ) or ($count == 10) ) { print ""; } else { print ""; } print ""; print "
  $nnews->[1]   $nnews->[1] $nnews->[2]   
"; print "
"; $count++; } print ""; print ""; print "
"; print ""; print ""; print "
 
"; print "
"; print "
"; print "
"; ############################### TOP 10 ######################################## print "
"; print ""; print ""; print "
"; print ""; print ""; print "
"; print ""; print "\n"; print "
TOP 10
"; print "$RatingContent"; print ""; print ""; print "
"; print ""; print ""; print "
 
"; print "
"; print "
"; print "
"; ############################### STAT ######################################## print " "; print " "; print "
"; print " "; print " "; print "
"; print "  01.01.2010 : 500000 visitors "; print "
"; print "
"; print "
"; local $count=1; local $color="tableBorderLeft"; foreach $level (@Level_01) { $color="tableBorderLeft"; if ($count==$Request_{'l1'}) {$color="tableBorderGreen";} print ""; $count++; } print "
"; print ""; print ""; print "
"; print "[2]\" style='color:#023f6e;'> $level->[1] "; print "
"; print "
"; } sub InterfaceWithoutMenu { ShowPinguinWithoutMenu(); InterfaceHeader(); } sub ShowPinguinWithMenu { if ($Request_{'f'} ne ''){$PinHref="forum.html?p=$Request_{'p'}\&f=1";} elsif ($Request_{'t'} ne ''){$PinHref="test.html?p=$Request_{'p'}\&t=$Request_{'t'}";} elsif ($Request_{'k'} ne ''){$PinHref="kernel_0.01.html?k=$Request_{'k'}\&p=333";} elsif ($Request_{'l1'} ne '') { if (($Request_{'l1'} eq '8') and ($Request_{'l1'} ne '')) {$PinHref="forum.html?p=$Request_{'p'}\&f=1&l1=$Request_{'l1'}";} elsif ($Request_{'l1'} eq '6') {$PinHref="index.html?p=$Request_{'p'}\&l1=$Request_{'l1'}";} else { {$PinHref="index.html?p=$Request_{'p'}\&l1=$Request_{'l1'}";} } } elsif ($Request_{'text_search2'} eq '') { if ($Request_{'p'} ne ''){$PinHref="index.html?p=$Request_{'p'}";} else{$PinHref="index.html";} } else {$PinHref="search.html?text_search2=$Request_{'text_search2'}";} } sub ShowPinguinWithoutMenu { if ($Request_{'f'} ne '') {$PinHref="forum.html?p=$Request_{'p'}\&f=1&m=1";} elsif ($Request_{'t'} ne '') { if ($Request_{'l1'} ne '') {$PinHref="test.html?p=$Request_{'p'}\&t=$Request_{'t'}&l1=$Request_{'l1'}";} else {$PinHref="index.html";} } elsif ($Request_{'k'} ne ''){$PinHref="kernel_0.01.html?k=$Request_{'k'}\&m=1&p=333";} elsif ($Request_{'text_search2'} eq "") { if ($Request_{'p'} ne ""){$PinHref="index.html?p=$Request_{'p'}\&m=1";} else{$PinHref="index.html?m=1";} } else {$PinHref="search.html?text_search2=$Request_{'text_search2'}\&m=1";} } #style='color:#023f6e;' 1; ";} if (($input eq 'l1=7')or ($input eq 'p=&l1=7&l1=7')) {print "";} if (($input eq 'l1=8')or ($input eq 'p=&f=1&l1=8&l1=8')) {print "";} foreach $f (@SSI_FILES) { if ( ($f->[0] eq "p=$InterfaceParamP") or ($f->[0] eq $input) or ("$f->[0]\&m=1" eq $input) ) { open(SOMEFILE,"$Local::local_ssi$f->[1]") or die; @variable = ; close(SOMEFILE); print "@variable"; if ($f->[2] ne "") { require "comments.pl";} last; } } if ($input eq 'p=12345qwert') { require "comments_stat.pl"; } if ($input eq 'p=12345qwerty') { require "comments_stat.pl"; } 1;
www.iakovlev.org
";} if (($input eq 'l1=2')or ($input eq 'p=&l1=2&l1=2')) {print "";} if (($input eq 'l1=3')or ($input eq 'p=&l1=3&l1=3')) {print "";} if (($input eq 'l1=4')or ($input eq 'p=&l1=4&l1=4')) {print "";} if (($input eq 'l1=5')or ($input eq 'p=&l1=5&l1=5')) # Books { print "
#!/usr/bin/perl use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use lib './packages' ; use arrays qw{@SSI_FILES}; require "./packages/local.pm"; $InterfaceParamMenu=""; $InterfaceParamL1=""; $InterfaceParamP=""; print "Content-type: text/html; charset=windows-1251\n\n"; my $input = $ENV{'QUERY_STRING'} if $ENV{'QUERY_STRING'}; if (($ENV{'QUERY_STRING_UNESCAPED'}) && ($input eq '')) { $input = $ENV{'QUERY_STRING_UNESCAPED'}; $input =~ s/\\&/\&/g; } if ($input =~ /=/g) { my @pairs = split(/&/, $input); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $in{$name} = $value; if ($name eq "m") {$InterfaceParamMenu=$value;} if ($name eq "l1") {$InterfaceParamL1=$value;} if ($name eq "p") {$InterfaceParamP=$value;} } } if (($input eq 'l1=1')or ($input eq 'p=&l1=1&l1=1')) {print "

Linux

Language

Kernel

Package

Book

"; $my_file ="$Local::local_ssi"."template/Book/about.html"; open(SOMEFILE,"$my_file") or die; @variable = ; close(SOMEFILE); print "@variable"; } if (($input eq 'l1=6')or ($input eq 'p=&l1=6&l1=6')) {print "

Test

Operation System

Forum