User profile fields in postbit

h@ck3r

New Member
I run a car forum, and I'm using VBGarage.

I want to create a custom profile field so when members add the link to their garage, a text link will appear in the users postbit. When you click the link- It will take you to that members garage (In VBGarage).

Can anyone assist me in which steps I need to take?
 
After a little testing I have come up with this:

Admincp >> User Profile Fields >> Add New User Profile Field

Single-Selection Radio Buttons

Title: My Garage
Description: Link to my garage in posts?
Items Per Line: 0
Options:
Yes
No
(add each option on a seperate line)

Set Default: Yes
Display Order: Your choice
Field Required: No
Field Editable by User: Yes
Private Field: No
Field Searchable on Members List: Upto you
Show on Members List: Upto you


Optional Input
Allow user to input their own value for this option: No

Display Page
options other

Template Edits:
In postbit/_legacy Find:
HTML:
					<div>
						$vbphrase[posts]: $post[posts]
					</div>

add below:

Code:
<!-- Start: HBD vB Garage Post Link -->
<if condition="$post[field[color=Red]X[/color]]== Yes">
 <div>
<a href="vbgarage.php?do=view&id=$bbuserinfo[userid]" title="View My Garage">My Garage</a>
 </div>
</if>
<!-- End: HBD vB Garage Post Link -->

Change X to correct profile field number

Members can now go to UserCP >> Edit Options and at the bottom they have the choice to show their garage link in posts...:)
 
Many many thanks Hoxxy as ever- That's fantastic!!

One thing though- Even though the radio button is set to 'Yes' as default- I still had to go into my profile and click save before it appeared in my posts.

Is there any way to make it so that EVERYONE has a 'My garage' link in their postbit?

Not everyone on my forum has created a garage- But I could create a custom template with some text saying 'Sorry- This user has not created a garage' or something along those lines.

Maybe use conditionals so that if they don't have a garage, they are directed to this custom template?

Sorry to be a pain. :D

Thanks again- You're a star!
 
Hmm.. found a bug in this matey..

My links fine, but all of my users has the same link in their postbit. When you click 'My garage' in the members postbit- I'm taken to MY OWN garage, instead of theirs.

Any way to sort this?

Cheers
 
Remove...
Code:
<if condition="$post[fieldX]== Yes">
and
Code:
</if>
from postbit/_legacy template edits, that will show the link by default, you could even remove the custom profile field from admincp if you do that...

not sure on how to redirect though...
 
Cheers, but I'm still faced with a bug that's stopping me from using this.

Every user now has a link to MY garage in their posts, rather than their own garage. :)

How do I make it so that each member has a link to their own garage?
 
Yeah sorry we posted @ the same time so I misssd your bug problem...lol

ok so lets start over...

Single-Line Text Box

Title: My Garage
Description: Add your user id here?
Max length of allowed user input: something high as the more users you have the higher it needs to be...
Field Length: 10 or more
Profile Field Type: Single-Line Text Box
Field Required: No
Field Editable by User: Yes
Next 3 options are upto you: Yes/No

Display Page
options other

Template Edits:
postbit/_legacy as above but this:

Code:
<!-- Start: HBD vB Garage Post Link -->
<if condition="$post[field[color=red]X[/color]]">
 <div>
<a href="vbgarage.php?do=view&id=$post[field[color=red]X[/color]]" title="View My Garage">My Garage</a>
 </div>
</if>
<!-- End: HBD vB Garage Post Link -->

now only shows if the user enters their id number which in turn should fix the bug, again to edit:
UserCP >> Edit Options

The only downfall I see with this is that if you have vBSEO installed it will be hard for members to find out their user id as it replaces id with username in all the places you can find it ie: statusbar when hovering over avatar or username...:(
 
Hoxxy said:
Yeah sorry we posted @ the same time so I misssd your bug problem...lol

ok so lets start over...

Single-Line Text Box

Title: My Garage
Description: Add your user id here?
Max length of allowed user input: something high as the more users you have the higher it needs to be...
Field Length: 10 or more
Profile Field Type: Single-Line Text Box
Field Required: No
Field Editable by User: Yes
Next 3 options are upto you: Yes/No

Display Page
options other

Template Edits:
postbit/_legacy as above but this:

Code:
<!-- Start: HBD vB Garage Post Link -->
<if condition="$post[field[color=red]X[/color]]">
 <div>
<a href="vbgarage.php?do=view&id=$post[field[color=red]X[/color]]" title="View My Garage">My Garage</a>
 </div>
</if>
<!-- End: HBD vB Garage Post Link -->

now only shows if the user enters their id number which in turn should fix the bug, again to edit:
UserCP >> Edit Options

The only downfall I see with this is that if you have vBSEO installed it will be hard for members to find out their user id as it replaces id with username in all the places you can find it ie: statusbar when hovering over avatar or username...:(

Thanks bud, but I'm using VBSeo on my forums, so don't think this would be any good for me, as you say- members cannot find their user ID.

Maybe this will help?

They're not using VBGarage- But they do have a button in postbit linking to their gallery for all users.
 
And also- I've just looked, and the garage ID seems to be the same as the user ID.

Check my screenshot and you'll see what I mean :)

vbgarage.jpg


So.. maybe there is a way to fix this problem, without the users having to find out their user ID? :)
 
Ah ok then just add how to find id in the description section of profile field...:)
Description: Add your user id here. To find out your id....blah blah blah blah
 
Hoxxy said:
Ah ok then just add how to find id in the description section of profile field...:)
Description: Add your user id here. To find out your id....blah blah blah blah

So there's no way to have it automatically added without the user having to add it?
 
Back
Top