;
close(FILE);
$img= $img . "@adbanner[$count]";
$count++;
if ($count > @adbanner || $count eq @adbanner ) { $count="0"; }
open(FILE, ">$banners2" ) || print "I can't open that file\n";
print FILE "$count";
close(FILE);
}
if ($yesbest eq "1") {
$best="";
}
if ($showpslink eq "yes") {
$pslink="
";
}
$sitelogo2=$sitename;
if (index($sitelogo,"http://")>-1) {
$sitelogo2="";
}
$header = "
$sitelogo2 $days[$wday], $months[$mon] $mday, $year |
";
$footer ="$img$pslink
$bestV 3.1 ISELL Classifieds Script Copyright 2000-2003 Becanada
Get Your own, FREE at: http://www.becanada.com
Used By Permission at $home
Return to Homepage
Webmaster
";
@items = ("Name|30", "Address|30","City|20","State|20","Zip Code|10","Country|30","Phone Number|30","Headline|100","Ad Copy|250","Email Address|50||@","Website Address|100","Password|10");
@expiry=("10 Minutes|.005","1 Hour|.05","1 Day|1","7 Days|7","14 Days|14","30 Days|30","ADMIN 60 Days|?60","ADMIN 3 Monthes|?90","ADMIN 4 Monthes|?120","ADMIN 6 Monthes|?180","ADMIN 12 Monthes|?365","ADMIN NEVER Expiry|?never");
($cg,$data,$singlead) = split(/\|/,$ENV{'QUERY_STRING'});
print "Content-type: text/html\n\n";
if ($cg ne "frames" && $cg ne "frames1") {
print "
$sitename\n";
print "
\n$header\n";
}
if ($cg eq "post_ad" || $cg eq "do_delete_ad" || $cg eq "add_to_categories" || $cg eq "do_delete_cat" || $cg eq "do_email" || $cg eq "search_ads" || $cg eq "email_ad_friend" || $cg eq "admin_access" ) {
read(STDIN, $input, $ENV{'CONTENT_LENGTH'});
# split the input
@pairs = split(/&/, $input);
# split the name/value pairs
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
# change value to allow Returns.
if ($cg eq "do_email" || $cg eq "add_to_categories" ) {
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s///g;
}
else {
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<([^>]|\n)*>//g;
$value =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
$value =~ s/(\s+)?\n+(\s+)?//g;
}
$FORM{$name} = $value;
}
}
$modify=0;
$multisearch=0;
#display ads
$did=0;
if ($cg eq "display_ads") {
&displayads;
$did=1;
}
if ($cg eq "place_ads") {
if ($spamable ne "yes") { &check_url; }
&place_ads;
$did=1;
}
if ($cg eq "post_ad") {
if ($spamable ne "yes") { &check_url; }
&post_ad;
$did=1;
}
if ($cg eq "delete_ad") {
&delete_ad;
$did=1;
}
if ($cg eq "do_delete_ad") {
&do_delete_ad;
$did=1;
}
if ($cg eq "add_category") {
&add_category;
$did=1;
}
if ($cg eq "add_to_categories") {
&add_to_categories;
$did=1;
}
if ($cg eq "delete_cat") {
&delete_cat;
$did=1;
}
if ($cg eq "do_delete_cat") {
&do_delete_cat;
$did=1;
}
if ($cg eq "admin_access") {
&check_url;
&admin_access;
$did=1;
}
if ($cg eq "do_email") {
&check_url;
&do_email;
$did=1;
}
if ($cg eq "friend") {
&check_url;
&friend;
$did=1;
}
if ($cg eq "frames") {
&frames;
$did=1;
}
if ($cg eq "frames1") {
&frames1;
$did=1;
}
if ($cg eq "email_ad_friend") {
&check_url;
&email_ad_friend;
$did=1;
}
if ($cg eq "search_ads") {
@keywords = split(/,/,$FORM{'keywords'});
&check_url;
@keywords = split(/,/,$FORM{'keywords'});
$sear=1;
if ($FORM{'submit'} eq 'Search All Topics [will take longer]') {
$multisearch=1;
for ($data=1;$data<@cats;$data++) {
&displayads;
}
}
else {
&displayads;
}
$did=1;
}
if ($did eq "0") {
&showcategories;
}
if ($cg ne "frames1") {
print "$footer