1 of 2
1
Creating a user profile page like Jambor-ee
Posted: 27 February 2008 10:52 AM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

I’m using the user module on a site and I’ve currently got a login page, registration page, and forgot password page set up. What I’m looking to do is create a very basic “profile” page and “edit-profile” page similar to what Jambor-ee did when their site was live as I know they used the user module for their member functionality.

Can anyone maybe give me an idea where to start on this? I’m thinking that I need to do something with the exp:user:edit tag? It looks like the edit page in the docs just displays how to develop a page where members can edit their profile but not how to simply display this information? I’m really looking to display this exact information on a member “profile” page only without the input fields. This would just be a page that shows the members name, email on file, photo, url, screenname, etc.,

Any thoughts on this? I’m sure I’m just overlooking something in the docs…

Profile
 
 
Posted: 27 February 2008 10:57 AM   [ Ignore ]   [ # 1 ]
Member
Avatar
RankRankRank
Total Posts:  87
Joined  2008-02-26

I’m using the stats bit for that, though I’m having some issues with formatting:

{exp:user:stats username="{segment_3}"}
  
<h1>{screen_name}</h1>
  
{if photo_filename != ""}
   
<img src="{photo_url}{photo_filename}" />
  
{if:else}
   
Default piccie
  {
/if}
 
  
<p>First name{first_name}</p>
  <
p>Last name{last_name}</p>
 
{/exp:user:stats} 

I hope that’s right smile

 Signature 

Andy Harris | Pepper Digital | Malvern, UK

Profile
 
 
Posted: 27 February 2008 11:00 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

Yes,

The User 1.2 Stats function is the equivalent to the Member Profile. smile

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 27 February 2008 11:13 AM   [ Ignore ]   [ # 3 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

Thanks I’ll check that out. I didn’t realize that. I guess I overlooked that “stats” page as I just didn’t put two and two together. I kept looking for something that said “profile” in the docs.

I’ll post back if I have any trouble.

Profile
 
 
Posted: 27 February 2008 11:15 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

Haha, yeah… those Docs aren’t exactly a walk in the park raspberry

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 27 February 2008 07:28 PM   [ Ignore ]   [ # 5 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

I’m back with a question about my profile pages.

I’m wondering how I can lock the member profiles down so that are not publish and only the current logged in member can access their profile? Is that possible?

Here’s a basic template that I’ve got thus far:


{exp:user:stats username="{segment_3}"}
   
<h1>{if screen_name != ""}{screen_name}'s{if:else}{username}'s{/if} Profile</h1>

   
{if photo_filename != ""}
   
<img src="{photo_url}/{photo_filename}" alt="{photo_filename}" title="{photo_filename}" /><br />
   
{if:else}
   
<img src="/themes/forum_themes/kygolfing/images/icon_profile.gif" width="100" height="100" border="0" title="{name}" alt="No Member Photo" /><br />
   
No Member Photo<br />
   
{/if}

   Username
{username}<br />
   
Screen Name{screen_name}<br />
   
Last Activity{last_activity format="%F %j, %Y %h:%i %A"}<br />
   
Join Date{join_date format="%F %j, %Y %h:%i %A"}<br />
   
Email Address{email}
   {
/exp:user:stats} 

Profile
 
 
Posted: 27 February 2008 09:32 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  736
Joined  2004-03-30

Deron,

is_mine ought to come in handy here:

http://www.solspace.com/docs/entry/user_12_is_mine/

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 28 February 2008 07:03 AM   [ Ignore ]   [ # 7 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

Hey Mitchell, thanks for pointing that out.

At first glance, I’m afraid I’m confused on how I’m suppose to use the is_mine function.

Do I simply need to write out the {if mine}{/if} conditional and place my profile template (from above) between that conditional and then below that have the {if not_mine}{/if} conditional displaying some text or a login form if that profile doesn’t below to the person viewing it?

I see the member_id = “{author_id}“ parameter too… looks like that’s required to make this work. Can I place anything else in that parameter or does it have to be {author_id}? Where do I find the {author_id}‘s?

Thanks

Profile
 
 
Posted: 28 February 2008 08:23 AM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  736
Joined  2004-03-30

Deron,

PieMan was just telling me that he couldn’t get the is_mine to work in his testing. So I need to double check it before telling you what and how to do.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 29 February 2008 11:14 AM   [ Ignore ]   [ # 9 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

No problem Mitchell.

I was playing around with the is_mine function some more and used this code:

{if mine member_id "{author_id}"}
   {exp
:user:stats username="{segment_3}"}
   
<h1>{if screen_name != ""}{screen_name}'s{if:else}{username}'s{/if} Profile</h1>

   
{if photo_filename != ""}
   
<img src="{photo_url}/{photo_filename}" alt="{photo_filename}" title="{photo_filename}" /><br />
   
{if:else}
   
<img src="/themes/forum_themes/kygolfing/images/icon_profile.gif" width="100" height="100" border="0" title="{name}" alt="No Member Photo" /><br />
   
No Member Photo<br />
   
{/if}

   Username
{username}<br />
   
Screen Name{screen_name}<br />
   
Last Activity{last_activity format="%F %j, %Y %h:%i %A"}<br />
   
Join Date{join_date format="%F %j, %Y %h:%i %A"}<br />
   
Email Address{-email}
   {
/exp:user:stats}
   {
/if} 

If it helps you out at all in your testing, I received this error message when I tried to view my profile:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /www/eh6420/public_html/kygolfing/system_name/core/core.functions.php(637) : eval()‘d code on line 10

Profile
 
 
Posted: 29 February 2008 04:56 PM   [ Ignore ]   [ # 10 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  736
Joined  2004-03-30

Deron,

Just try wrapping everything inside

{exp:user:is_mine}

{
/exp:user:is_mine} 

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 01 March 2008 05:06 PM   [ Ignore ]   [ # 11 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

Mitchell,

Here’s what I’ve got:

{exp:user:is_mine}
   {exp
:user:stats username="{segment_3}"}
   
<h1>{if screen_name != ""}{screen_name}'s{if:else}{username}'s{/if} Profile</h1>

   
{if photo_filename != ""}
   
<img src="{photo_url}/{photo_filename}" alt="{photo_filename}" title="{photo_filename}" /><br />
   
{if:else}
   
<img src="/themes/forum_themes/kygolfing/images/icon_profile.gif" width="100" height="100" border="0" title="{name}" alt="No Member Photo" /><br />
   
No Member Photo<br />
   
{/if}

   Username
{username}<br />
   
Screen Name{screen_name}<br />
   
Last Activity{last_activity format="%F %j, %Y %h:%i %A"}<br />
   
Join Date{join_date format="%F %j, %Y %h:%i %A"}<br />
   
Email Address{-email}
   {
/exp:user:stats}
   {
/exp:user:is_mine} 

Still not working. I logged out and tried to manually browse to my member profile and it still came up just as if I were logged in. If I understand this correctly, with the is_mine in place, anyone logged out shouldn’t be able to view profiles by manually typing them in the address field of the browser?

Profile
 
 
Posted: 03 March 2008 07:38 AM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

deronsizemore,

Haha, this is something we’ve all finally wrapped our brains around… have a look at the updated User 1.2 Is Mine Documentation  smile

I’ve slapped up an example as well.

The example below is how you might use the IS MINE function on the User:Edit form, pulling the Member ID from the third segment of the URL.

{exp:user:is_mine member_id="{segment_3}"

{if mine}This profile is mine
, or I am a super admin.{/if} 
{if not_mine}Well
I can’t edit this I guess.{/if} 

{exp
:user:edit return="user"

<p>Location <input name="location" value="{location}" /></p
<
p>Email <input name="email" value="{email}" /></p
<
p>Username <input name="username" value="{username}" /></p
<
p>Screen Name <input name="screen_name" value="{screen_name}" /></p
<
p>Password <input type="password" name="password" value="" /></p
<
p>Password Confirm <input type="password" name="password_confirm" value="" /></p
<
p>Current Password <input type="password" name="current_password" value="" /></p
<
p><input type="submit" value="Submit" /></p

{/exp:user:edit} 

{
/exp:user:is_mine} 

Be sure to have a look at the documentation though, as there is a couple new details mentioned smile

Thank you very much for your patience!

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 03 March 2008 08:15 AM   [ Ignore ]   [ # 13 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

Pie Man,

Ahh yes, MUCH better! I was completely lost before, as I’m sure you could tell from the code I was supplying in this thread.

Here’s what I’ve got now and it seems to be working as it should:

{exp:user:is_mine username="{segment_3}"}
   {if mine}
   {exp
:user:stats}
   
<h1>{if screen_name != ""}{screen_name}'s{if:else}{username}'s{/if} Profile</h1>

   
{if photo_filename != ""}
   
<img src="{photo_url}/{photo_filename}" alt="{photo_filename}" title="{photo_filename}" /><br />
   
{if:else}
   
<img src="/themes/forum_themes/kygolfing/images/icon_profile.gif" width="100" height="100" border="0" title="{name}" alt="No Member Photo" /><br />
   
No Member Photo<br />
   
{/if}

   Username
{username}<br />
   
Screen Name{screen_name}<br />
   
Last Activity{last_activity format="%F %j, %Y %g:%i %A"}<br />
   
Join Date{join_date format="%F %j, %Y %g:%i %A"}<br />
   
Email Address{-email}
   {
/exp:user:stats}
   {
/if}

   {if not_mine}
   You can
't do that
   {/if}
   {/exp:user:is_mine} 

Profile
 
 
Posted: 03 March 2008 08:18 AM   [ Ignore ]   [ # 14 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

It should probably be:

{exp:user:is_mine member_id="{segment_3}"

instead of:

{exp:user:is_mine username="{segment_3}"

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 03 March 2008 08:24 AM   [ Ignore ]   [ # 15 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

Ok, I’ll change that.

In my header I have a “profile” link that will take members to their profile and I had the anchor set up to point to “/members/profile/{username}“ so that’s the reason I used the is_mine username=“{segment_3}“

I just changed the anchor in my header to “/members/profile/{member_id}“ and that works too.

Is the “member_id” way of doing it more secure or something or just the recommended way of displaying a member profile so the username is out of the URL?

Profile
 
 
   
1 of 2
1