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

Reply
 
Thread Tools Display Modes
  #11  
Old 12-17-2014, 12:53 PM
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i tried:
HTML Code:
<div class="body_measurements">
<vb:if condition="$post['field8']">
<h2 style="display: inline;">H: {userdata.field8}cm |&nbsp</h2> 
<vb:else />
<h2 style="display: inline;">H: -- |&nbsp</h2>
</vb:if>
<vb:if condition="$post['field7']">
<h2 style="display: inline;">W: {userdata.field7} Lbs</h2>
<vb:else />
<h2 style="display: inline;">W: -- </h2>
</vb:if>    
</div>
but the numbers still didn't show up on the page, anything else i could try?
Reply With Quote
  #12  
Old 12-17-2014, 12:55 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you create a plugin like that guide showed? What code do you have in your plugin?
Reply With Quote
  #13  
Old 12-17-2014, 01:01 PM
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

my plugin is this:
PHP Code:
if (isset($vbulletin->GPC['tab']))
{
    
$selected_tab $vbulletin->GPC['tab'];
}
$blockinfo['title'] = "My Bodyspace";
$blockid "my_bodyspace";
$taburl $memberurl fetch_seo_url('member'$prepared) . "&amp;tab=my_bodyspace#my_bodyspace";

$templater vB_Template::create('memberinfo_tab');
$templater->register('selected_tab'$selected_tab);
$templater->register('relpath'$relpath);
$templater->register('blockinfo'$blockinfo);
$templater->register('blockid'$blockid);
$templater->register('taburl'$taburl);
$template_hook['profile_tabs_last'] .= $templater->render();  

// ### Your code to fill the tab ###
// Don't forget you need to register any variables for use in templates 

$test_tab_content "Congratulations, you can see me, I'm your PHP Code!";

$templater vB_Template::create('memberinfo_block_test');
$templater->register('selected_tab'$selected_tab);
$templater->register('test_tab_content'$test_tab_content);
$templater->register('userdata'$prepared);
$template_hook['profile_tabs'] .= $templater->render(); 
--------------- Added [DATE]1418830513[/DATE] at [TIME]1418830513[/TIME] ---------------

Any other ideas for how i can get my custom field data into my bodyspace profile page Kevin?
Reply With Quote
  #14  
Old 12-17-2014, 03:30 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I lost my internet connection for a couple hours. Anyway, I copied your plugin code to create a new plugin using hook member_complete, and I created a template called memberinfo_block_test using the code from the guide page you linked to, but I get a blank tab. I haven't had a chance to figure out why yet.

Are you seeing anything from your template? I think I might have been wrong about using $prepared, I think you might want to use $userdata instead. So maybe change the added line to:
Code:
$templater->register('userinfo', $userinfo);

then use {userinfo.field8}, etc. But if you're having the same issue I am with the tab being entirely blank then you probably still won't see the profile fields.
Reply With Quote
  #15  
Old 12-17-2014, 10:09 PM
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried that but that didn't work either, i am able to see "Congratulations, you can see me, I'm your PHP Code!" on the profile tab page, therefore it should work if it is right.

Not sure why this is so hard to do.
Reply With Quote
  #16  
Old 12-17-2014, 11:13 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, I can't even get that message to show up and it's frustrating me. I don't think I can deal with it any more tonight.

I noticed that the template uses $userinfo in a condition, but for some reason it's not registered in the example plugin. Maybe it's preRegistered somewhere else or something. But that does mean that {userinfo.fieldX} would work if the profile fields are actually there (and since this is the profile page you'd think they would be).

Did you create those fields as private? Even if you did they should appear when you're looking at your own profile. You have data entered for those fields, right? I just can't think of any other reason right now.

Anyway, I'll look at it again in the morning if you haven't figured it out by then. If I can get the template to appear then I can figure out the field value problem.
Reply With Quote
  #17  
Old 12-17-2014, 11:24 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah Kevin, sometimes it is best to step back for the night, and come at it fresh in the morning.
Reply With Quote
  #18  
Old 12-18-2014, 01:35 AM
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, i have entered data and i am even displaying this information on my postbit_legacy template with all the numbers showing up, but for some reason when i try the same thing on a member profile tab, nothing shows up.

I'm still trying to look for a way.. i know you can go into custom "profile field categories" and set it to display on it's own tab...i think it uses the template "memberinfo_block_profilefield" but even using that template the numbers don't show up in the code i used for postbit_legacy.

Thanks for helping me out on this! do you have any ideas Chris?
Attached Images
File Type: png postbit.png (131.7 KB, 0 views)
Reply With Quote
  #19  
Old 12-18-2014, 10:21 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I have no idea what my problem was yesterday, but I went back to using the plugin code and template code from the guide and got it to appear. Then I added a register line for userinfo, like:
Code:
$templater->register('userinfo', $userinfo);
(that goes near the bottom, registering to the memberinfo_block_test template).

Now here's where I might have steered you wrong, just because I was spacing out - you should add {vb:raw userinfo.field7} in the template (I don't know why I was forgetting the vb:raw part). Anyway, if that was the only problem you were having, I'm really sorry about that.

So if you can get those values displaying then you probably would want to add code to the plugin to calculate whatever values you need for the chart and register them to the template, then you just have to copy that chart html to your template and insert the parameters.
Reply With Quote
  #20  
Old 12-18-2014, 11:33 AM
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You were pretty close, just forgot to mention to change (if $post) to (if $userinfo)... but thanks for your help. I will try get this chart working, if i have any questions i will post back.
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 03:10 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.06541 seconds
  • Memory Usage 2,296KB
  • Queries Executed 14 (?)
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
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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
  • (1)postbit_attachment
  • (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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete