guwebby
08-06-2006, 09:16 AM
Im trying to work on my own hack, and what im trying to do is this:
If a user is logged in and views his own profile, his profileviews doesnt get a +1, if he views another persons profile, they get a +1.
if ($_GET['u'] != $userinfo['userid']) {
$db->query ("UPDATE " . TABLE_PREFIX . "user SET profileviews=profileviews+1 WHERE userid = '".$_GET[u]."' OR userid = '".$userinfo[userid]."' ");
}
Thats what I did but obviously something isnt right (since Im using the $userinfo['userid'] twice)
So can someone tell me what is used to let the script know your logged in
(because im pretty sure $userinfo['userid'] is to display the users profile stuff, not for the logged in user)
If a user is logged in and views his own profile, his profileviews doesnt get a +1, if he views another persons profile, they get a +1.
if ($_GET['u'] != $userinfo['userid']) {
$db->query ("UPDATE " . TABLE_PREFIX . "user SET profileviews=profileviews+1 WHERE userid = '".$_GET[u]."' OR userid = '".$userinfo[userid]."' ");
}
Thats what I did but obviously something isnt right (since Im using the $userinfo['userid'] twice)
So can someone tell me what is used to let the script know your logged in
(because im pretty sure $userinfo['userid'] is to display the users profile stuff, not for the logged in user)