/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Name: Forum Users Activity Status Panel
| Type: Forum Mod
| Filename: users_forums_status_panel.php
| Author: Fangree Productions
| Developers: Fangree_Craig & MvE Designs
| Site: http://www.fangre...
-------------------------------------------------------+
| Output Handler by Hans Kristian Flaatten (Starefossen)
| Copyright (C) 2007 - 2010 Hans Kristian Flaatten
| http://code.stare...
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied!"); }
if (FUSION_SELF == "viewthread.php") {
global $online_users, $i;
$online_users = array();
function alter_user($matches) {
global $online_users;
if (!isset($online_users[$matches['3']])) {
$data = dbarray(dbquery("SELECT user_lastvisit FROM ".DB_USERS." WHERE user_id='".$matches['3']."' LIMIT 1"));
if ($data['user_lastvisit']<(time()-300)) {
$user_online = false;
$online_img = "user-offline.png";
} else {
$user_online = true;
$online_img = "user-online.png";
}
$online_users[$matches['3']] = $user_online;
} else {
$online_img = ($online_users[$matches['3']] ? "user-online.png" : "user-offline.png");
}
return $matches['0']."<img src='".BASEDIR."images/".$online_img."' alt='' align='center' />\n";
}
function alter_forum_output($output) {
$search = "/(<!--forum_thread_user_name-->)(<a href='[^0-9]+)([0-9]+)('[^0-9]+>)(.*?<\/a>)/";
return preg_replace_callback($search, "alter_user", $output);
}
add_handler("alter_forum_output");
}
echo "</br ><!--online_status-->\n";
$search = "/(<!--forum_thread_user_name-->)(<a href='[^0-9]+)([0-9]+)('[^0-9]+>)(.*?<\/a>)/";
return preg_replace_callback($search, "alter_user", $output);
$search = "/(<!--online_status-->)(<a href='[^0-9]+)([0-9]+)('[^0-9]+>)(.*?<\/a>)/";
return preg_replace_callback($search, "alter_user", $output);
echo "</br ><!--online_status-->".profile_link($data['user_id'])."\n";
Category Forum
Modifications and Requests - 8Labels
None yet
Statistics
1 participant
Notifications
You are not receiving notifications from this thread.
Related Questions