Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2009, 11:41 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 08-09-2009, 02:34 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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']);

Reply With Quote
  #3  
Old 08-09-2009, 05:25 AM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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?
Reply With Quote
  #4  
Old 08-09-2009, 02:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 08-09-2009, 03:23 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 08-09-2009, 03:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 08-10-2009, 02:16 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

testing testing testing

instead of:

testing
testing
testing
Reply With Quote
  #8  
Old 08-10-2009, 02:36 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 08-10-2009, 02:44 PM
RTMdotORG RTMdotORG is offline
 
Join Date: Dec 2008
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #10  
Old 08-10-2009, 02:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 12:53 AM.


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.04139 seconds
  • Memory Usage 2,257KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete