Post Expirator - Version 1.6.1

Version Description

Tweaked error messages, added option to allow user to select cron schedule and set default exiration duration

Download this release

Release Info

Developer axelseaa
Plugin Icon 128x128 Post Expirator
Version 1.6.1
Comparing to
See all releases

Code changes from version 1.6 to 1.6.1

Files changed (3) hide show
  1. languages/post-expirator.pot +139 -96
  2. post-expirator.php +259 -195
  3. readme.txt +16 -2
languages/post-expirator.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Post Expirator 1.6\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/post-expirator\n"
7
- "POT-Creation-Date: 2012-06-19 02:54:45+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -24,160 +24,172 @@ msgstr ""
24
  msgid "Message"
25
  msgstr ""
26
 
27
- #: post-expirator.php:20
28
  msgid "l F jS, Y"
29
  msgstr ""
30
 
31
- #: post-expirator.php:21
32
  msgid "g:ia"
33
  msgstr ""
34
 
35
- #: post-expirator.php:22
36
  msgid "Post expires at EXPIRATIONTIME on EXPIRATIONDATE"
37
  msgstr ""
38
 
39
- #: post-expirator.php:43
40
  msgid "Once a Minute"
41
  msgstr ""
42
 
43
- #: post-expirator.php:55
 
 
 
 
 
 
 
 
44
  msgid "Post Expirator cron events need to be reset. "
45
  msgstr ""
46
 
47
- #: post-expirator.php:57
48
  msgid "Click here to reset"
49
  msgstr ""
50
 
51
- #: post-expirator.php:135
52
  msgid "Expires"
53
  msgstr ""
54
 
55
- #: post-expirator.php:151
56
  msgid "Never"
57
  msgstr ""
58
 
59
  #. #-#-#-#-# plugin.pot (Post Expirator 1.6) #-#-#-#-#
60
  #. Plugin Name of the plugin/theme
61
- #: post-expirator.php:163 post-expirator.php:165 post-expirator.php:398
62
  msgid "Post Expirator"
63
  msgstr ""
64
 
65
- #: post-expirator.php:197
66
  msgid "Enable Post Expiration"
67
  msgstr ""
68
 
69
- #: post-expirator.php:199
 
 
 
 
70
  msgid "Year"
71
  msgstr ""
72
 
73
- #: post-expirator.php:200
74
  msgid "Month"
75
  msgstr ""
76
 
77
- #: post-expirator.php:201
78
  msgid "Day"
79
  msgstr ""
80
 
81
- #: post-expirator.php:233
82
  msgid "Hour"
83
  msgstr ""
84
 
85
- #: post-expirator.php:234
86
  msgid "Minute"
87
  msgstr ""
88
 
89
- #: post-expirator.php:256
90
  msgid "Expiration Categories"
91
  msgstr ""
92
 
93
- #: post-expirator.php:266
94
  msgid ""
95
  "Setting an expiration category will change the category at expiration time, "
96
  "and override the default post action"
97
  msgstr ""
98
 
99
- #: post-expirator.php:368
100
  msgid "General Settings"
101
  msgstr ""
102
 
103
- #: post-expirator.php:369
104
  msgid "Diagnostics"
105
  msgstr ""
106
 
107
- #: post-expirator.php:370
108
  msgid "View Debug Logs"
109
  msgstr ""
110
 
111
- #: post-expirator.php:381 post-expirator.php:398
112
  msgid "Post Expirator Options"
113
  msgstr ""
114
 
115
- #: post-expirator.php:418
116
  msgid "Saved Options!"
117
  msgstr ""
118
 
119
- #: post-expirator.php:479
120
  msgid ""
121
  "The post expirator plugin sets a custom meta value, and then optionally "
122
  "allows you to select if you want the post changed to a draft status or "
123
  "deleted when it expires."
124
  msgstr ""
125
 
126
- #: post-expirator.php:482
127
  msgid "Valid [postexpirator] attributes:"
128
  msgstr ""
129
 
130
- #: post-expirator.php:484
131
  msgid "type - defaults to full - valid options are full,date,time"
132
  msgstr ""
133
 
134
- #: post-expirator.php:485
135
  msgid ""
136
  "dateformat - format set here will override the value set on the settings page"
137
  msgstr ""
138
 
139
- #: post-expirator.php:486
140
  msgid ""
141
  "timeformat - format set here will override the value set on the settings page"
142
  msgstr ""
143
 
144
- #: post-expirator.php:490
145
  msgid "Defaults"
146
  msgstr ""
147
 
148
- #: post-expirator.php:493
149
  msgid "Set Post To:"
150
  msgstr ""
151
 
152
- #: post-expirator.php:496 post-expirator.php:507
153
  msgid "Draft"
154
  msgstr ""
155
 
156
- #: post-expirator.php:497 post-expirator.php:508
157
  msgid "Delete"
158
  msgstr ""
159
 
160
- #: post-expirator.php:500
161
  msgid ""
162
  "Select whether the post should be deleted or changed to a draft at "
163
  "expiration time."
164
  msgstr ""
165
 
166
- #: post-expirator.php:504
167
  msgid "Set Page To:"
168
  msgstr ""
169
 
170
- #: post-expirator.php:511
171
  msgid ""
172
  "Select whether the page should be deleted or changed to a draft at "
173
  "expiration time."
174
  msgstr ""
175
 
176
- #: post-expirator.php:515
177
  msgid "Date Format:"
178
  msgstr ""
179
 
180
- #: post-expirator.php:519
181
  msgid ""
182
  "The default format to use when displaying the expiration date within a post "
183
  "using the [postexpirator] shortcode or within the footer. For information "
@@ -185,11 +197,11 @@ msgid ""
185
  "function.date.php\" target=\"_blank\">PHP Date Function</a>."
186
  msgstr ""
187
 
188
- #: post-expirator.php:523
189
  msgid "Time Format:"
190
  msgstr ""
191
 
192
- #: post-expirator.php:527
193
  msgid ""
194
  "The default format to use when displaying the expiration time within a post "
195
  "using the [postexpirator] shortcode or within the footer. For information "
@@ -197,209 +209,240 @@ msgid ""
197
  "function.date.php\" target=\"_blank\">PHP Date Function</a>."
198
  msgstr ""
199
 
200
- #: post-expirator.php:531
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  msgid "Category Expiration"
202
  msgstr ""
203
 
204
- #: post-expirator.php:534
205
  msgid "Enable Post Expiration to Category?"
206
  msgstr ""
207
 
208
- #: post-expirator.php:536 post-expirator.php:565
209
  msgid "Enabled"
210
  msgstr ""
211
 
212
- #: post-expirator.php:537 post-expirator.php:566
213
  msgid "Disabled"
214
  msgstr ""
215
 
216
- #: post-expirator.php:539
217
  msgid "This will enable or disable the ability to expire a post to a category."
218
  msgstr ""
219
 
220
- #: post-expirator.php:543
221
  msgid "Default Expiration Category"
222
  msgstr ""
223
 
224
- #: post-expirator.php:554
225
  msgid "Set's the default expiration category for the post."
226
  msgstr ""
227
 
228
- #: post-expirator.php:559
229
  msgid "Post Footer Display"
230
  msgstr ""
231
 
232
- #: post-expirator.php:560
233
  msgid ""
234
  "Enabling this below will display the expiration date automatically at the "
235
  "end of any post which is set to expire."
236
  msgstr ""
237
 
238
- #: post-expirator.php:563
239
  msgid "Show in post footer?"
240
  msgstr ""
241
 
242
- #: post-expirator.php:568
243
  msgid ""
244
  "This will enable or disable displaying the post expiration date in the post "
245
  "footer."
246
  msgstr ""
247
 
248
- #: post-expirator.php:572
249
  msgid "Footer Contents:"
250
  msgstr ""
251
 
252
- #: post-expirator.php:576
253
  msgid ""
254
  "Enter the text you would like to appear at the bottom of every post that "
255
  "will expire. The following placeholders will be replaced with the post "
256
  "expiration date in the following format:"
257
  msgstr ""
258
 
259
- #: post-expirator.php:585
260
  msgid "Footer Style:"
261
  msgstr ""
262
 
263
- #: post-expirator.php:588
264
  msgid "This post will expire on"
265
  msgstr ""
266
 
267
- #: post-expirator.php:590
268
  msgid "The inline css which will be used to style the footer text."
269
  msgstr ""
270
 
271
- #: post-expirator.php:595
272
- msgid "Save"
273
  msgstr ""
274
 
275
- #: post-expirator.php:655
276
- msgid "Cron Events Reset! (Reload page to remove warning)"
277
- msgstr ""
278
-
279
- #: post-expirator.php:658
280
  msgid "Debugging Disabled"
281
  msgstr ""
282
 
283
- #: post-expirator.php:661
284
  msgid "Debugging Enabled"
285
  msgstr ""
286
 
287
- #: post-expirator.php:666
288
  msgid "Debugging Table Emptied"
289
  msgstr ""
290
 
291
- #: post-expirator.php:670 post-expirator.php:674
292
  msgid "OK"
293
  msgstr ""
294
 
295
- #: post-expirator.php:671
296
  msgid "RESET NEEDED"
297
  msgstr ""
298
 
299
- #: post-expirator.php:675
300
  msgid "ERROR WITH FILTER"
301
  msgstr ""
302
 
303
- #: post-expirator.php:681
304
  msgid "Cron Settings"
305
  msgstr ""
306
 
307
- #: post-expirator.php:684
308
  msgid "Reset Cron Event:"
309
  msgstr ""
310
 
311
- #: post-expirator.php:686
312
  msgid "Reset"
313
  msgstr ""
314
 
315
- #: post-expirator.php:687 post-expirator.php:695
316
  msgid "Status:"
317
  msgstr ""
318
 
319
- #: post-expirator.php:689
320
  msgid "Resets the cron event and removes any old or stray entries."
321
  msgstr ""
322
 
323
- #: post-expirator.php:693
324
  msgid "Reset Cron Schedule:"
325
  msgstr ""
326
 
327
- #: post-expirator.php:697
328
  msgid "Displays the cron minute schedule status for post expirator."
329
  msgstr ""
330
 
331
- #: post-expirator.php:702
332
  msgid "Advanced Diagnostics"
333
  msgstr ""
334
 
335
- #: post-expirator.php:705
336
  msgid "Post Expirator Debug Logging:"
