Topic: Missing argument 2... for 'generate_avatar_markup'
I'm using an extension called 'ajax rating' that is generating this error in PunBB 1.4.1 ...
Warning: Missing argument 2 for generate_avatar_markup(), called in /home/.../toprated.php on line 140 and defined in /home/.../include/functions.php on line 500
Warning: Missing argument 3 for generate_avatar_markup(), called in /home/.../toprated.php on line 140 and defined in /home/.../include/functions.php on line 500
Warning: Missing argument 4 for generate_avatar_markup(), called in /home/.../toprated.php on line 140 and defined in /home/.../include/functions.php on line 500
This is the toprated.php code section that seems to be causing trouble;
// Generate author identification
if ($cur_post['poster_id'] > 1)
{
if ($forum_config['o_avatars'] == '1' && $forum_user['show_avatars'] != '0')
{
$forum_page['avatar_markup'] = generate_avatar_markup($cur_post['poster_id']);
if (!empty($forum_page['avatar_markup']))
$forum_page['author_ident']['avatar'] = '<li class="useravatar">'.$forum_page['avatar_markup'].'</li>';
}
Anyone know what problem could be?
functions.php
// Outputs markup to display a user's avatar
function generate_avatar_markup($user_id, $avatar_type, $avatar_width, $avatar_height, $username = NULL, $drop_cache = FALSE)
{
global $forum_config, $base_url;
$avatar_markup = $avatar_filename = '';
$return = ($hook = get_hook('fn_generate_avatar_markup_start')) ? eval($hook) : null;
if ($return != null)
return $return;
^new 1.4.1
old 1.3.6
// Outputs markup to display a user's avatar
function generate_avatar_markup($user_id)
{
global $forum_config, $base_url;
$filetypes = array('jpg', 'gif', 'png');
$avatar_markup = '';
$return = ($hook = get_hook('fn_generate_avatar_markup_start')) ? eval($hook) : null;
if ($return != null)
return $return;
foreach ($filetypes as $cur_type)
{
$path = $forum_config['o_avatars_dir'].'/'.$user_id.'.'.$cur_type;
if (file_exists(FORUM_ROOT.$path) && $img_size = @getimagesize(FORUM_ROOT.$path))
{
$avatar_markup = '<img src="'.$base_url.'/'.$path.'" '.$img_size[3].' alt="" />';
break;
}
}
($hook = get_hook('fn_generate_avatar_markup_end')) ? eval($hook) : null;
return $avatar_markup;
}