Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-09-2012, 08:53 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Profile Field Value

I have run several searches on .org and even tried seeing how some had gotten things to show via their mods and I am still drawing a blank.

What I am Trying To Do

All I am trying to do is display the value of a custom profile field within a new tab on the profile. I am looking to render the inputed value as a link so it would appear like this within the template:

Code:
<a href="{raw $userinfo['field281']">Title here</a>
The field ID is 281 but no matter how I write it, and I have tried several variations, I can't get it to show the value. I would appreciate any help with this.
Reply With Quote
  #2  
Old 03-09-2012, 08:56 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you try {vb:raw userinfo.field281} ?
Reply With Quote
  #3  
Old 03-09-2012, 09:09 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I may have, it didn't work when I just tried it. I also wanted to wrap it in an if conditional like so:

HTML Code:
<vb:if condition="$userinfo['field281']">
$userinfo['field281']
</vb:if>
Reply With Quote
  #4  
Old 03-09-2012, 09:34 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How did you create your new tab?
Reply With Quote
  #5  
Old 03-09-2012, 09:45 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I followed this:

https://vborg.vbsupport.ru/showthread.php?t=265971
Reply With Quote
  #6  
Old 03-09-2012, 09:51 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, OK, I think you need to register $userinfo for use in your custom template, like this:

Code:
$templater->register('userinfo', $userinfo);

[S]then I think what you have in post #3 should work.[/S] The condition you have in post #3 should work, but you need {vb:raw userinfo.field281} inside the if.
Reply With Quote
  #7  
Old 03-10-2012, 12:54 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried this as well. I can get it to work with

Code:
<vb:if condition="$bbuserinfo['field281']">
{vb:raw bbuserinfo.field281}
</vb:if>
That obviously shows my info though. It just doesn't want to show their info when I am viewing it. lol Thanks for your help. I will keep digging. lol
Reply With Quote
  #8  
Old 03-10-2012, 01:19 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Right, as you figured out I was wrong about post#3, the condition is correct but the tag inside needs to be a vb:raw tag.

So you added the register call where you're rendering your custom template and it still didn't work? If you want to post your code we might be able to see something.
Reply With Quote
  #9  
Old 03-10-2012, 01:29 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I suspect it has more to do with "how" I am using this code than anything else. I wouldn't be able to post all of the code because alot of it belongs to vb.

Here is the entire concept:

I have created a new tab using the method mentioned in my previous post that calls a secondary instance of the "friends" tab. On my dev profile I have my new friend tab (and the original doesn't display based on a conditional). The customized friend tab templates are renames of the originals but have allowed me to manipulate them in a manner fluent with what I am trying to achieve.

I currently have my friends showing their instant message icons if they are using them beside their avatar. This makes reaching them pretty easy for me. I am looking to add the custom facebook field to that list so that I can access their facebook directly from my friends list as well.

Essentially I would be able to pull this off if I could get the field to show on the friends tab since I am using the same code.

--------------- Added [DATE]1331472906[/DATE] at [TIME]1331472906[/TIME] ---------------

Anyone have any ideas for me to get this to work? I wasted a few more hours yesterday trying to figure it out to no avail.
Reply With Quote
  #10  
Old 09-01-2013, 09:42 PM
stoute stoute is offline
 
Join Date: May 2010
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm trying to do something similar... did you ever find out how to get profile fields to display on the added tab in the member.php page
Reply With Quote
Reply

Thread Tools
Display Modes

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 04:53 PM.


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.04668 seconds
  • Memory Usage 2,242KB
  • 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
  • (3)bbcode_code
  • (1)bbcode_html
  • (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_postinfo_query
  • fetch_postinfo
  • 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