Search

Subroutines
About Subroutines

The EA script is divided into two sections.

1. The Configuration section allows you to customize the script to your need.

2. The Main Program will contain the Page Header, elsif statements, Page Footer, and all the subroutines, (subs). The EA Script contains 27 subs. Some of these subs will be working in the background, and in others you will see the results when you or someone clicks a link.

To install an add-on, (sub) three things may happen. The add-on instruction will tell you which method to use.

1. You could add the sub to the very bottom of the script. If necessary the add-on instruction will tell you to make modifications in other locations in the EA Script.

2. You could replace an existing sub with a modified add-on version. If necessary the add-on instruction will tell you to make modifications in other locations in the EA Script.

3. You could install the add-on as an external file. The add-on instruction will tell you to make modifications in other locations in the EA Script.
Subroutine Installation Tips

Sometimes the add-on instruction will say to modify every instance of this line, (sometimes "this line" is called a variable line or chomp line):

($title, $reserve, $inc, $desc, $image, @bids)

In the EA Script (partial listing), that line will appear as:

($title, $reserve, $inc, $desc, $image, @bids) = ;

chomp ($title, $reserve, $inc, $desc, $image, @bids);

my ($title, $reserve, $inc, $desc, $image, @bids) = &read_item_file($form{'category'},$file);

When the instructions say, for example to add "$something," you would go through the entire EA Script and modify it to look like this:

($title, $reserve, $inc, $desc, $image, $something, @bids);

Okay, sometimes an add-on will say something about a being configured for a virgin EA Script. All this means is that you may have to add variables from your auction script to your new add-on. If the new add-on does not say anything about configuration, then you may have to add additional variables from the add-on to your EA Script. For example, if your auction has this line ($title, $reserve, $inc, $desc, $image, $something, @bids); you'll have to add $something, to your new add-on.

All variables, in all lines have to be in the exact same order. If you do not add the variable you could end up with a blank page that displays just the header, or some pages will show 1969 or 1970 as the date, Number of Bids showing "-1", with Last Bid showing a blank spot. A variable is any information that can change, such as the title name for an item put up for sale.

I suggest you use your text editors' search and replace function, and remember to check your external files to make sure all lines are the same.

If you add - or remove - variables, all the old and current auction .dat files have to be altered to match the new chomp/variable lines. See Working with Date Files below.

And now the bad news - when you add a new variable you may have to edit closed auctions, current auction and registered users dat files, for some pages to display properly i.e. Display Item and View History are two. If you have a live auction and hundreds of closed auction data files, dozens of open auctions, and hundreds of registered users, it could be a problem (a lot of your time) editing all those dat files. If you have a test auction you could just delete the files.

Sometimes the add-on instructions will say to modify other lines. Just follow the add-on instructions and change all lines, if needed, and keep the variables in the same order.
External Subroutine Files

Some add-on writers write their add-on as an external file. This is normally done in the interest of speed. If the add-on is placed in your EA script it will take a browser longer to load the auction. But if the add-on is getting little use why not put it in an external file? Then it will only load when needed.

The add-on instruction will say to save the file as (for example) "myaddon.pl", upload into the same directory as your auction, and chmod it, (NT users will not chmod). The instruction will also say to add a "require" statement to the top of you EA script. To add the statement go to the top of your EA script and add the "require" statement under "use strict;". A few add-on will say to modify "use vars qw(%config %category %form);"

#!/usr/local/bin/perl
use vars qw(%config %category %form %coolcats);
use strict;
require "myaddon.pl";

Modifying the Subroutines

Formatting Output with HTML

The are two ways to modify the subs. The first way is to modify with HTML. I suggest you start out by changing the visible look of your auction. Specifically the Page Header and Page Footer and tables in the subs.

In the Header you could delete the Site Name and add your own site banner or horizontal navigation bar. Do not change "$config{'header'} =<<"EOF";" or "EOF". EOF stands for End of Form. You can change EOF to anything you want, for example EOS (End of Sub). Just make sure both match and are flushed against the left side of the script. Do not indent it. If you do indent, some strange things may or may not happen. Use normal HTML or JavaScript between the tags.

In the Footer you could change the links into gif buttons, add a cool horizontal navigation image, or add some type of banner. Use normal HTML or JavaScript between the tags "$config{'footer'} =<<"EOF";" and "EOF".

