1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Implemented Current year variable

Discussion in 'Closed Suggestions' started by Floren, Apr 15, 2013.

  1. Floren

    Floren Well-Known Member

    I was wondering if there is a specific year variable we can use into a phrase, for example xenforo_copyright. I bought the copyright removal and I personalized that phrase to match my needs. I would like to use inside that phrase, a variable that defines the current year. Thank you.
     
  2. Fufu

    Fufu Well-Known Member

    Having a reoccurring year being posted sounds illegal. By creating a variable that makes XenForo being copyrighted forever breaks UK laws. Which if I remember correctly, UK law states that typographical works only last from 25 years of the start of creation. I am not sure how code copyright works, but I would assume it is deemed as typographical work.
     
  3. James

    James Well-Known Member

    I'm not sure of the truth behind this so I'm not commenting on it, but the suggestion can merely be a variable for the current year, much like the $serverTime variable.

    It doesn't have to be created for copyright purposes :)
     
  4. Fufu

    Fufu Well-Known Member

    It looks like to me XenForo Ltd. is doing it right by only having the year static from the time of creation of the code. What a user does with their forum is their business in my eyes. However, this thread is in the 'Suggestions: Tweaks & Small Features' board, so naturally I would assume they are asking XenForo Ltd. to consult legal counsel before implementing this change across their entire clientele.
     
  5. xfrocks

    xfrocks Well-Known Member

    You can use this:

    Code:
    {xen:date $serverTime, Y}
     
  6. EQnoble

    EQnoble Well-Known Member

    Do you happen to know off hand what other (would arguments be the correct term here?) time labels are available if any and what represents those...

    Like, if this is year with Y representing current year
    Code:
    {xen:date $serverTime, Y}
    What else can be used (month, day, etc) and what represents those?
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    http://php.net/manual/en/function.date.php. Look at the format table.
     
    EQnoble likes this.
  8. xfrocks

    xfrocks Well-Known Member


    You can read about all of them here http://php.net/manual/en/function.date.php

    For example, if you need year and month, use:

    Code:
    {xen:date $serverTime, Ym}
    If you want day, use:

    Code:
    {xen:date $serverTime, d}
    For year-month-day hour:minute:second, use:

    Code:
    {xen:date $serverTime, 'Y-m-d H:i:s'}
     
    EQnoble likes this.
  9. EQnoble

    EQnoble Well-Known Member

    Ohh wow... so if I use xen:date $serverTime I can follow with any proper use of format as specified by the php date function?
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    Yup. Internally it just calls the date() function to format and retrieve the time.
     
    EQnoble likes this.
  11. Floren

    Floren Well-Known Member

    This does not applies for me because I purchased the right to remove the copyright, as described into OP.
    Thank you, it does not work when I put it into a phrase.
    Phrase text: xenforo_copyright
    Phrase text: Axivo Inc. © {xen:date $serverTime, Y}
     
  12. Syndol

    Syndol Guest

    You will need to edit the phrase to include the year variable:
    Axivo Inc. © {year}

    And then pass that variable to the phrase:
    {xen:phrase xenforo_copyright, 'year={xen:date $serverTime, Y}'}
     
    Floren likes this.
  13. Floren

    Floren Well-Known Member

    That is why I suggested to be done as default in XenForo source code, yet is marked as implemented.
    I was trying not to edit the template, thanks for the suggestion.
     
    Syndol likes this.
  14. Brogan

    Brogan XenForo Moderator Staff Member

    It's marked as implemented as you specifically asked "if there is a specific year variable we can use into a phrase, for example xenforo_copyright. I bought the copyright removal and I personalized that phrase to match my needs. I would like to use inside that phrase, a variable that defines the current year".

    And the answer is yes, as posted above.

    What about the suggestion do you feel is still not possible?
     

Share This Page