new entries via a drop-down menu. Part of the standard distribution. [Instructions] * Version: 1.0.5 * Author URI: https://www.flatpress.org */ if (!(basename($_SERVER ['PHP_SELF']) == 'admin.php' && // must be admin area @$_GET ['p'] == 'entry' && // must be right panel @$_GET ['action'] == 'write' && // must be right action !(@$_POST ['timestamp'] || @$_REQUEST ['entry']))) // must be a new entry return; function plugin_datechanger_toolbar() { // $time = time(); // use UTC + timeoffset, coe.date.php. line 64 $time = date_time(); $h = date('H', $time); $m = date('i', $time); $s = date('s', $time); $Y = date('Y', $time); $M = date('m', $time); $D = date('d', $time); $lang = lang_load('plugin:datechanger'); // Multilingual support by Plugin global $lang; // Multilingual support by FlatPress echo '
'; } // Meh, {toolbar} no longer works with fp-1.3 dev -> #17 //add_action('editor_toolbar', 'plugin_datechanger_toolbar', 0); add_filter('simple_datechanger_form', 'plugin_datechanger_toolbar', 0); function plugin_datechanger_check() { if ((isset($_GET ['p']) && $_GET ['p'] != 'entry') || (isset($_GET ['action']) && $_GET ['action'] != 'write')) return; if (empty($_POST)) return; if (!empty($_POST ['date'])) $date = $_POST ['date']; else return; foreach ($date as $v) { if (!is_numeric($v)) return; else $date [] = intval($v); } list ($hour, $minute, $second, $day, $month, $year) = $date; $time = mktime($hour, $minute, $second, $month, $day, $year); $_POST ['timestamp'] = $time; } add_action('init', 'plugin_datechanger_check'); ?>