mallchin.com

mallchin.com header graphic
Home arrow Misc. Code arrow Joomla! arrow Joomla! - Joomla! Credits component
Joomla! - Joomla! Credits component PDF Print E-mail
Saturday, 19 January 2008

I've recently implemented the fine Joomla! Credits component (as seen in the top right) but noticed a small bug.

By default it excludes modules in the cpanel position, those related to the Control Panel in the Administrator section. However, some Administrator modules reside in module positions other than cpanel, such as header, which also relate to the main site.

Rather than excluding items based on the position I tweaked the code to exclude based on the access, usually 99 for Administrator items. This has the advantage of excluding *all* Administrator modules regardless of position -- useful as Administrator modules tend to have elevated privileges and noting which ones are installed may be undesirable.

 

To make the tweak simply edit line 95 in components/com_joomlacredits/joomlacredits.php like so (v1.0.3):
 

Old:

  1. $database->setQuery( "SELECT DISTINCT (module) as module FROM #__modules WHERE module LIKE 'mod_%' AND position <> 'cpanel' AND iscore = 0 AND published = 1 ORDER BY title");
 

New:

  1. $database->setQuery( "SELECT DISTINCT (module) as module FROM #__modules WHERE module LIKE 'mod_%' AND access <> 99 AND iscore = 0 AND published = 1 ORDER BY title");
 

 

I hope this comes in useful.


Quote this article on your site

  Be first to comment this article
RSS comments

Only registered users can write comments.
Please login or register.

 

  Tag it:blogmarksco.mmentsDeliciousdiggDiigo