Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #76  
Old 04 Apr 2014, 02:56
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Aug 2009
Real name: Chris
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.
Reply With Quote
  #77  
Old 29 Apr 2014, 03:12
Protonus Protonus is offline
 
Join Date: Aug 2005
Real name: Jim
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:

Multiple Line Text Boxes

While I don't recommend displaying these in the postbit as they can contain a large amount of information, they are done in the exact same way as the single line text box.

Note: The text entered will display all on one line, not in multiple lines as added to the text box and displayed in the profile page.
But... no mention on how to fix it? Thanks in advance!
Reply With Quote
  #78  
Old 29 Apr 2014, 05:00
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.)
Reply With Quote
  #79  
Old 30 Apr 2014, 11:09
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You might try:

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


but I haven't tried it myself.
Reply With Quote
  #80  
Old 30 Apr 2014, 22:13
Protonus Protonus is offline
 
Join Date: Aug 2005
Real name: Jim
Originally Posted by kh99 View Post
You might try:

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

but I haven't tried it myself.
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.
Reply With Quote
  #81  
Old 30 Apr 2014, 22:57
DreadsUK's Avatar
DreadsUK DreadsUK is offline
 
Join Date: Jan 2014
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

Last edited by DreadsUK; 01 May 2014 at 06:41.
Reply With Quote
  #82  
Old 01 May 2014, 19:05
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.)
Reply With Quote
  #83  
Old 02 May 2014, 20:05
DreadsUK's Avatar
DreadsUK DreadsUK is offline
 
Join Date: Jan 2014
<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
Reply With Quote
  #84  
Old 02 May 2014, 20:22
Mark.B Mark.B is offline
 
Join Date: Feb 2004
Take off the conditionals so you just have this:

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

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)
Reply With Quote
  #85  
Old 02 May 2014, 20:27
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.)
Reply With Quote
  #86  
Old 02 May 2014, 20:34
DreadsUK's Avatar
DreadsUK DreadsUK is offline
 
Join Date: Jan 2014
Originally Posted by Lynne View Post
Are you sure the poster has even set the gender in their profile?
Yea, the poster is me hehe. good question tho

--------------- Added 02 May 2014 at 20:38 ---------------

AHHHH, i was editing

'postbit' not 'postbit_legacy'
__________________
working for a more secure, more sustainable future www.dreadsuk.com
Reply With Quote
  #87  
Old 02 May 2014, 21:13
Mark.B Mark.B is offline
 
Join Date: Feb 2004
Originally Posted by Mark.B View Post
This is really a test that you are editing the correct template
Originally Posted by DreadsUK View Post
AHHHH, i was editing

'postbit' not 'postbit_legacy'
The old ones are the best.
__________________
MARK.B (Member of the vB Support Team)
Reply With Quote
  #88  
Old 23 Jun 2015, 14:13
jagtpf jagtpf is offline
 
Join Date: Mar 2015
Real name: Geoff
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 ?!
Reply With Quote
  #89  
Old 23 Jun 2015, 19:52
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You need some parenthesis after your second condition (why are you using a second one anyway?).


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

__________________
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.)
Reply With Quote
  #90  
Old 25 Jun 2015, 10:08
jagtpf jagtpf is offline
 
Join Date: Mar 2015
Real name: Geoff
Not too sure what you mean by "why am I using a second condition...."

I'm following your method 2 :

if ($post['fieldx'])
{
$template_hook['postbit_userinfo_right_after_posts'] .= '<dt>My FieldX</dt> <dd>';

if ($post['fieldx'] & 1) $template_hook['postbit_userinfo_right_after_posts'] .= 'Your 1rst option';
if ($post['fieldx'] & 2) $template_hook['postbit_userinfo_right_after_posts'] .= 'Your 2nd option';
if ($post['fieldx'] & 4) $template_hook['postbit_userinfo_right_after_posts'] .= 'Your 3rd option';
if ($post['fieldx'] & 8) $template_hook['postbit_userinfo_right_after_posts'] .= 'Your 4th option';
if ($post['fieldx'] & 16) $template_hook['postbit_userinfo_right_after_posts'] .= 'Your 5th option';

$template_hook['postbit_userinfo_right_after_posts'] .= '</dd>';
}
but for 3 conditions. But even ignoring the conditional, I can't get a true result from conditional statement for any of ; ($post[field40] & 1), ($post[field40] & 2) or ($post[field40] & 4), whilst I can from ($post[field]).

[field40] contains 3 radio buttons.

Looks like I need to keep hammering at it ....
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 12:34.

Layout Options | Width: Wide Color: