#!/usr/local/bin/perl ######################################################### # # # Go2! Search # # # ######################################################### # # # search.pl # # # # If needed, change the paths to the required files # # below. Upload in ASCII and CHMOD this script 755. # # # # If you have any further questions, direct them to # # the support forum at http://www.go2cgi.com/ # # # ######################################################### # # # Copyright © 1999 W. Dustin Alligood # # # ######################################################### require "/http/cgi-bin/dfrench/text/config.txt"; require "/http/cgi-bin/dfrench/text/text.txt"; require "/http/cgi-bin/dfrench/text/plugins.txt"; # Change nothing below this line ######################################################### $adultwords=~s/, ?/\|/gi; @cats=split(/}{/,$cats); if($ENV{'QUERY_STRING'} ne ''){ $buffer=$ENV{'QUERY_STRING'}; }else{ read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } @pairs=split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value)=split(/=/,$pair); $value =~ tr/+/ /; $value=~s/%25spa%25/%spa%/gi; $value=~s/%25amp%25/%amp%/gi; $value=~s/%25pip%25/%pip%/gi; $value=~s/%3A/:/gi; $value=~s/%2F/\//gi; $value=~s/%20/ /; $value=~s/%2B/\+/gi; $value=~s/%28/\(/gi; $value=~s/%29/\)/gi; $value=~s/%DF/ß/gi; $value=~s/%FC/ü/gi; $value=~s/%F6/ö/gi; $value=~s/%EB/ë/gi; $value=~s/%E4/ä/gi; $value=~s/%D6/Ö/gi; $value=~s/%DC/Ü/gi; $value=~s/%CB/Ë/gi; $value=~s/%C4/Ä/gi; $value=~s/%A2/¢/gi; $value=~s/%24/\$/gi; $value=~s/%2C/,/gi; $value=~s/%7C/\|/gi; $value=~s/%26/\&/gi; $value=~s/%7E/~/gi; $value=~s/%21/!/gi; $f{$name}=$value; } if($f{'action'} eq 'addurl'){ &AddURL; }elsif($f{'action'} eq 'rate'){ &Rate1; }elsif($f{'action'} eq 'powersearch'){ &Powersearch; }elsif($f{'action'} eq 'parsesearch'){ &Parsesearch; }elsif($f{'action'} eq 'rate2'){ &Rate2; }elsif($f{'action'} eq 'search'){ &Search; }elsif($f{'action'} eq 'spider'){ &Spider; }elsif($f{'action'} eq 'spider_noemail'){ &Spider_noemail; }elsif($f{'action'} eq 'cat'){ &BrowseCat; }elsif($f{'action'} eq 'click'){ &URLClick; }elsif($f{'action'} eq 'homeclick'){ &HomeClick; }elsif($f{'action'} eq 'showreframe'){ &ShowReFrame; }elsif($f{'action'} eq 'tips'){ &ShowTips; }else{ &HomePage; } sub HomePage{ &Plugin('homepage'); open(FILE,"<$home"); flock(FILE,2); @data=; close(FILE); $text{'searchbox'} =""; $text{'searchbox'}.="
"; $text{'searchbox'}.="\n"; if($famdefault eq "yes"){ $text{'searchbox'}.="\n"; }else{ $text{'searchbox'}.="\n"; } $text{'searchbox'}.="\n"; $text{'searchbox'}.=" "; $text{'searchbox'}.=" 
\n"; $text{'searchbox'}.=""; $text{'searchbox'}.=""; $text{'searchbox'}.="$link{'powersearch'} | "; if($adminadd ne 'yes'){ $text{'searchbox'}.="$link{'addurl'} | "; } $text{'searchbox'}.=""; $text{'searchbox'}.=""; $text{'searchbox'}.="$link{'tips'}\n"; $text{'searchbox'}.="
\n"; use LWP::Simple; $doc = get "http://abcnews.go.com/"; @abc=split(/\n/,$doc); $rcd=0; $news=""; foreach $line (@abc){ $ft=substr "$line","",7; if($rcd==1){ if($line!~/font/){ if($ft ne '/$text{'searchbox'}/gi; $line=~s//$text{'lastsub'}/gi; $line=~s//$text{'abcnews'}/gi; $line=~s//$text{'catlink'}/gi; print "$line\n"; } } sub Parsesearch{ if($f{'type'} eq 'phrase'){ $term="($f{'phrase'}) "; }else{ for($i=0;$i<10;$i++){ if($f{"term$i"} ne ""){ $term.=$f{"cas$i"}; $term.=$f{"term$i"}; $term.=" "; } } } if($f{'case'} eq "sensitive"){ $c="sen"; }else{ $c="in"; } if($f{'unfiltered'} eq "yes"){ $a="no"; }else{ $a="yes"; } if($f{'fivestar'} eq "yes"){ $f="yes"; }else{ $f="no"; } chomp($term); chop($term); $term=~s/%spa%/%25spa%25/gi; $term=~s/%amp%/%25amp%25/gi; $term=~s/%pip%/%25pip%25/gi; $term=~s/:/%3A/gi; $term=~s/\//%2F/gi; $term=~s/\+/%2B/gi; $term=~s/ /\+/gi; $term=~s/\(/%28/gi; $term=~s/\)/%29/gi; $term=~s/ß/%DF/gi; $term=~s/ü/%FC/gi; $term=~s/ö/%F6/gi; $term=~s/ë/%EB/gi; $term=~s/ä/%E4/gi; $term=~s/Ö/%D6/gi; $term=~s/Ü/%DC/gi; $term=~s/Ë/%CB/gi; $term=~s/Ä/%C4/gi; $term=~s/¢/%A2/gi; $term=~s/\$/%24/gi; $term=~s/,/%2C/gi; $term=~s/~/%7E/gi; $term=~s/\?/%3F/gi; print "Location:$script?action=search&terms=$term&case=$c&unfiltered=$a&fivestar=$f\n\n"; } sub Powersearch{ print "Content-type: text/html\n\n"; $|++; print "$title: $title{'powersearch'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$text{'powersearch'} < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'powersearch'}
\n"; print "\n"; print "
\n"; print "

