Web Design Forum: Day Based Content - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Day Based Content Rate Topic: -----

#1 User is offline   tomwebber 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 28-July 09
  • Reputation: 0

Posted 30 July 2009 - 03:51 PM

Hello Everyone,

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
0

#2 User is offline   Meow 

  • Advanced Member
  • PipPipPip
  • View gallery
  • Group: Members
  • Posts: 476
  • Joined: 06-April 09
  • Reputation: 12
  • Gender:Female
  • Location:Rugby
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 30 July 2009 - 04:04 PM

How do yuo want to display it, e.g. just in words, or more graphically, like a calendar? Is it for just the day, or a week/month/year listing?

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?
0

#3 User is offline   AdamConder 

  • Dedicated Member
  • PipPip
  • View gallery
  • Group: Members
  • Posts: 205
  • Joined: 18-May 09
  • Reputation: 9
  • Gender:Male
  • Location:Newcastle, UK
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 30 July 2009 - 04:07 PM

Is this something your after:
http://www.jigowatt....orest/calendar/
0

#4 User is offline   tomwebber 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 28-July 09
  • Reputation: 0

Posted 30 July 2009 - 05:58 PM

View Postcinnamondm, on 30 July 2009 - 04:04 PM, said:

How do yuo want to display it, e.g. just in words, or more graphically, like a calendar? Is it for just the day, or a week/month/year listing?

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:

Posted Image

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.
0

#5 User is offline   AdamConder 

  • Dedicated Member
  • PipPip
  • View gallery
  • Group: Members
  • Posts: 205
  • Joined: 18-May 09
  • Reputation: 9
  • Gender:Male
  • Location:Newcastle, UK
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 30 July 2009 - 07:10 PM

Aghh I remember seeing this on a DJ site before, you could achieve this by inserting a form into a database with a field as date?

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

0

#6 User is offline   AdamConder 

  • Dedicated Member
  • PipPip
  • View gallery
  • Group: Members
  • Posts: 205
  • Joined: 18-May 09
  • Reputation: 9
  • Gender:Male
  • Location:Newcastle, UK
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 30 July 2009 - 07:23 PM

View PostAdamConder, on 30 July 2009 - 07:10 PM, said:

Aghh I remember seeing this on a DJ site before, you could achieve this by inserting a form into a database with a field as date?

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 :D There's more experienced people on here who will know!
0

#7 User is offline   tomwebber 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 28-July 09
  • Reputation: 0

Posted 31 July 2009 - 12:06 AM

View PostAdamConder, on 30 July 2009 - 07:23 PM, said:

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 :D There's more experienced people on here who will know!


I wouldn't know where to start! haha! Is there a way of implementing a already existing system, Like Google Calender as cinnamondm said?
0

#8 User is offline   Meow 

  • Advanced Member
  • PipPipPip
  • View gallery
  • Group: Members
  • Posts: 476
  • Joined: 06-April 09
  • Reputation: 12
  • Gender:Female
  • Location:Rugby
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 31 July 2009 - 06:46 AM

You may be able to achieve what you want with the Google calendar, but have not actually tried to know for sure.

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.
0

#9 User is offline   Jake151 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 261
  • Joined: 14-March 09
  • Reputation: 9
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 01 August 2009 - 02:37 PM

If you want it day by day and its not dynamic so each Monday is the same you could do that.

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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users