News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Global $context help

Started by SeaOfSin, February 12, 2006, 10:49:22 PM

Previous topic - Next topic

SeaOfSin

I am trying to write a little modification on my test site and I decided to use the bio mod as part of the mod as it fits some of my needs.  Now what I need is for $context['member']['bio'] to be able to be used in the index.template but it doesn't seem to be global.  How can I make it global? Would I need to add an array in Boardindex.php? if so where?
here is the code used in the mod.


$context['member'] = array(
'id' => $memID,
'gender' => array('name' => empty($user_profile[$memID]['gender']) ? '' : ($user_profile[$memID]['gender'] == 2 ? 'f' : 'm')),
'birth_date' => !isset($user_profile[$memID]['birthdate']) || $user_profile[$memID]['birthdate'] == '' ? '0000-00-00' : $user_profile[$memID]['birthdate'],
'location' => !isset($user_profile[$memID]['location']) ? '' : $user_profile[$memID]['location'],
'title' => !isset($user_profile[$memID]['usertitle']) || $user_profile[$memID]['usertitle'] == '' ? '' : $user_profile[$memID]['usertitle'],
'blurb' => !isset($user_profile[$memID]['personalText']) ? '' : str_replace(array('<', '>', '&amp;#039;'), array('&lt;', '&gt;', '&#039;'), $user_profile[$memID]['personalText']),
'signature' => !isset($user_profile[$memID]['signature']) ? '' : str_replace(array('<br />', '<', '>', '"', '\''), array("\n", '&lt;', '&gt;', '$quot;', '&#039;'), $user_profile[$memID]['signature']),
</search>

<add after>
'bio' => !isset($user_profile[$memID]['bio']) ? '' : str_replace(array('<br />', '<', '>', '"', '\''), array("\n", '&lt;', '&gt;', '$quot;', '&#039;'), $user_profile[$memID]['bio']),
</add after>


This is added in Profile.php

Thanks in advance

SeaOfSin

OK I figured out how to do that.

Advertisement: