User Tools

Site Tools


res:plugins:datechanger

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
res:plugins:datechanger [2019/01/12 17:53] – external edit 127.0.0.1res:plugins:datechanger [2024/01/21 18:14] (current) – [Download] DateChanger-Plugin v1.0.4 for FlatPress 1.3 "Andante" Beta 1 fraenkiman
Line 1: Line 1:
 ====== DateChanger Plugin ====== ====== DateChanger Plugin ======
 +Author: NoWhereMan, revised by [[https://frank-web.dedyn.io|Fraenkiman]]
  
-Adds yet another toolbar to the entry interface +==== Description ==== 
 +Lets you change the publish date for (new) entries. Therefore, it adds the edit interface with a date drop down menu.
  
-Largely untested, this plugin won't be part of the standard distribution, for now  --- //Edoardo Vacchi 2007/09/07 09:09//+This plugin only works for //new// entries. Once published, the date cannot be changed again!
  
-Copy paste this to ''fp-plugins/datechanger/plugin.datechanger.php''Have fun!+==== Download ==== 
 +{{ res:plugins:nowhereman:datechanger_1_0_4.zip |}} for [[https://github.com/flatpressblog/flatpress/releases/download/1.3.beta1/flatpress_1_3_beta1.zip|FlatPress 1.3 "Andante" Beta 1]] or higher
  
 +[[https://codeload.github.com/flatpressblog/flatpress-extras/zip/3c237b8f352aa124fadf2bda41ce0f3e1e082d8c|DateChanger 1.0.2]] for FlatPress 1.2.1
  
-<code php> 
-<?php 
-/* 
-Plugin Name: DateChanger 
-Plugin URI: http://www.nowhereland.it/ 
-Type: Block 
-Description: Let you change date for entries and clutters the interface with another drop down menu 
-Author: NoWhereMan 
-Version: 1.0 
-Author URI: http://www.nowhereland.it/ 
-*/  
  
-if (! ( +See also: https://github.com/flatpressblog/flatpress-extras/tree/master/fp-plugins/datechanger
- 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() { +==== Screenshot ==== 
-  +Screenshot of the edit area with the DateChanger toolbar:\\ 
- $time time(); +{{:res:plugins:nowhereman:datechanger_1_0_3.png?640|Screenshot of the edit area with the DateChanger toolbar}}
-  +
- $h date('H', $time); +
- $m date('i', $time); +
- $s date('s', $time); +
-  +
- $Y date('Y', $time); +
- $M date('m', $time); +
- $D date('d', $time); +
-  +
- +
  
- echo '<div id="admin-date"><p>'; 
-  
- echo '<label><select name="date[]">'; 
- for ($i=0; $i<24; $i++) { 
- $v = sprintf('%02d', $i); 
- echo '<option value="' . $v . '"'. 
- (($v == $h)? ' selected="selected"' : ''). 
- '>' . $v . '</option>'; 
- } 
-  
- echo '</select>h</label> :'; 
-  
- echo '<label><select name="date[]">'; 
- for ($i=0; $i<60; $i++) { 
- $v = sprintf('%02d', $i); 
- echo '<option value="' . $v . '"'. 
- (($v == $m)? ' selected="selected"' : ''). 
- '>' . $v . '</option>'; 
- } 
-  
- echo '</select>mins</label> :'; 
-  
-  
- echo '<label><select name="date[]">'; 
- for ($i=0; $i<60; $i++) { 
- $v = sprintf('%02d', $i); 
- echo '<option value="' . $v . '"'. 
- (($v == $s)? ' selected="selected"' : ''). 
- '>' . $v . '</option>'; 
- } 
-  
- echo '</select>secs</label> '; 
-  
-  
-  
- echo '<select name="date[]">'; 
- foreach (range(2000, intval($Y)+10) as $v) { 
- echo '<option value="' . $v . '"'. 
- (($v == $Y)? ' selected="selected"' : ''). 
- '>' . $v . '</option>'; 
- } 
- echo '</select>/'; 
-  
- $mths = array( 
- 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' 
- ); 
-  
- echo '<select name="date[]">'; 
- for ($i=0; $i<12; $i++) { 
- $v = sprintf('%02d', $i+1); 
- echo '<option value="' . $v . '"'. 
- (($v == $M)? ' selected="selected"' : ''). 
- '>' . $mths[$i] . '</option>'; 
- } 
- echo '</select>/'; 
-  
- echo '<select name="date[]">'; 
- for ($i=1; $i<=31; $i++) { 
- $v = sprintf('%02d', $i); 
- echo '<option value="' . $v . '"'. 
- (($v == $D)? ' selected="selected"' : ''). 
- '>' . $v . '</option>'; 
- } 
- echo '</select></p></div><!-- end of #admin-date -->'; 
-  
-} 
  
-add_action('editor_toolbar', 'plugin_datechanger_toolbar');+**Support**
  
 +Please ask for help on the [[https://forum.flatpress.org/viewtopic.php?t=491|FlatPress Forum]]
  
-function plugin_datechanger_check() { +=== Changelog: === 
- +== 2024-01-21 (V1.0.4) == 
- if ((isset($_GET['p']&& $_GET['p'] !'entry') ||  +  * Compatibility with [[https://github.com/flatpressblog/flatpress/releases/download/1.3.beta1/flatpress_1_3_beta1.zip|FlatPress 1.3 "Andante" Beta 1]] and other active plugins established 
- (isset($_GET['action']) &&  $_GET['action'] != 'write')) return; +== 2024-01-05 (V1.0.3== 
- +  * Compatibility with FlatPress 1.3 established 
- if (empty($_POST)) return; +== 2023-01-07 (V1.0.2) == 
- +  * Small fixes in HTML output 
- if (!empty($_POST['date'])) +== 2022-12-03 (V1.0.1) == 
- $date $_POST['date']; +  * Add multilangual support 
- else  +  * added german and english translation 
- return; +  * Revised style 
-  +  * the position of the plugin is now above the BBCode elements 
- foreach ($date as $v{ +  * added Instructions
- if (!is_numeric($v)) +
- return; +
- else  +
- $date[] intval($v); +
-+
-  +
- list($hour, $minute, $second, $year, $month, $day) = $date; +
-  +
- $time mktime $hour, $minute, $second, $month, $day, $year )+
-  +
- $_POST['timestamp'$time; +
-} +
- +
-add_action('init', 'plugin_datechanger_check'); +
- +
-?></code> +
res/plugins/datechanger.1547312011.txt.gz · Last modified: 2019/01/12 17:53 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki