vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Profile Field Value (https://vborg.vbsupport.ru/showthread.php?t=279838)

Rich 03-09-2012 07:53 PM

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.

kh99 03-09-2012 07:56 PM

Did you try {vb:raw userinfo.field281} ?

Rich 03-09-2012 08:09 PM

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>


kh99 03-09-2012 08:34 PM

How did you create your new tab?

Rich 03-09-2012 08:45 PM

I followed this:

https://vborg.vbsupport.ru/showthread.php?t=265971

kh99 03-09-2012 08:51 PM

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.

Rich 03-10-2012 11:54 AM

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

kh99 03-10-2012 12:19 PM

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.

Rich 03-10-2012 12:29 PM

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.

stoute 09-01-2013 08:42 PM

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


All times are GMT. The time now is 05:43 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.01689 seconds
  • Memory Usage 1,737KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_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