function profile_mini_page($options) { $output .= profile_top($options); $output .= profile_head($options); $output .= profile_bottom($options); return $output; }
if ($increase_profile_visitors == true) { $query = 'UPDATE userinfo SET profile_visitors = profile_visitors + 1 WHERE userid = ' . $user_id; mysql_query($query) or die(report_sql_error($query)); } $querys = array(); $querys['insert'] = 'INSERT INTO user_visits(user_id, item_id, type, count, timestamp) VALUES(' . $user_id . ', ' . $_SESSION['login']['id'] . ', "profile_visit", 1, unix_timestamp())'; $querys['update'] = 'UPDATE user_visits SET count = count + 1, timestamp = unix_timestamp() WHERE user_id=' . $user_id . ' AND item_id=' . $_SESSION['login']['id'] . ' AND type="profile_visit"'; @mysql_query($querys['insert']) or @mysql_query($querys['update']); unset($querys); /* Read remote session and log this visit */ $remote_session = session_load($userinfo['login']['session_id']); if ($_SESSION['userinfo']['image'] == 1 || $_SESSION['userinfo']['image'] == 2) { $visited = false; foreach ($remote_session['visitors_with_image'] as $visitor) { $visited = $visitor['id'] == $_SESSION['login']['id'] ? true : $visited; } if ($visited == false) { while (count($remote_session['visitors_with_image']) >= 8) { array_pop($remote_session['visitors_with_image']); } array_unshift($remote_session['visitors_with_image'], array('id' => $_SESSION['login']['id'], 'timestamp' => time(), 'username' => $_SESSION['login']['username'])); } } $remote_session['notice_message'] = 'Hey där, <a href="/traffa/profile.php?id=' . $_SESSION['login']['id'] . '">' . $_SESSION['login']['username'] . '</a> sladdade just in på din profil! - <a href="/traffa/my_visitors.php">Visa alla dina besökare!</a>'; session_save($userinfo['login']['session_id'], $remote_session); } //End of Lef $output .= profile_bottom($profile); ui_top($ui_options); echo $output; ui_bottom();