PHP Code:
// random profile
$randprof = $DB_site->query_first("
SELECT *
FROM user
LEFT JOIN userfield ON (userfield.userid = user.userid)
WHERE user.userid > 0 AND user.usergroupid <> 10 AND user.usergroupid <> 11 AND user.posts > 0
GROUP BY user.userid
ORDER BY rand()
LIMIT 4
");
while ($randprofinfo = $DB_site->fetch_array($randprof))
{
$rpusername = $randprofinfo['username'];
if ($randprofinfo['userid']!=0)
{
if ($randprofinfo[photos])
{
$pictureurl = fetch_cachedgallerypicture_url($userinfo[userid]);
if (file_exists($pictureurl))
{
$avatarimage = "<img src=\"" . $pictureurl . "\" border=\"0\" alt=\"" . $rpusername . "\" />";
}
}
else
{
$avatarurl=fetch_cachedavatar_url($randprofinfo['userid']);
if ($avatarurl == "")
{
$avatarurl = "" . $vboptions[bburl] . "/" . $stylevar[imgdir_misc] . "/noavatar.gif";
$avatarimage = "<img src=\"" . $avatarurl . "\" border=\"0\" alt=\"" . $rpusername . "\" />";
}
else
{
$avatarurl = "" . $vboptions[bburl] . "/" . $stylevar[imgdir_misc] . "guestavatar.gif";
$avatarimage = "<img src=\"" . $avatarurl . "\" border=\"0\" style=\"filter:alpha(opacity=50)\" alt=\"" . $rpusername . "\" />";
}
}
}
if (!$year)
{
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
}
if (empty($gotage["$randprofinfo[userid]"]))
{
$date = explode('-', $randprofinfo['birthday']);
if ($year > $date[2] AND $date[2] != '0000')
{
$randprofinfo['age'] = $year - $date[2];
if ($month < $date[0] OR ($month == $date[0] AND $day < $date[1]))
{
$randprofinfo['age']--;
}
if ($randprofinfo['age'] < 101)
{
$gotage["$randprofinfo[userid]"] = $randprofinfo['age'];
}
else
{
unset($randprofinfo['age']);
}
}
else
{
$randprofinfo['age'] = $gotage["$randprofinfo[userid]"];
}
}
if ($randprofinfo[field24] != "")
{
$randprofinfo2[field24] = "<img src=\"$vboptions[bburl]/$stylevar[imgdir_misc]/$randprofinfo[field24].gif\" />";
}
$show[age] = "" . $randprofinfo['age'] . "/";
$show[gender] = "" . $randprofinfo2['field24'] . "/";
$show[location] = "" . $randprofinfo['field2'] . "";
//$profilebits = "TESTING";
eval('$profilebits .= "' . fetch_template("siteindex_profilebits") . '";');
}
eval('$siteindex_profile .= "' . fetch_template("siteindex_profile") . '";');
i have no idea what's wrong with this.