Gossamer Forum
Home : Products : DBMan SQL : Development, Plugins and Globals :

Problems calling Plugin

Quote Reply
Problems calling Plugin
Hi,

I've written a plugin, which should return an URL belonging to an ID.

But if I call the plugin via template

<%Plugins::myJump($ID)%>

I always get this error:

Quote:


Error: Unable to load module: Plugins. Reason:


Can't locate Plugins.pm in @INC (@INC contains: /var/www/cgi-bin/dbase/admin /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at GT::Template::_call_func line 730.




Does anyone knows what the problem is??

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.

Last edited by:

ManuGermany: Feb 12, 2003, 3:11 AM
Quote Reply
Re: [ManuGermany] Problems calling Plugin In reply to
I think that you've missed the plugin name, ie. <%Plugins::Dbsql::plugin_name::func_name%>

TheStone.

B.
Quote Reply
Re: [TheStone] Problems calling Plugin In reply to
Do I have to create a separate function??

I've also tried:

<%Plugins::Dbsql::myJump($ID)%>

and got the error above plus another error

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.
Quote Reply
Re: [ManuGermany] Problems calling Plugin In reply to
You are still missing out part of the tag.

You need Plugins plus Dbsql plus your plugin name and _then_ the function.
Quote Reply
Re: [Paul] Problems calling Plugin In reply to
O.K.,

it's the main function, but as I understand, I have to give it a function-name.

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.
Quote Reply
Re: [ManuGermany] Problems calling Plugin In reply to
Didn't the plugin wizard create a function template for you?...like:

sub your_function {
# This function will get called ..blah


}
Quote Reply
Re: [Paul] Problems calling Plugin In reply to
No, just the about -admin option, because I hadn't defined another one.

I was thinking, it will work, if I but the code into the main-function:

Quote:


# ==================================================================
# Plugins::Dbsql::myJump - Auto Generated Program Module
#
# Plugins::Dbsql::myJump
# Author : Manuel Kester
# Version : 1.0
# Updated : Tue Feb 11 11:14:47 2003
#
# ==================================================================
#

package Plugins::Dbsql::myJump;
# ==================================================================

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

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

# Your code begins here! Good Luck!


# we need a header to be printed :D
print $IN->header();

# setup the variables, and my declerations...
my $ID = $IN->param('ID');
my $idcheck;
my $URL;
my $StoreID;

# verify they even sent an ID number!
if (!$IN->param('ID') || !($ID =~ /^\d+$/)) { print "Cant find ID number: $ID"; exit; }

# verify that the ID actually exists...
my $table = $DB->table ('Produkte');
if (my $sth = $table->select( { ID => $ID }, ['ID'] )) {
$idcheck = $sth->fetchrow;
}

# if $id isn't defined, then we can't have a link in the database by that number!
if (!$idcheck) {
# if the ID wasn't found...give em a nice message :p
print "Cant find ID number: $ID";
exit;
} else {

# get URL from ID
my $table = $DB->table ('Produkte');
if (my $sth = $table->select( { ID => $ID }, ['URL'] )) {
$URL = $sth->fetchrow;
}


return $URL;


}



# ADMIN MENU OPTIONS
# ===================================================================

sub about {
# -------------------------------------------------------------------
# This subroutine will get called whenever the user clicks
# on 'About' in the admin menu. Remember, you need to print
# your own content-type headers; you should use
#
# print $IN->header();
#

}

# Always end with a 1.
1;

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.