![]() |
|
Article Options |
#76
|
||||
|
||||
Excellent, glad you got it sorted.
![]()
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others. No members have liked this post.
|
#77
|
|||
|
|||
TL;DR - how can I display a multi line textbox custom profile field, with line breaks preserved, in the postbit?
I've got a Multi Line Text Box, custom profile field, that I would like to display in my legacy postbit. I'm using this code from the OP: <vb:if condition="$post['fieldx']"><dt>My FieldX</dt> <dd>{vb:raw post.fieldx}</dd></vb:if> And it works great! But it doesn't respect line breaks, that users entered into this profile field, which makes it look really weird when you have more than one item listed. I found a post mentioning this:
No members have liked this post.
|
#78
|
||||
|
||||
You'd have to look at the array and put line feeds between the items. I haven't ever needed to look into this, so I can't offer a solution to you.
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) The following members like this post: Protonus
|
#79
|
||||
|
||||
You might try:
but I haven't tried it myself. The following members like this post: Protonus
|
#80
|
||||
|
||||
Originally Posted by kh99
Thank you for the suggestion! It DOES preserve the line breaks now, however, it also doesn't word wrap now, which means it allows long lines to spill into the post area from the postbit. Doh! ![]()
So, close, but I had to roll back due to the spill over issue. No members have liked this post.
|
#81
|
||||
|
||||
oh man im so shit at this lol
ok, so vB4.2.2 and editing in postbit template The field i've created is gender with 2 options male or female. ![]() Here is the code i've got in there. Its not working and i bet one of you guys will take 1 look and it will be so obvious lol ![]()
__________________
working for a more secure, more sustainable future www.dreadsuk.com No members have liked this post.
Last edited by DreadsUK; 01 May 2014 at 05:41. |
#82
|
||||
|
||||
It's "field7", not "Field7".
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#83
|
||||
|
||||
<vb:if condition="$post['field7']"><dt>Gender</dt> <dd>{vb:raw post.field7}</dd></vb:if>
Not working
__________________
working for a more secure, more sustainable future www.dreadsuk.com No members have liked this post.
|
#84
|
||||
|
||||
Take off the conditionals so you just have this:
Does anything show up now? This is really a test that you are editing the correct template in the correct style, since now, even if your field id was wrong you should at least see "Gender" in the postbit.
__________________
MARK.B (Member of the vB Support Team) No members have liked this post.
|
#85
|
||||
|
||||
Are you sure the poster has even set the gender in their profile?
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#86
|
||||
|
||||
Yea, the poster is me hehe. good question tho
![]() --------------- Added 02 May 2014 at 19:38 --------------- AHHHH, i was editing 'postbit' not 'postbit_legacy'
__________________
working for a more secure, more sustainable future www.dreadsuk.com No members have liked this post.
|
#87
|
|||
|
|||
The old ones are the best.
![]()
__________________
MARK.B (Member of the vB Support Team) No members have liked this post.
|
#88
|
|||
|
|||
Have been trying to use method 2 ...
This works >>>> if ($post[field40]) { $ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc').'/critique/nocritique.png'; $template_hook['postbit_userinfo_right_after_posts'] .= '<br /><dt>Critique Level</dt><br /> <dd><img src="' . $ImagePath . '"/></dd>'; } Yielding both Critique Level: and an image. Adding conditional doesn't, if there is just one conditional I get Critique Level: and a broken image link; the only difference is the "& 4" - If I use with three conditionals I get 3 * Critique Level: s and 3 broken image links .... It also seems as though it is ignoring the "if" statement because it shows on every profile.>>>> if ($post[field40]) { if ($post[field40] & 4) $ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc').'/critique/nocritique.png'; $template_hook['postbit_userinfo_right_after_posts'] .= '<br /><dt>Critique Level</dt><br /> <dd><img src="' . $ImagePath . '"/></dd>'; } I can hazard a guess that using three conditionals there could be a confusion over $ImagePath, but surely it should work with just the one condition ? I'm missing something rather simple I think ?! No members have liked this post.
|
#89
|
||||
|
||||
You need some parenthesis after your second condition (why are you using a second one anyway?).
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#90
|
|||
|
|||
Not too sure what you mean by "why am I using a second condition...."
I'm following your method 2 :
[field40] contains 3 radio buttons. Looks like I need to keep hammering at it .... No members have liked this post.
|
![]() |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 16:36.