Version Description
Download this release
Release Info
Developer | GamerZ |
Plugin | WP-UserOnline |
Version | 2.10 |
Comparing to | |
See all releases |
Code changes from version 2.00 to 2.10
- readme-install.txt +0 -45
- readme-upgrade.txt +0 -34
- readme.html +524 -0
- readme.txt +31 -17
- useronline-install.php +0 -111
- useronline.php +0 -120
- useronline/useronline-js.php +89 -0
- useronline/useronline-options.php +103 -0
- useronline/useronline-widget.php +87 -0
- useronline/useronline.php +667 -0
- useronline/wp-useronline.pot +221 -0
- wp-useronline.php +0 -133
readme-install.txt
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
-> Installation Instructions
|
2 |
-
--------------------------------------------------
|
3 |
-
// Open wp-admin folder
|
4 |
-
|
5 |
-
Put:
|
6 |
-
------------------------------------------------------------------
|
7 |
-
useronline-install.php
|
8 |
-
------------------------------------------------------------------
|
9 |
-
|
10 |
-
|
11 |
-
// Open wp-content/plugins folder
|
12 |
-
|
13 |
-
Put:
|
14 |
-
------------------------------------------------------------------
|
15 |
-
useronline.php
|
16 |
-
------------------------------------------------------------------
|
17 |
-
|
18 |
-
|
19 |
-
// Open root Wordpress folder
|
20 |
-
|
21 |
-
Put:
|
22 |
-
------------------------------------------------------------------
|
23 |
-
wp-useronline.php
|
24 |
-
------------------------------------------------------------------
|
25 |
-
|
26 |
-
|
27 |
-
// Activate useronline plugin
|
28 |
-
|
29 |
-
|
30 |
-
// Run wp-admin/useronline-install.php
|
31 |
-
|
32 |
-
|
33 |
-
// Open wp-content/themes/<YOUR THEME NAME>/sidebar.php
|
34 |
-
|
35 |
-
Add:
|
36 |
-
------------------------------------------------------------------
|
37 |
-
<?php if (function_exists('useronline')): ?>
|
38 |
-
<li>
|
39 |
-
<h2>UserOnline</h2>
|
40 |
-
<ul>
|
41 |
-
<li><a href="<?php echo get_settings('home'); ?>/wp-useronline.php"><?php get_useronline(); ?></a></li>
|
42 |
-
</ul>
|
43 |
-
</li>
|
44 |
-
<?php endif; ?>
|
45 |
-
------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme-upgrade.txt
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
-> Upgrade Instructions For Version 1.0x To Version 2.00
|
2 |
-
------------------------------------------------------------------
|
3 |
-
// Open wp-content/plugins folder
|
4 |
-
|
5 |
-
Put:
|
6 |
-
------------------------------------------------------------------
|
7 |
-
useronline.php
|
8 |
-
------------------------------------------------------------------
|
9 |
-
|
10 |
-
|
11 |
-
// Open root Wordpress folder
|
12 |
-
|
13 |
-
Put:
|
14 |
-
------------------------------------------------------------------
|
15 |
-
wp-useronline.php
|
16 |
-
------------------------------------------------------------------
|
17 |
-
|
18 |
-
|
19 |
-
// Remove Previous Traces Of UserOnline Code In Your Theme
|
20 |
-
|
21 |
-
|
22 |
-
// Open wp-content/themes/<YOUR THEME NAME>/sidebar.php
|
23 |
-
|
24 |
-
Add:
|
25 |
-
------------------------------------------------------------------
|
26 |
-
<?php if (function_exists('useronline')): ?>
|
27 |
-
<li>
|
28 |
-
<h2>UserOnline</h2>
|
29 |
-
<ul>
|
30 |
-
<li><a href="<?php echo get_settings('home'); ?>/wp-useronline.php"><?php get_useronline(); ?></a></li>
|
31 |
-
</ul>
|
32 |
-
</li>
|
33 |
-
<?php endif; ?>
|
34 |
-
------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.html
ADDED
@@ -0,0 +1,524 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5 |
+
<title>WP-UserOnline 2.10 Readme</title>
|
6 |
+
<style type="text/css" media="screen">
|
7 |
+
/* Default Style */
|
8 |
+
BODY {
|
9 |
+
font-family: Verdana, Arial;
|
10 |
+
font-size: 12px;
|
11 |
+
color: #000000;
|
12 |
+
background: #FFFFFF;
|
13 |
+
}
|
14 |
+
P {
|
15 |
+
padding-left: 10px;
|
16 |
+
}
|
17 |
+
BLOCKQUOTE {
|
18 |
+
margin: 10px 20px 0px 20px;
|
19 |
+
padding: 10px;
|
20 |
+
border: 1px solid #8d8d8d;
|
21 |
+
background-color: #f5f5f5;
|
22 |
+
overflow: auto;
|
23 |
+
}
|
24 |
+
LI {
|
25 |
+
margin-top: 20px;
|
26 |
+
}
|
27 |
+
UL LI UL LI {
|
28 |
+
margin-top: 10px;
|
29 |
+
}
|
30 |
+
A, A:active, A:link, A:visited {
|
31 |
+
color: #2d3a4c;
|
32 |
+
text-decoration: none;
|
33 |
+
}
|
34 |
+
A:hover {
|
35 |
+
color: #5577a5;
|
36 |
+
text-decoration: underline;
|
37 |
+
}
|
38 |
+
/* Place Holder Style */
|
39 |
+
#Container {
|
40 |
+
width: 780px;
|
41 |
+
margin-left: auto;
|
42 |
+
margin-right: auto;
|
43 |
+
}
|
44 |
+
#Content {
|
45 |
+
background-color: #fafafa;
|
46 |
+
border: 1px solid #a2b6cb;
|
47 |
+
padding: 10px;
|
48 |
+
margin-top: -13px;
|
49 |
+
}
|
50 |
+
/* Title Style */
|
51 |
+
#Title {
|
52 |
+
font-family: Verdana, Arial;
|
53 |
+
font-size: 22px;
|
54 |
+
font-weight: bold;
|
55 |
+
color: #389aff;
|
56 |
+
border-bottom: 1px solid #389aff;
|
57 |
+
margin-bottom: 10px;
|
58 |
+
}
|
59 |
+
.SubTitle {
|
60 |
+
font-family: Verdana, Arial;
|
61 |
+
font-size: 18px;
|
62 |
+
font-weight: bold;
|
63 |
+
color: #5b87b4;
|
64 |
+
}
|
65 |
+
.SubSubTitle {
|
66 |
+
font-family: Verdana, Arial;
|
67 |
+
font-size: 14px;
|
68 |
+
font-weight: bold;
|
69 |
+
color: #73a4d6;
|
70 |
+
}
|
71 |
+
/* Tabs */
|
72 |
+
UL#Tabs {
|
73 |
+
font-family: Verdana, Arial;
|
74 |
+
font-size: 12px;
|
75 |
+
font-weight: bold;
|
76 |
+
list-style-type: none;
|
77 |
+
padding-bottom: 28px;
|
78 |
+
border-bottom: 1px solid #a2b6cb;
|
79 |
+
margin-bottom: 12px;
|
80 |
+
z-index: 1;
|
81 |
+
}
|
82 |
+
#Tabs LI.Tab {
|
83 |
+
float: right;
|
84 |
+
height: 25px;
|
85 |
+
background-color: #deedfb;
|
86 |
+
margin: 2px 0px 0px 5px;
|
87 |
+
border: 1px solid #a2b6cb;
|
88 |
+
}
|
89 |
+
#Tabs LI.Tab A {
|
90 |
+
float: left;
|
91 |
+
display: block;
|
92 |
+
color: #666666;
|
93 |
+
text-decoration: none;
|
94 |
+
padding: 5px;
|
95 |
+
}
|
96 |
+
#Tabs LI.Tab A:hover {
|
97 |
+
background-color: #bfe0fe;
|
98 |
+
border-bottom: 1px solid #bfe0fe;
|
99 |
+
}
|
100 |
+
/* Selected Tab */
|
101 |
+
#Tabs LI.SelectedTab {
|
102 |
+
float: right;
|
103 |
+
height: 25px;
|
104 |
+
background-color: #fafafa;
|
105 |
+
margin: 2px 0px 0px 5px;
|
106 |
+
border-top: 1px solid #a2b6cb;
|
107 |
+
border-right: 1px solid #a2b6cb;
|
108 |
+
border-bottom: 1px solid #fafafa;
|
109 |
+
border-left: 1px solid #a2b6cb;
|
110 |
+
}
|
111 |
+
#Tabs LI.SelectedTab A {
|
112 |
+
float: left;
|
113 |
+
display: block;
|
114 |
+
color: #666666;
|
115 |
+
text-decoration: none;
|
116 |
+
padding: 5px;
|
117 |
+
cursor: default;
|
118 |
+
}
|
119 |
+
/* Copyright */
|
120 |
+
#Copyright {
|
121 |
+
text-align: center;
|
122 |
+
}
|
123 |
+
</style>
|
124 |
+
<script type="text/javascript">
|
125 |
+
/* <![CDATA[*/
|
126 |
+
// Index Page
|
127 |
+
function index() {
|
128 |
+
// Tab
|
129 |
+
document.getElementById('IndexTab').className = 'SelectedTab';
|
130 |
+
document.getElementById('ChangelogTab').className = 'Tab';
|
131 |
+
document.getElementById('InstallTab').className = 'Tab';
|
132 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
133 |
+
document.getElementById('UsageTab').className = 'Tab';
|
134 |
+
// Page
|
135 |
+
document.getElementById('Index').style.display= 'block';
|
136 |
+
document.getElementById('Changelog').style.display = 'none';
|
137 |
+
document.getElementById('Install').style.display = 'none';
|
138 |
+
document.getElementById('Upgrade').style.display = 'none';
|
139 |
+
document.getElementById('Usage').style.display = 'none';
|
140 |
+
}
|
141 |
+
// Changelog Page
|
142 |
+
function changelog() {
|
143 |
+
// Tab
|
144 |
+
document.getElementById('IndexTab').className = 'Tab';
|
145 |
+
document.getElementById('ChangelogTab').className = 'SelectedTab';
|
146 |
+
document.getElementById('InstallTab').className = 'Tab';
|
147 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
148 |
+
document.getElementById('UsageTab').className = 'Tab';
|
149 |
+
// Page
|
150 |
+
document.getElementById('Index').style.display = 'none';
|
151 |
+
document.getElementById('Changelog').style.display = 'block';
|
152 |
+
document.getElementById('Install').style.display = 'none';
|
153 |
+
document.getElementById('Upgrade').style.display = 'none';
|
154 |
+
document.getElementById('Usage').style.display = 'none';
|
155 |
+
}
|
156 |
+
// Installation Page
|
157 |
+
function install() {
|
158 |
+
// Tab
|
159 |
+
document.getElementById('IndexTab').className = 'Tab';
|
160 |
+
document.getElementById('ChangelogTab').className = 'Tab';
|
161 |
+
document.getElementById('InstallTab').className = 'SelectedTab';
|
162 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
163 |
+
document.getElementById('UsageTab').className = 'Tab';
|
164 |
+
// Page
|
165 |
+
document.getElementById('Index').style.display= 'none';
|
166 |
+
document.getElementById('Changelog').style.display = 'none';
|
167 |
+
document.getElementById('Install').style.display = 'block';
|
168 |
+
document.getElementById('Upgrade').style.display = 'none';
|
169 |
+
document.getElementById('Usage').style.display = 'none';
|
170 |
+
}
|
171 |
+
// Upgrade Page
|
172 |
+
function upgrade() {
|
173 |
+
// Tab
|
174 |
+
document.getElementById('IndexTab').className = 'Tab';
|
175 |
+
document.getElementById('ChangelogTab').className = 'Tab';
|
176 |
+
document.getElementById('InstallTab').className = 'Tab';
|
177 |
+
document.getElementById('UpgradeTab').className = 'SelectedTab';
|
178 |
+
document.getElementById('UsageTab').className = 'Tab';
|
179 |
+
// Page
|
180 |
+
document.getElementById('Index').style.display= 'none';
|
181 |
+
document.getElementById('Changelog').style.display = 'none';
|
182 |
+
document.getElementById('Install').style.display = 'none';
|
183 |
+
document.getElementById('Upgrade').style.display = 'block';
|
184 |
+
document.getElementById('Usage').style.display = 'none';
|
185 |
+
}
|
186 |
+
// Usage Page
|
187 |
+
function usage() {
|
188 |
+
// Tab
|
189 |
+
document.getElementById('IndexTab').className = 'Tab';
|
190 |
+
document.getElementById('ChangelogTab').className = 'Tab';
|
191 |
+
document.getElementById('InstallTab').className = 'Tab';
|
192 |
+
document.getElementById('UpgradeTab').className = 'Tab';
|
193 |
+
document.getElementById('UsageTab').className = 'SelectedTab';
|
194 |
+
// Page
|
195 |
+
document.getElementById('Index').style.display= 'none';
|
196 |
+
document.getElementById('Changelog').style.display = 'none';
|
197 |
+
document.getElementById('Install').style.display = 'none';
|
198 |
+
document.getElementById('Upgrade').style.display = 'none';
|
199 |
+
document.getElementById('Usage').style.display = 'block';
|
200 |
+
}
|
201 |
+
/* ]]> */
|
202 |
+
</script>
|
203 |
+
</head>
|
204 |
+
<body>
|
205 |
+
<div id="Container">
|
206 |
+
<!-- Title -->
|
207 |
+
<div id="Title">WP-UserOnline 2.10 <span style="color: #aaaaaa;">Readme</span></div>
|
208 |
+
|
209 |
+
<!-- Tabs -->
|
210 |
+
<ul id="Tabs">
|
211 |
+
<li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
|
212 |
+
<li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
|
213 |
+
<li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
|
214 |
+
<li id="ChangelogTab" class="Tab"><a href="#Changelog" onclick="changelog(); return false;" title="Changelog">Changelog</a></li>
|
215 |
+
<li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index">Index</a></li>
|
216 |
+
</ul>
|
217 |
+
|
218 |
+
<!-- Content -->
|
219 |
+
<div id="Content">
|
220 |
+
<!-- Index -->
|
221 |
+
<div id="Index">
|
222 |
+
<div class="SubTitle">» Index</div>
|
223 |
+
<div class="SubSubTitle">Plugin Information</div>
|
224 |
+
<p>
|
225 |
+
<b>Author:</b><br />
|
226 |
+
<b>»</b> Lester 'GaMerZ' Chan
|
227 |
+
</p>
|
228 |
+
<p>
|
229 |
+
<b>EMail:</b><br />
|
230 |
+
<b>»</b>
|
231 |
+
<script type="text/javascript">
|
232 |
+
/* <![CDATA[*/
|
233 |
+
document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-UserOnline%202.10%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
|
234 |
+
/* ]]> */
|
235 |
+
</script>
|
236 |
+
</p>
|
237 |
+
<p>
|
238 |
+
<b>Website:</b><br />
|
239 |
+
<b>»</b> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a>
|
240 |
+
</p>
|
241 |
+
<p>
|
242 |
+
<b>Features:</b><br />
|
243 |
+
<b>»</b> Enable you to display how many users are online on your Wordpress blog with detailed statistics of where they are and who there are(Members/Guests/Search Bots).
|
244 |
+
</p>
|
245 |
+
<p>
|
246 |
+
<b>Download:</b><br />
|
247 |
+
<b>»</b> <a href="http://www.lesterchan.net/others/downloads.php?id=14" title="http://www.lesterchan.net/others/downloads.php?id=14">WP-UserOnline 2.10 For WordPress 2.1.x</a><br />
|
248 |
+
<b>»</b> <a href="http://www.lesterchan.net/others/downloads/wp-useronline206.zip" title="http://www.lesterchan.net/others/downloads/wp-useronline206.zip">WP-UserOnline 2.06 For WordPress 2.0.x</a><br />
|
249 |
+
<b>»</b> <a href="http://www.lesterchan.net/others/downloads/wp-useronline.zip" title="http://www.lesterchan.net/others/downloads/wp-useronline.zip">WP-UserOnline 1.00 For WordPress 1.5.2</a>
|
250 |
+
</p>
|
251 |
+
<p>
|
252 |
+
<b>Demo:</b><br />
|
253 |
+
<b>»</b> <a href="http://www.lesterchan.net/wordpress/useronline/" title="http://www.lesterchan.net/wordpress/useronline/">http://www.lesterchan.net/wordpress/useronline/</a>
|
254 |
+
</p>
|
255 |
+
<p>
|
256 |
+
<b>Development:</b><br />
|
257 |
+
<b>»</b> <a href="http://dev.wp-plugins.org/browser/wp-useronline/" title="http://dev.wp-plugins.org/browser/wp-useronline/">http://dev.wp-plugins.org/browser/wp-useronline/</a>
|
258 |
+
</p>
|
259 |
+
<p>
|
260 |
+
<b>Translations:</b><br />
|
261 |
+
<b>»</b> <a href="http://dev.wp-plugins.org/browser/wp-useronline/i18n/" title="http://dev.wp-plugins.org/browser/wp-useronline/i18n/">http://dev.wp-plugins.org/browser/wp-useronline/i18n/</a>
|
262 |
+
</p>
|
263 |
+
<p>
|
264 |
+
<b>Support Forums:</b><br />
|
265 |
+
<b>»</b> <a href="http://forums.lesterchan.net/index.php?board=21.0" title="http://forums.lesterchan.net/index.php?board=21.0">http://forums.lesterchan.net/index.php?board=21.0</a>
|
266 |
+
</p>
|
267 |
+
<p>
|
268 |
+
<b>Updated:</b><br />
|
269 |
+
<b>»</b> 1st February 2007
|
270 |
+
</p>
|
271 |
+
<p>
|
272 |
+
<b>Note:</b><br />
|
273 |
+
<b>»</b> The <b>Changelog</b>, <b>Installation</b>, <b>Upgrade</b>, <b>Usage</b> Tab at the top of the page.
|
274 |
+
</p>
|
275 |
+
<p>
|
276 |
+
<b>Donations:</b><br />
|
277 |
+
<b>»</b> I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks as my school allowance, I will really appericiate it. If not feel free to use it without any obligations. Thank You. My Paypal account is
|
278 |
+
<script type="text/javascript">
|
279 |
+
/* <![CDATA[*/
|
280 |
+
document.write(' <b>gamerz84@hotmail.com</b>.');
|
281 |
+
/* ]]> */
|
282 |
+
</script>
|
283 |
+
</p>
|
284 |
+
</div>
|
285 |
+
|
286 |
+
<!-- Changelog -->
|
287 |
+
<div id="Changelog" style="display: none;">
|
288 |
+
<div class="SubTitle">» Changelog</div>
|
289 |
+
<ul>
|
290 |
+
<li>
|
291 |
+
<b>Version 2.10 (01-02-2007)</b>
|
292 |
+
<ul>
|
293 |
+
<li>NEW: Works For WordPress 2.1 Only</li>
|
294 |
+
<li>NEW: Renamed useronline-js.js to useronline-js.php To Enable PHP Parsing</li>
|
295 |
+
</ul>
|
296 |
+
</li>
|
297 |
+
<li>
|
298 |
+
<b>Version 2.06 (02-01-2007)</b>
|
299 |
+
<ul>
|
300 |
+
<li>NEW: useronline.php Now Handles The AJAX Processing Instead Of index.php</li>
|
301 |
+
<li>NEW: Localize WP-UserOnline</li>
|
302 |
+
<li>FIXED: JavaScript onLoad Function Conflict By <a href="http://an-archos.com/anarchy-media-player/">zeug</a></li>
|
303 |
+
<li>FIXED: AJAX Not Working On Servers Running On PHP CGI</li>
|
304 |
+
<li>FIXED: IP2Nation Will Now Work Whether Or Not WP-Stats Is Activated</li>
|
305 |
+
</ul>
|
306 |
+
</li>
|
307 |
+
<li>
|
308 |
+
<b>Version 2.05 (01-10-2006)</b>
|
309 |
+
<ul>
|
310 |
+
<li>NEW: UserOnline Is Now Embedded Into A Page, And Hence No More Integrating Of UserOnline Page (Removed wp-useronline.php)</li>
|
311 |
+
<li>NEW: Changed In WP-UserOnline Structure: Members Mean Registered Users and Guests Mean Comment Authors</li>
|
312 |
+
<li>NEW: get_users_browsing_site(false) And get_users_browsing_page(false) Will Now Return An Array Containing Total Users, Total Members, Total Guests and Total Bots Online</li>
|
313 |
+
<li>NEW: Added Widget Title Option To WP-UserOnline Widget</li>
|
314 |
+
<li>FIXED: Invalid IP Error</li>
|
315 |
+
<li>FIXED: If Site URL Doesn't Match WP Option's Site URL, WP-UserOnline Will Not Work</li>
|
316 |
+
</ul>
|
317 |
+
</li>
|
318 |
+
<li>
|
319 |
+
<b>Version 2.04 (01-07-2006)</b>
|
320 |
+
<ul>
|
321 |
+
<li>NEW: AJAX Is Now Used For Updating Users Online Every 1 Minute Without Refreshing The Page</li>
|
322 |
+
<li>NEW: You Can Now Place Users Online Count And Users Browsing Site Data On The Sidebar As A Widget</li>
|
323 |
+
<li>NEW: UserOnline Options Panel And The Code That WP-UserOnline Generated Is XHTML 1.0 Transitional</li>
|
324 |
+
<li>NEW: Added Useronline Options In WP Administration Panel Under 'Options -> Useronline'</li>
|
325 |
+
<li>NEW: If You Have <a href="http://frenchfragfactory.net/ozh/archives/2004/08/27/ip-to-nation-plugin/">ip2nation Plugin</a> Installed, The User's/Guest's Country Flag Will Be Displayed</li>
|
326 |
+
</ul>
|
327 |
+
</li>
|
328 |
+
<li>
|
329 |
+
<b>Version 2.03 (01-04-2006)</b>
|
330 |
+
<ul>
|
331 |
+
<li>NEW: Added get_users_browsing_site(); To Display Users Browsing The Site</li>
|
332 |
+
<li>FIXED: wp-stats.php Link</li>
|
333 |
+
<li>FIXED: Some Grammer Errors, Credit To xclouds (http://www.xclouds.com/)</li>
|
334 |
+
</ul>
|
335 |
+
</li>
|
336 |
+
<li>
|
337 |
+
<b>Version 2.02 (01-03-2006)</b>
|
338 |
+
<ul>
|
339 |
+
<li>NEW: No More Install/Upgrade File, It Will Install/Upgrade When You Activate The Plugin.</li>
|
340 |
+
<li>FIXED: IP 'Unknown' Error, Credit To Brian Layman (http://www.knitchat.com/)</li>
|
341 |
+
<li>FIXED: ON DUPLICATE KEY Error, Credit To Brian Layman (http://www.knitchat.com/)</li>
|
342 |
+
<li>FIXED: DUPLICATE KEY Error By Using DELETE First, Credit To Jody Cairns (http://steelwhitetable.org/blog/)</li>
|
343 |
+
</ul>
|
344 |
+
</li>
|
345 |
+
<li>
|
346 |
+
<b>Version 2.01 (01-02-2006)</b>
|
347 |
+
<ul>
|
348 |
+
<li>NEW: Added Users Browsing Page</li>
|
349 |
+
<li>NEW: Added Most Users Ever Online</li>
|
350 |
+
<li>FIXED: Added UNIQUE Key Instead Of Primary Key To Test Whether It Will Solve Duplicate Entry Errors</li>
|
351 |
+
<li>FIXED: Quotes Issue In Page Title</li>
|
352 |
+
</ul>
|
353 |
+
</li>
|
354 |
+
<li>
|
355 |
+
<b>Version 2.00 (01-01-2006)</b>
|
356 |
+
<ul>
|
357 |
+
<li>NEW: Compatible With Only WordPress 2.0</li>
|
358 |
+
<li>NEW: Better Installer</li>
|
359 |
+
<li>NEW: GPL License Added</li>
|
360 |
+
<li>NEW: Page Title Added To wp-useronline.php</li>
|
361 |
+
<li>NEW: Added Extra Bots, Credit To Greg Perry (http://www.gregrperry.com/)</li>
|
362 |
+
<li>FIXED: Cleaner Codes</li>
|
363 |
+
</ul>
|
364 |
+
</li>
|
365 |
+
</ul>
|
366 |
+
</div>
|
367 |
+
|
368 |
+
<!-- Installation Instructions -->
|
369 |
+
<div id="Install" style="display: none;">
|
370 |
+
<div class="SubTitle">» Installation Instructions</div>
|
371 |
+
<ol>
|
372 |
+
<li>
|
373 |
+
Open <b>wp-content/plugins</b> Folder
|
374 |
+
</li>
|
375 |
+
<li>
|
376 |
+
Put:
|
377 |
+
<blockquote>Folder: useronline</blockquote>
|
378 |
+
</li>
|
379 |
+
<li>
|
380 |
+
<b>Activate</b> WP-UserOnline Plugin
|
381 |
+
</li>
|
382 |
+
<li>
|
383 |
+
Refer To <b>Usage</b> For Further Instructions
|
384 |
+
</li>
|
385 |
+
</ol>
|
386 |
+
</div>
|
387 |
+
|
388 |
+
<!-- Upgrade Instructions -->
|
389 |
+
<div id="Upgrade" style="display: none;">
|
390 |
+
<div class="SubTitle">» Upgrade Instructions</div>
|
391 |
+
<div class="SubSubTitle">From v1.0x To v2.10</div>
|
392 |
+
<ol>
|
393 |
+
<li>
|
394 |
+
<b>Deactivate</b> WP-UserOnline Plugin
|
395 |
+
</li>
|
396 |
+
<li>
|
397 |
+
Open <b>wp-content/plugins</b> Folder
|
398 |
+
</li>
|
399 |
+
<li>
|
400 |
+
Put/Overwrite:
|
401 |
+
<blockquote>Folder: useronline</blockquote>
|
402 |
+
</li>
|
403 |
+
<li>
|
404 |
+
Delete these file if exists:
|
405 |
+
<blockquote>
|
406 |
+
File: wp-useronline.php<br />
|
407 |
+
File: wp-content/plugins/useronline.php<br />
|
408 |
+
File: wp-content/plugins/useronline/wp-useronline.php<br />
|
409 |
+
File: wp-content/plugins/useronline/useronline-js.js
|
410 |
+
</blockquote>
|
411 |
+
</li>
|
412 |
+
<li>
|
413 |
+
<b>Activate</b> WP-UserOnline Plugin
|
414 |
+
</li>
|
415 |
+
<li>
|
416 |
+
Refer To <b>Usage</b> For Further Instructions
|
417 |
+
</li>
|
418 |
+
</ol>
|
419 |
+
</div>
|
420 |
+
|
421 |
+
<!-- Usage Instructions -->
|
422 |
+
<div id="Usage" style="display: none;">
|
423 |
+
<div class="SubTitle">» Usage Instructions</div>
|
424 |
+
<div class="SubSubTitle">General Usage (Without Widget)</div>
|
425 |
+
<ol>
|
426 |
+
<li>
|
427 |
+
Open <b>wp-content/themes/<YOUR THEME NAME>/sidebar.php</b>
|
428 |
+
</li>
|
429 |
+
<li>
|
430 |
+
Add Anywhere:
|
431 |
+
<blockquote>
|
432 |
+
<?php if (function_exists('useronline')): ?><br />
|
433 |
+
<li><br />
|
434 |
+
<h2>UserOnline</h2><br />
|
435 |
+
<ul><br />
|
436 |
+
<li><div id="useronline-count"><?php get_useronline(); ?></div></li><br />
|
437 |
+
</ul><br />
|
438 |
+
</li><br />
|
439 |
+
<?php endif; ?>
|
440 |
+
</blockquote>
|
441 |
+
</li>
|
442 |
+
</ol>
|
443 |
+
<div class="SubSubTitle">General Usage (With Widget)</div>
|
444 |
+
<ol>
|
445 |
+
<li>
|
446 |
+
<b>Activate</b> WP-UserOnline Widget Plugin
|
447 |
+
</li>
|
448 |
+
<li>
|
449 |
+
Go to 'WP-Admin -> Presentation -> Sidebar Widgets'
|
450 |
+
</li>
|
451 |
+
<li>
|
452 |
+
<b>Drag</b> the UserOnline Widget to your sidebar
|
453 |
+
</li>
|
454 |
+
<li>
|
455 |
+
You can <b>configure</b> the UserOnline Widget by clicking on the configure icon
|
456 |
+
</li>
|
457 |
+
<li>
|
458 |
+
Click 'Save changes'
|
459 |
+
</li>
|
460 |
+
<li>
|
461 |
+
Scroll down for instructions on how to create a <b>UserOnline Page</b>.
|
462 |
+
</li>
|
463 |
+
</ol>
|
464 |
+
<div class="SubSubTitle">UserOnline Page</div>
|
465 |
+
<ol>
|
466 |
+
<li>
|
467 |
+
Go to 'WP-Admin -> Write -> Write Page'
|
468 |
+
</li>
|
469 |
+
<li>
|
470 |
+
Type any title you like in the post's title area
|
471 |
+
</li>
|
472 |
+
<li>
|
473 |
+
Type '<b>[page_useronline]</b>' in the post's content area (without the quotes)
|
474 |
+
</li>
|
475 |
+
<li>
|
476 |
+
Type '<b>useronline</b>' in the post's slug area (without the quotes)
|
477 |
+
</li>
|
478 |
+
<li>
|
479 |
+
Click 'Publish'
|
480 |
+
</li>
|
481 |
+
<li>If you <b>ARE NOT</b> using nice permalinks, you need to go to 'WP-Admin -> Options -> Useronline' and under '<b>UserOnline URL</b>', you need to fill in the URL to the UserOnline Page you created above.</li>
|
482 |
+
</ol>
|
483 |
+
<div class="SubSubTitle">UserOnline Stats (Outside WP Loop)</div>
|
484 |
+
<ul>
|
485 |
+
<li>
|
486 |
+
To Display <b>Most Number Of Users Online</b>
|
487 |
+
</li>
|
488 |
+
<li>
|
489 |
+
Use:
|
490 |
+
<blockquote>
|
491 |
+
<?php if (function_exists('get_most_useronline')): ?><br />
|
492 |
+
<p>Most Users Ever Online Is <?php get_most_useronline(); ?> On <?php get_most_useronline_date(); ?></p><br />
|
493 |
+
<?php endif; ?>
|
494 |
+
</blockquote>
|
495 |
+
</li>
|
496 |
+
<li>
|
497 |
+
To Display <b>Users Browsing Site</b>
|
498 |
+
</li>
|
499 |
+
<li>
|
500 |
+
Use:
|
501 |
+
<blockquote>
|
502 |
+
<?php if (function_exists('get_users_browsing_site')): ?><br />
|
503 |
+
<div id="useronline-browsing-site"><?php get_users_browsing_site(); ?></div><br />
|
504 |
+
<?php endif; ?>
|
505 |
+
</blockquote>
|
506 |
+
</li>
|
507 |
+
<li>
|
508 |
+
To Display <b>Users Browsing A Page</b>
|
509 |
+
</li>
|
510 |
+
<li>
|
511 |
+
Use:
|
512 |
+
<blockquote>
|
513 |
+
<?php if (function_exists('get_users_browsing_page')): ?><br />
|
514 |
+
<div id="useronline-browsing-page"><?php get_users_browsing_page(); ?></div><br />
|
515 |
+
<?php endif; ?>
|
516 |
+
</blockquote>
|
517 |
+
</li>
|
518 |
+
</ul>
|
519 |
+
</div>
|
520 |
+
</div>
|
521 |
+
</div>
|
522 |
+
<p id="Copyright">WP-UserOnline 2.10<br />Copyright © 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
|
523 |
+
</body>
|
524 |
+
</html>
|
readme.txt
CHANGED
@@ -1,17 +1,31 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== WP-UserOnline ===
|
2 |
+
Contributors: GamerZ
|
3 |
+
Donate link: http://www.lesterchan.net/wordpress
|
4 |
+
Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
|
5 |
+
Requires at least: 2.1.0
|
6 |
+
Stable tag: 2.10
|
7 |
+
|
8 |
+
Enable you to display how many users are online on your Wordpress blog with detailed statistics.
|
9 |
+
|
10 |
+
== Description ==
|
11 |
+
|
12 |
+
Detailed statistics of where they are and who there are(Members/Guests/Search Bots).
|
13 |
+
|
14 |
+
All the information (general, changelog, installation, upgrade, usage) you need about this plugin can be found here: [WP-UserOnline Readme](http://www.lesterchan.net/wordpress/readme/wp-useronline.html "WP-UserOnline Readme").
|
15 |
+
It is the exact same readme.html is included in the zip package.
|
16 |
+
|
17 |
+
== Development Blog ==
|
18 |
+
|
19 |
+
[GaMerZ WordPress Plugins Development Blog](http://www.lesterchan.net/wordpress/ "GaMerZ WordPress Plugins Development Blog")
|
20 |
+
|
21 |
+
== Installation ==
|
22 |
+
|
23 |
+
[WP-UserOnline Readme](http://www.lesterchan.net/wordpress/readme/wp-useronline.html "WP-UserOnline Readme") (Installation Tab)
|
24 |
+
|
25 |
+
== Screenshots ==
|
26 |
+
|
27 |
+
[GaMerZ WordPress Plugins Screenshots](http://www.lesterchan.net/wordpress/screenshots/ "GaMerZ WordPress Plugins Screenshots")
|
28 |
+
|
29 |
+
== Frequently Asked Questions ==
|
30 |
+
|
31 |
+
You will need [GaMerZ WordPress Plugins Support Forums](http://forums.lesterchan.net/ "GaMerZ WordPress Plugins Support Forums")
|
useronline-install.php
DELETED
@@ -1,111 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
+----------------------------------------------------------------+
|
4 |
-
| |
|
5 |
-
| WordPress 2.0 Plugin: WP-UserOnline 2.00 |
|
6 |
-
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
-
| |
|
8 |
-
| File Written By: |
|
9 |
-
| - Lester "GaMerZ" Chan |
|
10 |
-
| - http://www.lesterchan.net |
|
11 |
-
| |
|
12 |
-
| File Information: |
|
13 |
-
| - Install WP-UserOnline 2.00 |
|
14 |
-
| - wp-admin/useronline-install.php |
|
15 |
-
| |
|
16 |
-
+----------------------------------------------------------------+
|
17 |
-
*/
|
18 |
-
|
19 |
-
|
20 |
-
### Require Config
|
21 |
-
require('../wp-config.php');
|
22 |
-
|
23 |
-
### Variables, Variables, Variables
|
24 |
-
$current_timestamp = current_time('timestamp');
|
25 |
-
$create_table = array();
|
26 |
-
$error = '';
|
27 |
-
|
28 |
-
### Create Tables (3 Tables)
|
29 |
-
$create_table[] = "CREATE TABLE $wpdb->useronline (".
|
30 |
-
" timestamp int(15) NOT NULL default '0',".
|
31 |
-
" username varchar(50) NOT NULL default '',".
|
32 |
-
" ip varchar(40) NOT NULL default '',".
|
33 |
-
" location varchar(255) NOT NULL default '',".
|
34 |
-
" url varchar(255) NOT NULL default '',".
|
35 |
-
" PRIMARY KEY (timestamp))";
|
36 |
-
|
37 |
-
### Check Whether There Is Any Pre Errors
|
38 |
-
$wpdb->show_errors = false;
|
39 |
-
$check_install = $wpdb->query("SHOW COLUMNS FROM $wpdb->useronline");
|
40 |
-
if($check_install) {
|
41 |
-
$error = __('You Had Already Installed WP-UserOnline.');
|
42 |
-
}
|
43 |
-
if(empty($wpdb->useronline)) {
|
44 |
-
$error = __('Please Define The useronline in wp-settings.php.');
|
45 |
-
}
|
46 |
-
?>
|
47 |
-
|
48 |
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
49 |
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
50 |
-
<head>
|
51 |
-
<title>WordPress › <?php _e('Installing'); ?> › <?php _e('WP-UserOnline 2.00'); ?></title>
|
52 |
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
53 |
-
<style type="text/css" media="screen">
|
54 |
-
@import url( wp-admin.css );
|
55 |
-
</style>
|
56 |
-
</head>
|
57 |
-
<body>
|
58 |
-
<div class="wrap">
|
59 |
-
<h2><?php _e('Install WP-UserOnline 2.00'); ?></h2>
|
60 |
-
<p><?php _e('This install script will install WP-UserOnline 2.00 for your Wordpress'); ?>.</p>
|
61 |
-
<p>
|
62 |
-
<?php _e('This install script will be doing the following:'); ?><br />
|
63 |
-
<b>»</b> <b>1</b> <?php _e('tables will be created namely <b>useronline</b>.'); ?><br />
|
64 |
-
<b>»</b> <b>1</b> <?php _e('tables will be optimized namely <b>useronline</b>.'); ?><br />
|
65 |
-
</p>
|
66 |
-
<?php
|
67 |
-
if(empty($error)) {
|
68 |
-
if(!empty($_POST['install'])) {
|
69 |
-
// Create Tables
|
70 |
-
$create_table_count = 0;
|
71 |
-
echo "<p><b>".__('Creating Tables:')."</b>";
|
72 |
-
foreach($create_table as $createtable) {
|
73 |
-
$wpdb->query($createtable);
|
74 |
-
}
|
75 |
-
$check_useronline = $wpdb->query("SHOW COLUMNS FROM $wpdb->useronline");
|
76 |
-
if($check_useronline) {
|
77 |
-
echo "<br /><b>»</b> Table (<b>$wpdb->useronline</b>) created.";
|
78 |
-
$create_table_count++;
|
79 |
-
} else {
|
80 |
-
echo "<br /><b>»</b> <font color=\"red\">Table (<b>$wpdb->useronline</b>) table NOT created.</font>";
|
81 |
-
}
|
82 |
-
echo "<br /><b>»</b> <b>$create_table_count / 1</b> Tables Created.</p>";
|
83 |
-
// Optimize Tables
|
84 |
-
$optimize_table_count = 0;
|
85 |
-
echo "<p><b>".__('Optimizing Tables:')."</b>";
|
86 |
-
$optimize_tables = $wpdb->query("OPTIMIZE TABLE $wpdb->useronline");
|
87 |
-
if($optimize_tables) {
|
88 |
-
echo "<br /><b>»</b> Tables (<b>$wpdb->useronline</b>) optimized.";
|
89 |
-
$optimize_table_count = 1;
|
90 |
-
} else {
|
91 |
-
echo "<br /><b>»</b> <font color=\"red\">Tables (<b>$wpdb->useronline</b>) NOT optimized.</font>";
|
92 |
-
}
|
93 |
-
echo "<br /><b>»</b> <b>$optimize_table_count / 1</b> Tables Optimized.</p>";
|
94 |
-
// Check Whether Install Is Successful
|
95 |
-
if($create_table_count == 1) {
|
96 |
-
echo '<p align="center"><b>'.__('WP-UserOnline 2.00 Installed Successfully.').'</b><br />'.__('Please remember to delete this file before proceeding on.').'</p>';
|
97 |
-
}
|
98 |
-
} else {
|
99 |
-
?>
|
100 |
-
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
101 |
-
<div align="center"><input type="submit" name="install" value="<?php _e('Click Here To Install WP-UserOnline 2.00'); ?>" class="button"></div>
|
102 |
-
</form>
|
103 |
-
<?php
|
104 |
-
}
|
105 |
-
} else {
|
106 |
-
echo "<p align=\"center\"><font color=\"red\"><b>$error</b></font></p>\n";
|
107 |
-
}
|
108 |
-
?>
|
109 |
-
</div>
|
110 |
-
</body>
|
111 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useronline.php
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: WP-UserOnline
|
4 |
-
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
-
Description: Adds A Useronline Feature To WordPress
|
6 |
-
Version: 2.0
|
7 |
-
Author: GaMerZ
|
8 |
-
Author URI: http://www.lesterchan.net
|
9 |
-
*/
|
10 |
-
|
11 |
-
|
12 |
-
/* Copyright 2005 Lester Chan (email : gamerz84@hotmail.com)
|
13 |
-
|
14 |
-
This program is free software; you can redistribute it and/or modify
|
15 |
-
it under the terms of the GNU General Public License as published by
|
16 |
-
the Free Software Foundation; either version 2 of the License, or
|
17 |
-
(at your option) any later version.
|
18 |
-
|
19 |
-
This program is distributed in the hope that it will be useful,
|
20 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
-
GNU General Public License for more details.
|
23 |
-
|
24 |
-
You should have received a copy of the GNU General Public License
|
25 |
-
along with this program; if not, write to the Free Software
|
26 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
-
*/
|
28 |
-
|
29 |
-
|
30 |
-
### UserOnline Table Name
|
31 |
-
$wpdb->useronline = $table_prefix . 'useronline';
|
32 |
-
|
33 |
-
### Function: Get IP
|
34 |
-
function get_IP() {
|
35 |
-
if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
|
36 |
-
$ip_address = $_SERVER["REMOTE_ADDR"];
|
37 |
-
} else {
|
38 |
-
$ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
|
39 |
-
}
|
40 |
-
if(strpos($ip_address, ',') !== false) {
|
41 |
-
$ip_address = explode(',', $ip_address);
|
42 |
-
$ip_address = $ip_address[0];
|
43 |
-
}
|
44 |
-
return $ip_address;
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
### Function: Process UserOnline
|
49 |
-
add_action('wp_head', 'useronline');
|
50 |
-
function useronline() {
|
51 |
-
global $wpdb;
|
52 |
-
// Search Bots
|
53 |
-
$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');
|
54 |
-
|
55 |
-
// Useronline Settings
|
56 |
-
$timeoutseconds = 300;
|
57 |
-
$timestamp = current_time('timestamp');
|
58 |
-
$timeout = ($timestamp-$timeoutseconds);
|
59 |
-
$ip = get_IP();
|
60 |
-
$url = addslashes(urlencode($_SERVER['REQUEST_URI']));
|
61 |
-
|
62 |
-
// Check For Members
|
63 |
-
if(!empty($_COOKIE['comment_author_'.COOKIEHASH])) {
|
64 |
-
$memberonline = addslashes(trim($_COOKIE['comment_author_'.COOKIEHASH]));
|
65 |
-
$where = "WHERE username='$memberonline'";
|
66 |
-
// Check For Admins
|
67 |
-
} elseif(!empty($_COOKIE['wordpressuser_'.COOKIEHASH])) {
|
68 |
-
$memberonline = addslashes(trim($_COOKIE['wordpressuser_'.COOKIEHASH]));
|
69 |
-
$where = "WHERE username='$memberonline'";
|
70 |
-
// Check For Guests
|
71 |
-
} else {
|
72 |
-
$memberonline = 'Guest';
|
73 |
-
$where = "WHERE ip='$ip'";
|
74 |
-
}
|
75 |
-
// Check For Bot
|
76 |
-
foreach ($bots as $name => $lookfor) {
|
77 |
-
if (stristr($_SERVER['HTTP_USER_AGENT'], $lookfor) !== false) {
|
78 |
-
$memberonline = addslashes($name);
|
79 |
-
$where = "WHERE ip='$ip'";
|
80 |
-
}
|
81 |
-
}
|
82 |
-
// Check For Page Title
|
83 |
-
$make_page = wp_title('»', false);
|
84 |
-
if(empty($make_page)) {
|
85 |
-
$make_page = get_bloginfo('name');
|
86 |
-
} elseif(is_single()) {
|
87 |
-
$make_page = get_bloginfo('name').' » Blog Archive '.$make_page;
|
88 |
-
} else {
|
89 |
-
$make_page = get_bloginfo('name').$make_page;
|
90 |
-
}
|
91 |
-
|
92 |
-
// Update User First
|
93 |
-
$update_user = $wpdb->query("UPDATE $wpdb->useronline SET timestamp = '$timestamp', ip = '$ip', location = '$make_page', url = '$url' $where");
|
94 |
-
|
95 |
-
// If No Such User Insert It
|
96 |
-
if(!$update_user) {
|
97 |
-
$insert_user = $wpdb->query("INSERT INTO $wpdb->useronline VALUES ('$timestamp', '$memberonline', '$ip', '$make_page', '$url')");
|
98 |
-
}
|
99 |
-
|
100 |
-
// Delete Users
|
101 |
-
$delete_users = $wpdb->query("DELETE FROM $wpdb->useronline WHERE timestamp < $timeout");
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
### Function: Display UserOnline
|
106 |
-
function get_useronline($user = 'User', $users = 'Users', $display = true) {
|
107 |
-
global $wpdb;
|
108 |
-
// Count Total Users Online
|
109 |
-
$useronline = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->useronline");
|
110 |
-
if($display) {
|
111 |
-
if($useronline > 1) {
|
112 |
-
echo "<b>$useronline</b> $users ".__('Online');
|
113 |
-
} else {
|
114 |
-
echo "<b>$useronline</b> $user ".__('Online');
|
115 |
-
}
|
116 |
-
} else {
|
117 |
-
return $useronline;
|
118 |
-
}
|
119 |
-
}
|
120 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useronline/useronline-js.php
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-UserOnline 2.10 |
|
6 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Useronline Javascript File |
|
14 |
+
| - wp-content/plugins/useronline/useronline-js.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Include wp-config.php
|
21 |
+
@require('../../../wp-config.php');
|
22 |
+
cache_javascript_headers();
|
23 |
+
|
24 |
+
### Determine useronline.php Path
|
25 |
+
$useronline_ajax_url = dirname($_SERVER['PHP_SELF']);
|
26 |
+
if(substr($useronline_ajax_url, -1) == '/') {
|
27 |
+
$useronline_ajax_url = substr($useronline_ajax_url, 0, -1);
|
28 |
+
}
|
29 |
+
?>
|
30 |
+
// Variables
|
31 |
+
var useronline_ajax_url = "<?php echo $useronline_ajax_url; ?>/useronline.php";
|
32 |
+
var useronline_timeout = <?php echo (get_option('useronline_timeout')*1000); ?>;
|
33 |
+
|
34 |
+
// UserOnline JavaScript Init
|
35 |
+
function useronline_init() {
|
36 |
+
// Check Users Count
|
37 |
+
if(document.getElementById('useronline-count') != null ) {
|
38 |
+
setInterval("get_useronline_count()", useronline_timeout);
|
39 |
+
}
|
40 |
+
// Check Users Browsing Site
|
41 |
+
if(document.getElementById('useronline-browsing-site') != null ) {
|
42 |
+
setInterval("get_useronline_browsingsite()", useronline_timeout);
|
43 |
+
}
|
44 |
+
// Check Users Browsing Page
|
45 |
+
if(document.getElementById('useronline-browsing-page') != null) {
|
46 |
+
setInterval("get_useronline_browsingpage()", useronline_timeout);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
// Get UserOnline Count
|
52 |
+
function get_useronline_count() {
|
53 |
+
useronline_count = new sack(useronline_ajax_url);
|
54 |
+
useronline_count.setVar("useronline_mode", 'useronline_count');
|
55 |
+
useronline_count.method = 'GET';
|
56 |
+
useronline_count.element = 'useronline-count';
|
57 |
+
useronline_count.runAJAX();
|
58 |
+
useronline_count = null;
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
// Get Users Browsing Site
|
63 |
+
function get_useronline_browsingsite() {
|
64 |
+
useronline_browsingsite = new sack(useronline_ajax_url);
|
65 |
+
useronline_browsingsite.setVar("useronline_mode", 'useronline_browsingsite');
|
66 |
+
useronline_browsingsite.method = 'GET';
|
67 |
+
useronline_browsingsite.element = 'useronline-browsing-site';
|
68 |
+
useronline_browsingsite.runAJAX();
|
69 |
+
useronline_browsingsite = null;
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
// Get Users Browsing Page
|
74 |
+
function get_useronline_browsingpage() {
|
75 |
+
useronline_browsingpage = new sack(useronline_ajax_url);
|
76 |
+
useronline_browsingpage.setVar("useronline_mode", 'useronline_browsingpage');
|
77 |
+
useronline_browsingpage.method = 'GET';
|
78 |
+
useronline_browsingpage.element = 'useronline-browsing-page';
|
79 |
+
useronline_browsingpage.runAJAX();
|
80 |
+
useronline_browsingpage = null;
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
// Init UserOnline
|
85 |
+
addLoadEvent = function(f) { var old = window.onload
|
86 |
+
if (typeof old != 'function') window.onload = f
|
87 |
+
else { window.onload = function() { old(); f() }}
|
88 |
+
}
|
89 |
+
addLoadEvent(useronline_init);
|
useronline/useronline-options.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
+----------------------------------------------------------------+
|
4 |
+
| |
|
5 |
+
| WordPress 2.1 Plugin: WP-UserOnline 2.10 |
|
6 |
+
| Copyright (c) 2007 Lester "GaMerZ" Chan |
|
7 |
+
| |
|
8 |
+
| File Written By: |
|
9 |
+
| - Lester "GaMerZ" Chan |
|
10 |
+
| - http://www.lesterchan.net |
|
11 |
+
| |
|
12 |
+
| File Information: |
|
13 |
+
| - Useronline Options Page |
|
14 |
+
| - wp-content/plugins/useronline/useronline-options.php |
|
15 |
+
| |
|
16 |
+
+----------------------------------------------------------------+
|
17 |
+
*/
|
18 |
+
|
19 |
+
|
20 |
+
### Variables Variables Variables
|
21 |
+
$base_name = plugin_basename('useronline/useronline-options.php');
|
22 |
+
$base_page = 'admin.php?page='.$base_name;
|
23 |
+
|
24 |
+
### If Form Is Submitted
|
25 |
+
if($_POST['Submit']) {
|
26 |
+
$useronline_bots = array();
|
27 |
+
$useronline_timeout = intval($_POST['useronline_timeout']);
|
28 |
+
$useronline_bots_name = explode("\n", trim($_POST['useronline_bots_name']));
|
29 |
+
$useronline_bots_agent = explode("\n", trim($_POST['useronline_bots_agent']));
|
30 |
+
$useronline_bots_keys = array_values((array) $useronline_bots_name);
|
31 |
+
$useronline_bots_vals = array_values((array) $useronline_bots_agent);
|
32 |
+
$n = max(count($useronline_bots_keys), count($useronline_bots_vals));
|
33 |
+
for($i = 0; $i < $n; $i++) {
|
34 |
+
$useronline_bots[trim($useronline_bots_keys[$i])] = trim($useronline_bots_vals[$i]);
|
35 |
+
}
|
36 |
+
$useronline_url = addslashes(trim($_POST['useronline_url']));
|
37 |
+
$update_useronline_queries = array();
|
38 |
+
$update_useronline_text = array();
|
39 |
+
$update_useronline_queries[] = update_option('useronline_timeout', $useronline_timeout);
|
40 |
+
$update_useronline_queries[] = update_option('useronline_bots', $useronline_bots);
|
41 |
+
$update_useronline_queries[] = update_option('useronline_url', $useronline_url);
|
42 |
+
$update_useronline_text[] = __('Useronline Timeout', 'wp-useronline');
|
43 |
+
$update_useronline_text[] = __('Useronline Bots', 'wp-useronline');
|
44 |
+
$update_useronline_text[] = __('Useronline URL', 'wp-useronline');
|
45 |
+
$i=0;
|
46 |
+
$text = '';
|
47 |
+
foreach($update_useronline_queries as $update_useronline_query) {
|
48 |
+
if($update_useronline_query) {
|
49 |
+
$text .= '<font color="green">'.$update_useronline_text[$i].' '.__('Updated', 'wp-useronline').'</font><br />';
|
50 |
+
}
|
51 |
+
$i++;
|
52 |
+
}
|
53 |
+
if(empty($text)) {
|
54 |
+
$text = '<font color="red">'.__('No Useronline Option Updated', 'wp-useronline').'</font>';
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
### Get Useronline Bots
|
59 |
+
$useronline_options_bots = get_option('useronline_bots');
|
60 |
+
$useronline_options_bots_name = '';
|
61 |
+
$useronline_options_bots_agent = '';
|
62 |
+
foreach($useronline_options_bots as $botname => $botagent) {
|
63 |
+
$useronline_options_bots_name .= $botname."\n";
|
64 |
+
$useronline_options_bots_agent .= $botagent."\n";
|
65 |
+
}
|
66 |
+
$useronline_options_bots_name = trim($useronline_options_bots_name);
|
67 |
+
$useronline_options_bots_agent = trim($useronline_options_bots_agent);
|
68 |
+
?>
|
69 |
+
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
|
70 |
+
<div class="wrap">
|
71 |
+
<h2><?php _e('Useronline Options', 'wp-useronline'); ?></h2>
|
72 |
+
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
|
73 |
+
<fieldset class="options">
|
74 |
+
<legend><?php _e('Useronline Options', 'wp-useronline'); ?></legend>
|
75 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
76 |
+
<tr valign="top">
|
77 |
+
<th align="left" width="30%"><?php _e('Time Out', 'wp-useronline'); ?></th>
|
78 |
+
<td align="left">
|
79 |
+
<input type="text" name="useronline_timeout" value="<?php echo get_option('useronline_timeout'); ?>" size="4" /><br /><?php _e('How long till it will remove the user from the database (In seconds).', 'wp-useronline'); ?>
|
80 |
+
</td>
|
81 |
+
</tr>
|
82 |
+
<tr valign="top">
|
83 |
+
<th align="left" width="30%"><?php _e('UserOnline URL', 'wp-useronline'); ?></th>
|
84 |
+
<td align="left">
|
85 |
+
<input type="text" name="useronline_url" value="<?php echo get_option('useronline_url'); ?>" size="50" /><br /><?php _e('URL To UserOnline Page<br />Example: http://www.yoursite.com/blogs/useronline/<br />Example: http://www.yoursite.com/blogs/?page_id=2', 'wp-useronline'); ?>
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
<tr valign="top">
|
89 |
+
<th align="left" width="30%"><?php _e('Bots Name/User Agent', 'wp-useronline'); ?></th>
|
90 |
+
<td align="left">
|
91 |
+
<?php _e('Here are a list of bots and their partial browser agents.<br />On the left column will be the <strong>Bot\'s Name</strong> and on the right column will be their <strong>Partial Browser Agent</strong>.<br />Start each entry on a new line.', 'wp-useronline'); ?>
|
92 |
+
<br /><br />
|
93 |
+
<textarea cols="20" rows="30" name="useronline_bots_name"><?php echo $useronline_options_bots_name; ?></textarea>
|
94 |
+
<textarea cols="20" rows="30" name="useronline_bots_agent"><?php echo $useronline_options_bots_agent; ?></textarea>
|
95 |
+
</td>
|
96 |
+
</tr>
|
97 |
+
</table>
|
98 |
+
</fieldset>
|
99 |
+
<div align="center">
|
100 |
+
<input type="submit" name="Submit" class="button" value="<?php _e('Update Options', 'wp-useronline'); ?>" /> <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-useronline'); ?>" class="button" onclick="javascript:history.go(-1)" />
|
101 |
+
</div>
|
102 |
+
</form>
|
103 |
+
</div>
|
useronline/useronline-widget.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: WP-UserOnline Widget
|
4 |
+
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
+
Description: Adds a UserOnline Widget To Display Users Online From WP-UserOnline Plugin. Please Activate WP-UserOnline First.
|
6 |
+
Version: 2.10
|
7 |
+
Author: GaMerZ
|
8 |
+
Author URI: http://www.lesterchan.net
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
/*
|
13 |
+
Copyright 2007 Lester Chan (email : gamerz84@hotmail.com)
|
14 |
+
|
15 |
+
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation; either version 2 of the License, or
|
18 |
+
(at your option) any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program; if not, write to the Free Software
|
27 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
+
*/
|
29 |
+
|
30 |
+
|
31 |
+
### Function: Init WP-UserOnline Widget
|
32 |
+
function widget_useronline_init() {
|
33 |
+
if (!function_exists('register_sidebar_widget')) {
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
|
37 |
+
### Function: WP-UserOnline Widget
|
38 |
+
function widget_useronline($args) {
|
39 |
+
extract($args);
|
40 |
+
$options = get_option('widget_useronline');
|
41 |
+
$title = htmlspecialchars($options['title']);
|
42 |
+
echo $before_widget.$before_title.$title.$after_title;
|
43 |
+
if (function_exists('useronline')) {
|
44 |
+
echo '<ul>'."\n";
|
45 |
+
echo '<li><div id="useronline-count">';
|
46 |
+
get_useronline();
|
47 |
+
echo '</div></li>'."\n";
|
48 |
+
if(intval($options['display_usersbrowsingsite']) == 1) {
|
49 |
+
echo '<li><div id="useronline-browsing-site">';
|
50 |
+
get_users_browsing_site();
|
51 |
+
echo '</div></li>'."\n";
|
52 |
+
}
|
53 |
+
echo '</ul>'."\n";
|
54 |
+
}
|
55 |
+
echo $after_widget;
|
56 |
+
}
|
57 |
+
|
58 |
+
### Function: WP-UserOnline Widget Options
|
59 |
+
function widget_useronline_options() {
|
60 |
+
$options = get_option('widget_useronline');
|
61 |
+
if (!is_array($options)) {
|
62 |
+
$options = array('display_usersbrowsingsite' => '0', 'title' => __('UserOnline', 'wp-useronline'));
|
63 |
+
}
|
64 |
+
if ($_POST['useronline-submit']) {
|
65 |
+
$options['display_usersbrowsingsite'] = intval($_POST['useronline-usersbrowsingsite']);
|
66 |
+
$options['title'] = strip_tags(stripslashes($_POST['useronline-title']));
|
67 |
+
update_option('widget_useronline', $options);
|
68 |
+
}
|
69 |
+
echo '<p style="text-align: left;"><label for="useronline-title">'.__('Widget Title', 'wp-useronline').':</label> <input type="text" id="useronline-title" name="useronline-title" value="'.htmlspecialchars($options['title']).'" />';
|
70 |
+
echo '<p style="text-align: center;"><label for="useronline-usersbrowsingsite">'.__('Display Users Browsing Site Under Users Online Count?', 'wp-useronline').'</label></p>'."\n";
|
71 |
+
echo '<p style="text-align: center;"><input type="radio" id="useronline-usersbrowsingsite" name="useronline-usersbrowsingsite" value="1"';
|
72 |
+
checked(1, intval($options['display_usersbrowsingsite']));
|
73 |
+
echo ' /> '.__('Yes', 'wp-useronline').' <input type="radio" id="useronline-usersbrowsingsite" name="useronline-usersbrowsingsite" value="0"';
|
74 |
+
checked(0, intval($options['display_usersbrowsingsite']));
|
75 |
+
echo ' /> '.__('No', 'wp-useronline').'</p>'."\n";
|
76 |
+
echo '<input type="hidden" id="useronline-submit" name="useronline-submit" value="1" />'."\n";
|
77 |
+
}
|
78 |
+
|
79 |
+
// Register Widgets
|
80 |
+
register_sidebar_widget('UserOnline', 'widget_useronline');
|
81 |
+
register_widget_control('UserOnline', 'widget_useronline_options', 350, 120);
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
### Function: Load The WP-UserOnline Widget
|
86 |
+
add_action('plugins_loaded', 'widget_useronline_init');
|
87 |
+
?>
|
useronline/useronline.php
ADDED
@@ -0,0 +1,667 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: WP-UserOnline
|
4 |
+
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
|
5 |
+
Description: Enable you to display how many users are online on your Wordpress blog with detailed statistics of where they are and who there are(Members/Guests/Search Bots).
|
6 |
+
Version: 2.10
|
7 |
+
Author: GaMerZ
|
8 |
+
Author URI: http://www.lesterchan.net
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
/*
|
13 |
+
Copyright 2007 Lester Chan (email : gamerz84@hotmail.com)
|
14 |
+
|
15 |
+
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation; either version 2 of the License, or
|
18 |
+
(at your option) any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program; if not, write to the Free Software
|
27 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
+
*/
|
29 |
+
|
30 |
+
|
31 |
+
### Load WP-Config File If This File Is Called Directly
|
32 |
+
if (!function_exists('add_action')) {
|
33 |
+
require_once('../../../wp-config.php');
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
### Create Text Domain For Translation
|
38 |
+
load_plugin_textdomain('wp-useronline', 'wp-content/plugins/useronline');
|
39 |
+
|
40 |
+
|
41 |
+
### UserOnline Table Name
|
42 |
+
$wpdb->useronline = $table_prefix . 'useronline';
|
43 |
+
|
44 |
+
|
45 |
+
### Function: WP-UserOnline Menu
|
46 |
+
add_action('admin_menu', 'useronline_menu');
|
47 |
+
function useronline_menu() {
|
48 |
+
if (function_exists('add_submenu_page')) {
|
49 |
+
add_submenu_page('index.php', __('WP-UserOnline', 'wp-useronline'), __('WP-UserOnline', 'wp-useronline'), 1, 'useronline/useronline.php', 'display_useronline');
|
50 |
+
}
|
51 |
+
if (function_exists('add_options_page')) {
|
52 |
+
add_options_page(__('Useronline', 'wp-useronline'), __('Useronline', 'wp-useronline'), 'manage_options', 'useronline/useronline-options.php');
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
### Function: Displays UserOnline Header
|
58 |
+
add_action('wp_head', 'useronline_header');
|
59 |
+
function useronline_header() {
|
60 |
+
echo "\n".'<!-- Start Of Script Generated By WP-UserOnline 2.10 -->'."\n";
|
61 |
+
wp_register_script('wp-useronline', '/wp-content/plugins/useronline/useronline-js.php', false, '2.10');
|
62 |
+
wp_print_scripts(array('sack', 'wp-useronline'));
|
63 |
+
echo '<!-- End Of Script Generated By WP-UserOnline 2.10 -->'."\n";
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
### Function: Process UserOnline
|
68 |
+
add_action('admin_head', 'useronline');
|
69 |
+
add_action('wp_head', 'useronline');
|
70 |
+
function useronline() {
|
71 |
+
global $wpdb, $useronline;
|
72 |
+
// Useronline Settings
|
73 |
+
$timeoutseconds = get_option('useronline_timeout');
|
74 |
+
$timestamp = current_time('timestamp');
|
75 |
+
$timeout = ($timestamp-$timeoutseconds);
|
76 |
+
$ip = get_ipaddress();
|
77 |
+
$url = addslashes(urlencode($_SERVER['REQUEST_URI']));
|
78 |
+
$useragent = $_SERVER['HTTP_USER_AGENT'];
|
79 |
+
$current_user = wp_get_current_user();
|
80 |
+
|
81 |
+
// Check For Bot
|
82 |
+
$bots = get_option('useronline_bots');
|
83 |
+
foreach ($bots as $name => $lookfor) {
|
84 |
+
if (stristr($useragent, $lookfor) !== false) {
|
85 |
+
$user_id = 0;
|
86 |
+
$display_name = addslashes($name);
|
87 |
+
$user_name = addslashes($lookfor);
|
88 |
+
$type = 'bot';
|
89 |
+
$where = "WHERE ip = '$ip'";
|
90 |
+
$bot_found = true;
|
91 |
+
break;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
// If No Bot Is Found, Then We Check Members And Guests
|
96 |
+
if(!$bot_found) {
|
97 |
+
// Check For Member
|
98 |
+
if($current_user->ID > 0) {
|
99 |
+
$user_id = $current_user->ID;
|
100 |
+
$display_name = addslashes($current_user->display_name);
|
101 |
+
$user_name = addslashes($current_user->user_login);
|
102 |
+
$type = 'member';
|
103 |
+
$where = "WHERE userid = '$user_id'";
|
104 |
+
// Check For Comment Author (Guest)
|
105 |
+
} elseif(!empty($_COOKIE['comment_author_'.COOKIEHASH])) {
|
106 |
+
$user_id = 0;
|
107 |
+
$display_name = addslashes(trim($_COOKIE['comment_author_'.COOKIEHASH]));
|
108 |
+
$user_name = __('guest', 'wp-useronline').'_'.$display_name;
|
109 |
+
$type = 'guest';
|
110 |
+
$where = "WHERE ip = '$ip'";
|
111 |
+
// Check For Guest
|
112 |
+
} else {
|
113 |
+
$user_id = 0;
|
114 |
+
$display_name = __('Guest', 'wp-useronline');
|
115 |
+
$user_name = "guest";
|
116 |
+
$type = 'guest';
|
117 |
+
$where = "WHERE ip = '$ip'";
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
// Get User Agent
|
122 |
+
$useragent = addslashes($useragent);
|
123 |
+
|
124 |
+
// Check For Page Title
|
125 |
+
$make_page = wp_title('»', false);
|
126 |
+
if(empty($make_page)) {
|
127 |
+
$make_page = get_bloginfo('name');
|
128 |
+
} elseif(is_single()) {
|
129 |
+
$make_page = get_bloginfo('name').' » '.__('Blog Archive', 'wp-useronline').' '.$make_page;
|
130 |
+
} else {
|
131 |
+
$make_page = get_bloginfo('name').$make_page;
|
132 |
+
}
|
133 |
+
$make_page = addslashes($make_page);
|
134 |
+
|
135 |
+
// Delete Users
|
136 |
+
$delete_users = $wpdb->query("DELETE FROM $wpdb->useronline $where OR (timestamp < $timeout)");
|
137 |
+
|
138 |
+
// Insert Users
|
139 |
+
$insert_user = $wpdb->query("INSERT INTO $wpdb->useronline VALUES ('$timestamp', '$user_id', '$user_name', '$display_name', '$useragent', '$ip', '$make_page', '$url', '$type')");
|
140 |
+
|
141 |
+
// Count Users Online
|
142 |
+
$useronline = intval($wpdb->get_var("SELECT COUNT(*) FROM $wpdb->useronline"));
|
143 |
+
|
144 |
+
// Get Most User Online
|
145 |
+
$most_useronline = intval(get_option('useronline_most_users'));
|
146 |
+
|
147 |
+
// Check Whether Current Users Online Is More Than Most Users Online
|
148 |
+
if($useronline > $most_useronline) {
|
149 |
+
update_option('useronline_most_users', $useronline);
|
150 |
+
update_option('useronline_most_timestamp', current_time('timestamp'));
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
### Function: Display UserOnline
|
156 |
+
if(!function_exists('get_useronline')) {
|
157 |
+
function get_useronline($user = '', $users = '', $display = true) {
|
158 |
+
global $useronline;
|
159 |
+
if(empty($user)) {
|
160 |
+
$user = __('User', 'wp-useronline');
|
161 |
+
}
|
162 |
+
if(empty($users)) {
|
163 |
+
$users = __('Users', 'wp-useronline');
|
164 |
+
}
|
165 |
+
$useronline_url = get_option('useronline_url');
|
166 |
+
// Display User Online
|
167 |
+
if($display) {
|
168 |
+
if($useronline > 1) {
|
169 |
+
echo '<a href="'.$useronline_url.'"><strong>'.number_format($useronline).'</strong> '.$users.' '.__('Online', 'wp-useronline').'</a>'."\n";
|
170 |
+
} else {
|
171 |
+
echo '<a href="'.$useronline_url.'"><strong>'.$useronline.'</strong> '.$user.' '.__('Online', 'wp-useronline').'</a>'."\n";
|
172 |
+
}
|
173 |
+
} else {
|
174 |
+
return number_format($useronline);
|
175 |
+
}
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
|
180 |
+
### Function: Display Max UserOnline
|
181 |
+
if(!function_exists('get_most_useronline')) {
|
182 |
+
function get_most_useronline($display = true) {
|
183 |
+
$most_useronline_users = intval(get_option('useronline_most_users'));
|
184 |
+
if($display) {
|
185 |
+
echo number_format($most_useronline_users);
|
186 |
+
} else {
|
187 |
+
return $most_useronline_users;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
|
193 |
+
### Function: Display Max UserOnline Date
|
194 |
+
if(!function_exists('get_most_useronline_date')) {
|
195 |
+
function get_most_useronline_date($display = true, $date_format = 'jS F Y, H:i') {
|
196 |
+
$most_useronline_timestamp = get_option('useronline_most_timestamp');
|
197 |
+
$most_useronline_date = gmdate($date_format, $most_useronline_timestamp);
|
198 |
+
if($display) {
|
199 |
+
echo $most_useronline_date;
|
200 |
+
} else {
|
201 |
+
return$most_useronline_date;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
|
207 |
+
### Function: Display Users Browsing The Site
|
208 |
+
function get_users_browsing_site($display = true) {
|
209 |
+
global $wpdb;
|
210 |
+
|
211 |
+
// Get Users Browsing Site
|
212 |
+
$page_url = addslashes(urlencode($_SERVER['REQUEST_URI']));
|
213 |
+
$users_browse = $wpdb->get_results("SELECT displayname, type FROM $wpdb->useronline ORDER BY type");
|
214 |
+
|
215 |
+
// Variables
|
216 |
+
$members = array();
|
217 |
+
$guests = array();
|
218 |
+
$bots = array();
|
219 |
+
$total_users = 0;
|
220 |
+
$total_members = 0;
|
221 |
+
$total_guests = 0;
|
222 |
+
$total_bots = 0;
|
223 |
+
$nicetext_members = '';
|
224 |
+
$nicetext_guests = '';
|
225 |
+
$nicetext_bots = '';
|
226 |
+
|
227 |
+
// If There Is Users Browsing, Then We Execute
|
228 |
+
if($users_browse) {
|
229 |
+
// Get Users Information
|
230 |
+
foreach($users_browse as $user_browse) {
|
231 |
+
switch($user_browse->type) {
|
232 |
+
case 'member':
|
233 |
+
$members[] = stripslashes($user_browse->displayname);
|
234 |
+
$total_members++;
|
235 |
+
break;
|
236 |
+
case 'guest':
|
237 |
+
$guests[] = stripslashes($user_browse->displayname);
|
238 |
+
$total_guests++;
|
239 |
+
break;
|
240 |
+
case 'bot':
|
241 |
+
$bots[] = stripslashes($user_browse->displayname);
|
242 |
+
$total_bots++;
|
243 |
+
break;
|
244 |
+
}
|
245 |
+
}
|
246 |
+
$total_users = ($total_guests+$total_bots+$total_members);
|
247 |
+
|
248 |
+
// If We Do Not Display It, Return Respective Users Count
|
249 |
+
if(!$display) {
|
250 |
+
return array ($total_users, $total_members, $total_guests, $total_bots);
|
251 |
+
}
|
252 |
+
|
253 |
+
// Nice Text For Guests
|
254 |
+
if($total_guests == 1) {
|
255 |
+
$nicetext_guests = $total_guests.' '.__('Guest', 'wp-useronline');
|
256 |
+
} else {
|
257 |
+
$nicetext_guests = number_format($total_guests).' '.__('Guests', 'wp-useronline');
|
258 |
+
}
|
259 |
+
// Nice Text For Bots
|
260 |
+
if($total_bots == 1) {
|
261 |
+
$nicetext_bots = $total_bots.' '.__('Bot', 'wp-useronline');
|
262 |
+
} else {
|
263 |
+
$nicetext_bots = number_format($total_bots).' '.__('Bots', 'wp-useronline');
|
264 |
+
}
|
265 |
+
|
266 |
+
// Print Member Name
|
267 |
+
if($members) {
|
268 |
+
$temp_member = '';
|
269 |
+
foreach($members as $member) {
|
270 |
+
$temp_member .= '<a href="'.useronline_stats_page_link(urlencode($member)).'">'.$member.'</a>, ';
|
271 |
+
}
|
272 |
+
if(!function_exists('get_totalposts')) {
|
273 |
+
$temp_member = strip_tags($temp_member);
|
274 |
+
}
|
275 |
+
}
|
276 |
+
// Print Guests
|
277 |
+
if($total_guests > 0) {
|
278 |
+
$temp_member .= $nicetext_guests.', ';
|
279 |
+
}
|
280 |
+
// Print Bots
|
281 |
+
if($total_bots > 0) {
|
282 |
+
$temp_member .= $nicetext_bots.', ';
|
283 |
+
}
|
284 |
+
// Print User Count
|
285 |
+
$temp_member = substr($temp_member, 0, -2);
|
286 |
+
echo __('Users', 'wp-useronline').': <strong>'.$temp_member.'</strong><br />';
|
287 |
+
} else {
|
288 |
+
// This Should Not Happen
|
289 |
+
_e('No User Is Browsing This Site', 'wp-useronline');
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
|
294 |
+
### Function: Display Users Browsing The Page
|
295 |
+
function get_users_browsing_page($display = true) {
|
296 |
+
global $wpdb;
|
297 |
+
|
298 |
+
// Get Users Browsing Page
|
299 |
+
$page_url = addslashes(urlencode($_SERVER['REQUEST_URI']));
|
300 |
+
$users_browse = $wpdb->get_results("SELECT displayname, type FROM $wpdb->useronline WHERE url = '$page_url' ORDER BY type");
|
301 |
+
|
302 |
+
// Variables
|
303 |
+
$members = array();
|
304 |
+
$guests = array();
|
305 |
+
$bots = array();
|
306 |
+
$total_users = 0;
|
307 |
+
$total_members = 0;
|
308 |
+
$total_guests = 0;
|
309 |
+
$total_bots = 0;
|
310 |
+
$nicetext_members = '';
|
311 |
+
$nicetext_guests = '';
|
312 |
+
$nicetext_bots = '';
|
313 |
+
|
314 |
+
// If There Is Users Browsing, Then We Execute
|
315 |
+
if($users_browse) {
|
316 |
+
// Reassign Bots Name
|
317 |
+
$bots = get_option('useronline_bots');
|
318 |
+
$bots_name = array();
|
319 |
+
foreach($bots as $botname => $botlookfor) {
|
320 |
+
$bots_name[] = $botname;
|
321 |
+
}
|
322 |
+
// Get Users Information
|
323 |
+
foreach($users_browse as $user_browse) {
|
324 |
+
switch($user_browse->type) {
|
325 |
+
case 'member':
|
326 |
+
$members[] = stripslashes($user_browse->displayname);
|
327 |
+
$total_members++;
|
328 |
+
break;
|
329 |
+
case 'guest':
|
330 |
+
$guests[] = stripslashes($user_browse->displayname);
|
331 |
+
$total_guests++;
|
332 |
+
break;
|
333 |
+
case 'bot':
|
334 |
+
$bots[] = stripslashes($user_browse->displayname);
|
335 |
+
$total_bots++;
|
336 |
+
break;
|
337 |
+
}
|
338 |
+
}
|
339 |
+
$total_users = ($total_guests+$total_bots+$total_members);
|
340 |
+
|
341 |
+
// If We Do Not Display It, Return Respective Users Count
|
342 |
+
if(!$display) {
|
343 |
+
return array ($total_users, $total_members, $total_guests, $total_bots);
|
344 |
+
}
|
345 |
+
|
346 |
+
// Nice Text For Members
|
347 |
+
if($total_members == 1) {
|
348 |
+
$nicetext_members = $total_members.' '.__('Member', 'wp-useronline');
|
349 |
+
} else {
|
350 |
+
$nicetext_members = number_format($total_members).' '.__('Members', 'wp-useronline');
|
351 |
+
}
|
352 |
+
// Nice Text For Guests
|
353 |
+
if($total_guests == 1) {
|
354 |
+
$nicetext_guests = $total_guests.' '.__('Guest', 'wp-useronline');
|
355 |
+
} else {
|
356 |
+
$nicetext_guests = number_format($total_guests).' '.__('Guests', 'wp-useronline');
|
357 |
+
}
|
358 |
+
// Nice Text For Bots
|
359 |
+
if($total_bots == 1) {
|
360 |
+
$nicetext_bots = $total_bots.' '.__('Bot', 'wp-useronline');
|
361 |
+
} else {
|
362 |
+
$nicetext_bots = number_format($total_bots).' '.__('Bots', 'wp-useronline');
|
363 |
+
}
|
364 |
+
|
365 |
+
// Print User Count
|
366 |
+
echo __('Users Browsing This Page', 'wp-useronline').': <strong>'.number_format($total_users).'</strong> ('.$nicetext_members.', '.$nicetext_guests.' '.__('and', 'wp-useronline').' '.$nicetext_bots.')<br />';
|
367 |
+
|
368 |
+
// Print Member Name
|
369 |
+
if($members) {
|
370 |
+
$temp_member = '';
|
371 |
+
foreach($members as $member) {
|
372 |
+
$temp_member .= '<a href="'.useronline_stats_page_link(urlencode($member)).'">'.$member.'</a>, ';
|
373 |
+
}
|
374 |
+
if(!function_exists('get_totalposts')) {
|
375 |
+
$temp_member = strip_tags($temp_member);
|
376 |
+
}
|
377 |
+
echo __('Members', 'wp-useronline').': '.substr($temp_member, 0, -2);
|
378 |
+
}
|
379 |
+
} else {
|
380 |
+
// This Should Not Happen
|
381 |
+
_e('No User Is Browsing This Page', 'wp-useronline');
|
382 |
+
}
|
383 |
+
}
|
384 |
+
|
385 |
+
|
386 |
+
### Function: Get IP Address
|
387 |
+
if(!function_exists('get_ipaddress')) {
|
388 |
+
function get_ipaddress() {
|
389 |
+
if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
|
390 |
+
$ip_address = $_SERVER["REMOTE_ADDR"];
|
391 |
+
} else {
|
392 |
+
$ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
|
393 |
+
}
|
394 |
+
if(strpos($ip_address, ',') !== false) {
|
395 |
+
$ip_address = explode(',', $ip_address);
|
396 |
+
$ip_address = $ip_address[0];
|
397 |
+
}
|
398 |
+
return $ip_address;
|
399 |
+
}
|
400 |
+
}
|
401 |
+
|
402 |
+
|
403 |
+
### Function: Check IP
|
404 |
+
function check_ip($ip) {
|
405 |
+
$current_user = wp_get_current_user();
|
406 |
+
$user_level = intval($current_user->wp_user_level);
|
407 |
+
$ip2long = ip2long($ip);
|
408 |
+
if($user_level == 10 && ($ip != 'unknown') && $ip == long2ip($ip2long) && $ip2long !== false) {
|
409 |
+
return "(<a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=$ip\" target=\"_blank\" title=\"".gethostbyaddr($ip)."\">$ip</a>)";
|
410 |
+
}
|
411 |
+
}
|
412 |
+
|
413 |
+
|
414 |
+
### Function Check If User Is Online
|
415 |
+
function is_online($user_login) {
|
416 |
+
global $wpdb;
|
417 |
+
$is_online = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->useronline WHERE username = '$user_login' LIMIT 1");
|
418 |
+
return intval($is_online);
|
419 |
+
}
|
420 |
+
|
421 |
+
|
422 |
+
### Function: Output User's Country Flag/Name
|
423 |
+
function ip2nation_country($ip, $display_countryname = 0) {
|
424 |
+
if(function_exists('wp_ozh_ip2nation')) {
|
425 |
+
$country_code = wp_ozh_getCountryCode(0, $ip);
|
426 |
+
$country_name = wp_ozh_getCountryName(0, $ip);
|
427 |
+
$country_mirror = '';
|
428 |
+
$mirrors = array("http://frenchfragfactory.net/images", "http://www.lesterchan.net/wordpress/images/flags");
|
429 |
+
if($country_name != 'Private') {
|
430 |
+
foreach($mirrors as $mirror) {
|
431 |
+
if(file($mirror.'/flag_sg.gif')) {
|
432 |
+
$country_mirror = $mirror;
|
433 |
+
break;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
$temp = '<img src="'.$mirror.'/flag_'.$country_code.'.gif" alt="'.$country_name.'" />';
|
437 |
+
if($display_countryname) {
|
438 |
+
$temp .= $country_name;
|
439 |
+
}
|
440 |
+
return $temp.' ';
|
441 |
+
} else {
|
442 |
+
return;
|
443 |
+
}
|
444 |
+
}
|
445 |
+
return;
|
446 |
+
}
|
447 |
+
|
448 |
+
|
449 |
+
### Function: Display UserOnline For Admin
|
450 |
+
function display_useronline() {
|
451 |
+
$useronline_page = useronline_page();
|
452 |
+
echo "<div class=\"wrap\">\n$useronline_page</div>\n";
|
453 |
+
}
|
454 |
+
|
455 |
+
|
456 |
+
### Function: Place Polls Archive In Content
|
457 |
+
add_filter('the_content', 'place_useronlinepage', '7');
|
458 |
+
function place_useronlinepage($content){
|
459 |
+
$content = preg_replace( "/\[page_useronline\]/ise", "useronline_page()", $content);
|
460 |
+
return $content;
|
461 |
+
}
|
462 |
+
|
463 |
+
|
464 |
+
### Function: UserOnline Page
|
465 |
+
function useronline_page() {
|
466 |
+
global $wpdb;
|
467 |
+
// Get The Users Online
|
468 |
+
$usersonline = $wpdb->get_results("SELECT * FROM $wpdb->useronline ORDER BY type");
|
469 |
+
|
470 |
+
// Variables Variables Variables
|
471 |
+
$useronline_output = '';
|
472 |
+
$members = array();
|
473 |
+
$guests = array();
|
474 |
+
$bots = array();
|
475 |
+
$total_users = 0;
|
476 |
+
$total_members = 0;
|
477 |
+
$total_guests = 0;
|
478 |
+
$total_bots = 0;
|
479 |
+
$nicetext_users = '';
|
480 |
+
$nicetext_members = '';
|
481 |
+
$nicetext_guests = '';
|
482 |
+
$nicetext_bots = '';
|
483 |
+
$url_front = 'http://'.$_SERVER['SERVER_NAME'];
|
484 |
+
|
485 |
+
// Process Those User Who Is Online
|
486 |
+
if($usersonline) {
|
487 |
+
foreach($usersonline as $useronline) {
|
488 |
+
switch($useronline->type) {
|
489 |
+
case 'member':
|
490 |
+
$members[] = array('timestamp' => $useronline->timestamp, 'user_id' => $useronline->userid, 'user_name' => stripslashes($useronline->username), 'display_name' => stripslashes($useronline->displayname), 'user_agent' => stripslashes($useronline->useragent), 'ip' => $useronline->ip, 'location' => stripslashes($useronline->location), 'url' => $url_front.stripslashes(urldecode($useronline->url)));
|
491 |
+
$total_members++;
|
492 |
+
break;
|
493 |
+
case 'guest':
|
494 |
+
$guests[] = array('timestamp' => $useronline->timestamp, 'user_id' => $useronline->userid, 'user_name' => stripslashes($useronline->username), 'display_name' => stripslashes($useronline->displayname), 'user_agent' => stripslashes($useronline->useragent), 'ip' => $useronline->ip, 'location' => stripslashes($useronline->location), 'url' => $url_front.stripslashes(urldecode($useronline->url)));
|
495 |
+
$total_guests++;
|
496 |
+
break;
|
497 |
+
case 'bot':
|
498 |
+
$bots[] = array('timestamp' => $useronline->timestamp, 'user_id' => $useronline->userid, 'user_name' => stripslashes($useronline->username), 'display_name' => stripslashes($useronline->displayname), 'user_agent' => stripslashes($useronline->useragent), 'ip' => $useronline->ip, 'location' => stripslashes($useronline->location), 'url' => $url_front.stripslashes(urldecode($useronline->url)));
|
499 |
+
$total_bots++;
|
500 |
+
break;
|
501 |
+
}
|
502 |
+
}
|
503 |
+
$total_users = ($total_guests+$total_bots+$total_members);
|
504 |
+
}
|
505 |
+
|
506 |
+
// Nice Text For Users
|
507 |
+
if($total_users == 1) {
|
508 |
+
$nicetext_users = $total_users.' '.__('User', 'wp-useronline');
|
509 |
+
} else {
|
510 |
+
$nicetext_users = number_format($total_users).' '.__('Users', 'wp-useronline');
|
511 |
+
}
|
512 |
+
|
513 |
+
// Nice Text For Members
|
514 |
+
if($total_members == 1) {
|
515 |
+
$nicetext_members = $total_members.' '.__('Member', 'wp-useronline');
|
516 |
+
} else {
|
517 |
+
$nicetext_members = number_format($total_members).' '.__('Members', 'wp-useronline');
|
518 |
+
}
|
519 |
+
|
520 |
+
|
521 |
+
// Nice Text For Guests
|
522 |
+
if($total_guests == 1) {
|
523 |
+
$nicetext_guests = $total_guests.' '.__('Guest', 'wp-useronline');
|
524 |
+
} else {
|
525 |
+
$nicetext_guests = number_format($total_guests).' '.__('Guests', 'wp-useronline');
|
526 |
+
}
|
527 |
+
|
528 |
+
// Nice Text For Bots
|
529 |
+
if($total_bots == 1) {
|
530 |
+
$nicetext_bots = $total_bots.' '.__('Bot', 'wp-useronline');
|
531 |
+
} else {
|
532 |
+
$nicetext_bots = number_format($total_bots).' '.__('Bots', 'wp-useronline');
|
533 |
+
}
|
534 |
+
|
535 |
+
// Check Whether WP-Stats Is Activated
|
536 |
+
$wp_stats = false;
|
537 |
+
if(function_exists('get_totalposts')) {
|
538 |
+
$wp_stats = true;
|
539 |
+
}
|
540 |
+
$useronline_output .= '<p>';
|
541 |
+
if ($total_users == 1) {
|
542 |
+
$useronline_output .= __('There is', 'wp-useronline').' ';
|
543 |
+
} else {
|
544 |
+
$useronline_output .= __('There are a total of', 'wp-useronline').' ';
|
545 |
+
}
|
546 |
+
$useronline_output .= "<strong>$nicetext_users</strong> ".__('online now', 'wp-useronline').": <strong>$nicetext_members</strong>, <strong>$nicetext_guests</strong> ".__('and', 'wp-useronline')." <strong>$nicetext_bots</strong>.</p>\n";
|
547 |
+
$useronline_output .= '<p>'.__('Most users ever online were', 'wp-useronline')." <strong>".get_most_useronline(false)."</strong>, ".__('on', 'wp-useronline')." <strong>".get_most_useronline_date(false)."</strong></p>\n";
|
548 |
+
// Print Out Members
|
549 |
+
if($total_members > 0) {
|
550 |
+
$useronline_output .= '<h2>'.$nicetext_members.' '.__('Online Now', 'wp-useronline').'</h2>'."\n";
|
551 |
+
}
|
552 |
+
$no=1;
|
553 |
+
if($members) {
|
554 |
+
foreach($members as $member) {
|
555 |
+
if($wp_stats) {
|
556 |
+
$useronline_output .= '<p><strong>#'.$no.' - <a href="'.useronline_stats_page_link($member['display_name']).'">'.$member['display_name'].'</a></strong> '.ip2nation_country($member['ip']).check_ip($member['ip']).' '.__('on', 'wp-useronline').' '.gmdate('d.m.Y @ H:i', $member['timestamp']).'<br />'.$member['location'].' [<a href="'.$member['url'].'">'.__('url', 'wp-useronline').'</a>]</p>'."\n";
|
557 |
+
} else {
|
558 |
+
$useronline_output .= '<p><strong>#'.$no.' - '.$member['user_name'].'</strong> '.ip2nation_country($member['ip']).check_ip($member['ip']).' '.__('on', 'wp-useronline').' '.gmdate('d.m.Y @ H:i', $member['timestamp']).'<br />'.$member['location'].' [<a href="'.$member['url'].'">'.__('url', 'wp-useronline').'</a>]</p>'."\n";
|
559 |
+
}
|
560 |
+
$no++;
|
561 |
+
}
|
562 |
+
}
|
563 |
+
|
564 |
+
// Print Out Guest
|
565 |
+
if($total_guests > 0) {
|
566 |
+
$useronline_output .= '<h2>'.$nicetext_guests.' '.__('Online Now', 'wp-useronline').'</h2>'."\n";
|
567 |
+
}
|
568 |
+
$no=1;
|
569 |
+
if($guests) {
|
570 |
+
foreach($guests as $guest) {
|
571 |
+
if($wp_stats) {
|
572 |
+
$useronline_output .= '<p><strong>#'.$no.' - <a href="'.useronline_stats_page_link($guest['display_name']).'">'.$guest['display_name'].'</a></strong> '.ip2nation_country($guest['ip']).check_ip($guest['ip']).' '.__('on', 'wp-useronline').' '.gmdate('d.m.Y @ H:i', $guest['timestamp']).'<br />'.$guest['location'].' [<a href="'.$guest['url'].'">'.__('url', 'wp-useronline').'</a>]</p>'."\n";
|
573 |
+
} else {
|
574 |
+
$useronline_output .= '<p><strong>#'.$no.' - '.$guest['user_name'].'</strong> '.ip2nation_country($guest['ip']).check_ip($guest['ip']).' '.__('on', 'wp-useronline').' '.gmdate('d.m.Y @ H:i', $guest['timestamp']).'<br />'.$guest['location'].' [<a href="'.$guest['url'].'">'.__('url', 'wp-useronline').'</a>]</p>'."\n";
|
575 |
+
}
|
576 |
+
$no++;
|
577 |
+
}
|
578 |
+
}
|
579 |
+
|
580 |
+
// Print Out Bots
|
581 |
+
if($total_bots > 0) {
|
582 |
+
$useronline_output .= '<h2>'.$nicetext_bots.' '.__('Online Now', 'wp-useronline').'</h2>'."\n";
|
583 |
+
}
|
584 |
+
$no=1;
|
585 |
+
if($bots) {
|
586 |
+
foreach($bots as $bot) {
|
587 |
+
$useronline_output .= '<p><strong>#'.$no.' - '.$bot['display_name'].'</strong> '.check_ip($bot['ip']).' '.__('on', 'wp-useronline').' '.gmdate('d.m.Y @ H:i', $bot['timestamp']).'<br />'.$bot['location'].' [<a href="'.$bot['url'].'">'.__('url', 'wp-useronline').'</a>]</p>'."\n";
|
588 |
+
$no++;
|
589 |
+
}
|
590 |
+
}
|
591 |
+
|
592 |
+
// Print Out No One Is Online Now
|
593 |
+
if($total_users == 0) {
|
594 |
+
$useronline_output .= '<h2>'.__('No One Is Online Now', 'wp-useronline').'</h2>'."\n";
|
595 |
+
}
|
596 |
+
|
597 |
+
// Output UserOnline Page
|
598 |
+
return $useronline_output;
|
599 |
+
}
|
600 |
+
|
601 |
+
|
602 |
+
### Function: Stats Page Link
|
603 |
+
function useronline_stats_page_link($author) {
|
604 |
+
$stats_url = get_option('stats_url');
|
605 |
+
if(strpos($stats_url, '?') !== false) {
|
606 |
+
$stats_url = "$stats_url&stats_author=$author";
|
607 |
+
} else {
|
608 |
+
$stats_url = "$stats_url?stats_author=$author";
|
609 |
+
}
|
610 |
+
return $stats_url;
|
611 |
+
}
|
612 |
+
|
613 |
+
|
614 |
+
### Function: Process AJAX Request
|
615 |
+
useronline_ajax();
|
616 |
+
function useronline_ajax() {
|
617 |
+
global $wpdb, $useronline;
|
618 |
+
$mode = trim($_GET['useronline_mode']);
|
619 |
+
if(!empty($mode)) {
|
620 |
+
header('Content-Type: text/html; charset='.get_option('blog_charset'));
|
621 |
+
switch($mode) {
|
622 |
+
case 'useronline_count':
|
623 |
+
$useronline = intval($wpdb->get_var("SELECT COUNT(*) FROM $wpdb->useronline"));
|
624 |
+
get_useronline();
|
625 |
+
break;
|
626 |
+
case 'useronline_browsingsite':
|
627 |
+
get_users_browsing_site();
|
628 |
+
break;
|
629 |
+
case 'useronline_browsingpage':
|
630 |
+
get_users_browsing_page();
|
631 |
+
break;
|
632 |
+
}
|
633 |
+
exit();
|
634 |
+
}
|
635 |
+
}
|
636 |
+
|
637 |
+
|
638 |
+
### Function: Create UserOnline Table
|
639 |
+
add_action('activate_useronline/useronline.php', 'create_useronline_table');
|
640 |
+
function create_useronline_table() {
|
641 |
+
global $wpdb;
|
642 |
+
$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' => 'pubsub', 'Syndic8' => 'syndic8', 'RadioUserland' => 'userland', 'Gigabot' => 'gigabot', 'Become.com' => 'become.com');
|
643 |
+
include_once(ABSPATH.'/wp-admin/upgrade-functions.php');
|
644 |
+
// Drop UserOnline Table
|
645 |
+
$wpdb->query("DROP TABLE IF EXISTS $wpdb->useronline");
|
646 |
+
// Create UserOnline Table
|
647 |
+
$create_table = "CREATE TABLE $wpdb->useronline (".
|
648 |
+
" timestamp int(15) NOT NULL default '0',".
|
649 |
+
" userid int(10) NOT NULL default '0',".
|
650 |
+
" username varchar(50) NOT NULL default '',".
|
651 |
+
" displayname varchar(255) NOT NULL default '',".
|
652 |
+
" useragent varchar(255) NOT NULL default '',".
|
653 |
+
" ip varchar(40) NOT NULL default '',".
|
654 |
+
" location varchar(255) NOT NULL default '',".
|
655 |
+
" url varchar(255) NOT NULL default '',".
|
656 |
+
" type enum('member','guest','bot') NOT NULL default 'guest',".
|
657 |
+
" UNIQUE KEY useronline_id (timestamp,username,ip,useragent)) ENGINE=MyISAM;";
|
658 |
+
maybe_create_table($wpdb->useronline, $create_table);
|
659 |
+
// Add In Options
|
660 |
+
add_option('useronline_most_users', 1, 'Most Users Ever Online Count');
|
661 |
+
add_option('useronline_most_timestamp', current_time('timestamp'), 'Most Users Ever Online Date');
|
662 |
+
add_option('useronline_timeout', 300, 'Timeout In Seconds');
|
663 |
+
add_option('useronline_bots', $bots, 'Bots Name/Useragent');
|
664 |
+
// Database Upgrade For WP-UserOnline 2.05
|
665 |
+
add_option('useronline_url', get_option('siteurl').'/useronline/', 'UserOnline Page URL');
|
666 |
+
}
|
667 |
+
?>
|
useronline/wp-useronline.pot
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WP-UserOnline 2.10\n"
|
4 |
+
"POT-Creation-Date: \n"
|
5 |
+
"PO-Revision-Date: 2007-01-27 15:08+0800\n"
|
6 |
+
"Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n"
|
7 |
+
"Language-Team: Lester Chan <gamerz84@hotmail.com>\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Poedit-Country: SINGAPORE\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
13 |
+
"X-Poedit-Basepath: .\n"
|
14 |
+
"X-Poedit-Language: English\n"
|
15 |
+
"X-Poedit-SearchPath-0: .\n"
|
16 |
+
|
17 |
+
#: useronline-options.php:42
|
18 |
+
msgid "Useronline Timeout"
|
19 |
+
msgstr ""
|
20 |
+
|
21 |
+
#: useronline-options.php:43
|
22 |
+
msgid "Useronline Bots"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: useronline-options.php:44
|
26 |
+
msgid "Useronline URL"
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: useronline-options.php:49
|
30 |
+
msgid "Updated"
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: useronline-options.php:54
|
34 |
+
msgid "No Useronline Option Updated"
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: useronline-options.php:71
|
38 |
+
#: useronline-options.php:74
|
39 |
+
msgid "Useronline Options"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: useronline-options.php:77
|
43 |
+
msgid "Time Out"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: useronline-options.php:79
|
47 |
+
msgid "How long till it will remove the user from the database (In seconds)."
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: useronline-options.php:83
|
51 |
+
msgid "UserOnline URL"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: useronline-options.php:85
|
55 |
+
msgid "URL To UserOnline Page<br />Example: http://www.yoursite.com/blogs/useronline/<br />Example: http://www.yoursite.com/blogs/?page_id=2"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: useronline-options.php:89
|
59 |
+
msgid "Bots Name/User Agent"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: useronline-options.php:91
|
63 |
+
msgid "Here are a list of bots and their partial browser agents.<br />On the left column will be the <strong>Bot's Name</strong> and on the right column will be their <strong>Partial Browser Agent</strong>.<br />Start each entry on a new line."
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
#: useronline-options.php:100
|
67 |
+
msgid "Update Options"
|
68 |
+
msgstr ""
|
69 |
+
|
70 |
+
#: useronline-options.php:100
|
71 |
+
msgid "Cancel"
|
72 |
+
msgstr ""
|
73 |
+
|
74 |
+
#: useronline-widget.php:62
|
75 |
+
msgid "UserOnline"
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
#: useronline-widget.php:69
|
79 |
+
msgid "Widget Title"
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
#: useronline-widget.php:70
|
83 |
+
msgid "Display Users Browsing Site Under Users Online Count?"
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: useronline-widget.php:73
|
87 |
+
msgid "Yes"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: useronline-widget.php:75
|
91 |
+
msgid "No"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: useronline.php:49
|
95 |
+
msgid "WP-UserOnline"
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: useronline.php:52
|
99 |
+
msgid "Useronline"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: useronline.php:108
|
103 |
+
msgid "guest"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: useronline.php:114
|
107 |
+
#: useronline.php:255
|
108 |
+
#: useronline.php:354
|
109 |
+
#: useronline.php:523
|
110 |
+
msgid "Guest"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: useronline.php:129
|
114 |
+
msgid "Blog Archive"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: useronline.php:160
|
118 |
+
#: useronline.php:508
|
119 |
+
msgid "User"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: useronline.php:163
|
123 |
+
#: useronline.php:286
|
124 |
+
#: useronline.php:510
|
125 |
+
msgid "Users"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: useronline.php:169
|
129 |
+
#: useronline.php:171
|
130 |
+
msgid "Online"
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
#: useronline.php:257
|
134 |
+
#: useronline.php:356
|
135 |
+
#: useronline.php:525
|
136 |
+
msgid "Guests"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: useronline.php:261
|
140 |
+
#: useronline.php:360
|
141 |
+
#: useronline.php:530
|
142 |
+
msgid "Bot"
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: useronline.php:263
|
146 |
+
#: useronline.php:362
|
147 |
+
#: useronline.php:532
|
148 |
+
msgid "Bots"
|
149 |
+
msgstr ""
|
150 |
+
|
151 |
+
#: useronline.php:289
|
152 |
+
msgid "No User Is Browsing This Site"
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#: useronline.php:348
|
156 |
+
#: useronline.php:515
|
157 |
+
msgid "Member"
|
158 |
+
msgstr ""
|
159 |
+
|
160 |
+
#: useronline.php:350
|
161 |
+
#: useronline.php:377
|
162 |
+
#: useronline.php:517
|
163 |
+
msgid "Members"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: useronline.php:366
|
167 |
+
msgid "Users Browsing This Page"
|
168 |
+
msgstr ""
|
169 |
+
|
170 |
+
#: useronline.php:366
|
171 |
+
#: useronline.php:546
|
172 |
+
msgid "and"
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#: useronline.php:381
|
176 |
+
msgid "No User Is Browsing This Page"
|
177 |
+
msgstr ""
|
178 |
+
|
179 |
+
#: useronline.php:542
|
180 |
+
msgid "There is"
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
#: useronline.php:544
|
184 |
+
msgid "There are a total of"
|
185 |
+
msgstr ""
|
186 |
+
|
187 |
+
#: useronline.php:546
|
188 |
+
msgid "online now"
|
189 |
+
msgstr ""
|
190 |
+
|
191 |
+
#: useronline.php:547
|
192 |
+
msgid "Most users ever online were"
|
193 |
+
msgstr ""
|
194 |
+
|
195 |
+
#: useronline.php:547
|
196 |
+
#: useronline.php:556
|
197 |
+
#: useronline.php:558
|
198 |
+
#: useronline.php:572
|
199 |
+
#: useronline.php:574
|
200 |
+
#: useronline.php:587
|
201 |
+
msgid "on"
|
202 |
+
msgstr ""
|
203 |
+
|
204 |
+
#: useronline.php:550
|
205 |
+
#: useronline.php:566
|
206 |
+
#: useronline.php:582
|
207 |
+
msgid "Online Now"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
#: useronline.php:556
|
211 |
+
#: useronline.php:558
|
212 |
+
#: useronline.php:572
|
213 |
+
#: useronline.php:574
|
214 |
+
#: useronline.php:587
|
215 |
+
msgid "url"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: useronline.php:594
|
219 |
+
msgid "No One Is Online Now"
|
220 |
+
msgstr ""
|
221 |
+
|
wp-useronline.php
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
+----------------------------------------------------------------+
|
4 |
-
| |
|
5 |
-
| WordPress 2.0 Plugin: WP-UserOnline 2.00 |
|
6 |
-
| Copyright (c) 2005 Lester "GaMerZ" Chan |
|
7 |
-
| |
|
8 |
-
| File Written By: |
|
9 |
-
| - Lester "GaMerZ" Chan |
|
10 |
-
| - http://www.lesterchan.net |
|
11 |
-
| |
|
12 |
-
| File Information: |
|
13 |
-
| - Useronline Page |
|
14 |
-
| - wp-useronline.php |
|
15 |
-
| |
|
16 |
-
+----------------------------------------------------------------+
|
17 |
-
*/
|
18 |
-
|
19 |
-
|
20 |
-
### Require WordPress Header
|
21 |
-
require(dirname(__FILE__).'/wp-blog-header.php');
|
22 |
-
|
23 |
-
### Function: UserOnline Page Title
|
24 |
-
add_filter('wp_title', 'useronline_pagetitle');
|
25 |
-
function useronline_pagetitle($useronline_pagetitle) {
|
26 |
-
return $useronline_pagetitle.' » UserOnline';
|
27 |
-
}
|
28 |
-
|
29 |
-
### Search Bots Array
|
30 |
-
$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');
|
31 |
-
|
32 |
-
### Reassign Bots Name
|
33 |
-
$bots_name = array();
|
34 |
-
foreach($bots as $botname => $botlookfor) {
|
35 |
-
$bots_name[] = $botname;
|
36 |
-
}
|
37 |
-
|
38 |
-
### Get The Users Online
|
39 |
-
$usersonline = $wpdb->get_results("SELECT * FROM $wpdb->useronline");
|
40 |
-
|
41 |
-
### Type Of Users Array
|
42 |
-
$bots = array();
|
43 |
-
$guests = array();
|
44 |
-
$members = array();
|
45 |
-
|
46 |
-
### Users Count
|
47 |
-
$total = array();
|
48 |
-
$total['bots'] = 0;
|
49 |
-
$total['guests'] = 0;
|
50 |
-
$total['members'] = 0;
|
51 |
-
|
52 |
-
### Process Those User Who Is Online
|
53 |
-
if($usersonline) {
|
54 |
-
foreach($usersonline as $useronline) {
|
55 |
-
if($useronline->username == 'Guest') {
|
56 |
-
$guests[] = array('username' => stripslashes($useronline->username), 'timestamp' => $useronline->timestamp, 'ip' => $useronline->ip, 'location' => stripslashes($useronline->location), 'url' => stripslashes(urldecode($useronline->url)));
|
57 |
-
$total['guests']++;
|
58 |
-
} elseif(in_array($useronline->username, $bots_name)) {
|
59 |
-
$bots[] = array('username' => stripslashes($useronline->username), 'timestamp' => $useronline->timestamp, 'ip' => $useronline->ip, 'location' => stripslashes($useronline->location), 'url' => stripslashes(urldecode($useronline->url)));
|
60 |
-
$total['bots']++;
|
61 |
-
} else {
|
62 |
-
$members[] = array('username' => stripslashes($useronline->username), 'timestamp' => $useronline->timestamp, 'ip' => $useronline->ip, 'location' => stripslashes($useronline->location), 'url' => stripslashes(urldecode($useronline->url)));
|
63 |
-
$total['members']++;
|
64 |
-
}
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
### Nice Text For Bots, Guest And Members
|
69 |
-
$nicetext = array();
|
70 |
-
if($total['bots'] > 1) { $nicetext['bots'] = __('Bots'); } else { $nicetext['bots'] = __('Bot'); }
|
71 |
-
if($total['guests'] > 1) { $nicetext['guests'] = __('Guests'); } else { $nicetext['guests'] = __('Guest'); }
|
72 |
-
if($total['members'] > 1) { $nicetext['members'] = __('Members'); } else { $nicetext['members'] = __('Member'); }
|
73 |
-
|
74 |
-
### Function: Check IP
|
75 |
-
function check_ip($ip) {
|
76 |
-
if(isset($_COOKIE['wordpressuser_'.COOKIEHASH])) {
|
77 |
-
return "(<a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=$ip\" target=\"_blank\" title=\"".gethostbyaddr($ip)."\">$ip</a>)";
|
78 |
-
}
|
79 |
-
}
|
80 |
-
?>
|
81 |
-
<?php get_header(); ?>
|
82 |
-
<div id="content" class="narrowcolumn">
|
83 |
-
<p><?php _e('There Are A Total Of'); ?> <b><?php echo$total['members'].' '.$nicetext['members']; ?></b>, <b><?php echo$total['guests'].' '.$nicetext['guests']; ?></b> <?php _e('And'); ?> <b><?php echo$total['bots'].' '.$nicetext['bots']; ?></b> <?php _e('Online Now'); ?>.<b></b> </p>
|
84 |
-
<table width="100%" border="0" cellspacing="1" cellpadding="5">
|
85 |
-
<?php
|
86 |
-
if($total['members'] > 0) {
|
87 |
-
echo '<tr><td><h2 class="pagetitle">'.$total['members'].' '.$nicetext['members'].' '.__('Online Now').'</h2></td></tr>'."\n";
|
88 |
-
}
|
89 |
-
?>
|
90 |
-
<?php
|
91 |
-
$no=1;
|
92 |
-
if($members) {
|
93 |
-
foreach($members as $member) {
|
94 |
-
echo '<tr>'."\n";
|
95 |
-
echo '<td><b>#'.$no.' - <a href="wp-stats.php?author='.$member['username'].'">'.$member['username'].'</a></b> '.check_ip($member['ip']).' on '.gmdate('d.m.Y @ H:i', $member['timestamp']).'<br />'.$member['location'].' [<a href="'.$member['url'].'">url</a>]</td>'."\n";
|
96 |
-
echo '</tr>'."\n";
|
97 |
-
$no++;
|
98 |
-
}
|
99 |
-
}
|
100 |
-
// Print Out Guest
|
101 |
-
if($total['guests'] > 0) {
|
102 |
-
echo '<tr><td><h2 class="pagetitle">'.$total['guests'].' '.$nicetext['guests'].' '.__('Online Now').'</h2></td></tr>'."\n";
|
103 |
-
}
|
104 |
-
$no=1;
|
105 |
-
if($guests) {
|
106 |
-
foreach($guests as $guest) {
|
107 |
-
echo '<tr>'."\n";
|
108 |
-
echo '<td><b>#'.$no.' - '.$guest['username'].'</b> '.check_ip($guest['ip']).' on '.gmdate('d.m.Y @ H:i', $guest['timestamp']).'<br />'.$guest['location'].' [<a href="'.$guest['url'].'">url</a>]</td>'."\n";
|
109 |
-
echo '</tr>'."\n";
|
110 |
-
$no++;
|
111 |
-
}
|
112 |
-
}
|
113 |
-
// Print Out Bots
|
114 |
-
if($total['bots'] > 0) {
|
115 |
-
echo '<tr><td><h2 class="pagetitle">'.$total['bots'].' '.$nicetext['bots'].' '.__('Online Now').'</h2></td></tr>'."\n";
|
116 |
-
}
|
117 |
-
$no=1;
|
118 |
-
if($bots) {
|
119 |
-
foreach($bots as $bot) {
|
120 |
-
echo '<tr>'."\n";
|
121 |
-
echo '<td><b>#'.$no.' - '.$bot['username'].'</b> '.check_ip($bot['ip']).' on '.gmdate('d.m.Y @ H:i', $bot['timestamp']).'<br />'.$bot['location'].' [<a href="'.$bot['url'].'">url</a>]</td>'."\n";
|
122 |
-
echo '</tr>'."\n";
|
123 |
-
$no++;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
if($total['members'] == 0 && $total['guests'] == 0 && $total['bots']) {
|
127 |
-
echo '<tr><td><h2 class="pagetitle">'.__('No One Is Online Now').'</h2></td></tr>'."\n";
|
128 |
-
}
|
129 |
-
?>
|
130 |
-
</table>
|
131 |
-
</div>
|
132 |
-
<?php get_sidebar(); ?>
|
133 |
-
<?php get_footer(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|