PDA

View Full Version : Need Different Day Page Script



Moh
27-09-2006, 05:38 PM
Well i need a script where the page is different for each day of the week.
Its for our DJ Panel Timetable, and I will find it realy usefull.
+ Rep for first person to help :D

nets
27-09-2006, 06:00 PM
<script type="text/javascript">
<!--

//Sunday
var d0 = new Array('Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John');

//Monday
var d1 = new Array('Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John');

//Tuesday
var d2 = new Array('Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John');

//Wednesday
var d3 = new Array('Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John');

//Thursday
var d4 = new Array('Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John');

//Friday
var d5 = new Array('Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John');

//Saturday
var d6 = new Array('Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John', 'Bob', 'Dave', 'Mike', 'John');

var dObj = new Date()
var day = dObj.getDay()
eval('var times = d'+day+';');

for(i=0; i<24; i++) {
ti = i;
if(i<10) ti = '0'+i;
document.write(ti+':00 - '+times[i]+'<br/>');
}

-->
</script>
Haven't tested, but it should solve your problem.

Colin-Roberts
27-09-2006, 06:32 PM
i needed it also but now i forgot what for. thanx josh

Moh
27-09-2006, 06:55 PM
I Mean like a different page. Like Monday - http://url.com/monday.php
Tuesday - http://url.com/tuesday.php

nets
27-09-2006, 07:01 PM
I Mean like a different page. Like Monday - http://url.com/monday.php
Tuesday - http://url.com/tuesday.php
The script I posted will do what you're asking for, but if you're just looking for a simple PHP script:


<? print file_get_contents(date('D').'.txt'); ?>

"Mon.txt" to "Sun.txt" containing your HTML for those days.

Moh
27-09-2006, 07:17 PM
The script I posted will do what you're asking for, but if you're just looking for a simple PHP script:


<? print file_get_contents(date('D').'.txt'); ?>

"Mon.txt" to "Sun.txt" containing your HTML for those days.
where do I put that, and does it have to be txt ?

:James:
27-09-2006, 07:23 PM
where do I put that, and does it have to be txt ?

<? print file_get_contents(date('D').'.FILE-EXTENSION'); ?> Just change the 'FILE-EXTENSION' to what ext you want it to be :)

Moh
27-09-2006, 07:36 PM
can some 1 post the full script, where all i have to do is put in the URL plz :D

:James:
27-09-2006, 07:38 PM
can some 1 post the full script, where all i have to do is put in the URL plz :D
It's been posted by joshuar- ;)

Moh
27-09-2006, 07:43 PM
It's been posted by joshuar- ;)
so that i can add the urls, it keeps coming up with times

Colin-Roberts
27-09-2006, 08:52 PM
<? print file_get_contents(date('D').'.htm'); ?>

nets
27-09-2006, 09:54 PM
It's been posted by joshuar- ;)
That's someone else, lol.

Moh
28-09-2006, 05:23 PM
where does
<? print file_get_contents(date('D').'.txt'); ?>
go ?

What does it replace? I can do all the rest, but dont know where to add it :S

RobbiePwnage
28-09-2006, 05:45 PM
Make a file called timetable.php and in it place



<? print file_get_contents(date('D').'.php'); ?>


Then on your navigation have it go to timetable.php e.g.



<a href="timetable.php" target="main">Timetable</a>

Moh
28-09-2006, 06:02 PM
can some one post the FULL SCRIPT where I can edit it, not things i need to add :S
it wont work for me, im doing sumin wrong, so can some 1 pls post the FULL Script

Want to hide these adverts? Register an account for free!