PDA

View Full Version : [PROBLEM WITH CODE!] ShowProfilePic in Online.php


Gio~Logist
09-10-2005, 09:34 PM
I tried the following code, however, it did not work.


$allusers = $DB_site->query("
SELECT user.username, session.useragent, session.location, session.lastactivity, user.userid, user.options, session.host, session.badlocation, session.incalendar, user.aim, user.icq, user.msn, user.yahoo,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
". iif($show['profilepic'], ',customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline') . "
FROM " . TABLE_PREFIX . "session AS session
". iif($show['profilepic'], "LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid) ") . "
". iif($vboptions['WOLguests'], " LEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid) ", ", " . TABLE_PREFIX . "user AS user") ."
WHERE session.lastactivity > $datecut
". iif(!$vboptions['WOLguests'], " AND session.userid = user.userid", "") ."
ORDER BY $sqlsort $sortorder
");

if ($show['profilepic'])
{
$userinfo['profilepic'] = "<img src=\"image.php?u=$userinfo[userid]&amp;type=profile&amp;dateline=$userinfo[profilepicdateline]\" alt=\"\" title=\"$userinfo[username]'s picture\" border=\"0\" />";
}
else
{
$userinfo['profilepic'] = '&nbsp;not showing';
}



Any ideas?

Marco van Herwaarden
09-11-2005, 05:22 AM
Well with the code above, you have not read a single row from the database. :D

bigcurt
09-11-2005, 05:28 AM
rofl xD

~Curt

Gio~Logist
09-11-2005, 05:33 AM
Well with the code above, you have not read a single row from the database. :D


Lmfao that was kind of funny.. what do you mean?

Andreas
09-11-2005, 05:33 AM
... and even if you did it would't work properly as you don't take storage method into account.

Gio~Logist
09-11-2005, 05:38 AM
... and even if you did it would't work properly as you don't take storage method into account.


I'm using vb3.0.8 and i'm using database storage, not file storage. It's for my site.

Colin F
09-12-2005, 10:10 AM
It would probably be easiest to start coding that again.

You're not even fetching the results of the query.
Additionally, the variables $show and $userinfo don't just fill themselves you know :)

Gio~Logist
09-12-2005, 06:27 PM
I'm not worried abut this any longer i figured it out :-D

What im REALLY CONCERNED ABOUT NOW.. is making is so that instead of showing it in ABC order.. how can i make it in order from what time they logged in?