Icy Phoenix

     
 

PROFILE - How To Create Custom Profile Fields

PROFILE - How To Create Custom Profile Fields

Article
Reply with quote    Download Post  
Post PROFILE - How To Create Custom Profile Fields 
 
[DOC] How To Create Custom Profile Fields

Icy Phoenix already comes with Custom Profile Fields (ACP -> Users -> Add Custom Profile Fields), but what if you wanted to create a deeper, richer Custom Profile Field?  This guide will help get you started down the right path.

In this DOC, I will be explaining how to add a new Custom Profile Field for Xbox LIVE Gamercards.

What is an Xbox LIVE Gamercard?  A Gamercard shows your accumulated points earned by playing games, reputation, last five games played, etc.  It's basically a way for everyone to see what you play and your Xbox LIVE Gamertag.  Users are also able to click your Gamercard and add you to their Xbox LIVE Friends List.  For more information about this, visit Xbox.com

First, you want to create your Custom Profile Field via your ACP: ACP -> Users -> Add Custom Profile Fields

 gamertag1

In this case, make sure the field is as seen in the picture: "xbox".  We want to make the Xbox LIVE Gamercard viewable on viewtopic_body.tpl.

Next, open: viewtopic.php

FIND:

Code: [Download] [Hide] [Select]
$poster_from = ($postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';


AFTER, ADD:

Code: [Download] [Hide] [Select]
$poster_xbox = ($postrow[$i]['xbox'] && $postrow[$i]['user_id'] != ANONYMOUS) ? ('<a href="http://profile.mygamercard.net/' . urlencode($postrow[$i]['xbox']) . '"><img src="http://card.mygamercard.net/' . urlencode($postrow[$i]['xbox']) . '.png" /></a>') : '';


Now we need to add the variable.

FIND:

Code: [Download] [Hide] [Select]
'POSTER_FROM' => $poster_from,


AFTER, ADD:

Code: [Download] [Hide] [Select]
'POSTER_XBOX' => $poster_xbox,


Now we need to make the Gamercard viewable on viewtopic.

OPEN: viewtopic_body.tpl

FIND:

Code: [Download] [Hide] [Select]
<!-- END author_profile -->


AFTER, ADD:

Code: [Download] [Hide] [Select]
{postrow.POSTER_XBOX}<br />


Now let's add the language variable for the Custom Profile Field.

OPEN: lang_profile_fields.php

ADD:

Code: [Download] [Hide] [Select]
$lang['1_xbox'] = 'XBox ID';
$lang['1_Description'] = 'Insert your xbox gamers ID';


(CHANGE THE NUMBER TO YOUR CUSTOM PROFILE FIELD ID)  (THIS CAN BE FOUND IN ACP -> USERS -> EDIT CUSTOM PROFILE FIELDS.)

Change the number "1" to whatever your Custom Profile Field is numbered.  You may also change the text in this file to whatever you wish.  The end result is this:

 mysite


You are able to do anything with the Custom Profile Fields and this is just one of the many different things you can use it for.

Thanks to Luca for guidance!



 
Chaotic - View user's profile Send private message  
Chaotic [ Fri 14 Aug, 2009 02:08 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


PROFILE - How To Create Custom Profile Fields

Comments
Reply with quote    Download Post  
Post Re: [DOC] How To Create Custom Profile Fields 
 
Great Doc again Chaotic... number one in the docs department..

   



 
DWho - View user's profile Send private message  
DWho [ Fri 14 Aug, 2009 18:04 ]
Reply with quote    Download Post  
Post Re: [DOC] How To Create Custom Profile Fields 
 
Very nice DOC Chaotic.

I just needed some explanacions of how to implement these thing´s .

You´re the Best



 
spydie - View user's profile Send private message  
spydie [ Fri 14 Aug, 2009 18:36 ]
Reply with quote    Download Post  
Post Re: PROFILE - How To Create Custom Profile Fields 
 
Like Facebook?  Want to add a button to your posts that links users straight to your Facebook page so they can add you as a friend?

Enter your ACP -> USERS -> Add Custom Profile Field.

Field Name: facebook
Field Description: facebook

Just enter those two fields and click SUBMIT.

OPEN: viewtopic.php

FIND:

Code: [Download] [Hide] [Select]
        $poster_from = ($postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';


AFTER, ADD:

Code: [Download] [Hide] [Select]
        $poster_facebook = ( $postrow[$i]['facebook'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? '<a href="http://www.facebook.com/profile.php?ref=name&id=' . urlencode($postrow[$i]['facebook']) . '" target="_blank"><img src="images/facebook-icon.gif" alt="'. $lang['facebook'] .'" title="'. $lang['facebook'] .'" border="0" /></a>' : '';


FIND:

Code: [Download] [Hide] [Select]
            'POSTER_FROM_FLAG' => $poster_from_flag,


BEFORE, ADD:

Code: [Download] [Hide] [Select]
            'POSTER_FACEBOOK' => $poster_facebook,


OPEN: viewtopic_body.tpl

FIND:

Code: [Download] [Hide] [Select]
{postrow.POSTER_POSTS}


AFTER, ADD:

Code: [Download] [Hide] [Select]
{postrow.POSTER_FACEBOOK}<br />


OPEN: lang_profile_fields.php

FIND:

Code: [Download] [Hide] [Select]
/*
//An Australian Example for Profile Fields
$lang['1_Phone'] = 'Phone';
$lang['1_Description'] = 'Phone Number';
$lang['2_Team'] = 'Team';
$lang['2_Description'] = 'Australian Team';
$lang['2_Juve'] = 'Wallabies';
$lang['2_Milan'] = 'Kangaroos';
$lang['2_Altro'] = 'Other';
*/


AFTER, ADD:

Code: [Download] [Hide] [Select]
$lang['10_facebook'] = 'Facebook';
$lang['10_Description'] = 'Insert your Facebook ID number here.  To find your Facebook ID number, log into your Facebook account and click your name next to SETTINGS at the top of the page.  Look at the link in your browser and copy the number following "ref=name&id=".  Your ID number will be a series of only numbers.';


In the above lines, ($lang['10_facebook']), please replace the number 10 with your custom profile field ID.  To find your custom profile field ID, ACP -> Users -> Edit Custom Profile Fields.  Look for your custom profile field and note the number to the left of the field you created.  You should change the number in the above code to YOUR custom profile field ID.

 facebook



 
Chaotic - View user's profile Send private message  
Chaotic [ Wed 18 Nov, 2009 19:54 ]
Reply with quote    Download Post  
Post Re: PROFILE - How To Create Custom Profile Fields 
 
Nice word chaotic, but i dont understand how to add custom profiles without external references... for example...

I want add a custom field called "My Points", this field only could be modified for administrators (that option is in the ACP) and i'd like that field appear only in the user profile and/or any part my posts...

I dont know if you understand me. I'd like add custom fields that can be modified and set by admins...

how i could put that?

I hope you can help me =)

and nice tutorial =D



 
paramine-gx - View user's profile Send private message  
paramine-gx [ Thu 10 Dec, 2009 02:12 ]
Reply with quote    Download Post  
Post Re: PROFILE - How To Create Custom Profile Fields 
 
How i put the logo?



 
odelot - View user's profile Send private message  
odelot [ Wed 16 Mar, 2011 08:53 ]
Reply with quote    Download Post  
Post Re: PROFILE - How To Create Custom Profile Fields 
 
Can you please ask your question in "General Support"
and can you please explain a little bit more your question, because I don't understand what you mean.



 
TheSteffen - View user's profile Send private message  
TheSteffen [ Sun 20 Mar, 2011 17:29 ]
Reply with quote    Download Post  
Post Re: PROFILE - How To Create Custom Profile Fields 
 
Se puede poner algo como el id de play station osea algo asi¿?¿?

elvamo

pero con la información del centro de los juegos y eso...



 
elvamo - View user's profile Send private message  
elvamo [ Fri 29 Jul, 2011 01:05 ]
Reply with quote    Download Post  
Post Re: PROFILE - How To Create Custom Profile Fields 
 
English please Elvamo Inglés, por favor



 
Joshua203 - View user's profile Send private message  
Joshua203 [ Fri 29 Jul, 2011 07:50 ]
Reply with quote    Download Post  
Post Re: PROFILE - How To Create Custom Profile Fields 
 
This is great! Thanks! Ur one BIG help! Keep it up!



 
jeff909 - View user's profile Send private message  
jeff909 [ Sun 11 Sep, 2011 17:47 ]
Reply with quote    Download Post  
Post Re: PROFILE - How To Create Custom Profile Fields 
 
Very nice DOC Chaotic.

keep it up.
you are awesome.  



 
Edited by Joshua203, Fri 13 Jul, 2012 10:44: In profile..sig- and www button -info removed (user banned)
Edited by Joshua203, Fri 13 Jul, 2012 10:45: btw he was selling headphones :D
kerwin - View user's profile Send private message  
kerwin [ Fri 13 Jul, 2012 09:51 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 1