For comparison purposes (e.g. using workflow-ng's numeric comparison) it might be useful to have a token for the site's UNIX timestamp.

This very short and clean patch adds this token (called site-timestamp) to the token module.

Cheers,
Remco

CommentFileSizeAuthor
#1 250261_200903121611+1100.patch4.83 KBsammys
token-timestamp.patch843 bytesrkj

Comments

sammys’s picture

Version: 5.x-1.10 » 6.x-1.11
StatusFileSize
new4.83 KB

Hi,

Thanks for submitting this patch. I'm also wanting this to be added in though the version i'd like it added to is 6.x-1.x. Before this patch will be applied i'm pretty sure they'll want the equals sign '=' characters to line up above it. Could you reroll the patch for that?

Also, have a look at the use of the format_date() function in the patch i'm attaching for the D6 version. Since it's already being used in the D6 version perhaps you can backport all the other tokens (if they aren't already).

I'm going to bump it to the D6 version and then we can backport to the D5 version.

IMPORTANT: This token is needed for publishing and unpublishing nodes using rules.

greggles’s picture

Version: 6.x-1.11 » 6.x-1.x-dev

This no longer applies...can you re-roll for 6.x-1.x-dev?

greggles’s picture

Actually...maybe hold off for a little bit while I work on another token extras module...

sammys’s picture

@greggles: Not sure what you're doing over there but it applies for me. :p

sammys@pie:~/sites/all/modules/token$ patch --dry-run -p0 < 250261_200903121611+1100.patch 
patching file token.module
sammys@pie:~/sites/all/modules/token$ cvs stat token.module
===================================================================
File: token.module     	Status: Up-to-date

   Working revision:	1.7.4.9
   Repository revision:	1.7.4.9	/cvs/drupal-contrib/contributions/modules/token/token.module,v
   Commit Identifier:	7bfe48b814034567
   Sticky Tag:		DRUPAL-6--1 (branch: 1.7.4)
   Sticky Date:		(none)
   Sticky Options:	(none)

This being a system level token doesn't it make sense for it to be in the main token module?

sammys’s picture

Ok now that's weird... All those bits have been removed from 1.11. I'll let you get on with it!

greggles’s picture

Status: Needs review » Fixed

Fixed in #437842: create a token starterkit module and documentation so people know how to use it.

If you can review that and make sure it works that would be great. Thanks!

sammys’s picture

@greggles: The starterkit module is a good idea as tokens can be daunting for noobs. However, adding the timestamp token to it means you have to install the starterkit module in order to make available a site-wide token. It doesn't make sense to do that since it's an example module and the timestamp is a valid non-example token.

greggles’s picture

@sammys - I definitely see where you're coming from and struggled with this point for a bit. Ultimately, though, there is a penalty in UI and performance to jamming every last token into token core so token starter kit is a combination of "help noobs" and "random, less useful token dumping ground."

We can argue which tokens are more or less important for a long time - so far I'm going to use my best sense of it. Having two people request this feature over the 2 years since token was created ranks it pretty low in importance, in my opinion.

sammys’s picture

Yep ok. Thanks for the info.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.