Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [doublemint] Using templates to generate "Static Pages"

Quote Reply
Re: [doublemint] Using templates to generate "Static Pages" In reply to
Hi,

the plugin worked fine in 2.0.0 but is not working as fine in Version 2.0.2. This is preventing easy upgrades. Frown

First Issue: File System structure has changed

In Version 2.0.2 plugins are in admin/Plugins/DBsql (before it was admin/Plugins). When you upgrade an existing installation the Plugin Manager is not any longer finding the Plugins already installed.
Workaround:
1. You need to reinstall the distributed tar file.
2. You need to insert ::DBsql in any function call (e.g. hook install and uninstall sections etc.) of the Plugin Files.
3. If applicable you need to change your functions calls in your templates and add ::DBsql

Second Issue:
I found it easier to rebuild the plugin using the wizzard.Unsure But it has at least one bug with the new file system structure. The install.pm is inserting wrong hook calls (the ::DBsql is missing).
Workaround: patch those calls to $mgr->install_hooks and $mgr->uninstall_hook by inserting the missing ::DBsql


Third Issue:
After Processing the plugin DBsql ist sarching a template named "1". I don't know where that Problem is located. It might be the Plugin itself, because the GT XML sample plugin does not have this problem.
Workaround: Provide an empty file name "1" in the templates directory.

For reference here is the plugin code. It is hooked to home. So you can call it with db.cgi?do=home&page=the/page/to/show.html&db=yourdb. The html file needs to be in the template directory.
Code:
sub page {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'home'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my ($args) = @_;

# Do something useful here
my $file = $args->{cgi}->{page} || '' ;
$file or return $args;
#check if user passed on some tricks in filename
unless ($file =~ m,^([-\w. \/]+)$, and $file !~ m,\.\.,) {
return $args->error("Invalid page $file");
}
# you can add some vars and return to the template here, good luck
$args->print ($file,{});
GT::Plugins->action ( STOP );
}

Any Help would be appriciated!

Thanks


Subject Author Views Date
Thread Using templates to generate "Static Pages" Bearwithme 15614 Oct 29, 2001, 3:19 PM
Thread Re: [Bearwithme] Using templates to generate "Static Pages"
doublemint 15031 Oct 29, 2001, 6:11 PM
Thread Re: [doublemint] Using templates to generate "Static Pages"
Bearwithme 15152 Oct 29, 2001, 6:55 PM
Thread Re: [Bearwithme] Using templates to generate "Static Pages"
doublemint 15155 Oct 29, 2001, 7:57 PM
Thread Re: [doublemint] Using templates to generate "Static Pages"
Bearwithme 15188 Oct 29, 2001, 9:02 PM
Post Re: [Bearwithme] Using templates to generate "Static Pages"
604 14996 Nov 1, 2001, 11:19 AM
Thread Re: [Bearwithme] Using templates to generate "Static Pages"
ktt 15161 Oct 30, 2001, 7:57 AM
Post Re: [ktt] Using templates to generate "Static Pages"
Bearwithme 15112 Oct 30, 2001, 9:52 AM
Thread Re: [ktt] Using templates to generate "Static Pages"
doublemint 15155 Oct 30, 2001, 4:48 PM
Thread Re: [doublemint] Using templates to generate "Static Pages"
doublemint 15125 Oct 30, 2001, 4:56 PM
Post Re: [doublemint] Using templates to generate "Static Pages"
Alex 15122 Oct 30, 2001, 5:30 PM
Thread Re: [doublemint] Using templates to generate "Static Pages"
ktt 15171 Nov 10, 2001, 9:51 PM
Thread Re: [ktt] Using templates to generate "Static Pages"
jean 15002 Nov 12, 2001, 9:54 AM
Post Re: [jean] Using templates to generate "Static Pages"
ktt 14987 Nov 12, 2001, 12:12 PM
Thread Re: [jean] Using templates to generate "Static Pages"
gatman 14958 Dec 31, 2001, 9:37 AM
Thread Re: [gatman] Using templates to generate "Static Pages"
gatman 15005 Jan 3, 2002, 2:28 PM
Thread Re: [gatman] Using templates to generate "Static Pages"
jean 15024 Jan 3, 2002, 6:21 PM
Thread Re: [jean] Using templates to generate "Static Pages"
gatman 14990 Jan 4, 2002, 7:48 AM
Post Re: [gatman] Using templates to generate "Static Pages"
jean 14833 Jan 4, 2002, 9:48 AM
Thread Re: [gatman] Using templates to generate "Static Pages"
jean 14982 Jan 4, 2002, 11:28 AM
Post Re: [jean] Using templates to generate "Static Pages"
gatman 6702 Jan 7, 2002, 9:16 AM
Thread Re: [jean] Using templates to generate "Static Pages"
gatman 6769 Jan 8, 2002, 3:13 PM
Thread Re: [gatman] Using templates to generate "Static Pages"
604 6691 Jan 8, 2002, 4:20 PM
Thread Re: [TheStone] Using templates to generate "Static Pages"
gatman 6703 Jan 9, 2002, 5:24 AM
Thread Re: [gatman] Using templates to generate "Static Pages"
604 6638 Jan 9, 2002, 9:18 AM
Thread Re: [TheStone] Using templates to generate "Static Pages"
gatman 6503 Jan 10, 2002, 7:56 AM
Post Post deleted by TheStone
604 6488 Jan 10, 2002, 9:27 AM
Thread Re: [gatman] Using templates to generate "Static Pages"
jean 6604 Jan 16, 2002, 12:21 PM
Thread Re: [jean] Using templates to generate "Static Pages"
gatman 6737 Jan 16, 2002, 3:24 PM
Thread Re: [gatman] Using templates to generate "Static Pages"
604 6572 Jan 16, 2002, 3:33 PM
Post Re: [TheStone] Using templates to generate "Static Pages"
gatman 6440 Jan 16, 2002, 4:06 PM
Thread Re: [gatman] Using templates to generate "Static Pages"
jean 6557 Jan 16, 2002, 3:58 PM
Post Re: [jean] Using templates to generate "Static Pages"
gatman 6499 Jan 16, 2002, 4:12 PM
Post Re: [gatman] Using templates to generate "Static Pages"
604 14910 Jan 4, 2002, 9:49 AM
Thread Re: [ktt] Using templates to generate "Static Pages"
Bearwithme 15023 Nov 13, 2001, 3:51 AM
Thread Re: [Bearwithme] Using templates to generate "Static Pages"
jean 15065 Nov 13, 2001, 1:09 PM
Post Re: [jean] Using templates to generate "Static Pages"
Bearwithme 15012 Nov 13, 2001, 1:19 PM
Post Re: [doublemint] Using templates to generate "Static Pages"
ktt 15024 Oct 31, 2001, 11:55 AM