vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Adding A <br /> To Multiple Line Text Custom Profile Fields (https://vborg.vbsupport.ru/showthread.php?t=220484)

RTMdotORG 08-08-2009 11:41 PM

Adding A <br /> To Multiple Line Text Custom Profile Fields
 
I've searched the forum for over an hour and have come up with nothing.

What I would like to do is show my members websites in the postbit.
I have it set to multiple line text, and when members add them, it looks like this:

Website(s):
www.?????.net www.?????.org www.?????.com

I would like it to look like

Website(s):
www.?????.net
www.?????.org
www.?????.com

any suggestions?

Lynne 08-09-2009 02:34 AM

I wrote this plugin for someone who wanted to do something like this on the member.php page. I'm sure you can modify it for use in the postbit (use one of the postbit_ hook locations - and change the field id, of course):
PHP Code:

if ($profilefield['profilefieldid'] == 16)
{
$find ",";
$replace "<br />";

$profilefield['value']= str_replace($find$replace$profilefield['value']);



RTMdotORG 08-09-2009 05:25 AM

Quote:

Originally Posted by Lynne (Post 1863873)
I wrote this plugin for someone who wanted to do something like this on the member.php page. I'm sure you can modify it for use in the postbit (use one of the postbit_ hook locations - and change the field id, of course):
PHP Code:

if ($profilefield['profilefieldid'] == 16)
{
$find ",";
$replace "<br />";

$profilefield['value']= str_replace($find$replace$profilefield['value']);



Thanks, but it doesnt add a comma either. So how would replacing a comma with a break work?

Lynne 08-09-2009 02:52 PM

I know that one won't work exactly without modification of the variable names (I said you would have to modify it to work). Post the code (and hook location) you tried.

RTMdotORG 08-09-2009 03:23 PM

Hey Lynne,
You're the best at answering all these help issues, and yes I do have some knowledge of hooks and what not. But I cannot seem to figure this one out. Variables and Hooks are a challenge to me. It's one of those things where you search and try for hours and I'm overwhelmed. I previously saw your post with the above information, and I've tried. Isn't there an easier way?

Lynne 08-09-2009 03:38 PM

That probably is the easiest way. This works for my simple field of comma separated items (I tested it on my field16, you need to change for yourself):
postbit_display_complete
PHP Code:

if ($post['field16'])
{
$find ",";
$replace "<br />";

$post['field16']= str_replace($find$replace$post['field16']);


Of course, also add the field to your postbit.

RTMdotORG 08-10-2009 02:16 PM

Thanks... but it stills shows like this...

testing testing testing

instead of:

testing
testing
testing

Lynne 08-10-2009 02:36 PM

Did you change the field id for the one you are using? It's usually best when you say something is not working if you post the exact code you used - in this case the exact plugin code and the exact code you put in the template.

RTMdotORG 08-10-2009 02:44 PM

Heres the code i used:

Code:

if ($post['field5'])
{
$find = ",";
$replace = "<br />";

$post['field5']= str_replace($find, $replace, $post['field5']);
}

and heres the code i used in the postbit_legacy:
Code:

<if condition="$post['field5']"><div class="pbbox"><strong>Website(s):<br /></strong>
$post[field5]</div></if>


Lynne 08-10-2009 02:47 PM

And you turned on the plugin? and the websites are separated by commas in the profile field? Or by a space? If a space, then the $find variable needs to be a space, not a comma.


All times are GMT. The time now is 01:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01218 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete