Gossamer Forum
Quote Reply
CGI file rename problem?
hi,

I have just started learning about programming plugins and i am already stuck on the most basic task! Blush

i am trying to rename a CGI file without much success. It is part of a VERY SIMPLE plugin. i have edited the following files, making sure that the old name is substituted by the new one.

PLUGIN.cgi
PLUGIN.pm


However, I always get a INTERNAL SERVER error... The original Plugin works perfectly of course.

What am I doing wrong??? Crazy


Thanks.
Quote Reply
Re: [server0000] CGI file rename problem? In reply to
Hi,

You can't do that =) The;

package Plugins::Name;

part compiles it into that module name, so simple renaming it will cause 500 IS Errors.

You're best bet, is to try using the Plugin Wizard (Plugins > Plugin Wizard) Smile

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!
Quote Reply
Re: [Andy] CGI file rename problem? In reply to
I have used the Plugin Wizard to create the following CGI file to display a template sample.html. I added a file: zzz.cgi, and edited it in the wizard before installing. I am still getting a 500 IS error! Blush

=======================

#Code to display "sample.html" placed in templates directory

use strict;
use lib 'MY ADMIN PATH';
use Links qw/$IN $DB $CFG/;
use Links::SiteHTML;
use Links::Plugins;
use CGI::Carp qw(fatalsToBrowser);

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

Links::init('MY ADMIN PATH');


&show_form;


sub show_form {

print $IN->header();
print Links::SiteHTML::display('sample');

}
Quote Reply
Re: [server0000] CGI file rename problem? In reply to
Hi,

1) If thats all your code, then you need some headers =) Something like; (assuming its going in a file, for example testing.cgi)

Code:
#!/usr/bin/perl

use strict;
use lib '/path/to/admin';
use GT::Base;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$CFG $IN $DB $USER/;
use CGI::Carp qw(fatalsToBrowser);
use Data::Dumper;
use GT::Date;
use Links::SiteHTML;
use File::Copy;

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

Links::init('/path/to/admin');
Links::init_user();

print $IN->header();
print Links::SiteHTML::display('start');

If that still doesn't work, try running it from SSH/Telnet;

Code:
cd /path/to/folder
perl testing.cgi

..and see if that gives any more info :)

Hope that helps.

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!
Quote Reply
Re: [Andy] CGI file rename problem? In reply to
Hahaha!!! Great!!! It worked!!! Sly

Thanks a lot, Andy! Wink
Quote Reply
Re: [server0000] CGI file rename problem? In reply to
No worries Cool

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!