Reprezent!
- Started
- Last post
- 14 Responses
- 187LockDown
I would like to represent the date on a site with JavaScript. Just like NT. But with different font of course. and alot smaller images.
Im using ASP, is there an easy way to do this. Im guessing I put the image paths into the DB in Fields that represent each Weekday, day. month & Year. But how do I split the date to get 4 different values used to sort a recordset?
- 187LockDown0
Or in PHP I don't care Im desperate.
- altamont0
sumthin like this:
date ("D, F jS Y");
that's the PHP way...
- altamont0
sorry..i should have read better...i'd create an array with the images then rock and "if else" loop to coincide with the current date
- smokie0
img src=.gif
img src=.gif
img src=.gif
:)¬
- smokie0
errrr, ok, try again
Response.Write ""
- smokie0
FUCK IT
- jslr0
Here's a script I wrote to deal with numeric dates. I created n image for each number ("01.gif", "02.gif" and so on) and stored them in the same folder. Widths and sizes are variable, so I used a GetImageSize.
$date=date("d.m.y");
$numbers=explode(".", $date);
$day="$numbers[0].gif";
$dsize= GetImageSize($day);
$dwidth=$dsize[0];
$month="$numbers[1].gif";
$msize= GetImageSize($month);
$mwidth=$msize[0];
$year="$numbers[2].gif";
$ysize= GetImageSize($year);
$ywidth=$ysize[0];echo "";
echo "";
echo "";Wrote it a while back, so it's pro'lly not as efficient as it could be, but it should be a start. Should be easy to work up to month names - just make the images and name them to match up contents of the array.
Let me know if you want me to make more sense... :)
- jslr0
ooops. html stuff got eaten. Each echo should write an image tag:
img src="$day" width="$dwidth"
...for day, month and year accordingly.
hth...
- 187LockDown0
Sorry it took me so long to reply.
Is there any way you could put iin a .txt file aand post the code. I understand it, but I think something is missing from the orig code you posted.
- jslr0
gimme a minute. I'll find the script again and mail it sometime this morning...
- 187LockDown0
cool thanks
- 187LockDown0
jslr yustill around?
- 187LockDown0
OK if anyone is interested, which I take it that no one is. from the response. Here is what I figured out.
Very simple script to display the date as images. Code is here, since NT does nto allow posting of code:
http://breaks247.com/php/dateUsi…
- 187LockDown0
Just View Source, I dont feel like updating the text file.