1. yoji
  2. General
  3. Monday, July 06 2015, 09:22 AM
I want to show the viewing Access level to registered user.
Is it possible?
It may be a Joomla question not EasyProfile...
But if anyone knows the answer, please let me know.
Thanks in advance.
Accepted Answer
admin Accepted Answer
Admin
Hi,
you can do something like this:

1. Override Easy Profile Layout (to not loss changes when you update our component)
- copy /components/com_jsn/views/profile/tmpl/default.php into /templates/your-template-folder/html/com_jsn/profile/default.php

2. add this code at line 14 on new default.php
$acl=JFactory::getUser($this->data->id)->getAuthorisedViewLevels();
$db=JFactory::getDbo();
$query=$db->getQuery(true);
$query->select('title')->from('#__viewlevels')->where('id in ('.implode(',',$acl).')');
$db->setQuery($query);
$accessLevels=$db->loadColumn();
$formattedAcl='<span class="label label-info">'.implode('</span> <span class="label label-info">',$accessLevels).'</span>';
echo '<div style="float:right">'.$formattedAcl.'</div>';


3. see screenshot for result

NOTE: this code is for example purpose, so not supported .
Attachments (1)
  1. more than a month ago
  2. General
  3. # Permalink
yoji Accepted Answer
Basic
Hi Tech.Support,

Thank you so much. I really appreciate your kind support.

Best Regards,
Yoji
  1. more than a month ago
  2. General
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.