baonest All American 47902 Posts user info edit post |
i'm looking for a code that updates a website. instead of everytime i login to update something and change the thing to "updated 5/9/08" or something like that, is there a code i can insert that it just updates each day.
so tomorrow it will say "updated 5/10/08"
i was told that there it should auto update everytime i login, but it doesnt. just the certain page is "updated" and it doesnt even say it on that page.
thanks 5/9/2008 12:08:06 PM |
Golovko All American 27023 Posts user info edit post |
if you aren't really performing updates and just want the time stamp to say the current date just cheat and use php or javascript to output the current date. 5/9/2008 12:09:09 PM |
DirtyMonkey All American 4269 Posts user info edit post |
in php, you would just put this in your page.
echo date('n/j/y');
but you might as just well say "Today's date is 5/9/08". do you really want to say "my page was updated" even when it hasn't been?
[Edited on May 9, 2008 at 12:13 PM. Reason : ^ or use javascript]
[Edited on May 9, 2008 at 12:13 PM. Reason : FUCK YOU CRAZY CODE]5/9/2008 12:12:27 PM |
baonest All American 47902 Posts user info edit post |
well the thing is i have actually been updating it for the past like 3 weeks.
and probably for the next 2-3 weeks to come. ^,^^ sound like a good idea 5/9/2008 12:19:07 PM |
qntmfred retired 40726 Posts user info edit post |
i used something like this several years ago to display the ACTUAL last file update date/time. not sure if it's still a well accepted way to do it, but here ya go
http://dionysia.org/software/lastupdated/ssi-method.html 5/9/2008 12:27:15 PM |
evan All American 27701 Posts user info edit post |
Quote : | "echo date('n/j/y'); " |
5/9/2008 12:40:21 PM |
Prospero All American 11662 Posts user info edit post |
^^i used to do that back in the day when i did web design... by far the easiest way to update the "updated last" date. 5/9/2008 12:41:49 PM |
baonest All American 47902 Posts user info edit post |
ok, kinda new here at this stuff.
so all i type in is echo date('n/j/y');
im using joomla BTW 5/9/2008 12:44:34 PM |
evan All American 27701 Posts user info edit post |
well with a CMS it's a bit different
is it a field you change? or what?
easiest way would be to edit the template your site uses and place something in the footer
echo date('n/j/y'); will echo the current date
if it's not already inside php brackets, do the following:
echo date('n/j/y'); ?> 5/9/2008 12:46:08 PM |
baonest All American 47902 Posts user info edit post |
nice
thanks all 5/9/2008 12:54:53 PM |
baonest All American 47902 Posts user info edit post |
nice. anyway to do it like weekly, instead of every day. every day doesnt hurt. but weekly is more practicle 7/15/2008 7:56:07 AM |
DirtyMonkey All American 4269 Posts user info edit post |
echo date('n/j/y', strtotime('last monday')); // outputs 7/14/08 as of this post
substitute 'monday' for whatever day you want this to be updated on. i'm thinking this might break if it is the actual day of the 'update' so a cheap way to get around that would be:
if (date('w') == 1) { echo date('n/j/y'); } else { echo date('n/j/y', strtotime('last monday')); }
or you can do some shorthand:
echo date('w') == 1 ? date('n/j/y') : date('n/j/y', strtotime('last monday'));
7/15/2008 2:05:11 PM |