Now is the time to modify the subs and now is the time to decide on the theme or layout of your auction. The best advice I can offer is to follow the rules for designing a web page. For example consider displaying the page name on each page so viewers know where they are. Consider writing your own instructions specific to each page.

The first pages your viewers will see is the Categories Page, (sub dispcat) consider writing a welcome message. Let your visitors know that browsing is free but registration is needed to sell or bid. Don't forget to provide a link to the Registration Page. (You can copy this link from the Footer.)

In other subs consider changing the table size or turning the table border off. Change the font, size, or color. For example the User Name and Password boxes appear through the auction. Why not change the "User Name" and "Password" font color to blue? The other boxes could be changed to a dark violet. When currency is used you could change it to green. The possibilities are endless, use you imagination.

You can also take the easy way out and purchase auction web sets from http://www.DynamicEnterprise.com/scripts/addons.html

We talked about using HTML with "$config{'header'} =<<"EOF";" and "$config{'footer'} =<<"EOF";".

There are two other ways to print the HTML that is used throughout the remainder of the script, "print <<"EOF";" and "print".

1. print <<"EOF" is used with EOF. HTML can be placed between these two tags. For example:

print <<"EOF"


Hello World

EOF

2. The second way the print statement is used, is for a small amount of HTML, or if the HTML is used with a conditional statement, (else, if, and, unless, or, etc.). See Examples below.

