Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2013-02-03 17:49:43

etc
Developer
Registered: 2010-11-11
Posts: 5,192
Website GitHub

Re: [SOLVED] Plugin which counts days

Yiannis, why not to move glx tag to variable?

<txp:variable name="lastday" value='<txp:glx_ ... />' />
<txp:if_variable name="lastday" value='<span title="deadline">0 days</span>'>
<span title="deadline">last day</span>
<txp:else />
<txp:variable name="lastday" />
</txp:if_variable>

Offline

#26 2013-02-03 17:58:55

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: [SOLVED] Plugin which counts days

Hi Oleg, the glx tag is in the cf as each entry has a different deadline/closing date/etc.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#27 2013-02-03 18:05:40

etc
Developer
Registered: 2010-11-11
Posts: 5,192
Website GitHub

Re: [SOLVED] Plugin which counts days

Why wouldn’t you put these dates in cf, an then call

<txp:variable name="lastday" value='<txp:glx_countdown ... to_or_whatever=''<txp:custom_field name="custom3" />'' />' />

Offline

#28 2013-02-03 18:18:12

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: [SOLVED] Plugin which counts days

Thanks, Oleg, the listing made it clear … umm, the post from 18:11:25.
(Unfortunately we don’t have posting numeration any longer).


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#29 2013-02-03 19:04:38

etc
Developer
Registered: 2010-11-11
Posts: 5,192
Website GitHub

Re: [SOLVED] Plugin which counts days

Uli, my loose English certainly accounts for 50% of your ears temperature. :) But what can I do – English has evolved since my last lessons.

Offline

#30 2013-02-03 22:06:46

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: [SOLVED] Plugin which counts days

Please don’t worry one iota about your English, Oleg! And my brain temperature (especially that of its left hemisphere) quickly went down again due to your excellent explanations :)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#31 2013-02-04 06:12:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: [SOLVED] Plugin which counts days

etc wrote:

Why wouldn’t you put these dates in cf, and then call…

Hi Oleg, the plugin’s tag is <txp:glx_countdown month="2" year="2013" day="4" delimiter=" " titletxt="passed" usetitle="false">passed</txp:glx_countdown> so it makes difficult to separate the dates.

I guess it is one of those rear txp walls so the only way is to edit the glx plugin so as to output last day when $now - $when ≤ 1 but I just can’t figure out how to do it.

Last edited by colak (2013-02-04 06:27:21)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#32 2013-02-04 09:50:59

etc
Developer
Registered: 2010-11-11
Posts: 5,192
Website GitHub

Re: [SOLVED] Plugin which counts days

Yiannis, try to replace

        $output = ($count == 1) ? "1 ".$name : "$count {$nameMulti}";

by

        $output = $count ? ($count == 1 ? "1 ".$name : "$count {$nameMulti}") : "last ".$name;

Offline

#33 2013-02-04 10:29:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: [SOLVED] Plugin which counts days

Thanks so much Oleg. That did it. I tested it and all is working just fine.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB