PHP Classes

File: readme.mkd

Recommend this page to a friend!
  Classes of Frank Cauley  >  Publication Date Control  >  readme.mkd  >  Download  
File: readme.mkd
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Publication Date Control
Compute the next date of publications
Author: By
Last change: Update of readme.mkd
Date: 1 month ago
Size: 4,250 bytes


Class file image Download
Event Entry Readme file for Event Entry Class ============================================= This is a class that can be used in a content Management system to generate publication dates and publication issue information. The first version of the class was oriented to a weekly publication that covered events occuring in a particular week. This version includes functions for monthly and quarterly. Semi-weekly is in the five year plan. Here is an example of a page the had it's dates generated by this <a href=" for week of 08-26-2013.htm" target="_blank">class</a> Notice the volume and issue located underneath the blue box at the top.The volume abd issue were generated because the first issue of the newsletter was produced on May 31, 2003. Over in the left column are links to the days in the week's events. The same dates were used to extract the events to include in the newsletter. The script that creates the newsletter automaticaly rolls over on Tuesday to the next week so that work on other parts of the newsletter can begin. Some explanations ----------------- We will be using the term next in this readme file. By next we mean that in the current time we are working on a presentation for the next week, month or quarter. Once that presentation is published, we will be working on the next presentation. Therfore, reffering to the previous, or edition= -1, we are reffering to something that has allready been published. Edition= +1 reffers to something that will be published after the next publication - a preview. Calling the script ------------------ Use something like the following in your script: < 1. Be sure to include the script file. < 2. $ee= new eventEnty < 3. $ee->set_begin_publication_date($date_begin); $date_begin in the form mm/dd/yy < (the date that the publication first started publishing) < 4. $date_arrray=$ee->getNextWeekDay("Mon") < or whichever day of the week your publication will be published < e.g. "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" < You can also add a second parameter after a comma indicating which < week you are going to publish. -1 indicates last week, +1 is this week < which is the default, or +2 to get the week after. < 4. The $date_array will contain the following dates: < * date_begin in the form yyyy-mm-dd < *date_end in the form yyyy-mm-dd < *pubdate in the form November 26, 2012 < *pubdate1 in the form Mon. Nov. 26 Events < *pubdate2 in the form Tue. Nov. 27 Events < *pubdate3 in the form Wed. Nov. 28 Events < *pubdate4 in the form Thu. Nov. 29 Events < *pubdate5 in the form Fri. Nov. 30 Events < *pubdate6 in the form Sat. Dec. 1 Events < *pubdate7 in the form Sun. Dec. 2 Events < *selectdate1 in the form 2012-11-26 < *selectdate2 in the form 2012-11-27 < *selectdate3 in the form 2012-11-28 < *selectdate4 in the form 2012-11-29 < *selectdate5 in the form 2012-11-30 < *selectdate6 in the form 2012-12-01 < *selectdate7 in the form 2012-12-02 Simpletest script included in this version. ------------------------------------------- In order to run these script, you would need to download the required files from The following is a description of the tests. In all of the tests except the last one we are setting the test date to December 29, 2012. This overides the system date, which is used by the class to calculate dates, so that the test assertion values would not have to be changed each time the test was run. We are testing the logic of the class. When changes to the class are made, we can run the tests to make sure that every thing still works. Note the intervening dates for a period are only generated for weeks. all the tests verify that dates returned from the class are still valid. 1. Tests weekly dates for what was the upcoming week as of December 29, 2012. 2. Tests weekly dates for the week preceedimg December 29, 2012. 3. Tests weekly dates for the week after the upcoming week. 4. Tests monthly dates for the upcoming month as of December 29, 2012. 5. Tests quaurterly dates for upcoming quarter. 6. Tests quarterly dates for the third quarter of 2012 by setting the test date back to June 29, 2012.