Ticket 248 PM notification
Review Request #78 - Created March 7, 2009 and submitted
Information | |
---|---|
Alexandru Tudorica | |
infoarena | |
Reviewers | |
hackers | |
So I add the number of unread messages to the "mesaje" text on the navigation bar. But this partially solves ticket 248. The mail part is like this. The field `pm_email_notify` in the `ia_smf_members` is 1 for new members but some of the old members still have it on 0. So the simple solution is to make it 1 for everybody. The harder solution is to hack IA account page and put an option there.
Tested locally as you can se in the screenshots.
-
/trunk/common/db/smf.php (Diff revision 1) -
Use db_quote for smf_get_member_id
-
/trunk/common/db/smf.php (Diff revision 1) -
unnecesary whitespace
-
/trunk/www/views/sitewide.php (Diff revision 1) -
lines shouldn't exceed 80 characters
Hi! Thanks for submitting the patch! I'm a bit worried about running an additional SQL query for every pageview, especially for obtaining a number which barely ever changes. I think we could use a caching mechanism, similar to what we do here: http://hackers.devnet.ro/browser/trunk/common/db/user.php#L79
-
/trunk/common/db/smf.php (Diff revision 1) -
I suggest using a more descriptive name like smf_get_pm_count().
-
/trunk/common/db/smf.php (Diff revision 1) -
Please maintain a consistent coding style within the same file. Place { brackets on the same line with the declaration.
-
/trunk/www/views/sitewide.php (Diff revision 1) -
Save the value, don't run the query twice.
Are you sure SMF does not have it's own function for getting message count?
-
/trunk/common/db/smf.php (Diff revision 5) -
I'd rather cache it by username since smf_get_member_id does cost you an extra query. Also move smf_get_member_id after if ($from_cache)
-
/trunk/www/views/sitewide.php (Diff revision 5) -
Add a space between mesaje and (
30 minute cache seems a bit too much. I think 10 minutes is enough :)
-
/trunk/common/db/smf.php (Diff revision 6) -
Evil endline space :)
-
/trunk/smf/Sources/PersonalMessage.php (Diff revision 7) -
SMF allows you to send messages to users by their full name (for example "Bogdan Tataroiu") so that is not the username. You also don't handle the bcc. Also, from what i see SMF doesn't send the message here, it just puts it in sort of a Queue or something. It sends it in MessagePost2. That's where the mem_cache_delete should be.