Changeset 5121
- Timestamp:
- 02/13/06 11:36:11 (2 years ago)
- Files:
-
- wp-useronline/trunk/readme.txt (modified) (1 diff)
- wp-useronline/trunk/useronline.php (modified) (5 diffs)
- wp-useronline/trunk/wp-useronline.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wp-useronline/trunk/readme.txt
r5011 r5121 12 12 // Version 2.02 (01-03-2006) 13 13 - NEW: No More Install/Upgrade File, It Will Install/Upgrade When You Activate The Plugin. 14 - FIXED: IP 'Unknown' Error, Credit To Brian Layman (http://www.knitchat.com/) 15 - FIXED: ON DUPLICATE KEY Error, Credit To Brian Layman (http://www.knitchat.com/) 14 16 15 17 // Version 2.01 (01-02-2006) wp-useronline/trunk/useronline.php
r5011 r5121 33 33 34 34 ### Search Bots Name 35 $bots = array('Google Bot' => 'googlebot', ' MSN' => 'msnbot', 'Alex' => 'ia_archiver', 'Lycos' => 'lycos', 'Ask Jeeves' => 'jeeves', 'Altavista' => 'scooter', 'AllTheWeb' => 'fast-webcrawler', 'Inktomi' => 'slurp@inktomi', 'Turnitin.com' => 'turnitinbot', 'Technorati' => 'technorati', 'Yahoo' => 'yahoo', 'Findexa' => 'findexa', 'NextLinks' => 'findlinks', 'Gais' => 'gaisbo', 'WiseNut' => 'zyborg', 'WhoisSource' => 'surveybot', 'Bloglines' => 'bloglines', 'BlogSearch' => 'blogsearch', 'PubSub' => 'ubsub', 'Syndic8' => 'syndic8', 'RadioUserland' => 'userland', 'Gigabot' => 'gigabot');35 $bots = array('Google Bot' => 'googlebot', 'Google Bot' => 'google', 'MSN' => 'msnbot', 'Alex' => 'ia_archiver', 'Lycos' => 'lycos', 'Ask Jeeves' => 'jeeves', 'Altavista' => 'scooter', 'AllTheWeb' => 'fast-webcrawler', 'Inktomi' => 'slurp@inktomi', 'Turnitin.com' => 'turnitinbot', 'Technorati' => 'technorati', 'Yahoo' => 'yahoo', 'Findexa' => 'findexa', 'NextLinks' => 'findlinks', 'Gais' => 'gaisbo', 'WiseNut' => 'zyborg', 'WhoisSource' => 'surveybot', 'Bloglines' => 'bloglines', 'BlogSearch' => 'blogsearch', 'PubSub' => 'ubsub', 'Syndic8' => 'syndic8', 'RadioUserland' => 'userland', 'Gigabot' => 'gigabot', 'Become.com bot' => 'become.com', 'Technorati Blog Bot'=>'technorati'); 36 36 37 37 … … 93 93 } 94 94 $make_page = addslashes($make_page); 95 96 // Update User First 97 $update_user = $wpdb->query("UPDATE $wpdb->useronline SET timestamp = '$timestamp', ip = '$ip', location = '$make_page', url = '$url' $where"); 98 99 // If No Such User Insert It 100 if(!$update_user) { 101 $insert_user = $wpdb->query("INSERT INTO $wpdb->useronline VALUES ('".($timestamp+1)."', '$memberonline', '$ip', '$make_page', '$url')"); 95 96 // Check User First 97 $check_user = intval($wpdb->get_var("SELECT COUNT(*) FROM $wpdb->useronline $where")); 98 99 // If User Exists, Update User 100 if($check_user > 0) { 101 $update_user = $wpdb->query("UPDATE $wpdb->useronline SET timestamp = '$timestamp', ip = '$ip', location = '$make_page', url = '$url' $where"); 102 // Else Insert User 103 } else { 104 $insert_user = $wpdb->query("INSERT INTO $wpdb->useronline VALUES ('$timestamp', '$memberonline', '$ip', '$make_page', '$url')"); 102 105 } 103 106 … … 136 139 137 140 ### Function: Display Max UserOnline 138 function get_most_useronline($display = true) { 139 $most_useronline_users = intval(get_settings('useronline_most_users')); 140 if($display) { 141 echo $most_useronline_users; 142 } else { 143 return $most_useronline_users; 141 if(!function_exists('get_most_useronline')) { 142 function get_most_useronline($display = true) { 143 $most_useronline_users = intval(get_settings('useronline_most_users')); 144 if($display) { 145 echo $most_useronline_users; 146 } else { 147 return $most_useronline_users; 148 } 144 149 } 145 150 } … … 147 152 148 153 ### Function: Display Max UserOnline Date 149 function get_most_useronline_date($date_format = 'jS F Y, H:i', $display =true) { 150 $most_useronline_timestamp = get_settings('useronline_most_timestamp'); 151 $most_useronline_date = gmdate($date_format, $most_useronline_timestamp); 152 if($display) { 153 echo $most_useronline_date; 154 } else { 155 return$most_useronline_date; 154 if(!function_exists('get_most_useronline_date')) { 155 function get_most_useronline_date($date_format = 'jS F Y, H:i', $display =true) { 156 $most_useronline_timestamp = get_settings('useronline_most_timestamp'); 157 $most_useronline_date = gmdate($date_format, $most_useronline_timestamp); 158 if($display) { 159 echo $most_useronline_date; 160 } else { 161 return$most_useronline_date; 162 } 156 163 } 157 164 } … … 247 254 " location varchar(255) NOT NULL default '',". 248 255 " url varchar(255) NOT NULL default '',". 249 " UNIQUEKEY (timestamp))";256 " PRIMARY KEY (timestamp))"; 250 257 maybe_create_table($wpdb->useronline, $create_table); 251 258 // Add In Options wp-useronline/trunk/wp-useronline.php
r5011 r5121 97 97 ### Function: Check IP 98 98 function check_ip($ip) { 99 if(!empty($_COOKIE[USER_COOKIE]) ) {99 if(!empty($_COOKIE[USER_COOKIE]) && ($ip != 'unknown')) { 100 100 return "(<a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=$ip\" target=\"_blank\" title=\"".gethostbyaddr($ip)."\">$ip</a>)"; 101 101 }
