The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I am adding a new section to my users profile.
I want the user to be able to see/edit information but only if the user is logged in and viewing their own profile. I created a new tab in memberinfo_block and the tab shows up... The problem is hiding the highlighted information below. Here is what I've tried to use to hide the info. Code:
<vb:if condition="$userinfo['userid'] == $bbuserinfo['userid']"> Code:
<vb:if condition="$prepared['myprofile']"> |
|
#2
|
||||
|
||||
|
<vb:if condition="$prepared['userid'] == $userinfo['userid']">
or <vb:if condition="$prepared['userid'] == $bbuserinfo['userid']">
|
|
#3
|
|||
|
|||
|
Thanks for the extra options... here are my results.
With: Code:
<vb:if condition="$prepared['userid'] == $userinfo['userid']"> Member A looks at Member B's profile and can see the info I'm trying to hide. With: Code:
<vb:if condition="$prepared['userid'] == $bbuserinfo['userid']"> With: Code:
<vb:if condition="$prepared['userid'] != $bbuserinfo['userid']"> With: Code:
<vb:if condition="$prepared['userid'] != $userinfo['userid']"> I do know that the "==" is telling me that it must match for it to show and that "!=" is telling me that if the two variables do not match then it will show up. --------------- Added [DATE]1377983647[/DATE] at [TIME]1377983647[/TIME] --------------- To help this is my template code. Code:
<vb:if condition="$prepared['userid'] != $userinfo['userid']">
<br/><div class="blocksubhead subsectionhead userprof_headers userprof_headers_border">
<h4 class="subsectionhead-understate">Power Points Bank</h4></div>
<h3><dl class="userinfo_extra"><dt>Points you have to spend:</dt> <dd>{vb:raw bbuserinfo.field5}</dd></dl></h3>
</vb:if>
Code:
if (isset($vbulletin->GPC['tab']))
{
$selected_tab = $vbulletin->GPC['tab'];
}
$blockinfo['title'] = "Character Page";
$blockid = "characterpage";
$taburl = $memberurl = fetch_seo_url('member', $prepared) . "&tab=characterpage#characterpage";
$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();
$templater = vB_Template::create('memberinfo_block_characterpage');
$templater->register('selected_tab', $selected_tab);
$template_hook['profile_tabs'] .= $templater->render();
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|