337
  msgstr ""
338
 
339
- #: post-expirator.php:709
340
  msgid "Status: Enabled"
341
  msgstr ""
342
 
343
- #: post-expirator.php:710
344
  msgid "Disable Debugging"
345
  msgstr ""
346
 
347
- #: post-expirator.php:712
348
  msgid "Status: Disabled"
349
  msgstr ""
350
 
351
- #: post-expirator.php:713
352
  msgid "Enable Debugging"
353
  msgstr ""
354
 
355
- #: post-expirator.php:721
356
  msgid "Purge Debug Log:"
357
  msgstr ""
358
 
359
- #: post-expirator.php:723
360
  msgid "Purge Debug Log"
361
  msgstr ""
362
 
363
- #: post-expirator.php:727
364
  msgid "Current Cron Schedule:"
365
  msgstr ""
366
 
367
- #: post-expirator.php:729
368
  msgid ""
369
  "The below table will show all currently scheduled cron events with the next "
370
  "run time."
371
  msgstr ""
372
 
373
- #: post-expirator.php:730
374
  msgid ""
375
- "Single site (non multisite) users should see an event named "
376
- "expirationdate_delete with a schedule of postexpiratorminute."
377
  msgstr ""
378
 
379
- #: post-expirator.php:731
380
  msgid ""
381
- "Multisite users should see an event named expirationdate_delete_blogid "
382
- "(where the blogid is replaced with the numeric id of the blog) with a "
383
- "schedule of postexpiratorminute"
384
  msgstr ""
385
 
386
- #: post-expirator.php:734
387
  msgid "Date"
388
  msgstr ""
389
 
390
- #: post-expirator.php:735
391
  msgid "Event"
392
  msgstr ""
393
 
394
- #: post-expirator.php:736
395
  msgid "Schedule"
396
  msgstr ""
397
 
398
- #: post-expirator.php:737
399
  msgid "Interval (seconds)"
400
  msgstr ""
401
 
402
- #: post-expirator.php:763
403
  msgid ""
404
  "Below is a dump of the debugging table, this should be useful for "
405
  "troubleshooting."
4
  msgstr ""
5
  "Project-Id-Version: Post Expirator 1.6\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/post-expirator\n"
7
+ "POT-Creation-Date: 2012-07-26 03:34:46+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
24
  msgid "Message"
25
  msgstr ""
26
 
27
+ #: post-expirator.php:23
28
  msgid "l F jS, Y"
29
  msgstr ""
30
 
31
+ #: post-expirator.php:24
32
  msgid "g:ia"
33
  msgstr ""
34
 
35
+ #: post-expirator.php:25
36
  msgid "Post expires at EXPIRATIONTIME on EXPIRATIONDATE"
37
  msgstr ""
38
 
39
+ #: post-expirator.php:53
40
  msgid "Once a Minute"
41
  msgstr ""
42
 
43
+ #: post-expirator.php:62
44
+ msgid "Settings"
45
+ msgstr ""
46
+
47
+ #: post-expirator.php:75
48
+ msgid "Cron Events Reset!"
49
+ msgstr ""
50
+
51
+ #: post-expirator.php:79
52
  msgid "Post Expirator cron events need to be reset. "
53
  msgstr ""
54
 
55
+ #: post-expirator.php:81
56
  msgid "Click here to reset"
57
  msgstr ""
58
 
59
+ #: post-expirator.php:159
60
  msgid "Expires"
61
  msgstr ""
62
 
63
+ #: post-expirator.php:175
64
  msgid "Never"
65
  msgstr ""
66
 
67
  #. #-#-#-#-# plugin.pot (Post Expirator 1.6) #-#-#-#-#
68
  #. Plugin Name of the plugin/theme
69
+ #: post-expirator.php:187 post-expirator.php:189 post-expirator.php:465
70
  msgid "Post Expirator"
71
  msgstr ""
72
 
73
+ #: post-expirator.php:238
74
  msgid "Enable Post Expiration"
75
  msgstr ""
76
 
77
+ #: post-expirator.php:241
78
+ msgid "The published date/time will be used as the expiration value"
79
+ msgstr ""
80
+
81
+ #: post-expirator.php:244
82
  msgid "Year"
83
  msgstr ""
84
 
85
+ #: post-expirator.php:245
86
  msgid "Month"
87
  msgstr ""
88
 
89
+ #: post-expirator.php:246
90
  msgid "Day"
91
  msgstr ""
92
 
93
+ #: post-expirator.php:278
94
  msgid "Hour"
95
  msgstr ""
96
 
97
+ #: post-expirator.php:279
98
  msgid "Minute"
99
  msgstr ""
100
 
101
+ #: post-expirator.php:302
102
  msgid "Expiration Categories"
103
  msgstr ""
104
 
105
+ #: post-expirator.php:312
106
  msgid ""
107
  "Setting an expiration category will change the category at expiration time, "
108
  "and override the default post action"
109
  msgstr ""
110
 
111
+ #: post-expirator.php:435
112
  msgid "General Settings"
113
  msgstr ""
114
 
115
+ #: post-expirator.php:436
116
  msgid "Diagnostics"
117
  msgstr ""
118
 
119
+ #: post-expirator.php:437
120
  msgid "View Debug Logs"
121
  msgstr ""
122
 
123
+ #: post-expirator.php:448 post-expirator.php:465
124
  msgid "Post Expirator Options"
125
  msgstr ""
126
 
127
+ #: post-expirator.php:489
128
  msgid "Saved Options!"
129
  msgstr ""
130
 
131
+ #: post-expirator.php:526
132
  msgid ""
133
  "The post expirator plugin sets a custom meta value, and then optionally "
134
  "allows you to select if you want the post changed to a draft status or "
135
  "deleted when it expires."
136
  msgstr ""
137
 
138
+ #: post-expirator.php:529
139
  msgid "Valid [postexpirator] attributes:"
140
  msgstr ""
141
 
142
+ #: post-expirator.php:531
143
  msgid "type - defaults to full - valid options are full,date,time"
144
  msgstr ""
145
 
146
+ #: post-expirator.php:532
147
  msgid ""
148
  "dateformat - format set here will override the value set on the settings page"
149
  msgstr ""
150
 
151
+ #: post-expirator.php:533
152
  msgid ""
153
  "timeformat - format set here will override the value set on the settings page"
154
  msgstr ""
155
 
156
+ #: post-expirator.php:537
157
  msgid "Defaults"
158
  msgstr ""
159
 
160
+ #: post-expirator.php:540
161
  msgid "Set Post To:"
162
  msgstr ""
163
 
164
+ #: post-expirator.php:543 post-expirator.php:554
165
  msgid "Draft"
166
  msgstr ""
167
 
168
+ #: post-expirator.php:544 post-expirator.php:555
169
  msgid "Delete"
170
  msgstr ""
171
 
172
+ #: post-expirator.php:547
173
  msgid ""
174
  "Select whether the post should be deleted or changed to a draft at "
175
  "expiration time."
176
  msgstr ""
177
 
178
+ #: post-expirator.php:551
179
  msgid "Set Page To:"
180
  msgstr ""
181
 
182
+ #: post-expirator.php:558
183
  msgid ""
184
  "Select whether the page should be deleted or changed to a draft at "
185
  "expiration time."
186
  msgstr ""
187
 
188
+ #: post-expirator.php:562
189
  msgid "Date Format:"
190
  msgstr ""
191
 
192
+ #: post-expirator.php:566
193
  msgid ""
194
  "The default format to use when displaying the expiration date within a post "
195
  "using the [postexpirator] shortcode or within the footer. For information "
197
  "function.date.php\" target=\"_blank\">PHP Date Function</a>."
198
  msgstr ""
199
 
200
+ #: post-expirator.php:570
201
  msgid "Time Format:"
202
  msgstr ""
203
 
204
+ #: post-expirator.php:574
205
  msgid ""
206
  "The default format to use when displaying the expiration time within a post "
207
  "using the [postexpirator] shortcode or within the footer. For information "
209
  "function.date.php\" target=\"_blank\">PHP Date Function</a>."
210
  msgstr ""
211
 
212
+ #: post-expirator.php:578
213
+ msgid "Cron Schedule:"
214
+ msgstr ""
215
+
216
+ #: post-expirator.php:588
217
+ msgid "By default set to \"postexpiratorminute\" which fires every minute."
218
+ msgstr ""
219
+
220
+ #: post-expirator.php:592
221
+ msgid "Default Date/Time Duration:"
222
+ msgstr ""
223
+
224
+ #: post-expirator.php:595
225
+ msgid "None"
226
+ msgstr ""
227
+
228
+ #: post-expirator.php:596
229
+ msgid "Custom"
230
+ msgstr ""
231
+
232
+ #: post-expirator.php:597
233
+ msgid "Post/Page Publish Time"
234
+ msgstr ""
235
+
236
+ #: post-expirator.php:600
237
+ msgid ""
238
+ "Set the default expiration date to be used when creating new posts and "
239
+ "pages. Defaults to none."
240
+ msgstr ""
241
+
242
+ #: post-expirator.php:605
243
+ msgid ""
244
+ "Set the custom value to use for the default expiration date. For "
245
+ "information on formatting, see <a href=\"http://php.net/manual/en/function."
246
+ "strtotime.php\">PHP strtotime function</a>."
247
+ msgstr ""
248
+
249
+ #: post-expirator.php:610
250
  msgid "Category Expiration"
251
  msgstr ""
252
 
253
+ #: post-expirator.php:613
254
  msgid "Enable Post Expiration to Category?"
255
  msgstr ""
256
 
257
+ #: post-expirator.php:615 post-expirator.php:644
258
  msgid "Enabled"
259
  msgstr ""
260
 
261
+ #: post-expirator.php:616 post-expirator.php:645
262
  msgid "Disabled"
263
  msgstr ""
264
 
265
+ #: post-expirator.php:618
266
  msgid "This will enable or disable the ability to expire a post to a category."
267
  msgstr ""
268
 
269
+ #: post-expirator.php:622
270
  msgid "Default Expiration Category"
271
  msgstr ""
272
 
273
+ #: post-expirator.php:633
274
  msgid "Set's the default expiration category for the post."
275
  msgstr ""
276
 
277
+ #: post-expirator.php:638
278
  msgid "Post Footer Display"
279
  msgstr ""
280
 
281
+ #: post-expirator.php:639
282
  msgid ""
