NAME
ASP::NextLink - Perl implementation of the NextLink ASP component
SYNOPSIS
require ASP::NextLink;
$nl = new ASP::NextLink('linkfile.ext');
$current = $nl->GetListIndex;
for $idx (1..$nl->GetListCount) {
my $url = $nl->GetNthURL($idx);
my $desc = $nl->GetNthDescription($idx);
if ($idx == $current) {
print qq(<A href="$url">$desc</A><BR>);
}
else {
print qq(<B>$desc</B>);
}
}
DESCRIPTION
ASP::NextLink is a Perl implementation of MSWC.NextLink, ASP's content-linking component for use with Apache::ASP.
NOTES
ASP::NextLink is NOT functionally equivalent to MSWC.NextLink. Whereas each method of MSWC.NextLink takes a file argument, ASP::NextLink takes a file argument ONLY in the constructor ( ASP::NextLink->new("linkfile") ). new() parses the linkfile given; the information derived from this linkfile is subsequently available only through the object returned by new().
Attempts to call object methods on a class and attempts to call class methods on an object will both trigger an exception.
However, in the interest of portability of algorithms to ASP::NextLink, indexes passed to the GetNth*() methods remain 1-based, as they are in MSWC.NextLink.
USE
require ASP::NextLink;
METHOD REFERENCE
new( linkfile )
The new() class method accepts a virtual or relative path. (Paths handed to new() are run through the $Server->MapPath() method.) new() returns a reference to an ASP::NextLink object.
my $linkfile = "/links.txt";
my $nl = ASP::NextLink->new( $linkfile );
From now we will refer to the object returned by new() as $nl.
GetListCount()
Returns the number of links (lines containing tab-separated fields) in link file.
my $count = $nl->GetListCount();
GetListIndex()
Index of the current page in the link file.
GetPreviousURL()
URL of the previous page in the link file.
GetPreviousDescription()
Description of the previous page in the link file.
GetNextURL()
URL of the next page in the link file.
GetNextDescription()
Description of the next page in the link file.
GetNthURL( n )
URL of the nth page in the link file. NOTE: Index is 1-based, NOT zero-based.
GetNthDescription( n )
Description of the nth page in the link file. NOTE: Index is 1-based, NOT zero-based.
AUTHOR
Tim Hammerquist <cafall@voffice.net>
HISTORY
SEE ALSO
ASP(3)