#!/usr/bin/perl use CGI qw(:standard); $query = new CGI; # use CGI::Carp qw(fatalsToBrowser); require('/httpd/htdocs/site.cfg'); @search_tips = ("Wpisz kilka słów, a wyszukiwarka znajdzie strony z każdym z nich", "Wpisz cze¶ć słowa, wtedy wyszukiwarka uwzględni także słowa zbliżone", "Nie używaj operatorów, jak w innych wyszukiwarkach", "Skorzystaj z zaawansowanego wyszukiwania, aby zawęzić wyniki"); &run_html; &header; &katalog_head; &search_tips; &last_searched; &get_nested; &print_nested; &stopka; exit; sub run_html { $style_home=<header( -type=>'text/html', -expires=>'2d+', -refresh=>'1800', -charset=>'iso-8859-2'); print "\n\n"; print $query->start_html( -TITLE=>' - Katalog Zielonej Bramy ', -AUTHOR=>$master_site, -META=>{'Version'=>'1.2', 'Generator'=>'Brain & Keyboard', 'Language'=>'PL', 'Robots'=>'index,follow'}, -style=>{-code=>$style_home}, -BGCOLOR=>'#e6e6e6', -TEXT=>'black', -LINK=>'#005A5A', -VLINK=>'#005A5A', -MARGINHEIGHT=>'0', -TOPMARGIN=>'0', -MARGINWIDTH=>'0', -LEFTMARGIN=>'0'); } sub header { print<
Poleca Wirtualna Polska mały zielony katalog internetu


nowo¶ci
prawo
przewodnik
interwencje
serwis info
organizacje
czasopisma
instytucje
szukaj
o serwerze

BRAMA

EOF } sub katalog_head { ############ WYSZUKIWARKA print< \n \n"; } sub get_nested { opendir(DIR, "./"); while ($nestdir = readdir(DIR)) { push(@nested,$nestdir) if -d $nestdir && $nestdir !~ /\./ && $nestdir ne "admin" && $nestdir ne "Nowe" && $nestdir ne ""; } closedir(DIR); # katalogi zagniezdzone } sub print_nested { if (@nested) { @nested = sort(@nested); print< --> EOF $counter = int($#nested/2); foreach $nested (@nested) { if ($count == 0) { print " \n"; } # else { print " \n \n"; } } print "\n
najnowsze  •   dodaj stronę  •   zaawansowane

EOF } ############# PODPOWIEDZI DO WYSZUKIWANIA sub search_tips { $tindex = rand @search_tips; print "
RADA: $search_tips[$tindex]
"; } ############# OSTATNIO SZUKANE sub last_searched { if (-e "$path_cgi/search/katalog_search.log") { open(LOG, "$path_cgi/search/katalog_search.log"); my @log = ; close(LOG); $_ = pop(@log); chomp; my ($czas,$modul,$keys) = split(/\|/,$_); print "

ostatnio szukane:\n "; print "$keys\n"; } else { print "$!"; } print "

\n". "


\n"; } } ############# KONIEC TABEL I STRONY sub stopka { print<
główna | nowo¶ci | poradnik | przewodnik | interwencje | instytucje | organizacje | czasopisma
Wydrukowano na ekranie z makulatury
 
stat4u
EOF } sub check_nested { my @subdirs; opendir(DIR, $_[0]); while ($_ = readdir(DIR)) { if (-d "$_[0]/$_" && $_ !~ /\./ && $_ !~ "admin") { push(@subdirs,$_) } else {} } closedir(DIR); return @subdirs; }