[How To] Utilizing each Custom Profile Field

How-to's, little tricks, tutorials, code examples (snippets) and read-me's.

Re: [How To] Utilizing each Custom Profile Field

Postby Sniper_E » 31 Dec 2010, 19:51

That makes the instructions in the memberlist_view.html template wrong....

They should read:
Code: Select all
      <!-- IF S_PROFILE_FIELD1 -->
         <!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
         <dt>{PROFILE_FIELD1_NAME}:</dt> <dd>{PROFILE_FIELD1_VALUE}</dd>
      <!-- ENDIF -->

I bet that is why I started this topic.... the information was wrong.
I could never get that to work so I found another way around it.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: [How To] Utilizing each Custom Profile Field

Postby Honor » 07 Jan 2011, 12:18

I'm having a difficult time understanding this - could be the head cold I've got, but you all know me anyway :P Here's what I want:

I want users/admin to be able to list in a user's profile field a list of links. They don't have to be images, but they need to be innumberable. It's for a character listing - each character has it's own HTML page, but I would like users to have a listing of those characters in their profile.

So it would look like this:

Characters:
Tristan Avalon
Lauryl Mossiva
Corrine Ranshaw



etc, and each name would be a link to that character's page.

Can someone help me with a profile field that would do that? Some of us have MANY characters, others only have one or two.
BluePlanet RP
my own creation.

Host: Host Monster
Version: 3.0.9
Honor    
STG Moderator
STG Moderator
 
Posts: 328
Joined: 23 Dec 2010, 10:53
Gender: Female
phpBB Knowledge: 2

Re: [How To] Utilizing each Custom Profile Field

Postby Sniper_E » 07 Jan 2011, 21:30

Would a custom profile field work for each of your users? Something like this...
Click to enlarge image
characters.gif
(17.61 KiB) Not downloaded yet

Go to ACP / Users and Groups / Custom profile fields / and create a new "characters" cpf.
characters - Textarea - Create new field
Field name/title presented to the user: Character Names
Field description: List all of your Character names, one character per line.
Then click "Profile type specific options"
Make the 'Rows' the amount of the most characters a user may have and click "Save"

Then if you wanted to show that somewhere else in your page other than where it shows,
then you could use this utilize each cpf stuff.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [How To] Utilizing each Custom Profile Field

Postby Honor » 07 Jan 2011, 22:35

I have one of those already, but I don't know how to make it accept links. HTML and BBCodes aren't accepted.

That's exactly what I want though :) Just, instead of a list of names, I need to make the names links to that character.
BluePlanet RP
my own creation.

Host: Host Monster
Version: 3.0.9
Honor    
STG Moderator
STG Moderator
 
Posts: 328
Joined: 23 Dec 2010, 10:53
Gender: Female
phpBB Knowledge: 2

Re: [How To] Utilizing each Custom Profile Field

Postby Sniper_E » 08 Jan 2011, 00:44

How many different characters would one user have? The most. There is a way.
You could have one cpf for the character name and one cpf for the link it goes to.
That would be two cpf for each line/each character.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [How To] Utilizing each Custom Profile Field

Postby Honor » 08 Jan 2011, 12:55

... a lot. For myself, my list would be:

SGC
Tristan Avalon
Elliot Grey

SGA
Lauryl Mossiva
Corrine Ranshaw

OB
Sterling Vanderbuilt

SE
Reah
Jax Avatar

CC
Tristan Avalon (diff sheet for diff game)

AoL
Chardonai
Maria



Those are separated by games. That would be nice, actually - have each world as one "field", and then the person can list the links to their characters.

I most likely have the most characters, as I try to participate alot. I also believe I might be the only person to run two characters on any game, but the option is there if people want more than one. I'd like to be able to take all of this into account.
BluePlanet RP
my own creation.

Host: Host Monster
Version: 3.0.9
Honor    
STG Moderator
STG Moderator
 
Posts: 328
Joined: 23 Dec 2010, 10:53
Gender: Female
phpBB Knowledge: 2

Re: [How To] Utilizing each Custom Profile Field

Postby Sniper_E » 08 Jan 2011, 22:40

Aight, if you want to go there... First to link the cpf names listed you need this edit.

Open ./includes/functions_profile_fields.php
FIND
Code: Select all
    $value = make_clickable($value);
REPLACE WITH
Code: Select all
    // $value = make_clickable($value);

Let's start with 4 cpf names for this and you can expand from there.
You will need 8 cpf for those 4 names. 2 names in each game.

Let's do the SGC and the SGA games for this example.
Create the 8 cpf:
  • sgcnameone - Simple text field
  • sgclinkone - Simple text field
  • sgcnametwo - Simple text field
  • sgclinktwo - Simple text field
  • sganameone - Simple text field
  • sgalinkone - Simple text field
  • sganametwo - Simple text field
  • sgalinktwo - Simple text field
You will find out that you need a long line to enter the url addresses in so make the link cpf large.
Maximum number of characters: 50 to 80 (what ever you need)

Creating one name cpf and one link cpf example:
Code: Select all
sgcnameone - Simple text field - Create new field
Field name/title presented to the user: SGC Character1
Field description: Enter your first character name for SGC.
Profile type specific options - Save

Code: Select all
sgclinkone - Simple text field - Create new field
Field name/title presented to the user: SGC Link1
Field description: Enter url to your first character for SGC.
Profile type specific options - Maximum number of characters: 80 - Save

Those two cpf will do for one name. Continue and create another 3 names for this.
I put some code together for 4 names. So add these 3 other names like you did above.
  • sgcnametwo - Simple text field
  • sgclinktwo - Simple text field
  • sganameone - Simple text field
  • sgalinkone - Simple text field
  • sganametwo - Simple text field
  • sgalinktwo - Simple text field

I placed this cpf group below the sig of the user's post like this.

Open ./styles/prosilver/template/viewtopic_body.html
FIND
Code: Select all
         <!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF -->
AFTER ADD
Code: Select all
         <ul class="profile-icons">
         <!-- IF postrow.S_PROFILE_SGCNAMEONE and postrow.S_PROFILE_SGCLINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_SGCNAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_SGCLINKONE_VALUE}" title="{postrow.PROFILE_SGCLINKONE_VALUE}">{postrow.PROFILE_SGCNAMEONE_VALUE}</a></dd>
            <!-- IF postrow.S_PROFILE_SGCNAMETWO and postrow.S_PROFILE_SGCLINKTWO -->
               <dd><a href="{postrow.PROFILE_SGCLINKTWO_VALUE}" title="{postrow.PROFILE_SGCLINKTWO_VALUE}">{postrow.PROFILE_SGCNAMETWO_VALUE}</a></dd>
            <!-- ENDIF -->
            </li>
         <!-- ENDIF -->
         <!-- IF postrow.S_PROFILE_SGANAMEONE and postrow.S_PROFILE_CGAKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_SGANAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_SGALINKONE_VALUE}" title="{postrow.PROFILE_SGALINKONE_VALUE}">{postrow.PROFILE_SGANAMEONE_VALUE}</a></dd>
            <!-- IF postrow.S_PROFILE_SGANAMETWO and postrow.S_PROFILE_SGALINKTWO -->
               <dd><a href="{postrow.PROFILE_SGALINKTWO_VALUE}" title="{postrow.PROFILE_SGALINKTWO_VALUE}">{postrow.PROFILE_SGANAMETWO_VALUE}</a></dd>
            <!-- ENDIF -->
            </li>
         <!-- ENDIF -->
         </ul>

Study the codes, you will see that each game with 2 names in it is between the <li> and the </li>
If you can see how that code is dividing the games you can add the other 3 games to this.

Let me know how it goes...
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [How To] Utilizing each Custom Profile Field

Postby Honor » 10 Jan 2011, 12:10

I don't think it's working =/ When I view a post, I get this:

SGC Main Character: Tristan Elizabeth Avalon
SGC Main Character Link: http://blueplanet.road2us.com/t14-trist ... eth-avalon
SGC 2nd Character: Elliot Grey
SGC 2nd Character Link: http://blueplanet.road2us.com/t140-elliot-grey
OB Main Character: Sterling Vanderbuilt
OB Character Link: http://blueplanet.road2us.com/t489-ster ... anderbuilt
SGA Main Character: Lauryl Mossiva
SGA Main Character Link: http://blueplanet.road2us.com/t15-laury ... and-amirin
SGA 2nd Character: Corrine Andrew
SGA 2nd Character Link: http://blueplanet.road2us.com/t16-corri ... background
SE Main Character: Jax Avatar
SE Main Character Link: http://blueplanet.road2us.com/t17-jax-avatar
2nd SE Character link: http://blueplanet.road2us.com/t315-nine
Crusade Character Name: Tristan Avalon
Crusade Character Link: http://blueplanet.road2us.com/t18-civil ... eth-avalon
Lystra Main Character: Chardonai
Lystra Main Character Link: http://blueplanet.road2us.com/t183-char ... lle-valley
2nd Lystra Character: Maria Trescreek
2nd Lystra Character Link: http://blueplanet.road2us.com/t412-maria-trescreek

Example viewable as guest:
http://www.blueplanetrp.com/phpBB3/view ... ead#unread

My code:
Code: Select all
         <!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF -->
         
                  <ul class="profile-icons">
         <!-- IF postrow.S_PROFILE_SGCNAMEONE and postrow.S_PROFILE_SGCLINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_SGCNAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_SGCLINKONE_VALUE}" title="{postrow.PROFILE_SGCLINKONE_VALUE}">{postrow.PROFILE_SGCNAMEONE_VALUE}</a></dd>
            <!-- IF postrow.S_PROFILE_SGCNAMETWO and postrow.S_PROFILE_SGCLINKTWO -->
               <dd><a href="{postrow.PROFILE_SGCLINKTWO_VALUE}" title="{postrow.PROFILE_SGCLINKTWO_VALUE}">{postrow.PROFILE_SGCNAMETWO_VALUE}</a></dd>
            <!-- ENDIF -->
            </li>
         <!-- ENDIF -->
         <!-- IF postrow.S_PROFILE_SGANAMEONE and postrow.S_PROFILE_SGALINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_SGANAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_SGALINKONE_VALUE}" title="{postrow.PROFILE_SGALINKONE_VALUE}">{postrow.PROFILE_SGANAMEONE_VALUE}</a></dd>
            <!-- IF postrow.S_PROFILE_SGANAMETWO and postrow.S_PROFILE_SGALINKTWO -->
               <dd><a href="{postrow.PROFILE_SGALINKTWO_VALUE}" title="{postrow.PROFILE_SGALINKTWO_VALUE}">{postrow.PROFILE_SGANAMETWO_VALUE}</a></dd>
            <!-- ENDIF -->
            </li>
         <!-- ENDIF -->
        <!-- IF postrow.S_PROFILE_OBNAMEONE and postrow.S_PROFILE_OBLINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_OBNAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_OBLINKONE_VALUE}" title="{postrow.PROFILE_OBLINKONE_VALUE}">{postrow.PROFILE_OBNAMEONE_VALUE}</a></dd>
     
            </li>
         <!-- ENDIF -->
     <!-- IF postrow.S_PROFILE_SENAMEONE and postrow.S_PROFILE_SELINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_SENAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_SELINKONE_VALUE}" title="{postrow.PROFILE_SELINKONE_VALUE}">{postrow.PROFILE_SENAMEONE_VALUE}</a></dd>
            <!-- IF postrow.S_PROFILE_SGANAMETWO and postrow.S_PROFILE_SGALINKTWO -->
               <dd><a href="{postrow.PROFILE_SELINKTWO_VALUE}" title="{postrow.PROFILE_SELINKTWO_VALUE}">{postrow.PROFILE_SENAMETWO_VALUE}</a></dd>
            <!-- ENDIF -->
            </li>
         <!-- ENDIF --> 
     <!-- IF postrow.S_PROFILE_CNAMEONE and postrow.S_PROFILE_CLINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_CNAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_CLINKONE_VALUE}" title="{postrow.PROFILE_CLINKONE_VALUE}">{postrow.PROFILE_CNAMEONE_VALUE}</a></dd>
            <!-- IF postrow.S_PROFILE_CNAMETWO and postrow.S_PROFILE_CLINKTWO -->
               <dd><a href="{postrow.PROFILE_CLINKTWO_VALUE}" title="{postrow.PROFILE_CLINKTWO_VALUE}">{postrow.PROFILE_CNAMETWO_VALUE}</a></dd>
            <!-- ENDIF -->
            </li>
         <!-- ENDIF -->         
        <!-- IF postrow.S_PROFILE_WNAMEONE and postrow.S_PROFILE_WLINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_WNAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_WLINKONE_VALUE}" title="{postrow.PROFILE_WLINKONE_VALUE}">{postrow.PROFILE_WNAMEONE_VALUE}</a></dd>

            </li>
         <!-- ENDIF -->
     <!-- IF postrow.S_PROFILE_AOLNAMEONE and postrow.S_PROFILE_AOLLINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_AOLNAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_AOLLINKONE_VALUE}" title="{postrow.PROFILE_AOLLINKONE_VALUE}">{postrow.PROFILE_AOLNAMEONE_VALUE}</a></dd>
            <!-- IF postrow.S_PROFILE_AOLNAMETWO and postrow.S_PROFILE_AOLLINKTWO -->
               <dd><a href="{postrow.PROFILE_AOLLINKTWO_VALUE}" title="{postrow.PROFILE_AOLLINKTWO_VALUE}">{postrow.PROFILE_AOLNAMETWO_VALUE}</a></dd>
            <!-- ENDIF -->
            </li>
         <!-- ENDIF -->         
      <!-- IF postrow.S_PROFILE_FANTASYNAMEONE and postrow.S_PROFILE_FANTASYLINKONE -->
            <li>
               <dd><strong>{postrow.PROFILE_FANTASYNAMEONE_NAME} &nbsp;</strong><br />
               <a href="{postrow.PROFILE_FANTASYLINKONE_VALUE}" title="{postrow.PROFILE_FANTASYLINKONE_VALUE}">{postrow.PROFILE_FANTASYNAMEONE_VALUE}</a></dd>
            <!-- IF postrow.S_PROFILE_FANTASYNAMETWO and postrow.S_PROFILE_FANTASYLINKTWO -->
               <dd><a href="{postrow.PROFILE_FANTASYLINKTWO_VALUE}" title="{postrow.PROFILE_FANTASYLINKTWO_VALUE}">{postrow.PROFILE_FANTASYNAMETWO_VALUE}</a></dd>
            <!-- ENDIF -->
            </li>
         <!-- ENDIF -->       
         </ul>
         
      <!-- ENDIF -->

      </div>



The view is the same on my profile page.
BluePlanet RP
my own creation.

Host: Host Monster
Version: 3.0.9
Honor    
STG Moderator
STG Moderator
 
Posts: 328
Joined: 23 Dec 2010, 10:53
Gender: Female
phpBB Knowledge: 2

Re: [How To] Utilizing each Custom Profile Field

Postby Sniper_E » 10 Jan 2011, 12:56

Yes it's working. All of your characters are showing in your profile. You're good. :good:
We will have to do a <!-- IF not statement in that section to get rid of those showing.
The first post on this topic shows how to do that.
I can make one up for you later. You will need a long IF statement in that cpf section.
Once it shows where your sig is then we have to remove them from your profile.
We are putting these somewhere else in the page where they fit and removing those.

But, they are not showing under where your sig is located on that site. Get that to show.
The <!-- IF postrow.S_PROFILE_SGCNAMEONE and postrow.S_PROFILE_SGCLINKONE -->
Did you create your cpf with the name "sgcnameone" and the link as "sgclinkone"?
Your IF codes have to match the name you created... but all in caps.

It looks like all of your links go to: http://blueplanet.road2us.com/
You could set that link up like this:
Code: Select all
<a href="http://blueplanet.road2us.com/{postrow.PROFILE_SGCLINKONE_VALUE}" title="http://blueplanet.road2us.com/{postrow.PROFILE_SGCLINKONE_VALUE}">{postrow.PROFILE_SGCNAMEONE_VALUE}</a>

Then your users can enter in their character name in the link field like:
Code: Select all
t14-tristan-elizabeth-avalon

Just an option...

This is where I set these up to go.
characters-in-sig.gif
(12.07 KiB) Not downloaded yet

I only have one game setup but yours would line up across the page under where your sig is.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [How To] Utilizing each Custom Profile Field

Postby Honor » 10 Jan 2011, 19:48

I completely forgot to refresh the templates lol - they're there now, and they all seem to match :)

As for those links - they are just temporary. I used the Pages mod from the .com site but haven't transfered over the files yet. Was just using these links as tests to get this right.

Okay, the styling is very off. I'm still learning html/css and need just a slight push in the right direction....

http://www.blueplanetrp.com/phpBB3/view ... ead#unread

As you can see, they are all mooshed up on the left. I'd like them either centered or right aligned, and I need at least two or three lines as they all don't fit. I tried <br> breaks but that didn't help, as you can see.

This is wonderful! I'm going to work on the IF statement and a really good placement in the profile page :) Thank you!
BluePlanet RP
my own creation.

Host: Host Monster
Version: 3.0.9
Honor    
STG Moderator
STG Moderator
 
Posts: 328
Joined: 23 Dec 2010, 10:53
Gender: Female
phpBB Knowledge: 2

PreviousNext

Return to Tutorials and How-Tos

Who is online

Users browsing this forum: Googlebot and 8 guests