283
  "Enabling this below will display the expiration date automatically at the "
284
  "end of any post which is set to expire."
285
  msgstr ""
286
 
287
+ #: post-expirator.php:642
288
  msgid "Show in post footer?"
289
  msgstr ""
290
 
291
+ #: post-expirator.php:647
292
  msgid ""
293
  "This will enable or disable displaying the post expiration date in the post "
294
  "footer."
295
  msgstr ""
296
 
297
+ #: post-expirator.php:651
298
  msgid "Footer Contents:"
299
  msgstr ""
300
 
301
+ #: post-expirator.php:655
302
  msgid ""
303
  "Enter the text you would like to appear at the bottom of every post that "
304
  "will expire. The following placeholders will be replaced with the post "
305
  "expiration date in the following format:"
306
  msgstr ""
307
 
308
+ #: post-expirator.php:664
309
  msgid "Footer Style:"
310
  msgstr ""
311
 
312
+ #: post-expirator.php:667
313
  msgid "This post will expire on"
314
  msgstr ""
315
 
316
+ #: post-expirator.php:669
317
  msgid "The inline css which will be used to style the footer text."
318
  msgstr ""
319
 
320
+ #: post-expirator.php:674
321
+ msgid "Save Changes"
322
  msgstr ""
323
 
324
+ #: post-expirator.php:724
 
 
 
 
325
  msgid "Debugging Disabled"
326
  msgstr ""
327
 
328
+ #: post-expirator.php:727
329
  msgid "Debugging Enabled"
330
  msgstr ""
331
 
332
+ #: post-expirator.php:732
333
  msgid "Debugging Table Emptied"
334
  msgstr ""
335
 
336
+ #: post-expirator.php:736 post-expirator.php:740
337
  msgid "OK"
338
  msgstr ""
339
 
340
+ #: post-expirator.php:737
341
  msgid "RESET NEEDED"
342
  msgstr ""
343
 
344
+ #: post-expirator.php:741
345
  msgid "ERROR WITH FILTER"
346
  msgstr ""
347
 
348
+ #: post-expirator.php:747
349
  msgid "Cron Settings"
350
  msgstr ""
351
 
352
+ #: post-expirator.php:750
353
  msgid "Reset Cron Event:"
354
  msgstr ""
355
 
356
+ #: post-expirator.php:752
357
  msgid "Reset"
358
  msgstr ""
359
 
360
+ #: post-expirator.php:753 post-expirator.php:761
361
  msgid "Status:"
362
  msgstr ""
363
 
364
+ #: post-expirator.php:755
365
  msgid "Resets the cron event and removes any old or stray entries."
366
  msgstr ""
367
 
368
+ #: post-expirator.php:759
369
  msgid "Reset Cron Schedule:"
370
  msgstr ""
371
 
372
+ #: post-expirator.php:763
373
  msgid "Displays the cron minute schedule status for post expirator."
374
  msgstr ""
375
 
376
+ #: post-expirator.php:768
377
  msgid "Advanced Diagnostics"
378
  msgstr ""
379
 
380
+ #: post-expirator.php:771
381
  msgid "Post Expirator Debug Logging:"
382
  msgstr ""
383
 
384
+ #: post-expirator.php:775
385
  msgid "Status: Enabled"
386
  msgstr ""
387
 
388
+ #: post-expirator.php:776
389
  msgid "Disable Debugging"
390
  msgstr ""
391
 
392
+ #: post-expirator.php:778
393
  msgid "Status: Disabled"
394
  msgstr ""
395
 
396
+ #: post-expirator.php:779
397
  msgid "Enable Debugging"
398
  msgstr ""
399
 
400
+ #: post-expirator.php:787
401
  msgid "Purge Debug Log:"
402
  msgstr ""
403
 
404
+ #: post-expirator.php:789
405
  msgid "Purge Debug Log"
406
  msgstr ""
407
 
408
+ #: post-expirator.php:793
409
  msgid "Current Cron Schedule:"
410
  msgstr ""
411
 
412
+ #: post-expirator.php:795
413
  msgid ""
414
  "The below table will show all currently scheduled cron events with the next "
415
  "run time."
416
  msgstr ""
417
 
418
+ #: post-expirator.php:798
419
  msgid ""
420
+ "There should be an event named expirationdate_delete_blogid (where the "
421
+ "blogid is replaced with the numeric id of the blog) with a schedule of %s."
422
  msgstr ""
423
 
424
+ #: post-expirator.php:800
425
  msgid ""
426
+ "There should be an event named expirationdate_delete with a schedule of %s."
 
 
427
  msgstr ""
428
 
429
+ #: post-expirator.php:805
430
  msgid "Date"
431
  msgstr ""
432
 
433
+ #: post-expirator.php:806
434
  msgid "Event"
435
  msgstr ""
436
 
437
+ #: post-expirator.php:807
438
  msgid "Schedule"
439
  msgstr ""
440
 
441
+ #: post-expirator.php:808
442
  msgid "Interval (seconds)"
443
  msgstr ""
444
 
445
+ #: post-expirator.php:834
446
  msgid ""
447
  "Below is a dump of the debugging table, this should be useful for "
448
  "troubleshooting."
post-expirator.php CHANGED
@@ -4,23 +4,33 @@ Plugin Name: Post Expirator
4
  Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
5
  Description: Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time.
6
  Author: Aaron Axelsen
7
- Version: 1.6
8
  Author URI: http://postexpirator.tuxdocs.net/
