hanna211
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: need help all user and admin being banned by a hackeri have to restore my website to how it was before i let that user edit the plugin i will se how it goes.
jan is there anything you can do to re-modify this plugin for me, untouched by that hacker.
i will give you something in return to your paypal thanks.
contact me on skype now
[ redacted, support is not offered via email, IM or Skype ]
Forum: Fixing WordPress
In reply to: Author online or offline code neededhow do i do step 2 ? call it ?
Forum: Fixing WordPress
In reply to: Author online or offline code neededhere do i call this
<?php session_start(); /* * * WordPress code to check wheather user is Online or not - by S V N Labs Softwares (svnlabs@gmail.com) (blog.svnlabs.com) * This is not a wordpress plugin, just a simple code to display user online status on blog or site ;) * ** User Online Status check Table CREATE TABLE <code>wordpress_users_online</code> ( <code>user_id</code> int(11) default NULL, <code>full_name</code> varchar(64) NOT NULL default '', <code>session_id</code> varchar(128) NOT NULL default '', <code>ip_address</code> varchar(15) NOT NULL default '', <code>time_entry</code> varchar(14) NOT NULL default '', <code>time_last_click</code> varchar(14) NOT NULL default '', <code>last_page_url</code> varchar(255) NOT NULL default '' ) ENGINE=MyISAM; ** Uses STEP 1: Add these 2 lines in header.php of wordpress theme file include("wordpress_users_online.php"); update_user_online(); STEP 2: Call function is_online() with $user_id for which we have to check online status is_online($user_id); */ define('TABLE_USERS', 'wordpress_users'); define('TABLE_USER_ONLINE', 'wordpress_users_online'); function update_user_online() { //global $user_id; global $current_user; get_currentuserinfo(); if ($current_user->ID && $current_user->user_login) { $wo_user_id = $current_user->ID; $wo_full_name = $user['user_nicename']; } else { $wo_user_id = ''; $wo_full_name = 'Guest'; } $wo_session_id = session_id(); $wo_ip_address = getenv('REMOTE_ADDR'); $wo_last_page_url = getenv('REQUEST_URI'); $current_time = time(); $xx_mins_ago = ($current_time - 300); // remove entries that have expired mysql_query("delete from " . TABLE_USER_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'"); $stored_user_query = mysql_query("select count(*) as count from " . TABLE_USER_ONLINE . " where session_id = '" . mysql_escape_string($wo_session_id) . "'"); $stored_user = mysql_fetch_array($stored_user_query); if ($stored_user['count'] > 0) { mysql_query("update " . TABLE_USER_ONLINE . " set user_id = '" . (int)$wo_user_id . "', full_name = '" . mysql_escape_string($wo_full_name) . "', ip_address = '" . mysql_escape_string($wo_ip_address) . "', time_last_click = '" . mysql_escape_string($current_time) . "', last_page_url = '" . mysql_escape_string($wo_last_page_url) . "' where session_id = '" . mysql_escape_string($wo_session_id) . "'"); } else { mysql_query("insert into " . TABLE_USER_ONLINE . " (user_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . (int)$wo_user_id . "', '" . mysql_escape_string($wo_full_name) . "', '" . mysql_escape_string($wo_session_id) . "', '" . mysql_escape_string($wo_ip_address) . "', '" . mysql_escape_string($current_time) . "', '" . mysql_escape_string($current_time) . "', '" . mysql_escape_string($wo_last_page_url) . "')"); } } function is_online($user_id) { $stored_user_query = mysql_query("select user_id from ".TABLE_USER_ONLINE." where user_id = '" . mysql_escape_string($user_id) . "'"); $stored_user = mysql_fetch_array($stored_user_query); if(isset($stored_user['user_id'])) $online = '<img src="online.png" border="0" /> Online'; else $online = '<img src="offline.png" border="0" /> Offline'; return $online; } ?>
Viewing 3 replies - 1 through 3 (of 3 total)