Jump to content

PHP in Copyright


Recommended Posts

Hello,

I'm trying to get the copyright line to display the current year.

Copyright ©️ LuzFaltex, LLC 2014-<?php echo date("Y"); ?>, all rights reserved
<span id="elCopyright_userLine">Copyright ©️ LuzFaltex, LLC 2014-<!--?php echo date("Y"); ?-->, all rights reserved</span>

I have also tried using template syntax, but this just gets rendered raw.

<span id="elCopyright_userLine">Copyright ©️ LuzFaltex, LLC 2014-{{date("Y")}}, all rights reserved</span>

I tried searching for this copyright line in the templates, but neither the global nor footer templates have any mention of this. The footer template ends with the "Contact Us" link and the global template just references the footer and then moves on to javascript.

Is there a way that I can do what I'm trying to accomplish here or do I need to just opt for no copyright line and then create it myself manually by modifying the footer template?

Edited by Foxtrek_64
Fix code blocks
Link to comment
Share on other sites

35 minutes ago, Ryan Ashbrook said:

{expression="date('Y')"}

Try that.

Hi Ryan,

Thanks for the response. Unfortunately this also renders as raw text.

Copyright line text:

Copyright ©️ LuzFaltex, LLC 2014-{expression="date('Y')"}, all rights reserved

Rendered text:

<span id="elCopyright_userLine">Copyright ©️ LuzFaltex, LLC 2014-{expression="date('Y')"}, all rights reserved</span>

 

Link to comment
Share on other sites

4 minutes ago, Ioannis D said:

With javascript?


<script type='text/javascript'>document.write(new Date().getFullYear());</script>

 

I was able to get it with modifying the template. I'm not unfamiliar with template modifications, but I was trying to figure out if I could do it with the built-in copyright text system.

Link to comment
Share on other sites

Just now, Foxtrek_64 said:

I was able to get it with modifying the template. I'm not unfamiliar with template modifications, but I was trying to figure out if I could do it with the built-in copyright text system.

Oh, no that is made for just simple plaintext. If you want to do dynamic things like JavaScript or PHP, then the templates would need to be modified. 🙂 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...