vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=250418

Lynne 25 Sep 2012 21:49

You need to use the <a> tag for links - http://www.w3schools.com/tags/tag_a.asp and please use double-quotes in the tag, not single-quotes since the single-quotes are being used in the equation.

omega79 26 Sep 2012 08:38

i am just very new to all this so i have no idea how to do it ...
isn't there a way you can put a form in the pluginconfiguration where the plugin-user could type in or choose the fieldID ?

but well if needed i will probably finishing my community first and after i went live i can look into this again ...

still having headaches over other things in VBB ... have to learn alot ;)

Lynne 26 Sep 2012 17:09

I already have it in a form where all you have to do is change the field id. This is an article, not a modification. If you don't know how to do it, then I suggest you try it out on your test site.

omega79 02 Oct 2012 10:08

okay thank you very much :D
it all looks very complicated if you are new to vbulletin ...
but after some time it gets more simple ...
nice work you done here :D

CentralGarrison 26 Feb 2013 14:39

I'm sorry if this is inappropriate to ask here, but reading through this guide it looks like the same method could be used to put custom profile fields into the user's signature. Which templates would I need to edit to force a custom field to always be displayed in a user's signature?

EDIT: Nevermind, please disregard. I found what I needed in the postbit_legacy template! Thank you!

Mysterious Ride 23 Apr 2013 16:13

Quote:

Originally Posted by Lynne (Post 2097602)
Method 2 - Using a template_hook
I have always found it easier to just use the existing $template_hooks in the template and write a plugin to add these. In this case, there is a $template_hook right where we want it, after the user post count:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So, we would create a plugin with these specifications:
hook location - postbit_display_complete
Title - Add User Profile Fields to Postbit Templates
Plugin is Active - Yes
Plugin PHP Code -

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change "fieldx" to your actual field name and the green field to whatever you want. Again, notice the html I used is similar to the html used for the text above me new field. Whichever template_hook you use, you should look at the template to see what sort of html is being used around the hook so that you may use similar, proper html also.

I tried to read on how to make this a hyperlink from what others asked, but I got confused. This is the method that you posted that I want to use and what's going to be placed into the profile field is a link to profile post that the member posted for a character. What I trying to get it to look like is this:

Join Date:
Posts:
Character Profile

Even if its the whole Character Profile is the hyperlink that will take member directly to the character profile will work. I believe you said that I would have to use the <a> tag, but I'm not sure how to insert it into the code you already have.

Lynne 23 Apr 2013 16:54

Something like:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I haven't tested it, but I think it should work.

Mysterious Ride 24 Apr 2013 09:20

That didn't work, I got this error at the top of my board. I tried just doing the regular method two you have posted, but the profile field didn't show up under the post count either.

Lynne 24 Apr 2013 17:20

And what was the error? And what was the *exact* code you entered into the plugin?

Mysterious Ride 25 Apr 2013 02:01

1 Attachment(s)
Sorry, I tried it again and it worked perfectly. I must have not posted something right. I got the error because I left out the:

if ($post['fieldx'])
{

I thought I added it when I tried a second time, but I didn't get an error message nor did anything show up. But here's the completed code for Method 2 that works perfectly:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The My Link can be anything anyone what's it to be.

I also adjusted the code so that it fits Method 1 and I tested it and it works great to. It still goes in the same place you said.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I included an attachment to show the end result.

kiddo 22 Aug 2013 19:22

1 Attachment(s)
So I copied the same code from Location to use for other custom profile fields. When I did this, it showed up, but the name didn't as you can see in the image below. Any help??

The custom profile field's name is PSN so for the code

{vb:rawphrase} I put {vb:rawphrase PSN}\



EDIT: FIXED IT! I just completely removed the vb:rawphrase and simply added PSN to the "MyField" part and it worked!

afmarko99 15 Feb 2014 16:15

Thank you very much Lynne

akxt660 04 Apr 2014 00:58

I want to show images in postbit, related to the selected options by the user in the Multiple Choice Menu.

The below code works just in "Single Selection Menu:

<vb:if condition="$post['fieldX']"> <img src="{vb:raw post.fieldX}.png" /> </ a> </ vb: if>

But how do I work on Multiple Choice Menus?

In the image below you can view the images, but it performed with the Single Choice Menus:

https://www.vbulletin.org/forum/external/2014/04/48.jpg

In this case the user should select four options in Multiple Choice Menu.
These images refer to flags that users rescued

ozzy47 04 Apr 2014 01:08

Did you follow all the instructions in the first post?

For Multiple-Selection Menu and Multiple-Selection Checkbox

It is a bit more complicated for these two types of selections since the options selected are stored as a binary number. If you just display the field using the method above, you will get a number, not a list of options selected. So, in order to use these types of fields, you will have to use the method below. Here is a thead that will explain the binary scheme - http://www.vbulletin.com/forum/showt...To-The-Postbit

Method 1
- Modifying the Template
Open the template and find the area you want to add it to. For instance, to add it right after the user post count, find this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And then add this underneath (this is assuming the field has 5 options):


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Change "fieldx" to your actual field name and the green field to whatever you want. Notice the html I used is similar to the html used for the text above me new field.

akxt660 04 Apr 2014 01:54

Yes. All ok now!

I found a problem here:
<vb:if condition="$post['fieldx']"><dt>My FieldX</dt><dd>
<vb:if condition="$post['fieldx'] & 1">Your 1rst option</vb:if>
<vb:if condition="$post['fieldx'] & 2">Your 2nd option</vb:if>

correct is:
<vb:if condition="$post['fieldx']"><dt>My FieldX</dt><dd> </vb:if>
<vb:if condition="$post['fieldx'] & 1">Your 1rst option</vb:if>
<vb:if condition="$post['fieldx'] & 2">Your 2nd option</vb:if>

I get string error because of this small problem!


All times are GMT. The time now is 10:33.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.