PDA

View Full Version : avatar db query problem..


mescalin
04-02-2007, 11:40 AM
if ($vbulletin->GPC['profilepic'] == 1)
{
if (isset($vbulletin->products['profpicicon']))
{
// lighter query if my profile picture icon hack is installed ;)
$advsearchwhere .= " AND (user.customuseroptions & " . $vbulletin->bf_misc_customuseroptions['hasprofilepic'] . ")";
}
else
{
$advsearchjoin .= " LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (customprofilepic.userid=user.userid)";
$advsearchwhere .= " AND NOT ISNULL(customprofilepic.userid)";
}
$urladd .= (($urladd != '') ? '&' : '') .'profilepic=1';
}
else if ($vbulletin->GPC['profilepic'] == 2)
{
if (isset($vbulletin->products['profpicicon']))
{
// lighter query if my profile picture icon hack is installed ;)
$advsearchwhere .= " AND NOT (user.customuseroptions & " . $vbulletin->bf_misc_customuseroptions['hasprofilepic'] . ")";
}
else
{
$advsearchjoin .= " LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (customprofilepic.userid=user.userid)";
$advsearchwhere .= " AND ISNULL(customprofilepic.userid)";
}
$urladd .= (($urladd != '') ? '&' : '') .'profilepic=2';
}

$hook_query_joins .= $advsearchjoin;
$hook_query_where .= $advsearchwhere;

I want to convert that code to search avatars.. i changed customprofilepic to customavatar but it didnt work. Anybody can help me? i dont know anything about these:(