Keyword

Get user groups assigned categories in k2

  • ahmad balavipour
  • ahmad balavipour's Avatar Topic Author
  • Offline
  • New Member
  • هاستینگ
More
13 years 4 months ago #96775 by ahmad balavipour
Get user groups assigned categories in k2 was created by ahmad balavipour
$queryahmad = "  SELECT ".$db->nameQuote('permissions')."    FROM ".$db->nameQuote('#__k2_user_groups')."    WHERE ".$db->nameQuote('id')." = ".$db->quote($userGroup).";  ";$db->setQuery($queryahmad);$userGroupaccess = $db->loadResult();$pieces = explode("\n", $userGroupaccess);$ahmaddal=ereg_replace("categories=","",$pieces[6]);$piecesah = explode("|", $ahmaddal);$anacounty = 0;if(count($piecesah)){ $query .= " AND ( ";foreach ($piecesah as $value){ if($anacounty==0) $query .= "  i.catid=$value "; else $query .= " OR i.catid=$value "; $anacounty = $anacounty + 1; } $query .= " ) ";}

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #96776 by BBC
Is it possible to set this part of code in K2 Users Module ?

 

I want to get rid of styling of Users Items listings. As you can make Category override it would be a perfect solution to style Users pages as you wish.

Please Log in or Create an account to join the conversation.

  • ahmad balavipour
  • ahmad balavipour's Avatar Topic Author
  • Offline
  • New Member
  • هاستینگ
More
13 years 4 months ago #96777 by ahmad balavipour
Replied by ahmad balavipour on topic Get user groups assigned categories in k2
Yes you can do this in module for showing assigned categories to user. i am using this for "my page" of users so users can see items related to their assigned categories

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #96778 by BBC
Any chance you can attach here relative PHP files ? Thanks.

You don´t need to bother to search and copy code.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum