<![CDATA[ Peoples and link to profile - My Forums]]> https://forums.modx.com/thread/?thread=93220 <![CDATA[Peoples and link to profile]]> https://forums.modx.com/thread/93220/peoples-and-link-to-profile#dis-post-509103
For my site I thought it was a nice idea to have a page with members using peoples. I've been trying some stuff and overall it works, but some links point to the right name, but when you click on them, they move to the general discuss forum.

Members page: http://www.gamerschain.com/members.html

Code used on the page:
<div class="term-priv">
[[
PeopleGroup? 
 &usergroup=`gcmembers` 
 &toPlaceholder=`users` 
 &getProfile=`1` 
 &getExtended=`1` 
 &sortDir=`ASC`
 &outputSeparator=`<br />.......................`
 &active=`1`
]]
 
<h1>Gamers Chain members</h1>
<p>([[+peoplegroups.userCount]] Users)</p>
 
<br />

<ul>
[[+users]]
</ul>

</div>

The &getExtended is for future use.

Chunk used:
<li class="[[+cls]]">[[+username]] - <em>[[+role]]</em></li>
<div class="PanelBox-avatar img">
<img src="assets/userfiles/[[+username]]/avatar.gif">
</div>
<p><a href="[[+site_url]]/forums/u/[[+username]]">view profile</a></p>


Also, for some reason you need to be logged in to view the profile page. Anyone any ideas for both issues?]]>
gormytorysh Sep 19, 2014, 08:49 AM https://forums.modx.com/thread/93220/peoples-and-link-to-profile#dis-post-509103
<![CDATA[Re: Peoples and link to profile]]> https://forums.modx.com/thread/93220/peoples-and-link-to-profile#dis-post-513681 gormytorysh Oct 30, 2014, 05:06 AM https://forums.modx.com/thread/93220/peoples-and-link-to-profile#dis-post-513681 <![CDATA[Re: Peoples and link to profile]]> https://forums.modx.com/thread/93220/peoples-and-link-to-profile#dis-post-511847
I'm achieving this by linking to a resource which holds the "People"-snippet:

Chunk:
<p><a href="[[~241]]?user=[[+id]]">">view profile</a></p>


"People"-snippet call on resource 241:

[[!mySession]] 
[[!Profile? &user=`[[+user]]`]]


The [[+user]]-placeholder is "built" in the mySession-snippet:

<?php
$myUserId = $_GET['user'];
$profile = $modx->getObject('modUserProfile', array('internalKey' => $myUserId));

$modx->setPlaceholder('user', $myUserId);


This looks for the URL-variable which holds the user-id.

Hope this helps...

EDIT:

Bob Ray did point me to this:

http://forums.modx.com/thread/93111/search-in-user-extended-fields?page=2#dis-post-511685

You should also think about the security implications, because anyone can access that page with any user ID (including yours). Putting it in a $_SESSION variable wherever you currently construct the URL would be safer:

$_SESSION['user'] = $userId;

So you should better try to get the $_SESSION variable set! Then I think you don't have to use the URL-variable, you have to check for the $_SESSION variable in the mySession-snippet I think...didn't try this yet, because my profile-sites are in a restricted area.]]>
profilneurotiker Oct 02, 2014, 09:05 PM https://forums.modx.com/thread/93220/peoples-and-link-to-profile#dis-post-511847