Support

  1. Zephyrinus
  2. General
  3. Monday, January 12 2015, 06:35 PM
Dear people of easy-profile,

We're using your extension as core functionality within our dutch start-up company called Dinst. It does a LOT of what we exactly needed. Thank you.

Some months ago we asked for a method to link user-list profiles to a certain profile page (user-profile menu-item). Thanks to your great support user-lists linked to profilepages first-child (not standard router of joomla to the first profile page in the menu)

Now we're still trying to build a perfect routing cause of the duplicate content and the modules we want to add on certain profile pages.
The sollution for us would be the following, could you please help us out?

We want to set (manually) the direction manually, that's all.

How can we change very little pieces of code so that user-list shows "sampleuser" and profile-link links to "input custom link here"

We can add a easy-profile custom field, only available for admins. And they can type in an custom profile-link. Only thing is; how does easy-profiles user-list read out this field to use thát as profile-link?

Please help? our lives depent on it ;-)

with regards,

Dennis

-----extra----
ps.

So "sampleuser" is in the list of http://website.com/ep-user-list

----

and our website has:

http://website.com/ep-profile-1
http://website.com/ep-profile-2
http://website.com/ep-profile-3

and now we have a ep-custom-field texttype say alias "customrouter"

Our admins write down: http://website.com/ep-profile-2/

or

http://website.com/ep-profile-2/sampleuser

---
Accepted Answer
admin Accepted Answer
Admin
try now, the first line of code was wrong because this forum have removed some parenthesis (for emoticon purpose).
  1. more than a month ago
  2. General
  3. # Permalink
Zephyrinus Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 1
Zephyrinus Accepted Answer
Pro
Works perfect!

Thank you so much!

Warm regards,

Dennis
  1. more than a month ago
  2. General
  3. # 2
Zephyrinus Accepted Answer
Pro
This does not seem to work. After replacing the code the website freezes.
  1. more than a month ago
  2. General
  3. # 3
admin Accepted Answer
Admin
Hi,
The lines 28 to 43 don't seem to be the right lines in router.php (easy-profile 1.3.8)

yes are correct, these lines set Item id, so you need to replace with previous code:
remove this code:
$active=$menu->getActive();
if(isset($active->link) && $active->link=='index.php?option=com_jsn&view=profile')
{
$query['Itemid']=$active->id;
}
else
{
$profileMenu=$menu->getItems('link','index.php?option=com_jsn&view=profile',true);
if(isset($profileMenu->id))
{
$query['Itemid']=$profileMenu->id;
}
else{
$query['Itemid']=$menu->getDefault()->id;
}
}

and replace with this:
if(isset($query['id'] ) ) $user_id=$query['id'];
else $user_id=JFacory::getUser()->id;

$db = JFactory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery->select('a.aangeslotenbij')->from('#__jsn_users AS a')->where('a.id = '. (int) $user_id);
$db->setQuery( $dbquery );
if($value=$db->loadResult())
{
if($value=='1') $query['Itemid']=326;
if($value=='2') $query['Itemid']=10155;
.....
}
else
{
$query['Itemid']=320; // this is id of fault menu item, if the fields is not set
}
  1. more than a month ago
  2. General
  3. # 4
Zephyrinus Accepted Answer
Pro
Hi,

This topic had become relevant now.

The lines 28 to 43 don't seem to be the right lines in router.php (easy-profile 1.3.8)

----------------

I've created a field with alias "aangeslotenbij" with the options 1|Dinst, 2|Amstelring, and there will be more in the future.

Some users are set to 1 and some to 2. I need router.php to link those different set users to different 'profile' pages.

IF EP alias "aangeslotenbij" = 1 THEN open profile with menu-item ID 326
IF EP alias "aangeslotenbij" = 2 THEN open profile with menu-item ID 10155
-- ADD future lines --

ELSE open profile with menu-item ID 326

----------------


Can you guys please help me out with the right code to implement into the right lines with router.php on easy-profile 1.3.8. What code do i have to replace?

This would help us a LOT!

keep up the good work!

warm regards,

Dennis
  1. more than a month ago
  2. General
  3. # 5
admin Accepted Answer
Admin
Hi,
you can customize your route by changing the file /components/com_jsn/router.php.

in this file the Itemid is recovered from line 28 to line 43.

you can remove from line 28 to line 43 and write something like this:
if(isset($query['id'])) $user_id=$query['id'];
else $user_id=JFacory::getUser()->id;

$db = JFactory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery->select('a.your_field_alias')->from('#__jsn_users AS a')->where('a.id = '. (int) $user_id);
$db->setQuery( $dbquery );
if($value=$db->loadResult())
{
if($value=='value1') $query['Itemid']=326; // this is id of ep-profile-1 menu item
if($value=='value1') $query['Itemid']=327; // this is id of ep-profile-2 menu item
if($value=='value1') $query['Itemid']=328; // this is id of ep-profile-3 menu item
}
else
{
$query['Itemid']=320; // this is id of fault menu item, if the fields is not set
}


NOTE: This code is not tested and not supported, was written as example purposes. If you change router.php file keep a backup of the new file because when you update Easy Profile this file will be overwritten.
  1. more than a month ago
  2. General
  3. # 6
  • 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.

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.