\n"; print "
"; print "\n"; print "\n"; print "$text{'phrase'}
\n"; print "
\n"; print "

$text{'case'}

\n"; if($familysafe eq "yes"){ print "

$text{'famsearch'}

\n"; } if($fivestar eq "yes"){ print "

$text{'fivestar'}

\n"; } print "

\n"; print "\n"; print "\n"; print "$text{'constraints'}
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print " \n"; print "

\n"; print "

\n"; $bottombar="$title{'home'} > $text{'powersearch'}"; &BottomBar; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; } sub ShowTips{ print "Content-type: text/html\n\n"; $|++; print "$title: $title{'tips'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$title{'tips'} < $title{'home'}"; &TopBar; &Banner('general'); print "\n"; print "

$window{'tips'}
\n"; print "\n"; print "
\n"; print "$text{'tips'}\n"; print "
\n"; print "

\n"; $bottombar="$title{'home'} > $title{'tips'}"; &BottomBar; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; } sub Search{ print "Content-type: text/html\n\n"; $|++; $terms=$f{'terms'}; $terms=~s/%(..)/pack("c",hex($1))/ge; $entered=$terms; if($terms eq ''){ print "$title\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="Error < $title{'home'}"; &TopBar; &Banner('general'); print "

$window{'error'}
\n"; print "
\n"; print "No search terms entered"; print "

\n"; $bottombar="$title{'home'} > Error"; &BottomBar; print "\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } if($terms eq '+'){ print "$title\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="Error < $title{'home'}"; &TopBar; &Banner('general'); print "

$window{'error'}
\n"; print "
\n"; print "No search terms entered"; print "

\n"; $bottombar="$title{'home'} > Error"; &BottomBar; print "\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } if($terms eq '-'){ print "$title\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="Error < $title{'home'}"; &TopBar; &Banner('general'); print "

$window{'error'}
\n"; print "
\n"; print "No search terms entered"; print "

\n"; $bottombar="$title{'home'} > Error"; &BottomBar; print "\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } if($terms eq '()'){ print "$title\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="Error < $title{'home'}"; &TopBar; &Banner('general'); print "

$window{'error'}
\n"; print "
\n"; print "No search terms entered"; print "

\n"; $bottombar="$title{'home'} > Error"; &BottomBar; print "\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } if($terms eq '|'){ print "$title\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="Error < $title{'home'}"; &TopBar; &Banner('general'); print "

$window{'error'}
\n"; print "
\n"; print "No search terms entered"; print "

\n"; $bottombar="$title{'home'} > Error"; &BottomBar; print "\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } $limit=$f{'limit'}; $case=$f{'case'}; $amt=$f{'amt'}; $terms=~s/ AND / \+/gi; $terms=~s/ NOT / \-/gi; $terms=~s/ OR /\|/gi; $terms=~s/::/;;/g; if($terms=~/\(.*\)/i){ my ($proc1, $proc2, $proc3); $proc1 = "::" . $terms . "::"; $proc1 =~s/-\(/::-\(/g; $proc1 =~s/\+\(/::\+\(/g; $proc1 =~s/\s\(/::\+\(/g; $proc1 =~s/\)/\)::/g; @proc2 = split(/::/, $proc1); $terms = ''; foreach $proc3 (@proc2) { $proc3=~s/ /::/g if (!($proc3=~/\(.*\)/i)); $terms = $terms . $proc3; } } else { $terms=~s/ /::/g; } if(($terms!~/\+/g)&&($terms!~/\-/g)){ $terms=~s/ / \+/g; } $first=substr "$terms","",1; if(($first ne '+')&&($first ne '-')){ $terms="+$terms"; } @terms=split(/::/,$terms); $terms =~s/::/ /g; $terms=~s/;;/::/g; foreach $item (@terms){ $item=~s/;;/::/g; if($item=~/^\-/){ $item=~s/^\-//i; $item=~s/^\+//i; push(@not,$item); }else{ $item=~s/^\-//i; $item=~s/^\+//i; push(@and,$item); } } @categories=split(/}{/,$cats); foreach $category (@categories){ $category=~s/ /%spa%/gi; $category=~s/\&/%amp%/gi; $category=~s/\|/%pip%/gi; ($base,$subs)=split(/%pip%/,$category); @subdirs=split(/,/,$subs); open(FILE,"<$data/data_$base.txt"); flock(FILE,2); @data=; close(FILE); foreach $line (@data){ chomp($line); push(@rawdata,$line); } foreach $sub (@subdirs){ open(FILE,"<$data/data_$base%pip%$sub.txt"); flock(FILE,2); @data=; close(FILE); foreach $line (@data){ chomp($line); push(@rawdata,$line); } } } foreach $line (@rawdata){ ($clicks,$url,$stitle,$desc,$keys,$cat,$rate,$votes,$junk)=split(/}{/,$line); $searchdata="$url $stitle $desc $keys $cat"; (@and) ? $include=0 : $include=1; foreach $and (@and){ if($case eq "sen"){ if($searchdata=~/$and/){ $include=1; }else{ $include=0; last; } }else{ if ($searchdata=~/$and/i) { $include=1; } else { $include=0; last; } } } foreach $not (@not){ if($case eq "sen"){ if($searchdata=~/$not/){ $include=0; last; } }else{ if($searchdata=~/$not/i){ $include=0; last; } } } if($f{'unfiltered'} eq 'no'){ if($searchdata=~/$adultwords/i){ $include=0; } } if($f{'fivestar'} eq 'yes'){ if(($rate!=0)&&($votes!=0)){ if(int($rate/$votes)<5){ $include=0; } }else{ $include=0; } } if($include==1){ push(@results,$line); } } @results=sort{$b <=> $a}(@results); $matchnum=$#results+1; $text{'matches'}=~s/##/$matchnum/; unshift(@results,$text{'matches'}); &Plugin('search'); $termshref=$terms; $termshref=~s/\+/%2B/gi; $termshref=~s/ /\+/gi; $tterms=$terms; $tterms=~s/\|/ > /gi; print "$title: Search For: \"$entered\"\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="\"$entered\" < $text{'searchfor'} < $title{'home'}"; &TopBar; if($searchagain eq "yes"){ print "
\n"; if($famdefault eq "yes"){ print "\n"; }else{ print "\n"; } print "\n"; print "\n"; if($wirwide eq "yes"){ print "

\n"; print "
$text{'swr'}
$text{'ns'}

\n"; }else{ print "

\n"; print "
$text{'swr'}
$text{'ns'}

\n"; } } &Banner("$terms"); print "
"; if($amt<0){ $amt=0; } if($amt>$#results){ $amt=$#results; } $a2=$amt+10; $a1=$amt; if($a1<0){ $a1=0; } $sitefound=0; for($i=$a1;$i<$a2;$i++){ if(@results[$i]=~/}{/gi){ ($clicks,$url,$stitle,$desc,$keys,$category,$rate,$votes,$junk)=split(/}{/,@results[$i]); $url=~s/%(..)/pack("c",hex($1))/ge; $stitle=~s/%(..)/pack("c",hex($1))/ge; $desc=~s/%(..)/pack("c",hex($1))/ge; $keys=~s/%(..)/pack("c",hex($1))/ge; if(length($stitle)>$titletrunc){ $stitle=substr "$stitle","",$titletrunc-3; $stitle.="..."; } if(length($url)>$urltrunc){ $surl=substr "$url","",$urltrunc-3; $surl.="..."; }else{ $surl=$url; } if(length($desc)==$desclength){ $desc.="..."; } $cathref=$category; $cathref=~s/ /%spa%/gi; $cathref=~s/\&/%amp%/gi; $cathref=~s/\|/%pip%/gi; $category=~s/%spa%/ /gi; $category=~s/%amp%/\&/gi; $category=~s/%pip%/\|/gi; $sitefound++; if(($rez_cat eq "yes")||($rez_rate eq "yes")){ print "
  • "; print "
    $stitle"; if($rez_rate eq "yes"){ if(($rate==0)||($votes==0)){ $rating=0; }else{ $rating=int($rate/$votes); if($rating>5){ $rating=5; } } if($rating!=0){ for($n=0;$n<$rating;$n++){ print " $text{'ratesymbol'}"; } } print "$text{'ratesep'}$text{'rate'}"; } print "
    $desc
    $surl"; if($rez_cat eq "yes"){ $category=~s/\|/ > /gi; print "$category"; $category=~s/ > /\|/gi; } if($entryextra eq "yes"){ $ln=$extrahref; $ln=~s//$url/gi; if($rez_cat eq "yes"){ print " | "; } print "$extralink"; } print "
"; }else{ print ""; } }else{ print "@results[$i]\n"; } } if($sitefound==0){ print "$text{'nomatch'}\n"; } if($#results>9){ $pg=0; $pages=""; for($i=0;$i<=$#results;$i=$i+10){ $pg++; if($pg-1==int($amt/10)){ $last=$i-10; $next=$i+10; $pages.=" $pg |"; }else{ $pages.=" $pg |"; } } chop($pages); print "

"; if($pagenumbers ne "yes"){ print "\n"; } if(int($amt/10)!=0){ $pages=" << Last |$pages"; if($pagenumbers ne "yes"){ print ""; } } if($amt+10<=$#results){ $pages.="| Next >> "; if($pagenumbers ne "yes"){ print ""; } } if($pagenumbers eq "yes"){ print "$text{'page'}   $pages

\n"; }else{ print "
\n"; } } print "\n"; print "
\n"; $cdbooklink=$entered; $cdbookhref=$entered; $cdbookhref=~s/\+/%2B/gi; $cdbookhref=~s/ /\%20/gi; $cdbookhref=~s/\&/%26/gi; if($affiliates==2){ if($showamazon eq 'yes'){ print "
\n"; print "Books about:
\n"; print "$cdbooklink
\n"; print "

 
\n"; } if($showcdnow eq 'yes'){ print "
\n"; print "CDs about:
\n"; print "$cdbooklink
\n"; print "
\n"; } }else{ if($showamazon eq 'yes'){ print "

\n"; print "\n"; print "
\n"; print "Amazon.$amaex
\n"; print "
\n"; print "\n"; print "Books about:
\n"; print "$cdbooklink
\n"; print "
\n"; print "

\n"; } if($showcdnow eq 'yes'){ print "

\n"; print "\n"; print "
\n"; print "CDNow.com
\n"; print "
\n"; print "\n"; print "CDs about:
\n"; print "$cdbooklink
\n"; print "
\n"; print "

\n"; } } print "
 
\n"; $remotehref=$entered; $remotehref=~s/\+/%2B/gi; $remotehref=~s/ /\+/gi; $remotehref=~s/\&/%26/gi; $yahoohref=$entered; $yahoohref=~s/\(/%22/gi; $yahoohref=~s/\)/%22/gi; $yahoohref=~s/\+/%2B/gi; $yahoohref=~s/ /\+/gi; $yahoohref=~s/\&/%26/gi; if($showremote eq "yes"){ print "

$text{'remotesearch'}
AltaVista | \n"; print "AOL Search | \n"; print "Amazon.com | \n"; print "DejaNews | \n"; print "Direct Hit | \n"; print "Dogpile | \n"; print "EuroSeek | \n"; print "Excite
\n"; print "Fast Search | \n"; print "Google | \n"; print "GoTo | \n"; print "HotBot | \n"; print "Infind | \n"; print "Infoseek | \n"; print "LookSmart | \n"; print "Lycos | \n"; print "MetaCrawler
\n"; print "Netscape Search | \n"; print "Snap | \n"; print "Northern Light | \n"; print "WebCrawler | \n"; print "Webtop | \n"; print "Yahoo

\n"; } $bottombar="$title{'home'} > $text{'searchfor'} > \"$entered\""; &BottomBar; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; } sub Rate2{ $url=$f{'url'}; $url=~s/%(..)/pack("c",hex($1))/ge; $category=$f{'cat'}; chomp($category); open(FILE,"<$data/data_$category.txt"); flock(FILE,2); @data=; close(FILE); $category=~s/%spa%/ /gi; $category=~s/%amp%/\&/gi; $category=~s/%pip%/\|/gi; foreach $item (@data){ @splt=split(/}{/,$item); $uls=@splt[1]; $uls=~s/%(..)/pack("c",hex($1))/ge; chomp($uls); chomp($url); if($url eq $uls){ ($clicks,$url,$stitle,$desc,$keys,$cat,$rate,$votes,$junk)=split(/}{/,$item); $url=~s/%(..)/pack("c",hex($1))/ge; $stitle=~s/%(..)/pack("c",hex($1))/ge; $desc=~s/%(..)/pack("c",hex($1))/ge; $keys=~s/%(..)/pack("c",hex($1))/ge; if(length($stitle)>$titletrunc){ $stitle=substr "$stitle","",$titletrunc-3; $stitle.="..."; } if(length($url)>$urltrunc){ $surl=substr "$url","",$urltrunc-3; $surl.="..."; }else{ $surl=$url; } if(length($desc)==$desclength){ $desc.="..."; } $votes++; $rate=$rate+$f{'rating'}; $item="$clicks}{$url}{$stitle}{$desc}{$keys}{$cat}{$rate}{$votes"; $item=~s/\n//gi; } chomp($item); push(@newdata,"$item\n"); } open(FILE,">$data/data_$f{'cat'}.txt"); flock(FILE,2); foreach $line (@newdata){ chomp($line); print FILE "$line\n"; } close(FILE); print "Content-type: text/html\n\n"; $|++; print "$title: $text{'rate'} $url\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$text{'rate'} $url < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'rateurl'}
\n"; print "\n"; print "
\n"; print "

"; if(($rez_cat eq "yes")||($rez_rate eq "yes")){ print "
  • \n"; print "
    $stitle"; if($rez_rate eq "yes"){ if(($rate==0)||($votes==0)){ $rating=1; }else{ $rating=int($rate/$votes); if($rating>5){ $rating=5; } } if($rating!=0){ for($n=0;$n<$rating;$n++){ print " $text{'ratesymbol'}"; } } print "$text{'ratesep'}$text{'rate'}"; } print "
    $desc
    $url"; if($rez_cat eq "yes"){ $category=~s/\|/ > /gi; print "$category"; } if($entryextra eq "yes"){ $ln=$extrahref; $ln=~s//$url/gi; if($rez_cat eq "yes"){ print " | "; } print "$extralink"; } print "
"; }else{ print "\n"; } print "

$text{'thanksrate'}

\n"; print "

\n"; print "

\n"; $bottombar="$title{'home'} > $text{'rate'} $url"; &BottomBar; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; } sub Rate1{ $url=$f{'url'}; $url=~s/%(..)/pack("c",hex($1))/ge; $category=$f{'cat'}; chomp($category); &Plugin('rate'); open(FILE,"<$data/data_$category.txt"); flock(FILE,2); @data=; close(FILE); $category=~s/%spa%/ /gi; $category=~s/%amp%/\&/gi; $category=~s/%pip%/\|/gi; foreach $item (@data){ @splt=split(/}{/,$item); $uls=@splt[1]; $uls=~s/%(..)/pack("c",hex($1))/ge; chomp($uls); chomp($url); if($url eq $uls){ ($clicks,$url,$stitle,$desc,$keys,$cat,$rate,$votes,$junk)=split(/}{/,$item); $url=~s/%(..)/pack("c",hex($1))/ge; $stitle=~s/%(..)/pack("c",hex($1))/ge; $desc=~s/%(..)/pack("c",hex($1))/ge; $keys=~s/%(..)/pack("c",hex($1))/ge; if(length($stitle)>$titletrunc){ $stitle=substr "$stitle","",$titletrunc-3; $stitle.="..."; } if(length($url)>$urltrunc){ $surl=substr "$url","",$urltrunc-3; $surl.="..."; }else{ $surl=$url; } if(length($desc)==$desclength){ $desc.="..."; } } } print "Content-type: text/html\n\n"; $|++; print "$title: $text{'rate'} $url\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$text{'rate'} $url < $title{'home'}"; &TopBar; &Banner('general'); print "\n"; print "

$window{'rateurl'}
\n"; print "\n"; print "
\n"; print "

"; if(($rez_cat eq "yes")||($rez_rate eq "yes")){ print "
  • \n"; print "
    $stitle"; if($rez_rate eq "yes"){ if(($rate==0)||($votes==0)){ $rating=0; }else{ $rating=int($rate/$votes); if($rating>5){ $rating=5; } } if($rating!=0){ for($n=0;$n<$rating;$n++){ print " $text{'ratesymbol'}"; } } print "$text{'ratesep'}$text{'rate'}"; } print "
    $desc
    $surl"; if($rez_cat eq "yes"){ $category=~s/\|/ > /gi; print "$category"; } if($entryextra eq "yes"){ $ln=$extrahref; $ln=~s//$url/gi; if($rez_cat eq "yes"){ print " | "; } print "$extralink"; } print "
"; }else{ print "\n"; } print "

\n"; print "

"; print "\n"; print ""; print ""; print "

\n"; print "

\n"; $bottombar="$title{'home'} > $text{'rate'} $url"; &BottomBar; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; } sub BrowseCat{ &Plugin('browsecat'); $category=$f{'name'}; $amt=$f{'amt'}; $cathref=$category; $category=~s/%spa%/ /gi; $category=~s/%amp%/\&/gi; $category=~s/%pip%/\|/gi; if($category=~/\|/){ $issubcat="yes"; } @categories=split(/}{/,$cats); @catsdescs=split(/}{/,$catdesc); print "Content-type: text/html\n\n"; $|++; $tcategory=$category; $tcategory=~s/\|/: /gi; print "$title: $tcategory\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; if($issubcat ne "yes"){ $topbar="$category < $title{'home'}"; }else{ ($backcat,$thissub)=split(/\|/,$category); ($backcathref,$thissubhref)=split(/%pip%/,$cathref); $topbar="$thissub < $backcat < $title{'home'}"; } &TopBar; &Banner("$category"); print "
"; open(FILE,"<$data/data_$cathref.txt"); flock(FILE,2); @data=; close(FILE); sort(@data); &Plugin('category'); $c1=-1; $webcount=$#data+1; $text{'websites'}=~s/##/$webcount/gi; unshift(@data,$text{'websites'}); if($issubcat ne "yes"){ $subcatfound=0; foreach $item (@categories){ $c1++; ($ucat,$subcats)=split(/\|/,$item); chomp($ucat); if($ucat eq $category){ ($junk,$subcatsdesc)=split(/\|/,$catsdescs[$c1]); @subcategories=split(/,/,$subcats); @subcategoriesdesc=split(/,/,$subcatsdesc); for($t=0;$t<=$#subcategories;$t=$t+2){ $subhref1=@subcategories[$t]; $subhref1=~s/ /%spa%/gi; $subhref1=~s/\&/%amp%/gi; $subhref1=~s/\|/%pip%/gi; open(FILE,"<$data/data_$cathref%pip%$subhref1.txt"); flock(FILE,2); @subnum1=; close(FILE); $subnum1=$#subnum1; $subnum1++; $subtxt1=$text{'subnum'}; $subtxt1=~s/##/$subnum1/gi; $subhref2=@subcategories[$t+1]; $subhref2=~s/ /%spa%/gi; $subhref2=~s/\&/%amp%/gi; $subhref2=~s/\|/%pip%/gi; open(FILE,"<$data/data_$cathref%pip%$subhref2.txt"); flock(FILE,2); @subnum2=; close(FILE); $subnum2=$#subnum2; $subnum2++; $subtxt2=$text{'subnum'}; $subtxt2=~s/##/$subnum2/gi; $subcatfound++; $sb="

"; if(@subcategories[$t+1] ne ""){ $sb.=""; $subcatfound++; } $sb.="
\n"; if($subcatspace eq "yes"){ print "

\n"; } push(@subdata,$sb); } } } if($subcatfound==0){ unshift(@data,"$text{'nosubs'}\n"); }else{ @data=(@subdata,@data); } $text{'subcategories'}=~s/##/$subcatfound/gi; unshift(@data,$text{'subcategories'}); } if(($amt<0)||($amt eq "")){ $amt=0; } if($amt>$#data){ $amt=$#data; } $a2=$amt+10; $a1=$amt; if($a1<0){ $a1=0; } $sitefound=0; for($i=$a1;$i<$a2;$i++){ if(@data[$i]=~/}{/gi){ ($clicks,$url,$stitle,$desc,$keys,$cat,$rate,$votes,$junk)=split(/}{/,@data[$i]); $url=~s/%(..)/pack("c",hex($1))/ge; $stitle=~s/%(..)/pack("c",hex($1))/ge; $desc=~s/%(..)/pack("c",hex($1))/ge; $keys=~s/%(..)/pack("c",hex($1))/ge; if(length($stitle)>$titletrunc){ $stitle=substr "$stitle","",$titletrunc-3; $stitle.="..."; } if(length($url)>$urltrunc){ $surl=substr "$url","",$urltrunc-3; $surl.="..."; }else{ $surl=$url; } $url=~s/:/%3A/gi; $url=~s/\//%2F/gi; $url=~s/\?/%3F/gi; $url=~s/\|/%7C/gi; if(length($desc)==$desclength){ $desc.="..."; } $sitefound++; &Result; }else{ print "@data[$i]\n"; } } if(($sitefound==0)&&($subcatfound<9)){ print "$text{'nosites'}\n"; } if($#data>9){ $pg=0; $pages=""; for($i=0;$i<=$#data;$i=$i+10){ $pg++; if($pg-1==int($amt/10)){ $last=$i-10; $next=$i+10; $pages.=" $pg |"; }else{ $pages.=" $pg |"; } } chop($pages); print "

"; if($pagenumbers ne "yes"){ print "\n"; } if(int($amt/10)!=0){ $pages=" << Last |$pages"; if($pagenumbers ne "yes"){ print ""; } } if($amt+10<=$#data){ $pages.="| Next >> "; if($pagenumbers ne "yes"){ print ""; } } if($pagenumbers eq "yes"){ print "$text{'page'}   $pages

\n"; }else{ print "
\n"; } } print "\n"; print "
\n"; if($issubcat eq "yes"){ $cdbooklink=$thissub; $remotehref=$thissubhref; }else{ $cdbooklink=$category; $remotehref=$cathref; } $remotehref=~s/\+/%2B/gi; $remotehref=~s/ /\+/gi; $remotehref=~s/\&/%26/gi; $remotehref=~s/%amp%/%26/gi; $remotehref=~s/%pip%/%7C/gi; $remotehref=~s/%spa%/\+/gi; $cdbookhref=$remotehref; if($affiliates==2){ if($showamazon eq 'yes'){ print "
\n"; print "Books about:
\n"; print "$cdbooklink
\n"; print "

 
\n"; } if($showcdnow eq 'yes'){ print "
\n"; print "CDs about:
\n"; print "$cdbooklink
\n"; print "
\n"; } }else{ if($showamazon eq 'yes'){ print "

\n"; print "\n"; print "
\n"; print "Amazon.$amaex
\n"; print "
\n"; print "\n"; print "Books about:
\n"; print "$cdbooklink
\n"; print "
\n"; print "

\n"; } if($showcdnow eq 'yes'){ print "

\n"; print "\n"; print "
\n"; print "CDNow.com
\n"; print "
\n"; print "\n"; print "CDs about:
\n"; print "$cdbooklink
\n"; print "
\n"; print "

\n"; } } print "
 
\n"; if($showremote eq "yes"){ print "

$text{'remotesearch'}
AltaVista | \n"; print "AOL Search | \n"; print "Amazon.com | \n"; print "DejaNews | \n"; print "Direct Hit | \n"; print "Dogpile | \n"; print "EuroFerret | \n"; print "EuroSeek
\n"; print "Excite | \n"; print "Fast Search | \n"; print "Google | \n"; print "GoTo | \n"; print "HotBot | \n"; print "Infind | \n"; print "Infoseek | \n"; print "LookSmart | \n"; print "Lycos | \n"; print "MetaCrawler
\n"; print "Netscape Search | \n"; print "Snap | \n"; print "Northern Light | \n"; print "WebCrawler | \n"; print "Yahoo

\n"; } if($issubcat ne "yes"){ $bottombar="$title{'home'} > $category"; $remotehref=$category; }else{ ($backcat,$thissub)=split(/\|/,$category); ($backcathref,$thissubhref)=split(/%pip%/,$cathref); $bottombar="$title{'home'} > $backcat > $thissub"; $remotehref=$thissub; } &BottomBar; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } sub ShowReFrame{ $f{'url'}=~s/%(..)/pack("c",hex($1))/ge; &Plugin('reframe'); open(FILE,"<$rebarpath"); flock(FILE,2); @refile=; close(FILE); print "content-type:text/html\n\n"; foreach $line (@refile){ chomp($line); $line=~s//$f{'url'}/gi; $line=~s//$ENV{'HTTP_REFERER'}/gi; print "$line\n"; } } sub HomeClick{ if($rebar eq "on"){ print "content-type:text/html\n\n"; print "$f{'title'}\n"; print "\n"; print "\n"; }else{ $f{'url'}=~s/%(..)/pack("c",hex($1))/ge; print "location:$f{'url'}\n\n"; } } sub URLClick{ &Plugin('urlclick'); $url=$f{'url'}; $url=~s/%(..)/pack("c",hex($1))/ge; $category=$f{'cat'}; chomp($category); open(FILE,"<$data/data_$category.txt"); flock(FILE,2); @data=; close(FILE); foreach $item (@data){ @splt=split(/}{/,$item); $uls=@splt[1]; $uls=~s/%(..)/pack("c",hex($1))/ge; chomp($uls); chomp($url); if($url eq $uls){ $osplt=@splt[0]; $newline=@splt[0]+1; $item=~s/$osplt}{//gi; $newline="$newline}{$item"; push(@newfile,"$newline"); $stitle=@splt[2]; }else{ push(@newfile,"$item"); } } open(FILE,">$data/data_$category.txt"); flock(FILE,2); foreach $line (@newfile){ chomp($line); print FILE "$line\n"; } close(FILE); if($rebar eq "on"){ print "content-type:text/html\n\n"; print "$stitle\n"; if($framepos="top"){ print ""; print "\n"; print ""; }else{ print ""; print ""; print "\n"; } print "\n"; }else{ print "location:$url\n\n"; } } sub Spider{ &Plugin('spider'); $url=$f{'url'}; $url=~s/%(..)/pack("c",hex($1))/ge; $f{'email'}=~s/%(..)/pack("c",hex($1))/ge; chomp($f{'email'}); if($mustem eq "yes"){ if($f{'email'} !~ /.+\@.+\..+/){ print "Content-type: text/html\n\n"; print "$title: $title{'addurl'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$title{'addurl'} < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'error'}
\n"; print "\n"; print "
\n"; print "$text{'emailneeded'}"; print "

\n"; print "

\n"; $bottombar="$title{'home'} > $title{'addurl'}"; &BottomBar; print "
\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } } opendir(DIR,$data); @files=readdir(DIR); closedir(DIR); foreach $line (@files){ chomp($line); if(($line ne ".")&&($line ne "..")){ open(FILE,"<$data/$line"); flock(FILE,2); @urls=; close(FILE); foreach $item (@urls){ @splt=split(/}{/,$item); $uls=@splt[1]; $uls=~s/%(..)/pack("c",hex($1))/ge; chomp($uls); chomp($url); if($reindex eq 'yes'){ open(FILE2,">$data/$line"); flock(FILE2,2); foreach $nl (@urls){ @splt2=split(/}{/,$nl); $uls2=@splt2[1]; chomp($uls2); chomp($nl); if(($url ne $uls2)&&($nl ne '')){ print FILE2 "$nl\n"; } } close(FILE2); }else{ if($url eq $uls){ &Error($text{'urlindexed'}); } } } } } if($lwp eq "on"){ use LWP::UserAgent; use HTTP::Request; use HTTP::Response; $ua = LWP::UserAgent->new(); $ua->agent("$spider"); $request = HTTP::Request->new(GET => $url); $response = $ua->request($request); $dolwp=$response->is_error(); if($dolwp){ print "Content-type: text/html\n\n"; print "$title: $title{'addurl'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$title{'addurl'} < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'error'}
\n"; print "\n"; print "
\n"; print "$text{'addurlerror'}"; print "

\n"; print "

\n"; $bottombar="$title{'home'} > $title{'addurl'}"; &BottomBar; print "
\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } # `/http/cgi-bin/dfrench/spider.pl "${url}" "${category}" > /tmp/spider${$}.out 2>&1 &`; exec "/http/cgi-bin/dfrench/spider.pl '${url}' '${category}'"; $stitle=$response->title(); $page=$response->content(); $page=~s/\n/ /gi; $page=~s/\r/ /gi; $page=~s/\c/ /gi; $page=~s///gi; $page=~s///gi; while($page=~/ /){ $page=~s/ / /gi; } $nometa=$page; $page=~s/>/\>*brkhre\*/gi; @tags=split(/\*brkhre\*/,$page); foreach $tag (@tags){ # print "tag = ${tag}
\n"; if($tag=~//gi){ $tag=~s///gi; $tag=~s//>/gi; $desc=$tag; } if($tag=~//gi){ $tag=~s///gi; $tag=~s//>/gi; $keys=$tag; } } $nometa=~s/<([^>]|\n)*>//gi; $nometa=~s/\ / /g; while($nometa=~/ /){ $nometa=~s/ / /gi; } $nometa=~s/ / /gi; while($nometa=~/ /){ $nometa=~s/ / /g; } $nometa=~s/ / /g; chomp($desc); chomp($keys); if($desc eq ''){ $desc=substr "$nometa","",$desclength; }else{ $desc=substr "$desc","",$desclength; } if($keys eq ''){ $nometa=~s/$desc//g; $keys=substr "$nometa","",$keyslength; }else{ $keys=substr "$keys","",$keyslength; } }else{ $desc=$f{'desc'}; $keys=$f{'keys'}; $stitle=$f{'title'}; } $desc=~s/}{//gi; chomp($desc); $keys=~s/}{//gi; chomp($keys); $stitle=~s/}{//gi; $stitle=substr "$stitle","",$titletrunc; chomp($stitle); if(($desc eq '')||($desc eq ' ')){ $desc=$text{'nodesc'}; } if(($stitle eq '')||($stitle eq ' ')){ $stitle=$text{'notitle'}; } chomp($f{'category'}); $category=$f{'category'}; $f{'category'}=~s/ /%spa%/gi; $f{'category'}=~s/\&/%amp%/gi; $f{'category'}=~s/\|/%pip%/gi; print "Content-type: text/html\n\n"; print "$title: $title{'addurl'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$title{'addurl'} < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'addurl'}
\n"; print "\n"; print "
\n"; print "

"; if(length($stitle)>$titletrunc){ $stitle=substr "$stitle","",$titletrunc-3; $stitle.="..."; } if(length($url)>$urltrunc){ $surl=substr "$url","",$urltrunc-3; $surl.="..."; }else{ $surl=$url; } if(length($desc)==$desclength){ $desc.="..."; } if(($rez_cat eq "yes")||($rez_rate eq "yes")){ print "
  • \n"; print "
    $stitle"; if($rez_rate eq "yes"){ print "$text{'ratesep'}$text{'rate'}"; } print "
    $desc
    $surl"; if($rez_cat eq "yes"){ $category=~s/\|/ > /gi; print "$category"; } if($entryextra eq "yes"){ $ln=$extrahref; $ln=~s//$url/gi; if($rez_cat eq "yes"){ print " | "; } print "$extralink"; } print "
"; }else{ print "\n"; } open(FILE,">>$data/data_$f{'category'}.txt"); flock(FILE,2); print FILE "0}{$url}{$stitle}{$desc}{$keys}{$f{'category'}}{0}{0\n"; close(FILE); open(FILE,">>$newsubs"); flock(FILE,2); print FILE "0}{$url}{$stitle}{$desc}{$keys}{$f{'category'}}{0}{0\n"; close(FILE); open(FILE,">$lastsub"); flock(FILE,2); print FILE "$url\n$stitle\n$desc"; close(FILE); print "

\n"; print "$text{'addurldone'}"; print "

\n"; print "

\n"; $bottombar="$title{'home'} > $title{'addurl'}"; &BottomBar; print "
\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; if($mustem eq "yes"){ open (FILE, "<$emailfile"); flock(FILE, 2); @emails=; close(FILE); chomp($f{'email'}); $sh=1; foreach $item (@emails){ chomp($item); if($item eq $f{'email'}){ $sh=0; } } if($sh==1){ open (FILE, ">>$emailfile"); flock(FILE, 2); print FILE "$f{'email'}\n"; close(FILE); } open (MAIL, "|$mail_prog"); print MAIL "To: $f{'email'}\n"; print MAIL "Reply-to: $remail\n"; print MAIL "From: $remail\n"; print MAIL "Subject: $emailtitle\n"; print MAIL "\n\n"; print MAIL "$text{'thanksemail'}"; close(MAIL); } exit; } sub AddURL{ &Plugin('addurl'); print "Content-type: text/html\n\n"; print "$title: $title{'addurl'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$title{'addurl'} < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'addurl'}
\n"; print "\n"; print "
\n"; print "\n"; print "\n"; if($rqmail eq 'yes'){ print "\n"; } if($lwp eq "on"){ print "\n"; print "
\n"; if ($lwp eq "on"){ print "

$text{'auspider'}

\n"; }else{ print "

$text{'aunolwp'}

\n"; } print "
$text{'category'}
$text{'email'}
$text{'yoururl'}
\n"; }else{ print "
$text{'yoururl'}\n"; print "
\n"; print "$text{'title'}\n"; print "\n"; print "\n"; print "
\n"; print "$text{'desc'}\n"; print "\n"; print "\n"; print "
\n"; print "$text{'keys'}\n"; print "\n"; print "\n"; print "
\n"; } print "

\n"; $bottombar="$title{'home'} > $title{'addurl'}"; &BottomBar; print "
\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } sub Result{ if(($rez_cat eq "yes")||($rez_rate eq "yes")){ print "
  • "; print "
    $stitle"; if($rez_rate eq "yes"){ if(($rate==0)||($votes==0)){ $rating=0; }else{ $rating=int($rate/$votes); if($rating>5){ $rating=5; } } if($rating!=0){ for($n=0;$n<$rating;$n++){ print " $text{'ratesymbol'}"; } } print "$text{'ratesep'}$text{'rate'}"; } print "
    $desc
    $surl"; if($rez_cat eq "yes"){ $category=~s/\|/ > /gi; print "$category"; $category=~s/ > /\|/gi; } if($entryextra eq "yes"){ $ln=$extrahref; $ln=~s//$url/gi; if($rez_cat eq "yes"){ print " | "; } print "$extralink"; } print "
"; }else{ print ""; } } sub Error{ &Plugin('error'); print "Content-type: text/html\n\n"; print "$title: $title{'error'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$title{'error'} < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'error'}
\n"; print "\n"; print "
\n"; print "$_[0]"; print "

\n"; $bottombar="$title{'home'} > $title{'error'}"; &BottomBar; print "
\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } sub Banner{ $search="$_[0]"; &Plugin('specialad'); if($specialad ne "yes"){ open(ADVERT,"<$banner"); @ad=; close(ADVERT); if((@ad[0] ne '')||(@ad[1] ne '')||(@ad[2] ne '')){ print "

@ad

\n"; } }else{ &Plugin("showad|$search"); } } sub TopBar{ &Plugin('topbar'); print "

$topbar

\n"; } sub BottomBar{ &Plugin('bottombar'); print "

$bottombar

\n"; } ################################################################ sub Spider_noemail{ &Plugin('spider_noemail'); $url=$f{'url'}; $url=~s/%(..)/pack("c",hex($1))/ge; opendir(DIR,$data); @files=readdir(DIR); closedir(DIR); foreach $line (@files){ chomp($line); if(($line ne ".")&&($line ne "..")){ open(FILE,"<$data/$line"); flock(FILE,2); @urls=; close(FILE); foreach $item (@urls){ @splt=split(/}{/,$item); $uls=@splt[1]; $uls=~s/%(..)/pack("c",hex($1))/ge; chomp($uls); chomp($url); if($reindex eq 'yes'){ open(FILE2,">$data/$line"); flock(FILE2,2); foreach $nl (@urls){ @splt2=split(/}{/,$nl); $uls2=@splt2[1]; chomp($uls2); chomp($nl); if(($url ne $uls2)&&($nl ne '')){ print FILE2 "$nl\n"; } } close(FILE2); }else{ if($url eq $uls){ &Error($text{'urlindexed'}); } } } } } if($lwp eq "on"){ use LWP::UserAgent; use HTTP::Request; use HTTP::Response; $ua = LWP::UserAgent->new(); $ua->agent("$spider_noemail"); $request = HTTP::Request->new(GET => $url); $response = $ua->request($request); $dolwp=$response->is_error(); if($dolwp){ print "Content-type: text/html\n\n"; print "$title: $title{'addurl'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$title{'addurl'} < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'error'}
\n"; print "\n"; print "
\n"; print "$text{'addurlerror'}"; print "

\n"; print "

\n"; $bottombar="$title{'home'} > $title{'addurl'}"; &BottomBar; print "
\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; } $stitle=$response->title(); $page=$response->content(); $page=~s/\n/ /gi; $page=~s/\r/ /gi; $page=~s/\c/ /gi; $page=~s///gi; $page=~s///gi; while($page=~/ /){ $page=~s/ / /gi; } $nometa=$page; $page=~s/>/\>*brkhre\*/gi; @tags=split(/\*brkhre\*/,$page); foreach $tag (@tags){ # print "tag = ${tag}
\n"; if($tag=~//gi){ $tag=~s///gi; $tag=~s//>/gi; $desc=$tag; } if($tag=~//gi){ $tag=~s///gi; $tag=~s//>/gi; $keys=$tag; } } $nometa=~s/<([^>]|\n)*>//gi; $nometa=~s/\ / /g; while($nometa=~/ /){ $nometa=~s/ / /gi; } $nometa=~s/ / /gi; while($nometa=~/ /){ $nometa=~s/ / /g; } $nometa=~s/ / /g; chomp($desc); chomp($keys); if($desc eq ''){ $desc=substr "$nometa","",$desclength; }else{ $desc=substr "$desc","",$desclength; } if($keys eq ''){ $nometa=~s/$desc//g; $keys=substr "$nometa","",$keyslength; }else{ $keys=substr "$keys","",$keyslength; } }else{ $desc=$f{'desc'}; $keys=$f{'keys'}; $stitle=$f{'title'}; } $desc=~s/}{//gi; chomp($desc); $keys=~s/}{//gi; chomp($keys); $stitle=~s/}{//gi; $stitle=substr "$stitle","",$titletrunc; chomp($stitle); if(($desc eq '')||($desc eq ' ')){ $desc=$text{'nodesc'}; } if(($stitle eq '')||($stitle eq ' ')){ $stitle=$text{'notitle'}; } chomp($f{'category'}); $category=$f{'category'}; $f{'category'}=~s/ /%spa%/gi; $f{'category'}=~s/\&/%amp%/gi; $f{'category'}=~s/\|/%pip%/gi; print "Content-type: text/html\n\n"; print "$title: $title{'addurl'}\n"; open(HEAD,"<$header"); @top=; close(HEAD); print "@top"; $topbar="$title{'addurl'} < $title{'home'}"; &TopBar; &Banner('general'); print "
\n"; print "

$window{'addurl'}
\n"; print "\n"; print "
\n"; print "

"; if(length($stitle)>$titletrunc){ $stitle=substr "$stitle","",$titletrunc-3; $stitle.="..."; } if(length($url)>$urltrunc){ $surl=substr "$url","",$urltrunc-3; $surl.="..."; }else{ $surl=$url; } if(length($desc)==$desclength){ $desc.="..."; } if(($rez_cat eq "yes")||($rez_rate eq "yes")){ print "
  • \n"; print "
    $stitle"; if($rez_rate eq "yes"){ print "$text{'ratesep'}$text{'rate'}"; } print "
    $desc
    $surl"; if($rez_cat eq "yes"){ $category=~s/\|/ > /gi; print "$category"; } if($entryextra eq "yes"){ $ln=$extrahref; $ln=~s//$url/gi; if($rez_cat eq "yes"){ print " | "; } print "$extralink"; } print "
"; }else{ print "\n"; } open(FILE,">>$data/data_$f{'category'}.txt"); flock(FILE,2); print FILE "0}{$url}{$stitle}{$desc}{$keys}{$f{'category'}}{0}{0\n"; close(FILE); open(FILE,">>$newsubs"); flock(FILE,2); print FILE "0}{$url}{$stitle}{$desc}{$keys}{$f{'category'}}{0}{0\n"; close(FILE); open(FILE,">$lastsub"); flock(FILE,2); print FILE "$url\n$stitle\n$desc"; close(FILE); print "

\n"; print "$text{'addurldone'}"; print "

\n"; print "

\n"; $bottombar="$title{'home'} > $title{'addurl'}"; &BottomBar; print "
\n"; open(FOOT,"<$footer"); @bottom=; close(FOOT); print "@bottom"; print "\n"; exit; }