Gossamer Forum
Home : Products : Gossamer Links : Discussions :

calling plugin from user end cgi script

Quote Reply
calling plugin from user end cgi script
hello

can anyone tell/show me how to use/call a "mine.pm" file from a user side "mine.cgi" script? i can't figure it out for the life of me...

this is what I have placed inside the Plugins folder - it is called Mine.pm.

Code:

package Plugins::Mine;
# ==================================================================

use strict;
use GT::Base;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$CFG $IN $DB/;

# Inherit from base class for debug and error methods
@Plugins::Mine::ISA = qw(GT::Base);

sub handle {
# -------------------------------------------------------------------

print $IN->header();
print Links::SiteHTML::display('error', { error => "YOU MADE IT THIS FAR" });

}

# Always end with a 1.
1;

This is what I have in my top level cgi folder, alongside add.cgi and modify.cgi etc - the cgi file is called "mine.cgi".

Code:
#!/usr/bin/perl
# ==================================================================

use strict;
use lib '/mnt/raid/www/newzealand/weblinks2/admin';
use Links qw/$CFG/;
use Plugins::Mine;

local $SIG{__DIE__} = \&Links::fatal;

Links::init('/mnt/raid/www/newzealand/weblinks2/admin');
Links::init_user();

if (GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'check_request', \&Links::check_request)) {

IS THE ABOVE CORRECT & HOW DO I GET IT TO RUN THE HANDLE SUB ROUTINE

}

thanks

r