This is what I did to views/slaves/view.php in the frontend
Code: |
// $groupName = null; //original code
$groupName = array(); // changed to array by Buddy Q
if ( isset( $filters['groupName'])) {
$groupName[] = $filters['groupName'];
}
// Start Add by Buddy Q
$user =& JFactory::getUser();
if($user->id){
// Get ALL user fields in case we want to use them.
$db = JFactory::getDBO();
// user_profile table is created and used with ContentBuilder component :: crosstec.de
$query = "SELECT *"
. " FROM #__user_profile"
. " WHERE user_id = ".$user->id
. " LIMIT 1"
;
$db->setQuery($query);
$userInfoRows = $db->loadObjectList();
}
foreach ($userInfoRows as $key=>$object){
if($object->template_groups){
// Get the originally selected groupName set in Multisites and merge with groups set in user field called 'template_groups'
$groupName = array_merge( $groupName, explode( "," , str_replace(" ","", $object->template_groups)));
}
}
// End add by Buddy Q
|
Then in admin/components/com_multisites/helpers/helper.php
Changed line: 393 to:
Code: |
else if ( in_array($groupName, $filter_GroupName)) {
|
That's it. Not too hard and really nice!
Buddy