Code Monkey home page Code Monkey logo

pubdatefix-getsimplecms's Introduction

PubDate Fix (publication date) - plugin for GetSimple CMS

Makes GetSimple pages' date field fixed and editable, and adds new replacement lastUpdate field.

It makes GS functions (template tags) get_page_date() and return_page_date() work like a blog post's date.

If you want to display or use the lastUpdate field, you can use the helper functions / template tags:

get_page_lastupdate($dateformat)
return_page_lastupdate($dateformat)

(they work exactly like GetSimple's get_page_date() and return_page_date() do when this plugin is not installed)

A new editable Publication Date field is displayed in Edit Page -- Options.

Default date[time] editing format is 'Y-m-d H:i' (for e.g. 2015-12-31 23:59)
You can define your custom format in your site's gsconfig.php file.
Some examples:

 define('PUBDATEFORMAT','Y/m/d H.i'); // ==> 2015/12/31 23.59
 define('PUBDATEFORMAT','Y-m-d');     // ==> 2015-12-31
...

To disable the datepicker, insert this in gsconfig.php:

define('PUBDATEPICKER', false);

(jQuery DateTimePicker by XDSoft http://xdsoft.net/jqplugins/datetimepicker/)

pubdatefix-getsimplecms's People

Contributors

cnb avatar

Watchers

James Cloos avatar  avatar

pubdatefix-getsimplecms's Issues

add support for strftime format

check if string format parameter contains "%", then use strftime. If not, use date().

This would be done in get_page_lastupdate()

As for GS's get_page_date(), create an alternative replacement function until GS supports strftime.

Replace table tags by divs (lastUpdate_edit)

I created this plugin when GS was version 2.0x, that used a table for the page options in edit.php (this was changes in GS 3.0)

Though it still works, change the "<td..." to "<div ..."

edit date format should not be defined by editing the plugin

Right now you have to edit pubdatefix.php to define the edit date format

define('GSEDITDATEFORMAT','Y-m-d H:i');

If you change that and upgrade the plugin by overwriting, changes are lost.
Better define it in GS's root gsconfig.php file.
The plugin should then have a default value (in case it's not defined)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.