Ok, now this currently doesn't support hit tracking or anything. It's just a very basic mod that's based on the Random link function in the jump.cgi file. (Don't know if it works with templates or not... haven't tried it)
In the nph-build.cgi file add this line to the sub build_home_page function:
Underneath the following code:
Code:
print "\tOpening page: $build_root_path/$build_index\n";
Place:
Code:
my ($rand, $find);
# Get the random line from the url lookup database.
srand;
$find = 0; $rand = int (rand ($grand_total + 0.5)); ($rand == $grand_total) and ($rand--);
open (URL, "<$db_links_name") or &error ("unable to open url database: $db_url_name. Reason: $!");
while (<URL> ) {
$find++ == $rand or next;
/\d+$delim(.+)/o or next;
$goto = $1;
last;
}
close URL;
$goto or &error ("Can't find random line: $rand.");
@site_info = split(/\Q$db_delim\E/, $goto);
And underneath the following code:
Code:
open (HOME, ">$build_root_path/$build_index") or &cgierr ("unable to open home page: $build_root_path/$build_index. Reason: $!");
$category = &site_html_print_cat (@rootcat) if ($#rootcat >= 0);
$total = $grand_total;
Place:
Code:
$site = $site_info[1];
$url = $site_info[2];
Ok, now you have the option to use the $site and $url in the site_html.pl file under site_html_home.