PROFILE - How To Create Custom Profile Fields


Subject: 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!

Subject: Re: [DOC] How To Create Custom Profile Fields
Great Doc again Chaotic... number one in the docs department..

:mrgreen: :mrgreen:

Subject: 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 :drink_02:

Subject: 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

Subject: 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

Subject: Re: PROFILE - How To Create Custom Profile Fields
How i put the logo?

Subject: 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.

Profile PM  
Subject: 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...

Subject: Re: PROFILE - How To Create Custom Profile Fields
English please Elvamo :shock: Inglés, por favor :wink:

Subject: Re: PROFILE - How To Create Custom Profile Fields
This is great! Thanks! Ur one BIG help! Keep it up!

Subject: Re: PROFILE - How To Create Custom Profile Fields
Very nice DOC Chaotic.

keep it up.
you are awesome. :LOL: :LOL:


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.9612s (PHP: 2% SQL: 98%)
SQL queries: 18 - Debug Off - GZIP Enabled