2013-12-29, 07:56 PM
Hey guys i am loading a new set of vars into the $mybb array. I need to show some of the values that where added inside the forum tenplate systeme.
Inside the load_user() funtion in class_session.php i added the following code:
I dumped the array and i can see the new values added to $mybb->game
So what i am trying to du is add one of those values inside the header_welcomeblock_member template.
I added <span>{$mybb->game['site']['vp']}</span>
But the value is empty ... When i echo $mybb->game['site']['vp'] outside the template systeme i get the correct value...
What did i miss? Thx in advance!
Inside the load_user() funtion in class_session.php i added the following code:
if ($mybb->user['uid']){
// User is connected lets attach his game account array
function game_stuff($username){
// Get account info
$mysql_connect1 = @mysql_connect("***", "***", "***") or die(mysql_error());
@mysql_select_db("***");
$array[account] = mysql_fetch_array(mysql_query("SELECT * FROM account WHERE username=upper('$username')"));
@mysql_select_db("***");
$array[site] = mysql_fetch_array(mysql_query("SELECT * FROM account_data WHERE id='".$array[account][id]."'"));
// Get chatacter data
@mysql_select_db("***");
$select = mysql_query("SELECT * FROM characters WHERE account='".$array[account][id]."'");
while($char = mysql_fetch_array($select)){
$array[characters][]=$char;
}
return $array;
}
$mybb->game = game_stuff($mybb->user['username']);
}
I dumped the array and i can see the new values added to $mybb->game
So what i am trying to du is add one of those values inside the header_welcomeblock_member template.
I added <span>{$mybb->game['site']['vp']}</span>
But the value is empty ... When i echo $mybb->game['site']['vp'] outside the template systeme i get the correct value...
What did i miss? Thx in advance!