Support

  1. blocdaddy
  2. General
  3. Friday, May 10 2019, 12:40 AM
  4.  Subscribe via email
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
Pro
This works perfectly!! Thank you so much!!

I have one last question:

I would like to have the map module in position above the search box on my user search page (page generated by users list menu item). Right now I have the backend setting to randomly display two users on the page at all times even with no search. When the map is published above the search box, if you scroll down the page to where the map is out of view and then scroll back up to the top where the map is, a popup profile display of one of the two users automatically opens. Is there a way to disable this feature? I still want the popup box to show when users click on the specific user avatar, but not popup automatically at all. Thanks!!

Although the map module is unpublished right now, you can see the page that I'm referencing here: https://www.premierlawyers.org/index.php/find-an-attorney?
  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
Pro
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.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy ProfileĀ® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.