Loading badges only when on user profile page

robphillips - September 23, 2009 - 18:17
Project:User Badges
Version:5.x-1.5
Component:Code
Category:feature request
Priority:normal
Assigned:robphillips
Status:needs work
Description

On sites that have a lot of user_load() calls the user badges modules seems to really tally up a large amount of queries due to it's loading operation in hook_user. It doesn't always make sense for users of this module to load badges on any page except the user profile page. So this patch adds a setting into user badges that allows it to be toggled on and off, essentially giving the user an option to save on precious query calls. Please review and let me know if you find anything off-mark with this. Thanks!

AttachmentSize
user_badges_profileonly.patch1.58 KB

#1

Likeless - October 5, 2009 - 15:43
Status:needs review» needs work

I'm not sure this is the best approach because it will break any modules that need to load badges on other pages. It might be better to use Drupal's cache system (does D5 have this?) so that functionality isn't reduced, or add a hook or something so that other modules can force a load on other pages.

 
 

Drupal is a registered trademark of Dries Buytaert.