Try this global:
sub {
my $tags=shift;
my ($output,$sth,$user);
my $owner=$tags->{LinkOwner}; #this may need changing to tag containing username
use lib('/path/to/forum/admin'); #change
my $db = GT::SQL->new('/path/to/forum/admin/defs')->table('User');#change
my $forumid = $db->select ( { user_username => $owner, user_accept_privmsg=>'1' }, ['user_id'] )->fetchrow_array;
if ($forumid) {
$output .= qq~<form action='url to gforum.cgi' method=POST><tr><td><input type=submit name="do=message;user=$forumid" value="Contact Author" class=button></td></tr></form>~;
}
return $output;
}
sub {
my $tags=shift;
my ($output,$sth,$user);
my $owner=$tags->{LinkOwner}; #this may need changing to tag containing username
use lib('/path/to/forum/admin'); #change
my $db = GT::SQL->new('/path/to/forum/admin/defs')->table('User');#change
my $forumid = $db->select ( { user_username => $owner, user_accept_privmsg=>'1' }, ['user_id'] )->fetchrow_array;
if ($forumid) {
$output .= qq~<form action='url to gforum.cgi' method=POST><tr><td><input type=submit name="do=message;user=$forumid" value="Contact Author" class=button></td></tr></form>~;
}
return $output;
}