Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: strftime unix %s doesn't works on localhost
There are symlinks for PHP 7.3 and PHP 7.4, so try that again with:
php73 -r "echo strftime('%s', '1591628404');"
php74 -r "echo strftime('%s', '1591628404');"
Last edited by gaekwad (2020-06-08 17:22:04)
Offline
Re: strftime unix %s doesn't works on localhost
Both -1.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: strftime unix %s doesn't works on localhost
Time to compare phpinfo()
? I’m around for the evening, just waiting on stuff to compile.
Offline
Re: strftime unix %s doesn't works on localhost
gaekwad wrote #323658:
Time to compare
phpinfo()
? I’m around for the evening, just waiting on stuff to compile.
I’ll show you mine if you show me yours ;)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: strftime unix %s doesn't works on localhost
Bloke wrote #323635:
Thanks for the report. In the meantime, this will get you the current article timstamp:
<txp:php>global $thisarticle; echo $thisarticle['posted'];</txp:php>...
Cool thanks, where can I find the full documentation about the $thisarticle
and all the other cool friends please?
BTW if you already working on solving this, then it also the same in all other date related tags as:
<txp:posted />
<txp:expires />
<txp:image_date />
<txp:image_info />
<txp:file_download_created />
Offline
Re: strftime unix %s doesn't works on localhost
Yeah, they all use our safe_strftime()
function, which is basically a piggyback to PHP’s strftime()
with the timezone/gmt offsets added to it. So any tag that uses any such time-based info will be affected.
Trying to zero in on the problem. We’ve ruled out a lot of things, but have yet to find the root cause.
btw, the easiest way to find out about the various $this
strings is to import them from the global scope and just dmp();
them on your page, maybe in your default form. You can see how they react as you navigate around the front end.
These are the most fun ones, some of which are context dependent (so will return null unless you’re in a <txp:images>
or <txp:file_download_list>
or <txp:linklist>
container, etc):
global $pretext,
$thisarticle,
$thissection,
$thiscategory,
$thispage,
$thislink,
$thisimage,
$thisfile,
$thisauthor;
dmp('TXP CONTEXT', $pretext);
dmp('CURRENT ARTICLE', $thisarticle);
dmp('CURRENT IMAGE', $thisimage);
dmp('CURRENT FILE', $thisfile);
dmp('CURRENT LINK', $thislink);
dmp('CURRENT SECTION', $thissection);
dmp('CURRENT URL CATEGORY', $thiscategory);
dmp('CURRENT URL AUTHOR', $thisauthor);
dmp('CURRENT URL PAGINATION', $thispage);
They’re probably documented somewhere, but if not, you’re right, they should be. I’ll check as we iterate the documentation for 4.8.
Last edited by Bloke (2020-06-08 21:41:46)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: strftime unix %s doesn't works on localhost
Bloke wrote #323662:
They’re probably documented somewhere, but if not, you’re right, they should be. I’ll check as we iterate the documentation for 4.8.
Thanks a lot this is a really useful stuff, always great to learn more TXP love 🤗
Offline
Re: strftime unix %s doesn't works on localhost
After going round in circles and plenty of head scratching, my sleuthing accomplice and I have decided to just work around this issues instead of trying to fathom why it happens.
Should be patched in this commit.
Thanks for all your help on this one, Mr Cooper.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline