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

Plugins - how toi print out content, and stop "1" showing at bottom of page?

Quote Reply
Plugins - how toi print out content, and stop "1" showing at bottom of page?
Hi,

I'm trying to write something that works with:

gforum.cgi?action=guestbook

Now, this works fine:

Code:
sub main {
# -----------------------------------------------------------------------------
# This subroutine will be called whenever the hook 'main' is run. You
# should call GT::Plugins->action(STOP) if you don't want the regular
# 'main' code to run, otherwise the code will continue as normal.
#
my (@args) = @_;

# Do something useful here
if ($IN->param('action') eq "guestbook") {

use GForum::Template;

my $do = $IN->param('do');
if (!$do) {
print $IN->header();
print GForum::Template->parse_print('error.html', { error => "FOO" } );
exit;
}
GT::Plugins->action(STOP);
}


return @args;
}

(the error.html bit is just to test the GForum::Template parsing bits :))

However, at the bottom of the page it shows:

Quote:
1

I've attached a screenshot.


I've also tried:

Code:
sub main {
# -----------------------------------------------------------------------------
# This subroutine will be called whenever the hook 'main' is run. You
# should call GT::Plugins->action(STOP) if you don't want the regular
# 'main' code to run, otherwise the code will continue as normal.
#
my (@args) = @_;

# Do something useful here
if ($IN->param('action') eq "guestbook") {

use GForum::Template;

my $do = $IN->param('do');
if (!$do) {
print $IN->header();
return GForum::Template->parse_print('error.html', { error => "FOO" } );
}
GT::Plugins->action(STOP);
}


return @args;
}

..but that prints out error.html, and then shows the normal pagePirate

Whats the correct way for printing out in GForum? I remember doing some stuff with PMManager back in 2004 - but all I can see in there, is stuff like:

return GForum::Template->parse_print('pmmanager_folder_page_sent.html', { pm_list => \@pms, %$vars } );

..and somehow, that seems to work right - so I'm not sure what I'm doing wrong :(

TIA for any suggestions .. in the mean time, I'll keep playing here =)

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!

Last edited by:

Andy: Feb 21, 2008, 4:47 AM
Subject Author Views Date
Thread Plugins - how toi print out content, and stop "1" showing at bottom of page? Andy 3360 Feb 21, 2008, 4:44 AM
Post Re: [Andy] Plugins - how toi print out content, and stop "1" showing at bottom of page?
Andy 3190 Feb 22, 2008, 8:57 AM
Thread Re: [Andy] Plugins - how toi print out content, and stop "1" showing at bottom of page?
Wychwood 3189 Feb 22, 2008, 10:47 AM
Post Re: [Wychwood] Plugins - how toi print out content, and stop "1" showing at bottom of page?
Andy 3177 Feb 22, 2008, 11:48 PM