9
  Translation: Thierry (http://palijn.info)
10
  Text Domain: post-expirator
11
  */
12
 
13
- define('POSTEXPIRATOR_VERSION','1.6');
14
-
15
  /* Load translation, if it exists */
16
- $plugin_dir = basename(dirname(__FILE__));
17
- load_plugin_textdomain( 'post-expirator', null, $plugin_dir.'/languages/' );
 
 
 
 
18
 
19
  // Default Values
20
- $expirationdateDefaultDateFormat = __('l F jS, Y','post-expirator');
21
- $expirationdateDefaultTimeFormat = __('g:ia','post-expirator');
22
- $expirationdateDefaultFooterContents = __('Post expires at EXPIRATIONTIME on EXPIRATIONDATE','post-expirator');
23
- $expirationdateDefaultFooterStyle = 'font-style: italic;';
 
 
 
 
 
 
 
 
24
 
25
  // Detect WPMU/MultiSite
26
  function postExpirator_is_wpmu() {
@@ -38,22 +48,36 @@ function postExpiratorTimezoneSetup() {
38
 
39
  // Add cron interval of 60 seconds
40
  function postExpiratorAddCronMinutes($array) {
41
- $array['postexpiratorminute'] = array(
42
- 'interval' => 60,
43
- 'display' => __('Once a Minute','post-expirator')
44
- );
45
  return $array;
46
  }
47
  add_filter('cron_schedules','postExpiratorAddCronMinutes');
48
 
 
 
 
 
 
 
 
 
 
 
49
  /**
50
  * Add admin notice hook if cron schedule needs to be reset
51
  */
52
  function postExpirationAdminNotice() {
 
 
 
 
53
  if (postExpiratorCronEventStatus() === false) {
54
  echo '<div class="error fade post-expirator-adminnotice"><p><strong>';
55
  _e('Post Expirator cron events need to be reset. ','post-expirator');
56
- echo('<a href="'.admin_url('options-general.php?page=post-expirator.php&tab=diagnostics').'" style="color: blue;">');
57
  _e('Click here to reset','post-expirator');
58
  echo('</a></strong></p></div>');
59
  }
@@ -92,9 +116,9 @@ function expirationdate_delete_expired_posts() {
92
 
93
  $post_result = $wpdb->get_var('select post_type from ' . $wpdb->posts .' where ID = '. $a->post_id);
94
  if ($post_result == 'post') {
95
- $expiredStatus = strtolower(get_option('expirationdateExpiredPostStatus'));
96
  } else if ($post_result == 'page') {
97
- $expiredStatus = strtolower(get_option('expirationdateExpiredPageStatus'));
98
  } else {
99
  $expiredStatus = 'draft';
100
  }
@@ -173,12 +197,29 @@ function expirationdate_meta_box($post) {
173
  // Get default month
174
  postExpiratorTimezoneSetup();
175
  $expirationdatets = get_post_meta($post->ID,'expiration-date',true);
 
176
  if (empty($expirationdatets)) {
177
- $defaultmonth = date('F');
178
- $defaultday = date('d');
179
- $defaulthour = date('H');
180
- $defaultyear = date('Y');
181
- $defaultminute = date('i');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  $disabled = ' disabled="disabled"';
183
  $categories = get_option('expirationdateCategoryDefaults');
184
  } else {
@@ -187,67 +228,72 @@ function expirationdate_meta_box($post) {
187
  $defaultyear = date('Y',$expirationdatets);
188
  $defaulthour = date('H',$expirationdatets);
189
  $defaultminute = date('i',$expirationdatets);
190
- $categories = get_post_meta($post->ID,'_expiration-date-category',true);
191
  $enabled = ' checked="checked"';
192
  $disabled = '';
 
193
  }
194
 
195
  $rv = array();
196
  $rv[] = '<p><input type="checkbox" name="enable-expirationdate" id="enable-expirationdate" value="checked"'.$enabled.' onclick="expirationdate_ajax_add_meta(\'enable-expirationdate\')" />';
197
  $rv[] = '<label for="enable-expirationdate">'.__('Enable Post Expiration','post-expirator').'</label></p>';
198
- $rv[] = '<table><tr>';
199
- $rv[] = '<th style="text-align: left;">'.__('Year','post-expirator').'</th>';
200
- $rv[] = '<th style="text-align: left;">'.__('Month','post-expirator').'</th>';
201
- $rv[] = '<th style="text-align: left;">'.__('Day','post-expirator').'</th>';
202
- $rv[] = '</tr><tr>';
203
- $rv[] = '<td>';
204
- $rv[] = '<select name="expirationdate_year" id="expirationdate_year"'.$disabled.'>';
205
- $currentyear = date('Y');
206
-
207
- if ($defaultyear < $currentyear) $currentyear = $defaultyear;
208
-
209
- for($i = $currentyear; $i < $currentyear + 8; $i++) {
210
- if ($i == $defaultyear)
211
- $selected = ' selected="selected"';
212
- else
213
- $selected = '';
214
- $rv[] = '<option'.$selected.'>'.($i).'</option>';
215
- }
216
- $rv[] = '</select>';
217
- $rv[] = '</td><td>';
218
- $rv[] = '<select name="expirationdate_month" id="expirationdate_month"'.$disabled.'>';
219
-
220
- for($i = 1; $i <= 12; $i++) {
221
- if ($defaultmonth == date('F',mktime(0, 0, 0, $i, 1, date("Y"))))
222
- $selected = ' selected="selected"';
223
- else
224
- $selected = '';
225
- $rv[] = '<option value="'.date('m',mktime(0, 0, 0, $i, 1, date("Y"))).'"'.$selected.'>'.date_i18n('F',mktime(0, 0, 0, $i, 1, date("Y"))).'</option>';
226
- }
227
 
228
- $rv[] = '</select>';
229
- $rv[] = '</td><td>';
230
- $rv[] = '<input type="text" id="expirationdate_day" name="expirationdate_day" value="'.$defaultday.'" size="2"'.$disabled.' />,';
231
- $rv[] = '</td></tr><tr>';
232
- $rv[] = '<th style="text-align: left;"></th>';
233
- $rv[] = '<th style="text-align: left;">'.__('Hour','post-expirator').'('.date('T',mktime(0, 0, 0, $i, 1, date("Y"))).')</th>';
234
- $rv[] = '<th style="text-align: left;">'.__('Minute','post-expirator').'</th>';
235
- $rv[] = '</tr><tr>';
236
- $rv[] = '<td>@</td><td>';
237
- $rv[] = '<select name="expirationdate_hour" id="expirationdate_hour"'.$disabled.'>';
238
-
239
- for($i = 1; $i <= 24; $i++) {
240
- if ($defaulthour == date('H',mktime($i, 0, 0, date("n"), date("j"), date("Y"))))
241
- $selected = ' selected="selected"';
242
- else
243
- $selected = '';
244
- $rv[] = '<option value="'.date('H',mktime($i, 0, 0, date("n"), date("j"), date("Y"))).'"'.$selected.'>'.date_i18n('H',mktime($i, 0, 0, date("n"), date("j"), date("Y"))).'</option>';
245
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
 
247
- $rv[] = '</select></td><td>';
248
- $rv[] = '<input type="text" id="expirationdate_minute" name="expirationdate_minute" value="'.$defaultminute.'" size="2"'.$disabled.' />';
 
 
249
  $rv[] = '<input type="hidden" name="expirationdate_formcheck" value="true" />';
250
- $rv[] = '</td></tr></table>';
251
  echo implode("\n",$rv);
252
 
253
  $catEnabled = get_option('expirationdateCategory');
@@ -281,22 +327,26 @@ function expirationdate_ajax_add_meta(expireenable) {
281
 
282
  if (expire.checked == true) {
283
  var enable = 'true';
284
- document.getElementById('expirationdate_month').disabled = false;
285
- document.getElementById('expirationdate_day').disabled = false;
286
- document.getElementById('expirationdate_year').disabled = false;
287
- document.getElementById('expirationdate_hour').disabled = false;
288
- document.getElementById('expirationdate_minute').disabled = false;
 
 
289
  var cats = document.getElementsByName('expirationdate_category[]');
290
  var max = cats.length;
291
  for (var i=0; i<max; i++) {
292
  cats[i].disabled = '';
293
  }
294
  } else {
295
- document.getElementById('expirationdate_month').disabled = true;
296
- document.getElementById('expirationdate_day').disabled = true;
297
- document.getElementById('expirationdate_year').disabled = true;
298
- document.getElementById('expirationdate_hour').disabled = true;
299
- document.getElementById('expirationdate_minute').disabled = true;
 
 
300
  var cats = document.getElementsByName('expirationdate_category[]');
301
  var max = cats.length;
302
  for (var i=0; i<max; i++) {
@@ -307,6 +357,14 @@ function expirationdate_ajax_add_meta(expireenable) {
307
 
308
  return true;
309
  }
 
 
 
 
 
 
 
 
310
  //]]>
311
  </script>
312
  <?php
@@ -330,12 +388,21 @@ function expirationdate_update_post_meta($id) {
330
  if (!isset($_POST['expirationdate_formcheck']))
331
  return false;
332
 
333
- $month = $_POST['expirationdate_month'];
334
- $day = $_POST['expirationdate_day'];
335
- $year = $_POST['expirationdate_year'];
336
- $hour = $_POST['expirationdate_hour'];
337
- $minute = $_POST['expirationdate_minute'];
338
- $category = $_POST['expirationdate_category'];
 
 
 
 
 
 
 
 
 
339
  if (isset($_POST['enable-expirationdate'])) {
340
  postExpiratorTimezoneSetup();
341
  // Format Date
@@ -375,7 +442,7 @@ function postExpiratorMenuTabs($tab) {
375
  *
376
  */
377
  function postExpiratorMenu() {
378
- $tab = $_GET['tab'];
379
 
380
  echo '<div class="wrap">';
381
  echo '<h2>'.__('Post Expirator Options','post-expirator').'</h2>';
@@ -404,7 +471,7 @@ add_action('admin_menu', 'postExpiratorPluginMenu');
404
  */
405
  function postExpiratorMenuGeneral() {
406
 
407
- if ($_POST['expirationdateSave']) {
408
  update_option('expirationdateExpiredPostStatus',$_POST['expired-post-status']);
409
  update_option('expirationdateExpiredPageStatus',$_POST['expired-page-status']);
410
  update_option('expirationdateDefaultDateFormat',$_POST['expired-default-date-format']);
@@ -414,42 +481,31 @@ function postExpiratorMenuGeneral() {
414
  update_option('expirationdateFooterStyle',$_POST['expired-footer-style']);
415
  update_option('expirationdateCategory',$_POST['expired-category']);
416
  update_option('expirationdateCategoryDefaults',$_POST['expirationdate_category']);
 
 
 
 
417
  echo "<div id='message' class='updated fade'><p>";
418
  _e('Saved Options!','post-expirator');
419
  echo "</p></div>";
420
  }
421
  postExpiratorTimezoneSetup();
422
- // Get Option
423
- $expirationdateExpiredPostStatus = get_option('expirationdateExpiredPostStatus');
424
- if (empty($expirationdateExpiredPostStatus))
425
- $expirationdateExpiredPostStatus = 'Draft';
426
-
427
- $expirationdateExpiredPageStatus = get_option('expirationdateExpiredPageStatus');
428
- if (empty($expirationdateExpiredPageStatus))
429
- $expirationdateExpiredPageStatus = 'Draft';
430
 
431
- $expirationdateDefaultDateFormat = get_option('expirationdateDefaultDateFormat');
432
- if (empty($expirationdateDefaultDateFormat)) {
433
- global $expirationdateDefaultDateFormat;
434
- $expirationdateDefaultDateFormat = $expirationdateDefaultDateFormat;
435
- }
436
-
437
- $expirationdateDefaultTimeFormat = get_option('expirationdateDefaultTimeFormat');
438
- if (empty($expirationdateDefaultTimeFormat)) {
439
- global $expirationdateDefaultTimeFormat;
440
- $expirationdateDefaultTimeFormat = $expirationdateDefaultTimeFormat;
441
- }
 
442
 
443
  $categories = get_option('expirationdateCategoryDefaults');
444
 
445
- $expiredcategory = get_option('expirationdateCategory');
446
- if (!isset($expiredcategory))
447
- $expiredcategory = 1;
448
-
449
- $expireddisplayfooter = get_option('expirationdateDisplayFooter');
450
- if (empty($expireddisplayfooter))
451
- $expireddisplayfooter = 0;
452
-
453
  $expireddisplayfooterenabled = '';
454
  $expireddisplayfooterdisabled = '';
455
  if ($expireddisplayfooter == 0)
@@ -457,22 +513,13 @@ function postExpiratorMenuGeneral() {
457
  else if ($expireddisplayfooter == 1)
458
  $expireddisplayfooterenabled = 'checked="checked"';
459
 
 
 
460
  if ($expiredcategory == 0)
461
  $expiredcategorydisabled = 'checked="checked"';
462
  else if ($expiredcategory == 1)
463
  $expiredcategoryenabled = 'checked="checked"';
464
 
465
- $expirationdateFooterContents = get_option('expirationdateFooterContents');
466
- if (empty($expirationdateFooterContents)) {
467
- global $expirationdateDefaultFooterContents;
468
- $expirationdateFooterContents = $expirationdateDefaultFooterContents;
469
- }
470
-
471
- $expirationdateFooterStyle = get_option('expirationdateFooterStyle');
472
- if (empty($expirationdateFooterStyle)) {
473
- global $expirationdateDefaultFooterStyle;
474
- $expirationdateFooterStyle = $expirationdateDefaultFooterStyle;
475
- }
476
 
477
  ?>
478
  <p>
@@ -527,6 +574,38 @@ function postExpiratorMenuGeneral() {
527
  <?php _e('The default format to use when displaying the expiration time within a post using the [postexpirator] shortcode or within the footer. For information on valid formatting options, see: <a href="http://us2.php.net/manual/en/function.date.php" target="_blank">PHP Date Function</a>.','post-expirator'); ?>
528
  </td>
529
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  </table>
531
  <h3><?php _e('Category Expiration','post-expirator');?></h3>
532
  <table class="form-table">
@@ -592,7 +671,7 @@ function postExpiratorMenuGeneral() {
592
  </tr>
593
  </table>
594
  <p class="submit">
595
- <input type="submit" name="expirationdateSave" value="<?php _e('Save','post-expirator');?>" />
596
  </p>
597
  </form>
598
  <?php
@@ -603,27 +682,19 @@ function postExpiratorCronEventStatus() {
603
  // WPMU
604
  if (postExpirator_is_wpmu()) {
605
  global $current_blog;
606
- $names[] = 'expirationdate_delete_'.$current_blog->blog_id;
607
  } else {
608
- $names[] = 'expirationdate_delete';
609
- }
610
-
611
- $results = array();
612
- foreach ( $names as $name ) {
613
- if (wp_get_schedule($name) !== false) array_push($results,wp_get_schedule($name));
614
  }
615
 
616
- if (empty($results)) return false;
 
617
 
618
- foreach ( $results as $result ) {
619
- if ($result == 'hourly') return false;
620
- }
621
  return true;
622
  }
623
 
624
  function postExpiratorCronScheduleStatus() {
625
  $schedules = wp_get_schedules();
626
-
627
  if (isset($schedules['postexpiratorminute'])) {
628
  if ($schedules['postexpiratorminute']['interval'] == '60')
629
  return true;
@@ -635,25 +706,20 @@ function postExpiratorCronScheduleStatus() {
635
  * Reset all cron events for Post Expirator Plugin
636
  */
637
  function postExpiratorResetCronEvent() {
638
- postExpiratorTimezoneSetup();
639
-
640
  wp_clear_scheduled_hook('expirationdate_delete');
641
  wp_clear_scheduled_hook('expirationdate_delete_');
642
 
643
  if (postExpirator_is_wpmu()) {
644
  global $current_blog;
645
  wp_clear_scheduled_hook('expirationdate_delete_'.$current_blog->blog_id);
646
- wp_schedule_event(mktime(date('H'),0,0,date('m'),date('d'),date('Y')), 'postexpiratorminute', 'expirationdate_delete_'.$current_blog->blog_id);
647
  } else {
648
- wp_schedule_event(mktime(date('H'),0,0,date('m'),date('d'),date('Y')), 'postexpiratorminute', 'expirationdate_delete');
649
  }
650
  }
651
 
652
  function postExpiratorMenuDiagnostics() {
653
- if (isset($_POST['reset-cron-event'])) {
654
- postExpiratorResetCronEvent();
655
- echo "<div id='message' class='updated fade'><p>"; _e('Cron Events Reset! (Reload page to remove warning)','post-expirator'); echo "</p></div>";
656
- } elseif (isset($_POST['debugging-disable'])) {
657
  update_option('expirationdateDebug',0);
658
  echo "<div id='message' class='updated fade'><p>"; _e('Debugging Disabled','post-expirator'); echo "</p></div>";
659
  } elseif (isset($_POST['debugging-enable'])) {
@@ -683,7 +749,7 @@ function postExpiratorMenuDiagnostics() {
683
  <tr valign-"top">
684
  <th scope="row"><label for="reset-cron-event"><?php _e('Reset Cron Event:','post-expirator');?></label></th>
685
  <td>
686
- <input type="submit" name="reset-cron-event" id="reset-cron-event" value="<?php _e('Reset','post-expirator');?>" />
687
  <?php _e('Status:','post-expirator');?> <?php echo $cronstatus; ?>
688
  <br/>
689
  <?php _e('Resets the cron event and removes any old or stray entries.','post-expirator');?>
@@ -707,10 +773,10 @@ function postExpiratorMenuDiagnostics() {
707
  <?php
708
  if ($debug) {
709
  echo __('Status: Enabled','post-expirator').'<br/>';
710
- echo '<input type="submit" name="debugging-disable" id="debugging-disable" value="'.__('Disable Debugging','post-expirator').'" />';
711
  } else {
712
  echo __('Status: Disabled','post-expirator').'<br/>';
713
- echo '<input type="submit" name="debugging-enable" id="debugging-enable" value="'.__('Enable Debugging','post-expirator').'" />';
714
  }
715
  ?>
716
  <br/>
@@ -720,15 +786,20 @@ function postExpiratorMenuDiagnostics() {
720
  <tr valign-"top">
721
  <th scope="row"><?php _e('Purge Debug Log:','post-expirator');?></th>
722
  <td>
723
- <input type="submit" name="purge-debug" id="purge-debug" value="<?php _e('Purge Debug Log','post-expirator');?>" />
724
  </td>
725
  </tr/>
726
  <tr valign-"top">
727
  <th scope="row"><label for="cron-schedule"><?php _e('Current Cron Schedule:','post-expirator');?></label></th>
728
  <td>
729
  <?php _e('The below table will show all currently scheduled cron events with the next run time.','post-expirator');?><br/>
730
- <?php _e('Single site (non multisite) users should see an event named expirationdate_delete with a schedule of postexpiratorminute.','post-expirator');?><br/>
731
- <?php if (postExpirator_is_wpmu()) _e('Multisite users should see an event named expirationdate_delete_blogid (where the blogid is replaced with the numeric id of the blog) with a schedule of postexpiratorminute','post-expirator');?>
 
 
 
 
 
732
  <table>
733
  <tr>
734
  <th><?php _e('Date','post-expirator');?></th>
@@ -774,8 +845,8 @@ function postexpirator_shortcode($atts) {
774
  return false;
775
 
776
  extract(shortcode_atts(array(
777
- 'dateformat' => get_option('expirationdateDefaultDateFormat'),
778
- 'timeformat' => get_option('expirationdateDefaultTimeFormat'),
779
  'type' => full,
780
  'tz' => date('T')
781
  ), $atts));
@@ -814,29 +885,10 @@ function postexpirator_add_footer($text) {
814
  if (!is_numeric($expirationdatets))
815
  return $text;
816
 
817
- $dateformat = get_option('expirationdateDefaultDateFormat');
818
- if (empty($dateformat)) {
819
- global $expirationdateDefaultDateFormat;
820
- $dateformat = $expirationdateDefaultDateFormat;
821
- }
822
-
823
- $timeformat = get_option('expirationdateDefaultTimeFormat');
824
- if (empty($timeformat)) {
825
- global $expirationdateDefaultTimeFormat;
826
- $timeformat = $expirationdateDefaultTimeFormat;
827
- }
828
-
829
- $expirationdateFooterContents = get_option('expirationdateFooterContents');
830
- if (empty($expirationdateFooterContents)) {
831
- global $expirationdateDefaultFooterContents;
832
- $expirationdateFooterContents = $expirationdateDefaultFooterContents;
833
- }
834
-
835
- $expirationdateFooterStyle = get_option('expirationdateFooterStyle');
836
- if (empty($expirationdateFooterStyle)) {
837
- global $expirationdateDefaultFooterStyle;
838
- $expirationdateFooterStyle = $expirationdateDefaultFooterStyle;
839
- }
840
 
841
  postExpiratorTimezoneSetup();
842
  $search = array(
@@ -887,6 +939,14 @@ function postexpirator_upgrade() {
887
  if ($version === false) { //not installed, run default activation
888
  postexpirator_activate();
889
  update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
 
 
 
 
 
 
 
 
890
  }
891
  }
892
  add_action('admin_init','postexpirator_upgrade');
@@ -895,22 +955,22 @@ add_action('admin_init','postexpirator_upgrade');
895
  * Called at plugin activation
896
  */
897
  function postexpirator_activate () {
898
- global $current_blog,$expirationdateDefaultDateFormat,$expirationdateDefaultTimeFormat,$expirationdateDefaultFooterContents,$expirationdateDefaultFooterStyle;
899
- if (get_option('expirationdateExpiredPostStatus') === false) update_option('expirationdateExpiredPostStatus','Draft');
900
- if (get_option('expirationdateExpiredPageStatus') === false) update_option('expirationdateExpiredPageStatus','Draft');
901
- if (get_option('expirationdateDefaultDateFormat') === false) update_option('expirationdateDefaultDateFormat',$expirationdateDefaultDateFormat);
902
- if (get_option('expirationdateDefaultTimeFormat') === false) update_option('expirationdateDefaultTimeFormat',$expirationdateDefaultTimeFormat);
903
- if (get_option('expirationdateFooterContents') === false) update_option('expirationdateFooterContents',$expirationdateDefaultFooterContents);
904
- if (get_option('expirationdateFooterStyle') === false) update_option('expirationdateFooterStyle',$expirationdateDefaultFooterStyle);
905
- if (get_option('expirationdateDisplayFooter') === false) update_option('expirationdateDisplayFooter',0);
906
- if (get_option('expirationdateCategory') === false) update_option('expirationdateCategory',1);
907
- if (get_option('expirationdateDebug') === false) update_option('expirationdateDebug',0);
908
- postExpiratorTimezoneSetup();
909
 
910
- if (postExpirator_is_wpmu())
911
- wp_schedule_event(mktime(date('H'),0,0,date('m'),date('d'),date('Y')), 'postexpiratorminute', 'expirationdate_delete_'.$current_blog->blog_id);
912
- else
913
- wp_schedule_event(mktime(date('H'),0,0,date('m'),date('d'),date('Y')), 'postexpiratorminute', 'expirationdate_delete');
 
914
  }
915
 
916
  /**
@@ -926,8 +986,12 @@ function expirationdate_deactivate () {
926
  delete_option('expirationdateFooterContents');
927
  delete_option('expirationdateFooterStyle');
928
  delete_option('expirationdateCategory');
 
929
  delete_option('expirationdateDebug');
930
  delete_option('postexpiratorVersion');
 
 
 
931
  if (postExpirator_is_wpmu())
932
  wp_clear_scheduled_hook('expirationdate_delete_'.$current_blog->blog_id);
933
  else
4
  Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
5
  Description: Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time.
6
  Author: Aaron Axelsen
7
+ Version: 1.6.1
8
  Author URI: http://postexpirator.tuxdocs.net/
9
  Translation: Thierry (http://palijn.info)
10
  Text Domain: post-expirator
11
  */
12
 
 
 
13
  /* Load translation, if it exists */
14
+ function postExpirator_init() {
15
+ $plugin_dir = basename(dirname(__FILE__));
16
+ load_plugin_textdomain( 'post-expirator', null, $plugin_dir.'/languages/' );
17
+ }
18
+ add_action('plugins_loaded', 'postExpirator_init');
19
+
20
 
21
  // Default Values
22
+ define('POSTEXPIRATOR_VERSION','1.6.1');
23
+ define('POSTEXPIRATOR_DATEFORMAT',__('l F jS, Y','post-expirator'));
24
+ define('POSTEXPIRATOR_TIMEFORMAT',__('g:ia','post-expirator'));
25
+ define('POSTEXPIRATOR_FOOTERCONTENTS',__('Post expires at EXPIRATIONTIME on EXPIRATIONDATE','post-expirator'));
26
+ define('POSTEXPIRATOR_FOOTERSTYLE','font-style: italic;');
27
+ define('POSTEXPIRATOR_POSTSTATUS','Draft');
28
+ define('POSTEXPIRATOR_PAGESTATUS','Draft');
29
+ define('POSTEXPIRATOR_FOOTERDISPLAY','0');
30
+ define('POSTEXPIRATOR_CATEGORY','1');
31
+ define('POSTEXPIRATOR_DEBUG','0');
32
+ define('POSTEXPIRATOR_CRONSCHEDULE','postexpiratorminute');
33
+ define('POSTEXPIRATOR_EXPIREDEFAULT','null');
34
 
35
  // Detect WPMU/MultiSite
36
  function postExpirator_is_wpmu() {
48
 
49
  // Add cron interval of 60 seconds
50
  function postExpiratorAddCronMinutes($array) {
51
+ $array['postexpiratorminute'] = array(
52
+ 'interval' => 60,
53
+ 'display' => __('Once a Minute','post-expirator')
54
+ );
55
  return $array;
56
  }
57
  add_filter('cron_schedules','postExpiratorAddCronMinutes');
58
 
59
+ function postExpirator_plugin_action_links($links, $file) {
60
+ $this_plugin = basename(plugin_dir_url(__FILE__)) . '/post-expirator.php';
61
+ if($file == $this_plugin) {
62
+ $links[] = '<a href="options-general.php?page=post-expirator">' . __('Settings', 'post-expirator') . '</a>';
63
+ }
64
+ return $links;
65
+ }
66
+ add_filter('plugin_action_links', 'postExpirator_plugin_action_links', 10, 2);
67
+
68
+
69
  /**
70
  * Add admin notice hook if cron schedule needs to be reset
71
  */
72
  function postExpirationAdminNotice() {
73
+ if (isset($_POST['reset-cron-event']) || (isset($_GET['reset']) && $_GET['reset'] == 'cron')) {
74
+ postExpiratorResetCronEvent();
75
+ echo "<div id='message' class='updated fade'><p>"; _e('Cron Events Reset!','post-expirator'); echo "</p></div>";
76
+ }
77
  if (postExpiratorCronEventStatus() === false) {
78
  echo '<div class="error fade post-expirator-adminnotice"><p><strong>';
79
  _e('Post Expirator cron events need to be reset. ','post-expirator');
80
+ echo('<a href="'.admin_url('options-general.php?page=post-expirator.php&tab=diagnostics&reset=cron').'" style="color: blue;">');
81
  _e('Click here to reset','post-expirator');
82
  echo('</a></strong></p></div>');
83
  }
116
 
117
  $post_result = $wpdb->get_var('select post_type from ' . $wpdb->posts .' where ID = '. $a->post_id);
118
  if ($post_result == 'post') {
119
+ $expiredStatus = strtolower(get_option('expirationdateExpiredPostStatus',POSTEXPIRATOR_POSTSTATUS));
120
  } else if ($post_result == 'page') {
121
+ $expiredStatus = strtolower(get_option('expirationdateExpiredPageStatus',POSTEXPIRATOR_PAGESTATUS));
122
  } else {
123
  $expiredStatus = 'draft';
124
  }
197
  // Get default month
198
  postExpiratorTimezoneSetup();
199
  $expirationdatets = get_post_meta($post->ID,'expiration-date',true);
200
+ $default = '';
201
  if (empty($expirationdatets)) {
202
+ $default = get_option('expirationdateDefaultDate',POSTEXPIRATOR_EXPIREDEFAULT);
203
+ if ($default == 'null') {
204
+ $defaultmonth = date('F');
205
+ $defaultday = date('d');
206
+ $defaulthour = date('H');
207
+ $defaultyear = date('Y');
208
+ $defaultminute = date('i');
209
+
210
+ } elseif ($default == 'custom') {
211
+ $custom = get_option('expirationdateDefaultDateCustom');
212
+ if ($custom === false) $ts = time();
213
+ else $ts = strtotime($custom);
214
+ $defaultmonth = date('F',$ts);
215
+ $defaultday = date('d',$ts);
216
+ $defaulthour = date('H',$ts);
217
+ $defaultyear = date('Y',$ts);
218
+ $defaultminute = date('i',$ts);
219
+
220
+ }
221
+
222
+ $enabled = '';
223
  $disabled = ' disabled="disabled"';
224
  $categories = get_option('expirationdateCategoryDefaults');
225
  } else {
228
  $defaultyear = date('Y',$expirationdatets);
229
  $defaulthour = date('H',$expirationdatets);
230
  $defaultminute = date('i',$expirationdatets);
 
231
  $enabled = ' checked="checked"';
232
  $disabled = '';
233
+ $categories = get_post_meta($post->ID,'_expiration-date-category',true);
234
  }
235
 
236
  $rv = array();
237
  $rv[] = '<p><input type="checkbox" name="enable-expirationdate" id="enable-expirationdate" value="checked"'.$enabled.' onclick="expirationdate_ajax_add_meta(\'enable-expirationdate\')" />';
238
  $rv[] = '<label for="enable-expirationdate">'.__('Enable Post Expiration','post-expirator').'</label></p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
 
240
+ if ($default == 'publish') {
241
+ $rv[] = '<em>'.__('The published date/time will be used as the expiration value','post-expirator').'</em><br/>';
242
+ } else {
243
+ $rv[] = '<table><tr>';
244
+ $rv[] = '<th style="text-align: left;">'.__('Year','post-expirator').'</th>';
245
+ $rv[] = '<th style="text-align: left;">'.__('Month','post-expirator').'</th>';
246
+ $rv[] = '<th style="text-align: left;">'.__('Day','post-expirator').'</th>';
247
+ $rv[] = '</tr><tr>';
248
+ $rv[] = '<td>';
249
+ $rv[] = '<select name="expirationdate_year" id="expirationdate_year"'.$disabled.'>';
250
+ $currentyear = date('Y');
251
+
252
+ if ($defaultyear < $currentyear) $currentyear = $defaultyear;
253
+
254
+ for($i = $currentyear; $i < $currentyear + 8; $i++) {
255
+ if ($i == $defaultyear)
256
+ $selected = ' selected="selected"';
257
+ else
258
+ $selected = '';
259
+ $rv[] = '<option'.$selected.'>'.($i).'</option>';
260
+ }
261
+ $rv[] = '</select>';
262
+ $rv[] = '</td><td>';
263
+ $rv[] = '<select name="expirationdate_month" id="expirationdate_month"'.$disabled.'>';
264
+
265
+ for($i = 1; $i <= 12; $i++) {
266
+ if ($defaultmonth == date('F',mktime(0, 0, 0, $i, 1, date("Y"))))
267
+ $selected = ' selected="selected"';
268
+ else
269
+ $selected = '';
270
+ $rv[] = '<option value="'.date('m',mktime(0, 0, 0, $i, 1, date("Y"))).'"'.$selected.'>'.date_i18n('F',mktime(0, 0, 0, $i, 1, date("Y"))).'</option>';
271
+ }
272
+
273
+ $rv[] = '</select>';
274
+ $rv[] = '</td><td>';
275
+ $rv[] = '<input type="text" id="expirationdate_day" name="expirationdate_day" value="'.$defaultday.'" size="2"'.$disabled.' />,';
276
+ $rv[] = '</td></tr><tr>';
277
+ $rv[] = '<th style="text-align: left;"></th>';
278
+ $rv[] = '<th style="text-align: left;">'.__('Hour','post-expirator').'('.date('T',mktime(0, 0, 0, $i, 1, date("Y"))).')</th>';
279
+ $rv[] = '<th style="text-align: left;">'.__('Minute','post-expirator').'</th>';
280
+ $rv[] = '</tr><tr>';
281
+ $rv[] = '<td>@</td><td>';
282
+ $rv[] = '<select name="expirationdate_hour" id="expirationdate_hour"'.$disabled.'>';
283
+
284
+ for($i = 1; $i <= 24; $i++) {
285
+ if ($defaulthour == date('H',mktime($i, 0, 0, date("n"), date("j"), date("Y"))))
286
+ $selected = ' selected="selected"';
287
+ else
288
+ $selected = '';
289
+ $rv[] = '<option value="'.date('H',mktime($i, 0, 0, date("n"), date("j"), date("Y"))).'"'.$selected.'>'.date_i18n('H',mktime($i, 0, 0, date("n"), date("j"), date("Y"))).'</option>';
290
+ }
291
 
292
+ $rv[] = '</select></td><td>';
293
+ $rv[] = '<input type="text" id="expirationdate_minute" name="expirationdate_minute" value="'.$defaultminute.'" size="2"'.$disabled.' />';
294
+ $rv[] = '</td></tr></table>';
295
+ }
296
  $rv[] = '<input type="hidden" name="expirationdate_formcheck" value="true" />';
 
297
  echo implode("\n",$rv);
298
 
299
  $catEnabled = get_option('expirationdateCategory');
327
 
328
  if (expire.checked == true) {
329
  var enable = 'true';
330
+ if (document.getElementById('expirationdate_month')) {
331
+ document.getElementById('expirationdate_month').disabled = false;
332
+ document.getElementById('expirationdate_day').disabled = false;
333
+ document.getElementById('expirationdate_year').disabled = false;
334
+ document.getElementById('expirationdate_hour').disabled = false;
335
+ document.getElementById('expirationdate_minute').disabled = false;
336
+ }
337
  var cats = document.getElementsByName('expirationdate_category[]');
338
  var max = cats.length;
339
  for (var i=0; i<max; i++) {
340
  cats[i].disabled = '';
341
  }
342
  } else {
343
+ if (document.getElementById('expirationdate_month')) {
344
+ document.getElementById('expirationdate_month').disabled = true;
345
+ document.getElementById('expirationdate_day').disabled = true;
346
+ document.getElementById('expirationdate_year').disabled = true;
347
+ document.getElementById('expirationdate_hour').disabled = true;
348
+ document.getElementById('expirationdate_minute').disabled = true;
349
+ }
350
  var cats = document.getElementsByName('expirationdate_category[]');
351
  var max = cats.length;
352
  for (var i=0; i<max; i++) {
357
 
358
  return true;
359
  }
360
+ function expirationdate_toggle_defaultdate(id) {
361
+ if (id.options[id.selectedIndex].value == 'custom') {
362
+ jQuery('#expired-custom-container').show();
363
+ } else {
364
+ jQuery('#expired-custom-container').hide();
365
+ }
366
+
367
+ }
368
  //]]>
369
  </script>
370
  <?php
388
  if (!isset($_POST['expirationdate_formcheck']))
389
  return false;
390
 
391
+ $default = get_option('expirationdateDefaultDate',POSTEXPIRATOR_EXPIREDEFAULT);
392
+ if ($default == 'publish') {
393
+ $month = $_POST['mm'];
394
+ $day = $_POST['jj'];
395
+ $year = $_POST['aa'];
396
+ $hour = $_POST['hh'];
397
+ $minute = $_POST['mn'];
398
+ } else {
399
+ $month = $_POST['expirationdate_month'];
400
+ $day = $_POST['expirationdate_day'];
401
+ $year = $_POST['expirationdate_year'];
402
+ $hour = $_POST['expirationdate_hour'];
403
+ $minute = $_POST['expirationdate_minute'];
404
+ }
405
+ $category = isset($_POST['expirationdate_category']) ? $_POST['expirationdate_category'] : 0;
406
  if (isset($_POST['enable-expirationdate'])) {
407
  postExpiratorTimezoneSetup();
408
  // Format Date
442
  *
443
  */
444
  function postExpiratorMenu() {
445
+ $tab = isset($_GET['tab']) ? $_GET['tab'] : '';
446
 
447
  echo '<div class="wrap">';
448
  echo '<h2>'.__('Post Expirator Options','post-expirator').'</h2>';
471
  */
472
  function postExpiratorMenuGeneral() {
473
 
474
+ if (isset($_POST['expirationdateSave']) && $_POST['expirationdateSave']) {
475
  update_option('expirationdateExpiredPostStatus',$_POST['expired-post-status']);
476
  update_option('expirationdateExpiredPageStatus',$_POST['expired-page-status']);
477
  update_option('expirationdateDefaultDateFormat',$_POST['expired-default-date-format']);
481
  update_option('expirationdateFooterStyle',$_POST['expired-footer-style']);
482
  update_option('expirationdateCategory',$_POST['expired-category']);
483
  update_option('expirationdateCategoryDefaults',$_POST['expirationdate_category']);
484
+ update_option('expirationdateCronSchedule',$_POST['expired-default-cron-schedule']);
485
+ update_option('expirationdateDefaultDate',$_POST['expired-default-expiration-date']);
486
+ if ($_POST['expired-custom-expiration-date']) update_option('expirationdateDefaultDateCustom',$_POST['expired-custom-expiration-date']);
487
+ postExpiratorResetCronEvent();
488
  echo "<div id='message' class='updated fade'><p>";
489
  _e('Saved Options!','post-expirator');
490
  echo "</p></div>";
491
  }
492
  postExpiratorTimezoneSetup();
 
 
 
 
 
 
 
 
493
 
494
+ // Get Option
495
+ $expirationdateExpiredPostStatus = get_option('expirationdateExpiredPostStatus',POSTEXPIRATOR_POSTSTATUS);
496
+ $expirationdateExpiredPageStatus = get_option('expirationdateExpiredPageStatus',POSTEXPIRATOR_PAGESTATUS);
497
+ $expirationdateDefaultDateFormat = get_option('expirationdateDefaultDateFormat',POSTEXPIRATOR_DATEFORMAT);
498
+ $expirationdateDefaultTimeFormat = get_option('expirationdateDefaultTimeFormat',POSTEXPIRATOR_TIMEFORMAT);
499
+ $expiredcategory = get_option('expirationdateCategory',POSTEXPIRATOR_CATEGORY);
500
+ $expireddisplayfooter = get_option('expirationdateDisplayFooter',POSTEXPIRATOR_FOOTERDISPLAY);
501
+ $expirationdateFooterContents = get_option('expirationdateFooterContents',POSTEXPIRATOR_FOOTERCONTENTS);
502
+ $expirationdateFooterStyle = get_option('expirationdateFooterStyle',POSTEXPIRATOR_FOOTERSTYLE);
503
+ $expirationdateCronSchedule = get_option('expirationdateCronSchedule',POSTEXPIRATOR_CRONSCHEDULE);
504
+ $expirationdateDefaultDate = get_option('expirationdateDefaultDate',POSTEXPIRATOR_EXPIREDEFAULT);
505
+ $expirationdateDefaultDateCustom = get_option('expirationdateDefaultDateCustom');
506
 
507
  $categories = get_option('expirationdateCategoryDefaults');
508
 
 
 
 
 
 
 
 
 
509
  $expireddisplayfooterenabled = '';
510
  $expireddisplayfooterdisabled = '';
511
  if ($expireddisplayfooter == 0)
513
  else if ($expireddisplayfooter == 1)
514
  $expireddisplayfooterenabled = 'checked="checked"';
515
 
516
+ $expiredcategorydisabled = '';
517
+ $expiredcategoryenabled = '';
518
  if ($expiredcategory == 0)
519
  $expiredcategorydisabled = 'checked="checked"';
520
  else if ($expiredcategory == 1)
521
  $expiredcategoryenabled = 'checked="checked"';
522
 
 
 
 
 
 
 
 
 
 
 
 
523
 
524
  ?>
525
  <p>
574
  <?php _e('The default format to use when displaying the expiration time within a post using the [postexpirator] shortcode or within the footer. For information on valid formatting options, see: <a href="http://us2.php.net/manual/en/function.date.php" target="_blank">PHP Date Function</a>.','post-expirator'); ?>
575
  </td>
576
  </tr>
577
+ <tr valign-"top">
578
+ <th scope="row"><label for="expired-default-cron-schedule"><?php _e('Cron Schedule:','post-expirator');?></label></th>
579
+ <td>
580
+ <select name="expired-default-cron-schedule" id="expired-default-cron-schedule">
581
+ <?php $schedules = wp_get_schedules();
582
+ foreach ($schedules as $key=>$value) {
583
+ $selected = ($key == $expirationdateCronSchedule) ? ' selected="selected"' : '';
584
+ echo '<option value="'.$key.'"'.$selected.'>'.$value['display'].' ('.$key.') </option>';
585
+ } ?>
586
+ </select>
587
+ <br/>
588
+ <?php _e('By default set to "postexpiratorminute" which fires every minute.','post-expirator'); ?>
589
+ </td>
590
+ </tr>
591
+ <tr valign-"top">
592
+ <th scope="row"><label for="expired-default-expiration-date"><?php _e('Default Date/Time Duration:','post-expirator');?></label></th>
593
+ <td>
594
+ <select name="expired-default-expiration-date" id="expired-default-expiration-date" onchange="expirationdate_toggle_defaultdate(this)">
595
+ <option value="null" <?php echo ($expirationdateDefaultDate == 'null') ? ' selected="selected"' : ''; ?>><?php _e('None','post-expirator');?></option>
596
+ <option value="custom" <?php echo ($expirationdateDefaultDate == 'custom') ? ' selected="selected"' : ''; ?>><?php _e('Custom','post-expirator');?></option>
597
+ <option value="publish" <?php echo ($expirationdateDefaultDate == 'publish') ? ' selected="selected"' : ''; ?>><?php _e('Post/Page Publish Time','post-expirator');?></option>
598
+ </select>
599
+ <br/>
600
+ <?php _e('Set the default expiration date to be used when creating new posts and pages. Defaults to none.','post-expirator'); ?>
601
+ <?php $show = ($expirationdateDefaultDate == 'custom') ? 'block' : 'none'; ?>
602
+ <div id="expired-custom-container" style="display: <?php echo $show; ?>;">
603
+ <br/><label for="expired-custom-expiration-date">Custom:</label> <input type="text" value="<?php echo $expirationdateDefaultDateCustom; ?>" name="expired-custom-expiration-date" id="expired-custom-expiration-date" />
604
+ <br/>
605
+ <?php _e('Set the custom value to use for the default expiration date. For information on formatting, see <a href="http://php.net/manual/en/function.strtotime.php">PHP strtotime function</a>.','post-expirator'); ?>
606
+ </div>
607
+ </td>
608
+ </tr>
609
  </table>
610
  <h3><?php _e('Category Expiration','post-expirator');?></h3>
611
  <table class="form-table">
671
  </tr>
672
  </table>
673
  <p class="submit">
674
+ <input type="submit" name="expirationdateSave" class="button-primary" value="<?php _e('Save Changes','post-expirator');?>" />
675
  </p>
676
  </form>
677
  <?php
682
  // WPMU
683
  if (postExpirator_is_wpmu()) {
684
  global $current_blog;
685
+ $name = 'expirationdate_delete_'.$current_blog->blog_id;
686
  } else {
687
+ $name = 'expirationdate_delete';
 
 
 
 
 
688
  }
689
 
690
+ $expirationdateCronSchedule = get_option('expirationdateCronSchedule',POSTEXPIRATOR_CRONSCHEDULE);
691
+ if (wp_get_schedule($name) != $expirationdateCronSchedule) return false;
692
 
 
 
 
693
  return true;
694
  }
695
 
696
  function postExpiratorCronScheduleStatus() {
697
  $schedules = wp_get_schedules();
 
698
  if (isset($schedules['postexpiratorminute'])) {
699
  if ($schedules['postexpiratorminute']['interval'] == '60')
700
  return true;
706
  * Reset all cron events for Post Expirator Plugin
707
  */
708
  function postExpiratorResetCronEvent() {
 
 
709
  wp_clear_scheduled_hook('expirationdate_delete');
710
  wp_clear_scheduled_hook('expirationdate_delete_');
711
 
712
  if (postExpirator_is_wpmu()) {
713
  global $current_blog;
714
  wp_clear_scheduled_hook('expirationdate_delete_'.$current_blog->blog_id);
715
+ wp_schedule_event(current_time('timestamp'), get_option('expirationdateCronSchedule',POSTEXPIRATOR_CRONSCHEDULE), 'expirationdate_delete_'.$current_blog->blog_id);
716
  } else {
717
+ wp_schedule_event(current_time('timestamp'), get_option('expirationdateCronSchedule',POSTEXPIRATOR_CRONSCHEDULE), 'expirationdate_delete');
718
  }
719
  }
720
 
721
  function postExpiratorMenuDiagnostics() {
722
+ if (isset($_POST['debugging-disable'])) {
 
 
 
723
  update_option('expirationdateDebug',0);
724
  echo "<div id='message' class='updated fade'><p>"; _e('Debugging Disabled','post-expirator'); echo "</p></div>";
725
  } elseif (isset($_POST['debugging-enable'])) {
749
  <tr valign-"top">
750
  <th scope="row"><label for="reset-cron-event"><?php _e('Reset Cron Event:','post-expirator');?></label></th>
751
  <td>
752
+ <input type="submit" class="button" name="reset-cron-event" id="reset-cron-event" value="<?php _e('Reset','post-expirator');?>" />
753
  <?php _e('Status:','post-expirator');?> <?php echo $cronstatus; ?>
754
  <br/>
755
  <?php _e('Resets the cron event and removes any old or stray entries.','post-expirator');?>
773
  <?php
774
  if ($debug) {
775
  echo __('Status: Enabled','post-expirator').'<br/>';
776
+ echo '<input type="submit" class="button" name="debugging-disable" id="debugging-disable" value="'.__('Disable Debugging','post-expirator').'" />';
777
  } else {
778
  echo __('Status: Disabled','post-expirator').'<br/>';
779
+ echo '<input type="submit" class="button" name="debugging-enable" id="debugging-enable" value="'.__('Enable Debugging','post-expirator').'" />';
780
  }
781
  ?>
782
  <br/>
786
  <tr valign-"top">
787
  <th scope="row"><?php _e('Purge Debug Log:','post-expirator');?></th>
788
  <td>
789
+ <input type="submit" class="button" name="purge-debug" id="purge-debug" value="<?php _e('Purge Debug Log','post-expirator');?>" />
790
  </td>
791
  </tr/>
792
  <tr valign-"top">
793
  <th scope="row"><label for="cron-schedule"><?php _e('Current Cron Schedule:','post-expirator');?></label></th>
794
  <td>
795
  <?php _e('The below table will show all currently scheduled cron events with the next run time.','post-expirator');?><br/>
796
+ <?php
797
+ if (postExpirator_is_wpmu())
798
+ printf(__('There should be an event named expirationdate_delete_blogid (where the blogid is replaced with the numeric id of the blog) with a schedule of %s.','post-expirator'),'<em>'.get_option('expirationdateCronSchedule',POSTEXPIRATOR_CRONSCHEDULE).'</em>');
799
+ else
800
+ printf(__('There should be an event named expirationdate_delete with a schedule of %s.','post-expirator'),'<em>'.get_option('expirationdateCronSchedule',POSTEXPIRATOR_CRONSCHEDULE.'</em>'));
801
+ ?><br/>
802
+
803
  <table>
804
  <tr>
805
  <th><?php _e('Date','post-expirator');?></th>
845
  return false;
846
 
847
  extract(shortcode_atts(array(
848
+ 'dateformat' => get_option('expirationdateDefaultDateFormat',POSTEXPIRATOR_DATEFORMAT),
849
+ 'timeformat' => get_option('expirationdateDefaultTimeFormat',POSTEXPIRATOR_TIMEFORMAT),
850
  'type' => full,
851
  'tz' => date('T')
852
  ), $atts));
885
  if (!is_numeric($expirationdatets))
886
  return $text;
887
 
888
+ $dateformat = get_option('expirationdateDefaultDateFormat',POSTEXPIRATOR_DATEFORMAT);
889
+ $timeformat = get_option('expirationdateDefaultTimeFormat',POSTEXPIRATOR_TIMEFORMAT);
890
+ $expirationdateFooterContents = get_option('expirationdateFooterContents',POSTEXPIRATOR_FOOTERCONTENTS);
891
+ $expirationdateFooterStyle = get_option('expirationdateFooterStyle',POSTEXPIRATOR_FOOTERSTYLE);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
892
 
893
  postExpiratorTimezoneSetup();
894
  $search = array(
939
  if ($version === false) { //not installed, run default activation
940
  postexpirator_activate();
941
  update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
942
+ } elseif ($version !== POSTEXPIRATOR_VERSION) {
943
+ switch (POSTEXPIRATOR_VERSION) {
944
+ case '1.6.1':
945
+ update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
946
+ update_option('expirationdateDefaultDate',POSTEXPIRATOR_EXPIREDEFAULT);
947
+ break;
948
+
949
+ }
950
  }
951
  }
952
  add_action('admin_init','postexpirator_upgrade');
955
  * Called at plugin activation
956
  */
957
  function postexpirator_activate () {
958
+ if (get_option('expirationdateExpiredPostStatus') === false) update_option('expirationdateExpiredPostStatus',POSTEXPIRATOR_POSTSTATUS);
959
+ if (get_option('expirationdateExpiredPageStatus') === false) update_option('expirationdateExpiredPageStatus',POSTEXPIRATOR_PAGESTATUS);
960
+ if (get_option('expirationdateDefaultDateFormat') === false) update_option('expirationdateDefaultDateFormat',POSTEXPIRATOR_DATEFORMAT);
961
+ if (get_option('expirationdateDefaultTimeFormat') === false) update_option('expirationdateDefaultTimeFormat',POSTEXPIRATOR_TIMEFORMAT);
962
+ if (get_option('expirationdateFooterContents') === false) update_option('expirationdateFooterContents',POSTEXPIRATOR_FOOTERCONTENTS);
963
+ if (get_option('expirationdateFooterStyle') === false) update_option('expirationdateFooterStyle',POSTEXPIRATOR_FOOTERSTYLE);
964
+ if (get_option('expirationdateDisplayFooter') === false) update_option('expirationdateDisplayFooter',POSTEXPIRATOR_FOOTERDISPLAY);
965
+ if (get_option('expirationdateCategory') === false) update_option('expirationdateCategory',POSTEXPIRATOR_CATEGORY);
966
+ if (get_option('expirationdateDebug') === false) update_option('expirationdateDebug',POSTEXPIRATOR_DEBUG);
967
+ if (get_option('expirationdateDefaultDate') === false) update_option('expirationdateDefaultDate',POSTEXPIRATOR_EXPIREDEFAULT);
 
968
 
969
+ if (postExpirator_is_wpmu()) {
970
+ global $current_blog;
971
+ wp_schedule_event(current_time('timestamp'), get_option('expirationdateCronSchedule',POSTEXPIRATOR_CRONSCHEDULE), 'expirationdate_delete_'.$current_blog->blog_id);
972
+ } else
973
+ wp_schedule_event(current_time('timestamp'), get_option('expirationdateCronSchedule',POSTEXPIRATOR_CRONSCHEDULE), 'expirationdate_delete');
974
  }
975
 
976
  /**
986
  delete_option('expirationdateFooterContents');
987
  delete_option('expirationdateFooterStyle');
988
  delete_option('expirationdateCategory');
989
+ delete_option('expirationdateCategoryDefaults');
990
  delete_option('expirationdateDebug');
991
  delete_option('postexpiratorVersion');
992
+ delete_option('expirationdateCronSchedule');
993
+ delete_option('expirationdateDefaultDate');
994
+ delete_option('expirationdateDefaultDateCustom');
995
  if (postExpirator_is_wpmu())
996
  wp_clear_scheduled_hook('expirationdate_delete_'.$current_blog->blog_id);
997
  else
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: axelseaa
3
  Tags: expire, posts, pages, schedule
4
  Requires at least: 3.2
5
  Tested up to: 3.4
6
- Stable tag: 1.6
7
 
8
  Allows you to add an expiration date to posts which you can configure to either delete the post, change it to a draft, or update the
9
  post categories.
@@ -15,13 +15,15 @@ area that will allow you to seperataly control whether or not posts/pages are ei
15
  also choose to have the post categories change at expiration time. If you choose to change the post category, the default action of changing
16
  the status will be ignored.
17
 
18
- The plugin hooks into the wp cron processes and runs every minute.
19
 
20
  The expiration date can be displayed within the actual post by using the [postexpirator] tag. The format attribute will override the plugin
21
  default display format. See the [PHP Date Function](http://us2.php.net/manual/en/function.date.php) for valid date/time format options.
22
 
23
  Plugin homepage [WordPress Post Expirator](http://postexpirator.tuxdocs.net).
24
 
 
 
25
  **[postexpirator] shortcode attributes**
26
 
27
  * type - defaults to full - valid options are full,date,time
@@ -45,6 +47,15 @@ This section describes how to install the plugin and get it working.
45
 
46
  == Changelog ==
47
 
 
 
 
 
 
 
 
 
 
48
  **Version 1.6**
49
 
50
  * Fixed invalid html
@@ -133,6 +144,9 @@ NOTE: After upgrading, you may need to reset the cron schedules. Following onsc
133
 
134
  == Upgrade Notice ==
135
 
 
 
 
136
  = 1.6 =
137
  Fixed invalid html
138
  Fixed i18n issues with dates
3
  Tags: expire, posts, pages, schedule
4
  Requires at least: 3.2
5
  Tested up to: 3.4
6
+ Stable tag: 1.6.1
7
 
8
  Allows you to add an expiration date to posts which you can configure to either delete the post, change it to a draft, or update the
9
  post categories.
15
  also choose to have the post categories change at expiration time. If you choose to change the post category, the default action of changing
16
  the status will be ignored.
17
 
18
+ The plugin hooks into the wp cron processes and runs every minute by default, but can be configured to use any cron schedule (hourly, twicedaily, daily, etc).
19
 
20
  The expiration date can be displayed within the actual post by using the [postexpirator] tag. The format attribute will override the plugin
21
  default display format. See the [PHP Date Function](http://us2.php.net/manual/en/function.date.php) for valid date/time format options.
22
 
23
  Plugin homepage [WordPress Post Expirator](http://postexpirator.tuxdocs.net).
24
 
25
+ New! [Feature Requests](http://postexpirator.uservoice.com) Please enter all feature requests here. Requests entered via the plugin website or support forum may be missed.
26
+
27
  **[postexpirator] shortcode attributes**
28
 
29
  * type - defaults to full - valid options are full,date,time
47
 
48
  == Changelog ==
49
 
50
+ **Version 1.6.1**
51
+
52
+ * Tweaked error messages, removed clicks for reset cron event
53
+ * Switched cron schedule functions to use "current_time('timestamp')"
54
+ * Cleaned up default values code
55
+ * Added option to allow user to select any cron schedule (minute, hourly, twicedaily, daily) - including other defined schedules
56
+ * Added option to set default expiration duration - options are none, custom, or publish time
57
+ * Code cleanup - php notice
58
+
59
  **Version 1.6**
60
 
61
  * Fixed invalid html
144
 
145
  == Upgrade Notice ==
146
 
147
+ = 1.6.1 =
148
+ Tweaked error messages, added option to allow user to select cron schedule and set default exiration duration
149
+
150
  = 1.6 =
151
  Fixed invalid html
152
  Fixed i18n issues with dates