#======================================================# # EveryAuction Addon # Misc Display Add-on v1.0 #------------------------------------------------------# # If you have them, this add-on will replace the # following add-ons: # View Sellers Other Auctions, View All Ending, # View All New, and View All Hot #======================================================# # PiTA - Park In The Alley Software (Auction-Script.com) #======================================================# # Author: Splatt 02/20/00 # justguns.com auction-script.com compalley.com #------------------------------------------------------# # Unauthorized redistribution is prohibited!!! # The latest version of my addons can be found at: # www.auction-script.com/addons #======================================================# #------------------------------------------------------# # Variables that need to be in your config section #------------------------------------------------------# #------------------------------------------------------# # Alternating Colors for the rows # $odd_row_color = '#EEEEEE'; # $even_row_color = '#FFFFFF'; #------------------------------------------------------# #------------------------------------------------------# # $hotitemnum = number of bids to trigger hot item # $hoticonpath = URL to an icon for displaying # $hotitemnum = 10; # $hoticonpath = ""; #------------------------------------------------------# #------------------------------------------------------# # View new items # $newdays = number of days item is considered new # $newiconpath = URL to an icon for displaying # $newdays = 1; # $newiconpath = ""; #------------------------------------------------------# #------------------------------------------------------# # View ending soon items # $endhours = number of hours left in auction to be considered closing soon # $endiconpath = URL to an icon for displaying # $endhours = 3; # $endiconpath=""; #------------------------------------------------------# #------------------------------------------------------# # This goes in your elsif section # elsif ($ARGV[0] eq 'disp') { &disp; } #------------------------------------------------------# # It replaces: # elsif ($ARGV[0] eq 'allnew') { &allnew; } # elsif ($ARGV[0] eq 'allend') { &allend; } # elsif ($ARGV[0] eq 'allhot') { &allhot; } # elsif ($ARGV[0] eq 'viewseller') { &viewseller; } #------------------------------------------------------# #------------------------------------------------------# # This goes in your footer section or wherever you have # your menuing code # print "New Items "; # print "Hot Items "; # print "Ending Soon "; #------------------------------------------------------# #------------------------------------------------------# # This goes in your dispitem sub to allow users to view # the sellers other auctions # print " (view seller's other auctions)\n"; #------------------------------------------------------# #------------------------------------------------------# # This replaces subs: &allhot, &allnew, &allend, &viewseller #------------------------------------------------------# # Sub: Show misc displays #------------------------------------------------------# sub disp { #------------------------------------------------------# # I use the Header as a sub, this is here for reference #------------------------------------------------------# # if ($ARGV[1] eq 'allend') {&ShowHeader("Closing Items");} # if ($ARGV[1] eq 'allnew') {&ShowHeader("New Items");} # if ($ARGV[1] eq 'allhot') {&ShowHeader("Hot Items");} # if ($ARGV[1] eq 'viewseller') {&ShowHeader("Auctions by: $ARGV[2]");} #------------------------------------------------------# &autoclose; # REM if not using autoclose print "\n"; if ($ARGV[1] eq 'allend') { print "\n";} if ($ARGV[1] eq 'allhot') { print "\n"; } if ($ARGV[1] eq 'allnew') { print "\n"; } if ($ARGV[1] eq 'viewseller') { print "\n"; } print "
Closing Items - Items with less than $endhours hours until they close
Hot Items - Items with $hotitemnum or more bids
New Items - Items posted within $newdays day(s)
Auctions Offered By - $ARGV[2]
\n"; print "\n"; print "\n"; $i=0; foreach $key (sort keys %category) { opendir THEDIR, "$basepath$key" || die "Unable to open directory: $!"; @allfiles = readdir THEDIR; closedir THEDIR; foreach $file (sort { int($a) <=> int($b) } @allfiles) { if (-T "$basepath$key/$file") { open THEFILE, "$basepath$key/$file"; ($title, $reserve, $inc, $desc, $image, @bids) = ; close THEFILE; chomp($title, $reserve, $inc, $desc, $image, @bids); @lastbid = split(/\[\]/,$bids[$#bids]); $file =~ s/\.dat//; @closetime = localtime($file); $closetime[4]++; $camera=""; $camera = $piciconpath if ($image); @firstbid = split(/\[\]/,$bids[0]); $timediff = ($file - time); $hoticon=""; $hoticon=$hoticonpath if ($hotitemnum <= $#bids); $newicon=""; $newicon=$newiconpath if (time<($newdays * 86400 + $firstbid[3])); $timediff=($file - time); $endicon=""; $endicon=$endiconpath if ($timediff < ($endhours * 3600)); $camera=""; $camera =$piciconpath if ($image); #------------------------------------------------------# # View Sellers Other Auctions #------------------------------------------------------# if ($ARGV[1] eq 'viewseller') { if ($i % 2 == 1) { $colortablebody=$odd_row_color; } else { $colortablebody=$even_row_color; } $flag=0; foreach $bid(@bids) { $i++ if (($firstbid[0]=~/$ARGV[2]\b/i) && ($flag==0)); if (($firstbid[0]=~/$ARGV[2]\b/i) && ($flag==0)) { print "\n"; $flag=1; } } } #------------------------------------------------------# # View All New Items #------------------------------------------------------# if ($ARGV[1] eq 'allnew') { if ($i % 2 == 1) { $colortablebody=$odd_row_color; } else { $colortablebody=$even_row_color; } $i++ if (time < ($newdays * 86400 + $firstbid[3])); print "\n" if (time < ($newdays * 86400 + $firstbid[3])); } else { print "$closetime[1] \n" if (time < ($newdays * 86400 + $firstbid[3])); } } #------------------------------------------------------# # View All Hot Items #------------------------------------------------------# if ($ARGV[1] eq 'allhot') { if ($i % 2 == 1) { $colortablebody=$odd_row_color; } else { $colortablebody=$even_row_color; } $i++ if ($hotitemnum <= $#bids); print "\n" if ($hotitemnum <= $#bids); } else { print "$closetime[1] \n" if ($hotitemnum <= $#bids); } } #------------------------------------------------------# # View All Ending Items #------------------------------------------------------# if ($ARGV[1] eq 'allend'){ if ($i % 2 == 1) { $colortablebody=$odd_row_color; } else { $colortablebody=$even_row_color; } $i++ if ($timediff < ($endhours * 3600)); print "\n" if ($timediff < ($endhours * 3600));} else { print "$closetime[1] \n" if ($timediff < ($endhours * 3600)); } } #------------------------------------------------------# } } } print "
ItemClosesBidsHigh Bid
$category{$key}\: $title$hoticon$camera$newicon$endicon$closetime[4]/$closetime[3]$#bids\$$lastbid[2]
$hoticon$newicon $title$camera$endicon$closetime[4]/$closetime[3] $closetime[2]\:" if (time < ($newdays * 86400 + $firstbid[3])); if ($closetime[1] < 10) { print "0$closetime[1] $#bids\$$lastbid[2]
$#bids\$$lastbid[2]
$hoticon$newicon $title$camera$endicon$closetime[4]/$closetime[3] $closetime[2]\:" if ($hotitemnum <= $#bids); if ($closetime[1] < 10) { print "0$closetime[1] $#bids\$$lastbid[2]
$#bids\$$lastbid[2]
$hoticon$newicon $title$camera$endicon$closetime[4]/$closetime[3] $closetime[2]\:" if ($timediff < ($endhours * 3600)); if ($closetime[1] < 10) { print "0$closetime[1] $#bids\$$lastbid[2]
$#bids\$$lastbid[2]
\n"; #------------------------------------------------------# # I also use the Footer as a sub, here for reference # &ShowFooter; #------------------------------------------------------# } #------------------------------------------------------#