Gossamer Forum
Quote Reply
Number of messages
How can I get the number of new messages a user has (if any) into Community? (or a Links Installation)

ie.
Messages
1 NEW

Cheers
Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Number of messages In reply to
Got it sorted - in case anyone is interested:

Global (new_messages):
Code:
sub {
my $user_id = shift;
lib->import('/path/to/gforum/admin');
require GT::SQL;
my $DB = GT::SQL->new('/path/to/gforum/admin/defs');
return $DB->table('Message')->count({ to_user_id_fk => $user_id, msg_status => 0 });
}

Call it from your template as:

<%new_messages($app_forum_user_id)%>

Cheers
Klaus

http://www.ameinfo.com
Post deleted by pugdog In reply to
Quote Reply
Re: [klauslovgreen] Number of messages In reply to
Wrong forum <G>


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Number of messages In reply to
Klauslovgreen,
I tried the above code, and I keep getting an error, where do you put the global at? the community, links, or the gforum???
Thanks,

</not a clue>