Advanced Free For All Link List     


    Introduction

    The script is designed to be installed via FTP to a remote server running PERL 5 or higher. Designed for easy setup and configuration, AFFA is capable of powerful filtering that can prevent undesirable links being added to your site.

    Download and Installation

    To install AFFA, first click on your choice of download method and file format (see below) and download it to your computer. You will need to decompress the files that are contained in the AFFA archive. You can edit the top of the affa.pl file to reflect the directory path to your perl compiler and sendmail script. (You may turn off the email autoresponder by changing the "$mailon = 1 ;" to "$mailon = 0 ;" at the top of the affa.pl file) Then edit the affa.cfg file to reflect the settings you need to run AFFA. Pay particular attention to the directory paths for the required files.

    Method File format Type Command used to extract
    HTTP affa.zip Compressed Zip unzip affa.zip


    The archive contains 10 files.
    affa.pl - The perl script.
    affa.cfg - The configuration file.
    header.htm - The header is attached to the top of the link list.
    footer.htm - The footer is attached to the bottom of the link list.
    db.txt - An empty file used to store the links.
    email.txt - A template to change to modify the email autoresponse.
    affanow.gif - AFFA gif file to be uploaded to the site if left in the header.htm
    manual.txt - The instruction manual for AFFA.
    history.txt - The release and revision history of AFFA.
    licence.txt - The software licence for using AFFA.
    The last 3 files are not required to make the script work and should not be uploaded to your website.

    It is advised that you place all the files in the one directory. You must ensure that the directory chosen is permitted to run CGI or PERL scripts. The email.txt file must be placed in the same directory as the affa.pl and affa.cfg files (the affanow.gif file should also be in this directory if used). The db.txt, header.htm and footer.htm files may be placed in any directory as long as the directory path is set in the affa.cfg file.

    When the files have been placed on your server, you must CHMOD the affa.pl file to 755. The db.txt file must then be set to CHMOD 666.

    The script can be loaded in your web browser in one of 2 ways. The first is calling the affa.pl file directly. For example:
    http://www.yourdomain.com/directory/affa.pl
    In which case, do not supply a target file in the affa.cfg file.
    Or you can load a page created by AFFA, like this:
    http://www.yourdomain.com/directory/links.htm
    To install the script like this, you must specify a target file in the affa.cfg file and then create an empty file called links.htm and upload it to the server so it is the same path as set in the affa.cfg file. Then CHMOD the links.htm file to 666. You must then change the HTML in the header.htm file.

    The first method (directly loading the script) is recommended.

    Customizing AFFA

    AFFA automatically generates an HTML file by first pre-pending a header HTML file, then formatting and laying-out the database file of links and finally by appending a footer HTML file. Sample header and footer HTML files are supplied with this distribution.

    The main things you may wish to change are the Administrator email and the TextReject field, which lists words that the script will not accept in a posting.

    You will probably want to change the header.htm and footer.htm files to add your company details, advertising and some links. Just be careful not to alter the working parts of the page. It is best to make a spare copy of the original file before altering it.

    You can use AFFA as-is straight away (you should put your email address in the Administrator field in the affa.cfg file however), or customize nearly every aspect of its operation. AFFA is configured through a configuration file (`AFFA.cfg') that you can edit with a text editor. The file itself contains comments (any line starting with a `#') that describe each of the options. In summary, the following configuration options are available:

    • The location (path) of any of the files; in particular,
      • TargetFile - the HTML file to create
      • HeaderFile - the HTML header to pre-pend to target file
      • FooterFile - the HTML footer to append to target file
      • DatabaseFile - the database file of links
      • LogFile - the log file for postings
    • Administrator - the e-mail address to send notifications to.
    • CategoryTemplate - the template used for displaying each of the categories.
    • LinkTemplate - the template used for displaying each of the links.
    • TextReject - a list of keywords which, if contained in the posting, should cause a rejection.
    • TextRejectMessage - the message to display when a TextReject occurs.
    • CaseTransform - whether to automatically drop second and subsequent letters in a word to lower-case to prevent `shouting' (all caps)
    • CaseReject - the number of words posted in all-caps to cause a rejection.
    • CaseRejectMessage - the message to display when a CaseReject occurs.
    • DuplicateURLReject - whether to reject duplicate URLs (based on path, not just on filename).
    • DuplicateURLRejectMessage - the message to display when a DuplicateURLReject occurs.
    • MaximumCount - the maximum number of links to hold; oldest links are moved where necessary.
    • MaximumSize - the maximum size of the database file (in Kb); oldest links are moved where necessary.
    • DomainReject - which domains to reject postings for.
    • DomainRejectMessage - the message to display when a DomainReject occurs.
    • Lifespan - the maximum lifespan (in days) of a posting, before it is automatically removed.
    • TestURL - whether to automatically testing URLs during posting, to ensure that it is valid.
    • TestURLTimeout - how long to wait before deciding that a URL is invalid during testing.
    • TestURLMessage - the message to display if a URL is tested false.
    • SortOrder - whether to display new postings at the end, at the start or in alphabetical order.
    • SubstituteList - how to alter the posting before it gets tested or posted.
    • Categories - which categories to permit and to display, and in which order.
    • CategoryRejectMessage - message to display if an unknown category is posted.
    • CategoryParam - the name of the supplied category parameter for posting.
    • TitleParam - the name of the supplied title parameter for posting.
    • UrlParam - the name of the supplied URL parameter for posting.
    • DescriptionParam - the name of the supplied description parameter for posting.
    • MaxTitleLen - the maximum length of title (longer than this will be truncated).
    • MaxDescriptionLen - the maximum length of description (longer than this will be truncated).
    • RejectIfTooLong - reject postings where the title or description exceed MaxTitleLen and MaxDescriptionLen respectively, rather than merely truncating.
    • MaxURLLen - maximum allowed length for the URL.
    • RejectIfTooLongMessage - message to display if a rejection occurs based on length of URL, title or description.
    • MinTitleLen - the minimum length of title allowed.
    • MinDescriptionLen - the minimum length of description allowed.
    • MinURLLen - the minimum length of URL allowed.
    • RejectIfTooShortMessage - message to display if a rejection occurs based on length of URL, title or description.
    • AcceptMessage - message to display when a posting is accepted.
    • URLPrefixAccept - URL prefixes (such as http:// or ftp://) to accept.
    • Delimiter - the character(s) to split lists of items in the config file.

    Troubleshooting

    System Errors

    System Error 1
    AFFA was unable to open the database file for updating; this is almost always caused by incorrect permission settings on the database file.
    System Error 2
    You have enabled automatic URL-testing, however AFFA could not find the necessary library (PERL library Socket.pm) to achieve this. Check your PERL installation, or disable automatic URL-testing.
    System Error 3
    You have configured an invalid substitution in the config file (SubstituteList). Please check the substitution format carefully.
    System Error 4
    AFFA was unable to open the target HTML file for updating; this is almost always caused by incorrect permission settings on the target HTML file file.
    System Error 5
    AFFA was unable to open the log file for updating; this is almost always caused by incorrect permission settings on the log file.
    System Error 6
    The config file could not be opened for reading. The config file should be named `AFFA.cfg' in the same directory as AFFA, unless otherwise in the header of AFFA (edit the script to modify).
    System Error 7
    The config file contains an error at the line given. Check for syntax errors and typos.