Checking to see if a module is active...

Oldiesmann
Oldiesmann's picture

Joined: 2005-05-18
Posts: 151
Posted: Mon, 2006-09-11 15:46

I am looking at adding a couple of features from the Members module to the next version of the SMF+G2 integration - a link to the user's profile and the summary of a user's latest items (with a link to view the full list in the gallery).

As far as I can tell, this should be a relatively simple task. I am probably going to add a setting to enable/disable this in the forum admin center (since some users may not want this feature), but I would also like to have the forum automatically detect whether or not the members module is even installed and active, just to avoid any potential errors that might be caused otherwise.

What would be the best way to accomplish this? GalleryCoreApi::fetchPluginStatus will give me the information I need, but it also loads the information for every module in the modules directory (regardless of whether or not each one is installed), and I'm wondering if there's a way to do this without loading a bunch of information that I don't need.

Once I know whether or not the module is enabled, I can get their G2 user ID and rely on GalleryMembersHelper::fetchLastUserItems to pull the information about the user's latest items...

The Oldiesmann
SMF Support Specialist
SMF+G2 Integration Project - Beta2 now available!