Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • Add-ons
  • Manager, Parser & the Core
  • PHx
  •  
  • [SOLVED] PHX:ago returns incorrect result#

  • 791
    38
    Learning a little more each day.

    aksteven Reply #1, 1 year, 3 months ago

    Reply
    • Link to this post#1
    I'm using the PHX:ago modifier in a Revolution snippet (getFeed) to embed a Twitter feed in a site. The :ago modifier is returning 41 years 1 month ago for a tweet posted yesterday! Can anyone point me in the right direction? My call and template chunk are as follows:
        [[!getFeed?
          &url=`http://twitter.com/statuses/user_timeline/46646566.rss`
    
          &tpl=`twitterFeedTpl`
          &limit=`1`
          ]]


    And the Template is:

    <div class="tweet">
        <p>[[+description]] <br />
        <a class="timestamp" href="[[+link]]">[[+date_timestamp:ago]]</a></p>
    </div>


    Thanks in advance.


  • 20413
    2,474
    My playground: http://4up2date.info | Twitter: @mrhaw

    mrhaw Reply #2, 1 year, 3 months ago

    Reply
    • Link to this post#2
    Is it this CODE you are using http://wiki.modxcms.com/index.php/PHx/CustomModifiers#phx:timesince


  • 791
    38
    Learning a little more each day.

    aksteven Reply #3, 1 year, 3 months ago

    Reply
    • Link to this post#3
    I'm using Revolution, so it won't accept a new snippet called phx:anything. It returns invalid snippet name. Besides, I simply followed the instructions http://rtfm.modx.com/display/ADDON/getFeed.Adding+a+Twitter+Feed which seem to suggest that the :ago modifier is built into the core of Revo??


  • 28042
    15,113
    How MODx Evo Works

    Log in to an Evo Manager username guest, password guestuser.

    sottwell Reply #4, 1 year, 3 months ago

    Reply
    • Link to this post#4
    All of the phx functions are built in to Revo.


  • 791
    38
    Learning a little more each day.

    aksteven Reply #5, 1 year, 3 months ago

    Reply
    • Link to this post#5
    Thanks for the note and I had gathered that all PHX functions are inbuilt. However I still have the problem that the :ago function is incorrectly interpreting the Twitter time stamp and inserting 41 years ago! I'm slightly stuck as the client wants to display this info, I can't add a custom PHX modifier in the way that I used to , i.e. via a new snippet called PHX:xxxx, so I'm hunting for suggestions!

    Anyone care to comment or point me in the right direction?


  • 25461
    23

    romanum Reply #6, 1 year, 2 months ago

    Reply
    • Link to this post#6
    I had the same problem with a twitter feed.

    Found that if I changed:

    [[+date_timestamp:ago]]


    To:

    [[+pubdate:ago]]


    and it worked!

    Don't know if the docs need changing...?
    http://rtfm.modx.com/display/ADDON/getFeed.Adding+a+Twitter+Feed


  • 22303
    9,765
    - MODX Chief Architect

    Jason Coward | MODX Chief Architect

    jasoncoward.com | @drumshaman

    opengeek Reply #7, 1 year, 2 months ago

    Reply
    • Link to this post#7
    Quote from: aksteven at Feb 17, 2011, 12:59 PM
    Thanks for the note and I had gathered that all PHX functions are inbuilt. However I still have the problem that the :ago function is incorrectly interpreting the Twitter time stamp and inserting 41 years ago! I'm slightly stuck as the client wants to display this info, I can't add a custom PHX modifier in the way that I used to , i.e. via a new snippet called PHX:xxxx, so I'm hunting for suggestions!

    Anyone care to comment or point me in the right direction?
    Since there is no PHX, do not prefix your Snippets with PHX: — it will look for the modifier in all Snippets without the prefix in MODX Revolution.


  • 791
    38
    Learning a little more each day.

    aksteven Reply #8, 1 year, 2 months ago

    Reply
    • Link to this post#8
    Thanks everyone. It was that
    [[+date_timestamp:ago]]
    needs to be changed to
    [[+pubdate:ago]]

    @splittingred - if you read this... Could you please amend your instructions?



  • 20413
    2,474
    My playground: http://4up2date.info | Twitter: @mrhaw

    mrhaw Reply #9, 1 year, 2 months ago

    Reply
    • Link to this post#9
    Quote from: aksteven at Mar 14, 2011, 09:18 AM
    Thanks everyone. It was that
    [[+date_timestamp:ago]]
    needs to be changed to
    [[+pubdate:ago]]

    @splittingred - if you read this... Could you please amend your instructions?

    You can use createdon or your own custom TV as timestamp as well.





Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
aksteven, mrhaw, opengeek, romanum, sottwell

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy