View Full Version : Making a registration profile field show up on posts?
Rubiano
03-19-2008, 01:08 AM
I have made a custom question at the registration by creating a new Custom Profile Field. I am trying to make it so that the User's answer to the question shows up in their posts. How do i do this?
Dismounted
03-19-2008, 05:17 AM
In the postbit (or postbit_legacy, depending on which you use), you need to add something like below where you want it (or you could just search for "$vbphrase[posts]" to find where the post count is displayed). Replace "X" with the field number (can be found in the Profile Fields Manager.
Field Name: $post[fieldX]
Rubiano
03-21-2008, 07:29 PM
it is still not showing up- this is what i posted
<if condition="$post['fieldX']">
$post[fieldX]
</if>
Dismounted
03-22-2008, 12:13 PM
In the postbit (or postbit_legacy, depending on which you use), you need to add something like below where you want it (or you could just search for "$vbphrase[posts]" to find where the post count is displayed). Replace "X" with the field number (can be found in the Profile Fields Manager.
Field Name: $post[fieldX]
Have you done that?
Rubiano
03-22-2008, 01:44 PM
yes i have
Dismounted
03-23-2008, 04:04 AM
Where are you putting it?
Rubiano
03-25-2008, 09:47 PM
Where should i put the code so that my custom profile field shows up right above the
post count?
DieselTruck
03-25-2008, 09:56 PM
Above the post count code.
Rubiano
03-25-2008, 10:25 PM
I tried this and it still didnt work!
Here is what i put:
<if condition="$post['fieldX5']">
$post[field5]
</if>
EvilChicken
03-25-2008, 11:10 PM
Make sure that the field IS in fact field 5, feel it in.
your code also has an error here:
<if condition="$post['fieldX5']">
$post[field5]
</if>
Change it to this:
<if condition="$post['field5']">
$post[field5]
</if>
Rubiano
03-25-2008, 11:53 PM
I tried it again and made sure everything was correct. I checked and made sure that it was field 5. and it still didnt work.
SEOvB
03-26-2008, 01:27 AM
your if statement is incorrect
try just using $post[field5] instead
Dismounted
03-26-2008, 02:47 AM
Please tell me how the condition is incorrect? $post[field5] and $post['field5'] both mean the same thing, with the one with quotes being faster. When you don't have the quotes, PHP searches for the constant named field5, then searches for the array key named field5. With the quotes, PHP only searches for the array key named field5.
Opserty
03-26-2008, 10:15 AM
I tried it again and made sure everything was correct. I checked and made sure that it was field 5. and it still didnt work.
Please post the code you are using, furthermore have you checked that this field actually contains data to be displayed? (i.e. it is not empty)
Rubiano
04-02-2008, 08:13 PM
Please post the code you are using, furthermore have you checked that this field actually contains data to be displayed? (i.e. it is not empty)
<if condition="$post['field5']">
$post[field5]
</if>
That is the code i am using. The field is not required to be filled out at registration. It is optional. But I have it filled out and so do many members and when i put the code in it does not show up on the posts of the people who do have it filled it. Is the code wrong or something or is the field supposed to be a Required field instead of an optional field?
--------------- Added 1207186313 at 1207186313 ---------------
Update:
I have been adding the code to the postbit_legacy which is listed under "postbit templates" and is also the one that is Red text. There is also a thing called "postbit" listed under "postbit templates" but it is in white text. Am i supposed to add the code to "postbit" or "postbit_legacy"?
Dismounted
04-03-2008, 05:24 AM
You need to add it to the one you are using. If your posts have the user info on the left hand side, it is legacy. If they display on the top (like here), it is not legacy.
Rubiano
04-03-2008, 10:18 AM
You need to add it to the one you are using. If your posts have the user info on the left hand side, it is legacy. If they display on the top (like here), it is not legacy.
That must be why! I was adding to the postbit_legacy but the other fields display on the top right of the posts. That is wierd though because in the legacy i saw the code for location and join date and all of that stuff.
Dismounted
04-03-2008, 12:54 PM
That is wierd though because in the legacy i saw the code for location and join date and all of that stuff.
Because the legacy template also shows that information. It is used when the option to display user info in posts to the left is activated.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.