Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Message Preview In Search Results

Quote Reply
Message Preview In Search Results
Hi,

Although overlib.js is there is the msgs_search_results.htm but the message preview does not work. What needs to be modified in template.

Anup
Quote Reply
Re: [anup123] Message Preview In Search Results In reply to
There's a few things that you need to do to make it work:
- Update the templates
- Add the following code to admin/GMail/Messages/Search.pm, ~line 71:

Code:
# Add in the message preview
if (@list) {
my @mids;
for (0 .. $#list) {
push @mids, $list[$_]->{msgs_mid};
}
my $msth = $DB->table('msgsearch')->select('msgsearch_mid', 'msgsearch_body', { 'msgsearch_mid' => \@mids });
my %mid2body;
while (my ($msg_id, $msg_body) = $msth->fetchrow_array) {
$mid2body{$msg_id} = substr($msg_body, 0, $USER->{opts}->{display}->{preview} || 100);
}
for (0 .. $#list) {
$list[$_]->{msgs_preview} = $mid2body{$list[$_]->{msgs_mid}};
}
}

I'd just like to note that these changes were already added to Gossamer Mail 2.1.1.

Adrian