WP-UserOnline - Version 2.81

Version Description

  • fixed settings page
  • fixed "Return to default" buttons
  • show user list in admin only to users with 'manage_options' capability
  • added 'useronline_bots' filter
Download this release

Release Info

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

Code changes from version 2.80 to 2.81

admin.php CHANGED
@@ -10,14 +10,17 @@ class UserOnline_Admin_Integration extends scbAdminPage {
10
  'menu_title' => __( 'WP-UserOnline', $this->textdomain ),
11
  'page_slug' => 'useronline',
12
  'parent' => 'index.php',
13
- 'capability' => 'read',
14
  'action_link' => false,
 
15
  );
16
 
17
  add_action( 'rightnow_end', array( $this, 'rightnow' ) );
18
  }
19
 
20
  function rightnow() {
 
 
 
21
  $total_users = get_users_online_count();
22
 
23
  $str = _n(
@@ -99,45 +102,47 @@ class UserOnline_Options extends scbAdminPage {
99
  function page_content() {
100
  $options = $this->options->get();
101
  $defaults = $this->options->get_defaults();
102
- ?>
103
- <form method="post" action="options.php">
104
- <?php settings_fields( $this->option_name ); ?>
105
 
 
 
 
106
  <table class="form-table">
107
  <?php
108
  $rows = array(
109
  array(
110
  'title' => __( 'Time Out', 'wp-useronline' ),
111
  'type' => 'text',
112
- 'name_tree' => 'timeout',
113
- 'desc' => '<br />' . __( 'How long until it will remove the user from the database ( In seconds ).', 'wp-useronline' ),
114
  'extra' => 'size="4"'
115
  ),
116
 
117
  array(
118
  'title' => __( 'UserOnline URL', 'wp-useronline' ),
119
  'type' => 'text',
120
- 'name_tree' => 'url',
121
  'desc' => '<br />' . __( 'URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br />Example: http://www.yoursite.com/?page_id=2', 'wp-useronline' ),
122
  ),
123
 
124
  array(
125
  'title' => __( 'User Names', 'wp-useronline' ),
126
  'type' => 'checkbox',
127
- 'name_tree' => 'names',
128
  'desc' => __( 'Link user names to their author page', 'wp-useronline' ),
129
  ),
130
  );
131
 
132
- foreach ( $rows as $row )
133
  echo $this->table_row( $row );
 
 
134
  ?>
135
  <tbody id="default_naming" style="display:none">
136
- <?php $this->formdata = $defaults; $this->naming_table(); ?>
137
  </tbody>
138
 
139
  <tbody id="current_naming">
140
- <?php $this->formdata = $options; $this->naming_table(); ?>
141
  </tbody>
142
 
143
  </table>
@@ -145,11 +150,11 @@ class UserOnline_Options extends scbAdminPage {
145
  <h3><?php _e( 'Useronline Templates', 'wp-useronline' ); ?></h3>
146
  <table class="form-table">
147
  <tbody id="default_template_useronline" style="display:none">
148
- <?php $this->formdata = $defaults; $this->useronline_template_table(); ?>
149
  </tbody>
150
 
151
  <tbody id="current_template_useronline">
152
- <?php $this->formdata = $options; $this->useronline_template_table(); ?>
153
  </tbody>
154
 
155
  <?php
@@ -159,22 +164,22 @@ class UserOnline_Options extends scbAdminPage {
159
  );
160
  foreach ( $templates as $name => $title ) { ?>
161
  <tbody id="default_template_<?php echo $name; ?>" style="display:none">
162
- <?php $this->formdata = $defaults; $this->template_table( $title, $name ); ?>
163
  </tbody>
164
 
165
  <tbody id="current_template_<?php echo $name; ?>">
166
- <?php $this->formdata = $options; $this->template_table( $title, $name ); ?>
167
  </tbody>
168
  <?php } ?>
169
  </table>
170
  <p class="submit">
171
- <input type="submit" name="Submit" class="button" value="<?php _e( 'Save Changes', 'wp-useronline' ); ?>" />
172
  </p>
173
  </form>
174
  <?php
175
  }
176
 
177
- private function naming_table() {
178
  ?>
179
  <tr>
180
  <td width="30%">
@@ -198,10 +203,10 @@ class UserOnline_Options extends scbAdminPage {
198
  foreach ( array( $tmp, $tmp . 's' ) as $type ) {
199
  echo $this->input( array(
200
  'type' => 'text',
201
- 'name_tree' => array( 'naming', $type ),
202
  'extra' => 'size="30"',
203
  'desc' => html( 'td', '%input%' )
204
- ) );
205
  }
206
  echo "\n</tr>\n";
207
  }
@@ -214,7 +219,7 @@ class UserOnline_Options extends scbAdminPage {
214
  <?php
215
  }
216
 
217
- private function useronline_template_table() {
218
  ?>
219
  <tr>
220
  <td width="30%">
@@ -229,14 +234,14 @@ class UserOnline_Options extends scbAdminPage {
229
  <td>
230
  <?php echo $this->input( array(
231
  'type' => 'textarea',
232
- 'name_tree' => array( 'templates', 'useronline' ),
233
- ) ); ?>
234
  </td>
235
  </tr>
236
  <?php
237
  }
238
 
239
- private function template_table( $title, $option ) {
240
  ?>
241
  <tr>
242
  <td width="30%">
@@ -245,9 +250,9 @@ class UserOnline_Options extends scbAdminPage {
245
  - %USERS%<br />
246
  - %MEMBERS%<br />
247
  - %MEMBER_NAMES%<br />
248
- - %GUESTS_SEPERATOR%<br />
249
  - %GUESTS%<br />
250
- - %BOTS_SEPERATOR%<br />
251
  - %BOTS%<br /><br />
252
  <input type="button" value="<?php _e( 'Restore Default Template', 'wp-useronline' ); ?>" onclick="useronline_default_template( '<?php echo $option; ?>' );" class="button" />
253
  </td>
@@ -264,17 +269,17 @@ class UserOnline_Options extends scbAdminPage {
264
  <?php foreach ( array_keys( $this->options->templates[$option]['separators'] ) as $type ) {
265
  echo html( 'td', $this->input( array(
266
  'type' => 'text',
267
- 'name_tree' => array( 'templates', $option, 'separators', $type ),
268
  'extra' => "size='15'",
269
- ) ) );
270
  } ?>
271
  </tr>
272
  </table>
273
  <br />
274
  <?php echo $this->input( array(
275
  'type' => 'textarea',
276
- 'name_tree' => array( 'templates', $option, 'text' )
277
- ) ); ?>
278
  </td>
279
  </tr>
280
  <?php
10
  'menu_title' => __( 'WP-UserOnline', $this->textdomain ),
11
  'page_slug' => 'useronline',
12
  'parent' => 'index.php',
 
13
  'action_link' => false,
14
+ 'capability' => 'list_users',
15
  );
16
 
17
  add_action( 'rightnow_end', array( $this, 'rightnow' ) );
18
  }
19
 
20
  function rightnow() {
21
+ if ( !current_user_can( 'manage_options' ) )
22
+ return;
23
+
24
  $total_users = get_users_online_count();
25
 
26
  $str = _n(
102
  function page_content() {
103
  $options = $this->options->get();
104
  $defaults = $this->options->get_defaults();
 
 
 
105
 
106
+ ?>
107
+ <form method="post" action="">
108
+ <?php wp_nonce_field( $this->nonce ); ?>
109
  <table class="form-table">
110
  <?php
111
  $rows = array(
112
  array(
113
  'title' => __( 'Time Out', 'wp-useronline' ),
114
  'type' => 'text',
115
+ 'name' => 'timeout',
116
+ 'desc' => '<br />' . __( 'How long until it will remove the user from the database (in seconds).', 'wp-useronline' ),
117
  'extra' => 'size="4"'
118
  ),
119
 
120
  array(
121
  'title' => __( 'UserOnline URL', 'wp-useronline' ),
122
  'type' => 'text',
123
+ 'name' => 'url',
124
  'desc' => '<br />' . __( 'URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br />Example: http://www.yoursite.com/?page_id=2', 'wp-useronline' ),
125
  ),
126
 
127
  array(
128
  'title' => __( 'User Names', 'wp-useronline' ),
129
  'type' => 'checkbox',
130
+ 'name' => 'names',
131
  'desc' => __( 'Link user names to their author page', 'wp-useronline' ),
132
  ),
133
  );
134
 
135
+ foreach ( $rows as $row ) {
136
  echo $this->table_row( $row );
137
+ }
138
+
139
  ?>
140
  <tbody id="default_naming" style="display:none">
141
+ <?php $this->naming_table( $defaults ); ?>
142
  </tbody>
143
 
144
  <tbody id="current_naming">
145
+ <?php $this->naming_table( $options ); ?>
146
  </tbody>
147
 
148
  </table>
150
  <h3><?php _e( 'Useronline Templates', 'wp-useronline' ); ?></h3>
151
  <table class="form-table">
152
  <tbody id="default_template_useronline" style="display:none">
153
+ <?php $this->useronline_template_table( $defaults ); ?>
154
  </tbody>
155
 
156
  <tbody id="current_template_useronline">
157
+ <?php $this->useronline_template_table( $options ); ?>
158
  </tbody>
159
 
160
  <?php
164
  );
165
  foreach ( $templates as $name => $title ) { ?>
166
  <tbody id="default_template_<?php echo $name; ?>" style="display:none">
167
+ <?php $this->template_table( $title, $name, $defaults ); ?>
168
  </tbody>
169
 
170
  <tbody id="current_template_<?php echo $name; ?>">
171
+ <?php $this->template_table( $title, $name, $options ); ?>
172
  </tbody>
173
  <?php } ?>
174
  </table>
175
  <p class="submit">
176
+ <input type="submit" name="action" class="button" value="<?php _e( 'Save Changes', 'wp-useronline' ); ?>" />
177
  </p>
178
  </form>
179
  <?php
180
  }
181
 
182
+ private function naming_table( $data ) {
183
  ?>
184
  <tr>
185
  <td width="30%">
203
  foreach ( array( $tmp, $tmp . 's' ) as $type ) {
204
  echo $this->input( array(
205
  'type' => 'text',
206
+ 'name' => array( 'naming', $type ),
207
  'extra' => 'size="30"',
208
  'desc' => html( 'td', '%input%' )
209
+ ), $data );
210
  }
211
  echo "\n</tr>\n";
212
  }
219
  <?php
220
  }
221
 
222
+ private function useronline_template_table( $data ) {
223
  ?>
224
  <tr>
225
  <td width="30%">
234
  <td>
235
  <?php echo $this->input( array(
236
  'type' => 'textarea',
237
+ 'name' => array( 'templates', 'useronline' ),
238
+ ), $data ); ?>
239
  </td>
240
  </tr>
241
  <?php
242
  }
243
 
244
+ private function template_table( $title, $option, $data ) {
245
  ?>
246
  <tr>
247
  <td width="30%">
250
  - %USERS%<br />
251
  - %MEMBERS%<br />
252
  - %MEMBER_NAMES%<br />
253
+ - %GUESTS_SEPARATOR%<br />
254
  - %GUESTS%<br />
255
+ - %BOTS_SEPARATOR%<br />
256
  - %BOTS%<br /><br />
257
  <input type="button" value="<?php _e( 'Restore Default Template', 'wp-useronline' ); ?>" onclick="useronline_default_template( '<?php echo $option; ?>' );" class="button" />
258
  </td>
269
  <?php foreach ( array_keys( $this->options->templates[$option]['separators'] ) as $type ) {
270
  echo html( 'td', $this->input( array(
271
  'type' => 'text',
272
+ 'name' => array( 'templates', $option, 'separators', $type ),
273
  'extra' => "size='15'",
274
+ ), $data ) );
275
  } ?>
276
  </tr>
277
  </table>
278
  <br />
279
  <?php echo $this->input( array(
280
  'type' => 'textarea',
281
+ 'name' => array( 'templates', $option, 'text' )
282
+ ), $data ); ?>
283
  </td>
284
  </tr>
285
  <?php
core.php CHANGED
@@ -76,10 +76,40 @@ class UserOnline_Core {
76
  $current_user = wp_get_current_user();
77
 
78
  // Check For Bot
79
- $bots = array( 'Google Bot' => 'googlebot', 'Google Bot' => 'google', 'MSN' => 'msnbot', 'Alex' => 'ia_archiver', 'Lycos' => 'lycos', 'Ask Jeeves' => 'jeeves', 'Altavista' => 'scooter', 'AllTheWeb' => 'fast-webcrawler', 'Inktomi' => 'slurp@inktomi', 'Turnitin.com' => 'turnitinbot', 'Technorati' => 'technorati', 'Yahoo' => 'yahoo', 'Findexa' => 'findexa', 'NextLinks' => 'findlinks', 'Gais' => 'gaisbo', 'WiseNut' => 'zyborg', 'WhoisSource' => 'surveybot', 'Bloglines' => 'bloglines', 'BlogSearch' => 'blogsearch', 'PubSub' => 'pubsub', 'Syndic8' => 'syndic8', 'RadioUserland' => 'userland', 'Gigabot' => 'gigabot', 'Become.com' => 'become.com', 'Baidu' => 'baidu', 'Yandex' => 'yandex', 'Amazon' => 'amazonaws.com' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  $bot_found = false;
82
- foreach ( $bots as $name => $lookfor )
83
  if ( stristr( $user_agent, $lookfor ) !== false ) {
84
  $user_id = 0;
85
  $user_name = $name;
@@ -89,6 +119,7 @@ class UserOnline_Core {
89
 
90
  break;
91
  }
 
92
 
93
  // If No Bot Is Found, Then We Check Members And Guests
94
  if ( !$bot_found ) {
76
  $current_user = wp_get_current_user();
77
 
78
  // Check For Bot
79
+ $bots = array(
80
+ 'Google Bot' => 'google',
81
+ 'MSN' => 'msnbot',
82
+ 'BingBot' => 'bingbot',
83
+ 'Alex' => 'ia_archiver',
84
+ 'Lycos' => 'lycos',
85
+ 'Ask Jeeves' => 'jeeves',
86
+ 'Altavista' => 'scooter',
87
+ 'AllTheWeb' => 'fast-webcrawler',
88
+ 'Inktomi' => 'slurp@inktomi',
89
+ 'Turnitin.com' => 'turnitinbot',
90
+ 'Technorati' => 'technorati',
91
+ 'Yahoo' => 'yahoo',
92
+ 'Findexa' => 'findexa',
93
+ 'NextLinks' => 'findlinks',
94
+ 'Gais' => 'gaisbo',
95
+ 'WiseNut' => 'zyborg',
96
+ 'WhoisSource' => 'surveybot',
97
+ 'Bloglines' => 'bloglines',
98
+ 'BlogSearch' => 'blogsearch',
99
+ 'PubSub' => 'pubsub',
100
+ 'Syndic8' => 'syndic8',
101
+ 'RadioUserland' => 'userland',
102
+ 'Gigabot' => 'gigabot',
103
+ 'Become.com' => 'become.com',
104
+ 'Baidu' => 'baidu',
105
+ 'Yandex' => 'yandex',
106
+ 'Amazon' => 'amazonaws.com'
107
+ );
108
+
109
+ $bots = apply_filters( 'useronline_bots', $bots );
110
 
111
  $bot_found = false;
112
+ foreach ( $bots as $name => $lookfor ) {
113
  if ( stristr( $user_agent, $lookfor ) !== false ) {
114
  $user_id = 0;
115
  $user_name = $name;
119
 
120
  break;
121
  }
122
+ }
123
 
124
  // If No Bot Is Found, Then We Check Members And Guests
125
  if ( !$bot_found ) {
lang/wp-useronline-et.mo ADDED
Binary file
lang/wp-useronline-et.po ADDED
@@ -0,0 +1,361 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-useronline\n"
5
+ "POT-Creation-Date: 2010-09-20 15:01+0300\n"
6
+ "PO-Revision-Date: 2011-03-12 13:40+0200\n"
7
+ "Last-Translator: illimar <illimartambek@gmail.com>\n"
8
+ "Language-Team: Illimar Tambek <illimartambek@gmail.com>\n"
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: Estonia\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-Language: Estonian\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: admin.php:9
19
+ msgid "Users Online Now"
20
+ msgstr "Kasutajate arv lehel"
21
+
22
+ #. #-#-#-#-# wp-useronline.pot (WP-UserOnline 2.80) #-#-#-#-#
23
+ #. Plugin Name of the plugin/theme
24
+ #: admin.php:10
25
+ #: wp-stats.php:14
26
+ #: wp-stats.php:31
27
+ msgid "WP-UserOnline"
28
+ msgstr "WP-UserOnline"
29
+
30
+ #: admin.php:24
31
+ #, php-format
32
+ msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
33
+ msgstr "Hetkel on lehel <strong><a href='%s'>%s kasutaja</a></strong>."
34
+
35
+ #: admin.php:52
36
+ msgid "UserOnline Options"
37
+ msgstr "UserOnline valikud"
38
+
39
+ #: admin.php:53
40
+ #: widget.php:6
41
+ #: widget.php:49
42
+ msgid "UserOnline"
43
+ msgstr "UserOnline"
44
+
45
+ #: admin.php:110
46
+ msgid "Time Out"
47
+ msgstr "Timeout"
48
+
49
+ #: admin.php:113
50
+ msgid "How long until it will remove the user from the database ( In seconds )."
51
+ msgstr "Kui kaua oodata, enne kui kasutaja eemaldatakse andmebaasist (sekundites)."
52
+
53
+ #: admin.php:118
54
+ msgid "UserOnline URL"
55
+ msgstr "UserOnline aadress"
56
+
57
+ #: admin.php:121
58
+ msgid "URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br />Example: http://www.yoursite.com/?page_id=2"
59
+ msgstr "UserOnline lehe aadress<br />Näiteks: http://www.sinuleht.ee/useronline/<br />Näiteks: http://www.sinuleht.ee/?page_id=2"
60
+
61
+ #: admin.php:125
62
+ msgid "User Names"
63
+ msgstr "Kasutajate nimed"
64
+
65
+ #: admin.php:128
66
+ msgid "Link user names to their author page"
67
+ msgstr "Kasutajanimed lingivad autori arhiivile"
68
+
69
+ #: admin.php:145
70
+ msgid "Useronline Templates"
71
+ msgstr "Useronline mallid"
72
+
73
+ #: admin.php:157
74
+ msgid "User(s) Browsing Site:"
75
+ msgstr "Kasutaja(d), kes on saidil:"
76
+
77
+ #: admin.php:158
78
+ msgid "User(s) Browsing Page:"
79
+ msgstr "Kasutaja(d), kes vaatavad seda lehte"
80
+
81
+ #: admin.php:171
82
+ #: scb/AdminPage.php:179
83
+ #: scb/AdminPage.php:189
84
+ msgid "Save Changes"
85
+ msgstr "Salvesta muutused"
86
+
87
+ #: admin.php:181
88
+ msgid "Naming Conventions:"
89
+ msgstr "Nimetamine:"
90
+
91
+ #: admin.php:182
92
+ #: admin.php:222
93
+ #: admin.php:244
94
+ msgid "Allowed Variables:"
95
+ msgstr "Lubatud muutujad:"
96
+
97
+ #: admin.php:184
98
+ msgid "Restore Defaults"
99
+ msgstr "Taasta algseaded"
100
+
101
+ #: admin.php:190
102
+ msgid "Singular Form"
103
+ msgstr "Ainsuse vorm"
104
+
105
+ #: admin.php:191
106
+ msgid "Plural Form"
107
+ msgstr "Mitmuse vorm"
108
+
109
+ #: admin.php:221
110
+ msgid "User(s) Online:"
111
+ msgstr "Kasutaja(id) lehel:"
112
+
113
+ #: admin.php:227
114
+ #: admin.php:252
115
+ msgid "Restore Default Template"
116
+ msgstr "Taasta algne mall"
117
+
118
+ #: admin.php:258
119
+ msgid "Member Names Separator"
120
+ msgstr "Liikmete nimede eraldaja"
121
+
122
+ #: admin.php:259
123
+ msgid "Guests Separator"
124
+ msgstr "Külaliste eraldaja"
125
+
126
+ #: admin.php:260
127
+ msgid "Bots Separator"
128
+ msgstr "Bottide eraldaja"
129
+
130
+ #: core.php:109
131
+ msgid "Guest"
132
+ msgstr "külaline"
133
+
134
+ #: core.php:180
135
+ msgid "Admin"
136
+ msgstr "Haldur"
137
+
138
+ #: core.php:186
139
+ msgid "Archive"
140
+ msgstr "Arhiiv"
141
+
142
+ #: scb/AdminPage.php:167
143
+ msgid "Settings <strong>saved</strong>."
144
+ msgstr "Seaded <strong>salvestati</strong>."
145
+
146
+ #: scb/AdminPage.php:371
147
+ msgid "Settings"
148
+ msgstr "Seaded"
149
+
150
+ #: template-tags.php:81
151
+ #, php-format
152
+ msgid "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
153
+ msgstr "Hetkel on lehel <strong>%s</strong>: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
154
+
155
+ #: template-tags.php:190
156
+ msgid "No one is online now."
157
+ msgstr "Hetkel ei ole lehel kedagi."
158
+
159
+ #: template-tags.php:192
160
+ msgid "on"
161
+ msgstr " "
162
+
163
+ #: template-tags.php:193
164
+ msgid "url"
165
+ msgstr "link"
166
+
167
+ #: template-tags.php:194
168
+ msgid "referral"
169
+ msgstr "viitaja"
170
+
171
+ #: template-tags.php:205
172
+ msgid "Online Now"
173
+ msgstr "hetkel lehel"
174
+
175
+ #: template-tags.php:247
176
+ #: template-tags.php:249
177
+ #, php-format
178
+ msgid "%s @ %s"
179
+ msgstr "%s kell %s"
180
+
181
+ #: template-tags.php:269
182
+ #, php-format
183
+ msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
184
+ msgstr "Kõige rohkem kasutajaid (<strong>%s</strong>) oli lehel <strong>%s</strong>"
185
+
186
+ #: widget.php:5
187
+ msgid "WP-UserOnline users online statistics"
188
+ msgstr "WP-USerOnline kasutajate lehel viibimise statistika"
189
+
190
+ #: widget.php:56
191
+ msgid "Title:"
192
+ msgstr "Pealkiri:"
193
+
194
+ #: widget.php:59
195
+ msgid "Statistics Type:"
196
+ msgstr "Statistika:"
197
+
198
+ #: widget.php:61
199
+ msgid "Users Online Count"
200
+ msgstr "Kasutajate arv lehel"
201
+
202
+ #: widget.php:62
203
+ msgid "Users Browsing Current Page"
204
+ msgstr "Kasutajad, kes vaatavad seda lehte"
205
+
206
+ #: widget.php:63
207
+ msgid "Users Browsing Site"
208
+ msgstr "Kasutajaid lehel"
209
+
210
+ #: widget.php:65
211
+ msgid "Users Online Count & Users Browsing Current Page"
212
+ msgstr "Kasutajaid lehel & Kasutajad sellel lehel"
213
+
214
+ #: widget.php:66
215
+ msgid "Users Online Count & Users Browsing Site"
216
+ msgstr "Kasutajate arv lehel & Kasutajad, kes vaatavad saiti"
217
+
218
+ #: wp-stats.php:24
219
+ #, php-format
220
+ msgid "<strong>%s</strong> user online now."
221
+ msgstr "<strong>%s</strong> kasutaja lehel."
222
+
223
+ #: wp-useronline.php:61
224
+ msgid "1 User"
225
+ msgstr "1 kasutaja"
226
+
227
+ #: wp-useronline.php:62
228
+ msgid "%COUNT% Users"
229
+ msgstr "%COUNT% kasutajat"
230
+
231
+ #: wp-useronline.php:63
232
+ msgid "1 Member"
233
+ msgstr "1 liige"
234
+
235
+ #: wp-useronline.php:64
236
+ msgid "%COUNT% Members"
237
+ msgstr "%COUNT% liiget"
238
+
239
+ #: wp-useronline.php:65
240
+ msgid "1 Guest"
241
+ msgstr "1 külastaja"
242
+
243
+ #: wp-useronline.php:66
244
+ msgid "%COUNT% Guests"
245
+ msgstr "%COUNT% külalist"
246
+
247
+ #: wp-useronline.php:67
248
+ msgid "1 Bot"
249
+ msgstr "1 bot"
250
+
251
+ #: wp-useronline.php:68
252
+ msgid "%COUNT% Bots"
253
+ msgstr "%COUNT% botti"
254
+
255
+ #: wp-useronline.php:72
256
+ msgid "Online"
257
+ msgstr "lehel"
258
+
259
+ #: wp-useronline.php:76
260
+ #: wp-useronline.php:77
261
+ #: wp-useronline.php:78
262
+ #: wp-useronline.php:85
263
+ #: wp-useronline.php:86
264
+ #: wp-useronline.php:87
265
+ msgid ","
266
+ msgstr ","
267
+
268
+ #: wp-useronline.php:80
269
+ #: wp-useronline.php:89
270
+ msgctxt "Template Element"
271
+ msgid "Users"
272
+ msgstr "kasutajat"
273
+
274
+ #: wp-useronline.php:89
275
+ msgid "Browsing This Page."
276
+ msgstr "vaatavad seda lehte."
277
+
278
+ #. Plugin URI of the plugin/theme
279
+ msgid "http://wordpress.org/extend/plugins/wp-useronline/"
280
+ msgstr "http://wordpress.org/extend/plugins/wp-useronline/"
281
+
282
+ #. Description of the plugin/theme
283
+ msgid "Enable you to display how many users are online on your Wordpress site"
284
+ msgstr "Võimaldab näidata, kui palju kasutajaid hetkel sinu Wordpressi lehel viibib"
285
+
286
+ #. Author of the plugin/theme
287
+ msgid "Lester 'GaMerZ' Chan & scribu"
288
+ msgstr "Lester 'GaMerZ' Chan & scribu"
289
+
290
+ #~ msgid "WordPress Options"
291
+ #~ msgstr "WordPressi seaded"
292
+
293
+ #~ msgid "WordPress Tables"
294
+ #~ msgstr "WordPressi tabelid"
295
+
296
+ #~ msgid "Yes"
297
+ #~ msgstr "Jah"
298
+
299
+ #~ msgid "Useronline"
300
+ #~ msgstr "Useronline"
301
+
302
+ #~ msgid "guest"
303
+ #~ msgstr "külastaja"
304
+
305
+ #~ msgid ""
306
+ #~ "There are a total of <strong><a href=\"%s\">%s users</a></strong> online "
307
+ #~ "now."
308
+ #~ msgstr ""
309
+ #~ "Hetklel on lehel kokku <strong><a href=\"%s\">%s kasutajat</a></strong>."
310
+
311
+ #~ msgid "User"
312
+ #~ msgstr "kasutaja"
313
+
314
+ #~ msgid "Member"
315
+ #~ msgstr "liige"
316
+
317
+ #~ msgid "Members"
318
+ #~ msgstr "liiget"
319
+
320
+ #~ msgid "Guests"
321
+ #~ msgstr "külastajat"
322
+
323
+ #~ msgid "Bot"
324
+ #~ msgstr "bot"
325
+
326
+ #~ msgid "Bots"
327
+ #~ msgstr "botti"
328
+
329
+ #~ msgid ""
330
+ #~ "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, "
331
+ #~ "<strong>%s</strong> and <strong>%s</strong>."
332
+ #~ msgstr ""
333
+ #~ "Hetkel on lehel kokku <strong>%s</strong>: <strong>%s</strong>, <strong>%"
334
+ #~ "s</strong> ja <strong>%s</strong>."
335
+
336
+ #~ msgid "user(s) online now."
337
+ #~ msgstr "kasutaja(t) lehel"
338
+
339
+ #~ msgid "Most users ever online was"
340
+ #~ msgstr "Kõige rohkem kasutajaid oli lehel korraga"
341
+
342
+ #~ msgid "Update Options"
343
+ #~ msgstr "Uuenda seadeid"
344
+
345
+ #~ msgid "Cancel"
346
+ #~ msgstr "Tühista"
347
+
348
+ #~ msgid "There is"
349
+ #~ msgstr "Hetkel on"
350
+
351
+ #~ msgid "There are a total of"
352
+ #~ msgstr "Lehel on"
353
+
354
+ #~ msgid "online now"
355
+ #~ msgstr " "
356
+
357
+ #~ msgid "and"
358
+ #~ msgstr "ja"
359
+
360
+ #~ msgid "Most users ever online were"
361
+ #~ msgstr "Kõige rohkem kasutajaid oli lehel"
lang/wp-useronline-nl_NL.mo CHANGED
Binary file
lang/wp-useronline-nl_NL.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: Frans Davina <reg@frandre.net>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -49,7 +49,7 @@ msgstr "Bijgewerkt"
49
 
50
  #: useronline-options.php:79
51
  msgid "No Useronline Option Updated"
52
- msgstr "Geen Useronline Optie Bijgewerkt"
53
 
54
  #: useronline-options.php:85
55
  #: useronline-options.php:380
@@ -140,12 +140,12 @@ msgstr ""
140
  #: useronline-options.php:179
141
  #: wp-useronline.php:916
142
  msgid "Browsing This Page."
143
- msgstr "Bezoeken Deze Pagina."
144
 
145
  #: useronline-options.php:186
146
  #: useronline-options.php:187
147
  msgid "Useronline Options"
148
- msgstr "Useronline Opties"
149
 
150
  #: useronline-options.php:190
151
  msgid "Time Out"
@@ -153,7 +153,7 @@ msgstr "Time Out"
153
 
154
  #: useronline-options.php:192
155
  msgid "How long till it will remove the user from the database (In seconds)."
156
- msgstr "Hoe lang voordat de gebruiker uit de database wordt verwijderd (In Seconden)"
157
 
158
  #: useronline-options.php:196
159
  msgid "UserOnline URL"
@@ -161,7 +161,7 @@ msgstr "UserOnline URL"
161
 
162
  #: useronline-options.php:198
163
  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"
164
- msgstr "URL Naar UserOnline Pagina (laat leeg als u niet naar de UserOnline Pagina wilt linken)<br />Voorbeeld: http://www.jouwsite.nl/blogs/useronline/<br />Voorbeeld: http://www.jouwsite.nl/blogs/?page_id=2"
165
 
166
  #: useronline-options.php:202
167
  msgid "Bots Name/User Agent"
@@ -169,33 +169,33 @@ msgstr "Bots Naam/User Agent"
169
 
170
  #: useronline-options.php:204
171
  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."
172
- msgstr "Hier is een lijst met bots en hun gedeeltelijke browser agents.<br />In de linker kolom staat de <strong>Bots naam</strong> en in de rechter kolom de bijbehorende <strong> Gedeeltelijke Browser Agent</strong>.<br />Start iedere invoer op een nieuwe regel."
173
 
174
  #: useronline-options.php:212
175
  msgid "Naming Conventions:"
176
- msgstr "Naamgeving Regels:"
177
 
178
  #: useronline-options.php:213
179
  #: useronline-options.php:254
180
  #: useronline-options.php:266
181
  #: useronline-options.php:298
182
  msgid "Allowed Variables:"
183
- msgstr "Toegestand Variabelen:"
184
 
185
  #: useronline-options.php:215
186
  #: useronline-options.php:259
187
  #: useronline-options.php:274
188
  #: useronline-options.php:306
189
  msgid "Restore Default Template"
190
- msgstr "Herstel Standaard Template"
191
 
192
  #: useronline-options.php:221
193
  msgid "Singular Form"
194
- msgstr "Enkelvoudige vorm"
195
 
196
  #: useronline-options.php:222
197
  msgid "Plural Form"
198
- msgstr "Meervoudige vorm"
199
 
200
  #: useronline-options.php:249
201
  msgid "Useronline Templates"
@@ -203,38 +203,38 @@ msgstr "Useronline Templates"
203
 
204
  #: useronline-options.php:253
205
  msgid "User(s) Online:"
206
- msgstr "Bezoeker(s) Online:"
207
 
208
  #: useronline-options.php:265
209
  msgid "User(s) Browsing Site:"
210
- msgstr "Bezoeker(s) Op De Site:"
211
 
212
  #: useronline-options.php:280
213
  #: useronline-options.php:312
214
  msgid "Member Names Separator"
215
- msgstr "Ledennaam Scheiden Met"
216
 
217
  #: useronline-options.php:281
218
  #: useronline-options.php:313
219
  msgid "Guests Separator"
220
- msgstr "Gasten Scheiden Met"
221
 
222
  #: useronline-options.php:282
223
  #: useronline-options.php:314
224
  msgid "Bots Separator"
225
- msgstr "Bots Scheiden Met"
226
 
227
  #: useronline-options.php:297
228
  msgid "User(s) Browsing Page:"
229
- msgstr "Bezoeker(s) Op Deze Pagina:"
230
 
231
  #: useronline-options.php:329
232
  msgid "Save Changes"
233
- msgstr "Wijzigingen Opslaan"
234
 
235
  #: useronline-options.php:340
236
  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."
237
- msgstr "Deactiveren van WP-UserONline verwijdert niet de gegevens die zijn gecreeert, zoals de UserOnline opties. Het compleet verwijderen van de plugin, doe je door hier te de\"installeren."
238
 
239
  #: useronline-options.php:343
240
  msgid "WARNING:"
@@ -250,11 +250,11 @@ msgstr "De volgende WordPress Opties/Tabellen zullen worden VERWIJDERD:"
250
 
251
  #: useronline-options.php:352
252
  msgid "WordPress Options"
253
- msgstr "WordPress Opties:"
254
 
255
  #: useronline-options.php:353
256
  msgid "WordPress Tables"
257
- msgstr "WordPress Tabellen"
258
 
259
  #: useronline-options.php:379
260
  #: wp-useronline-widget.php:73
@@ -279,11 +279,11 @@ msgstr "UserOnline"
279
 
280
  #: wp-useronline-widget.php:69
281
  msgid "Widget Title"
282
- msgstr "Widget Titel"
283
 
284
  #: wp-useronline-widget.php:70
285
  msgid "Display Users Browsing Site Under Users Online Count?"
286
- msgstr "Weergeven Bezoekers Onder Bezoekers Online Aantal?"
287
 
288
  #: wp-useronline-widget.php:75
289
  msgid "No"
@@ -326,15 +326,15 @@ msgstr "%s @ %s"
326
 
327
  #: wp-useronline.php:396
328
  msgid "No User Is Browsing This Site"
329
- msgstr "Geen bezoeker is op de Site"
330
 
331
  #: wp-useronline.php:538
332
  msgid "No User Is Browsing This Page"
333
- msgstr "Geen bezoeker is op deze Pagina"
334
 
335
  #: wp-useronline.php:609
336
  msgid "Users Online Now"
337
- msgstr "Bezoekers Nu Online"
338
 
339
  #: wp-useronline.php:621
340
  #, php-format
@@ -350,11 +350,11 @@ msgstr "Er zijn nu totaal <strong><a href=\"%s\">%s bezoekers</a></strong> onlin
350
  #: wp-useronline.php:729
351
  #, php-format
352
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
353
- msgstr "De meeste bezoekers waren <strong>%s</strong>, op <strong>%s</strong>"
354
 
355
  #: wp-useronline.php:692
356
  msgid "User"
357
- msgstr "BEzoeker"
358
 
359
  #: wp-useronline.php:694
360
  msgid "Users"
@@ -374,11 +374,11 @@ msgstr "Gasten"
374
 
375
  #: wp-useronline.php:714
376
  msgid "Bot"
377
- msgstr "Bot"
378
 
379
  #: wp-useronline.php:716
380
  msgid "Bots"
381
- msgstr "Bots"
382
 
383
  #: wp-useronline.php:725
384
  #, php-format
@@ -394,7 +394,7 @@ msgstr "Er zijn nu <strong>%s</strong> online: <strong>%s</strong>, <strong>%s</
394
  #: wp-useronline.php:752
395
  #: wp-useronline.php:772
396
  msgid "Online Now"
397
- msgstr "Nu Online"
398
 
399
  #: wp-useronline.php:739
400
  #: wp-useronline.php:759
@@ -419,7 +419,7 @@ msgstr "url"
419
 
420
  #: wp-useronline.php:784
421
  msgid "No One Is Online Now"
422
- msgstr "Er is nu Niemand online"
423
 
424
  #: wp-useronline.php:860
425
  msgid "On"
@@ -427,6 +427,6 @@ msgstr "Op"
427
 
428
  #~ msgid "user(s) online now."
429
  #~ msgstr "gebruiker(s) nu online."
 
430
  #~ msgid "Most users ever online was"
431
  #~ msgstr "Meeste gebruikers ooit online was"
432
-
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: EW <test@gmail.com>\n"
8
  "Language-Team: Frans Davina <reg@frandre.net>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
49
 
50
  #: useronline-options.php:79
51
  msgid "No Useronline Option Updated"
52
+ msgstr "Geen Useronline optie bijgewerkt"
53
 
54
  #: useronline-options.php:85
55
  #: useronline-options.php:380
140
  #: useronline-options.php:179
141
  #: wp-useronline.php:916
142
  msgid "Browsing This Page."
143
+ msgstr "Bezoeken deze pagina."
144
 
145
  #: useronline-options.php:186
146
  #: useronline-options.php:187
147
  msgid "Useronline Options"
148
+ msgstr "Useronline opties"
149
 
150
  #: useronline-options.php:190
151
  msgid "Time Out"
153
 
154
  #: useronline-options.php:192
155
  msgid "How long till it will remove the user from the database (In seconds)."
156
+ msgstr "Hoelang voordat de gebruiker uit de database wordt verwijderd (In Seconden)"
157
 
158
  #: useronline-options.php:196
159
  msgid "UserOnline URL"
161
 
162
  #: useronline-options.php:198
163
  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"
164
+ msgstr "URL naar UserOnline Pagina (laat leeg als u niet naar de UserOnline Pagina wilt linken)<br />Voorbeeld: http://www.jouwsite.nl/blogs/useronline/<br />Voorbeeld: http://www.jouwsite.nl/blogs/?page_id=2"
165
 
166
  #: useronline-options.php:202
167
  msgid "Bots Name/User Agent"
169
 
170
  #: useronline-options.php:204
171
  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."
172
+ msgstr "Hier is een lijst met zoekmachines en hun gedeeltelijke browser agents.<br />In de linkerkolom staat de <strong>Naam van de zoekmachine</strong> en in de rechter kolom de bijbehorende <strong> Gedeeltelijke Browser Agent</strong>.<br />Start iedere invoer op een nieuwe regel."
173
 
174
  #: useronline-options.php:212
175
  msgid "Naming Conventions:"
176
+ msgstr "Naamgeving regels:"
177
 
178
  #: useronline-options.php:213
179
  #: useronline-options.php:254
180
  #: useronline-options.php:266
181
  #: useronline-options.php:298
182
  msgid "Allowed Variables:"
183
+ msgstr "Toegestane variabelen:"
184
 
185
  #: useronline-options.php:215
186
  #: useronline-options.php:259
187
  #: useronline-options.php:274
188
  #: useronline-options.php:306
189
  msgid "Restore Default Template"
190
+ msgstr "Herstel standaardinstellingen"
191
 
192
  #: useronline-options.php:221
193
  msgid "Singular Form"
194
+ msgstr "Enkelvoud"
195
 
196
  #: useronline-options.php:222
197
  msgid "Plural Form"
198
+ msgstr "Meervoud"
199
 
200
  #: useronline-options.php:249
201
  msgid "Useronline Templates"
203
 
204
  #: useronline-options.php:253
205
  msgid "User(s) Online:"
206
+ msgstr "Bezoeker(s) online:"
207
 
208
  #: useronline-options.php:265
209
  msgid "User(s) Browsing Site:"
210
+ msgstr "Bezoeker(s) op de site:"
211
 
212
  #: useronline-options.php:280
213
  #: useronline-options.php:312
214
  msgid "Member Names Separator"
215
+ msgstr "Naam van de leden scheiden met"
216
 
217
  #: useronline-options.php:281
218
  #: useronline-options.php:313
219
  msgid "Guests Separator"
220
+ msgstr "Gasten scheiden met"
221
 
222
  #: useronline-options.php:282
223
  #: useronline-options.php:314
224
  msgid "Bots Separator"
225
+ msgstr "Zoekmachines scheiden met"
226
 
227
  #: useronline-options.php:297
228
  msgid "User(s) Browsing Page:"
229
+ msgstr "Bezoeker(s) op deze pagina:"
230
 
231
  #: useronline-options.php:329
232
  msgid "Save Changes"
233
+ msgstr "Wijzigingen opslaan"
234
 
235
  #: useronline-options.php:340
236
  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."
237
+ msgstr "Deactiveren van WP-UserONline verwijdert niet de gegevens die zijn gecreëerd, zoals de UserOnline opties. Het compleet verwijderen van de plugin, doe je door hier te de\"installeren."
238
 
239
  #: useronline-options.php:343
240
  msgid "WARNING:"
250
 
251
  #: useronline-options.php:352
252
  msgid "WordPress Options"
253
+ msgstr "WordPress opties:"
254
 
255
  #: useronline-options.php:353
256
  msgid "WordPress Tables"
257
+ msgstr "WordPress oabellen"
258
 
259
  #: useronline-options.php:379
260
  #: wp-useronline-widget.php:73
279
 
280
  #: wp-useronline-widget.php:69
281
  msgid "Widget Title"
282
+ msgstr "Widget titel"
283
 
284
  #: wp-useronline-widget.php:70
285
  msgid "Display Users Browsing Site Under Users Online Count?"
286
+ msgstr "Weergeven bezoekers van de site onder Bezoekers online aantal?"
287
 
288
  #: wp-useronline-widget.php:75
289
  msgid "No"
326
 
327
  #: wp-useronline.php:396
328
  msgid "No User Is Browsing This Site"
329
+ msgstr "Er is geen bezoeker op de site"
330
 
331
  #: wp-useronline.php:538
332
  msgid "No User Is Browsing This Page"
333
+ msgstr "Er is geen bezoeker op deze pagina"
334
 
335
  #: wp-useronline.php:609
336
  msgid "Users Online Now"
337
+ msgstr "Bezoekers nu Online"
338
 
339
  #: wp-useronline.php:621
340
  #, php-format
350
  #: wp-useronline.php:729
351
  #, php-format
352
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
353
+ msgstr "De meeste bezoekers tegelijk online: <strong>%s</strong>, op <strong>%s</strong>"
354
 
355
  #: wp-useronline.php:692
356
  msgid "User"
357
+ msgstr "Gebruiker"
358
 
359
  #: wp-useronline.php:694
360
  msgid "Users"
374
 
375
  #: wp-useronline.php:714
376
  msgid "Bot"
377
+ msgstr "Zoekmachine"
378
 
379
  #: wp-useronline.php:716
380
  msgid "Bots"
381
+ msgstr "Zoekmachine"
382
 
383
  #: wp-useronline.php:725
384
  #, php-format
394
  #: wp-useronline.php:752
395
  #: wp-useronline.php:772
396
  msgid "Online Now"
397
+ msgstr "nu online"
398
 
399
  #: wp-useronline.php:739
400
  #: wp-useronline.php:759
419
 
420
  #: wp-useronline.php:784
421
  msgid "No One Is Online Now"
422
+ msgstr "Er is nu niemand online"
423
 
424
  #: wp-useronline.php:860
425
  msgid "On"
427
 
428
  #~ msgid "user(s) online now."
429
  #~ msgstr "gebruiker(s) nu online."
430
+
431
  #~ msgid "Most users ever online was"
432
  #~ msgstr "Meeste gebruikers ooit online was"
 
lang/wp-useronline-ro_RO.mo CHANGED
Binary file
lang/wp-useronline-ro_RO.po CHANGED
@@ -1,11 +1,12 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP-UserOnline 2.70\n"
4
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-useronline\n"
5
- "POT-Creation-Date: 2010-09-20 15:01+0300\n"
6
  "PO-Revision-Date: \n"
7
- "Last-Translator: scribu <scribu@gmail.com>\n"
8
  "Language-Team: scribu <scribu@gmail.com>\n"
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -13,216 +14,201 @@ msgstr ""
13
  "X-Poedit-Language: Romanian\n"
14
  "X-Poedit-Country: ROMANIA\n"
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  #: admin.php:9
17
  msgid "Users Online Now"
18
- msgstr ""
19
 
20
- #. #-#-#-#-# wp-useronline.pot (WP-UserOnline 2.80) #-#-#-#-#
21
- #. Plugin Name of the plugin/theme
22
  #: admin.php:10
23
  #: wp-stats.php:14
24
  #: wp-stats.php:31
25
  msgid "WP-UserOnline"
26
- msgstr ""
27
 
28
- #: admin.php:24
29
- #, php-format
30
  msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
31
  msgid_plural "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
32
- msgstr[0] ""
33
- msgstr[1] ""
34
 
35
- #: admin.php:52
36
  msgid "UserOnline Options"
37
- msgstr ""
38
-
39
- #: admin.php:53
40
- #: widget.php:6
41
- #: widget.php:49
42
- msgid "UserOnline"
43
- msgstr ""
44
 
45
- #: admin.php:110
46
  msgid "Time Out"
47
- msgstr ""
48
 
49
- #: admin.php:113
50
- msgid "How long until it will remove the user from the database ( In seconds )."
51
- msgstr ""
52
 
53
- #: admin.php:118
54
  msgid "UserOnline URL"
55
- msgstr ""
56
 
57
- #: admin.php:121
58
  msgid "URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br />Example: http://www.yoursite.com/?page_id=2"
59
- msgstr ""
60
 
61
- #: admin.php:125
62
  msgid "User Names"
63
- msgstr ""
64
 
65
- #: admin.php:128
66
  msgid "Link user names to their author page"
67
- msgstr ""
68
 
69
- #: admin.php:145
70
  msgid "Useronline Templates"
71
- msgstr ""
72
 
73
- #: admin.php:157
74
  msgid "User(s) Browsing Site:"
75
- msgstr ""
76
 
77
- #: admin.php:158
78
  msgid "User(s) Browsing Page:"
79
- msgstr ""
80
 
81
- #: admin.php:171
82
- #: scb/AdminPage.php:179
83
- #: scb/AdminPage.php:189
84
  msgid "Save Changes"
85
- msgstr ""
86
 
87
- #: admin.php:181
88
  msgid "Naming Conventions:"
89
- msgstr ""
90
 
91
- #: admin.php:182
92
- #: admin.php:222
93
- #: admin.php:244
94
  msgid "Allowed Variables:"
95
- msgstr ""
96
 
97
- #: admin.php:184
98
  msgid "Restore Defaults"
99
- msgstr ""
100
 
101
- #: admin.php:190
102
  msgid "Singular Form"
103
- msgstr ""
104
 
105
- #: admin.php:191
106
  msgid "Plural Form"
107
- msgstr ""
108
 
109
- #: admin.php:221
110
  msgid "User(s) Online:"
111
- msgstr ""
112
 
113
- #: admin.php:227
114
- #: admin.php:252
115
  msgid "Restore Default Template"
116
- msgstr ""
117
 
118
- #: admin.php:258
119
  msgid "Member Names Separator"
120
- msgstr ""
121
 
122
- #: admin.php:259
123
  msgid "Guests Separator"
124
- msgstr ""
125
 
126
- #: admin.php:260
127
  msgid "Bots Separator"
128
- msgstr ""
129
 
130
- #: core.php:109
131
- msgid "Guest"
132
- msgstr ""
133
-
134
- #: core.php:180
135
- msgid "Admin"
136
- msgstr ""
137
-
138
- #: core.php:186
139
- msgid "Archive"
140
- msgstr "Arhivă"
141
-
142
- #: scb/AdminPage.php:167
143
- msgid "Settings <strong>saved</strong>."
144
- msgstr ""
145
-
146
- #: scb/AdminPage.php:371
147
- msgid "Settings"
148
- msgstr ""
149
 
150
- #: template-tags.php:81
151
- #, php-format
152
  msgid "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
153
  msgid_plural "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
154
- msgstr[0] ""
155
- msgstr[1] ""
156
 
157
  #: template-tags.php:190
158
  msgid "No one is online now."
159
- msgstr "Nimeni nu este online acum."
160
 
161
  #: template-tags.php:192
162
  msgid "on"
163
- msgstr ""
164
 
165
  #: template-tags.php:193
166
  msgid "url"
167
- msgstr ""
168
 
169
  #: template-tags.php:194
170
  msgid "referral"
171
- msgstr ""
172
 
173
  #: template-tags.php:205
174
  msgid "Online Now"
175
- msgstr ""
176
 
177
  #: template-tags.php:247
178
  #: template-tags.php:249
179
- #, php-format
180
  msgid "%s @ %s"
181
- msgstr ""
182
 
183
  #: template-tags.php:269
184
- #, php-format
185
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
186
- msgstr ""
187
-
188
- #: widget.php:5
189
- msgid "WP-UserOnline users online statistics"
190
- msgstr ""
191
-
192
- #: widget.php:56
193
- msgid "Title:"
194
- msgstr ""
195
-
196
- #: widget.php:59
197
- msgid "Statistics Type:"
198
- msgstr ""
199
-
200
- #: widget.php:61
201
- msgid "Users Online Count"
202
- msgstr ""
203
-
204
- #: widget.php:62
205
- msgid "Users Browsing Current Page"
206
- msgstr ""
207
-
208
- #: widget.php:63
209
- msgid "Users Browsing Site"
210
- msgstr ""
211
 
212
- #: widget.php:65
213
- msgid "Users Online Count & Users Browsing Current Page"
214
- msgstr ""
215
 
216
- #: widget.php:66
217
- msgid "Users Online Count & Users Browsing Site"
218
- msgstr ""
219
 
220
- #: wp-stats.php:24
221
- #, php-format
222
- msgid "<strong>%s</strong> user online now."
223
- msgid_plural "<strong>%s</strong> users online now."
224
- msgstr[0] ""
225
- msgstr[1] ""
226
 
227
  #: wp-useronline.php:61
228
  msgid "1 User"
@@ -258,7 +244,7 @@ msgstr "%COUNT% boți"
258
 
259
  #: wp-useronline.php:72
260
  msgid "Online"
261
- msgstr "Online"
262
 
263
  #: wp-useronline.php:76
264
  #: wp-useronline.php:77
@@ -273,21 +259,26 @@ msgstr ","
273
  #: wp-useronline.php:89
274
  msgctxt "Template Element"
275
  msgid "Users"
276
- msgstr "utilizatori"
277
 
278
  #: wp-useronline.php:89
279
  msgid "Browsing This Page."
280
- msgstr ""
281
 
282
- #. Plugin URI of the plugin/theme
283
- msgid "http://wordpress.org/extend/plugins/wp-useronline/"
284
- msgstr ""
285
 
286
- #. Description of the plugin/theme
287
- msgid "Enable you to display how many users are online on your Wordpress site"
288
- msgstr ""
 
 
 
289
 
290
- #. Author of the plugin/theme
291
- msgid "Lester 'GaMerZ' Chan & scribu"
292
- msgstr "Lester 'GaMerZ' Chan & scribu"
293
 
 
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP-UserOnline 2.70\n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/wpu\n"
5
+ "POT-Creation-Date: 2011-06-02 20:04:14+00:00\n"
6
  "PO-Revision-Date: \n"
7
+ "Last-Translator: scribu <mail@scribu.net>\n"
8
  "Language-Team: scribu <scribu@gmail.com>\n"
9
+ "Language: \n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
14
  "X-Poedit-Language: Romanian\n"
15
  "X-Poedit-Country: ROMANIA\n"
16
 
17
+ #: widget.php:5
18
+ msgid "WP-UserOnline users online statistics"
19
+ msgstr "WP-UserOnline statistica utilizatorilor conectați"
20
+
21
+ #: widget.php:6
22
+ #: widget.php:49
23
+ #: admin.php:56
24
+ msgid "UserOnline"
25
+ msgstr "UtilizatoriOnline"
26
+
27
+ #: widget.php:56
28
+ msgid "Title:"
29
+ msgstr "Titlu:"
30
+
31
+ #: widget.php:59
32
+ msgid "Statistics Type:"
33
+ msgstr "Tip statistică:"
34
+
35
+ #: widget.php:61
36
+ msgid "Users Online Count"
37
+ msgstr "Numărul de utilizatori conectați"
38
+
39
+ #: widget.php:62
40
+ msgid "Users Browsing Current Page"
41
+ msgstr "Utilizatori navigând pagina curentă"
42
+
43
+ #: widget.php:63
44
+ msgid "Users Browsing Site"
45
+ msgstr "Utilizatori navigând site-ul"
46
+
47
+ #: widget.php:65
48
+ msgid "Users Online Count & Users Browsing Current Page"
49
+ msgstr "Utilizatori conectați & Utilizatori navigând pagina curentă"
50
+
51
+ #: widget.php:66
52
+ msgid "Users Online Count & Users Browsing Site"
53
+ msgstr "Utilizatori conectați & Utilizatori navigând site-ul"
54
+
55
  #: admin.php:9
56
  msgid "Users Online Now"
57
+ msgstr "Utilizatori conectați acum"
58
 
 
 
59
  #: admin.php:10
60
  #: wp-stats.php:14
61
  #: wp-stats.php:31
62
  msgid "WP-UserOnline"
63
+ msgstr "WP-UserOnline"
64
 
65
+ #: admin.php:26
 
66
  msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
67
  msgid_plural "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
68
+ msgstr[0] "Există conectat <strong><a href='%s'>%s utilizator</a></strong> acum."
69
+ msgstr[1] "Există conectați <strong><a href='%s'>%s utilizatori</a></strong> acum."
70
 
71
+ #: admin.php:55
72
  msgid "UserOnline Options"
73
+ msgstr "Opțiuni modul"
 
 
 
 
 
 
74
 
75
+ #: admin.php:114
76
  msgid "Time Out"
77
+ msgstr "Timp expirare"
78
 
79
+ #: admin.php:117
80
+ msgid "How long until it will remove the user from the database (in seconds)."
81
+ msgstr "Timpul până când un utilizator va fi scos din baza de date (în secunde)."
82
 
83
+ #: admin.php:122
84
  msgid "UserOnline URL"
85
+ msgstr "URL Modul"
86
 
87
+ #: admin.php:125
88
  msgid "URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br />Example: http://www.yoursite.com/?page_id=2"
89
+ msgstr "URL-ul la această pagină<br />Exemplu: http://www.siteultau.ro/useronline/<br />Exemplu: http://www.siteultau.ro/?page_id=2"
90
 
91
+ #: admin.php:129
92
  msgid "User Names"
93
+ msgstr "Utilizatori"
94
 
95
+ #: admin.php:132
96
  msgid "Link user names to their author page"
97
+ msgstr "Creează legătură între utilizatori și paginile lor"
98
 
99
+ #: admin.php:151
100
  msgid "Useronline Templates"
101
+ msgstr "Șabloane modul"
102
 
103
+ #: admin.php:163
104
  msgid "User(s) Browsing Site:"
105
+ msgstr "Utilizator(i) navigând site-ul:"
106
 
107
+ #: admin.php:164
108
  msgid "User(s) Browsing Page:"
109
+ msgstr "Utilizator(i) navigând pagina:"
110
 
111
+ #: admin.php:177
112
+ #: scb/AdminPage.php:177
113
+ #: scb/AdminPage.php:187
114
  msgid "Save Changes"
115
+ msgstr "Salvați modificările"
116
 
117
+ #: admin.php:187
118
  msgid "Naming Conventions:"
119
+ msgstr "Convenție denumiri:"
120
 
121
+ #: admin.php:188
122
+ #: admin.php:228
123
+ #: admin.php:250
124
  msgid "Allowed Variables:"
125
+ msgstr "Variabile Acceptate"
126
 
127
+ #: admin.php:190
128
  msgid "Restore Defaults"
129
+ msgstr "Revenire la configurarea inițială"
130
 
131
+ #: admin.php:196
132
  msgid "Singular Form"
133
+ msgstr "Forma singulară"
134
 
135
+ #: admin.php:197
136
  msgid "Plural Form"
137
+ msgstr "Forma plurală"
138
 
139
+ #: admin.php:227
140
  msgid "User(s) Online:"
141
+ msgstr "Utilizator(i) conectați:"
142
 
143
+ #: admin.php:233
144
+ #: admin.php:258
145
  msgid "Restore Default Template"
146
+ msgstr "Restabilește șablon inițial"
147
 
148
+ #: admin.php:264
149
  msgid "Member Names Separator"
150
+ msgstr "Separator Utilizatori"
151
 
152
+ #: admin.php:265
153
  msgid "Guests Separator"
154
+ msgstr "Separator Vizitator"
155
 
156
+ #: admin.php:266
157
  msgid "Bots Separator"
158
+ msgstr "Separator Boți"
159
 
160
+ #: wp-stats.php:23
161
+ msgid "<strong>%s</strong> user online now."
162
+ msgid_plural "<strong>%s</strong> users online now."
163
+ msgstr[0] "<strong>%s</strong> utilizator conectat acum."
164
+ msgstr[1] "<strong>%s</strong> utilizatori conectati acum."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
166
+ #: template-tags.php:80
 
167
  msgid "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
168
  msgid_plural "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</strong> and <strong>%s</strong>."
169
+ msgstr[0] "Există <strong>%s</strong> conectat acum: <strong>%s</strong>, <strong>%s</strong> și <strong>%s</strong>."
170
+ msgstr[1] "Există acum un total de <strong>%s</strong> conectați acum: <strong>%s</strong>, <strong>%s</strong> și <strong>%s</strong>."
171
 
172
  #: template-tags.php:190
173
  msgid "No one is online now."
174
+ msgstr "Momentan nu există utilizatori conectați."
175
 
176
  #: template-tags.php:192
177
  msgid "on"
178
+ msgstr "pe"
179
 
180
  #: template-tags.php:193
181
  msgid "url"
182
+ msgstr "vezi pagina"
183
 
184
  #: template-tags.php:194
185
  msgid "referral"
186
+ msgstr "referință"
187
 
188
  #: template-tags.php:205
189
  msgid "Online Now"
190
+ msgstr "conectat acum"
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 "Numărul maxim de utilizatori conectați în aceelași timp este de <strong>%s</strong>, pe <strong>%s</strong>"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
 
201
+ #: core.php:137
202
+ msgid "Guest"
203
+ msgstr "Vizitator"
204
 
205
+ #: core.php:208
206
+ msgid "Admin"
207
+ msgstr "Admin"
208
 
209
+ #: core.php:214
210
+ msgid "Archive"
211
+ msgstr "Arhivă"
 
 
 
212
 
213
  #: wp-useronline.php:61
214
  msgid "1 User"
244
 
245
  #: wp-useronline.php:72
246
  msgid "Online"
247
+ msgstr "Conectat"
248
 
249
  #: wp-useronline.php:76
250
  #: wp-useronline.php:77
259
  #: wp-useronline.php:89
260
  msgctxt "Template Element"
261
  msgid "Users"
262
+ msgstr "Utilizatori"
263
 
264
  #: wp-useronline.php:89
265
  msgid "Browsing This Page."
266
+ msgstr "Navigând pagina curentă"
267
 
268
+ #: scb/AdminPage.php:165
269
+ msgid "Settings <strong>saved</strong>."
270
+ msgstr "Configurări <strong>salvate</strong>."
271
 
272
+ #: scb/AdminPage.php:369
273
+ msgid "Settings"
274
+ msgstr "Setări"
275
+
276
+ #~ msgid "http://wordpress.org/extend/plugins/wp-useronline/"
277
+ #~ msgstr "http://wordpress.org/extend/plugins/wp-useronline/"
278
 
279
+ #~ msgid ""
280
+ #~ "Enable you to display how many users are online on your Wordpress site"
281
+ #~ msgstr "Permite afişarea utilizatorilor conecați pe site-ul dvs."
282
 
283
+ #~ msgid "Lester 'GaMerZ' Chan & scribu"
284
+ #~ msgstr "Lester 'GaMerZ' Chan & scribu"
lang/wp-useronline-zh_TW.mo ADDED
Binary file
lang/wp-useronline-zh_TW.po ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Translation of the WordPress plugin WP-UserOnline 2.80 by Lester 'GaMerZ' Chan & scribu.
2
+ # Copyright (C) 2010 Lester 'GaMerZ' Chan & scribu
3
+ # This file is distributed under the same license as the WP-UserOnline package.
4
+ # FIRST AUTHOR <joy.ueng@gmail.com>, 2011.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: WP-UserOnline 2.80\n"
10
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-useronline\n"
11
+ "POT-Creation-Date: 2010-09-20 15:01+0300\n"
12
+ "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: Joey Weng <joy.ueng@gmail.com>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "MIME-Version: 1.0\n"
16
+ "Content-Type: text/plain; charset=utf-8\n"
17
+ "Content-Transfer-Encoding: 8bit\n"
18
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
19
+
20
+ #: admin.php:9
21
+ msgid "Users Online Now"
22
+ msgstr "目前線上使用者"
23
+
24
+ #. #-#-#-#-# wp-useronline.pot (WP-UserOnline 2.80) #-#-#-#-#
25
+ #. Plugin Name of the plugin/theme
26
+ #: admin.php:10 wp-stats.php:14 wp-stats.php:31
27
+ msgid "WP-UserOnline"
28
+ msgstr "線上使用者"
29
+
30
+ #: admin.php:24
31
+ #, php-format
32
+ msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
33
+ msgid_plural ""
34
+ "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
35
+ msgstr[0] "目前共有 <strong><a href='%s'>%s 位使用者</a></strong>在線上。"
36
+ msgstr[1] "目前共有 <strong><a href='%s'>%s 位使用者</a></strong>在線上。"
37
+
38
+ #: admin.php:52
39
+ msgid "UserOnline Options"
40
+ msgstr "線上使用者設定選項"
41
+
42
+ #: admin.php:53 widget.php:6 widget.php:49
43
+ msgid "UserOnline"
44
+ msgstr "線上使用者"
45
+
46
+ #: admin.php:110
47
+ msgid "Time Out"
48
+ msgstr "逾時時間"
49
+
50
+ #: admin.php:113
51
+ msgid ""
52
+ "How long until it will remove the user from the database ( In seconds )."
53
+ msgstr "決定多久之後將使用者從資料庫中移除(以秒為單位)。"
54
+
55
+ #: admin.php:118
56
+ msgid "UserOnline URL"
57
+ msgstr "線上使用者網址"
58
+
59
+ #: admin.php:121
60
+ msgid ""
61
+ "URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br /"
62
+ ">Example: http://www.yoursite.com/?page_id=2"
63
+ msgstr "線上使用者網頁的位址<br />範例一:http://www.yoursite.com/useronline/<br /"
64
+ ">範例二:http://www.yoursite.com/?page_id=2"
65
+
66
+ #: admin.php:125
67
+ msgid "User Names"
68
+ msgstr "使用者名稱"
69
+
70
+ #: admin.php:128
71
+ msgid "Link user names to their author page"
72
+ msgstr "連結使用者名稱與其作者資訊網頁"
73
+
74
+ #: admin.php:145
75
+ msgid "Useronline Templates"
76
+ msgstr "線上使用者樣版"
77
+
78
+ #: admin.php:157
79
+ msgid "User(s) Browsing Site:"
80
+ msgstr "站台瀏覽"
81
+
82
+ #: admin.php:158
83
+ msgid "User(s) Browsing Page:"
84
+ msgstr "頁面瀏覽"
85
+
86
+ #: admin.php:171 scb/AdminPage.php:179 scb/AdminPage.php:189
87
+ msgid "Save Changes"
88
+ msgstr "儲存更新"
89
+
90
+ #: admin.php:181
91
+ msgid "Naming Conventions:"
92
+ msgstr "命名方式"
93
+
94
+ #: admin.php:182 admin.php:222 admin.php:244
95
+ msgid "Allowed Variables:"
96
+ msgstr "可使用變數"
97
+
98
+ #: admin.php:184
99
+ msgid "Restore Defaults"
100
+ msgstr "恢復預設值"
101
+
102
+ #: admin.php:190
103
+ msgid "Singular Form"
104
+ msgstr "單數格式"
105
+
106
+ #: admin.php:191
107
+ msgid "Plural Form"
108
+ msgstr "複數格式"
109
+
110
+ #: admin.php:221
111
+ msgid "User(s) Online:"
112
+ msgstr "線上使用者"
113
+
114
+ #: admin.php:227 admin.php:252
115
+ msgid "Restore Default Template"
116
+ msgstr "恢復預設樣版"
117
+
118
+ #: admin.php:258
119
+ msgid "Member Names Separator"
120
+ msgstr "會員名稱區隔字元"
121
+
122
+ #: admin.php:259
123
+ msgid "Guests Separator"
124
+ msgstr "訪客區隔字元"
125
+
126
+ #: admin.php:260
127
+ msgid "Bots Separator"
128
+ msgstr "機器人區隔字元"
129
+
130
+ #: core.php:109
131
+ msgid "Guest"
132
+ msgstr "訪客"
133
+
134
+ #: core.php:180
135
+ msgid "Admin"
136
+ msgstr "管理員"
137
+
138
+ #: core.php:186
139
+ msgid "Archive"
140
+ msgstr "彙整"
141
+
142
+ #: scb/AdminPage.php:167
143
+ msgid "Settings <strong>saved</strong>."
144
+ msgstr "設定<strong>已儲存</strong>。"
145
+
146
+ #: scb/AdminPage.php:371
147
+ msgid "Settings"
148
+ msgstr "設定"
149
+
150
+ #: template-tags.php:81
151
+ #, php-format
152
+ msgid ""
153
+ "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</"
154
+ "strong> and <strong>%s</strong>."
155
+ msgid_plural ""
156
+ "There are a total of <strong>%s</strong> online now: <strong>%s</strong>, "
157
+ "<strong>%s</strong> and <strong>%s</strong>."
158
+ msgstr[0] "目前共有 <strong>%s</strong> 正在線上:<strong>%s</strong>,<strong>%s</"
159
+ "strong>與 <strong>%s</strong>。"
160
+ msgstr[1] "目前共有 <strong>%s</strong> 正在線上:<strong>%s</strong>,<strong>%s</"
161
+ "strong>與 <strong>%s</strong>。"
162
+
163
+ #: template-tags.php:190
164
+ msgid "No one is online now."
165
+ msgstr "目前沒有任何使用者在線上。"
166
+
167
+ #: template-tags.php:192
168
+ msgid "on"
169
+ msgstr "在"
170
+
171
+ #: template-tags.php:193
172
+ msgid "url"
173
+ msgstr "網址"
174
+
175
+ #: template-tags.php:194
176
+ msgid "referral"
177
+ msgstr "參照網址"
178
+
179
+ #: template-tags.php:205
180
+ msgid "Online Now"
181
+ msgstr "正在線上"
182
+
183
+ #: template-tags.php:247 template-tags.php:249
184
+ #, php-format
185
+ msgid "%s @ %s"
186
+ msgstr ""
187
+
188
+ #: template-tags.php:269
189
+ #, php-format
190
+ msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
191
+ msgstr "線上同時最多使用者數量:<strong>%s</strong>,在 <strong>%s</strong>"
192
+
193
+ #: widget.php:5
194
+ msgid "WP-UserOnline users online statistics"
195
+ msgstr "WP-UserOnline 線上使用者統計"
196
+
197
+ #: widget.php:56
198
+ msgid "Title:"
199
+ msgstr "標題"
200
+
201
+ #: widget.php:59
202
+ msgid "Statistics Type:"
203
+ msgstr "統計種類:"
204
+
205
+ #: widget.php:61
206
+ msgid "Users Online Count"
207
+ msgstr "線上使用者人數"
208
+
209
+ #: widget.php:62
210
+ msgid "Users Browsing Current Page"
211
+ msgstr "使用者正在瀏覽目前頁面"
212
+
213
+ #: widget.php:63
214
+ msgid "Users Browsing Site"
215
+ msgstr "使用者正在瀏覽網站"
216
+
217
+ #: widget.php:65
218
+ msgid "Users Online Count & Users Browsing Current Page"
219
+ msgstr "線上使用者人數與正在瀏覽目前頁面"
220
+
221
+ #: widget.php:66
222
+ msgid "Users Online Count & Users Browsing Site"
223
+ msgstr "線上使用者人數與正在瀏覽網站"
224
+
225
+ #: wp-stats.php:24
226
+ #, php-format
227
+ msgid "<strong>%s</strong> user online now."
228
+ msgid_plural "<strong>%s</strong> users online now."
229
+ msgstr[0] "<strong>%s</strong> 名使用者正在線上。"
230
+ msgstr[1] "<strong>%s</strong> 名使用者正在線上。"
231
+
232
+ #: wp-useronline.php:61
233
+ msgid "1 User"
234
+ msgstr "1 位使用者"
235
+
236
+ #: wp-useronline.php:62
237
+ msgid "%COUNT% Users"
238
+ msgstr "%COUNT% 位使用者"
239
+
240
+ #: wp-useronline.php:63
241
+ msgid "1 Member"
242
+ msgstr "1 位會員"
243
+
244
+ #: wp-useronline.php:64
245
+ msgid "%COUNT% Members"
246
+ msgstr "%COUNT% 位會員"
247
+
248
+ #: wp-useronline.php:65
249
+ msgid "1 Guest"
250
+ msgstr "1 位訪客"
251
+
252
+ #: wp-useronline.php:66
253
+ msgid "%COUNT% Guests"
254
+ msgstr "%COUNT% 位訪客"
255
+
256
+ #: wp-useronline.php:67
257
+ msgid "1 Bot"
258
+ msgstr "1 個機器人"
259
+
260
+ #: wp-useronline.php:68
261
+ msgid "%COUNT% Bots"
262
+ msgstr "%COUNT% 個機器人"
263
+
264
+ #: wp-useronline.php:72
265
+ msgid "Online"
266
+ msgstr "正在線上"
267
+
268
+ #: wp-useronline.php:76 wp-useronline.php:77 wp-useronline.php:78
269
+ #: wp-useronline.php:85 wp-useronline.php:86 wp-useronline.php:87
270
+ msgid ","
271
+ msgstr ""
272
+
273
+ #: wp-useronline.php:80 wp-useronline.php:89
274
+ msgctxt "Template Element"
275
+ msgid "Users"
276
+ msgstr "使用者"
277
+
278
+ #: wp-useronline.php:89
279
+ msgid "Browsing This Page."
280
+ msgstr "正在瀏覽此頁。"
281
+
282
+ #. Plugin URI of the plugin/theme
283
+ msgid "http://wordpress.org/extend/plugins/wp-useronline/"
284
+ msgstr ""
285
+
286
+ #. Description of the plugin/theme
287
+ msgid "Enable you to display how many users are online on your Wordpress site"
288
+ msgstr "顯示目前網站中有多少使用者正在線上"
289
+
290
+ #. Author of the plugin/theme
291
+ msgid "Lester 'GaMerZ' Chan & scribu"
292
+ msgstr ""
lang/wp-useronline.pot CHANGED
@@ -1,153 +1,161 @@
1
- # Translation of the WordPress plugin WP-UserOnline 2.80 by Lester 'GaMerZ' Chan & scribu.
2
- # Copyright (C) 2010 Lester 'GaMerZ' Chan & scribu
3
- # This file is distributed under the same license as the WP-UserOnline package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
- #
6
- #, fuzzy
7
  msgid ""
8
  msgstr ""
9
- "Project-Id-Version: WP-UserOnline 2.80\n"
10
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-useronline\n"
11
- "POT-Creation-Date: 2010-09-20 15:01+0300\n"
 
 
 
12
  "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
- "MIME-Version: 1.0\n"
16
- "Content-Type: text/plain; charset=utf-8\n"
17
- "Content-Transfer-Encoding: 8bit\n"
18
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  #: admin.php:9
21
  msgid "Users Online Now"
22
  msgstr ""
23
 
24
- #. #-#-#-#-# wp-useronline.pot (WP-UserOnline 2.80) #-#-#-#-#
25
- #. Plugin Name of the plugin/theme
26
  #: admin.php:10 wp-stats.php:14 wp-stats.php:31
27
  msgid "WP-UserOnline"
28
  msgstr ""
29
 
30
- #: admin.php:24
31
- #, php-format
32
  msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
33
  msgid_plural ""
34
  "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
35
  msgstr[0] ""
36
  msgstr[1] ""
37
 
38
- #: admin.php:52
39
  msgid "UserOnline Options"
40
  msgstr ""
41
 
42
- #: admin.php:53 widget.php:6 widget.php:49
43
- msgid "UserOnline"
44
- msgstr ""
45
-
46
- #: admin.php:110
47
  msgid "Time Out"
48
  msgstr ""
49
 
50
- #: admin.php:113
51
- msgid ""
52
- "How long until it will remove the user from the database ( In seconds )."
53
  msgstr ""
54
 
55
- #: admin.php:118
56
  msgid "UserOnline URL"
57
  msgstr ""
58
 
59
- #: admin.php:121
60
  msgid ""
61
  "URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br /"
62
  ">Example: http://www.yoursite.com/?page_id=2"
63
  msgstr ""
64
 
65
- #: admin.php:125
66
  msgid "User Names"
67
  msgstr ""
68
 
69
- #: admin.php:128
70
  msgid "Link user names to their author page"
71
  msgstr ""
72
 
73
- #: admin.php:145
74
  msgid "Useronline Templates"
75
  msgstr ""
76
 
77
- #: admin.php:157
78
  msgid "User(s) Browsing Site:"
79
  msgstr ""
80
 
81
- #: admin.php:158
82
  msgid "User(s) Browsing Page:"
83
  msgstr ""
84
 
85
- #: admin.php:171 scb/AdminPage.php:179 scb/AdminPage.php:189
86
  msgid "Save Changes"
87
  msgstr ""
88
 
89
- #: admin.php:181
90
  msgid "Naming Conventions:"
91
  msgstr ""
92
 
93
- #: admin.php:182 admin.php:222 admin.php:244
94
  msgid "Allowed Variables:"
95
  msgstr ""
96
 
97
- #: admin.php:184
98
  msgid "Restore Defaults"
99
  msgstr ""
100
 
101
- #: admin.php:190
102
  msgid "Singular Form"
103
  msgstr ""
104
 
105
- #: admin.php:191
106
  msgid "Plural Form"
107
  msgstr ""
108
 
109
- #: admin.php:221
110
  msgid "User(s) Online:"
111
  msgstr ""
112
 
113
- #: admin.php:227 admin.php:252
114
  msgid "Restore Default Template"
115
  msgstr ""
116
 
117
- #: admin.php:258
118
  msgid "Member Names Separator"
119
  msgstr ""
120
 
121
- #: admin.php:259
122
  msgid "Guests Separator"
123
  msgstr ""
124
 
125
- #: admin.php:260
126
  msgid "Bots Separator"
127
  msgstr ""
128
 
129
- #: core.php:109
130
- msgid "Guest"
131
- msgstr ""
132
-
133
- #: core.php:180
134
- msgid "Admin"
135
- msgstr ""
136
-
137
- #: core.php:186
138
- msgid "Archive"
139
- msgstr ""
140
-
141
- #: scb/AdminPage.php:167
142
- msgid "Settings <strong>saved</strong>."
143
- msgstr ""
144
-
145
- #: scb/AdminPage.php:371
146
- msgid "Settings"
147
- msgstr ""
148
 
149
- #: template-tags.php:81
150
- #, php-format
151
  msgid ""
152
  "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</"
153
  "strong> and <strong>%s</strong>."
@@ -178,54 +186,25 @@ msgid "Online Now"
178
  msgstr ""
179
 
180
  #: template-tags.php:247 template-tags.php:249
181
- #, php-format
182
  msgid "%s @ %s"
183
  msgstr ""
184
 
185
  #: template-tags.php:269
186
- #, php-format
187
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
188
  msgstr ""
189
 
190
- #: widget.php:5
191
- msgid "WP-UserOnline users online statistics"
192
- msgstr ""
193
-
194
- #: widget.php:56
195
- msgid "Title:"
196
- msgstr ""
197
-
198
- #: widget.php:59
199
- msgid "Statistics Type:"
200
- msgstr ""
201
-
202
- #: widget.php:61
203
- msgid "Users Online Count"
204
- msgstr ""
205
-
206
- #: widget.php:62
207
- msgid "Users Browsing Current Page"
208
- msgstr ""
209
-
210
- #: widget.php:63
211
- msgid "Users Browsing Site"
212
  msgstr ""
213
 
214
- #: widget.php:65
215
- msgid "Users Online Count & Users Browsing Current Page"
216
  msgstr ""
217
 
218
- #: widget.php:66
219
- msgid "Users Online Count & Users Browsing Site"
220
  msgstr ""
221
 
222
- #: wp-stats.php:24
223
- #, php-format
224
- msgid "<strong>%s</strong> user online now."
225
- msgid_plural "<strong>%s</strong> users online now."
226
- msgstr[0] ""
227
- msgstr[1] ""
228
-
229
  #: wp-useronline.php:61
230
  msgid "1 User"
231
  msgstr ""
@@ -276,14 +255,10 @@ msgstr ""
276
  msgid "Browsing This Page."
277
  msgstr ""
278
 
279
- #. Plugin URI of the plugin/theme
280
- msgid "http://wordpress.org/extend/plugins/wp-useronline/"
281
- msgstr ""
282
-
283
- #. Description of the plugin/theme
284
- msgid "Enable you to display how many users are online on your Wordpress site"
285
  msgstr ""
286
 
287
- #. Author of the plugin/theme
288
- msgid "Lester 'GaMerZ' Chan & scribu"
289
  msgstr ""
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
 
 
 
 
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: \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: 2010-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: widget.php:5
16
+ msgid "WP-UserOnline users online statistics"
17
+ msgstr ""
18
+
19
+ #: widget.php:6 widget.php:49 admin.php:56
20
+ msgid "UserOnline"
21
+ msgstr ""
22
+
23
+ #: widget.php:56
24
+ msgid "Title:"
25
+ msgstr ""
26
+
27
+ #: widget.php:59
28
+ msgid "Statistics Type:"
29
+ msgstr ""
30
+
31
+ #: widget.php:61
32
+ msgid "Users Online Count"
33
+ msgstr ""
34
+
35
+ #: widget.php:62
36
+ msgid "Users Browsing Current Page"
37
+ msgstr ""
38
+
39
+ #: widget.php:63
40
+ msgid "Users Browsing Site"
41
+ msgstr ""
42
+
43
+ #: widget.php:65
44
+ msgid "Users Online Count & Users Browsing Current Page"
45
+ msgstr ""
46
+
47
+ #: widget.php:66
48
+ msgid "Users Online Count & Users Browsing Site"
49
+ msgstr ""
50
 
51
  #: admin.php:9
52
  msgid "Users Online Now"
53
  msgstr ""
54
 
 
 
55
  #: admin.php:10 wp-stats.php:14 wp-stats.php:31
56
  msgid "WP-UserOnline"
57
  msgstr ""
58
 
59
+ #: admin.php:26
 
60
  msgid "There is <strong><a href='%s'>%s user</a></strong> online now."
61
  msgid_plural ""
62
  "There are a total of <strong><a href='%s'>%s users</a></strong> online now."
63
  msgstr[0] ""
64
  msgstr[1] ""
65
 
66
+ #: admin.php:55
67
  msgid "UserOnline Options"
68
  msgstr ""
69
 
70
+ #: admin.php:114
 
 
 
 
71
  msgid "Time Out"
72
  msgstr ""
73
 
74
+ #: admin.php:117
75
+ msgid "How long until it will remove the user from the database (in seconds)."
 
76
  msgstr ""
77
 
78
+ #: admin.php:122
79
  msgid "UserOnline URL"
80
  msgstr ""
81
 
82
+ #: admin.php:125
83
  msgid ""
84
  "URL To UserOnline Page<br />Example: http://www.yoursite.com/useronline/<br /"
85
  ">Example: http://www.yoursite.com/?page_id=2"
86
  msgstr ""
87
 
88
+ #: admin.php:129
89
  msgid "User Names"
90
  msgstr ""
91
 
92
+ #: admin.php:132
93
  msgid "Link user names to their author page"
94
  msgstr ""
95
 
96
+ #: admin.php:151
97
  msgid "Useronline Templates"
98
  msgstr ""
99
 
100
+ #: admin.php:163
101
  msgid "User(s) Browsing Site:"
102
  msgstr ""
103
 
104
+ #: admin.php:164
105
  msgid "User(s) Browsing Page:"
106
  msgstr ""
107
 
108
+ #: admin.php:177 scb/AdminPage.php:177 scb/AdminPage.php:187
109
  msgid "Save Changes"
110
  msgstr ""
111
 
112
+ #: admin.php:187
113
  msgid "Naming Conventions:"
114
  msgstr ""
115
 
116
+ #: admin.php:188 admin.php:228 admin.php:250
117
  msgid "Allowed Variables:"
118
  msgstr ""
119
 
120
+ #: admin.php:190
121
  msgid "Restore Defaults"
122
  msgstr ""
123
 
124
+ #: admin.php:196
125
  msgid "Singular Form"
126
  msgstr ""
127
 
128
+ #: admin.php:197
129
  msgid "Plural Form"
130
  msgstr ""
131
 
132
+ #: admin.php:227
133
  msgid "User(s) Online:"
134
  msgstr ""
135
 
136
+ #: admin.php:233 admin.php:258
137
  msgid "Restore Default Template"
138
  msgstr ""
139
 
140
+ #: admin.php:264
141
  msgid "Member Names Separator"
142
  msgstr ""
143
 
144
+ #: admin.php:265
145
  msgid "Guests Separator"
146
  msgstr ""
147
 
148
+ #: admin.php:266
149
  msgid "Bots Separator"
150
  msgstr ""
151
 
152
+ #: wp-stats.php:23
153
+ msgid "<strong>%s</strong> user online now."
154
+ msgid_plural "<strong>%s</strong> users online now."
155
+ msgstr[0] ""
156
+ msgstr[1] ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
+ #: template-tags.php:80
 
159
  msgid ""
160
  "There is <strong>%s</strong> online now: <strong>%s</strong>, <strong>%s</"
161
  "strong> and <strong>%s</strong>."
186
  msgstr ""
187
 
188
  #: template-tags.php:247 template-tags.php:249
 
189
  msgid "%s @ %s"
190
  msgstr ""
191
 
192
  #: template-tags.php:269
 
193
  msgid "Most users ever online were <strong>%s</strong>, on <strong>%s</strong>"
194
  msgstr ""
195
 
196
+ #: core.php:137
197
+ msgid "Guest"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  msgstr ""
199
 
200
+ #: core.php:208
201
+ msgid "Admin"
202
  msgstr ""
203
 
204
+ #: core.php:214
205
+ msgid "Archive"
206
  msgstr ""
207
 
 
 
 
 
 
 
 
208
  #: wp-useronline.php:61
209
  msgid "1 User"
210
  msgstr ""
255
  msgid "Browsing This Page."
256
  msgstr ""
257
 
258
+ #: scb/AdminPage.php:165
259
+ msgid "Settings <strong>saved</strong>."
 
 
 
 
260
  msgstr ""
261
 
262
+ #: scb/AdminPage.php:369
263
+ msgid "Settings"
264
  msgstr ""
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === WP-UserOnline ===
2
  Contributors: GamerZ, scribu
3
  Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
4
- Requires at least: 3.0
5
- Tested up to: 3.0
6
- Stable tag: 2.80
7
 
8
  Enable you to display how many users are online on your Wordpress blog with detailed statistics.
9
 
@@ -95,6 +95,12 @@ Make sure your host is running PHP 5. The only foolproof way to do this is to ad
95
 
96
  == Changelog ==
97
 
 
 
 
 
 
 
98
  = 2.80 =
99
  * don't show url and referral links for users in the admin area
100
  * smarter detection via ajax requests
1
  === WP-UserOnline ===
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
 
96
  == Changelog ==
97
 
98
+ = 2.81 =
99
+ * fixed settings page
100
+ * fixed "Return to default" buttons
101
+ * show user list in admin only to users with 'manage_options' capability
102
+ * added 'useronline_bots' filter
103
+
104
  = 2.80 =
105
  * don't show url and referral links for users in the admin area
106
  * smarter detection via ajax requests
scb/AdminPage.php CHANGED
@@ -1,22 +1,21 @@
1
  <?php
2
 
3
- /*
4
- Creates an admin page
5
-
6
- You must set $this->args and define the page_content() method
7
- */
8
 
9
  abstract class scbAdminPage {
10
  /** Page args
11
- * $toplevel string If not empty, will create a new top level menu
12
- * $icon string Path to an icon for the top level menu
13
- * $parent string ( default: options-general.php )
14
- * $capability string ( default: 'manage_options' )
15
- * $page_title string ( mandatory )
16
- * $menu_title string ( default: $page_title )
17
- * $page_slug string ( default: sanitized $page_title )
18
- * $nonce string ( default: $page_slug )
19
- * $action_link string|bool Text of the action link on the Plugins page ( default: 'Settings' )
 
 
 
20
  */
21
  protected $args;
22
 
@@ -35,9 +34,6 @@ abstract class scbAdminPage {
35
  // l10n
36
  protected $textdomain;
37
 
38
- // Formdata used for filling the form elements
39
- protected $formdata = array();
40
-
41
 
42
  // ____________REGISTRATION COMPONENT____________
43
 
@@ -84,14 +80,9 @@ abstract class scbAdminPage {
84
 
85
 
86
  // Constructor
87
- function __construct( $file, $options = NULL ) {
88
- if ( NULL !== $options ) {
89
  $this->options = $options;
90
- $this->formdata = $this->options->get();
91
- }
92
-
93
- $this->file = $file;
94
- $this->plugin_url = plugin_dir_url( $file );
95
 
96
  $this->setup();
97
  $this->check_args();
@@ -102,11 +93,16 @@ abstract class scbAdminPage {
102
  add_action( 'admin_notices', 'settings_errors' );
103
  }
104
 
105
- add_action( 'admin_menu', array( $this, 'page_init' ) );
106
  add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
107
 
108
- if ( $this->args['action_link'] )
109
- add_filter( 'plugin_action_links_' . plugin_basename( $file ), array( $this, '_action_link' ) );
 
 
 
 
 
110
  }
111
 
112
  // This is where all the page args can be set
@@ -123,7 +119,7 @@ abstract class scbAdminPage {
123
  // A generic page header
124
  function page_header() {
125
  echo "<div class='wrap'>\n";
126
- screen_icon();
127
  echo "<h2>" . $this->args['page_title'] . "</h2>\n";
128
  }
129
 
@@ -147,16 +143,18 @@ abstract class scbAdminPage {
147
 
148
  check_admin_referer( $this->nonce );
149
 
150
- $new_data = array();
151
- foreach ( array_keys( $this->formdata ) as $key )
152
- $new_data[$key] = @$_POST[$key];
 
 
 
153
 
154
  $new_data = stripslashes_deep( $new_data );
155
 
156
- $this->formdata = $this->validate( $new_data, $this->formdata );
157
 
158
- if ( isset( $this->options ) )
159
- $this->options->set( $this->formdata );
160
 
161
  $this->admin_msg();
162
  }
@@ -166,7 +164,7 @@ abstract class scbAdminPage {
166
  if ( empty( $msg ) )
167
  $msg = __( 'Settings <strong>saved</strong>.', $this->textdomain );
168
 
169
- echo "<div class='$class fade'><p>$msg</p></div>\n";
170
  }
171
 
172
 
@@ -176,10 +174,12 @@ abstract class scbAdminPage {
176
  // Generates a form submit button
177
  function submit_button( $value = '', $action = 'action', $class = "button" ) {
178
  if ( is_array( $value ) ) {
179
- extract( wp_parse_args( $value, array( 'value' => __( 'Save Changes', $this->textdomain ),
 
180
  'action' => 'action',
181
  'class' => 'button',
182
- 'ajax' => true ) ) );
 
183
 
184
  if ( ! $ajax )
185
  $class .= ' no-ajax';
@@ -218,7 +218,7 @@ abstract class scbAdminPage {
218
  */
219
  function form_wrap( $content, $submit_button = true ) {
220
  if ( is_array( $submit_button ) ) {
221
- $content .= call_user_func( array( $this, 'submit_button' ), $submit_button );
222
  } elseif ( true === $submit_button ) {
223
  $content .= $this->submit_button();
224
  } elseif ( false !== strpos( $submit_button, '<input' ) ) {
@@ -231,13 +231,8 @@ abstract class scbAdminPage {
231
  return scbForms::form_wrap( $content, $this->nonce );
232
  }
233
 
234
- // See scbForms::form()
235
- function form( $rows, $formdata = array() ) {
236
- return scbForms::form( $rows, $formdata, $this->nonce );
237
- }
238
-
239
  // Generates a table wrapped in a form
240
- function form_table( $rows, $formdata = array() ) {
241
  $output = '';
242
  foreach ( $rows as $row )
243
  $output .= $this->table_row( $row, $formdata );
@@ -250,13 +245,13 @@ abstract class scbAdminPage {
250
  // Wraps the given content in a <form><table>
251
  function form_table_wrap( $content ) {
252
  $output = $this->table_wrap( $content );
253
- $output = $this->form_wrap( $output, $this->nonce );
254
 
255
  return $output;
256
  }
257
 
258
  // Generates a form table
259
- function table( $rows, $formdata = array() ) {
260
  $output = '';
261
  foreach ( $rows as $row )
262
  $output .= $this->table_row( $row, $formdata );
@@ -267,7 +262,7 @@ abstract class scbAdminPage {
267
  }
268
 
269
  // Generates a table row
270
- function table_row( $args, $formdata = array() ) {
271
  return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
272
  }
273
 
@@ -279,40 +274,22 @@ abstract class scbAdminPage {
279
 
280
  // Wraps the given content in a <tr><td>
281
  function row_wrap( $title, $content ) {
282
- return
283
- html( 'tr',
284
  html( 'th scope="row"', $title )
285
  .html( 'td', $content ) );
286
  }
287
 
288
- function input( $args, $formdata = array() ) {
289
- if ( empty( $formdata ) )
290
- $formdata = $this->formdata;
291
-
292
- if ( isset( $args['name_tree'] ) ) {
293
- $tree = ( array ) $args['name_tree'];
294
- unset( $args['name_tree'] );
295
-
296
- $value = $formdata;
297
- $name = $this->option_name;
298
- foreach ( $tree as $key ) {
299
- $value = $value[$key];
300
- $name .= '[' . $key . ']';
301
- }
302
-
303
- $args['name'] = $name;
304
- unset( $args['names'] );
305
-
306
- unset( $args['values'] );
307
 
308
- $formdata = array( $name => $value );
 
309
  }
310
 
311
- return scbForms::input( $args, $formdata );
312
- }
313
-
314
- // Mimic scbForms inheritance
315
- function __call( $method, $args ) {
316
  return call_user_func_array( array( 'scbForms', $method ), $args );
317
  }
318
 
@@ -338,7 +315,7 @@ abstract class scbAdminPage {
338
  $this->pagehook = add_submenu_page( $parent, $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ) );
339
  } else {
340
  $func = 'add_' . $toplevel . '_page';
341
- $this->pagehook = $func( $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ), $icon_url );
342
  }
343
 
344
  if ( ! $this->pagehook )
@@ -360,16 +337,19 @@ abstract class scbAdminPage {
360
  if ( empty( $this->args['page_title'] ) )
361
  trigger_error( 'Page title cannot be empty', E_USER_WARNING );
362
 
363
- $this->args = wp_parse_args( $this->args, array(
364
  'toplevel' => '',
365
- 'icon' => '',
 
 
366
  'parent' => 'options-general.php',
367
  'capability' => 'manage_options',
368
  'menu_title' => $this->args['page_title'],
369
  'page_slug' => '',
370
  'nonce' => '',
371
  'action_link' => __( 'Settings', $this->textdomain ),
372
- 'ajax_submit' => false,
 
373
  ) );
374
 
375
  if ( empty( $this->args['page_slug'] ) )
1
  <?php
2
 
3
+ // Administration page base class
 
 
 
 
4
 
5
  abstract class scbAdminPage {
6
  /** Page args
7
+ * $page_title string (mandatory)
8
+ * $parent (string) (default: options-general.php)
9
+ * $capability (string) (default: 'manage_options')
10
+ * $menu_title (string) (default: $page_title)
11
+ * $page_slug (string) (default: sanitized $page_title)
12
+ * $toplevel (string) If not empty, will create a new top level menu (for expected values see http://codex.wordpress.org/Administration_Menus#Using_add_submenu_page)
13
+ * - $icon_url (string) URL to an icon for the top level menu
14
+ * - $position (int) Position of the toplevel menu (caution!)
15
+ * $screen_icon (string) The icon type to use in the screen header
16
+ * $nonce string (default: $page_slug)
17
+ * $action_link (string|bool) Text of the action link on the Plugins page (default: 'Settings')
18
+ * $admin_action_priority int The priority that the admin_menu action should be executed at (default: 10)
19
  */
20
  protected $args;
21
 
34
  // l10n
35
  protected $textdomain;
36
 
 
 
 
37
 
38
  // ____________REGISTRATION COMPONENT____________
39
 
80
 
81
 
82
  // Constructor
83
+ function __construct( $file = false, $options = null ) {
84
+ if ( is_a( $options, 'scbOptions' ) )
85
  $this->options = $options;
 
 
 
 
 
86
 
87
  $this->setup();
88
  $this->check_args();
93
  add_action( 'admin_notices', 'settings_errors' );
94
  }
95
 
96
+ add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
97
  add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
98
 
99
+ if ( $file ) {
100
+ $this->file = $file;
101
+ $this->plugin_url = plugin_dir_url( $file );
102
+
103
+ if ( $this->args['action_link'] )
104
+ add_filter( 'plugin_action_links_' . plugin_basename( $file ), array( $this, '_action_link' ) );
105
+ }
106
  }
107
 
108
  // This is where all the page args can be set
119
  // A generic page header
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
 
143
 
144
  check_admin_referer( $this->nonce );
145
 
146
+ if ( !isset($this->options) ) {
147
+ trigger_error('options handler not set', E_USER_WARNING);
148
+ return false;
149
+ }
150
+
151
+ $new_data = wp_array_slice_assoc( $_POST, array_keys( $this->options->get_defaults() ) );
152
 
153
  $new_data = stripslashes_deep( $new_data );
154
 
155
+ $new_data = $this->validate( $new_data, $this->options->get() );
156
 
157
+ $this->options->set( $new_data );
 
158
 
159
  $this->admin_msg();
160
  }
164
  if ( empty( $msg ) )
165
  $msg = __( 'Settings <strong>saved</strong>.', $this->textdomain );
166
 
167
+ echo scb_admin_notice( $msg, $class );
168
  }
169
 
170
 
174
  // Generates a form submit button
175
  function submit_button( $value = '', $action = 'action', $class = "button" ) {
176
  if ( is_array( $value ) ) {
177
+ extract( wp_parse_args( $value, array(
178
+ 'value' => __( 'Save Changes', $this->textdomain ),
179
  'action' => 'action',
180
  'class' => 'button',
181
+ 'ajax' => true
182
+ ) ) );
183
 
184
  if ( ! $ajax )
185
  $class .= ' no-ajax';
218
  */
219
  function form_wrap( $content, $submit_button = true ) {
220
  if ( is_array( $submit_button ) ) {
221
+ $content .= $this->submit_button( $submit_button );
222
  } elseif ( true === $submit_button ) {
223
  $content .= $this->submit_button();
224
  } elseif ( false !== strpos( $submit_button, '<input' ) ) {
231
  return scbForms::form_wrap( $content, $this->nonce );
232
  }
233
 
 
 
 
 
 
234
  // Generates a table wrapped in a form
235
+ function form_table( $rows, $formdata = false ) {
236
  $output = '';
237
  foreach ( $rows as $row )
238
  $output .= $this->table_row( $row, $formdata );
245
  // Wraps the given content in a <form><table>
246
  function form_table_wrap( $content ) {
247
  $output = $this->table_wrap( $content );
248
+ $output = $this->form_wrap( $output );
249
 
250
  return $output;
251
  }
252
 
253
  // Generates a form table
254
+ function table( $rows, $formdata = false ) {
255
  $output = '';
256
  foreach ( $rows as $row )
257
  $output .= $this->table_row( $row, $formdata );
262
  }
263
 
264
  // Generates a table row
265
+ function table_row( $args, $formdata = false ) {
266
  return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
267
  }
268
 
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' ) ) ) {
286
+ if ( empty( $args[1] ) && isset( $this->options ) )
287
+ $args[1] = $this->options->get();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
 
289
+ if ( 'form' == $method )
290
+ $args[2] = $this->nonce;
291
  }
292
 
 
 
 
 
 
293
  return call_user_func_array( array( 'scbForms', $method ), $args );
294
  }
295
 
315
  $this->pagehook = add_submenu_page( $parent, $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ) );
316
  } else {
317
  $func = 'add_' . $toplevel . '_page';
318
+ $this->pagehook = $func( $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ), $icon_url, $position );
319
  }
320
 
321
  if ( ! $this->pagehook )
337
  if ( empty( $this->args['page_title'] ) )
338
  trigger_error( 'Page title cannot be empty', E_USER_WARNING );
339
 
340
+ $this->args = wp_parse_args( $this->args, array(
341
  'toplevel' => '',
342
+ 'position' => null,
343
+ 'icon_url' => '',
344
+ 'screen_icon' => '',
345
  'parent' => 'options-general.php',
346
  'capability' => 'manage_options',
347
  'menu_title' => $this->args['page_title'],
348
  'page_slug' => '',
349
  'nonce' => '',
350
  'action_link' => __( 'Settings', $this->textdomain ),
351
+ 'ajax_submit' => false,
352
+ 'admin_action_priority' => 10,
353
  ) );
354
 
355
  if ( empty( $this->args['page_slug'] ) )
scb/BoxesPage.php CHANGED
@@ -1,19 +1,7 @@
1
  <?php
2
 
3
- /*
4
- Creates an admin page with widgets, similar to the dashboard
5
 
6
- For example, if you defined the boxes like this:
7
-
8
- $this->boxes = array( array( 'settings', 'Settings box', 'normal' )
9
- ... );
10
-
11
- You must also define two methods in your class for each box:
12
-
13
- function settings_box() - this is where the box content is echoed
14
- function settings_handler() - this is where the box settings are saved
15
- ...
16
- */
17
  abstract class scbBoxesPage extends scbAdminPage {
18
  /*
19
  A box definition looks like this:
@@ -23,10 +11,9 @@ abstract class scbBoxesPage extends scbAdminPage {
23
  */
24
  protected $boxes = array();
25
 
26
- function __construct( $file, $options = null ) {
27
  parent::__construct( $file, $options );
28
 
29
- // too late
30
  scbUtil::add_uninstall_hook( $this->file, array( $this, 'uninstall' ) );
31
  }
32
 
@@ -37,23 +24,48 @@ abstract class scbBoxesPage extends scbAdminPage {
37
  parent::page_init();
38
 
39
  add_action( 'load-' . $this->pagehook, array( $this, 'boxes_init' ) );
40
- add_filter( 'screen_layout_columns', array( $this, 'columns' ) );
41
  }
42
 
43
  function default_css() {
44
  ?>
45
  <style type="text/css">
46
- .postbox-container + .postbox-container {margin-left: 18px}
47
- .postbox-container {padding-right: 0}
48
-
49
- .inside {clear: both; overflow: hidden; padding: 10px 10px 0 10px !important}
50
- .inside table {margin: 0 !important; padding: 0 !important}
51
- .inside table td {vertical-align: middle !important}
52
- .inside table .regular-text {width: 100% !important}
53
- .inside .form-table th {width: 30%; max-width: 200px; padding: 10px 0 !important}
54
- .inside .widefat .check-column {padding-bottom: 7px !important}
55
- .inside p, .inside table {margin: 0 0 10px 0 !important}
56
- .inside p.submit {float:left !important; padding: 0 !important}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  </style>
58
  <?php
59
  }
@@ -67,34 +79,40 @@ abstract class scbBoxesPage extends scbAdminPage {
67
  $hide2 = $hide3 = $hide4 = '';
68
  switch ( $screen_layout_columns ) {
69
  case 4:
70
- $width = 'width:24.5%;';
 
71
  break;
72
  case 3:
73
- $width = 'width:32.67%;';
 
74
  $hide4 = 'display:none;';
75
  break;
76
  case 2:
77
- $width = 'width:49%;';
 
78
  $hide3 = $hide4 = 'display:none;';
79
  break;
80
  default:
81
- $width = 'width:98%;';
 
82
  $hide2 = $hide3 = $hide4 = 'display:none;';
83
  }
 
 
84
  }
85
  ?>
86
  <div id='<?php echo $this->pagehook ?>-widgets' class='metabox-holder'>
87
  <?php
88
- echo "\t<div class='postbox-container' style='$width'>\n";
89
  do_meta_boxes( $this->pagehook, 'normal', '' );
90
 
91
- echo "\t</div><div class='postbox-container' style='{$hide2}$width'>\n";
92
  do_meta_boxes( $this->pagehook, 'side', '' );
93
 
94
- echo "\t</div><div class='postbox-container' style='{$hide3}$width'>\n";
95
  do_meta_boxes( $this->pagehook, 'column3', '' );
96
 
97
- echo "\t</div><div class='postbox-container' style='{$hide4}$width'>\n";
98
  do_meta_boxes( $this->pagehook, 'column4', '' );
99
  ?>
100
  </div></div>
@@ -121,15 +139,6 @@ abstract class scbBoxesPage extends scbAdminPage {
121
  if ( method_exists( $this, $handler ) )
122
  call_user_func_array( array( $this, $handler ), $args );
123
  }
124
-
125
- if ( $this->options )
126
- $this->formdata = $this->options->get();
127
- }
128
-
129
- function columns( $columns ) {
130
- $columns[$this->pagehook] = $this->args['columns'];
131
-
132
- return $columns;
133
  }
134
 
135
  function uninstall() {
@@ -149,10 +158,13 @@ abstract class scbBoxesPage extends scbAdminPage {
149
  }
150
 
151
  function boxes_init() {
152
- wp_enqueue_script( 'common' );
153
- wp_enqueue_script( 'wp-lists' );
154
  wp_enqueue_script( 'postbox' );
155
 
 
 
 
 
 
156
  $registered = array();
157
  foreach( $this->boxes as $box_args ) {
158
  @list( $name, $title, $context, $priority, $args ) = $box_args;
@@ -221,3 +233,5 @@ EOT
221
  }
222
  }
223
 
 
 
1
  <?php
2
 
3
+ // Admin screen with metaboxes base class
 
4
 
 
 
 
 
 
 
 
 
 
 
 
5
  abstract class scbBoxesPage extends scbAdminPage {
6
  /*
7
  A box definition looks like this:
11
  */
12
  protected $boxes = array();
13
 
14
+ function __construct( $file = false, $options = null ) {
15
  parent::__construct( $file, $options );
16
 
 
17
  scbUtil::add_uninstall_hook( $this->file, array( $this, 'uninstall' ) );
18
  }
19
 
24
  parent::page_init();
25
 
26
  add_action( 'load-' . $this->pagehook, array( $this, 'boxes_init' ) );
 
27
  }
28
 
29
  function default_css() {
30
  ?>
31
  <style type="text/css">
32
+ .postbox-container + .postbox-container {
33
+ margin-left: 18px;
34
+ }
35
+ .postbox-container {
36
+ padding-right: 0;
37
+ }
38
+ .inside {
39
+ clear: both;
40
+ overflow: hidden;
41
+ }
42
+ .inside table {
43
+ margin: 0 !important;
44
+ padding: 0 !important;
45
+ }
46
+ .inside table td {
47
+ vertical-align: middle !important;
48
+ }
49
+ .inside table .regular-text {
50
+ width: 100% !important;
51
+ }
52
+ .inside .form-table th {
53
+ width: 30%;
54
+ max-width: 200px;
55
+ padding: 10px 0 !important;
56
+ }
57
+ .inside .widefat .check-column {
58
+ padding-bottom: 7px !important;
59
+ }
60
+ .inside p,
61
+ .inside table {
62
+ margin: 0 0 10px !important;
63
+ }
64
+ .inside p.submit {
65
+ float: left !important;
66
+ padding: 0 !important;
67
+ margin-bottom: 0 !important;
68
+ }
69
  </style>
70
  <?php
71
  }
79
  $hide2 = $hide3 = $hide4 = '';
80
  switch ( $screen_layout_columns ) {
81
  case 4:
82
+ if( !isset( $this->args['column_widths'] ) )
83
+ $this->args['column_widths'] = array( 24.5, 24.5, 24.5, 24.5 );
84
  break;
85
  case 3:
86
+ if( !isset( $this->args['column_widths'] ) )
87
+ $this->args['column_widths'] = array( 32.67, 32.67, 32.67 );
88
  $hide4 = 'display:none;';
89
  break;
90
  case 2:
91
+ if( !isset( $this->args['column_widths'] ) )
92
+ $this->args['column_widths'] = array( 49, 49 );
93
  $hide3 = $hide4 = 'display:none;';
94
  break;
95
  default:
96
+ if( !isset( $this->args['column_widths'] ) )
97
+ $this->args['column_widths'] = array( 98 );
98
  $hide2 = $hide3 = $hide4 = 'display:none;';
99
  }
100
+
101
+ $this->args['column_widths'] = array_pad( $this->args['column_widths'], 4, 0 );
102
  }
103
  ?>
104
  <div id='<?php echo $this->pagehook ?>-widgets' class='metabox-holder'>
105
  <?php
106
+ echo "\t<div class='postbox-container' style='width:{$this->args['column_widths'][0]}%'>\n";
107
  do_meta_boxes( $this->pagehook, 'normal', '' );
108
 
109
+ echo "\t</div><div class='postbox-container' style='width:{$hide2}{$this->args['column_widths'][1]}%'>\n";
110
  do_meta_boxes( $this->pagehook, 'side', '' );
111
 
112
+ echo "\t</div><div class='postbox-container' style='width:{$hide3}{$this->args['column_widths'][2]}%'>\n";
113
  do_meta_boxes( $this->pagehook, 'column3', '' );
114
 
115
+ echo "\t</div><div class='postbox-container' style='width:{$hide4}{$this->args['column_widths'][3]}%'>\n";
116
  do_meta_boxes( $this->pagehook, 'column4', '' );
117
  ?>
118
  </div></div>
139
  if ( method_exists( $this, $handler ) )
140
  call_user_func_array( array( $this, $handler ), $args );
141
  }
 
 
 
 
 
 
 
 
 
142
  }
143
 
144
  function uninstall() {
158
  }
159
 
160
  function boxes_init() {
 
 
161
  wp_enqueue_script( 'postbox' );
162
 
163
+ add_screen_option( 'layout_columns', array(
164
+ 'max' => $this->args['columns'],
165
+ 'default' => $this->args['columns']
166
+ ) );
167
+
168
  $registered = array();
169
  foreach( $this->boxes as $box_args ) {
170
  @list( $name, $title, $context, $priority, $args ) = $box_args;
233
  }
234
  }
235
 
236
+
237
+
scb/Cron.php CHANGED
@@ -1,12 +1,14 @@
1
  <?php
2
 
 
 
3
  class scbCron {
4
  protected $schedule;
5
  protected $interval;
6
  protected $time;
7
 
8
  protected $hook;
9
- protected $callback_args;
10
 
11
  /**
12
  * Create a new cron job
@@ -15,19 +17,44 @@ class scbCron {
15
  * @param array List of args:
16
  string $action OR callback $callback
17
  string $schedule OR number $interval
18
- array $callback_args ( optional )
19
- * @param bool Debug mode
20
  */
21
- function __construct( $file, $args, $debug = false ) {
22
- $this->_set_args( $args );
23
 
24
- scbUtil::add_activation_hook( $file, array( $this, 'reset' ) );
25
- register_deactivation_hook( $file, array( $this, 'unschedule' ) );
 
26
 
27
- add_filter( 'cron_schedules', array( $this, '_add_timing' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- if ( $debug )
30
- self::debug();
 
 
 
 
31
  }
32
 
33
  /* Change the interval of the cron job
@@ -69,24 +96,26 @@ class scbCron {
69
 
70
  /**
71
  * Execute the job now
 
72
  */
73
- function do_now() {
74
- do_action( $this->hook );
 
 
 
75
  }
76
 
77
  /**
78
  * Execute the job with a given delay
79
- * @param int Delay in seconds
 
80
  */
81
- function do_once( $delay = 0 ) {
82
- wp_schedule_single_event( time() + $delay, $this->hook, $this->callback_args );
83
- }
84
 
85
- /**
86
- * Display current cron jobs
87
- */
88
- function debug() {
89
- add_action( 'admin_footer', array( __CLASS__, '_debug' ) );
90
  }
91
 
92
 
@@ -103,15 +132,6 @@ class scbCron {
103
  return $schedules;
104
  }
105
 
106
- function _debug() {
107
- if ( ! current_user_can( 'manage_options' ) )
108
- return;
109
-
110
- echo "<pre>";
111
- print_r( get_option( 'cron' ) );
112
- echo "</pre>";
113
- }
114
-
115
  protected function schedule() {
116
  if ( ! $this->time )
117
  $this->time = time();
@@ -119,38 +139,6 @@ class scbCron {
119
  wp_schedule_event( $this->time, $this->schedule, $this->hook, $this->callback_args );
120
  }
121
 
122
- protected function _set_args( $args ) {
123
- extract( $args );
124
-
125
- // Set hook
126
- if ( isset( $action ) ) {
127
- $this->hook = $action;
128
- } elseif ( isset( $callback ) ) {
129
- $this->hook = self::_callback_to_string( $callback );
130
-
131
- add_action( $this->hook, $callback );
132
- } elseif ( method_exists( $this, 'callback' ) ) {
133
- $this->hook = self::_callback_to_string( $callback );
134
-
135
- add_action( $this->hook, $callback );
136
- } else {
137
- trigger_error( '$action OR $callback not set', E_USER_WARNING );
138
- }
139
-
140
- // Set schedule
141
- if ( isset( $interval ) ) {
142
- $this->schedule = $interval . 'secs';
143
- $this->interval = $interval;
144
- } elseif ( isset( $schedule ) ) {
145
- $this->schedule = $schedule;
146
- } else {
147
- trigger_error( '$schedule OR $interval not set', E_USER_WARNING );
148
- }
149
-
150
- if ( isset( $callback_args ) )
151
- $this->callback_args = ( array ) $callback_args;
152
- }
153
-
154
  protected static function really_clear_scheduled_hook( $name ) {
155
  $crons = _get_cron_array();
156
 
1
  <?php
2
 
3
+ // wp-cron job container
4
+
5
  class scbCron {
6
  protected $schedule;
7
  protected $interval;
8
  protected $time;
9
 
10
  protected $hook;
11
+ protected $callback_args = array();
12
 
13
  /**
14
  * Create a new cron job
17
  * @param array List of args:
18
  string $action OR callback $callback
19
  string $schedule OR number $interval
20
+ array $callback_args (optional)
 
21
  */
22
+ function __construct( $file = false, $args ) {
23
+ extract( $args, EXTR_SKIP );
24
 
25
+ // Set time & schedule
26
+ if ( isset( $time ) )
27
+ $this->time = $time;
28
 
29
+ if ( isset( $interval ) ) {
30
+ $this->schedule = $interval . 'secs';
31
+ $this->interval = $interval;
32
+ } elseif ( isset( $schedule ) ) {
33
+ $this->schedule = $schedule;
34
+ }
35
+
36
+ // Set hook
37
+ if ( isset( $action ) ) {
38
+ $this->hook = $action;
39
+ } elseif ( isset( $callback ) ) {
40
+ $this->hook = self::_callback_to_string( $callback );
41
+ add_action( $this->hook, $callback );
42
+ } elseif ( method_exists( $this, 'callback' ) ) {
43
+ $this->hook = self::_callback_to_string( array( $this, 'callback' ) );
44
+ add_action( $this->hook, $callback );
45
+ } else {
46
+ trigger_error( '$action OR $callback not set', E_USER_WARNING );
47
+ }
48
+
49
+ if ( isset( $callback_args ) )
50
+ $this->callback_args = (array) $callback_args;
51
 
52
+ if ( $file && $this->schedule ) {
53
+ scbUtil::add_activation_hook( $file, array( $this, 'reset' ) );
54
+ register_deactivation_hook( $file, array( $this, 'unschedule' ) );
55
+ }
56
+
57
+ add_filter( 'cron_schedules', array( $this, '_add_timing' ) );
58
  }
59
 
60
  /* Change the interval of the cron job
96
 
97
  /**
98
  * Execute the job now
99
+ * @param array $args List of arguments to pass to the callback
100
  */
101
+ function do_now( $args = null ) {
102
+ if ( is_null( $args ) )
103
+ $args = $this->callback_args;
104
+
105
+ do_action_ref_array( $this->hook, $args );
106
  }
107
 
108
  /**
109
  * Execute the job with a given delay
110
+ * @param int $delay in seconds
111
+ * @param array $args List of arguments to pass to the callback
112
  */
113
+ function do_once( $delay = 0, $args = null ) {
114
+ if ( is_null( $args ) )
115
+ $args = $this->callback_args;
116
 
117
+ wp_clear_scheduled_hook( $this->hook, $args );
118
+ wp_schedule_single_event( time() + $delay, $this->hook, $args );
 
 
 
119
  }
120
 
121
 
132
  return $schedules;
133
  }
134
 
 
 
 
 
 
 
 
 
 
135
  protected function schedule() {
136
  if ( ! $this->time )
137
  $this->time = time();
139
  wp_schedule_event( $this->time, $this->schedule, $this->hook, $this->callback_args );
140
  }
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  protected static function really_clear_scheduled_hook( $name ) {
143
  $crons = _get_cron_array();
144
 
scb/Forms.php CHANGED
@@ -1,18 +1,15 @@
1
  <?php
2
 
3
- // Documentation: http://scribu.net/wordpress/scb-framework/scb-forms.html
4
 
5
  class scbForms {
6
 
7
  const token = '%input%';
8
 
9
- protected static $args;
10
- protected static $formdata = array();
11
 
12
- static function input( $args, $formdata = array() ) {
13
- $args = self::validate_data( $args );
14
-
15
- $error = false;
16
  foreach ( array( 'name', 'value' ) as $key ) {
17
  $old = $key . 's';
18
 
@@ -22,16 +19,43 @@ class scbForms {
22
  }
23
  }
24
 
 
 
 
 
 
25
  if ( empty( $args['name'] ) )
26
  return trigger_error( 'Empty name', E_USER_WARNING );
27
 
28
- self::$args = $args;
29
- self::$formdata = self::validate_data( $formdata );
 
 
30
 
31
- if ( 'select' == $args['type'] )
32
- return self::_select();
33
- else
34
- return self::_input();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
 
37
 
@@ -114,129 +138,135 @@ class scbForms {
114
  // ____________PRIVATE METHODS____________
115
 
116
 
117
- // Recursivly transform empty arrays to ''
118
- private static function validate_data( $data ) {
119
- if ( !is_array( $data ) )
120
- return $data;
121
-
122
- if ( empty( $data ) )
123
- return '';
124
 
125
- foreach ( $data as $key => &$value )
126
- $value = self::validate_data( $value );
127
 
128
- return $data;
 
 
 
129
  }
130
 
131
- // From multiple inputs to single inputs
132
- private static function _input() {
133
- extract( wp_parse_args( self::$args, array(
134
- 'name' => NULL,
135
- 'value' => NULL,
136
- 'desc' => NULL,
137
- 'checked' => NULL,
138
- ) ) );
139
 
140
- $m_name = is_array( $name );
141
- $m_value = is_array( $value );
142
- $m_desc = is_array( $desc );
143
 
144
- // Correct name
145
- if ( !$m_name && $m_value
146
- && 'checkbox' == $type
147
- && false === strpos( $name, '[' )
148
- )
149
- $args['name'] = $name = $name . '[]';
150
 
151
- // Expand names or values
152
- if ( !$m_name && !$m_value ) {
153
- $a = array( $name => $value );
154
- }
155
- elseif ( $m_name && !$m_value ) {
156
- $a = array_fill_keys( $name, $value );
157
- }
158
- elseif ( !$m_name && $m_value ) {
159
- $a = array_fill_keys( $value, $name );
160
- }
161
- else {
162
- $a = array_combine( $name, $value );
 
 
 
 
 
163
  }
164
 
165
- // Correct descriptions
166
- $_after = '';
167
- if ( isset( $desc ) && !$m_desc && false === strpos( $desc, self::token ) ) {
168
- if ( $m_value ) {
169
- $_after = $desc;
170
- $args['desc'] = $desc = $value;
171
- }
172
- elseif ( $m_name ) {
173
- $_after = $desc;
174
- $args['desc'] = $desc = $name;
 
175
  }
176
  }
 
177
 
178
- // Determine what goes where
179
- if ( !$m_name && $m_value ) {
180
- $i1 = 'val';
181
- $i2 = 'name';
182
- } else {
183
- $i1 = 'name';
184
- $i2 = 'val';
185
  }
186
 
187
- $func = in_array( $type, array( 'checkbox', 'radio' ) ) ? '_checkbox_single' : '_input_single';
 
 
 
188
 
189
- // Set constant args
190
- $const_args = self::array_extract( self::$args, array( 'type', 'desc_pos', 'checked' ) );
191
- if ( isset( $extra ) ) {
192
- if ( !is_array( $extra ) )
193
- $extra = self::attr_to_array( $extra );
194
- $const_args['extra'] = $extra;
 
195
  }
196
 
197
- $i = 0;
198
- foreach ( $a as $name => $val ) {
199
- $cur_args = $const_args;
200
-
201
- if ( $$i1 !== NULL )
202
- $cur_args['name'] = $$i1;
203
-
204
- if ( $$i2 !== NULL )
205
- $cur_args['value'] = $$i2;
206
-
207
- // Set desc
208
- if ( is_array( $desc ) )
209
- $cur_args['desc'] = $desc[$i];
210
- elseif ( isset( $desc ) )
211
- $cur_args['desc'] = $desc;
212
-
213
- // Find relevant formdata
214
- $match = NULL;
215
- if ( $checked === NULL ) {
216
- $match = @self::$formdata[str_replace( '[]', '', $$i1 )];
217
- if ( is_array( $match ) ) {
218
- $match = $match[$i];
219
- }
220
- } else if ( is_array( $checked ) ) {
221
- $cur_args['checked'] = isset( $checked[$i] ) && $checked[$i];
222
- }
 
 
 
223
 
224
- $output[] = self::$func( $cur_args, $match );
 
 
225
 
226
- $i++;
227
  }
228
 
229
- return implode( "\n", $output ) . $_after;
 
 
 
 
230
  }
231
 
232
- // Handle args for checkboxes and radio inputs
233
- private static function _checkbox_single( $args, $data ) {
234
- $args = wp_parse_args( $args, array(
235
- 'name' => NULL,
236
  'value' => true,
237
- 'desc_pos' => 'after',
238
  'desc' => NULL,
239
- 'checked' => NULL,
240
  'extra' => array(),
241
  ) );
242
 
@@ -244,11 +274,7 @@ class scbForms {
244
  $$key = &$val;
245
  unset( $val );
246
 
247
- if ( $checked === NULL && $value == $data )
248
- $checked = true;
249
-
250
- if ( $checked )
251
- $extra['checked'] = 'checked';
252
 
253
  if ( is_null( $desc ) && !is_bool( $value ) )
254
  $desc = str_replace( '[]', '', $value );
@@ -257,9 +283,9 @@ class scbForms {
257
  }
258
 
259
  // Handle args for text inputs
260
- private static function _input_single( $args, $data ) {
261
- $args = wp_parse_args( $args, array(
262
- 'value' => $data,
263
  'desc_pos' => 'after',
264
  'extra' => array( 'class' => 'regular-text' ),
265
  ) );
@@ -268,7 +294,7 @@ class scbForms {
268
  $$key = &$val;
269
  unset( $val );
270
 
271
- if ( FALSE === strpos( $name, '[' ) )
272
  $extra['id'] = $name;
273
 
274
  return self::_input_gen( $args );
@@ -276,72 +302,22 @@ class scbForms {
276
 
277
  // Generate html with the final args
278
  private static function _input_gen( $args ) {
279
- extract( wp_parse_args( $args, array(
280
- 'name' => NULL,
281
  'value' => NULL,
282
  'desc' => NULL,
283
  'extra' => array()
284
  ) ) );
285
 
286
- $extra = self::array_to_attr( $extra );
287
 
288
  if ( 'textarea' == $type ) {
289
- $value = esc_html( $value );
290
- $input = "<textarea name='{$name}'{$extra}>{$value}</textarea>\n";
291
- }
292
- else {
293
- $value = esc_attr( $value );
294
- $input = "<input name='{$name}' value='{$value}' type='{$type}'{$extra} /> ";
295
- }
296
-
297
- return self::add_label( $input, $desc, $desc_pos );
298
- }
299
-
300
- private static function _select() {
301
- extract( wp_parse_args( self::$args, array(
302
- 'name' => '',
303
- 'value' => array(),
304
- 'text' => '',
305
- 'selected' => array( 'foo' ), // hack to make default blank
306
- 'extra' => array(),
307
- 'numeric' => false, // use numeric array instead of associative
308
- 'desc' => '',
309
- 'desc_pos' => '',
310
- ) ), EXTR_SKIP );
311
-
312
- if ( empty( $value ) )
313
- $value = array( '' => '' );
314
-
315
- if ( !is_array( $value ) )
316
- return trigger_error( "'value' argument is expected to be an array", E_USER_WARNING );
317
-
318
- if ( !self::is_associative( $value ) && !$numeric )
319
- $value = array_combine( $value, $value );
320
-
321
- if ( isset( self::$formdata[$name] ) )
322
- $cur_val = self::$formdata[$name];
323
- else
324
- $cur_val = $selected;
325
-
326
- if ( false === $text ) {
327
- $opts = '';
328
  } else {
329
- $opts = "\t<option value=''" . selected( $cur_val, array( 'foo' ), false ) . ">{$text}</option>\n";
330
- }
331
-
332
- foreach ( $value as $key => $value ) {
333
- if ( empty( $key ) || empty( $value ) )
334
- continue;
335
-
336
- $opts .= "\t<option value='{$key}'" . selected( (string) $key, (string) $cur_val, false) . '>' . $value . "</option>\n";
337
  }
338
 
339
- if ( !is_array( $extra ) )
340
- $extra = self::attr_to_array( $extra );
341
- $extra = self::array_to_attr( $extra );
342
-
343
- $input = "<select name='{$name}'$extra>\n{$opts}</select>";
344
-
345
  return self::add_label( $input, $desc, $desc_pos );
346
  }
347
 
@@ -362,59 +338,110 @@ class scbForms {
362
  $label = trim( str_replace( self::token, $input, $label ) );
363
 
364
  if ( empty( $desc ) )
365
- $output = $input . "\n";
366
  else
367
- $output = "<label>{$label}</label>\n";
368
 
369
- return $output;
370
  }
371
 
372
 
373
  // Utilities
374
 
375
 
376
- private static function attr_to_array( $html ) {
377
- return shortcode_parse_atts( $html );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  }
379
 
380
- private static function array_to_attr( $attr ) {
381
- $out = '';
382
- foreach ( $attr as $key => $value )
383
- $out .= ' ' . $key . '=' . '"' . esc_attr( $value ) . '"';
 
 
 
 
 
 
 
 
 
 
 
 
384
 
385
- return $out;
386
  }
387
 
388
  private static function is_associative( $array ) {
389
- if ( !is_array( $array ) || empty( $array ) )
390
- return false;
391
-
392
  $keys = array_keys( $array );
393
-
394
  return array_keys( $keys ) !== $keys;
395
  }
 
 
 
 
 
 
 
 
396
 
397
- private static function array_extract( $array, $keys ) {
398
- $r = array();
399
- foreach ( $keys as $key )
400
- if ( isset( $array[$key] ) )
401
- $r[$key] = $array[$key];
402
 
403
- return $r;
 
404
  }
405
- }
406
 
407
- // PHP < 5.2
408
- if ( !function_exists( 'array_fill_keys' ) ) :
409
- function array_fill_keys( $keys, $value ) {
410
- if ( !is_array( $keys ) )
411
- trigger_error( 'First argument is expected to be an array.' . gettype( $keys ) . 'given', E_USER_WARNING );
412
 
413
- $r = array();
414
- foreach ( $keys as $key )
415
- $r[$key] = $value;
416
 
417
- return $r;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
  }
419
- endif;
420
 
1
  <?php
2
 
3
+ // Data-aware form generator
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
 
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
 
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
  ) );
272
 
274
  $$key = &$val;
275
  unset( $val );
276
 
277
+ $extra['checked'] = $checked;
 
 
 
 
278
 
279
  if ( is_null( $desc ) && !is_bool( $value ) )
280
  $desc = str_replace( '[]', '', $value );
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',
290
  'extra' => array( 'class' => 'regular-text' ),
291
  ) );
294
  $$key = &$val;
295
  unset( $val );
296
 
297
+ if ( !isset( $extra['id'] ) && !is_array( $name ) && false === strpos( $name, '[' ) )
298
  $extra['id'] = $name;
299
 
300
  return self::_input_gen( $args );
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
 
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
 
scb/Hooks.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class scbHooks {
4
+ private static $mangle_name;
5
+
6
+ public static function add( $class ) {
7
+ self::_do( 'add_filter', $class );
8
+ }
9
+
10
+ public static function remove( $class ) {
11
+ self::_do( 'remove_filter', $class );
12
+ }
13
+
14
+ public static function debug( $class, $mangle_name = false ) {
15
+ self::$mangle_name = $mangle_name;
16
+
17
+ echo "<pre>";
18
+ self::_do( array( __CLASS__, '_print' ), $class );
19
+ echo "</pre>";
20
+ }
21
+
22
+ private static function _print( $tag, $callback, $prio, $argc ) {
23
+ $static = !is_object( $callback[0] );
24
+
25
+ if ( self::$mangle_name )
26
+ $class = $static ? '__CLASS__' : '$this';
27
+ else if ( $static )
28
+ $class = "'" . $callback[0] . "'";
29
+ else
30
+ $class = '$' . get_class( $callback[0] );
31
+
32
+ $func = "array( $class, '$callback[1]' )";
33
+
34
+ echo "add_filter( '$tag', $func";
35
+
36
+ if ( $prio != 10 || $argc > 1 ) {
37
+ echo ", $prio";
38
+
39
+ if ( $argc > 1 )
40
+ echo ", $argc";
41
+ }
42
+
43
+ echo " );\n";
44
+ }
45
+
46
+ private static function _do( $action, $class ) {
47
+ $reflection = new ReflectionClass( $class );
48
+
49
+ foreach ( $reflection->getMethods() as $method ) {
50
+ if ( $method->isPublic() && !$method->isConstructor() ) {
51
+ $comment = $method->getDocComment();
52
+
53
+ if ( preg_match( '/@nohook[ \t\*\n]+/', $comment ) ) {
54
+ continue;
55
+ }
56
+
57
+ preg_match_all( '/@hook:?\s+([^\s]+)/', $comment, $matches ) ? $matches[1] : $method->name;
58
+ if ( empty( $matches[1] ) )
59
+ $hooks = array( $method->name );
60
+ else
61
+ $hooks = $matches[1];
62
+
63
+ $priority = preg_match( '/@priority:?\s+(\d+)/', $comment, $matches ) ? $matches[1] : 10;
64
+
65
+ foreach ( $hooks as $hook ) {
66
+ call_user_func( $action, $hook, array( $class, $method->name ), $priority, $method->getNumberOfParameters() );
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+
scb/Options.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
 
3
- // Documentation: http://scribu.net/wordpress/scb-framework/scb-options.html
4
 
5
  class scbOptions {
6
 
7
- protected $key; // the option name
8
 
9
- protected $defaults; // the default value( s )
10
 
11
  public $wp_filter_id; // used by WP hooks
12
 
@@ -15,15 +15,16 @@ class scbOptions {
15
  *
16
  * @param string $key Option name
17
  * @param string $file Reference to main plugin file
18
- * @param array $defaults An associative array of default values ( optional )
19
  */
20
- public function __construct( $key, $file, $defaults = '' ) {
21
  $this->key = $key;
22
  $this->defaults = $defaults;
23
 
24
- scbUtil::add_activation_hook( $file, array( $this, '_update_reset' ) );
25
-
26
- scbUtil::add_uninstall_hook( $file, array( $this, 'delete' ) );
 
27
  }
28
 
29
  /**
@@ -36,15 +37,14 @@ class scbOptions {
36
  /**
37
  * Get option values for one, many or all fields
38
  *
39
- * @param string|array $field The field( s ) to get
40
  * @return mixed Whatever is in those fields
41
  */
42
  public function get( $field = '' ) {
43
- $data = get_option( $this->key );
 
 
44
 
45
- if ( is_array( $this->defaults ) )
46
- $data = ( array ) $data;
47
-
48
  return $this->_get( $field, $data );
49
  }
50
 
@@ -119,21 +119,17 @@ class scbOptions {
119
  //_____INTERNAL METHODS_____
120
 
121
 
122
- // Add new fields with their default values
123
- function _update_reset() {
124
- if ( is_array( $this->defaults ) )
125
- $this->update( array_merge( $this->defaults, $this->get() ) );
126
- else
127
- add_option( $this->key, $this->defaults );
128
  }
129
 
 
130
  private function _clean( $data ) {
131
- if ( !is_array( $data ) || !is_array( $this->defaults ) )
132
- return $data;
133
-
134
  $r = array();
135
  foreach ( array_keys( $this->defaults ) as $key )
136
- $r[$key] = @$data[$key];
 
137
 
138
  return $r;
139
  }
1
  <?php
2
 
3
+ // Container for an array of options
4
 
5
  class scbOptions {
6
 
7
+ protected $key; // the option name
8
 
9
+ protected $defaults; // the default values
10
 
11
  public $wp_filter_id; // used by WP hooks
12
 
15
  *
16
  * @param string $key Option name
17
  * @param string $file Reference to main plugin file
18
+ * @param array $defaults An associative array of default values (optional)
19
  */
20
+ public function __construct( $key, $file, $defaults = array() ) {
21
  $this->key = $key;
22
  $this->defaults = $defaults;
23
 
24
+ if ( $file ) {
25
+ scbUtil::add_activation_hook( $file, array( $this, '_activation' ) );
26
+ scbUtil::add_uninstall_hook( $file, array( $this, 'delete' ) );
27
+ }
28
  }
29
 
30
  /**
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
 
119
  //_____INTERNAL METHODS_____
120
 
121
 
122
+ // Saves an extra query
123
+ function _activation() {
124
+ add_option( $this->key, $this->defaults );
 
 
 
125
  }
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
  }
scb/QueryManipulation.php DELETED
@@ -1,81 +0,0 @@
1
- <?php
2
-
3
- class scbQueryManipulation {
4
-
5
- private $bits = array();
6
- private $wp_query;
7
-
8
- private static $filters = array(
9
- 'posts_where',
10
- 'posts_join',
11
- 'posts_groupby',
12
- 'posts_orderby',
13
- 'posts_distinct',
14
- 'post_limits',
15
- 'posts_fields'
16
- );
17
-
18
- public function __construct( $callback, $once = true ) {
19
- $this->callback = $callback;
20
-
21
- $this->enable();
22
-
23
- if ( !$once )
24
- return;
25
-
26
- add_filter( 'posts_request', array( $this, '_disable' ) );
27
- }
28
-
29
- function _disable( $request ) {
30
- remove_filter( 'posts_request', array( $this, '_disable' ) );
31
-
32
- $this->disable();
33
-
34
- return $request;
35
- }
36
-
37
- public function enable() {
38
- foreach ( self::$filters as $filter ) {
39
- add_filter( $filter, array( $this, 'collect' ), 999, 2 );
40
- add_filter( $filter . '_request' , array( $this, 'update' ), 9 );
41
- }
42
-
43
- add_action( 'posts_selection' , array( $this, 'alter' ) );
44
- }
45
-
46
- public function disable() {
47
- foreach ( self::$filters as $filter ) {
48
- remove_filter( $filter, array( $this, 'collect' ), 999, 2 );
49
- remove_filter( $filter . '_request' , array( $this, 'update' ), 9 );
50
- }
51
-
52
- remove_action( 'posts_selection' , array( $this, 'alter' ) );
53
- }
54
-
55
- function collect( $value, $wp_query ) {
56
- // remove 'posts_'
57
- $key = explode( '_', current_filter() );
58
- $key = array_slice( $key, 1 );
59
- $key = implode( '_', $key );
60
-
61
- $this->bits[ $key ] = $value;
62
-
63
- $this->wp_query = $wp_query;
64
-
65
- return $value;
66
- }
67
-
68
- function alter( $query ) {
69
- $this->bits = call_user_func( $this->callback, $this->bits, $this->wp_query );
70
- }
71
-
72
- function update( $value ) {
73
- // remove 'posts_' and '_request'
74
- $key = explode( '_', current_filter() );
75
- $key = array_slice( $key, 1, -1 );
76
- $key = implode( '_', $key );
77
-
78
- return $this->bits[ $key ];
79
- }
80
- }
81
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scb/Table.php CHANGED
@@ -1,49 +1,70 @@
1
  <?php
2
 
3
  // Takes care of creating, updating and deleting database tables
 
4
  class scbTable {
5
  protected $name;
6
  protected $columns;
7
  protected $upgrade_method;
8
 
9
  function __construct( $name, $file, $columns, $upgrade_method = 'dbDelta' ) {
10
- global $wpdb;
11
-
12
- $this->name = $wpdb->$name = $wpdb->prefix . $name;
13
  $this->columns = $columns;
14
  $this->upgrade_method = $upgrade_method;
15
 
16
- scbUtil::add_activation_hook( $file, array( $this, 'install' ) );
17
- scbUtil::add_uninstall_hook( $file, array( $this, 'uninstall' ) );
 
 
 
 
18
  }
19
 
20
  function install() {
21
- global $wpdb;
22
-
23
- $charset_collate = '';
24
- if ( $wpdb->has_cap( 'collation' ) ) {
25
- if ( ! empty( $wpdb->charset ) )
26
- $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
27
- if ( ! empty( $wpdb->collate ) )
28
- $charset_collate .= " COLLATE $wpdb->collate";
29
- }
30
 
31
- if ( 'dbDelta' == $this->upgrade_method ) {
32
- require_once ABSPATH . 'wp-admin/includes/upgrade.php';
33
- dbDelta( "CREATE TABLE $this->name ( $this->columns ) $charset_collate" );
34
- return;
35
- }
36
 
37
- if ( 'delete_first' == $this->upgrade_method )
38
- $wpdb->query( "DROP TABLE IF EXISTS $this->name;" );
39
 
40
- $wpdb->query( "CREATE TABLE IF NOT EXISTS $this->name ( $this->columns ) $charset_collate;" );
41
- }
42
 
43
- function uninstall() {
44
- global $wpdb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
- $wpdb->query( "DROP TABLE IF EXISTS $this->name" );
 
 
 
47
  }
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
 
1
  <?php
2
 
3
  // Takes care of creating, updating and deleting database tables
4
+
5
  class scbTable {
6
  protected $name;
7
  protected $columns;
8
  protected $upgrade_method;
9
 
10
  function __construct( $name, $file, $columns, $upgrade_method = 'dbDelta' ) {
11
+ $this->name = $name;
 
 
12
  $this->columns = $columns;
13
  $this->upgrade_method = $upgrade_method;
14
 
15
+ scb_register_table( $name );
16
+
17
+ if ( $file ) {
18
+ scbUtil::add_activation_hook( $file, array( $this, 'install' ) );
19
+ scbUtil::add_uninstall_hook( $file, array( $this, 'uninstall' ) );
20
+ }
21
  }
22
 
23
  function install() {
24
+ scb_install_table( $this->name, $this->columns, $this->upgrade_method );
25
+ }
 
 
 
 
 
 
 
26
 
27
+ function uninstall() {
28
+ scb_uninstall_table( $this->name );
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' ) ) {
47
+ if ( ! empty( $wpdb->charset ) )
48
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
49
+ if ( ! empty( $wpdb->collate ) )
50
+ $charset_collate .= " COLLATE $wpdb->collate";
51
+ }
52
 
53
+ if ( 'dbDelta' == $upgrade_method ) {
54
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
55
+ dbDelta( "CREATE TABLE $full_table_name ( $columns ) $charset_collate" );
56
+ return;
57
  }
58
+
59
+ if ( 'delete_first' == $upgrade_method )
60
+ $wpdb->query( "DROP TABLE IF EXISTS $full_table_name;" );
61
+
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
 
scb/Util.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  class scbUtil {
4
 
5
  // Force script enqueue
@@ -23,27 +25,42 @@ class scbUtil {
23
 
24
  ob_start();
25
  $wp_styles->do_items( ( array ) $handles );
26
- $content = str_replace( array( '"', "\n" ), array( "'", '' ), ob_get_clean() );
27
 
28
  echo "<script type='text/javascript'>\n";
29
- echo "jQuery( document ).ready( function( $ ) {\n";
30
- echo "$( 'head' ).prepend( \"$content\" );\n";
31
- echo "} );\n";
32
  echo "</script>";
33
  }
34
 
35
- // Enable delayed activation ( to be used with scb_init() )
36
  static function add_activation_hook( $plugin, $callback ) {
37
- add_action( 'scb_activation_' . plugin_basename( $plugin ), $callback );
 
 
 
 
 
 
 
38
  }
39
 
40
- // Have more than one uninstall hooks; also prevents an UPDATE query on each page load
 
41
  static function add_uninstall_hook( $plugin, $callback ) {
42
  register_uninstall_hook( $plugin, '__return_false' ); // dummy
43
 
44
  add_action( 'uninstall_' . plugin_basename( $plugin ), $callback );
45
  }
46
 
 
 
 
 
 
 
 
 
 
47
  // Apply a function to each element of a ( nested ) array recursively
48
  static function array_map_recursive( $callback, $array ) {
49
  array_walk_recursive( $array, array( __CLASS__, 'array_map_recursive_helper' ), $callback );
@@ -57,37 +74,20 @@ class scbUtil {
57
 
58
  // Extract certain $keys from $array
59
  static function array_extract( $array, $keys ) {
60
- $r = array();
61
-
62
- foreach ( $keys as $key )
63
- if ( array_key_exists( $key, $array ) )
64
- $r[$key] = $array[$key];
65
-
66
- return $r;
67
  }
68
 
69
  // Extract a certain value from a list of arrays
70
  static function array_pluck( $array, $key ) {
71
- $r = array();
72
-
73
- foreach ( $array as $value ) {
74
- if ( is_object( $value ) )
75
- $value = get_object_vars( $value );
76
- if ( array_key_exists( $key, $value ) )
77
- $r[] = $value[$key];
78
- }
79
-
80
- return $r;
81
  }
82
 
83
  // Transform a list of objects into an associative array
84
  static function objects_to_assoc( $objects, $key, $value ) {
85
- $r = array();
86
-
87
- foreach ( $objects as $obj )
88
- $r[$obj->$key] = $obj->$value;
89
-
90
- return $r;
91
  }
92
 
93
  // Prepare an array for an IN statement
@@ -112,22 +112,60 @@ class scbUtil {
112
  }
113
  }
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  //_____Minimalist HTML framework_____
117
 
118
-
 
 
119
  if ( ! function_exists( 'html' ) ):
120
- function html( $tag, $attributes = array(), $content = '' ) {
121
- if ( is_array( $attributes ) ) {
 
 
 
 
122
  $closing = $tag;
 
123
  foreach ( $attributes as $key => $value ) {
 
 
 
 
 
 
124
  $tag .= ' ' . $key . '="' . esc_attr( $value ) . '"';
125
  }
126
  } else {
127
- $content = $attributes;
128
- list( $closing ) = explode(' ', $tag, 2);
129
  }
130
 
 
 
 
 
 
 
131
  return "<{$tag}>{$content}</{$closing}>";
132
  }
133
  endif;
@@ -138,7 +176,7 @@ function html_link( $url, $title = '' ) {
138
  if ( empty( $title ) )
139
  $title = $url;
140
 
141
- return sprintf( "<a href='%s'>%s</a>", esc_url( $url ), $title );
142
  }
143
  endif;
144
 
1
  <?php
2
 
3
+ // Various utilities
4
+
5
  class scbUtil {
6
 
7
  // Force script enqueue
25
 
26
  ob_start();
27
  $wp_styles->do_items( ( array ) $handles );
28
+ $content = str_replace( array( "'", "\n" ), array( '"', '' ), ob_get_clean() );
29
 
30
  echo "<script type='text/javascript'>\n";
31
+ echo "jQuery(function ($) { $('head').prepend('$content'); });\n";
 
 
32
  echo "</script>";
33
  }
34
 
35
+ // Enable delayed activation; to be used with scb_init()
36
  static function add_activation_hook( $plugin, $callback ) {
37
+ if ( defined( 'SCB_LOAD_MU' ) )
38
+ register_activation_hook( $plugin, $callback );
39
+ else
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
  }
46
 
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
+ }
58
+
59
+ // Get the current, full URL
60
+ static function get_current_url() {
61
+ return ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
62
+ }
63
+
64
  // Apply a function to each element of a ( nested ) array recursively
65
  static function array_map_recursive( $callback, $array ) {
66
  array_walk_recursive( $array, array( __CLASS__, 'array_map_recursive_helper' ), $callback );
74
 
75
  // Extract certain $keys from $array
76
  static function array_extract( $array, $keys ) {
77
+ _deprecated_function( __CLASS__ . '::' . __FUNCTION__, 'WP 3.1', 'wp_array_slice_assoc()' );
78
+ return wp_array_slice_assoc( $array, $keys );
 
 
 
 
 
79
  }
80
 
81
  // Extract a certain value from a list of arrays
82
  static function array_pluck( $array, $key ) {
83
+ _deprecated_function( __CLASS__ . '::' . __FUNCTION__, 'WP 3.1', 'wp_list_pluck()' );
84
+ return wp_list_pluck( $array, $key );
 
 
 
 
 
 
 
 
85
  }
86
 
87
  // Transform a list of objects into an associative array
88
  static function objects_to_assoc( $objects, $key, $value ) {
89
+ _deprecated_function( __CLASS__ . '::' . __FUNCTION__, 'r41', 'scb_list_fold()' );
90
+ return scb_list_fold( $objects, $key, $value );
 
 
 
 
91
  }
92
 
93
  // Prepare an array for an IN statement
112
  }
113
  }
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
121
+ function scb_list_fold( $list, $key, $value ) {
122
+ $r = array();
123
+
124
+ if ( is_array( reset( $list ) ) ) {
125
+ foreach ( $list as $item )
126
+ $r[ $item[ $key ] ] = $item[ $value ];
127
+ } else {
128
+ foreach ( $list as $item )
129
+ $r[ $item->$key ] = $item->$value;
130
+ }
131
+
132
+ return $r;
133
+ }
134
+
135
 
136
  //_____Minimalist HTML framework_____
137
 
138
+ /**
139
+ * Generate an HTML tag. Atributes are escaped. Content is NOT escaped.
140
+ */
141
  if ( ! function_exists( 'html' ) ):
142
+ function html( $tag ) {
143
+ $args = func_get_args();
144
+
145
+ $tag = array_shift( $args );
146
+
147
+ if ( is_array( $args[0] ) ) {
148
  $closing = $tag;
149
+ $attributes = array_shift( $args );
150
  foreach ( $attributes as $key => $value ) {
151
+ if ( false === $value )
152
+ continue;
153
+
154
+ if ( true === $value )
155
+ $value = $key;
156
+
157
  $tag .= ' ' . $key . '="' . esc_attr( $value ) . '"';
158
  }
159
  } else {
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
+
167
+ $content = implode( '', $args );
168
+
169
  return "<{$tag}>{$content}</{$closing}>";
170
  }
171
  endif;
176
  if ( empty( $title ) )
177
  $title = $url;
178
 
179
+ return html( 'a', array( 'href' => $url ), $title );
180
  }
181
  endif;
182
 
scb/Widget.php CHANGED
@@ -50,40 +50,26 @@ abstract class scbWidget extends WP_Widget {
50
  // See scbForms::input()
51
  // Allows extra parameter $args['title']
52
  protected function input( $args, $formdata = array() ) {
 
 
 
 
53
  // Add default class
54
- if ( !isset( $args['extra'] ) )
55
- $args['extra'] = 'class="regular-text"';
56
 
57
  // Add default label position
58
  if ( !in_array( $args['type'], array( 'checkbox', 'radio' ) ) && empty( $args['desc_pos'] ) )
59
  $args['desc_pos'] = 'before';
60
 
61
- // Then add prefix to names and formdata
62
- $new_formdata = array();
63
- foreach ( ( array ) $args['name'] as $name )
64
- $new_formdata[$this->scb_get_field_name( $name )] = @$formdata[$name];
65
- $new_names = array_keys( $new_formdata );
66
-
67
- // Finally, replace the old names
68
- if ( 1 == count( $new_names ) )
69
- $args['name'] = $new_names[0];
70
- else
71
- $args['name'] = $new_names;
72
-
73
- return scbForms::input( $args, $new_formdata );
74
- }
75
-
76
-
77
- //_____INTERNAL METHODS_____
78
 
 
 
79
 
80
- private function scb_get_field_name( $name ) {
81
- if ( $split = scbUtil::split_at( '[', $name ) )
82
- list( $basename, $extra ) = $split;
83
- else
84
- return $this->get_field_name( $name );
85
 
86
- return str_replace( '[]', '', $this->get_field_name( $basename ) ) . $extra;
87
  }
88
  }
89
 
50
  // See scbForms::input()
51
  // Allows extra parameter $args['title']
52
  protected function input( $args, $formdata = array() ) {
53
+ $prefix = array( 'widget-' . $this->id_base, $this->number );
54
+
55
+ $form = new scbForm( $formdata, $prefix );
56
+
57
  // Add default class
58
+ if ( !isset( $args['extra'] ) && 'text' == $args['type'] )
59
+ $args['extra'] = array( 'class' => 'widefat' );
60
 
61
  // Add default label position
62
  if ( !in_array( $args['type'], array( 'checkbox', 'radio' ) ) && empty( $args['desc_pos'] ) )
63
  $args['desc_pos'] = 'before';
64
 
65
+ $name = $args['name'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
+ if ( !is_array( $name ) && '[]' == substr( $name, -2 ) )
68
+ $name = array( substr( $name, 0, -2 ), '' );
69
 
70
+ $args['name'] = $name;
 
 
 
 
71
 
72
+ return $form->input( $args );
73
  }
74
  }
75
 
scb/load.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
- $GLOBALS['_scb_data'] = array( 24, __FILE__, array(
4
  'scbUtil', 'scbOptions', 'scbForms', 'scbTable',
5
  'scbWidget', 'scbAdminPage', 'scbBoxesPage',
6
- 'scbQueryManipulation', 'scbCron',
7
  ) );
8
 
9
  if ( !class_exists( 'scbLoad4' ) ) :
@@ -12,7 +12,7 @@ class scbLoad4 {
12
  private static $candidates;
13
  private static $classes;
14
  private static $callbacks = array();
15
-
16
  private static $loaded;
17
 
18
  static function init( $callback = '' ) {
@@ -28,7 +28,7 @@ class scbLoad4 {
28
  }
29
 
30
  // TODO: don't load when activating a plugin ?
31
- add_action( 'plugins_loaded', array( __CLASS__, 'load' ), 10, 0 );
32
  }
33
 
34
  static function delayed_activation( $plugin ) {
@@ -37,13 +37,14 @@ class scbLoad4 {
37
  if ( '.' == $plugin_dir )
38
  return;
39
 
40
- foreach ( self::$callbacks as $file => $callback )
41
- if ( plugin_basename( dirname( dirname( $file ) ) ) == $plugin_dir ) {
42
  self::load( false );
43
  call_user_func( $callback );
44
  do_action( 'scb_activation_' . $plugin );
45
  break;
46
  }
 
47
  }
48
 
49
  static function load( $do_callbacks = true ) {
@@ -56,7 +57,7 @@ class scbLoad4 {
56
  foreach ( self::$classes[$file] as $class_name ) {
57
  if ( class_exists( $class_name ) )
58
  continue;
59
-
60
  $fpath = $path . substr( $class_name, 3 ) . '.php';
61
  if ( file_exists( $fpath ) ) {
62
  include $fpath;
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' ) ) :
12
  private static $candidates;
13
  private static $classes;
14
  private static $callbacks = array();
15
+
16
  private static $loaded;
17
 
18
  static function init( $callback = '' ) {
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 ) {
37
  if ( '.' == $plugin_dir )
38
  return;
39
 
40
+ foreach ( self::$callbacks as $file => $callback ) {
41
+ if ( dirname( dirname( plugin_basename( $file ) ) ) == $plugin_dir ) {
42
  self::load( false );
43
  call_user_func( $callback );
44
  do_action( 'scb_activation_' . $plugin );
45
  break;
46
  }
47
+ }
48
  }
49
 
50
  static function load( $do_callbacks = true ) {
57
  foreach ( self::$classes[$file] as $class_name ) {
58
  if ( class_exists( $class_name ) )
59
  continue;
60
+
61
  $fpath = $path . substr( $class_name, 3 ) . '.php';
62
  if ( file_exists( $fpath ) ) {
63
  include $fpath;
template-tags.php CHANGED
@@ -173,12 +173,12 @@ class UserOnline_Template {
173
  $output = str_ireplace( "%{$user_type}S%", $number, $output );
174
  }
175
 
176
- // Seperators
177
  $separator = ( $counts['member'] && $counts['guest'] ) ? $template['separators']['guests'] : '';
178
- $output = str_ireplace( '%GUESTS_SEPERATOR%', $separator, $output );
179
 
180
  $separator = ( ( $counts['guest'] || $counts['member'] ) && $counts['bot'] ) ? $template['separators']['bots'] : '';
181
- $output = str_ireplace( '%BOTS_SEPERATOR%', $separator, $output );
182
 
183
  return $output;
184
  }
173
  $output = str_ireplace( "%{$user_type}S%", $number, $output );
174
  }
175
 
176
+ // SEPARATORs
177
  $separator = ( $counts['member'] && $counts['guest'] ) ? $template['separators']['guests'] : '';
178
+ $output = str_ireplace( '%GUESTS_SEPARATOR%', $separator, $output );
179
 
180
  $separator = ( ( $counts['guest'] || $counts['member'] ) && $counts['bot'] ) ? $template['separators']['bots'] : '';
181
+ $output = str_ireplace( '%BOTS_SEPARATOR%', $separator, $output );
182
 
183
  return $output;
184
  }
wp-useronline.php CHANGED
@@ -3,7 +3,7 @@
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.80
7
  Author: Lester 'GaMerZ' Chan & scribu
8
 
9
 
@@ -24,7 +24,7 @@ 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
- require_once dirname( __FILE__ ) . '/scb/load.php';
28
 
29
  function _useronline_init() {
30
  load_plugin_textdomain( 'wp-useronline', '', dirname( plugin_basename( __FILE__ ) ) . '/lang' );
@@ -77,7 +77,7 @@ function _useronline_init() {
77
  'guests' => __( ',', 'wp-useronline' ).' ',
78
  'bots' => __( ',', 'wp-useronline' ).' ',
79
  ),
80
- 'text' => _x( 'Users', 'Template Element', 'wp-useronline' ).': <strong>%MEMBER_NAMES%%GUESTS_SEPERATOR%%GUESTS%%BOTS_SEPERATOR%%BOTS%</strong>'
81
  ),
82
 
83
  'browsingpage' => array(
@@ -86,7 +86,7 @@ function _useronline_init() {
86
  'guests' => __( ',', 'wp-useronline' ).' ',
87
  'bots' => __( ',', 'wp-useronline' ).' ',
88
  ),
89
- 'text' => '<strong>%USERS%</strong> '.__( 'Browsing This Page.', 'wp-useronline' ).'<br />'._x( 'Users', 'Template Element', 'wp-useronline' ).': <strong>%MEMBER_NAMES%%GUESTS_SEPERATOR%%GUESTS%%BOTS_SEPERATOR%%BOTS%</strong>'
90
  )
91
  )
92
  ) );
@@ -99,10 +99,13 @@ function _useronline_init() {
99
  require_once dirname( __FILE__ ) . '/admin.php';
100
  scbAdminPage::register( 'UserOnline_Admin_Integration', __FILE__ );
101
  scbAdminPage::register( 'UserOnline_Options', __FILE__, UserOnline_Core::$options );
102
-
103
- if ( function_exists( 'stats_page' ) )
104
- require_once dirname( __FILE__ ) . '/wp-stats.php';
105
  }
 
 
 
 
 
 
106
  }
107
  scb_init( '_useronline_init' );
108
 
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
 
24
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
  */
26
 
27
+ @include dirname( __FILE__ ) . '/scb/load.php';
28
 
29
  function _useronline_init() {
30
  load_plugin_textdomain( 'wp-useronline', '', dirname( plugin_basename( __FILE__ ) ) . '/lang' );
77
  'guests' => __( ',', 'wp-useronline' ).' ',
78
  'bots' => __( ',', 'wp-useronline' ).' ',
79
  ),
80
+ 'text' => _x( 'Users', 'Template Element', 'wp-useronline' ).': <strong>%MEMBER_NAMES%%GUESTS_SEPARATOR%%GUESTS%%BOTS_SEPARATOR%%BOTS%</strong>'
81
  ),
82
 
83
  'browsingpage' => array(
86
  'guests' => __( ',', 'wp-useronline' ).' ',
87
  'bots' => __( ',', 'wp-useronline' ).' ',
88
  ),
89
+ 'text' => '<strong>%USERS%</strong> '.__( 'Browsing This Page.', 'wp-useronline' ).'<br />'._x( 'Users', 'Template Element', 'wp-useronline' ).': <strong>%MEMBER_NAMES%%GUESTS_SEPARATOR%%GUESTS%%BOTS_SEPARATOR%%BOTS%</strong>'
90
  )
91
  )
92
  ) );
99
  require_once dirname( __FILE__ ) . '/admin.php';
100
  scbAdminPage::register( 'UserOnline_Admin_Integration', __FILE__ );
101
  scbAdminPage::register( 'UserOnline_Options', __FILE__, UserOnline_Core::$options );
 
 
 
102
  }
103
+
104
+ if ( function_exists( 'stats_page' ) )
105
+ require_once dirname( __FILE__ ) . '/wp-stats.php';
106
+
107
+ # scbUtil::do_uninstall( __FILE__ );
108
+ # scbUtil::do_activation( __FILE__ );
109
  }
110
  scb_init( '_useronline_init' );
111