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

Creating new field in plugin..

Quote Reply
Creating new field in plugin..
Hi. I'm trying to get a new image field to be created when someone installs one of my plugins. I have this so far;

Code:
$DEBUG ? print "Setting up Image1 <BR>" : '';
my $exists = 0;
if (exists $DB->table('Links')->cols->{'Image1'}) { $exists = 1; }

if (!$exists) {
my $editor = $DB->editor ('Links');
$editor->add_col ('Image1', {
form_display => 'Image1',
form_type => 'FILE',
file_save_url => $CFG->{'build_root_url'} . "/images",
file_save_in => $CFG->{'build_root_path'} . "/images",
file_save_scheme => 'HASHED',
file_max_size => '25000',
regex => '(gif|jpg|png)$',
type => 'TEXT' }) || die $GT::SQL::error . "<BR>";
}

... but I keep getting this error :/

Quote:
Error running installation code: Can't call method "prepare" without a package or object reference at /home/ultranerds/imagesql.com/cgi-bin/admin/GT/SQL/Driver/MYSQL.pm line 36.

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] Creating new field in plugin.. In reply to
Nevermind. It was down to mySQL login details being incorrectly, after I made a password change for the same user, but on a different bit of software. Its all working now :)

Cheers

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!