a. The line starts with (print) and ends with (;). (print) means start an HTML line. (;) means
a HTML line.
b. After (print) and before (;) you need to have the double quotation marks ("). This is used
data that may need to be analyzed or interpolated before processing.
sometime you will see (\n). The (\n) means New Line. What's the difference? HTML
recognizes
to start a new line. Perl recognizes (\n) to start a new line. If you view
the source code you can see how it works.

Conditional Example:

else {
print "No bids were placed...
";
}

Small Amount of HTML Example:

Print "
Hello World
\n";

An important point you need to remember at all times. DO NOT USE THE FOLLOWING SYMBOLS IN YOUR HTML. The Single quotation marks ('), the semicolons (;), or the ampersand (&). These all have special meaning to Perl. If you must use one, escape it, (precede it) with a backslash. For example (\'), (\;), and (\&). The backslash tells Perl to ignore the following symbol. The word "don't" would look like "don\'t".

Be aware of Perl line breaks. When using HTML you can break and start a new line in mid-sentence. If you break a Perl sentence in half you will get a server error. Do not break a line and do not let your text editor break a line in mid-sentence. Formatting Output with Perl

The second way to modify a sub is with Perl. If you started out by changing the visible look of your auction, then you have learned quite a bit by now.

We will not be "writing a sub". Writing Perl is way beyond the scope of this tutorial, there is just too much to learn. I strongly suggest you purchase books on the subject.

In this tutorial we will be installing three subs and walking you through the installation process. Installing a Simple Add-on>/b>

Your EA Script will run as-is. The question is do I want that? For example if you post an auction to run for 7 days the auction will not close. The auctions will only close when someone views that item after the 7 days is up, it could close a month later. Now if you don't want to look at every item every day then you may want to install a sub that will close it. There is a subroutine that will do this, it is simple to install and we will be using it. I would like to thank Lion for writing checkclosed, Michael Bruce and E-Z Auction Software for making it even better, and giving us permission to use it in this tutorial.

1. Copy the checkclosed sub below and paste it to the bottom of your EA Script.

#################################################################
# Sub: checkclosed (lion)
# checks all of the items, and closes the ones whose ran out of time
#

sub chkclose {

foreach $cat (keys %category) {
opendir THEDIR, "$config{'basepath'}$cat" or next;
my @allfiles = (readdir THEDIR);
closedir THEDIR; foreach $file (@allfiles) {
unless ($file eq "." || $file eq "..") {
$file =~ s/^$config{'basepath'}$form{'category'}\///;
$file =~ s/\.dat$//;
if (my ($title, $reserve, $inc, $desc, $image, @bids) = &read_item_file($cat,$file)) {
my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bids[$#bids
if ((time > int($file)) && (time > (60 * $config{'aftermin'} + $time))) {
if ($type eq 'Auction'){
&closeit($cat,$file);
}
elsif ($type eq 'Classified'){
&closeit2($cat,$file);
}
else {
&closeit3($cat,$file);
}
}
}
}
}
}
}

#################################################################

3. Now we need to format the sub name it in order to call it from another sub. The sub is named "chkclose". We will add an ampersand (&) to the front of chkclose and a semicolon (;) after chkclose so it looks like this: &chkclose;

4. Copy &chkclose; and paste it just under sub dispcat in your EA Script so it looks like this:

sub dispcat {
&chkclose;

5. Save and upload your auction.pl to your server.

All done… now when anyone views your main categories the script you just installed will check all open auctions and close those which need to be closed.
Installing an Intermediate Add-on

Sometimes people will use a free email service such as MS Hotmail or NS WebMail to conduct illegal activities. People can and do post fictitious items, collect the money and move on. Other people will just bid on items with no intention of paying for it.

By requiring your customers to use their dialup email account their name, address and phone number are on file with the ISP.

Our next add-on will require that your customers use their dialup account.

1. Download to your hard drive and save as "domainnames.txt" and Free E-mail Blocker which is located on our auction script page at:

http://DynamicEnterprise.com/scripts/addons.html

4. Open your FTP and upload the domainnames.txt to the same directory as your auction script and chmod it 644 (rw-r--r--).

5. Open your EverySoft Auction Script in your text editor. Anyplace in the Configuration Section place the following variable. Be sure to change the path.

$config{'denydomain'} = '/path/to/auction/cgi-bin/domainnames.txt';

4. Scroll down to the sub procreg and find:

$form{'ALIAS'} = ucfirst(lc($form{'ALIAS'}));



Add the following two lines below it:

$form{'EMAIL'} = lc($form{'EMAIL'}); # Free E-mail Blocker
&blockdomain; # Free E-mail Blocker

5. Copy and paste the Free E-mail Blocker add-on to the end of your auction script.
NOTE: DO NOT USE THE COPY BELOW, THE "&oops" LINE IS BROKEN.

#################################################################
# Free E-mail Blocker Add-on v1.1
# DynamicEnterprise.com/scripts/free_email_blocker.txt
# Block Domain Sub

sub blockdomain {

my $denydomain;
open(DENY,"$config{'denydomain'}") || die "Unable to open directory: $!";
my @denydomain = ;
close(DENY);
foreach $denydomain (@denydomain) {
$denydomain =~ s/\s//g;
&oops('This auction does not accept free e-mail accounts for registration. Please enter a
different e-mail address.') if ($form{'EMAIL'} =~ /$denydomain\Z/);
}
}

#################################################################

6. Save and upload your auction.pl to your server.

All done… now when new user register, the user's e-mails domain name is checked against a list and stops the registration process if there is a match.
Installing an Advance Add-on

You can never have enough advertising. So why not use your site to its fullest potential? With this next add-on registered users can recommend your auction site to someone, let someone know about an item up for auction or ask the seller a question about an item up for auction.

Because this add-on is used as an external file you will have to download to your hard drive and save as "postal.pl" which is located on our auction script page. While you are there download the email icon too.


DynamicEnterprise.com/scripts/addons.html.

Be sure to save it as postal.pl, not as postal.txt. Save the email icon as email.gif. DO NOT COPY AND PASTE FROM THE TUTORIAL BELOW, LINES ARE BROKEN. COPY AND PASTE FROM POSTAIL.TXT

1. Open your EverySoft Auction Script in your text editor. At the top of the script find:

use strict;

Copy and paste the following just under it:

require "postal.pl";

2. Because we are going to use physical links you click, we need to format the links so Perl knows what we are trying to do. In the elsif section and add the following six lines under elsif ($form{'action'} eq 'search') { &procsearch; }:

elsif ($form{'action'} eq 'rsf') { &rsf; }
elsif ($form{'action'} eq 'prs') { &prs; }
elsif ($form{'action'} eq 'rif') { &rif; }
elsif ($form{'action'} eq 'pri') { &pri; }
elsif ($form{'action'} eq 'asq') { &asq; }
elsif ($form{'action'} eq 'paq') { &paq; }

INFO: (For example) to make a link to the Suggest This Site to a Friend Page we can now use:

Suggest This Site to a Friend

If you have a text file it would work the same way. For example if you had a file called site_rules.txt, then the elsif would be:

elsif ($form{'action'} eq 'site_rules.txt') { &site_rules.txt; }

The link would be:

Site Rules

3. In the "Print The Page Footer" section fine the following line:

print "

\n";

Copy and paste the following line just above it:

print "

[Suggest This Site to a Friend]

";


print "Offered By: $aliasCurrent Time: $nowtimeCloses: $closetime
Or $config{'aftermin'} minutes after last bid...Number of Bids: $#bids";

Remove:

5. Scroll down a few lines and find this line:

print "\n";

Copy and paste the following lines OVER it:

print "\"email\"  Suggest This Item to a Friend\n";
print "\"email\" Ask Seller a Question\n";
print "\n";

5. Upload postal.pl to your server, to the same directory as your EA Script and chmod it 755 or (rwx-rx--rx--). Upload the email.gif to your server, to the same directory as your auction script. Save and upload your auction.pl to your server.
Working with Data Files

Normally you will not work with the .dat files. When you do it may be because someone asked you to change their User Information, someone put the wrong information in an auction or you added a new form field to the EA Script.

When you installed EA Script, an auctiondata file was created. Within this file are three sub files, categories, closed and reg. The category contains all the information on all open auctions, (the name of the file is the auction close time), the closed file contains all the information on all Closed Auctions, and the reg file contains all the information on all Registered Users.

Open your FTP Software, download a .dat file to your computer, open in your text editor, and add or change whatever you need to. Save it and upload it back into the right directory. Remember… the script reads the .dat file as it was written, including blank lines. Don't add or delete blank lines or move data from one line to another.

If you added a variable to your script you'll have to change all existing files. For example if you added $condition then you would have to go through all open .dat files and add the condition or a notation.

I don't want to confuse you too much on how to do that and suggest that you create a test sale on your auction site. Download the test auction .dat to your computer and delete the .dat file on the server. Then download one of the open auctions .dat file and compare it against the test sale .dat. You'll see what needs to be added and where.

Considering adding to the add-on so that the item condition is displayed in the closed auctions. All it takes is a little time and understanding.

Subroutines
About Subroutines

The EA script is divided into two sections.

1. The Configuration section allows you to customize the script to your need.

2. The Main Program will contain the Page Header, elsif statements, Page Footer, and all the subroutines, (subs). The EA Script contains 27 subs. Some of these subs will be working in the background, and in others you will see the results when you or someone clicks a link.

To install an add-on, (sub) three things may happen. The add-on instruction will tell you which method to use.

1. You could add the sub to the very bottom of the script. If necessary the add-on instruction will tell you to make modifications in other locations in the EA Script.

2. You could replace an existing sub with a modified add-on version. If necessary the add-on instruction will tell you to make modifications in other locations in the EA Script.

3. You could install the add-on as an external file. The add-on instruction will tell you to make modifications in other locations in the EA Script. Subroutine Installation Tips

Sometimes the add-on instruction will say to modify every instance of this line, (sometimes "this line" is called a variable line or chomp line):

($title, $reserve, $inc, $desc, $image, @bids)

In the EA Script (partial listing), that line will appear as:

($title, $reserve, $inc, $desc, $image, @bids) = ;

chomp ($title, $reserve, $inc, $desc, $image, @bids);

my ($title, $reserve, $inc, $desc, $image, @bids) = &read_item_file($form{'category'},$file);

When the instructions say, for example to add "$something," you would go through the entire EA Script and modify it to look like this:

($title, $reserve, $inc, $desc, $image, $something, @bids);

Okay, sometimes an add-on will say something about a being configured for a virgin EA Script. All this means is that you may have to add variables from your auction script to your new add-on. If the new add-on does not say anything about configuration, then you may have to add additional variables from the add-on to your EA Script. For example, if your auction has this line ($title, $reserve, $inc, $desc, $image, $something, @bids); you'll have to add $something, to your new add-on.

All variables, in all lines have to be in the exact same order. If you do not add the variable you could end up with a blank page that displays just the header, or some pages will show 1969 or 1970 as the date, Number of Bids showing "-1", with Last Bid showing a blank spot. A variable is any information that can change, such as the title name for an item put up for sale.

I suggest you use your text editors' search and replace function, and remember to check your external files to make sure all lines are the same.

If you add - or remove - variables, all the old and current auction .dat files have to be altered to match the new chomp/variable lines. See Working with Date Files below.

And now the bad news - when you add a new variable you may have to edit closed auctions, current auction and registered users dat files, for some pages to display properly i.e. Display Item and View History are two. If you have a live auction and hundreds of closed auction data files, dozens of open auctions, and hundreds of registered users, it could be a problem (a lot of your time) editing all those dat files. If you have a test auction you could just delete the files.

Sometimes the add-on instructions will say to modify other lines. Just follow the add-on instructions and change all lines, if needed, and keep the variables in the same order. External Subroutine Files

Some add-on writers write their add-on as an external file. This is normally done in the interest of speed. If the add-on is placed in your EA script it will take a browser longer to load the auction. But if the add-on is getting little use why not put it in an external file? Then it will only load when needed.

The add-on instruction will say to save the file as (for example) "myaddon.pl", upload into the same directory as your auction, and chmod it, (NT users will not chmod). The instruction will also say to add a "require" statement to the top of you EA script. To add the statement go to the top of your EA script and add the "require" statement under "use strict;". A few add-on will say to modify "use vars qw(%config %category %form);"

#!/usr/local/bin/perl
use vars qw(%config %category %form %coolcats);
use strict;
require "myaddon.pl";

Modifying the Subroutines

Formatting Output with HTML

The are two ways to modify the subs. The first way is to modify with HTML. I suggest you start out by changing the visible look of your auction. Specifically the Page Header and Page Footer and tables in the subs.

In the Header you could delete the Site Name and add your own site banner or horizontal navigation bar. Do not change "$config{'header'} =<<"EOF";" or "EOF". EOF stands for End of Form. You can change EOF to anything you want, for example EOS (End of Sub). Just make sure both match and are flushed against the left side of the script. Do not indent it. If you do indent, some strange things may or may not happen. Use normal HTML or JavaScript between the tags.

In the Footer you could change the links into gif buttons, add a cool horizontal navigation image, or add some type of banner. Use normal HTML or JavaScript between the tags "$config{'footer'} =<<"EOF";" and "EOF".

Now is the time to modify the subs and now is the time to decide on the theme or layout of your auction. The best advice I can offer is to follow the rules for designing a web page. For example consider displaying the page name on each page so viewers know where they are. Consider writing your own instructions specific to each page.

The first pages your viewers will see is the Categories Page, (sub dispcat) consider writing a welcome message. Let your visitors know that browsing is free but registration is needed to sell or bid. Don't forget to provide a link to the Registration Page. (You can copy this link from the Footer.)

In other subs consider changing the table size or turning the table border off. Change the font, size, or color. For example the User Name and Password boxes appear through the auction. Why not change the "User Name" and "Password" font color to blue? The other boxes could be changed to a dark violet. When currency is used you could change it to green. The possibilities are endless, use you imagination.

You can also take the easy way out and purchase auction web sets from http://www.DynamicEnterprise.com/scripts/addons.html

We talked about using HTML with "$config{'header'} =<<"EOF";" and "$config{'footer'} =<<"EOF";".

There are two other ways to print the HTML that is used throughout the remainder of the script, "print <<"EOF";" and "print".

1. print <<"EOF" is used with EOF. HTML can be placed between these two tags. For example:

print <<"EOF"


Hello World

EOF

2. The second way the print statement is used, is for a small amount of HTML, or if the HTML is used with a conditional statement, (else, if, and, unless, or, etc.). See Examples below. a. The line starts with (print) and ends with (;). (print) means start an HTML line. (;) means end a HTML line. b. After (print) and before (;) you need to have the double quotation marks ("). This is used for data that may need to be analyzed or interpolated before processing. c. Sometime you will see (\n). The (\n) means New Line. What's the difference? HTML recognizes
to start a new line. Perl recognizes (\n) to start a new line. If you view the source code you can see how it works. Conditional Example: else { print "No bids were placed...
"; } Small Amount of HTML Example: Print "
Hello World
\n"; An important point you need to remember at all times. DO NOT USE THE FOLLOWING SYMBOLS IN YOUR HTML. The Single quotation marks ('), the semicolons (;), or the ampersand (&). These all have special meaning to Perl. If you must use one, escape it, (precede it) with a backslash. For example (\'), (\;), and (\&). The backslash tells Perl to ignore the following symbol. The word "don't" would look like "don\'t". Be aware of Perl line breaks. When using HTML you can break and start a new line in mid-sentence. If you break a Perl sentence in half you will get a server error. Do not break a line and do not let your text editor break a line in mid-sentence. Formatting Output with Perl The second way to modify a sub is with Perl. If you started out by changing the visible look of your auction, then you have learned quite a bit by now. We will not be "writing a sub". Writing Perl is way beyond the scope of this tutorial, there is just too much to learn. I strongly suggest you purchase books on the subject. In this tutorial we will be installing three subs and walking you through the installation process. Installing a Simple Add-on Your EA Script will run as-is. The question is do I want that? For example if you post an auction to run for 7 days the auction will not close. The auctions will only close when someone views that item after the 7 days is up, it could close a month later. Now if you don't want to look at every item every day then you may want to install a sub that will close it. There is a subroutine that will do this, it is simple to install and we will be using it. I would like to thank Lion for writing checkclosed, Michael Bruce and E-Z Auction Software for making it even better, and giving us permission to use it in this tutorial. 1. Copy the checkclosed sub below and paste it to the bottom of your EA Script. ################################################################# # Sub: checkclosed (lion) # checks all of the items, and closes the ones whose ran out of time # sub chkclose { my $cat; foreach $cat (keys %category) { opendir THEDIR, "$config{'basepath'}$cat" or next; my @allfiles = (readdir THEDIR); closedir THEDIR; my $file; foreach $file (@allfiles) { unless ($file eq "." || $file eq "..") { $file =~ s/^$config{'basepath'}$form{'category'}\///; $file =~ s/\.dat$//; if (my ($title, $reserve, $inc, $desc, $image, @bids) = &read_item_file($cat,$file)) { my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bids[$#bids if ((time > int($file)) && (time > (60 * $config{'aftermin'} + $time))) { if ($type eq 'Auction'){ &closeit($cat,$file); } elsif ($type eq 'Classified'){ &closeit2($cat,$file); } else { &closeit3($cat,$file); } } } } } } } ################################################################# 3. Now we need to format the sub name it in order to call it from another sub. The sub is named "chkclose". We will add an ampersand (&) to the front of chkclose and a semicolon (;) after chkclose so it looks like this: &chkclose; 4. Copy &chkclose; and paste it just under sub dispcat in your EA Script so it looks like this: sub dispcat { &chkclose; 5. Save and upload your auction.pl to your server. All done… now when anyone views your main categories the script you just installed will check all open auctions and close those which need to be closed. Installing an Intermediate Add-on Sometimes people will use a free email service such as MS Hotmail or NS WebMail to conduct illegal activities. People can and do post fictitious items, collect the money and move on. Other people will just bid on items with no intention of paying for it. By requiring your customers to use their dialup email account their name, address and phone number are on file with the ISP. Our next add-on will require that your customers use their dialup account. 1. Download to your hard drive and save as "domainnames.txt" and Free E-mail Blocker which is located on our auction script page at: http://DynamicEnterprise.com/scripts/addons.html 4. Open your FTP and upload the domainnames.txt to the same directory as your auction script and chmod it 644 (rw-r--r--). 5. Open your EverySoft Auction Script in your text editor. Anyplace in the Configuration Section place the following variable. Be sure to change the path. $config{'denydomain'} = '/path/to/auction/cgi-bin/domainnames.txt'; 4. Scroll down to the sub procreg and find: $form{'ALIAS'} = ucfirst(lc($form{'ALIAS'})); Add the following two lines below it: $form{'EMAIL'} = lc($form{'EMAIL'}); # Free E-mail Blocker &blockdomain; # Free E-mail Blocker 5. Copy and paste the Free E-mail Blocker add-on to the end of your auction script. NOTE: DO NOT USE THE COPY BELOW, THE "&oops" LINE IS BROKEN. ################################################################# # Free E-mail Blocker Add-on v1.1 # DynamicEnterprise.com/scripts/free_email_blocker.txt # Block Domain Sub sub blockdomain { my $denydomain; open(DENY,"$config{'denydomain'}") || die "Unable to open directory: $!"; my @denydomain = ; close(DENY); foreach $denydomain (@denydomain) { $denydomain =~ s/\s//g; &oops('This auction does not accept free e-mail accounts for registration. Please enter a different e-mail address.') if ($form{'EMAIL'} =~ /$denydomain\Z/); } } ################################################################# 6. Save and upload your auction.pl to your server. All done… now when new user register, the user's e-mails domain name is checked against a list and stops the registration process if there is a match. Installing an Advance Add-on You can never have enough advertising. So why not use your site to its fullest potential? With this next add-on registered users can recommend your auction site to someone, let someone know about an item up for auction or ask the seller a question about an item up for auction. Because this add-on is used as an external file you will have to download to your hard drive and save as "postal.pl" which is located on our auction script page. While you are there download the email icon too. http://DynamicEnterprise.com/scripts/addons.html. Be sure to save it as postal.pl, not as postal.txt. Save the email icon as email.gif. DO NOT COPY AND PASTE FROM THE TUTORIAL BELOW, LINES ARE BROKEN. COPY AND PASTE FROM POSTAIL.TXT 1. Open your EverySoft Auction Script in your text editor. At the top of the script find: use strict; Copy and paste the following just under it: require "postal.pl"; 2. Because we are going to use physical links you click, we need to format the links so Perl knows what we are trying to do. In the elsif section and add the following six lines under elsif ($form{'action'} eq 'search') { &procsearch; }: elsif ($form{'action'} eq 'rsf') { &rsf; } elsif ($form{'action'} eq 'prs') { &prs; } elsif ($form{'action'} eq 'rif') { &rif; } elsif ($form{'action'} eq 'pri') { &pri; } elsif ($form{'action'} eq 'asq') { &asq; } elsif ($form{'action'} eq 'paq') { &paq; } INFO: (For example) to make a link to the Suggest This Site to a Friend Page we can now use: Suggest This Site to a Friend If you have a text file it would work the same way. For example if you had a file called site_rules.txt, then the elsif would be: elsif ($form{'action'} eq 'site_rules.txt') { &site_rules.txt; } The link would be: Site Rules 3. In the "Print The Page Footer" section fine the following line: print "

\n"; Copy and paste the following line just above it: print "

[Suggest This Site to a Friend]

"; 4. Scroll down to sub dispitem section and fine the following line: print "Offered By: $aliasCurrent Time: $nowtimeCloses: $closetime
Or $config{'aftermin'} minutes after last bid...Number of Bids: $#bids"; Remove: 5. Scroll down a few lines and find this line: print "\n"; Copy and paste the following lines OVER it: print "\"email\" Suggest This Item to a Friend\n"; print "\"email\" Ask Seller a Question\n"; print "\n"; 5. Upload postal.pl to your server, to the same directory as your EA Script and chmod it 755 or (rwx-rx--rx--). Upload the email.gif to your server, to the same directory as your auction script. Save and upload your auction.pl to your server. Working with Data Files Normally you will not work with the .dat files. When you do it may be because someone asked you to change their User Information, someone put the wrong information in an auction or you added a new form field to the EA Script. When you installed EA Script, an auctiondata file was created. Within this file are three sub files, categories, closed and reg. The category contains all the information on all open auctions, (the name of the file is the auction close time), the closed file contains all the information on all Closed Auctions, and the reg file contains all the information on all Registered Users. Open your FTP Software, download a .dat file to your computer, open in your text editor, and add or change whatever you need to. Save it and upload it back into the right directory. Remember… the script reads the .dat file as it was written, including blank lines. Don't add or delete blank lines or move data from one line to another. If you added a variable to your script you'll have to change all existing files. For example if you added $condition then you would have to go through all open .dat files and add the condition or a notation. I don't want to confuse you too much on how to do that and suggest that you create a test sale on your auction site. Download the test auction .dat to your computer and delete the .dat file on the server. Then download one of the open auctions .dat file and compare it against the test sale .dat. You'll see what needs to be added and where. Considering adding to the add-on so that the item condition is displayed in the closed auctions. All it takes is a little time and understanding.

Home

© Copyright 2000 All Rights Reserved