Gossamer Forum
Quote Reply
Overriding Build_Ratings
Alex,

I'd like to override the subroutine in build.pm

It looks like in order to do that, though, I have to bypass the entire build_rating (create_ratings) stuff in the nph_build.cgi.

What I reall want to do:

Code:
sub _build_ratings {
# ------------------------------------------------------------------
# Generate the ratings page.
#
_time_start();

my $page = $CFG->{build_ratings_path} . "/" . $CFG->{build_index};
my $url = $CFG->{build_ratings_url} . "/" . $CFG->{build_index};

$USE_HTML ?
print "Building <a href='$url' target='_blank'>Top Rated</a> ... \n" :
print "Building Top Rated ... \n";

($CFG->{build_ratings_path} =~ m,^$CFG->{build_root_path}/(.*)\s*$,) and _build_dir($1);
open (PAGE, "> $page") or _cant_open($page, $!);
>>> print PAGE Links::Build::build ('rating', {}); <<< override this function
close PAGE;
my $perms = oct ($CFG->{build_file_per});
chmod ($perms, $page);

print "Done (", _time_display(), " s)\n\n";
}
But still use the standard print the page routines.

This is a good example of what I was meaning by a _pre_, _post_ and _committ_ type hook. The _committ_ hook would in this function override the line above, leaving the shell/engine of the build intact.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://LinkSQL.com/FAQ


Subject Author Views Date
Thread Overriding Build_Ratings pugdog 2917 Feb 8, 2001, 11:37 AM
Post Re: Overriding Build_Ratings
Alex 2829 Feb 8, 2001, 12:07 PM