Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Version 0.13:
- An attempt to fix some non-trivial bugs in date calculations that were present in the original script. Not sure if dates/times outputted are always 100% correct.
Who’s gonna textdrive you home tonight?
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Version 0.14:
- Added a
limit=""
property that limits the number of date/time entities returned to the first <strong>n</strong> of them. E. g. if the entire set of year/month/day/hour/minute values was to be outputted, setting this property to 2 would only output years and months (or years and days, if months are zero and so on). - Added a
posted=""
property. If set to any value (as in posted=“yes”), it takes in the current article’s posted date (provided there is such a context) instead of the usual individual date/time values. Currently it works in article forms, NOT in article bodies. (The original intention was to use this plugin instead of the @<txp:posted /> tag for better date/time handling when the ‘since’ date format is desired.) - Fixed a missing array element for Czech language.
Who’s gonna textdrive you home tonight?
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Dutch language:
<code>
$l = ‘nl’;
$words[] = $l;
$words[$l] = array(‘simpleplurals’,‘year’,‘month’,‘day’,‘hour’,‘minute’,‘override’);
$words[$l][‘simpleplurals’] = 2;
$words[$l][‘year’] = array(‘jaren’,‘jaar’);
$words[$l][‘month’] = array(‘maanden’,‘maand’);
$words[$l][‘day’] = array(‘dagen’,‘dag’);
$words[$l][‘hour’] = array(‘uur’,‘uur’);
$words[$l][‘minute’] = array(‘minuten’,‘minuut’);
$words[$l][‘override’] = array(0);
</code>
Last edited by ReinierBiz (2004-04-28 07:25:25)
VC88 | Nah, there weren’t really eighty-eight of them. They just called themselves “The Crazy 88.”
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Version 0.2 (see the top post for an URL)
- Added future dates handling. Countdowns are now possible!
- Added a
since=""
property: A word attached to the result in case the event date is in the past. There is no default value. If both since and until are specified, the plugin use one of them according the final result. - Added an
until=""
property: A word attached to the result in case the event date is in the future. There is no default value. If both since and until are specified, the plugin use one of them according the final result. - Added an
attach=""
property: A switch indicating whether the since/until words should be attached before or after the result. I. e. valid values are “before” and “after” (“before” being the default value). - Added a
from=""
property: Allows to set a date/time, which will be taken as a base to run calculations against (instead of the default now). The date/time format should adhere to the usual syntax (for examples see corresponding date and time section on this GNU manual page). - Added Dutch language (by ReinierBiz).
Last edited by mamash (2004-10-23 17:43:54)
Who’s gonna textdrive you home tonight?
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Love this plugin, thank you mamash. Nifty additions, too!
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
@Mamash:
Change:
<code>
$words[$l][‘year’] = array(‘jaren’,‘jaar’);
</code>
To this:
<code>
$words[$l][‘year’] = array(‘jaar’,‘jaar’);
</code>
That’s a little bit better :-)
VC88 | Nah, there weren’t really eighty-eight of them. They just called themselves “The Crazy 88.”
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
I obviously have nothing better to do.
Version 0.21 (see the top post for an URL)
- Added a
last=""
argument: Sets string that should be used as a final delimiter, i. e. to go before the last used date/time item. If not specified (and no delimiter is set), defaults to language specific value, e. g. and in English. (Intended to better simulate natural language.) - Changed the
attach
behaviour. Now it has to be specified if you wish to use this feature. Also added a ‘auto’ value which will switch the position according to language preferences (see source code). Feel free to modify it to suit your preferences. - Changed the
since
anduntil
behaviour. If not set, they will default to language specific values, but will not be used unless you provide anattach
argument. Feel free to modify it to suit your preferences. - Changed the Dutch language data per ReinierBiz’s instructions.
- Changed parts of the code (no impact on results).
- The code is growing in size, feel free to delete languages you don’t use, if you feel like. I’d welcome any suggestions on simplifying the code and/or using easier to use language definitions.
Last edited by mamash (2004-10-23 17:44:09)
Who’s gonna textdrive you home tonight?
Offline
#20 2004-05-12 20:20:30
- starzabove
- Member
- Registered: 2004-04-13
- Posts: 76
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
I tried opening this with WinRar and it gives me the error:
‘The archive is either in unknown format or damaged’
I have tried redownloading it, and I also downloaded WinAce to see if another program would work, but alas, it still doesn’t work.
The file claims to be 20.6 KB, so I’m not sure what’s up.
Thanks.
90+ Textpattern installs and still going…
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
I just right click and save as, works for me. =)
Offline
#22 2004-05-13 05:42:05
- starzabove
- Member
- Registered: 2004-04-13
- Posts: 76
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Oy, I was trying to double click on it and have it extract the file like a zip. I didn’t realize I should just load that file as the plug-in.
It worked great, now!
Thanks LisaJill for responding.
Thanks mamash for the plugin.
90+ Textpattern installs and still going…
Offline
#23 2004-06-14 11:46:44
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Mamash, I used your plugin and it works fine, only today I notice something I don’t know what causes it.
This is what I have on my page:
[txp:fha_time_diff year=“2004” month=“1” day=“14” delimiter=”, “ last=” en “ lang=“nl” /]
The output normally is “x months and y days”, but today it’s exactly 5 months and it says “n 5 months” (see <a href=“www.doggiez.nl”>here</a>).
As I’m not very familiar with php I don’t know where to look to find where the “n” is coming from. Can you tell me how to solve this?
Thank you.
Edit:
I’ll repost this in How Do I..
Last edited by doggiez (2004-06-14 21:07:46)
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Version 0.22 (see the top post for an URL)
- Fixed a bug that left the ‘last item’ delimiter at the beginning of plugin output in some cases.
Last edited by mamash (2004-10-23 17:44:25)
Who’s gonna textdrive you home tonight?
Offline