- Betroffene Version
- WoltLab Suite 5.2
In ACP - General - Page - Custom Copyright
What code can be used that will display the current year automatically?
In ACP - General - Page - Custom Copyright
What code can be used that will display the current year automatically?
...................
I'm using this code:
<font size="3" color="white">Copyright © 2008 -
<script type="text/javascript">
document.write(new Date().getFullYear());
</script> My Forum</font>
When I click submit I get a redirect to page with the below error. How to fix?
ZitatForbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Simply use {'Y'|date} within the language variable or template.
Simply use {'Y'|date} within the language variable or template.
Thanks. I need more detailed explanation how to implement this.
Just insert {TIME_NOW|date:"Y"} in the template at the location where you want the current year to show up. It is that simple
I'm using plugin Custom Copyright. It doesn't work there.
Which template should I insert it in?
I'm customized the language phrase wcf.page.copyright and entered the following in Custom Value
<a href="https://www.woltlab.com" rel="nofollow"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>Powered by <strong>WoltLab Suite™{if SHOW_VERSION_NUMBER} {@WCF_VERSION}{/if}</strong></a>
<br />
<a href="https://www.my-Site.com"> © 2001 – <script language="javascript" type="text/javascript">
var today = new Date()
var year = today.getFullYear()
document.write(year)
</script> <strong>My Site</strong></a>
Darklord You can greatly simplify your code:
<script language="javascript" type="text/javascript">
var today = new Date()
var year = today.getFullYear()
document.write(year)
</script>
Can be written with the same effect as:
The type is not required, because text/javascript is the default value anyway. language="javascript" is useless too, it has no effect. On top of this, these var declarations will polute the global namespace and and possibly even overwrite (!) existing variables of the same name. The above code is not only much smaller, it also prevents potentially problems.
Just insert {TIME_NOW|date:"Y"} in the template at the location where you want the current year to show up. It is that simple
I don't understand these instructions. Please explain.
{TIME_NOW|date:"Y"} is a tiny bit of code that is executed on the server and will print the current year. Just replace your entire <script> block with this and you're done.
Alexander Ebert when I insert {'Y'|date} in configuration - general - Custom Copyright - copyright text it displays in the front end as {'Y'|date} not the year.
Oh, I thought you simply modified the phrase. A plugin with a custom input for this is pretty much like reinventing the wheel…
Oh, I thought you simply modified the phrase.
How do I modify the phrase? Which phrase?
Oh, I thought you simply modified the phrase. A plugin with a custom input for this is pretty much like reinventing the wheel…
Well my friend, I edited the phrase wcf.page.copyright inserted {'Y'|date} and the whole site crashed. I can't even get into the backend to change it back to what it was. Will need to open a ticket now. Unless you can tell me which table to edit in the database. Not cool..
I'm sorry, the correct code is this: {TIME_NOW|date:"Y"}
I'm sorry, the correct code is this: {TIME_NOW|date:"Y"}
Works perfect thank you.
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!