#!/usr/bin/perl
##############################################################################
# PROGRAM : iLink Search Engine: Main Program #
# VERSION : 2000.1.02 #
# #
##############################################################################
# #
# __ __ #
# __ /\ \ __ /\ \ #
# /\_\ \ \ \ /\_\ ___ \ \ \/'\ #
# \/\ \ \ \ \ __\/\ \ /' _ `\\ \ , < #
# \ \ \ \ \ \L\ \\ \ \ /\ \/\ \\ \ \\`\ #
# \ \_\ \ \____/ \ \_\\ \_\ \_\\ \_\ \_\ #
# \/_/ \/___/ \/_/ \/_/\/_/ \/_/\/_/ #
# #
# ___ __ __ __ #
# /'___`\ /'__`\ /'__`\ /'__`\ #
# /\_\ /\ \/\ \/\ \/\ \/\ \/\ \/\ \ #
# \/_/// /_\ \ \ \ \ \ \ \ \ \ \ \ \ #
# // /_\ \ \ \_\ \ \ \_\ \ \ \_\ \ #
# /\______/\ \____/\ \____/\ \____/ #
# \/_____/ \/___/ \/___/ \/___/ #
# #
##############################################################################
# All source code, images, programs, files included in this distribution #
# Copyright (c) 1996,1997,1998,1999,2000 #
# #
# John C. Cokos, The CCS Network, Inc. IWeb, Inc. #
# All Rights Reserved. #
# #
# Use, distibution, sale, or access to this program is forbidden without #
# permission, except were permitted by the license agreement. #
# #
##############################################################################
# #
# ------ DO NOT MODIFY ANYTHING BELOW THIS POINT !!! ------- #
# #
# Modification of the souce code of this program violates the #
# license agreement, and terminates your right to technical support. #
# #
##############################################################################
#START#
package IWEB;
BEGIN {
use Cwd;
}
BEGIN {
$directory = cwd;
push @INC,$directory;
push @INC,".";
push @INC,"..";
}
BEGIN {
use IWeb::iweb;
use IWeb::ilink;
}
use vars qw(@categories);
use strict;
##############################################################################
# BEGIN OF ACTUAL PROGRAM CODE
##############################################################################
IWEB::Start_Program();
sub Start_Program {
###################################################################
## See what the user sent as variables and take action #
###################################################################
IWEB::Read_Config();
IWEB::Read_Language("ilink");
IWEB::Read_Language("global");
%input=IWEB::parse_form("input");
if($global{'DB_Format'} eq "SQL") { IWEB::SQL_Connect(); }
$hyperseek{'small_folder'} = qq! !;
#### File names / etc sent from html
$hyperseek{'database'} = "$data_dir/ilink/hyperseek.dat";
$hyperseek{'tempdb'} = "$data_dir/ilink/hyperseek.temp";
$hyperseek{'catdb'} = "$data_dir/ilink/subcategories.dat";
$hyperseek{'Category'} = $input{'Category'};
@categories = IWEB::ReadCategories();
$action = $input{'action'};
if ($input{'Terms'}) { $hyperseek{'template'} = "search"; }
elsif ($hyperseek{'Category'}) { $hyperseek{'template'} = IWEB::Make_Alpha($hyperseek{'Category'}); }
elsif ($action eq "Add_Link") { $hyperseek{'template'} = "add_url"; }
else { $hyperseek{'template'} = "ilink"; }
IWEB::Page_Header($hyperseek{'template'});
IWEB::Quit();
}
sub BODY {
my($body) = undef;
if ($action eq "Search") { $body = IWEB::DoSearch(); }
elsif ($action eq "Add_Link") { $body = IWEB::Add_Form(); }
elsif ($action eq "post_new") { $body = IWEB::Post_New(); }
else { $body = IWEB::Category_Listings(); }
return($body);
}
sub DoSearch {
my ($catsplit,@Terms,$IDX_File,$check_special,$searchterm,$term,$sterm,$terms,$found,$shown);
my ($temp,$tempterms,$DEL,$allterms,%entered,%quoted,$searchout,@results,$count,%scores,$end,$start);
## SETUP ##
$terms = lc($input{'Terms'});
$terms =~ s/\'//;
$hyperseek{'original_terms'} = $terms;
$hyperseek{'encoded_terms'} = IWEB::urlencode($hyperseek{'original_terms'});
$hyperseek{'phrase'} = $input{'Terms'};
$hyperseek{'phrase'} =~ s/ /_/g;
$hyperseek{'phrase'} =~ s/\"//g;
$hyperseek{'search_range'} = $input{'howmuch'};
if (! $hyperseek{'search_range'}) { $hyperseek{'search_range'} = "ALL"; }
if ($hyperseek{'search_range'} ne "ALL") {
$hyperseek{'search_cat'} = $hyperseek{'search_range'};
}
## Split out the mailto, ID, and URL requests ...
$DEL = "http://";
$check_special = $terms;
$check_special =~ s/$DEL//g;
($hyperseek{'prefix'},$sterm)= split(/\:/,$check_special);
if ($sterm) {
$input{'Range'} = "Any";
$hyperseek{'Search_By'} = lc($hyperseek{'prefix'});
$hyperseek{'Search_By'} =~ s/ //g;
$hyperseek{'original_terms'} = $sterm;
$hyperseek{'encoded_terms'} = IWEB::urlencode($hyperseek{'original_terms'});
$terms = $sterm;
$terms =~ s/ //g;
}
undef $allterms;
undef @Terms;
$tempterms = $terms;
## Make a space delimited string of terms, using "_" in any quoted term
while( $tempterms =~ m{"([^\"\\]*(?:\\.[^\"\\]*)*)"}gx ) {
$temp = IWEB::ul($1);
$terms =~ s/$1/$temp/g;
}
$terms =~ s/\"//g;
foreach $searchterm( split(/\s+/,$terms) ) {
if(! $hyperseek{'grp'}) { $hyperseek{'grp'} = IWEB::Make_Alpha($searchterm); }
if($allterms) { $allterms .= " $searchterm"; }
else { $allterms = $searchterm; }
}
## Change operational vars into codes
$allterms =~ s/ and not / -/ig;
$allterms =~ s/ not / -/ig;
$allterms =~ s/ and / \+/ig;
$allterms =~ s/ or / \|/ig;
# $allterms =~ s/(\+\+)/$hyperseek{'cpp'}/g;
$allterms =~ s/(\*+)/$hyperseek{'WildCard'}/g;
## Now, foreach term, do the magic.
foreach $searchterm( split(/ /,$allterms) ) {
if($ignored{$searchterm}) {
$forbidden{$searchterm}++;
next;
}
# Determine if it's required, optional, or screened
if( substr($searchterm,0,1) eq "+") {
$searchterm =~s/\+//;
$required{$searchterm}++;
$searchterm = quotemeta($searchterm);
$hyperseek{'required'} .= "(?=.*$searchterm)";
}
elsif( substr($searchterm,0,1) eq "-") {
$searchterm =~s/\-//;
$screen{$searchterm}++;
$searchterm = quotemeta($searchterm);
$hyperseek{'screened'} .= "(?=.*$searchterm)";
}
elsif( substr($searchterm,0,1) eq "|") {
$searchterm =~s/\|//;
$optional{$searchterm}++;
$searchterm = quotemeta($searchterm);
$hyperseek{'optional'} .= "(?=.*$searchterm)";
}
else {
$required{$searchterm}++;
$searchterm = quotemeta($searchterm);
$hyperseek{'required'} .= "(?=.*$searchterm)";
}
}
## END SETUP ##
open(IDB,$hyperseek{'database'});
while() {
chomp;
$hyperseek{'line'} = $_;
($ID,$Category,$ELink,$Position,$Qualifier,$Email,$Title,$URL,$Description,$Keys,$desc_image,$title_tag,$site_icon,$Name,$Address,$City,$State,$Zip,$Country,$Phone,$Fax,$startdate,$enddate,$price,$account,$xfactor,$field1,$field2,$field3,$field4,$field5,$field6,$field7,$field8,$field9,$field10)= split(/\|/,$hyperseek{'line'});
if($hyperseek{'required'}) {
if($Title =~ m/$hyperseek{'required'}/i) { $scores{$ID} += 10; }
if($Description =~ m/$hyperseek{'required'}/i) { $scores{$ID} += 8; }
if($Category =~ m/$hyperseek{'required'}/i) { $scores{$ID} += 7; }
}
if($hyperseek{'optional'}) {
if($Title =~ m/$hyperseek{'optional'}/i) { $scores{$ID} += 3; }
if($Description =~ m/$hyperseek{'optional'}/i) { $scores{$ID} += 2; }
if($Category =~ m/$hyperseek{'optional'}/i) { $scores{$ID} += 1; }
}
if($hyperseek{'screened'}) {
if($hyperseek{'line'} =~ m/$hyperseek{'screened'}/i) { delete $scores{$ID}; }
}
if($scores{$ID}) {
@{$results[$count++]}{qw(ID Cat ELink Cool Qualifier Email Title URL Description Keys desc_image title_tag site_icon Name Address City State Zip Country Phone Fax field1 field2 field3 field4 field5)} = split(/\|/,$hyperseek{'line'});
$results[$count]{'Score'} = $scores{$ID};
}
}
close(IDB);
@results = sort { $b->{'Score'} <=> $a->{'Score'} } @results;
if(! $input{'start'}) { $input{'start'}=0; }
$start = $input{'start'}+1;
$end = $input{'start'} + $global{'ilink_hits_per_page'};
$end = $#results if(! $hyperseek{'remaining'});
if ($end != -1) { $searchout .= "$#results $language{'found'} ... $language{'showing'} $start - $end
\n"; }
if ($end == -1) { $searchout .= "
Anzeige: Tausende Livesex Webcams mit Telefonsex! Tausende Girls und Paare treiben es vor der privaten Webcam, du hast die freie Auswahl. Kostenlose Vorschau! Zugang per Kreditkarte, Lastschrift oder über die Telefonrechnung.
Anzeige: 1a Livesex ohne Ende - Amateur-Livestrip.de Folgende Livesex-Angebote findest du bei uns: Dildocam, Eroticams, Fetishcams, Amateur-Cams sowie heiße Videos und xxx-Pictures. Als seriöser Anbieter setzen wir auf Qualität und Transparenz, testen Sie uns, eine kostenlose Vorschau steht Ihnen direkt zur Verfügung - Klick -
Es wurden keine Suchergebnisse gefunden!
"; }
for $x (0 .. $#results) {
$found++;
next if ($input{'start'} && $found <= $input{'start'});
next if($shown >= $global{'ilink_hits_per_page'});
$shown++;
if($results[$x]{'URL'}) {
$searchout .= qq!