Go Back   vb.org Archive > vBulletin Modifications > vBulletin 5.x Modifications > vBulletin 5.x Template Modifications

Reply
 
Thread Tools
Add custom field to postbit Details »»
Add custom field to postbit
Version: 1.00, by Replicant Replicant is offline
Developer Last Online: Jun 2022 Show Printable Version Email this Page

Category: Mini Mods - Version: 5.1.9 Rating:
Released: 11-27-2015 Last Update: Never Installs: 9
Template Edits
 
No support by the author.

There have been a few questions regarding adding location to the postbit on vb.com lately. Lynne had a write-up here in 2013 using the Product/Hook system which is the best way to do it as the mod will survive an upgrade and there is a hook exactly where it's needed. I'm not going to go into creating a product with this mod.This is an example of a template edit to add a field to the postbit that only takes a few minutes. Keep in mid, this will be overwritten during an upgrade and will need to be re-applied. Since this requires editing templates, it will not work on the cloud. I am currently working on a jquery/ajax version for the cloud, but it's a little ways down the road when I'm not so busy.

Here's how to do it.
Step 1)Go to AdminCP >> User Profile fields >> Add new user profile field
Select single line textbox > then click "continue"
Fill out the title, description and other relevant info on that page and click save. This will also create the necessary phrases for the field.
Go to AdminCP >> User Profile fields >> User Profile fields Manager. Here you will see the new field you created and the field number used in step 2. I used field8 (Location) for this example.

Step 2) Edit conversation_userinfo template. Add this code after {vb:hook 'conversation_userstats'} on or about line 53 and click save.

Step 3) Goto your user profile and click edit settings. Scroll down on the profile tab and fill the new field with the info.

Code:
{vb:data postInfo, user, fetchProfileInfo, {vb:raw conversation.userid}}
<vb:if condition="$postInfo['field8']"><li><label>{vb:phrase field8_title}:</lable>
	<span>{vb:raw postInfo.customFields.default.field8_title.val}</span></li>
</vb:if>

You can add classes in the code for custom CSS if you prefer. The default list view kind of sucks IMO.

Screenshots

File Type: png postbit.png (16.6 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
5 благодарности(ей) от:
Chicoynano, Dragonsys, MarkFL, napy8gen, tuerkraider

Comments
  #12  
Old 02-11-2016, 05:31 PM
Aros12 Aros12 is offline
 
Join Date: Jan 2016
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay thanks so much!
Reply With Quote
Благодарность от:
MarkFL
  #13  
Old 02-12-2016, 06:52 PM
Aros12 Aros12 is offline
 
Join Date: Jan 2016
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are the man! Thank you!!
Reply With Quote
  #14  
Old 02-22-2016, 12:38 PM
IggyP IggyP is offline
 
Join Date: May 2012
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great thanks
Reply With Quote
  #15  
Old 03-22-2016, 12:29 AM
mhere21 mhere21 is offline
 
Join Date: Mar 2016
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Exactly what I was looking for. Thank you.
Reply With Quote
  #16  
Old 08-11-2016, 07:00 PM
KimK KimK is offline
 
Join Date: Feb 2012
Location: Oregon
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Replicant View Post
I pulled the fetchProfileInfo for your user at your site and the location info is there so its just not retrieving or getting translated at the template. I've not tested this on 5.2.0 so maybe that's the issue. I'll take a look at it and report back. Give me a day or so.
Code:
"field2_title":{"val":"Maple Valley, WA","hidden":"0"}
SOLVED:I fetched your template and found your issue. It's a typo. Change the 8 below to a 2 in your template and it should work.

Code:
{vb:data postInfo, user, fetchProfileInfo, {vb:raw conversation.userid}}
<vb:if condition="$postInfo['field2']"><li><label>{vb:phrase field2_title}:</lable>
         <span>{vb:raw postInfo.customFields.default.field8_title.val}</span></li>
</vb:if>
Hi Replicant, I am using vb 5.2.2 and tried the above, but it just translates into the field 2 title Location, without pulling the actual location the member entered. My hope is to actually bring in 2 fields, occupation and location. If you have a second, can you take a look? I didn't know if I was suppose to do anything with your first code block in this post, so that could be what I am doing wrong. My location field is 2, and I copied your code above to try the second time. www.Agentlinkus.com

I tried the update tools, because these are fields my members have already filled in, they are not new fields, and perhaps that is the problem. Running update tools didn't fix. Thank you so much.
Reply With Quote
  #17  
Old 08-11-2016, 07:26 PM
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Location: Phoenix, Az. USA
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This modification is obsolete and cumbersome and was more or less a workaround until a proper mod was created. Noypiscripter has a mod that is far superior to this one and much easier to implement and is up to date. You can get it here.
Reply With Quote
Благодарность от:
MarkFL
  #18  
Old 08-11-2016, 07:43 PM
KimK KimK is offline
 
Join Date: Feb 2012
Location: Oregon
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, I appreciate the direction =)
Reply With Quote
  #19  
Old 08-15-2016, 03:03 AM
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Jul 2013
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Replicant View Post
This modification is obsolete and cumbersome and was more or less a workaround until a proper mod was created. Noypiscripter has a mod that is far superior to this one and much easier to implement and is up to date. You can get it here.
Thanks Replicant!
Reply With Quote
  #20  
Old 09-20-2017, 10:26 AM
spirit232 spirit232 is offline
 
Join Date: Sep 2017
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Many Thanks,

I am looking for the integration of the homepage from the profile page to the postbit
Reply With Quote
  #21  
Old 06-20-2021, 08:09 PM
SWCForum SWCForum is offline
 
Join Date: Jun 2021
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works great for me, but I would like to move one of the fields (field5) to appear after the usertitle, and I can't make it work. Any advice?

I'd also love to add a space between each field that displays at the bottom. But <br> didn't work obviously. But that's something I can live without if I have to.

Thanks for a great mod.
Reply With Quote
Reply

Thread Tools

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 10:34 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04924 seconds
  • Memory Usage 2,334KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (7)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete