Page 1 of 1

Possible to pass template variable to PHP?

Posted: Mon Feb 10, 2014 9:20 am
by vrocks
I want to add this code to the RSS feed template, subtemplate:

Code: Select all

<enclosure url="<!--THUMB_URL-->" length="<? echo filesize("/web/sites/domain.com/" . parse_url("<!--THUMB_URL-->",PHP_URL_PATH)); ?>" type="image/jpeg" />
If the THUMB_URL was parsed before the PHP code then this should work. It seems the PHP is parsed first?

Re: Possible to pass template variable to PHP?

Posted: Mon Feb 10, 2014 9:36 am
by vrocks

Code: Select all

<pubDate><?=date('r', strtotime('<!--ACTIVATION_DATE-->'))?></pubDate>
That code from the WIKI also doesn't work correctly...

Code: Select all

<pubDate>Wed, 31 Dec 1969 19:00:00 -0500</pubDate>

Re: Possible to pass template variable to PHP?

Posted: Mon Feb 10, 2014 2:09 pm
by admin
Why do you think it doesn't work ?

Re: Possible to pass template variable to PHP?

Posted: Mon Feb 10, 2014 3:17 pm
by vrocks
Notice in my own reply that the date wasn't output by your script so the timestamp shows default for 0 seconds from epoch.

Re: Possible to pass template variable to PHP?

Posted: Mon Feb 10, 2014 3:23 pm
by admin
what actual date for you have in admin for that thumb >

Re: Possible to pass template variable to PHP?

Posted: Mon Feb 10, 2014 3:35 pm
by vrocks

Code: Select all

2013-12-01 20:10:13
I am going to run a test right now where I hardcode the date and I don't.

Re: Possible to pass template variable to PHP?

Posted: Mon Feb 10, 2014 3:44 pm
by vrocks
Now it is working... Gremlins!

I swear it didn't work for me before. All dates for all thumbs were epoch. So now I am working on the original problem. The thumbnail size in bytes.

It should give me the number but is instead blank. Testing it in a file with a hardcoded thumbnail URL plucked from the RSS feed it works.

http://www.messedupshit.com/bytes.php

Re: Possible to pass template variable to PHP?

Posted: Mon Feb 10, 2014 5:34 pm
by admin
There's no tag to output thumb's size in bytes so you have to use your own code