Day Based Content
#1
Posted 30 July 2009 - 03:51 PM
I want to display a schedule on a site I'm working on, But obviously this changes with everyday that passes. Is there any scripting that will allow me to do this?
Cheers,
Tom
#2
Posted 30 July 2009 - 04:04 PM
You could look at pulling in via an XML feed of some sort, at embedding Google Calendar or one of the many event calendar style scripts around which you could probably adapt for your needs?
#4
Posted 30 July 2009 - 05:58 PM
cinnamondm, on 30 July 2009 - 04:04 PM, said:
You could look at pulling in via an XML feed of some sort, at embedding Google Calendar or one of the many event calendar style scripts around which you could probably adapt for your needs?
I want it to display like this:

So essentially just some styled up text. It's just the content inside the box that the script would have to generate. Someone has mentioned XML before but I wasn't usre how to implement it.
#5
Posted 30 July 2009 - 07:10 PM
Then grabbing all of the dates and echoing them into a unordered list etc?
Thats all I could code for you XD I wouldn't know how to implement an auto delete depending on date etc?
This could be done using MySql and PHP
This post has been edited by AdamConder: 30 July 2009 - 07:22 PM
#6
Posted 30 July 2009 - 07:23 PM
AdamConder, on 30 July 2009 - 07:10 PM, said:
Then grabbing all of the dates and echoing them into a unordered list etc?
Thats all I could code for you XD I wouldn't know how to implement an auto delete depending on date etc?
This could be done using MySql and PHP
Something like this:
<?php
$connect = mysql_connect("localhost", "username", "password"); // Connecting to the datatbase
$select_db = mysql_select_db("databasenamehere"); // Something like 'onair'
$query = mysql_query("SELECT name, time FROM onnow ORDER BY sortdate"); // Not sure on the date sorry, you will have to look at this on google.
echo "<div id=\"now\">";
while ($row = mysql_fetch_array($query)) {
echo "<li>".$row['name']."</li>"; // who is on
echo "<li>".$row['time']."</li"; // the time would be another field to contain the time for the visual link.
}
echo "</div>";
?>Just quickly done this up and haven't tested it so don't know if works
#7
Posted 31 July 2009 - 12:06 AM
AdamConder, on 30 July 2009 - 07:23 PM, said:
<?php
$connect = mysql_connect("localhost", "username", "password"); // Connecting to the datatbase
$select_db = mysql_select_db("databasenamehere"); // Something like 'onair'
$query = mysql_query("SELECT name, time FROM onnow ORDER BY sortdate"); // Not sure on the date sorry, you will have to look at this on google.
echo "<div id=\"now\">";
while ($row = mysql_fetch_array($query)) {
echo "<li>".$row['name']."</li>"; // who is on
echo "<li>".$row['time']."</li"; // the time would be another field to contain the time for the visual link.
}
echo "</div>";
?>Just quickly done this up and haven't tested it so don't know if works
I wouldn't know where to start! haha! Is there a way of implementing a already existing system, Like Google Calender as cinnamondm said?
#8
Posted 31 July 2009 - 06:46 AM
Assuming you have set up a calendar already (which if you haven't is extremely easy to do) visit this link on how to embed it into a page. When in the 'Customise settings' area, set your calendar to the Agenda view, which is for a day view.
#9
Posted 01 August 2009 - 02:37 PM
I am going to adapt the script that AdamConder posted
<?php
$connect = mysql_connect("localhost", "username", "password"); // Connecting to the datatbase
$select_db = mysql_select_db("databasenamehere"); // Something like 'onair'
$day = date("l"); //This will take the day so Monday, Tuesday, ect ect full name with a capitol
$query = mysql_query("SELECT name, time FROM onnow WHERE day = '$day' ORDER BY time"); //This will take the name and time from the DB where the day is equal to the day that the date(); function has returned
echo "<div id=\"now\">";
while ($row = mysql_fetch_array($query)) {
echo "<li>".$row['name']."</li>"; // who is on
echo "<li>".$row['time']."</li"; // the time would be another field to contain the time for the visual link.
}
echo "</div>";
?>
For the day field in the DB you would just manually put in (Unless you have a CMS then enter it through that) the day e.g. Monday and this should work.
This was straight off the top of my head it should work but like you I am also learning.
Jake151
Help



















