1. blocdaddy
  2. General
  3. Friday, May 10 2019, 12:40 AM
In Easy Profile in the users map module (mod_jsnmap), I would like to change the user avatar to show three different icons/pins for three different Joomla usergroups. I found this similar post which seemed to indicate it was possible:

https://www.easy-profile.com/support/user-map-3-user-groups-3-different-pins.html

I created a file called "custom.php", entered the code and the links to the three new image icons at line 117, selected "custom" and "avatar" as the module selections in the backend, but the custom icons didn't appear on the map.

The code I used is below. Can you please let me know what I'm doing wrong?

Changed line 117 from:

url: '<?php echo JURI::root(true).'/'.$user->getValue('avatar_mini'); ?>'

to:

url: '<?php
if( $user->getValue('group_id') == '13' ) echo 'https://www.premierlawyers.org/images/marker-platinum.png';
if( $user->getValue('group_id') == '12' ) echo 'https://www.premierlawyers.org/images/marker-gold.png';
if( $user->getValue('group_id') == '11' ) echo 'https://www.premierlawyers.org/images/marker-silver.png';
?>',


If this is not possible I would just like to change the default red location pin to my own image. I tried changing the link in default.php at line 162 from 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png' to my own url but it didn't change. Is there a way to do this? Thanks!!
Accepted Answer
admin Accepted Answer
Admin
Hi,
getValue function return the value of the Easy Profile field, to get usergroups try with a code like this:
url: '<?php 
if( in_array( 13 , $user->getAuthorisedGroups() ) ) echo 'https://www.premierlawyers.org/images/marker-platinum.png';
if( in_array( 12 , $user->getAuthorisedGroups() ) ) echo 'https://www.premierlawyers.org/images/marker-gold.png';
if( in_array( 11 , $user->getAuthorisedGroups() ) ) echo 'https://www.premierlawyers.org/images/marker-silver.png';
?>',
  1. more than a month ago
  2. General
  3. # Permalink
blocdaddy Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 1
admin Accepted Answer
Admin
Hi,
sorry for late reply, it's a weekend :D

You can do this with template overrides:
- Open your file "custom.php" from template folder (created to have 3 different avatars)
- At line 129 replace "mouseover" with "click" function.

NOTE: of course if you click to avatar or username then it open profile page.
  1. more than a month ago
  2. General
  3. # 2
blocdaddy Accepted Answer
Everything works great! Your product is terrific and thank you for the great support!
  1. more than a month ago
  2. General
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.