Hello Lynne, i still wondering with this figure, yes you are right it simple show profilepic using filestorage, but i still want to use the code built into memberinfo and memberlist
the memberlist code
PHP Code:
$can_view_profile_pic = (
$show['profilepiccol']
AND $userinfo['profilepic']
AND ($userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canprofilepic'] OR $userinfo['adminprofilepic'])
);
if ($userinfo['profilepicrequirement'] AND !can_view_profile_section($userinfo['userid'], 'profile_picture', $userinfo['profilepicrequirement'], $userinfo))
{
$can_view_profile_pic = false;
}
if ($can_view_profile_pic)
{
if ($vbulletin->options['usefileavatar'])
{
$userinfo['profilepicurl'] = $vbulletin->options['profilepicurl'] . '/profilepic' . $userinfo['userid'] . '_' . $userinfo['profilepicrevision'] . '.gif';
}
else
{
$userinfo['profilepicurl'] = 'image.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $userinfo['userid'] . "&dateline=$userinfo[profilepicdateline]&type=profile";
}
$userinfo['profilepic'] = "<img src=\"" . $userinfo['profilepicurl'] . "\" alt=\"\" title=\"" . construct_phrase($vbphrase['xs_picture'], $userinfo['username']) . "\" border=\"0\"";
$userinfo['profilepic'] .= ($userinfo['ppwidth'] AND $userinfo['ppheight']) ? " width=\"$userinfo[ppwidth]\" height=\"$userinfo[ppheight]\" " : '';
$userinfo['profilepic'] .= "/>";
}
else
{
$userinfo['profilepic'] = ' ';
}
and the template code is
PHP Code:
<if condition="$show['profilepiccol'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[profilepic]</td></if>
can i do the same thing in postbit?
yes
Code:
"$vboptions[profilepicurl]/profilepic$post[userid]_$post[profilepicrevision].gif".
this is very nice, but how about the user not upload any picture?
can i use this
Code:
if (!$this->post['avatarurl'])
{
$this->post['avatarurl'] = "images/avatars/defaultavatar.png";
}
if ($this->registry->userinfo['showavatars'])
{
$show['avatar'] = true;
}
into profilepic? nah, when i use <if condition="$show['profilepic']"> in template, it does not work.
i just want to show profilepic like in memberlist like in memberinfo >_<