The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
You would have to edit the memberdisplay template to have the <vb:if condition> code, i'll find it from one of my previous posts for you and add to this reply.
Edit: Code is; Code:
<vb:if condition="$post['field5']">Field 5:{vb:raw post.field5}</vb:if> |
#12
|
|||
|
|||
strangely enough that didn't display anything for me.
|
#13
|
|||
|
|||
I would have to see your code to see what you are doing wrong. If you care to post it then I would be glad to help.
The $post variable in general is not usually available to the templates in whole, although I have not looked at the code in the profile tabs. My two cents. |
#14
|
|||
|
|||
New custom Tab template:
Code:
<div id="view-my_character_bio" class="<vb:if condition="$selected_tab == 'my_character_bio'">selected_view_section<vb:else />view_section</vb:if><vb:if condition="$userinfo['userid'] != $bbuserinfo['userid']"> vm_other_prof</vb:if>"> <div class="blocksubhead subsectionhead userprof_headers userprof_headers_border"> <h4 class="subsectionhead-understate">My Character's Bio</h4> </div> <div style="margin-left:25px;margin-right:25px"> <br />This is a <b>custom tab</b> test.<br /> Code should appear below.<br/> <vb:if condition="$post['field5']">Field 5:{vb:raw post.field5}<br/></vb:if> Code should appear above. </div> </div> Code:
if (isset($vbulletin->GPC['tab'])) { $selected_tab = $vbulletin->GPC['tab']; } $blockinfo['title'] = "My Bio"; $blockid = "my_character_bio"; $taburl = $memberurl = fetch_seo_url('member', $prepared) . "&tab=my_character_bio#my_character_bio"; $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_first'] .= $templater->render(); // ### Your code to fill the tab ### // Don't forget you need to register any variables for use in templates $templater = vB_Template::create('my_character_bio'); $templater->register('selected_tab', $selected_tab); $template_hook['profile_tabs'] .= $templater->render(); Code:
if (!$vbulletin->GPC_exists['tab']) { $vbulletin->GPC['tab'] = 'my_character_bio'; } |
#15
|
||||
|
||||
And what plugin location are you using to execute the two above?
|
#16
|
|||
|
|||
sorry, I should have added that.
Plugin to show the custom tab: member_complete Plugin to make custom tab default: member_build_blocks_start |
#18
|
|||
|
|||
@Cellarius is of course right. You need to use $prepared. You will also need to add your field to the array in 'class_userprofile.php". You should then be able to use it in your template as a conditional. Make sure you register array $prepared in your template or it will not work. Use hook 'member_build_blocks_start' -- which I already think you are using.
Around line #89 in 'class_userprofile.php' Code:
var $auto_prepare = array( .................. 'show', 'field5', //Add your fieldxx here to the bottom of the array. ); |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|