WP-UserOnline - Version 2.82

Version Description

  • show most recent visitors first
  • fix duplicate entry errors
  • fix ajax requests for SSL
Download this release

Release Info

Developer scribu
Plugin Icon WP-UserOnline
Version 2.82
Comparing to
See all releases

Code changes from version 2.81 to 2.82

core.php CHANGED
@@ -53,7 +53,7 @@ class UserOnline_Core {
53
 
54
  wp_enqueue_script( 'wp-useronline', plugins_url( "useronline$js_dev.js", __FILE__ ), array( 'jquery' ), '2.80', true );
55
  wp_localize_script( 'wp-useronline', 'useronlineL10n', array(
56
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
57
  'timeout' => self::$options->timeout * 1000
58
  ) );
59
 
@@ -69,7 +69,10 @@ class UserOnline_Core {
69
  if ( empty( $page_title ) )
70
  $page_title = self::get_title();
71
 
72
- $referral = strip_tags( @$_SERVER['HTTP_REFERER'] );
 
 
 
73
 
74
  $user_ip = self::get_ip();
75
  $user_agent = $_SERVER['HTTP_USER_AGENT'];
@@ -152,17 +155,18 @@ class UserOnline_Core {
152
  // Insert Users
153
  $data = compact( 'user_type', 'user_id', 'user_name', 'user_ip', 'user_agent', 'page_title', 'page_url', 'referral' );
154
  $data = stripslashes_deep( $data );
155
- $insert_user = $wpdb->insert( $wpdb->useronline, $data );
156
 
157
  // Count Users Online
158
  self::$useronline = intval( $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->useronline" ) );
159
 
160
  // Maybe Update Most User Online
161
- if ( self::$useronline > self::$most->count )
162
  self::$most->update( array(
163
  'count' => self::$useronline,
164
  'date' => current_time( 'timestamp' )
165
  ) );
 
166
  }
167
 
168
  private function clear_table() {
53
 
54
  wp_enqueue_script( 'wp-useronline', plugins_url( "useronline$js_dev.js", __FILE__ ), array( 'jquery' ), '2.80', true );
55
  wp_localize_script( 'wp-useronline', 'useronlineL10n', array(
56
+ 'ajax_url' => admin_url( 'admin-ajax.php', ( is_ssl() ? 'https' : 'http' ) ),
57
  'timeout' => self::$options->timeout * 1000
58
  ) );
59
 
69
  if ( empty( $page_title ) )
70
  $page_title = self::get_title();
71
 
72
+ if ( isset( $_SERVER['HTTP_REFERER'] ) )
73
+ $referral = strip_tags( $_SERVER['HTTP_REFERER'] );
74
+ else
75
+ $referral = '';
76
 
77
  $user_ip = self::get_ip();
78
  $user_agent = $_SERVER['HTTP_USER_AGENT'];
155
  // Insert Users
156
  $data = compact( 'user_type', 'user_id', 'user_name', 'user_ip', 'user_agent', 'page_title', 'page_url', 'referral' );
157
  $data = stripslashes_deep( $data );
158
+ $wpdb->replace( $wpdb->useronline, $data );
159
 
160
  // Count Users Online
161
  self::$useronline = intval( $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->useronline" ) );
162
 
163
  // Maybe Update Most User Online
164
+ if ( self::$useronline > self::$most->count ) {
165
  self::$most->update( array(
166
  'count' => self::$useronline,
167
  'date' => current_time( 'timestamp' )
168
  ) );
169
+ }
170
  }
171
 
172
  private function clear_table() {
lang/wp-useronline-he_IL.mo CHANGED
Binary file
lang/wp-useronline-he_IL.po CHANGED
@@ -9,420 +9,341 @@ msgstr ""
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
 
 
12
  "X-Poedit-Country: SINGAPORE\n"
13
- "X-Poedit-KeywordsList: __;_e\n"
 
14
  "X-Poedit-Basepath: .\n"
15
- "X-Poedit-Language: English\n"
16
  "X-Poedit-SearchPath-0: .\n"
 
17
 
18
- #: useronline-options.php:63
19
- msgid "Useronline Timeout"
20
- msgstr "פסק זמן גולשים און ליין"
21
-
22
- #: useronline-options.php:64
23
- msgid "Useronline Bots"
24
- msgstr "בוטים און ליין"
25
-
26
- #: useronline-options.php:65
27
- msgid "Useronline URL"
28
- msgstr "קישור לגולשים און ליין"
29
-
30
- #: useronline-options.php:66
31
- msgid "Useronline Naming Conventions"
32
- msgstr "ועידת שמות גולשים און ליין"
33
-
34
- #: useronline-options.php:67
35
- msgid "User(s) Online Template"
36
- msgstr "תבנית גולשים און ליין"
37
-
38
- #: useronline-options.php:68
39
- msgid "User(s) Browsing Site Template"
40
- msgstr "תבנית של אתר לגולשים צופים"
41
-
42
- #: useronline-options.php:69
43
- msgid "User(s) Browsing Page Template"
44
- msgstr "תבנית של עמוד לגולשים צופים"
45
-
46
- #: useronline-options.php:74
47
- msgid "Updated"
48
- msgstr "עדכונים"
49
-
50
- #: useronline-options.php:79
51
- msgid "No Useronline Option Updated"
52
- msgstr "לא עודכנו אפשרויות גולשים און ליין"
53
-
54
- #: useronline-options.php:85
55
- #: useronline-options.php:379
56
- msgid "UNINSTALL WP-UserOnline"
57
- msgstr "תבנית של עמוד לגולשים צופים"
58
-
59
- #: useronline-options.php:92
60
- #, php-format
61
- msgid "Table '%s' has been deleted."
62
- msgstr "הטבלה '%s' נמחקה."
63
-
64
- #: useronline-options.php:101
65
- #, php-format
66
- msgid "Setting Key '%s' has been deleted."
67
- msgstr "מפתח האפשרויות '%s' נמחק."
68
-
69
- #: useronline-options.php:105
70
- #, php-format
71
- msgid "Error deleting Setting Key '%s'."
72
- msgstr "טעות במחיקת מפתח האפשרויות '%s'."
73
-
74
- #: useronline-options.php:127
75
- #: useronline-options.php:337
76
- msgid "Uninstall WP-UserOnline"
77
- msgstr "הסר התקנה של וורדספרס גולשים און ליין"
78
-
79
- #: useronline-options.php:128
80
- #, php-format
81
- msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-UserOnline Will Be Deactivated Automatically."
82
- msgstr "<a href=\"%s\">לחץ כאן</a> לסיום ההסרה והפסקה אוטומטית של וורדפרס גולשים און ליין."
83
-
84
- #: useronline-options.php:153
85
- #: wp-useronline.php:917
86
  msgid "Online"
87
- msgstr "און ליין"
88
 
89
- #: useronline-options.php:160
90
- #: wp-useronline.php:916
91
  msgid "1 User"
92
- msgstr "1 גולש"
93
-
94
- #: useronline-options.php:161
95
- #: wp-useronline.php:916
96
- msgid "%USERONLINE_COUNT% Users"
97
- msgstr "%USERONLINE_COUNT% גולשים"
98
 
99
- #: useronline-options.php:162
100
- #: wp-useronline.php:916
101
  msgid "1 Member"
102
- msgstr "1 חבר"
103
-
104
- #: useronline-options.php:163
105
- #: wp-useronline.php:916
106
- msgid "%USERONLINE_COUNT% Members"
107
- msgstr "%USERONLINE_COUNT% חברים"
108
 
109
- #: useronline-options.php:164
110
- #: wp-useronline.php:916
111
  msgid "1 Guest"
112
- msgstr "1 אורח"
113
 
114
- #: useronline-options.php:165
115
- #: wp-useronline.php:916
116
- msgid "%USERONLINE_COUNT% Guests"
117
- msgstr "%USERONLINE_COUNT% אורחים"
118
-
119
- #: useronline-options.php:166
120
- #: wp-useronline.php:916
121
  msgid "1 Bot"
122
- msgstr "1 בוט"
123
-
124
- #: useronline-options.php:167
125
- #: wp-useronline.php:916
126
- msgid "%USERONLINE_COUNT% Bots"
127
- msgstr "%USERONLINE_COUNT% בוטים"
128
-
129
- #: useronline-options.php:173
130
- #: useronline-options.php:179
131
- #: wp-useronline.php:698
132
- #: wp-useronline.php:918
133
- #: wp-useronline.php:919
134
- msgid "Users"
135
- msgstr "גולשים"
136
 
137
- #: useronline-options.php:179
138
- #: wp-useronline.php:919
139
  msgid "Browsing This Page."
140
  msgstr "צופים בדף זה."
141
 
142
- #: useronline-options.php:185
143
- #: useronline-options.php:186
144
- msgid "Useronline Options"
145
- msgstr "אפשרויות גולשים און ליין"
146
-
147
- #: useronline-options.php:189
148
  msgid "Time Out"
149
  msgstr "פסק זמן"
150
 
151
- #: useronline-options.php:191
152
- msgid "How long till it will remove the user from the database (In seconds)."
153
- msgstr "כמה זמן עד שיוסר משתמש ממסד הנתונים (בשניות)"
154
-
155
- #: useronline-options.php:195
156
  msgid "UserOnline URL"
157
- msgstr "קישור לגולשים און ליין"
158
-
159
- #: useronline-options.php:197
160
- msgid "URL To UserOnline Page (leave blank if you do not want to link it to the UserOnline Page)<br />Example: http://www.yoursite.com/blogs/useronline/<br />Example: http://www.yoursite.com/blogs/?page_id=2"
161
- msgstr "כתובת של העמוד גולשים און ליין באתר שלך (תשאיר ריק על מנת לקשר לעמוד וורדפרס גולשים און ליין)<br />דוגמא: http://www.yoursite.com/blogs/useronline/<br />דוגמא: http://www.yoursite.com/blogs/?page_id=2"
162
-
163
- #: useronline-options.php:201
164
- msgid "Bots Name/User Agent"
165
- msgstr "שמות של סוכני בוטים"
166
 
167
- #: useronline-options.php:203
168
- 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."
169
- msgstr "הנה רשימה של בוטים וסוכן דפדפן חלקי <br /> ובטור השמאלי יופיע <strong>שם הבוט</strong> ובטור הימני יופיע<strong> סוכן דפדפן חלקי </strong>.<br />הכנס כל ערך בשורה נפרדת."
170
-
171
- #: useronline-options.php:211
172
  msgid "Naming Conventions:"
173
- msgstr "ועידת שמות:"
174
 
175
- #: useronline-options.php:212
176
- #: useronline-options.php:253
177
- #: useronline-options.php:265
178
- #: useronline-options.php:297
179
  msgid "Allowed Variables:"
180
  msgstr "משתנים מותרים:"
181
 
182
- #: useronline-options.php:214
183
- #: useronline-options.php:258
184
- #: useronline-options.php:273
185
- #: useronline-options.php:305
186
  msgid "Restore Default Template"
187
- msgstr "שחזר תבנית ברירת מחדל"
188
 
189
- #: useronline-options.php:220
 
190
  msgid "Singular Form"
191
  msgstr "טופס יחיד"
192
 
193
- #: useronline-options.php:221
 
194
  msgid "Plural Form"
195
  msgstr "טופס רבים"
196
 
197
- #: useronline-options.php:248
 
198
  msgid "Useronline Templates"
199
- msgstr "תבנית גולשים און ליין"
200
 
201
- #: useronline-options.php:252
 
202
  msgid "User(s) Online:"
203
- msgstr "גולש(ים) און ליין:"
204
 
205
- #: useronline-options.php:264
 
206
  msgid "User(s) Browsing Site:"
207
- msgstr "גולש(ים) צופים באתר און ליין:"
208
 
209
- #: useronline-options.php:279
210
- #: useronline-options.php:311
211
  msgid "Member Names Separator"
212
  msgstr "מפריד שמות חברים"
213
 
214
- #: useronline-options.php:280
215
- #: useronline-options.php:312
216
  msgid "Guests Separator"
217
  msgstr "מפריד אורחים"
218
 
219
- #: useronline-options.php:281
220
- #: useronline-options.php:313
221
  msgid "Bots Separator"
222
  msgstr "מפריד בוטים"
223
 
224
- #: useronline-options.php:296
 
225
  msgid "User(s) Browsing Page:"
226
- msgstr "גולש(ים) צופים בעמוד זה:"
227
 
228
- #: useronline-options.php:328
 
 
 
229
  msgid "Save Changes"
230
  msgstr "שמור שינויים"
231
 
232
- #: useronline-options.php:339
233
- msgid "Deactivating WP-UserOnline plugin does not remove any data that may have been created, such as the useronline options. To completely remove this plugin, you can uninstall it here."
234
- msgstr "הפסקת הפלאג אין גולשים און ליין אינה מסירה את המידע שיצרת, לדוגמא אפשרויות גולשים און ליין. על מנת להסיר לחלוטין את הפלאג אין, אתה יכול להסיר אותו כאן."
235
-
236
- #: useronline-options.php:342
237
- msgid "WARNING:"
238
- msgstr "אזהרה:"
239
-
240
- #: useronline-options.php:343
241
- msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
242
- msgstr "ברגע שהסרת את ההתקנה, לא ניתן לחזור לאחור. עליך להשתמש בפלאג אין גיבוי של וורדפרס על מנת לגבות את המידע לפני"
243
-
244
- #: useronline-options.php:346
245
- msgid "The following WordPress Options/Tables will be DELETED:"
246
- msgstr "האפשרויות והטבלאות הבאות של וורדפרס ימחקו:"
247
-
248
- #: useronline-options.php:351
249
- msgid "WordPress Options"
250
- msgstr "אפשריות וורדפרס"
251
-
252
- #: useronline-options.php:352
253
- msgid "WordPress Tables"
254
- msgstr "טבלאות וורדפרס"
255
-
256
- #: useronline-options.php:378
257
- #: wp-useronline-widget.php:73
258
- msgid "Yes"
259
- msgstr "כן"
260
-
261
- #: useronline-options.php:379
262
- msgid ""
263
- "You Are About To Uninstall WP-UserOnline From WordPress.\\n"
264
- "This Action Is Not Reversible.\\n"
265
- "\\n"
266
- " Choose [Cancel] To Stop, [OK] To Uninstall."
267
- msgstr ""
268
- "אתה עומד להסיר את וורדפרס גולשים און ליין מוורדפרס. \\n"
269
- "פעולה זו בלתי הפיכה.\\n"
270
- "\\n"
271
- " בחר [Cancel] להפסיק, [OK] להסיר."
272
-
273
- #: wp-useronline-widget.php:62
274
  msgid "UserOnline"
275
- msgstr "UserOnline"
276
-
277
- #: wp-useronline-widget.php:69
278
- msgid "Widget Title"
279
- msgstr "כותרת ה Widget "
280
-
281
- #: wp-useronline-widget.php:70
282
- msgid "Display Users Browsing Site Under Users Online Count?"
283
- msgstr "להציג גולשים שצופים באתר תחת מונה גולשים און ליין?"
284
 
285
- #: wp-useronline-widget.php:75
286
- msgid "No"
287
- msgstr "לא"
288
-
289
- #: wp-useronline.php:77
290
- #: wp-useronline.php:848
291
- #: wp-useronline.php:850
292
- #: wp-useronline.php:860
293
  msgid "WP-UserOnline"
294
- msgstr "WP-UserOnline"
295
 
296
- #: wp-useronline.php:80
297
- msgid "Useronline"
298
- msgstr "WP-UserOnline"
299
-
300
- #: wp-useronline.php:145
301
- msgid "guest"
302
- msgstr "אורח"
303
-
304
- #: wp-useronline.php:151
305
- #: wp-useronline.php:711
306
  msgid "Guest"
307
  msgstr "אורח"
308
 
309
- #: wp-useronline.php:166
310
- msgid "Blog Archive"
311
- msgstr "ארכיון הבלוג"
312
-
313
- #: wp-useronline.php:247
314
- #: wp-useronline.php:278
315
- #: wp-useronline.php:746
316
- #: wp-useronline.php:748
317
- #: wp-useronline.php:766
318
- #: wp-useronline.php:768
319
- #: wp-useronline.php:781
320
  #, php-format
 
321
  msgid "%s @ %s"
322
  msgstr "%s @ %s"
323
 
324
- #: wp-useronline.php:411
325
- msgid "No User Is Browsing This Site"
326
- msgstr "אין גולשים שצופים באתר הזה"
327
-
328
- #: wp-useronline.php:549
329
- msgid "No User Is Browsing This Page"
330
- msgstr "אין גולשים שצופים בדף זה"
331
-
332
- #: wp-useronline.php:613
333
  msgid "Users Online Now"
334
- msgstr "גולשים און ליין"
335
-
336
- #: wp-useronline.php:625
337
- #, php-format
338
- msgid "There is <strong><a href=\"%s\">%s user</a></strong> online now."
339
- msgstr "ישנם <strong><a href=\"%s\">%s גולשים</a></strong> און ליין."
340
-
341
- #: wp-useronline.php:627
342
- #, php-format
343
- msgid "There are a total of <strong><a href=\"%s\">%s users</a></strong> online now."
344
- msgstr "סה\"כ <strong><a href=\"%s\">%s גולשים</a></strong> און ליין."
345
 
346
- #: wp-useronline.php:632
347
- #: wp-useronline.php:733
348
  #, php-format
 
349
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
350
- msgstr "הכי הרבה גולשים און ליין <strong>%s</strong>, ב <strong>%s</strong>"
351
 
352
- #: wp-useronline.php:696
353
- msgid "User"
354
- msgstr "גולש"
355
-
356
- #: wp-useronline.php:703
357
- msgid "Member"
358
- msgstr "חבר"
359
-
360
- #: wp-useronline.php:705
361
- msgid "Members"
362
- msgstr "חברים"
363
 
364
- #: wp-useronline.php:713
365
- msgid "Guests"
366
- msgstr "אורחים"
 
367
 
368
- #: wp-useronline.php:718
369
- msgid "Bot"
370
- msgstr "בוט"
 
371
 
372
- #: wp-useronline.php:720
373
- msgid "Bots"
374
- msgstr "בוטים"
 
375
 
376
- #: wp-useronline.php:729
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  #, php-format
 
378
  msgid "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
379
- msgstr "כרגע באתר <strong>%s</strong> און ליין: <strong>%s</strong>, <strong>%s</strong> ו <strong>%s</strong>."
380
-
381
- #: wp-useronline.php:731
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  #, php-format
383
- msgid "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
384
- msgstr "כרגע באתר יש סה''כ <strong>%s</strong> און ליין: <strong>%s</strong>, <strong>%s</strong> ו <strong>%s</strong>."
385
-
386
- #: wp-useronline.php:736
387
- #: wp-useronline.php:756
388
- #: wp-useronline.php:776
389
- msgid "Online Now"
390
- msgstr "און ליין"
391
-
392
- #: wp-useronline.php:743
393
- #: wp-useronline.php:763
394
- msgid "referral"
395
- msgstr "מפנה"
396
 
397
- #: wp-useronline.php:746
398
- #: wp-useronline.php:748
399
- #: wp-useronline.php:766
400
- #: wp-useronline.php:768
401
- #: wp-useronline.php:781
402
- msgid "on"
403
- msgstr "ב"
404
 
405
- #: wp-useronline.php:746
406
- #: wp-useronline.php:748
407
- #: wp-useronline.php:766
408
- #: wp-useronline.php:768
409
- #: wp-useronline.php:781
410
- msgid "url"
411
- msgstr "כתובת"
412
 
413
- #: wp-useronline.php:788
414
- msgid "No One Is Online Now"
415
- msgstr "אין גולשים באתר"
 
 
416
 
417
- #: wp-useronline.php:862
418
- msgid "user(s) online now."
419
- msgstr "גולש(ים) און ליין"
 
 
420
 
421
- #: wp-useronline.php:863
422
- msgid "Most users ever online was"
423
- msgstr "הכי הרבה גולשים און ליין"
 
 
 
 
 
 
424
 
425
- #: wp-useronline.php:864
426
- msgid "On"
427
- msgstr "ב"
 
 
 
428
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-Language: English\n"
14
  "X-Poedit-Country: SINGAPORE\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
  "X-Poedit-Basepath: .\n"
18
+ "X-Poedit-Bookmarks: \n"
19
  "X-Poedit-SearchPath-0: .\n"
20
+ "X-Textdomain-Support: yes"
21
 
22
+ #: wp-useronline.php:72
23
+ #@ wp-useronline
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  msgid "Online"
25
+ msgstr "מקוון"
26
 
27
+ #: wp-useronline.php:61
28
+ #@ wp-useronline
29
  msgid "1 User"
30
+ msgstr "גולש אחד"
 
 
 
 
 
31
 
32
+ #: wp-useronline.php:63
33
+ #@ wp-useronline
34
  msgid "1 Member"
35
+ msgstr "חבר אחד"
 
 
 
 
 
36
 
37
+ #: wp-useronline.php:65
38
+ #@ wp-useronline
39
  msgid "1 Guest"
40
+ msgstr "אורח אחד"
41
 
42
+ #: wp-useronline.php:67
43
+ #@ wp-useronline
 
 
 
 
 
44
  msgid "1 Bot"
45
+ msgstr "בוט אחד"
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
+ #: wp-useronline.php:89
48
+ #@ wp-useronline
49
  msgid "Browsing This Page."
50
  msgstr "צופים בדף זה."
51
 
52
+ #: admin.php:113
53
+ #@ wp-useronline
 
 
 
 
54
  msgid "Time Out"
55
  msgstr "פסק זמן"
56
 
57
+ #: admin.php:121
58
+ #@ wp-useronline
 
 
 
59
  msgid "UserOnline URL"
60
+ msgstr "כתובת URL לגולשים מקוונים"
 
 
 
 
 
 
 
 
61
 
62
+ #: admin.php:186
63
+ #@ wp-useronline
 
 
 
64
  msgid "Naming Conventions:"
65
+ msgstr "מוסכמות שמות:"
66
 
67
+ #: admin.php:187
68
+ #: admin.php:227
69
+ #: admin.php:249
70
+ #@ wp-useronline
71
  msgid "Allowed Variables:"
72
  msgstr "משתנים מותרים:"
73
 
74
+ #: admin.php:232
75
+ #: admin.php:257
76
+ #@ wp-useronline
 
77
  msgid "Restore Default Template"
78
+ msgstr "שחזר את תבנית ברירת המחדל"
79
 
80
+ #: admin.php:195
81
+ #@ wp-useronline
82
  msgid "Singular Form"
83
  msgstr "טופס יחיד"
84
 
85
+ #: admin.php:196
86
+ #@ wp-useronline
87
  msgid "Plural Form"
88
  msgstr "טופס רבים"
89
 
90
+ #: admin.php:150
91
+ #@ wp-useronline
92
  msgid "Useronline Templates"
93
+ msgstr "תבניות גולשים מקוונים"
94
 
95
+ #: admin.php:226
96
+ #@ wp-useronline
97
  msgid "User(s) Online:"
98
+ msgstr "גולשים מקוונים:"
99
 
100
+ #: admin.php:162
101
+ #@ wp-useronline
102
  msgid "User(s) Browsing Site:"
103
+ msgstr "גולשים צופים באתר:"
104
 
105
+ #: admin.php:263
106
+ #@ wp-useronline
107
  msgid "Member Names Separator"
108
  msgstr "מפריד שמות חברים"
109
 
110
+ #: admin.php:264
111
+ #@ wp-useronline
112
  msgid "Guests Separator"
113
  msgstr "מפריד אורחים"
114
 
115
+ #: admin.php:265
116
+ #@ wp-useronline
117
  msgid "Bots Separator"
118
  msgstr "מפריד בוטים"
119
 
120
+ #: admin.php:163
121
+ #@ wp-useronline
122
  msgid "User(s) Browsing Page:"
123
+ msgstr "גולשים צופים בעמוד זה:"
124
 
125
+ #: admin.php:176
126
+ #: scb/AdminPage.php:178
127
+ #: scb/AdminPage.php:189
128
+ #@ wp-useronline
129
  msgid "Save Changes"
130
  msgstr "שמור שינויים"
131
 
132
+ #: admin.php:56
133
+ #: widget.php:6
134
+ #: widget.php:49
135
+ #@ wp-useronline
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  msgid "UserOnline"
137
+ msgstr "משתמש מקוון"
 
 
 
 
 
 
 
 
138
 
139
+ #: admin.php:10
140
+ #: wp-stats.php:14
141
+ #: wp-stats.php:31
142
+ #@ wp-useronline
 
 
 
 
143
  msgid "WP-UserOnline"
144
+ msgstr "תוסף WP-UserOnline"
145
 
146
+ #: core.php:140
147
+ #@ wp-useronline
 
 
 
 
 
 
 
 
148
  msgid "Guest"
149
  msgstr "אורח"
150
 
151
+ #: template-tags.php:247
152
+ #: template-tags.php:249
 
 
 
 
 
 
 
 
 
153
  #, php-format
154
+ #@ wp-useronline
155
  msgid "%s @ %s"
156
  msgstr "%s @ %s"
157
 
158
+ #: admin.php:9
159
+ #@ wp-useronline
 
 
 
 
 
 
 
160
  msgid "Users Online Now"
161
+ msgstr "גולשים מקוונים כעת"
 
 
 
 
 
 
 
 
 
 
162
 
163
+ #: template-tags.php:269
 
164
  #, php-format
165
+ #@ wp-useronline
166
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
167
+ msgstr "הכי הרבה גולשים מקוונים היו <strong>%s</strong>, ב <strong>%s</strong>"
168
 
169
+ #: template-tags.php:205
170
+ #@ wp-useronline
171
+ msgid "Online Now"
172
+ msgstr "מקוונים כעת"
 
 
 
 
 
 
 
173
 
174
+ #: template-tags.php:194
175
+ #@ wp-useronline
176
+ msgid "referral"
177
+ msgstr "הפניה"
178
 
179
+ #: template-tags.php:192
180
+ #@ wp-useronline
181
+ msgid "on"
182
+ msgstr "ב"
183
 
184
+ #: template-tags.php:193
185
+ #@ wp-useronline
186
+ msgid "url"
187
+ msgstr "כתובת URL"
188
 
189
+ #: admin.php:27
190
+ #, php-format
191
+ #@ wp-useronline
192
+ msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
193
+ msgid_plural "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
194
+ msgstr[0] "יש <strong><a href='%s'>%s user</a></strong> מקוונים כעת."
195
+ msgstr[1] "יש בסך הכל <strong><a href='%s'>%s users</a></strong> מקוונים כעת."
196
+
197
+ #: admin.php:55
198
+ #@ wp-useronline
199
+ msgid "UserOnline Options"
200
+ msgstr "אפשרויות גולשש מקוון"
201
+
202
+ #: admin.php:116
203
+ #@ wp-useronline
204
+ msgid "How long until it will remove the user from the database (in seconds)."
205
+ msgstr "כמה זמן עד שהגולש יוסר ממסד הנתונים (בשניות)."
206
+
207
+ #: admin.php:124
208
+ #@ wp-useronline
209
+ msgid "URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br />Example: http://www.yoursite.com/?page_id=2"
210
+ msgstr "כתובת URL לדף UserOnline <br />דוגמה: http://www.yoursite.com/useronline/<br />דוגמה: http://www.yoursite.com/?page_id=2"
211
+
212
+ #: admin.php:128
213
+ #@ wp-useronline
214
+ msgid "User Names"
215
+ msgstr "שמות משתמש"
216
+
217
+ #: admin.php:131
218
+ #@ wp-useronline
219
+ msgid "Link user names to their author page"
220
+ msgstr "קשר שמות משתמשים לדף שמות המחבר שלהם"
221
+
222
+ #: admin.php:189
223
+ #@ wp-useronline
224
+ msgid "Restore Defaults"
225
+ msgstr "שחזר לברירות המחדל"
226
+
227
+ #: core.php:211
228
+ #@ wp-useronline
229
+ msgid "Admin"
230
+ msgstr "ניהול"
231
+
232
+ #: core.php:217
233
+ #@ wp-useronline
234
+ msgid "Archive"
235
+ msgstr "ארכיון"
236
+
237
+ #: scb/AdminPage.php:165
238
+ #@ wp-useronline
239
+ msgid "Settings <strong>saved</strong>."
240
+ msgstr "ההגדרות <strong>נשמרו</strong>."
241
+
242
+ #: scb/AdminPage.php:350
243
+ #@ wp-useronline
244
+ msgid "Settings"
245
+ msgstr "הגדרות"
246
+
247
+ #. gettext fix: identical singular and plural forms found, that may be ambiguous! Please check the code!
248
+ #: template-tags.php:81
249
  #, php-format
250
+ #@ wp-useronline
251
  msgid "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
252
+ msgid_plural "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
253
+ msgstr[0] "יש <strong>%s</strong> מקוונים כעת: <strong>%s</strong>, <strong>%s</strong> ו <strong>%s</strong>."
254
+ msgstr[1] "יש בסך הכל <strong>%s</strong> מקוונים כעת: <strong>%s</strong>, <strong>%s</strong> ו <strong>%s</strong>."
255
+
256
+ #: template-tags.php:190
257
+ #@ wp-useronline
258
+ msgid "No one is online now."
259
+ msgstr "אין אף אחד מקוון כעת."
260
+
261
+ #: widget.php:5
262
+ #@ wp-useronline
263
+ msgid "WP-UserOnline users online statistics"
264
+ msgstr "סטטיסטיקת גולשים מקוונים של תוסף WP-UserOnline"
265
+
266
+ #: widget.php:56
267
+ #@ wp-useronline
268
+ msgid "Title:"
269
+ msgstr "כותרת:"
270
+
271
+ #: widget.php:59
272
+ #@ wp-useronline
273
+ msgid "Statistics Type:"
274
+ msgstr "סוג סטטיסטיקה:"
275
+
276
+ #: widget.php:61
277
+ #@ wp-useronline
278
+ msgid "Users Online Count"
279
+ msgstr "מונה גולשים מקוונים"
280
+
281
+ #: widget.php:62
282
+ #@ wp-useronline
283
+ msgid "Users Browsing Current Page"
284
+ msgstr "גולשים הנמצאים בדף זה"
285
+
286
+ #: widget.php:63
287
+ #@ wp-useronline
288
+ msgid "Users Browsing Site"
289
+ msgstr "גולשים הנמצאים באתר"
290
+
291
+ #: widget.php:65
292
+ #@ wp-useronline
293
+ msgid "Users Online Count & Users Browsing Current Page"
294
+ msgstr "מונה גולשים מקוונים וגם גולשים הנמצאים בדף זה"
295
+
296
+ #: widget.php:66
297
+ #@ wp-useronline
298
+ msgid "Users Online Count & Users Browsing Site"
299
+ msgstr "מונה גולשים מקוונים וגם גולשים באתר"
300
+
301
+ #: wp-stats.php:24
302
  #, php-format
303
+ #@ wp-useronline
304
+ msgid "<strong>%s</strong> user online now."
305
+ msgid_plural "<strong>%s</strong> users online now."
306
+ msgstr[0] "<strong>%s</strong> גולש מקוון כעת."
307
+ msgstr[1] "<strong>%s</strong> גולשים מקוונים כעת."
 
 
 
 
 
 
 
 
308
 
309
+ #: wp-useronline.php:62
310
+ #, php-format
311
+ #@ wp-useronline
312
+ msgid "%COUNT% Users"
313
+ msgstr "%COUNT% משתמשים"
 
 
314
 
315
+ #: wp-useronline.php:64
316
+ #, php-format
317
+ #@ wp-useronline
318
+ msgid "%COUNT% Members"
319
+ msgstr "%COUNT% חברים"
 
 
320
 
321
+ #: wp-useronline.php:66
322
+ #, php-format
323
+ #@ wp-useronline
324
+ msgid "%COUNT% Guests"
325
+ msgstr "%COUNT% אורחים"
326
 
327
+ #: wp-useronline.php:68
328
+ #, php-format
329
+ #@ wp-useronline
330
+ msgid "%COUNT% Bots"
331
+ msgstr "%COUNT% בוטים"
332
 
333
+ #: wp-useronline.php:76
334
+ #: wp-useronline.php:77
335
+ #: wp-useronline.php:78
336
+ #: wp-useronline.php:85
337
+ #: wp-useronline.php:86
338
+ #: wp-useronline.php:87
339
+ #@ wp-useronline
340
+ msgid ","
341
+ msgstr ","
342
 
343
+ #: wp-useronline.php:80
344
+ #: wp-useronline.php:89
345
+ #@ wp-useronline
346
+ msgctxt "Template Element"
347
+ msgid "Users"
348
+ msgstr "גולשים"
349
 
lang/wp-useronline-pt_PT.mo CHANGED
Binary file
lang/wp-useronline-pt_PT.po CHANGED
@@ -4,7 +4,7 @@ msgstr ""
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2008-12-12 01:10+0800\n"
6
  "PO-Revision-Date: \n"
7
- "Last-Translator: Lester Chan <lesterchan@gmail.com>\n"
8
  "Language-Team: BlogTuga <geral@blogtuga.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -18,31 +18,31 @@ msgstr ""
18
 
19
  #: useronline-options.php:63
20
  msgid "Useronline Timeout"
21
- msgstr "Timeout usuário online"
22
 
23
  #: useronline-options.php:64
24
  msgid "Useronline Bots"
25
- msgstr "Bost online"
26
 
27
  #: useronline-options.php:65
28
  msgid "Useronline URL"
29
- msgstr "URL usuário online"
30
 
31
  #: useronline-options.php:66
32
  msgid "Useronline Naming Conventions"
33
- msgstr "Nome das convenções do usuário online"
34
 
35
  #: useronline-options.php:67
36
  msgid "User(s) Online Template"
37
- msgstr "Template Usuário(s) online"
38
 
39
  #: useronline-options.php:68
40
  msgid "User(s) Browsing Site Template"
41
- msgstr "Template dos usuários(s) a navegar no website "
42
 
43
  #: useronline-options.php:69
44
  msgid "User(s) Browsing Page Template"
45
- msgstr "Template dos usuários(s) a navegar na página "
46
 
47
  #: useronline-options.php:74
48
  msgid "Updated"
@@ -60,17 +60,17 @@ msgstr "Desinstalar o plugin WP-UserOnline"
60
  #: useronline-options.php:92
61
  #, php-format
62
  msgid "Table '%s' has been deleted."
63
- msgstr "Tabela '%s' foi apagado."
64
 
65
  #: useronline-options.php:101
66
  #, php-format
67
  msgid "Setting Key '%s' has been deleted."
68
- msgstr "Chave das definições '%s' foi apagada."
69
 
70
  #: useronline-options.php:105
71
  #, php-format
72
  msgid "Error deleting Setting Key '%s'."
73
- msgstr "Erro a apagar chave de definições '%s'."
74
 
75
  #: useronline-options.php:127
76
  #: useronline-options.php:338
@@ -80,7 +80,7 @@ msgstr "Desinstalar o plugin WP-UserOnline"
80
  #: useronline-options.php:128
81
  #, php-format
82
  msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-UserOnline Will Be Deactivated Automatically."
83
- msgstr "<a href=\"%s\">Clique aqui</a> para finalizar a desinstalação e o plugin ser desactivado."
84
 
85
  #: useronline-options.php:153
86
  #: wp-useronline.php:914
@@ -90,12 +90,12 @@ msgstr "Online"
90
  #: useronline-options.php:160
91
  #: wp-useronline.php:913
92
  msgid "1 User"
93
- msgstr "1 Usuário"
94
 
95
  #: useronline-options.php:161
96
  #: wp-useronline.php:913
97
  msgid "%USERONLINE_COUNT% Users"
98
- msgstr "%USERONLINE_COUNT% Usuários"
99
 
100
  #: useronline-options.php:162
101
  #: wp-useronline.php:913
@@ -158,23 +158,23 @@ msgstr "Quanto tempo até se retirar o utilizador da base de dados (segundos)."
158
 
159
  #: useronline-options.php:196
160
  msgid "UserOnline URL"
161
- msgstr "URL dos Usuários Online"
162
 
163
  #: useronline-options.php:198
164
  msgid "URL To UserOnline Page (leave blank if you do not want to link it to the UserOnline Page)<br />Example: http://www.yoursite.com/blogs/useronline/<br />Example: http://www.yoursite.com/blogs/?page_id=2"
165
- msgstr "URL da página dos usuários online (deixe em branco se não quiser ter esta página)<br />Exemplo: http://www.oseusite.com/blogs/useronline/<br />Exemplo: http://www.oseusite.com/blogs/?page_id=2"
166
 
167
  #: useronline-options.php:202
168
  msgid "Bots Name/User Agent"
169
- msgstr "Nome dos bots/Agente do usuário"
170
 
171
  #: useronline-options.php:204
172
  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."
173
- msgstr "Aqui tem uma lista dos bots e dos agentes parciais do browser.<br />Na coluna da esquerda estão os <strong>Nome dos bots</strong> e na coluna da direita estão os seus<strong>Agentes parciais do drowser</strong>.<br />Inicie cada entrada num novo ficheiro."
174
 
175
  #: useronline-options.php:212
176
  msgid "Naming Conventions:"
177
- msgstr "Nome da convenção:"
178
 
179
  #: useronline-options.php:213
180
  #: useronline-options.php:254
@@ -188,46 +188,46 @@ msgstr "Variáveis permitidas:"
188
  #: useronline-options.php:274
189
  #: useronline-options.php:306
190
  msgid "Restore Default Template"
191
- msgstr "Restaurar Template por defeito"
192
 
193
  #: useronline-options.php:221
194
  msgid "Singular Form"
195
- msgstr "Formulário singular"
196
 
197
  #: useronline-options.php:222
198
  msgid "Plural Form"
199
- msgstr "Formulário plural"
200
 
201
  #: useronline-options.php:249
202
  msgid "Useronline Templates"
203
- msgstr "Templates dos usuários online"
204
 
205
  #: useronline-options.php:253
206
  msgid "User(s) Online:"
207
- msgstr "Usuário(s) Online:"
208
 
209
  #: useronline-options.php:265
210
  msgid "User(s) Browsing Site:"
211
- msgstr "Usuário(s) a navegar o website:"
212
 
213
  #: useronline-options.php:280
214
  #: useronline-options.php:312
215
  msgid "Member Names Separator"
216
- msgstr "Separador do nome dos membros"
217
 
218
  #: useronline-options.php:281
219
  #: useronline-options.php:313
220
  msgid "Guests Separator"
221
- msgstr "Separador dos visitantes"
222
 
223
  #: useronline-options.php:282
224
  #: useronline-options.php:314
225
  msgid "Bots Separator"
226
- msgstr "Separador dos bots"
227
 
228
  #: useronline-options.php:297
229
  msgid "User(s) Browsing Page:"
230
- msgstr "Usuário(s) a navegar está página:"
231
 
232
  #: useronline-options.php:329
233
  msgid "Save Changes"
@@ -235,7 +235,7 @@ msgstr "Guardar alterações"
235
 
236
  #: useronline-options.php:340
237
  msgid "Deactivating WP-UserOnline plugin does not remove any data that may have been created, such as the useronline options. To completely remove this plugin, you can uninstall it here."
238
- msgstr "Ao desactivar o plugin WP-UserOnline, não serão removidas quaisquer base de dados, assim como as opções dos usuários online. Para completar a remoção deste plugin, pode desinstala-lo aqui."
239
 
240
  #: useronline-options.php:343
241
  msgid "WARNING:"
@@ -243,11 +243,11 @@ msgstr "AVISO:"
243
 
244
  #: useronline-options.php:344
245
  msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
246
- msgstr "Uma vez desinstalado, isto não pode ser refeito. Pode usar um Backup da Base de Dados do seu Wordpress."
247
 
248
  #: useronline-options.php:347
249
  msgid "The following WordPress Options/Tables will be DELETED:"
250
- msgstr "As seguintes Opções/Tabelas Wordpress serão APAGADAS:"
251
 
252
  #: useronline-options.php:352
253
  msgid "WordPress Options"
@@ -269,14 +269,14 @@ msgid ""
269
  "\\n"
270
  " Choose [Cancel] To Stop, [OK] To Uninstall."
271
  msgstr ""
272
- "Está prestes a desinstalar o plugin WP-UserOnline do seu Wordpress.\\n"
273
  "Está acção não é reversível.\\n"
274
  "\\n"
275
  "Escolha [Cancelar] para Parar, [Ok] para continuar."
276
 
277
  #: wp-useronline-widget.php:62
278
  msgid "UserOnline"
279
- msgstr "Usuários Online"
280
 
281
  #: wp-useronline-widget.php:69
282
  msgid "Widget Title"
@@ -284,7 +284,7 @@ msgstr "Título do Widget"
284
 
285
  #: wp-useronline-widget.php:70
286
  msgid "Display Users Browsing Site Under Users Online Count?"
287
- msgstr "Mostrar usuários a navegar no website por debaixo da contagem dos usuários online?"
288
 
289
  #: wp-useronline-widget.php:75
290
  msgid "No"
@@ -295,11 +295,11 @@ msgstr "Não"
295
  #: wp-useronline.php:846
296
  #: wp-useronline.php:856
297
  msgid "WP-UserOnline"
298
- msgstr "WP-UserOnline"
299
 
300
  #: wp-useronline.php:61
301
  msgid "Useronline"
302
- msgstr "Usuários Online"
303
 
304
  #: wp-useronline.php:126
305
  msgid "guest"
@@ -327,39 +327,39 @@ msgstr "%s @ %s"
327
 
328
  #: wp-useronline.php:396
329
  msgid "No User Is Browsing This Site"
330
- msgstr "Sem usuários a navegar neste website"
331
 
332
  #: wp-useronline.php:538
333
  msgid "No User Is Browsing This Page"
334
- msgstr "Sem usuários a navegar nesta página"
335
 
336
  #: wp-useronline.php:609
337
  msgid "Users Online Now"
338
- msgstr "Usuários online agora"
339
 
340
  #: wp-useronline.php:621
341
  #, php-format
342
  msgid "There is <strong><a href=\"%s\">%s user</a></strong> online now."
343
- msgstr "Estes são os <strong><a href=\"%s\">%s usuários</a></strong> online agora."
344
 
345
  #: wp-useronline.php:623
346
  #, php-format
347
  msgid "There are a total of <strong><a href=\"%s\">%s users</a></strong> online now."
348
- msgstr "Estes são o total de <strong><a href=\"%s\">%s usuários</a></strong> online agora."
349
 
350
  #: wp-useronline.php:628
351
  #: wp-useronline.php:729
352
  #, php-format
353
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
354
- msgstr "Maior número de usuários online de sempre <strong>%s</strong>, em <strong>%s</strong>"
355
 
356
  #: wp-useronline.php:692
357
  msgid "User"
358
- msgstr "Usuário"
359
 
360
  #: wp-useronline.php:694
361
  msgid "Users"
362
- msgstr "Usuários"
363
 
364
  #: wp-useronline.php:699
365
  msgid "Member"
@@ -379,17 +379,17 @@ msgstr "Bot"
379
 
380
  #: wp-useronline.php:716
381
  msgid "Bots"
382
- msgstr "Bost"
383
 
384
  #: wp-useronline.php:725
385
  #, php-format
386
  msgid "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
387
- msgstr "Estão <strong>%s</strong> online agora: <strong>%s</strong>, <strong>%s</strong> e <strong>%s</strong>."
388
 
389
  #: wp-useronline.php:727
390
  #, php-format
391
  msgid "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
392
- msgstr "Estão num total de <strong>%s</strong> online agora: <strong>%s</strong>, <strong>%s</strong> e <strong>%s</strong>."
393
 
394
  #: wp-useronline.php:732
395
  #: wp-useronline.php:752
@@ -420,7 +420,7 @@ msgstr "url"
420
 
421
  #: wp-useronline.php:784
422
  msgid "No One Is Online Now"
423
- msgstr "Ninguém online"
424
 
425
  #: wp-useronline.php:860
426
  msgid "On"
@@ -428,6 +428,6 @@ msgstr "Ligado"
428
 
429
  #~ msgid "user(s) online now."
430
  #~ msgstr "usuário(s) online agora"
 
431
  #~ msgid "Most users ever online was"
432
  #~ msgstr "Maior número de usuários online de sempre foi de"
433
-
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2008-12-12 01:10+0800\n"
6
  "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
  "Language-Team: BlogTuga <geral@blogtuga.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
18
 
19
  #: useronline-options.php:63
20
  msgid "Useronline Timeout"
21
+ msgstr "Timeout utilizador online"
22
 
23
  #: useronline-options.php:64
24
  msgid "Useronline Bots"
25
+ msgstr "Bots Online"
26
 
27
  #: useronline-options.php:65
28
  msgid "Useronline URL"
29
+ msgstr "URL utilizador online"
30
 
31
  #: useronline-options.php:66
32
  msgid "Useronline Naming Conventions"
33
+ msgstr "Nome das convenções de utilizador online"
34
 
35
  #: useronline-options.php:67
36
  msgid "User(s) Online Template"
37
+ msgstr "Template de Utilizador(es) online"
38
 
39
  #: useronline-options.php:68
40
  msgid "User(s) Browsing Site Template"
41
+ msgstr "Template dos Utilizador(es) a navegar no website "
42
 
43
  #: useronline-options.php:69
44
  msgid "User(s) Browsing Page Template"
45
+ msgstr "Template dos Utilizador(es) a navegar na página "
46
 
47
  #: useronline-options.php:74
48
  msgid "Updated"
60
  #: useronline-options.php:92
61
  #, php-format
62
  msgid "Table '%s' has been deleted."
63
+ msgstr "A tabela '%s' foi apagada."
64
 
65
  #: useronline-options.php:101
66
  #, php-format
67
  msgid "Setting Key '%s' has been deleted."
68
+ msgstr "A chave de definições '%s' foi apagada."
69
 
70
  #: useronline-options.php:105
71
  #, php-format
72
  msgid "Error deleting Setting Key '%s'."
73
+ msgstr "Erro a apagar a chave de definições '%s'."
74
 
75
  #: useronline-options.php:127
76
  #: useronline-options.php:338
80
  #: useronline-options.php:128
81
  #, php-format
82
  msgid "<a href=\"%s\">Click Here</a> To Finish The Uninstallation And WP-UserOnline Will Be Deactivated Automatically."
83
+ msgstr "<a href=\"%s\">Clique aqui</a> para desactivar automaticamente e finalizar a remoção do plugin WP-UserOnline."
84
 
85
  #: useronline-options.php:153
86
  #: wp-useronline.php:914
90
  #: useronline-options.php:160
91
  #: wp-useronline.php:913
92
  msgid "1 User"
93
+ msgstr "1 Utilizador"
94
 
95
  #: useronline-options.php:161
96
  #: wp-useronline.php:913
97
  msgid "%USERONLINE_COUNT% Users"
98
+ msgstr "%USERONLINE_COUNT% Utilizadores"
99
 
100
  #: useronline-options.php:162
101
  #: wp-useronline.php:913
158
 
159
  #: useronline-options.php:196
160
  msgid "UserOnline URL"
161
+ msgstr "URL dos Utilizadores Online"
162
 
163
  #: useronline-options.php:198
164
  msgid "URL To UserOnline Page (leave blank if you do not want to link it to the UserOnline Page)<br />Example: http://www.yoursite.com/blogs/useronline/<br />Example: http://www.yoursite.com/blogs/?page_id=2"
165
+ msgstr "URL da página para ver os utilizadores online (deixe em branco se não pretender utilizar esta página)<br />Exemplo: http://www.omeudominio.com/blogs/useronline/<br />Exemplo: http://www.omeudominio.com/blogs/?page_id=2"
166
 
167
  #: useronline-options.php:202
168
  msgid "Bots Name/User Agent"
169
+ msgstr "Nome dos Bots / Agente"
170
 
171
  #: useronline-options.php:204
172
  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."
173
+ msgstr "Abaixo fica uma lista dos bots e dos agentes parciais do browser.<br />Na coluna da esquerda estão os <strong>Nomes dos bots</strong> e na coluna da direita estão os seus<strong>Agentes Parciais do Browser</strong>.<br />Inicie cada entrada num novo ficheiro."
174
 
175
  #: useronline-options.php:212
176
  msgid "Naming Conventions:"
177
+ msgstr "Nome da Convenção:"
178
 
179
  #: useronline-options.php:213
180
  #: useronline-options.php:254
188
  #: useronline-options.php:274
189
  #: useronline-options.php:306
190
  msgid "Restore Default Template"
191
+ msgstr "Restaurar definições de origem"
192
 
193
  #: useronline-options.php:221
194
  msgid "Singular Form"
195
+ msgstr "Formulário Singular"
196
 
197
  #: useronline-options.php:222
198
  msgid "Plural Form"
199
+ msgstr "Formulário Plural"
200
 
201
  #: useronline-options.php:249
202
  msgid "Useronline Templates"
203
+ msgstr "Templates dos utilizadores online"
204
 
205
  #: useronline-options.php:253
206
  msgid "User(s) Online:"
207
+ msgstr "Utilizador(es) Online:"
208
 
209
  #: useronline-options.php:265
210
  msgid "User(s) Browsing Site:"
211
+ msgstr "Utilizador(es) a navegar o website:"
212
 
213
  #: useronline-options.php:280
214
  #: useronline-options.php:312
215
  msgid "Member Names Separator"
216
+ msgstr "Separador de Nomes dos Membros"
217
 
218
  #: useronline-options.php:281
219
  #: useronline-options.php:313
220
  msgid "Guests Separator"
221
+ msgstr "Separador dos Visitantes"
222
 
223
  #: useronline-options.php:282
224
  #: useronline-options.php:314
225
  msgid "Bots Separator"
226
+ msgstr "Separador dos Bots"
227
 
228
  #: useronline-options.php:297
229
  msgid "User(s) Browsing Page:"
230
+ msgstr "Utilizador(es) a navegar está página:"
231
 
232
  #: useronline-options.php:329
233
  msgid "Save Changes"
235
 
236
  #: useronline-options.php:340
237
  msgid "Deactivating WP-UserOnline plugin does not remove any data that may have been created, such as the useronline options. To completely remove this plugin, you can uninstall it here."
238
+ msgstr "Ao desactivar o plugin WP-UserOnline, não serão removidas quaisquer tabelas da base de dados, como por exemplo as opções dos utilizadores online.<br/>Para remover completamente este plugin, terá de desinstala-lo aqui."
239
 
240
  #: useronline-options.php:343
241
  msgid "WARNING:"
243
 
244
  #: useronline-options.php:344
245
  msgid "Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first."
246
+ msgstr "Uma vez desinstalado, não poderá voltar atrás. Por segurança pode optar por fazer um Backup da Base de Dados da sua instalação do Wordpress."
247
 
248
  #: useronline-options.php:347
249
  msgid "The following WordPress Options/Tables will be DELETED:"
250
+ msgstr "As seguintes Opções/Tabelas WordPress serão APAGADAS:"
251
 
252
  #: useronline-options.php:352
253
  msgid "WordPress Options"
269
  "\\n"
270
  " Choose [Cancel] To Stop, [OK] To Uninstall."
271
  msgstr ""
272
+ "Está prestes a desinstalar o plugin WP-UserOnline do seu site Wordpress.\\n"
273
  "Está acção não é reversível.\\n"
274
  "\\n"
275
  "Escolha [Cancelar] para Parar, [Ok] para continuar."
276
 
277
  #: wp-useronline-widget.php:62
278
  msgid "UserOnline"
279
+ msgstr "Utilizadores Online"
280
 
281
  #: wp-useronline-widget.php:69
282
  msgid "Widget Title"
284
 
285
  #: wp-useronline-widget.php:70
286
  msgid "Display Users Browsing Site Under Users Online Count?"
287
+ msgstr "Mostrar estatística de utilizadores online no Painel inicial do WordPress?"
288
 
289
  #: wp-useronline-widget.php:75
290
  msgid "No"
295
  #: wp-useronline.php:846
296
  #: wp-useronline.php:856
297
  msgid "WP-UserOnline"
298
+ msgstr "Utilizadores Online"
299
 
300
  #: wp-useronline.php:61
301
  msgid "Useronline"
302
+ msgstr "Utilizadores Online"
303
 
304
  #: wp-useronline.php:126
305
  msgid "guest"
327
 
328
  #: wp-useronline.php:396
329
  msgid "No User Is Browsing This Site"
330
+ msgstr "Não utilizadores a visitar neste momento"
331
 
332
  #: wp-useronline.php:538
333
  msgid "No User Is Browsing This Page"
334
+ msgstr "Não utilizadores nesta página neste momento."
335
 
336
  #: wp-useronline.php:609
337
  msgid "Users Online Now"
338
+ msgstr "Utilizadores Online"
339
 
340
  #: wp-useronline.php:621
341
  #, php-format
342
  msgid "There is <strong><a href=\"%s\">%s user</a></strong> online now."
343
+ msgstr " <strong><a href=\"%s\">%s utilizador</a></strong> online neste momento."
344
 
345
  #: wp-useronline.php:623
346
  #, php-format
347
  msgid "There are a total of <strong><a href=\"%s\">%s users</a></strong> online now."
348
+ msgstr " <strong><a href=\"%s\">%s utilizadores</a></strong> online neste momento."
349
 
350
  #: wp-useronline.php:628
351
  #: wp-useronline.php:729
352
  #, php-format
353
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
354
+ msgstr "Maior número de utilizadores simultâneos: <strong>%s</strong>, em <strong>%s</strong>"
355
 
356
  #: wp-useronline.php:692
357
  msgid "User"
358
+ msgstr "Utilizador"
359
 
360
  #: wp-useronline.php:694
361
  msgid "Users"
362
+ msgstr "Utilizadores"
363
 
364
  #: wp-useronline.php:699
365
  msgid "Member"
379
 
380
  #: wp-useronline.php:716
381
  msgid "Bots"
382
+ msgstr "Bots"
383
 
384
  #: wp-useronline.php:725
385
  #, php-format
386
  msgid "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
387
+ msgstr " <strong>%s</strong> online agora: <strong>%s</strong>, <strong>%s</strong> e <strong>%s</strong>."
388
 
389
  #: wp-useronline.php:727
390
  #, php-format
391
  msgid "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
392
+ msgstr " <strong>%s</strong> online agora: <strong>%s</strong>, <strong>%s</strong> e <strong>%s</strong>."
393
 
394
  #: wp-useronline.php:732
395
  #: wp-useronline.php:752
420
 
421
  #: wp-useronline.php:784
422
  msgid "No One Is Online Now"
423
+ msgstr "Nenhum Utilizador Online neste momento"
424
 
425
  #: wp-useronline.php:860
426
  msgid "On"
428
 
429
  #~ msgid "user(s) online now."
430
  #~ msgstr "usuário(s) online agora"
431
+
432
  #~ msgid "Most users ever online was"
433
  #~ msgstr "Maior número de usuários online de sempre foi de"
 
lang/wp-useronline-vi_VN.mo ADDED
Binary file
lang/wp-useronline-vi_VN.po ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: WP-UserOnline\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/wpu\n"
7
+ "POT-Creation-Date: 2011-06-02 20:04:14+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2012-04-14 11:54+0700\n"
12
+ "Last-Translator: solitary1510 <solitary1510@gmail.com>\n"
13
+ "Language-Team: DLTVP <solitary1510@gmail.com>\n"
14
+ "Plural-Forms: nplurals=1; plural=0;\n"
15
+ "X-Poedit-Language: Vietnamese\n"
16
+ "X-Poedit-Country: VIET NAM\n"
17
+ "X-Poedit-Basepath: .\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+
20
+ #: widget.php:5
21
+ msgid "WP-UserOnline users online statistics"
22
+ msgstr "Hiển thị thông tin thành viên trực tuyến"
23
+
24
+ #: widget.php:6
25
+ #: widget.php:49
26
+ #: admin.php:56
27
+ msgid "UserOnline"
28
+ msgstr "Thành Viên Trực Tuyến"
29
+
30
+ #: widget.php:56
31
+ msgid "Title:"
32
+ msgstr "Tiêu đề:"
33
+
34
+ #: widget.php:59
35
+ msgid "Statistics Type:"
36
+ msgstr "Kiểu Hiển Thị"
37
+
38
+ #: widget.php:61
39
+ msgid "Users Online Count"
40
+ msgstr "Số người trực tuyến"
41
+
42
+ #: widget.php:62
43
+ msgid "Users Browsing Current Page"
44
+ msgstr "Người đang xem trang hiện tại"
45
+
46
+ #: widget.php:63
47
+ msgid "Users Browsing Site"
48
+ msgstr "Chi tiết người đang trực tuyến"
49
+
50
+ #: widget.php:65
51
+ msgid "Users Online Count & Users Browsing Current Page"
52
+ msgstr "Số người trực tuyến & Người đang xem trang hiện tại"
53
+
54
+ #: widget.php:66
55
+ msgid "Users Online Count & Users Browsing Site"
56
+ msgstr "Số người trực tuyến & Chi tiết người đang trực tuyến"
57
+
58
+ #: admin.php:9
59
+ msgid "Users Online Now"
60
+ msgstr "Người Đang Trực Tuyến"
61
+
62
+ #: admin.php:10
63
+ #: wp-stats.php:14
64
+ #: wp-stats.php:31
65
+ msgid "WP-UserOnline"
66
+ msgstr "WP-UserOnline"
67
+
68
+ #: admin.php:26
69
+ msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
70
+ msgid_plural "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
71
+ msgstr[0] "Hiện có <strong><a href='%s'>%s Người</a></strong> đang trực tuyến."
72
+
73
+ #: admin.php:55
74
+ msgid "UserOnline Options"
75
+ msgstr "Thiết Lập UserOnline"
76
+
77
+ #: admin.php:114
78
+ msgid "Time Out"
79
+ msgstr "Time Out"
80
+
81
+ #: admin.php:117
82
+ msgid "How long until it will remove the user from the database (in seconds)."
83
+ msgstr "Thời gian sau khi người dùng ngoại tuyến thì loại khỏi danh sách đang trực tuyến (theo giây)."
84
+
85
+ #: admin.php:122
86
+ msgid "UserOnline URL"
87
+ msgstr "Địa chỉ trang UserOnline"
88
+
89
+ #: admin.php:125
90
+ msgid "URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br />Example: http://www.yoursite.com/?page_id=2"
91
+ msgstr "Địa chỉ đến trang ai đang trực tuyến của bạn<br />Example: http://www.yoursite.com/useronline/<br />Example: http://www.yoursite.com/?page_id=2"
92
+
93
+ #: admin.php:129
94
+ msgid "User Names"
95
+ msgstr "Tên Thành Viên"
96
+
97
+ #: admin.php:132
98
+ msgid "Link user names to their author page"
99
+ msgstr "Tên thành viên sẽ dẫn đến trang chứa bài của họ"
100
+
101
+ #: admin.php:151
102
+ msgid "Useronline Templates"
103
+ msgstr "Cấu trúc Useronline"
104
+
105
+ #: admin.php:163
106
+ msgid "User(s) Browsing Site:"
107
+ msgstr "Thành viên đang trực tuyến:"
108
+
109
+ #: admin.php:164
110
+ msgid "User(s) Browsing Page:"
111
+ msgstr "Thành viên đang xem trang hiện tại:"
112
+
113
+ #: admin.php:177
114
+ #: scb/AdminPage.php:177
115
+ #: scb/AdminPage.php:187
116
+ msgid "Save Changes"
117
+ msgstr "Lưu Thay Đổi"
118
+
119
+ #: admin.php:187
120
+ msgid "Naming Conventions:"
121
+ msgstr "Quy ước Tên:"
122
+
123
+ #: admin.php:188
124
+ #: admin.php:228
125
+ #: admin.php:250
126
+ msgid "Allowed Variables:"
127
+ msgstr "Trường cho phép:"
128
+
129
+ #: admin.php:190
130
+ msgid "Restore Defaults"
131
+ msgstr "Khôi phục mặc định"
132
+
133
+ #: admin.php:196
134
+ msgid "Singular Form"
135
+ msgstr "Số Ít"
136
+
137
+ #: admin.php:197
138
+ msgid "Plural Form"
139
+ msgstr "Số Nhiều"
140
+
141
+ #: admin.php:227
142
+ msgid "User(s) Online:"
143
+ msgstr "Số Người Trực Tuyến:"
144
+
145
+ #: admin.php:233
146
+ #: admin.php:258
147
+ msgid "Restore Default Template"
148
+ msgstr "Khôi phục mặc định"
149
+
150
+ #: admin.php:264
151
+ msgid "Member Names Separator"
152
+ msgstr "Dấu phân cách thành viên"
153
+
154
+ #: admin.php:265
155
+ msgid "Guests Separator"
156
+ msgstr "Dấu phân cách khách"
157
+
158
+ #: admin.php:266
159
+ msgid "Bots Separator"
160
+ msgstr "Dấu phân cách Bot"
161
+
162
+ #: wp-stats.php:23
163
+ msgid "<strong>%s</strong> user online now."
164
+ msgid_plural "<strong>%s</strong> users online now."
165
+ msgstr[0] "<strong>%s</strong> người trực tuyến."
166
+
167
+ #: template-tags.php:80
168
+ msgid "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
169
+ msgid_plural "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
170
+ msgstr[0] "Hiện có <strong>%s</strong> trực tuyến: <strong>%s</strong>, <strong>%s</strong> và <strong>%s</strong>."
171
+
172
+ #: template-tags.php:190
173
+ msgid "No one is online now."
174
+ msgstr "Không có ai trực tuyến."
175
+
176
+ #: template-tags.php:192
177
+ msgid "on"
178
+ msgstr "ngày"
179
+
180
+ #: template-tags.php:193
181
+ msgid "url"
182
+ msgstr "URL"
183
+
184
+ #: template-tags.php:194
185
+ msgid "referral"
186
+ msgstr "Referral"
187
+
188
+ #: template-tags.php:205
189
+ msgid "Online Now"
190
+ msgstr "Đang Trực Tuyến"
191
+
192
+ #: template-tags.php:247
193
+ #: template-tags.php:249
194
+ msgid "%s @ %s"
195
+ msgstr "%s - %s"
196
+
197
+ #: template-tags.php:269
198
+ msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
199
+ msgstr "Kỉ lục trực tuyến là <strong>%s</strong> người vào ngày <strong>%s</strong>"
200
+
201
+ #: core.php:137
202
+ msgid "Guest"
203
+ msgstr "Khách"
204
+
205
+ #: core.php:208
206
+ msgid "Admin"
207
+ msgstr "Quản Trị"
208
+
209
+ #: core.php:214
210
+ msgid "Archive"
211
+ msgstr "Trang"
212
+
213
+ #: wp-useronline.php:61
214
+ msgid "1 User"
215
+ msgstr "1 Người"
216
+
217
+ #: wp-useronline.php:62
218
+ msgid "%COUNT% Users"
219
+ msgstr "%COUNT% Người"
220
+
221
+ #: wp-useronline.php:63
222
+ msgid "1 Member"
223
+ msgstr "1 Thành Viên"
224
+
225
+ #: wp-useronline.php:64
226
+ msgid "%COUNT% Members"
227
+ msgstr "%COUNT% Thành Viên"
228
+
229
+ #: wp-useronline.php:65
230
+ msgid "1 Guest"
231
+ msgstr "1 Khách"
232
+
233
+ #: wp-useronline.php:66
234
+ msgid "%COUNT% Guests"
235
+ msgstr "%COUNT% Khách"
236
+
237
+ #: wp-useronline.php:67
238
+ msgid "1 Bot"
239
+ msgstr "1 Bot"
240
+
241
+ #: wp-useronline.php:68
242
+ msgid "%COUNT% Bots"
243
+ msgstr "%COUNT% Bot"
244
+
245
+ #: wp-useronline.php:72
246
+ msgid "Online"
247
+ msgstr "Trực Tuyến"
248
+
249
+ #: wp-useronline.php:76
250
+ #: wp-useronline.php:77
251
+ #: wp-useronline.php:78
252
+ #: wp-useronline.php:85
253
+ #: wp-useronline.php:86
254
+ #: wp-useronline.php:87
255
+ msgid ","
256
+ msgstr ","
257
+
258
+ #: wp-useronline.php:80
259
+ #: wp-useronline.php:89
260
+ msgctxt "Template Element"
261
+ msgid "Users"
262
+ msgstr "Người"
263
+
264
+ #: wp-useronline.php:89
265
+ msgid "Browsing This Page."
266
+ msgstr "Đang Xem Trang Này."
267
+
268
+ #: scb/AdminPage.php:165
269
+ msgid "Settings <strong>saved</strong>."
270
+ msgstr "Thiết Lập <strong>đã lưu</strong>."
271
+
272
+ #: scb/AdminPage.php:369
273
+ msgid "Settings"
274
+ msgstr "Thiết Lập"
275
+
readme.txt CHANGED
@@ -2,8 +2,10 @@
2
  Contributors: GamerZ, scribu
3
  Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
4
  Requires at least: 3.1
5
- Tested up to: 3.3
6
- Stable tag: 2.81
 
 
7
 
8
  Enable you to display how many users are online on your Wordpress blog with detailed statistics.
9
 
@@ -95,6 +97,11 @@ Make sure your host is running PHP 5. The only foolproof way to do this is to ad
95
 
96
  == Changelog ==
97
 
 
 
 
 
 
98
  = 2.81 =
99
  * fixed settings page
100
  * fixed "Return to default" buttons
2
  Contributors: GamerZ, scribu
3
  Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
4
  Requires at least: 3.1
5
+ Tested up to: 3.5
6
+ Stable tag: 2.82
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  Enable you to display how many users are online on your Wordpress blog with detailed statistics.
11
 
97
 
98
  == Changelog ==
99
 
100
+ = 2.82 =
101
+ * show most recent visitors first
102
+ * fix duplicate entry errors
103
+ * fix ajax requests for SSL
104
+
105
  = 2.81 =
106
  * fixed settings page
107
  * fixed "Return to default" buttons
scb/AdminPage.php CHANGED
@@ -108,6 +108,13 @@ abstract class scbAdminPage {
108
  // This is where all the page args can be set
109
  function setup(){}
110
 
 
 
 
 
 
 
 
111
  // This is where the css and js go
112
  // Both wp_enqueue_*() and inline code can be added
113
  function page_head(){}
@@ -120,7 +127,7 @@ abstract class scbAdminPage {
120
  function page_header() {
121
  echo "<div class='wrap'>\n";
122
  screen_icon( $this->args['screen_icon'] );
123
- echo "<h2>" . $this->args['page_title'] . "</h2>\n";
124
  }
125
 
126
  // This is where the page content goes
@@ -189,18 +196,19 @@ abstract class scbAdminPage {
189
  $value = __( 'Save Changes', $this->textdomain );
190
  }
191
 
192
- $input_args = array( 'type' => 'submit',
193
- 'names' => $action,
194
- 'values' => $value,
 
195
  'extra' => '',
196
- 'desc' => false );
 
 
197
 
198
  if ( ! empty( $class ) )
199
- $input_args['extra'] = "class='{$class}'";
200
-
201
- $output = "<p class='submit'>\n" . scbForms::input( $input_args ) . "</p>\n";
202
 
203
- return $output;
204
  }
205
 
206
  /*
@@ -266,20 +274,6 @@ abstract class scbAdminPage {
266
  return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
267
  }
268
 
269
- // Wraps the given content in a <table>
270
- function table_wrap( $content ) {
271
- return
272
- html( 'table class="form-table"', $content );
273
- }
274
-
275
- // Wraps the given content in a <tr><td>
276
- function row_wrap( $title, $content ) {
277
- return
278
- html( 'tr',
279
- html( 'th scope="row"', $title )
280
- .html( 'td', $content ) );
281
- }
282
-
283
  // Mimic scbForms inheritance
284
  function __call( $method, $args ) {
285
  if ( in_array( $method, array( 'input', 'form' ) ) ) {
@@ -295,12 +289,12 @@ abstract class scbAdminPage {
295
 
296
  // Wraps a string in a <script> tag
297
  function js_wrap( $string ) {
298
- return "\n<script type='text/javascript'>\n" . $string . "\n</script>\n";
299
  }
300
 
301
  // Wraps a string in a <style> tag
302
  function css_wrap( $string ) {
303
- return "\n<style type='text/css'>\n" . $string . "\n</style>\n";
304
  }
305
 
306
 
@@ -321,6 +315,8 @@ abstract class scbAdminPage {
321
  if ( ! $this->pagehook )
322
  return;
323
 
 
 
324
  if ( $ajax_submit ) {
325
  $this->ajax_response();
326
  add_action( 'admin_footer', array( $this, 'ajax_submit' ), 20 );
108
  // This is where all the page args can be set
109
  function setup(){}
110
 
111
+ /**
112
+ * Called when the page is loaded, but before any rendering.
113
+ *
114
+ * Useful for calling $screen->add_help_tab() etc.
115
+ */
116
+ function page_loaded() {}
117
+
118
  // This is where the css and js go
119
  // Both wp_enqueue_*() and inline code can be added
120
  function page_head(){}
127
  function page_header() {
128
  echo "<div class='wrap'>\n";
129
  screen_icon( $this->args['screen_icon'] );
130
+ echo html( "h2", $this->args['page_title'] );
131
  }
132
 
133
  // This is where the page content goes
196
  $value = __( 'Save Changes', $this->textdomain );
197
  }
198
 
199
+ $input_args = array(
200
+ 'type' => 'submit',
201
+ 'name' => $action,
202
+ 'value' => $value,
203
  'extra' => '',
204
+ 'desc' => false,
205
+ 'wrap' => html( 'p class="submit"', scbForms::TOKEN )
206
+ );
207
 
208
  if ( ! empty( $class ) )
209
+ $input_args['extra'] = compact( 'class' );
 
 
210
 
211
+ return scbForms::input( $input_args );
212
  }
213
 
214
  /*
274
  return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
275
  }
276
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  // Mimic scbForms inheritance
278
  function __call( $method, $args ) {
279
  if ( in_array( $method, array( 'input', 'form' ) ) ) {
289
 
290
  // Wraps a string in a <script> tag
291
  function js_wrap( $string ) {
292
+ return html( "script type='text/javascript'", $string );
293
  }
294
 
295
  // Wraps a string in a <style> tag
296
  function css_wrap( $string ) {
297
+ return html( "style type='text/css'", $string );
298
  }
299
 
300
 
315
  if ( ! $this->pagehook )
316
  return;
317
 
318
+ add_action( 'load-' . $this->pagehook, array( $this, 'page_loaded' ) );
319
+
320
  if ( $ajax_submit ) {
321
  $this->ajax_response();
322
  add_action( 'admin_footer', array( $this, 'ajax_submit' ), 20 );
scb/BoxesPage.php CHANGED
@@ -166,8 +166,11 @@ abstract class scbBoxesPage extends scbAdminPage {
166
  ) );
167
 
168
  $registered = array();
169
- foreach( $this->boxes as $box_args ) {
170
- @list( $name, $title, $context, $priority, $args ) = $box_args;
 
 
 
171
 
172
  if ( empty( $title ) )
173
  $title = ucfirst( $name );
166
  ) );
167
 
168
  $registered = array();
169
+ foreach ( $this->boxes as $box_args ) {
170
+ foreach ( array( 'name', 'title', 'context', 'priority', 'args' ) as $i => $arg ) {
171
+ if ( isset( $box_args[$i] ) )
172
+ $$arg = $box_args[$i];
173
+ }
174
 
175
  if ( empty( $title ) )
176
  $title = ucfirst( $name );
scb/Forms.php CHANGED
@@ -4,66 +4,22 @@
4
 
5
  class scbForms {
6
 
7
- const token = '%input%';
8
 
9
- protected static $cur_name;
 
10
 
11
- static function input( $args, $formdata = false ) {
12
- // setle on singular keys
13
- foreach ( array( 'name', 'value' ) as $key ) {
14
- $old = $key . 's';
15
-
16
- if ( isset( $args[$old] ) ) {
17
- $args[$key] = $args[$old];
18
- unset( $args[$old] );
19
- }
20
- }
21
-
22
- if ( !empty( $formdata ) ) {
23
- $form = new scbForm( $formdata );
24
- return $form->input( $args );
25
- }
26
-
27
- if ( empty( $args['name'] ) )
28
- return trigger_error( 'Empty name', E_USER_WARNING );
29
-
30
- $args = wp_parse_args( $args, array(
31
- 'desc' => '',
32
- 'desc_pos' => '',
33
- ) );
34
-
35
- $val_is_array = isset( $args['value'] ) && is_array( $args['value'] );
36
-
37
- if ( isset( $args['extra'] ) && !is_array( $args['extra'] ) )
38
- $args['extra'] = shortcode_parse_atts( $args['extra'] );
39
-
40
- self::$cur_name = self::get_name( $args['name'] );
41
-
42
- switch ( $args['type'] ) {
43
- case 'select':
44
- case 'radio':
45
- if ( ! $val_is_array )
46
- return trigger_error( "'value' argument is expected to be an array", E_USER_WARNING );
47
-
48
- return self::_single_choice( $args );
49
- break;
50
- case 'checkbox':
51
- if ( $val_is_array )
52
- return self::_multiple_choice( $args );
53
- else
54
- return self::_checkbox( $args );
55
- break;
56
- default:
57
- return self::_input( $args );
58
- }
59
  }
60
 
 
 
61
 
62
- // ____________UTILITIES____________
63
-
64
 
65
  // Generates a table wrapped in a form
66
- static function form_table( $rows, $formdata = NULL ) {
67
  $output = '';
68
  foreach ( $rows as $row )
69
  $output .= self::table_row( $row, $formdata );
@@ -74,7 +30,7 @@ class scbForms {
74
  }
75
 
76
  // Generates a form
77
- static function form( $inputs, $formdata = NULL, $nonce ) {
78
  $output = '';
79
  foreach ( $inputs as $input )
80
  $output .= self::input( $input, $formdata );
@@ -85,7 +41,7 @@ class scbForms {
85
  }
86
 
87
  // Generates a table
88
- static function table( $rows, $formdata = NULL ) {
89
  $output = '';
90
  foreach ( $rows as $row )
91
  $output .= self::table_row( $row, $formdata );
@@ -96,7 +52,7 @@ class scbForms {
96
  }
97
 
98
  // Generates a table row
99
- static function table_row( $args, $formdata = NULL ) {
100
  return self::row_wrap( $args['title'], self::input( $args, $formdata ) );
101
  }
102
 
@@ -104,168 +60,315 @@ class scbForms {
104
  // ____________WRAPPERS____________
105
 
106
 
107
- // Wraps the given content in a <form><table>
108
  static function form_table_wrap( $content, $nonce = 'update_options' ) {
109
- $output = self::table_wrap( $content );
110
- $output = self::form_wrap( $output, $nonce );
111
-
112
- return $output;
113
  }
114
 
115
- // Wraps the given content in a <form> tag
116
  static function form_wrap( $content, $nonce = 'update_options' ) {
117
- $output = "\n<form method='post' action=''>\n";
118
- $output .= $content;
119
- $output .= wp_nonce_field( $action = $nonce, $name = "_wpnonce", $referer = true , $echo = false );
120
- $output .= "\n</form>\n";
121
-
122
- return $output;
123
  }
124
 
125
- // Wraps the given content in a <table>
126
  static function table_wrap( $content ) {
127
- $output = "\n<table class='form-table'>\n" . $content . "\n</table>\n";
128
-
129
- return $output;
130
  }
131
 
132
- // Wraps the given content in a <tr><td>
133
  static function row_wrap( $title, $content ) {
134
- return "\n<tr>\n\t<th scope='row'>" . $title . "</th>\n\t<td>\n\t\t" . $content . "\t</td>\n\n</tr>";
 
 
 
135
  }
136
 
137
 
138
  // ____________PRIVATE METHODS____________
139
 
140
 
141
- private static function _single_choice( $args ) {
142
- $args = wp_parse_args( $args, array(
143
- 'numeric' => false, // use numeric array instead of associative
144
- 'selected' => array( 'foo' ), // hack to make default blank
145
- ) );
146
 
147
- self::_expand_values( $args );
148
 
149
- if ( 'select' == $args['type'] )
150
- return self::_select( $args );
151
- else
152
- return self::_radio( $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
154
 
155
- private static function _multiple_choice( $args ) {
156
- $args = wp_parse_args( $args, array(
157
- 'numeric' => false, // use numeric array instead of associative
158
- 'checked' => null,
159
- ) );
 
 
 
 
 
 
 
 
160
 
161
- self::$cur_name .= '[]';
 
162
 
163
- self::_expand_values( $args );
 
164
 
165
- extract( $args );
 
 
 
 
 
 
 
 
 
 
 
 
166
 
167
- if ( !is_array( $checked ) )
168
- $checked = array();
169
 
170
- $opts = '';
171
- foreach ( $value as $value => $title ) {
172
- if ( empty( $value ) || empty( $title ) )
173
- continue;
174
 
175
- $opts .= self::_checkbox( array(
176
- 'type' => 'checkbox',
177
- 'value' => $value,
178
- 'checked' => in_array( $value, $checked ),
179
- 'desc' => $title,
180
- 'desc_pos' => $desc_pos
181
- ) );
182
  }
183
 
184
- return $opts;
185
  }
186
 
187
- private static function _expand_values( &$args ) {
188
- $value =& $args['value'];
 
 
 
 
 
 
 
 
 
 
 
189
 
190
- if ( !empty( $value ) && !self::is_associative( $value ) ) {
191
- if ( is_array( $args['desc'] ) ) {
192
- $value = array_combine( $value, $args['desc'] ); // back-compat
193
- } elseif ( !$args['numeric'] ) {
194
- $value = array_combine( $value, $value );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  }
196
  }
197
  }
198
 
199
- private static function _radio( $args ) {
200
- extract( $args );
201
 
202
- if ( array( 'foo' ) == $selected ) {
203
- $selected = key( $value ); // radio buttons should always have one option selected
 
 
 
 
 
 
 
204
  }
205
 
206
- $opts = '';
207
- foreach ( $value as $value => $title ) {
208
- if ( empty( $value ) || empty( $title ) )
209
- continue;
210
 
211
- $opts .= self::_checkbox( array(
212
- 'type' => 'radio',
213
- 'value' => $value,
214
- 'checked' => ( (string) $value == (string) $selected ),
215
- 'desc' => $title,
216
- 'desc_pos' => $desc_pos
217
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  }
219
 
220
- return $opts;
221
  }
 
222
 
223
- private static function _select( $args ) {
224
- extract( wp_parse_args( $args, array(
225
- 'text' => '',
226
- 'extra' => array()
227
- ) ) );
228
 
229
- $options = array();
230
 
231
- if ( false !== $text ) {
232
- $options[] = array(
233
- 'value' => '',
234
- 'selected' => ( $selected == array( 'foo' ) ),
235
- 'title' => $text
236
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  }
238
 
239
- foreach ( $value as $value => $title ) {
240
- if ( empty( $value ) || empty( $title ) )
241
- continue;
 
242
 
243
- $options[] = array(
244
- 'value' => $value,
245
- 'selected' => ( (string) $value == (string) $selected ),
246
- 'title' => $title
247
- );
248
  }
249
 
250
- $opts = '';
251
- foreach ( $options as $option ) {
252
- extract( $option );
253
 
254
- $opts .= html( 'option', compact( 'value', 'selected' ), $title );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  }
 
256
 
257
- $extra['name'] = self::$cur_name;
 
 
258
 
259
- $input = html( 'select', $extra, $opts );
 
 
260
 
261
- return self::add_label( $input, $desc, $desc_pos );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  }
263
 
 
 
 
 
 
 
264
  // Handle args for a single checkbox or radio input
265
- private static function _checkbox( $args ) {
266
  $args = wp_parse_args( $args, array(
267
  'value' => true,
268
- 'desc' => NULL,
269
  'checked' => false,
270
  'extra' => array(),
271
  ) );
@@ -282,8 +385,70 @@ class scbForms {
282
  return self::_input_gen( $args );
283
  }
284
 
285
- // Handle args for text inputs
286
- private static function _input( $args ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  $args = wp_parse_args( $args, array(
288
  'value' => '',
289
  'desc_pos' => 'after',
@@ -297,151 +462,209 @@ class scbForms {
297
  if ( !isset( $extra['id'] ) && !is_array( $name ) && false === strpos( $name, '[' ) )
298
  $extra['id'] = $name;
299
 
300
- return self::_input_gen( $args );
301
  }
302
 
303
- // Generate html with the final args
304
- private static function _input_gen( $args ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
305
  extract( wp_parse_args( $args, array(
306
- 'value' => NULL,
307
- 'desc' => NULL,
308
  'extra' => array()
309
  ) ) );
310
 
311
- $extra['name'] = self::$cur_name;
312
 
313
- if ( 'textarea' == $type ) {
314
- $input = html( 'textarea', $extra, esc_textarea( $value ) );
315
- } else {
316
- $extra['value'] = $value;
317
- $extra['type'] = $type;
318
- $input = html( 'input', $extra );
319
  }
320
 
321
- return self::add_label( $input, $desc, $desc_pos );
322
- }
 
 
 
 
 
323
 
324
- private static function add_label( $input, $desc, $desc_pos ) {
325
- if ( empty( $desc_pos ) )
326
- $desc_pos = 'after';
327
 
328
- $label = '';
329
- if ( false === strpos( $desc, self::token ) ) {
330
- switch ( $desc_pos ) {
331
- case 'before': $label = $desc . ' ' . self::token; break;
332
- case 'after': $label = self::token . ' ' . $desc;
333
- }
334
- } else {
335
- $label = $desc;
336
  }
337
 
338
- $label = trim( str_replace( self::token, $input, $label ) );
339
 
340
- if ( empty( $desc ) )
341
- $output = $input;
342
- else
343
- $output = html( 'label', $label );
344
 
345
- return $output . "\n";
346
  }
 
347
 
348
 
349
- // Utilities
350
 
 
 
351
 
352
- /**
353
- * Generates the proper string for a name attribute.
354
- *
355
- * @param array|string $name The raw name
356
- *
357
- * @return string
358
- */
359
- static function get_name( $name ) {
360
- $name = (array) $name;
361
 
362
- $name_str = array_shift( $name );
 
 
 
 
 
 
 
 
 
363
 
364
- foreach ( $name as $key ) {
365
- $name_str .= '[' . esc_attr( $key ) . ']';
366
  }
367
 
368
- return $name_str;
369
  }
 
370
 
371
- /**
372
- * Traverses the formdata and retrieves the correct value.
373
- *
374
- * @param array|string $name The name of the value
375
- * @param array $value The data that will be traversed
376
- * @param mixed $fallback The value returned when the key is not found
377
- *
378
- * @return mixed
379
- */
380
- static function get_value( $name, $value, $fallback = null ) {
381
- foreach ( (array) $name as $key ) {
382
- if ( !isset( $value[ $key ] ) )
383
- return $fallback;
384
 
385
- $value = $value[$key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  }
387
 
388
- return $value;
389
  }
390
 
391
- private static function is_associative( $array ) {
392
- $keys = array_keys( $array );
393
- return array_keys( $keys ) !== $keys;
394
  }
395
  }
396
 
397
- /**
398
- * A wrapper for scbForms, containing the formdata
399
- */
400
- class scbForm {
401
- protected $data = array();
402
- protected $prefix = array();
403
 
404
- function __construct( $data, $prefix = false ) {
405
- if ( is_array( $data ) )
406
- $this->data = $data;
407
 
408
- if ( $prefix )
409
- $this->prefix = (array) $prefix;
410
  }
411
 
412
- function traverse_to( $path ) {
413
- $data = scbForms::get_value( $path, $this->data );
 
 
 
 
 
414
 
415
- $prefix = array_merge( $this->prefix, (array) $path );
 
 
416
 
417
- return new scbForm( $data, $prefix );
 
 
 
 
 
418
  }
419
 
420
- function input( $args ) {
421
- $value = scbForms::get_value( $args['name'], $this->data );
 
 
422
 
423
- if ( !is_null( $value ) ) {
424
- switch ( $args['type'] ) {
425
- case 'select':
426
- case 'radio':
427
- $args['selected'] = $value;
428
- break;
429
- case 'checkbox':
430
- if ( is_array( $value ) )
431
- $args['checked'] = $value;
432
- else
433
- $args['checked'] = ( $value || ( isset( $args['value'] ) && $value == $args['value'] ) );
434
- break;
435
- default:
436
- $args['value'] = $value;
437
- }
438
- }
439
 
440
- if ( !empty( $this->prefix ) ) {
441
- $args['name'] = array_merge( $this->prefix, (array) $args['name'] );
442
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
 
444
- return scbForms::input( $args );
 
445
  }
446
  }
447
 
4
 
5
  class scbForms {
6
 
7
+ const TOKEN = '%input%';
8
 
9
+ static function input_with_value( $args, $value ) {
10
+ $field = scbFormField::create( $args );
11
 
12
+ return $field->render( $value );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
 
15
+ static function input( $args, $formdata = null ) {
16
+ $field = scbFormField::create( $args );
17
 
18
+ return $field->render( scbForms::get_value( $args['name'], $formdata ) );
19
+ }
20
 
21
  // Generates a table wrapped in a form
22
+ static function form_table( $rows, $formdata = null ) {
23
  $output = '';
24
  foreach ( $rows as $row )
25
  $output .= self::table_row( $row, $formdata );
30
  }
31
 
32
  // Generates a form
33
+ static function form( $inputs, $formdata = null, $nonce ) {
34
  $output = '';
35
  foreach ( $inputs as $input )
36
  $output .= self::input( $input, $formdata );
41
  }
42
 
43
  // Generates a table
44
+ static function table( $rows, $formdata = null ) {
45
  $output = '';
46
  foreach ( $rows as $row )
47
  $output .= self::table_row( $row, $formdata );
52
  }
53
 
54
  // Generates a table row
55
+ static function table_row( $args, $formdata = null ) {
56
  return self::row_wrap( $args['title'], self::input( $args, $formdata ) );
57
  }
58
 
60
  // ____________WRAPPERS____________
61
 
62
 
 
63
  static function form_table_wrap( $content, $nonce = 'update_options' ) {
64
+ return self::form_wrap( self::table_wrap( $content ), $nonce );
 
 
 
65
  }
66
 
 
67
  static function form_wrap( $content, $nonce = 'update_options' ) {
68
+ return html( "form method='post' action=''",
69
+ $content,
70
+ wp_nonce_field( $nonce, '_wpnonce', $referer = true, $echo = false )
71
+ );
 
 
72
  }
73
 
 
74
  static function table_wrap( $content ) {
75
+ return html( "table class='form-table'", $content );
 
 
76
  }
77
 
 
78
  static function row_wrap( $title, $content ) {
79
+ return html( "tr",
80
+ html( "th scope='row'", $title ),
81
+ html( "td", $content )
82
+ );
83
  }
84
 
85
 
86
  // ____________PRIVATE METHODS____________
87
 
88
 
89
+ // Utilities
 
 
 
 
90
 
 
91
 
92
+ /**
93
+ * Generates the proper string for a name attribute.
94
+ *
95
+ * @param array|string $name The raw name
96
+ *
97
+ * @return string
98
+ */
99
+ static function get_name( $name ) {
100
+ $name = (array) $name;
101
+
102
+ $name_str = array_shift( $name );
103
+
104
+ foreach ( $name as $key ) {
105
+ $name_str .= '[' . esc_attr( $key ) . ']';
106
+ }
107
+
108
+ return $name_str;
109
  }
110
 
111
+ /**
112
+ * Traverses the formdata and retrieves the correct value.
113
+ *
114
+ * @param array|string $name The name of the value
115
+ * @param array $value The data that will be traversed
116
+ * @param mixed $fallback The value returned when the key is not found
117
+ *
118
+ * @return mixed
119
+ */
120
+ static function get_value( $name, $value, $fallback = null ) {
121
+ foreach ( (array) $name as $key ) {
122
+ if ( !isset( $value[ $key ] ) )
123
+ return $fallback;
124
 
125
+ $value = $value[$key];
126
+ }
127
 
128
+ return $value;
129
+ }
130
 
131
+ /**
132
+ * Given a list of fields, validate some data.
133
+ *
134
+ * @param array $fields List of args that would be sent to scbForms::input()
135
+ * @param array $data The data to validate. Defaults to $_POST
136
+ * @param array $to_update Existing data to populate. Necessary for nested values
137
+ *
138
+ * @return array
139
+ */
140
+ static function validate_post_data( $fields, $data = null, $to_update = array() ) {
141
+ if ( null === $data ) {
142
+ $data = stripslashes_deep( $_POST );
143
+ }
144
 
145
+ foreach ( $fields as $field ) {
146
+ $value = scbForms::get_value( $field['name'], $data );
147
 
148
+ $fieldObj = scbFormField::create( $field );
 
 
 
149
 
150
+ $value = $fieldObj->validate( $value );
151
+
152
+ if ( null !== $value )
153
+ self::set_value( $to_update, $field['name'], $value );
 
 
 
154
  }
155
 
156
+ return $to_update;
157
  }
158
 
159
+ /**
160
+ * For multiple-choice fields, we can never distinguish between "never been set" and "set to none".
161
+ * For single-choice fields, we can't distinguish either, because of how self::update_meta() works.
162
+ * Therefore, the 'default' parameter is always ignored.
163
+ *
164
+ * @param array $args Field arguments.
165
+ * @param int $object_id The object ID the metadata is attached to
166
+ * @param string $meta_type
167
+ *
168
+ * @return string
169
+ */
170
+ static function input_from_meta( $args, $object_id, $meta_type = 'post' ) {
171
+ $single = ( 'checkbox' != $args['type'] );
172
 
173
+ $key = (array) $args['name'];
174
+ $key = end( $key );
175
+
176
+ $value = get_metadata( $meta_type, $object_id, $key, $single );
177
+
178
+ return self::input_with_value( $args, $value );
179
+ }
180
+
181
+ static function update_meta( $fields, $data, $object_id, $meta_type = 'post' ) {
182
+ foreach ( $fields as $field_args ) {
183
+ $key = $field_args['name'];
184
+
185
+ if ( 'checkbox' == $field_args['type'] ) {
186
+ $new_values = isset( $data[$key] ) ? $data[$key] : array();
187
+
188
+ $old_values = get_metadata( $meta_type, $object_id, $key );
189
+
190
+ foreach ( array_diff( $new_values, $old_values ) as $value )
191
+ add_metadata( $meta_type, $object_id, $key, $value );
192
+
193
+ foreach ( array_diff( $old_values, $new_values ) as $value )
194
+ delete_metadata( $meta_type, $object_id, $key, $value );
195
+ } else {
196
+ $value = $data[$key];
197
+
198
+ if ( '' === $value )
199
+ delete_metadata( $meta_type, $object_id, $key );
200
+ else
201
+ update_metadata( $meta_type, $object_id, $key, $value );
202
  }
203
  }
204
  }
205
 
206
+ private static function set_value( &$arr, $name, $value ) {
207
+ $name = (array) $name;
208
 
209
+ $final_key = array_pop( $name );
210
+
211
+ while ( !empty( $name ) ) {
212
+ $key = array_shift( $name );
213
+
214
+ if ( !isset( $arr[ $key ] ) )
215
+ $arr[ $key ] = array();
216
+
217
+ $arr =& $arr[ $key ];
218
  }
219
 
220
+ $arr[ $final_key ] = $value;
221
+ }
222
+ }
 
223
 
224
+
225
+ /**
226
+ * A wrapper for scbForms, containing the formdata
227
+ */
228
+ class scbForm {
229
+ protected $data = array();
230
+ protected $prefix = array();
231
+
232
+ function __construct( $data, $prefix = false ) {
233
+ if ( is_array( $data ) )
234
+ $this->data = $data;
235
+
236
+ if ( $prefix )
237
+ $this->prefix = (array) $prefix;
238
+ }
239
+
240
+ function traverse_to( $path ) {
241
+ $data = scbForms::get_value( $path, $this->data );
242
+
243
+ $prefix = array_merge( $this->prefix, (array) $path );
244
+
245
+ return new scbForm( $data, $prefix );
246
+ }
247
+
248
+ function input( $args ) {
249
+ $value = scbForms::get_value( $args['name'], $this->data );
250
+
251
+ if ( !empty( $this->prefix ) ) {
252
+ $args['name'] = array_merge( $this->prefix, (array) $args['name'] );
253
  }
254
 
255
+ return scbForms::input_with_value( $args, $value );
256
  }
257
+ }
258
 
 
 
 
 
 
259
 
260
+ interface scbFormField_I {
261
 
262
+ /**
263
+ * Generate the corresponding HTML for a field
264
+ *
265
+ * @param mixed $value The value to use
266
+ *
267
+ * @return string
268
+ */
269
+ function render( $value = null );
270
+
271
+ /**
272
+ * Validates a value against a field.
273
+ *
274
+ * @param mixed $value The value to check
275
+ *
276
+ * @return mixed null if the validation failed, sanitized value otherwise.
277
+ */
278
+ function validate( $value );
279
+ }
280
+
281
+
282
+ abstract class scbFormField implements scbFormField_I {
283
+
284
+ protected $args;
285
+
286
+ public static function create( $args ) {
287
+ if ( is_a( $args, 'scbFormField_I' ) )
288
+ return $args;
289
+
290
+ if ( empty( $args['name'] ) ) {
291
+ return trigger_error( 'Empty name', E_USER_WARNING );
292
  }
293
 
294
+ if ( isset( $args['value'] ) && is_array( $args['value'] ) ) {
295
+ $args['choices'] = $args['value'];
296
+ unset( $args['value'] );
297
+ }
298
 
299
+ if ( isset( $args['values'] ) ) {
300
+ $args['choices'] = $args['values'];
301
+ unset( $args['values'] );
 
 
302
  }
303
 
304
+ if ( isset( $args['extra'] ) && !is_array( $args['extra'] ) )
305
+ $args['extra'] = shortcode_parse_atts( $args['extra'] );
 
306
 
307
+ $args = wp_parse_args( $args, array(
308
+ 'desc' => '',
309
+ 'desc_pos' => 'after',
310
+ 'wrap' => scbForms::TOKEN,
311
+ 'wrap_each' => scbForms::TOKEN,
312
+ ) );
313
+
314
+ // depends on $args['desc']
315
+ if ( isset( $args['choices'] ) )
316
+ self::_expand_choices( $args );
317
+
318
+ switch ( $args['type'] ) {
319
+ case 'radio':
320
+ return new scbRadiosField( $args );
321
+ case 'select':
322
+ return new scbSelectField( $args );
323
+ case 'checkbox':
324
+ if ( isset( $args['choices'] ) )
325
+ return new scbMultipleChoiceField( $args );
326
+ else
327
+ return new scbSingleCheckboxField( $args );
328
+ case 'custom':
329
+ return new scbCustomField( $args );
330
+ default:
331
+ return new scbTextField( $args );
332
  }
333
+ }
334
 
335
+ protected function __construct( $args ) {
336
+ $this->args = $args;
337
+ }
338
 
339
+ public function __get( $key ) {
340
+ return $this->args[ $key ];
341
+ }
342
 
343
+ public function __isset( $key ) {
344
+ return isset( $this->args[ $key ] );
345
+ }
346
+
347
+ public function render( $value = null ) {
348
+ if ( null === $value && isset( $this->default ) )
349
+ $value = $this->default;
350
+
351
+ $args = $this->args;
352
+
353
+ if ( null !== $value )
354
+ $this->_set_value( $args, $value );
355
+
356
+ $args['name'] = scbForms::get_name( $args['name'] );
357
+
358
+ return str_replace( scbForms::TOKEN, $this->_render( $args ), $this->wrap );
359
  }
360
 
361
+ // Mutate the field arguments so that the value passed is rendered.
362
+ abstract protected function _set_value( &$args, $value );
363
+
364
+ // The actual rendering
365
+ abstract protected function _render( $args );
366
+
367
  // Handle args for a single checkbox or radio input
368
+ protected static function _checkbox( $args ) {
369
  $args = wp_parse_args( $args, array(
370
  'value' => true,
371
+ 'desc' => null,
372
  'checked' => false,
373
  'extra' => array(),
374
  ) );
385
  return self::_input_gen( $args );
386
  }
387
 
388
+ // Generate html with the final args
389
+ protected static function _input_gen( $args ) {
390
+ extract( wp_parse_args( $args, array(
391
+ 'value' => null,
392
+ 'desc' => null,
393
+ 'extra' => array()
394
+ ) ) );
395
+
396
+ $extra['name'] = $name;
397
+
398
+ if ( 'textarea' == $type ) {
399
+ $input = html( 'textarea', $extra, esc_textarea( $value ) );
400
+ } else {
401
+ $extra['value'] = $value;
402
+ $extra['type'] = $type;
403
+ $input = html( 'input', $extra );
404
+ }
405
+
406
+ return self::add_label( $input, $desc, $desc_pos );
407
+ }
408
+
409
+ protected static function add_label( $input, $desc, $desc_pos ) {
410
+ return html( 'label', self::add_desc( $input, $desc, $desc_pos ) ) . "\n";
411
+ }
412
+
413
+ protected static function add_desc( $input, $desc, $desc_pos ) {
414
+ if ( empty( $desc ) )
415
+ return $input;
416
+
417
+ if ( 'before' == $desc_pos )
418
+ return $desc . ' ' . $input;
419
+ else
420
+ return $input . ' ' . $desc;
421
+ }
422
+
423
+ private static function _expand_choices( &$args ) {
424
+ $choices =& $args['choices'];
425
+
426
+ if ( !empty( $choices ) && !self::is_associative( $choices ) ) {
427
+ if ( is_array( $args['desc'] ) ) {
428
+ $choices = array_combine( $choices, $args['desc'] ); // back-compat
429
+ $args['desc'] = false;
430
+ } elseif ( !isset( $args['numeric'] ) || !$args['numeric'] ) {
431
+ $choices = array_combine( $choices, $choices );
432
+ }
433
+ }
434
+ }
435
+
436
+ private static function is_associative( $array ) {
437
+ $keys = array_keys( $array );
438
+ return array_keys( $keys ) !== $keys;
439
+ }
440
+ }
441
+
442
+
443
+ class scbTextField extends scbFormField {
444
+
445
+ public function validate( $value ) {
446
+ $sanitize = isset( $this->sanitize ) ? $this->sanitize : 'wp_filter_kses';
447
+
448
+ return call_user_func( $sanitize, $value, $this );
449
+ }
450
+
451
+ protected function _render( $args ) {
452
  $args = wp_parse_args( $args, array(
453
  'value' => '',
454
  'desc_pos' => 'after',
462
  if ( !isset( $extra['id'] ) && !is_array( $name ) && false === strpos( $name, '[' ) )
463
  $extra['id'] = $name;
464
 
465
+ return scbFormField::_input_gen( $args );
466
  }
467
 
468
+ protected function _set_value( &$args, $value ) {
469
+ $args['value'] = $value;
470
+ }
471
+ }
472
+
473
+
474
+ abstract class scbSingleChoiceField extends scbFormField {
475
+
476
+ public function validate( $value ) {
477
+ if ( isset( $this->choices[ $value ] ) )
478
+ return $value;
479
+
480
+ return null;
481
+ }
482
+
483
+ protected function _render( $args ) {
484
+ $args = wp_parse_args( $args, array(
485
+ 'numeric' => false, // use numeric array instead of associative
486
+ 'selected' => array( 'foo' ), // hack to make default blank
487
+ ) );
488
+
489
+ return $this->_render_specific( $args );
490
+ }
491
+
492
+ protected function _set_value( &$args, $value ) {
493
+ $args['selected'] = $value;
494
+ }
495
+
496
+ abstract protected function _render_specific( $args );
497
+ }
498
+
499
+
500
+ class scbSelectField extends scbSingleChoiceField {
501
+
502
+ protected function _render_specific( $args ) {
503
  extract( wp_parse_args( $args, array(
504
+ 'text' => false,
 
505
  'extra' => array()
506
  ) ) );
507
 
508
+ $options = array();
509
 
510
+ if ( false !== $text ) {
511
+ $options[] = array(
512
+ 'value' => '',
513
+ 'selected' => ( $selected == array( 'foo' ) ),
514
+ 'title' => $text
515
+ );
516
  }
517
 
518
+ foreach ( $choices as $value => $title ) {
519
+ $options[] = array(
520
+ 'value' => $value,
521
+ 'selected' => ( $value == $selected ),
522
+ 'title' => $title
523
+ );
524
+ }
525
 
526
+ $opts = '';
527
+ foreach ( $options as $option ) {
528
+ extract( $option );
529
 
530
+ $opts .= html( 'option', compact( 'value', 'selected' ), $title );
 
 
 
 
 
 
 
531
  }
532
 
533
+ $extra['name'] = $name;
534
 
535
+ $input = html( 'select', $extra, $opts );
 
 
 
536
 
537
+ return scbFormField::add_label( $input, $desc, $desc_pos );
538
  }
539
+ }
540
 
541
 
542
+ class scbRadiosField extends scbSelectField {
543
 
544
+ protected function _render_specific( $args ) {
545
+ extract( $args );
546
 
547
+ if ( array( 'foo' ) == $selected ) {
548
+ // radio buttons should always have one option selected
549
+ $selected = key( $choices );
550
+ }
 
 
 
 
 
551
 
552
+ $opts = '';
553
+ foreach ( $choices as $value => $title ) {
554
+ $single_input = scbFormField::_checkbox( array(
555
+ 'name' => $name,
556
+ 'type' => 'radio',
557
+ 'value' => $value,
558
+ 'checked' => ( $value == $selected ),
559
+ 'desc' => $title,
560
+ 'desc_pos' => 'after'
561
+ ) );
562
 
563
+ $opts .= str_replace( scbForms::TOKEN, $single_input, $wrap_each );
 
564
  }
565
 
566
+ return scbFormField::add_desc( $opts, $desc, $desc_pos );
567
  }
568
+ }
569
 
 
 
 
 
 
 
 
 
 
 
 
 
 
570
 
571
+ class scbMultipleChoiceField extends scbFormField {
572
+
573
+ public function validate( $value ) {
574
+ return array_intersect( array_keys( $this->choices ), (array) $value );
575
+ }
576
+
577
+ protected function _render( $args ) {
578
+ $args = wp_parse_args( $args, array(
579
+ 'numeric' => false, // use numeric array instead of associative
580
+ 'checked' => null,
581
+ ) );
582
+
583
+ extract( $args );
584
+
585
+ if ( !is_array( $checked ) )
586
+ $checked = array();
587
+
588
+ $opts = '';
589
+ foreach ( $choices as $value => $title ) {
590
+ $single_input = scbFormField::_checkbox( array(
591
+ 'name' => $name . '[]',
592
+ 'type' => 'checkbox',
593
+ 'value' => $value,
594
+ 'checked' => in_array( $value, $checked ),
595
+ 'desc' => $title,
596
+ 'desc_pos' => 'after'
597
+ ) );
598
+
599
+ $opts .= str_replace( scbForms::TOKEN, $single_input, $wrap_each );
600
  }
601
 
602
+ return scbFormField::add_desc( $opts, $desc, $desc_pos );
603
  }
604
 
605
+ protected function _set_value( &$args, $value ) {
606
+ $args['checked'] = (array) $value;
 
607
  }
608
  }
609
 
 
 
 
 
 
 
610
 
611
+ class scbSingleCheckboxField extends scbFormField {
 
 
612
 
613
+ public function validate( $value ) {
614
+ return (bool) $value;
615
  }
616
 
617
+ protected function _render( $args ) {
618
+ $args = wp_parse_args( $args, array(
619
+ 'value' => true,
620
+ 'desc' => null,
621
+ 'checked' => false,
622
+ 'extra' => array(),
623
+ ) );
624
 
625
+ foreach ( $args as $key => &$val )
626
+ $$key = &$val;
627
+ unset( $val );
628
 
629
+ $extra['checked'] = $checked;
630
+
631
+ if ( is_null( $desc ) && !is_bool( $value ) )
632
+ $desc = str_replace( '[]', '', $value );
633
+
634
+ return scbFormField::_input_gen( $args );
635
  }
636
 
637
+ protected function _set_value( &$args, $value ) {
638
+ $args['checked'] = ( $value || ( isset( $args['value'] ) && $value == $args['value'] ) );
639
+ }
640
+ }
641
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
642
 
643
+ class scbCustomField implements scbFormField_I {
644
+
645
+ protected $args;
646
+
647
+ function __construct( $args ) {
648
+ $this->args = wp_parse_args( $args, array(
649
+ 'render' => 'var_dump',
650
+ 'sanitize' => 'wp_filter_kses',
651
+ ) );
652
+ }
653
+
654
+ public function __get( $key ) {
655
+ return $this->args[ $key ];
656
+ }
657
+
658
+ public function __isset( $key ) {
659
+ return isset( $this->args[ $key ] );
660
+ }
661
+
662
+ public function render( $value = null ) {
663
+ return call_user_func( $this->render, $value, $this );
664
+ }
665
 
666
+ public function validate( $value ) {
667
+ return call_user_func( $this->sanitize, $value, $this );
668
  }
669
  }
670
 
scb/Options.php CHANGED
@@ -35,27 +35,25 @@ class scbOptions {
35
  }
36
 
37
  /**
38
- * Get option values for one, many or all fields
39
  *
40
- * @param string|array $field The field(s) to get
41
  * @return mixed Whatever is in those fields
42
  */
43
- public function get( $field = '' ) {
44
- $data = get_option( $this->key, array() );
45
 
46
- $data = array_merge( $this->defaults, $data );
47
-
48
- return $this->_get( $field, $data );
49
  }
50
 
51
  /**
52
- * Get default values for one, many or all fields
53
  *
54
- * @param string|array $field The field( s ) to get
55
  * @return mixed Whatever is in those fields
56
  */
57
- public function get_defaults( $field = '' ) {
58
- return $this->_get( $field, $this->defaults );
59
  }
60
 
61
  /**
@@ -89,7 +87,7 @@ class scbOptions {
89
  * @return bool
90
  */
91
  public function cleanup() {
92
- $this->update( $this->_clean( $this->get() ) );
93
  }
94
 
95
  /**
@@ -103,7 +101,7 @@ class scbOptions {
103
  if ( $clean )
104
  $newdata = $this->_clean( $newdata );
105
 
106
- update_option( $this->key, $newdata );
107
  }
108
 
109
  /**
@@ -126,27 +124,10 @@ class scbOptions {
126
 
127
  // Keep only the keys defined in $this->defaults
128
  private function _clean( $data ) {
129
- $r = array();
130
- foreach ( array_keys( $this->defaults ) as $key )
131
- if ( isset( $data[$key] ) )
132
- $r[$key] = $data[$key];
133
-
134
- return $r;
135
  }
136
 
137
- // Get one, more or all fields from an array
138
  private function &_get( $field, $data ) {
139
- if ( empty( $field ) )
140
- return $data;
141
-
142
- if ( is_string( $field ) )
143
- return $data[$field];
144
-
145
- foreach ( $field as $key )
146
- if ( isset( $data[$key] ) )
147
- $result[] = $data[$key];
148
-
149
- return $result;
150
  }
151
 
152
  // Magic method: $options->field
35
  }
36
 
37
  /**
38
+ * Get option values for one or all fields
39
  *
40
+ * @param string|array $field The field to get
41
  * @return mixed Whatever is in those fields
42
  */
43
+ public function get( $field = null, $default = null ) {
44
+ $data = array_merge( $this->defaults, get_option( $this->key, array() ) );
45
 
46
+ return scbForms::get_value( $field, $data, $default );
 
 
47
  }
48
 
49
  /**
50
+ * Get default values for one or all fields
51
  *
52
+ * @param string|array $field The field to get
53
  * @return mixed Whatever is in those fields
54
  */
55
+ public function get_defaults( $field = null ) {
56
+ return scbForms::get_value( $field, $this->defaults );
57
  }
58
 
59
  /**
87
  * @return bool
88
  */
89
  public function cleanup() {
90
+ $this->update( $this->get(), true );
91
  }
92
 
93
  /**
101
  if ( $clean )
102
  $newdata = $this->_clean( $newdata );
103
 
104
+ update_option( $this->key, array_merge( $this->get(), $newdata ) );
105
  }
106
 
107
  /**
124
 
125
  // Keep only the keys defined in $this->defaults
126
  private function _clean( $data ) {
127
+ return wp_array_slice_assoc( $data, array_keys( $this->defaults ) );
 
 
 
 
 
128
  }
129
 
 
130
  private function &_get( $field, $data ) {
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
 
133
  // Magic method: $options->field
scb/Table.php CHANGED
@@ -29,18 +29,26 @@ class scbTable {
29
  }
30
  }
31
 
32
-
33
- function scb_register_table( $name ) {
 
 
 
 
 
34
  global $wpdb;
35
 
 
 
 
36
  $wpdb->tables[] = $name;
37
- $wpdb->$name = $wpdb->prefix . $name;
38
  }
39
 
40
- function scb_install_table( $name, $columns, $upgrade_method = 'dbDelta' ) {
41
  global $wpdb;
42
 
43
- $full_table_name = $wpdb->$name;
44
 
45
  $charset_collate = '';
46
  if ( $wpdb->has_cap( 'collation' ) ) {
@@ -62,9 +70,9 @@ function scb_install_table( $name, $columns, $upgrade_method = 'dbDelta' ) {
62
  $wpdb->query( "CREATE TABLE IF NOT EXISTS $full_table_name ( $columns ) $charset_collate;" );
63
  }
64
 
65
- function scb_uninstall_table( $name ) {
66
  global $wpdb;
67
 
68
- $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->$name );
69
  }
70
 
29
  }
30
  }
31
 
32
+ /**
33
+ * Register a table with $wpdb
34
+ *
35
+ * @param string $key The key to be used on the $wpdb object
36
+ * @param string $name The actual name of the table, without $wpdb->prefix
37
+ */
38
+ function scb_register_table( $key, $name = false ) {
39
  global $wpdb;
40
 
41
+ if ( !$name )
42
+ $name = $key;
43
+
44
  $wpdb->tables[] = $name;
45
+ $wpdb->$key = $wpdb->prefix . $name;
46
  }
47
 
48
+ function scb_install_table( $key, $columns, $upgrade_method = 'dbDelta' ) {
49
  global $wpdb;
50
 
51
+ $full_table_name = $wpdb->$key;
52
 
53
  $charset_collate = '';
54
  if ( $wpdb->has_cap( 'collation' ) ) {
70
  $wpdb->query( "CREATE TABLE IF NOT EXISTS $full_table_name ( $columns ) $charset_collate;" );
71
  }
72
 
73
+ function scb_uninstall_table( $key ) {
74
  global $wpdb;
75
 
76
+ $wpdb->query( "DROP TABLE IF EXISTS " . $wpdb->$key );
77
  }
78
 
scb/Util.php CHANGED
@@ -40,6 +40,7 @@ class scbUtil {
40
  add_action( 'scb_activation_' . plugin_basename( $plugin ), $callback );
41
  }
42
 
 
43
  static function do_activation( $plugin ) {
44
  do_action( 'scb_activation_' . plugin_basename( $plugin ) );
45
  }
@@ -47,11 +48,15 @@ class scbUtil {
47
  // Allows more than one uninstall hooks.
48
  // Also prevents an UPDATE query on each page load.
49
  static function add_uninstall_hook( $plugin, $callback ) {
 
 
 
50
  register_uninstall_hook( $plugin, '__return_false' ); // dummy
51
 
52
  add_action( 'uninstall_' . plugin_basename( $plugin ), $callback );
53
  }
54
 
 
55
  static function do_uninstall( $plugin ) {
56
  do_action( 'uninstall_' . plugin_basename( $plugin ) );
57
  }
@@ -114,7 +119,7 @@ class scbUtil {
114
 
115
  // Return a standard admin notice
116
  function scb_admin_notice( $msg, $class = 'updated' ) {
117
- return "<div class='$class fade'><p>$msg</p></div>\n";
118
  }
119
 
120
  // Transform a list of objects into an associative array
@@ -140,6 +145,8 @@ function scb_list_fold( $list, $key, $value ) {
140
  */
141
  if ( ! function_exists( 'html' ) ):
142
  function html( $tag ) {
 
 
143
  $args = func_get_args();
144
 
145
  $tag = array_shift( $args );
@@ -160,7 +167,7 @@ function html( $tag ) {
160
  list( $closing ) = explode( ' ', $tag, 2 );
161
  }
162
 
163
- if ( in_array( $closing, array( 'area', 'base', 'basefont', 'br', 'hr', 'input', 'img', 'link', 'meta' ) ) ) {
164
  return "<{$tag} />";
165
  }
166
 
@@ -180,6 +187,18 @@ function html_link( $url, $title = '' ) {
180
  }
181
  endif;
182
 
 
 
 
 
 
 
 
 
 
 
 
 
183
 
184
  //_____Compatibility layer_____
185
 
40
  add_action( 'scb_activation_' . plugin_basename( $plugin ), $callback );
41
  }
42
 
43
+ // For debugging
44
  static function do_activation( $plugin ) {
45
  do_action( 'scb_activation_' . plugin_basename( $plugin ) );
46
  }
48
  // Allows more than one uninstall hooks.
49
  // Also prevents an UPDATE query on each page load.
50
  static function add_uninstall_hook( $plugin, $callback ) {
51
+ if ( !is_admin() )
52
+ return;
53
+
54
  register_uninstall_hook( $plugin, '__return_false' ); // dummy
55
 
56
  add_action( 'uninstall_' . plugin_basename( $plugin ), $callback );
57
  }
58
 
59
+ // For debugging
60
  static function do_uninstall( $plugin ) {
61
  do_action( 'uninstall_' . plugin_basename( $plugin ) );
62
  }
119
 
120
  // Return a standard admin notice
121
  function scb_admin_notice( $msg, $class = 'updated' ) {
122
+ return html( "div class='$class fade'", html( "p", $msg ) );
123
  }
124
 
125
  // Transform a list of objects into an associative array
145
  */
146
  if ( ! function_exists( 'html' ) ):
147
  function html( $tag ) {
148
+ static $SELF_CLOSING_TAGS = array( 'area', 'base', 'basefont', 'br', 'hr', 'input', 'img', 'link', 'meta' );
149
+
150
  $args = func_get_args();
151
 
152
  $tag = array_shift( $args );
167
  list( $closing ) = explode( ' ', $tag, 2 );
168
  }
169
 
170
+ if ( in_array( $closing, $SELF_CLOSING_TAGS ) ) {
171
  return "<{$tag} />";
172
  }
173
 
187
  }
188
  endif;
189
 
190
+ function scb_get_query_flags( $wp_query = null ) {
191
+ if ( !$wp_query )
192
+ $wp_query = $GLOBALS['wp_query'];
193
+
194
+ $flags = array();
195
+ foreach ( get_object_vars( $wp_query ) as $key => $val ) {
196
+ if ( 'is_' == substr( $key, 0, 3 ) && $val )
197
+ $flags[] = substr( $key, 3 );
198
+ }
199
+
200
+ return $flags;
201
+ }
202
 
203
  //_____Compatibility layer_____
204
 
scb/load.php CHANGED
@@ -1,15 +1,20 @@
1
  <?php
2
 
3
- $GLOBALS['_scb_data'] = array( 44, __FILE__, array(
4
  'scbUtil', 'scbOptions', 'scbForms', 'scbTable',
5
  'scbWidget', 'scbAdminPage', 'scbBoxesPage',
6
  'scbCron', 'scbHooks',
7
  ) );
8
 
9
  if ( !class_exists( 'scbLoad4' ) ) :
 
 
 
 
 
10
  class scbLoad4 {
11
 
12
- private static $candidates;
13
  private static $classes;
14
  private static $callbacks = array();
15
 
@@ -27,8 +32,10 @@ class scbLoad4 {
27
  add_action( 'activate_plugin', array( __CLASS__, 'delayed_activation' ) );
28
  }
29
 
30
- // TODO: don't load when activating a plugin ?
31
- add_action( 'plugins_loaded', array( __CLASS__, 'load' ), 9, 0 );
 
 
32
  }
33
 
34
  static function delayed_activation( $plugin ) {
1
  <?php
2
 
3
+ $GLOBALS['_scb_data'] = array( 57, __FILE__, array(
4
  'scbUtil', 'scbOptions', 'scbForms', 'scbTable',
5
  'scbWidget', 'scbAdminPage', 'scbBoxesPage',
6
  'scbCron', 'scbHooks',
7
  ) );
8
 
9
  if ( !class_exists( 'scbLoad4' ) ) :
10
+ /**
11
+ * The main idea behind this class is to load the most recent version of the scb classes available.
12
+ *
13
+ * It waits until all plugins are loaded and then does some crazy hacks to make activation hooks work.
14
+ */
15
  class scbLoad4 {
16
 
17
+ private static $candidates = array();
18
  private static $classes;
19
  private static $callbacks = array();
20
 
32
  add_action( 'activate_plugin', array( __CLASS__, 'delayed_activation' ) );
33
  }
34
 
35
+ if ( did_action( 'plugins_loaded' ) )
36
+ self::load();
37
+ else
38
+ add_action( 'plugins_loaded', array( __CLASS__, 'load' ), 9, 0 );
39
  }
40
 
41
  static function delayed_activation( $plugin ) {
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
template-tags.php CHANGED
@@ -63,7 +63,7 @@ function get_users_browsing_page( $page_url = '' ) {
63
  function users_online_page() {
64
  global $wpdb;
65
 
66
- $usersonline = $wpdb->get_results( "SELECT * FROM $wpdb->useronline" );
67
 
68
  $user_buckets = array();
69
  foreach ( $usersonline as $useronline )
@@ -122,7 +122,7 @@ class UserOnline_Template {
122
  $where = $wpdb->prepare( 'WHERE page_url = %s', $page_url );
123
  }
124
 
125
- self::$cache[$type . $page_url] = $wpdb->get_results( "SELECT * FROM $wpdb->useronline $where" );
126
  }
127
 
128
  $users = self::$cache[$type . $page_url];
@@ -184,7 +184,7 @@ class UserOnline_Template {
184
  }
185
 
186
  function detailed_list( $counts, $user_buckets, $nicetexts ) {
187
- UserOnline_Core::$add_script = true;
188
 
189
  if ( $counts['user'] == 0 )
190
  return html( 'h2', __( 'No one is online now.', 'wp-useronline' ) );
@@ -233,8 +233,8 @@ class UserOnline_Template {
233
 
234
  function format_ip( $ip ) {
235
  if ( current_user_can( 'edit_users' ) && !empty( $ip ) && $ip != 'unknown' )
236
- return
237
- html( 'span', array('dir' => 'ltr'),
238
  html( 'a', array(
239
  'href' => 'http://whois.domaintools.com/' . $ip,
240
  'title' => gethostbyaddr( $ip ),
63
  function users_online_page() {
64
  global $wpdb;
65
 
66
+ $usersonline = $wpdb->get_results( "SELECT * FROM $wpdb->useronline ORDER BY timestamp DESC" );
67
 
68
  $user_buckets = array();
69
  foreach ( $usersonline as $useronline )
122
  $where = $wpdb->prepare( 'WHERE page_url = %s', $page_url );
123
  }
124
 
125
+ self::$cache[$type . $page_url] = $wpdb->get_results( "SELECT * FROM $wpdb->useronline $where ORDER BY timestamp DESC" );
126
  }
127
 
128
  $users = self::$cache[$type . $page_url];
184
  }
185
 
186
  function detailed_list( $counts, $user_buckets, $nicetexts ) {
187
+ UserOnline_Core::$add_script = true;
188
 
189
  if ( $counts['user'] == 0 )
190
  return html( 'h2', __( 'No one is online now.', 'wp-useronline' ) );
233
 
234
  function format_ip( $ip ) {
235
  if ( current_user_can( 'edit_users' ) && !empty( $ip ) && $ip != 'unknown' )
236
+ return
237
+ html( 'span', array('dir' => 'ltr'),
238
  html( 'a', array(
239
  'href' => 'http://whois.domaintools.com/' . $ip,
240
  'title' => gethostbyaddr( $ip ),
wp-useronline.php CHANGED
@@ -3,25 +3,8 @@
3
  Plugin Name: WP-UserOnline
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-useronline/
5
  Description: Enable you to display how many users are online on your Wordpress site
6
- Version: 2.81
7
  Author: Lester 'GaMerZ' Chan & scribu
8
-
9
-
10
- Copyright 2009 Lester Chan ( email : lesterchan@gmail.com )
11
-
12
- This program is free software; you can redistribute it and/or modify
13
- it under the terms of the GNU General Public License as published by
14
- the Free Software Foundation; either version 2 of the License, or
15
- ( at your option ) any later version.
16
-
17
- This program is distributed in the hope that it will be useful,
18
- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- GNU General Public License for more details.
21
-
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
  */
26
 
27
  @include dirname( __FILE__ ) . '/scb/load.php';
@@ -39,7 +22,7 @@ function _useronline_init() {
39
  user_type varchar( 20 ) NOT NULL default 'guest',
40
  user_id bigint( 20 ) NOT NULL default 0,
41
  user_name varchar( 250 ) NOT NULL default '',
42
- user_ip varchar( 20 ) NOT NULL default '',
43
  user_agent text NOT NULL,
44
  page_title text NOT NULL,
45
  page_url varchar( 255 ) NOT NULL default '',
3
  Plugin Name: WP-UserOnline
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-useronline/
5
  Description: Enable you to display how many users are online on your Wordpress site
6
+ Version: 2.82
7
  Author: Lester 'GaMerZ' Chan & scribu
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  */
9
 
10
  @include dirname( __FILE__ ) . '/scb/load.php';
22
  user_type varchar( 20 ) NOT NULL default 'guest',
23
  user_id bigint( 20 ) NOT NULL default 0,
24
  user_name varchar( 250 ) NOT NULL default '',
25
+ user_ip varchar( 39 ) NOT NULL default '',
26
  user_agent text NOT NULL,
27
  page_title text NOT NULL,
28
  page_url varchar( 255 ) NOT NULL default '',