Gossamer Forum
Quote Reply
Plugins...
Ok, I'm new to all this plugin stuff...so please bear with me ;) I've got up up to the stage where it is asking for 'Install Code'. What exactly would I put there? I'm a bit confused here. The rest of it has been pretty simple...just this bit I'm stuck on really ;)

Any help would be much appreciated.

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: [A.J.] Plugins... In reply to
Mmm...found the documentation for most of it....but I'm still having a few problems :(

I'm getting the following error when trying to do an install of the Ace_PPC_Banner.tar file;

Quote:
unning installation code: Can't call method "name" on an undefined value at (eval 1) line 84.

Line 84 is this;

Code:
$file->name("$CFG->{admin_root_path}/../click.php");

Anyone got any ideas? I've uploaded a copy of install.pm if its any help ;) Also got another little weirdf problem...for some reason the version number is coming up as 2 squares. In install.pm I have it set as 1.0.1, but its getting screwed up somewhere along the lines...anyone seen that before?

Thanks in advance to anyone who replys...it is appreciated ;)

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!

Last edited by:

A.J.: Apr 12, 2002, 3:42 AM
Quote Reply
Re: [Andy.] Plugins... In reply to
Hi,

One of your tar files did not extract. Add:

my $class = 'Plugins::Ace_PPC_Banner';

before my $file line, and then change each:

$file = $tar->get_file ('click.php');

to:

$file = $tar->get_file ('click.php') or return $class->error("Unable to extract click.php ($GT::Tar::error)");

and you should see the error message.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Plugins... In reply to
Thanks Alex for the reply...I'm not having very much luck with this plugin stuff ;) When I edited Install.pm, and then saved I got the error:

Unable to save file: There was an error reading from GLOB(0x8337178),85504. Expected to read 4096 bytes, but only got 1024.

Any ideas?

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.] Plugins... In reply to
You probably made a syntax error. Click "Perl Check"

Last edited by:

Paul: Apr 13, 2002, 3:02 AM
Quote Reply
Re: [Paul] Plugins... In reply to
Thats the problem though. Cos it won't let me save to do the Perl Check on :(

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.] Plugins... In reply to
Oh yeah didn't see that bit...normally when you make a syntax error it still saves and you can click Perl Check....hmm Ive not seen that error before.

Sounds like maybe the tar is corrupt.

Last edited by:

Paul: Apr 13, 2002, 3:26 AM
Quote Reply
Re: [Paul] Plugins... In reply to
Damn..thats what I was worried about too. I've decided I'm gonna do a few smaller plugins first to get used to it all, then go back to making this script into a plugin.

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.] Plugins... In reply to
Ok..I'm getting there with the PPC Banner plugin...problem I'm having now is trying to work out how to add a new <%tag%> Frown Anyone got any pointers? BTW, the tag needs to be added to the 'globals', rather than main tags...not sure if this makes it any easier...lol

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!

Last edited by:

Andy.: Apr 13, 2002, 9:32 AM
Quote Reply
Re: [Andy.] Plugins... In reply to
Hi,

If you want to add a global, try something like:

my $template_set = $CFG->{build_default_tpl};
my $globals = GT::Config->load($CFG->{admin_root_path} . "/templates/$template_set/globals.txt", { inheritance => 1, compile_subs => 'Links', local => 1, cache => 1 });
$globals->{newkey} = 'new value';
$globals->save;

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Plugins... In reply to
Thanks, that worked great. Almost ready to release my plugin now :D Just gotta do some stuff on the un-install side of it, and the readme, but thats about it.

Thanks everyone for your help so far Smile

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: [Alex] Plugins... In reply to
Ack... I knew it was going too well to be true. For some reason I'm getting this error now;

Error running installation code: Can't locate object method "load" via package "GT::Config" at (eval 1) line 138.

This line is;

my $globals = GT::Config->load($CFG->{admin_root_path} . "/templates/$template_set/globals.txt", { inheritance => 1, compile_subs => 'Links', local => 1, cache => 1 });

Anyone got any ideas?

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.] Plugins... In reply to
....and did you require GT::Config ??
Quote Reply
Re: [Paul] Plugins... In reply to
Thats weird...I cant find it anywhere....it shouldnt have worked without it should it? Cos about an hour ago I had it working fine, and then global was added fine. Maybe I deleted it by accident Frown Thanks for reminding me about the importance of requiring the module..LOL

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: [Paul] Plugins... In reply to
Oooh...this is weird! I added 'use GT:Config;' in the code below, but now when I save it I get an error;

Quote:
package Plugins::PPC_Banner;
# ==================================================================
use strict;
use vars qw/$VERSION $DEBUG $NAME $META/;
use GT::Base;
use GT::Config;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$CFG $IN $DB/;

The error is;

Unable to load install file: Unable to load plugin PPC_Banner Reason: Install.pm does not compile: Can't locate GT/Config.pm in @INC (@INC contains: /home/ace-clipart.com/public_html/directory/cgi/admin /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at (eval 1) line 17. BEGIN failed--compilation aborted at (eval 1) line 17.

Anyone got any ideas?

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.] Plugins... In reply to
Well the first thing is to make sure you have GT::Config Crazy
Quote Reply
Re: [Paul] Plugins... In reply to
Erm..just said I DO have it now...but I'm getting a compilation error :(

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.] Plugins... In reply to
Thats not what I meant. I mean make sure it exists in the GT directory.
Quote Reply
Re: [Paul] Plugins... In reply to
Oooh...very odd. Its not. How could that have been deleted? Is the a file within apache or somewhere I can look at to see who/what deleted it?

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.] Plugins... In reply to
Hi,

Are you using 2.1.0? This would only work on 2.1.0.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Plugins... In reply to
Yup. 2.1.0 stable.

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!