Gossamer Forum
Home : Gossamer Threads Inc. : Custom Modification Jobs :

Re: [dmoynihan] Newsletter Mod Sought $$$

Quote Reply
Re: [dmoynihan] Newsletter Mod Sought $$$ In reply to
This is the global (i've called it newsletters):

Code:
sub {
my ($output,$sth);
my $id = shift;
my $maildb = $DB->table('MailingIndex');
if ($id =~ /\d+/) {
$sth = $maildb->select({Mailing => $id});
} else {
$sth = $maildb->select({extra => 'Users'});
}
while (my $mail = $sth->fetchrow_hashref) {
if ($id =~ /\d+/) {
if ($mail->{'messageformat'} eq 'text'){$mail->{'message'} =~ s/\n/<br>/g;}
$output .= qq~<b>$mail->{'subject'}</b><br><br>$mail->{'message'}~;
} else {
$output.= qq~<li><a href="$CFG->{db_cgi_url}/page.cgi?p=newsletters&mail=$mail->{'Mailing'}">$mail->{'subject'}</a>~;
}
}
return $output;
}


Then you need to create a template newsletters.html. Use your normal page layout and in the body of the page add

<%if mail%>
<%newsletters($mail)%>
<%endif%>


To call the page with the list of newsletters use <%db_cgi_url%>/page.cgi?p=newsletters&mail=index

You'll probably need to edit the html in the global to get it looking how you want.
Subject Author Views Date
Thread Newsletter Mod Sought $$$ dmoynihan 6495 Apr 17, 2003, 11:38 PM
Thread Re: [dmoynihan] Newsletter Mod Sought $$$
afinlr 6327 Apr 18, 2003, 6:38 AM
Thread Re: [afinlr] Newsletter Mod Sought $$$
dmoynihan 6363 Apr 18, 2003, 7:06 AM
Thread Re: [dmoynihan] Newsletter Mod Sought $$$
afinlr 6324 Apr 18, 2003, 7:52 AM
Post Re: [afinlr] Newsletter Mod Sought $$$
dmoynihan 6293 Apr 18, 2003, 12:34 PM
Post Re: [dmoynihan] Newsletter Mod Sought $$$
Andy 6323 Apr 19, 2003, 3:08 AM
Thread Re: [dmoynihan] Newsletter Mod Sought $$$
pugdog 6277 Apr 22, 2003, 2:49 PM
Post Re: [pugdog] Newsletter Mod Sought $$$
dmoynihan 6225 Apr 23, 2003, 12:03 PM