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.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
attachbehaviour. 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
sinceanduntilbehaviour. If not set, they will default to language specific values, but will not be used unless you provide anattachargument. 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
#25 2004-08-12 05:30:36
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Have you thought about a modification so that it you can choose the single-unit format in which it’s returned, as in
181 days since…
368 days since…
54400 minutes until…
Rather than having it be solely dictated by what values are passed to it & echoing those back, add an optional layer that allows the user to request in what single unit to get back?
Also… I just discovered that while wraptag was built in, it wasn’t actually implemented. Looks like you forgot to concatenate the strings at the end of the function.
Last edited by compooter (2004-08-12 05:46:18)
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Version 0.23 (see the top post for an URL)
- The
wraptag=""andclass=""argument now do work. (Thanks for that, compooter.)
Last edited by mamash (2004-10-23 17:44:53)
Who’s gonna textdrive you home tonight?
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
> compooter wrote:
> Have you thought about a modification so that it you can choose the single-unit format in which it’s returned, as in
>181 days since…
>368 days since…
>54400 minutes until…
>Rather than having it be solely dictated by what values are passed to it & echoing those back, add an optional layer that allows the user to request in what single unit to get back?
I’d be interested in this function as well.
Last edited by cfenison (2004-08-24 16:27:07)
-Chris
chrisfenison.com
Offline
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
OK guys, I will attempt to work this in, but probably no sooner than September. Got to get out of town.
Who’s gonna textdrive you home tonight?
Offline
#29 2004-08-24 20:32:04
- Andrew
- Plugin Author

- Registered: 2004-02-23
- Posts: 730
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
No rush, just blue-skying ;-)
Offline
#30 2004-09-06 16:38:20
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] fha_time_diff: A Time Since generator
Can somebody tell me what I would have to change in the plugin so that the spaces between ‘number of days (months etc.)’ and ‘days (months etc.)’ will become non breaking spaces?
For instance: 7<code> </code>days.
Last edited by doggiez (2004-09-06 16:38:48)
Offline