Gossamer Forum
Quote Reply
New Messages
I run into a global for Gforum listing new messages on the Links home page. What I would like to do is show Gmail number of messages on the home page when a user login thru GC. Can somebody please help modifying this global.
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)%>

Last edited by:

goman: Oct 16, 2005, 6:10 AM
Quote Reply
Re: [goman] New Messages In reply to
Got it, here the global sub {
my $gmail_id = shift;
my $db = GT::SQL->new("/path/to/gmail/data/admin/defs");
my $count = $db->table('msgtrack')->count( {
msgtrack_userid => $gmail_id,
msgtrack_fid => 1,
msgtrack_status => 'New'
});
return $count;
} The other thing I would like is show the percentage graph/bar (<%users_percent_used%>) on the GC page using the same as above, any ideas?