Gossamer Forum
Home : Products : Others : Gossamer Community :

GT::Template in comm

Quote Reply
GT::Template in comm
Hi,

Got a a bit of a weird one in GComm :/ (v1.1.1)

This routine:

Code:
sub Make {

print $IN->header();

use GT::Template;

my $sth = $DB->table('comm_users')->select() || die $GT::SQL::error;
open(WRITEIT,">$CFG->{path_private}/mailshot.txt") || die qq|Cant write $CFG->{path_private}/mailshot.txt. Reason: $!|;
while (my $user = $sth->fetchrow_hashref) {
print WRITEIT GT::Template->parse_print("$CFG->{path_private}/templates/$CFG->{system_template_set}/mailshot_temp.html", $user );
}

return "DONE!";
}

...prints out what I want ion mailshot.txt on the screen, and simply just puts this in mailshot.txt:

Code:
111111111111111111111111111111111111111111

I'm guessing the "1" is something to do with a default "true" or something in Gcomm , but I can't work out why it won't print what I want to the txt file :(

TIA for any help.

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] GT::Template in comm In reply to
No, because parse_print prints to STDOUT. You're printing the return value (1) of parse_print to your file. Just call parse().

Adrian
Quote Reply
Re: [brewt] GT::Template in comm In reply to
Hi,

Aha! Thanks for explaining, works like a charm now <G>

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!