Changeset 1957563
- Timestamp:
- 10/16/2018 03:01:03 PM (7 years ago)
- Location:
- safly-article-lock
- Files:
-
- 5 added
- 3 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/LICENSE.txt (added)
-
tags/1.1.0/config.php (added)
-
tags/1.1.0/readme.txt (added)
-
tags/1.1.0/safly-article-lock.php (added)
-
trunk/config.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/safly-article-lock.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
safly-article-lock/trunk/config.php
r1957301 r1957563 9 9 'from' => '2037-01-01', //...|..., the right part will be locked 10 10 'to' => '1970-01-01', //...|..., the left part will be locked 11 'f_t' => '1970-01-01, 2037-01-01', //...|...|..., the middle part will be locked11 'f_t' => '1970-01-01,1970-01-02', //...|...|..., the middle part will be locked 12 12 'home_excl' => true, //If true the homepage won't be locked 13 13 'exclude_p' => [], //[4,5,6] (Supreme Priority) … … 25 25 'from' => '2037-01-01', //...|..., the right part will be locked 26 26 'to' => '1970-01-01', //...|..., the left part will be locked 27 'f_t' => '1970-01-01, 2037-01-01', //...|...|..., the middle part will be locked27 'f_t' => '1970-01-01,1970-01-02', //...|...|..., the middle part will be locked 28 28 'home_excl' => true, //If true the homepage won't be locked 29 29 'exclude_p' => [], //[4,5,6] (Supreme Priority) … … 37 37 'from' => '2037-01-01', //...|..., the right part will be locked 38 38 'to' => '1970-01-01', //...|..., the left part will be locked 39 'f_t' => '1970-01-01, 2037-01-01', //...|...|..., the middle part will be locked39 'f_t' => '1970-01-01,1970-01-02', //...|...|..., the middle part will be locked 40 40 'home_excl' => true, //If true the homepage won't be locked 41 41 'exclude_p' => [], //[4,5,6] (Supreme Priority) -
safly-article-lock/trunk/readme.txt
r1957301 r1957563 4 4 Requires at least: 3.0 5 5 Tested up to: 4.9.8 6 Stable tag: 1. 0.06 Stable tag: 1.1.0 7 7 License: MPL 2.0 8 8 License URI: http://mozilla.org/MPL/2.0/ … … 37 37 == Changelog == 38 38 39 = 1.0 = 39 = 1.1.0 = 40 * Bug Fix: Some bugfixes 41 42 = 1.0.0 = 40 43 * Construct the basic framework -
safly-article-lock/trunk/safly-article-lock.php
r1957301 r1957563 4 4 Plugin URI: https://www.oranme.com 5 5 Description: A plug-in helps you disable the access to the articles in an appointed range. 6 Version: 1. 0.06 Version: 1.1.0 7 7 Author: OranMe Ltd. 8 8 Author URI: https://blog.safly.org … … 31 31 } 32 32 33 if (SaFly_Article_Lock($GLOBALS['SaFly_AL'])) { 34 if (!headers_sent()) { 35 header($GLOBALS['SaFly_AL']['header']); 36 header('Location: ' . $GLOBALS['SaFly_AL']['location']); 33 //Add hook 34 add_action('wp', 'SaFly_Article_Lock_Hook'); 35 function SaFly_Article_Lock_Hook() { 36 if (SaFly_Article_Lock($GLOBALS['SaFly_AL'])) { 37 if (!headers_sent()) { 38 header($GLOBALS['SaFly_AL']['header']); 39 header('Location: ' . $GLOBALS['SaFly_AL']['location']); 40 } 41 exit('SaFly Article Lock'); 37 42 } 38 exit('SaFly Article Lock');39 43 } 40 44 … … 64 68 $post_time = strtotime($post->post_date); 65 69 //Initialize and avoid wrong time set 66 $f_t = explode(',', $ f_t);70 $f_t = explode(',', $config['f_t']); 67 71 $from = strtotime($config['from']); 68 72 $to = strtotime($config['to']); 69 73 $f_t[0] = strtotime($f_t[0]); 70 74 $f_t[1] = strtotime($f_t[1]); 71 if ($from && $to && $f_t) { 75 //1970-01-01 76 $from = ($from === 0)?1:$from; 77 $to = ($to === 0)?1:$to; 78 $f_t[0] = ($f_t[0] === 0)?1:$f_t[0]; 79 $f_t[1] = ($f_t[1] === 0)?1:$f_t[1]; 80 //Mistakes check 81 if ($from && $to && $f_t[0] && $f_t[1]) { 72 82 //... 73 83 }else { 74 //Wrong time set, please check 75 error_log('SaFly Article Lock: Wrong time set'); 84 if (!empty($config['from']) && !empty($config['to']) && !empty($config['f_t'])) { 85 //Wrong time set, please check 86 error_log('SaFly Article Lock: Wrong time set'); 87 } 76 88 return false; 77 89 }
Note: See TracChangeset
for help on using the changeset viewer.