corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » HTML auto update code for company founded years


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author HTML auto update code for company founded years
deano87
Member

Registered: 21st Oct 06
Location: Bedfordshire Drives: Ford Fiesta
User status: Offline
14th Feb 14 at 12:23   View User's Profile U2U Member Reply With Quote

I look after our company website which is in the process of being upgraded to Joomla 2.5. I suspect this will be supported in that version other than our current v1.5.

We have a page on our website that reads this:

quote:
The Storage Equipment Centre (SEC) Ltd was originally formed in 1998. It has grown to become one of the UK's largest independent suppliers of warehouse storage solutions, pallet racking systems and commercial interior fit out & refurbishment works.

Over the past 14 years, the company has grown from a select few warehouse fit out experts to a 30 strong team of people dedicated to supplying the highest levels of service & quality installations.



Now someone has pointed out 1998 was 15/16 years ago, so the 14 years was correct when the site was first published.

Is there any code or plugin that can be used to autoupdate the 14 years on a certain anniversary?

(Excuse the poor copy as this page is also going to be updated in the future once our v2.5 site is live).

Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
14th Feb 14 at 12:49   View Garage View User's Profile U2U Member Reply With Quote

you could do it in php easily if you can output in php..have a look at the date function the rest is simple maths

[Edited on 14-02-2014 by Steve]
deano87
Member

Registered: 21st Oct 06
Location: Bedfordshire Drives: Ford Fiesta
User status: Offline
14th Feb 14 at 12:57   View User's Profile U2U Member Reply With Quote

I'm not techy enough to understand PHP

Not a major issue. Set a reminder in my diary for 5th January 2015 to update it, if the copy is the same then
Nismo
Member

Registered: 12th Sep 02
User status: Offline
14th Feb 14 at 13:57   View User's Profile U2U Member Reply With Quote

As Steve said PHP is the answer, failing that I would just change the text to say.

"Since the company was formed it has grown from..."

Or something along those lines.
Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
14th Feb 14 at 14:02   View Garage View User's Profile U2U Member Reply With Quote

As per reply above, clever phrasing is going to be a much better/easier solution than clever coding.


Dom
Member

Registered: 13th Sep 03
User status: Offline
14th Feb 14 at 14:38   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Balling
As per reply above, clever phrasing is going to be a much better/easier solution than clever coding.


I'd word it differently but you could just use JS on the page -
quote:
<script type="text/javascript">document.write((new Date().getFullYear()) - 1998);</script>


[Edited on 14-02-2014 by Dom]
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
14th Feb 14 at 17:54   View Garage View User's Profile U2U Member Reply With Quote

If you're using JS, have a fall back.

If you've got spare processor cycles, use PHP.

If you have PHP hosting but can't work it out, code snippet would be easy.

I personally wouldn't use client side where I can avoid it.
ed
Member

Registered: 10th Sep 03
User status: Offline
14th Feb 14 at 21:24   View User's Profile U2U Member Reply With Quote

<?php echo date('Y') - 1998; ?>

Though I'd guess that Joomla will prevent you from putting inline PHP into a page so you might not be able to do it that way.
deano87
Member

Registered: 21st Oct 06
Location: Bedfordshire Drives: Ford Fiesta
User status: Offline
14th Feb 14 at 22:18   View User's Profile U2U Member Reply With Quote

Ok thanks guys

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Police Fu**ed Me corsa02 General Chat 30 1001
22nd Aug 05 at 15:42
by dave17
 
HELP needed [now with link...oops] 16vOllie Geek Day 14 266
24th Jun 07 at 11:53
by 16vOllie
 
Centering windows in HTML Butler Geek Day 10 498
23rd Jul 09 at 14:59
by JohnnyR
 
Apache/PHP Installation Tom J Geek Day 13 720
11th Nov 12 at 09:39
by ed
 
GTA 5: PS3 Online Tomnova16 Geek Day 218 8000
21st Mar 14 at 21:23
by IvIarkgraham
 

Corsa Sport » Message Board » Off Day » Geek Day » HTML auto update code for company founded years 30 database queries in 0.0111020 seconds