Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Getting user defined variables?

Quote Reply
Getting user defined variables?
I'm just having a play with user variables (i.e the ones users can define for plugins).

I keep getting the following problem though;

Quote:
A fatal error has occured:

Can't locate object method "get_plugin_user_cfg" via package "Links::Plugins" at /home/dumps/public_html/templates/admin/Plugins/Guess.pm line 37.

Please enable debugging in setup for more details.

The code I am using at the moment is;

Code:
# ==================================================================
# Plugins::Guess - Auto Generated Program Module
#
# Plugins::Guess
# Author : Andy Newby
# Version : 1
# Updated : Wed Jun 12 14:22:04 2002
#
# ==================================================================
#

package Plugins::Guess;
# ==================================================================

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

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

# Your code begins here! Good Luck!


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

sub Make_HTML {
# -------------------------------------------------------------------
# This subroutine will get called whenever the user clicks
# on 'Make_HTML' in the admin menu. Remember, you need to print
# your own content-type headers; you should use
#
print $IN->header();
#
my $opts = Links::Plugins->get_plugin_user_cfg('MyLinks_DB');

my $max = $opts->{'Max_Num'};
my $min = $opts->{'Min_Num'};

print $max . "and" . $min;

}


# Always end with a 1.
1;

Any ideas are welcome. I'm stuck as to what I'm doing wrong :(

Thanks

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Getting user defined variables? In reply to
You need to include

use Links::Plugins;

at the beginning of your module.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Getting user defined variables? In reply to
Ah..knew it had to be something simple Tongue I was looking at use GT::Plugins; , thinking that was what I needed, but in fact it was Links, and not GT Wink

Thank

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!