-1

The website that im trying to make it work on is http://www.phone7forum.com/

The way I get it to show up on the index page is adding this code to the core index.php page right below this:

// Assign index specific vars
'S_AVATAR' => get_user_avatar(
    $user->data['user_avatar'],
    $user->data['user_avatar_type'],
    $user->data['user_avatar_width'],
    $user->data['user_avatar_height']
),

Then I can use {S_AVATAR} in my template but it ONLY shows up in the index file... So another phpbb guy suggested that I take that same code from above and place it in the includes/functions.php file right below this:

// The following assigns all _common_ variables that may be used at any point in a template.

I did that, and though it seemed to "try" and work I clicked on a few pages outside the index page and got a fatal error message:

Fatal error: Call to undefined function get_user_avatar() in /home/content/04/6534704/html/phone7forum/includes/functions.php on line 4385

Does anyone have any ideas?

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
Oneezy
  • 4,881
  • 7
  • 44
  • 73
  • Your site, BTW, looks good. Did you do it all yourself? I am a noobie at it, and can't figure out some of the basics. –  Dec 06 '11 at 16:05

1 Answers1

1

IIRC get_user_avatar() is a function from functions_display. If you want to use it in the functions file, you have to include it.

Put it into an if condition to have it only load if you're on a page where function_display isn't already included:

if(!function_exists('get_user_avatar')){ include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); }
Mayur Birari
  • 5,837
  • 8
  • 34
  • 61
Aevis
  • 11
  • 1