PHP Classes

Publication Date Control: Compute the next date of publications

Recommend this page to a friend!
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (2 months ago) RSS 2.0 feedStarStarStar 45%Total: 363 This week: 1All time: 6,876 This week: 571Up
Version License PHP version Categories
event-entry 1.0GNU Free Document...3.0PHP 5, Time and Date
Description 

Author

This class can compute the next date of publications

It takes a given day of the week on which a publication should occur and calculates the date of next publication.

The class can also compute the volume number and issue given the date of the beginning publication.

Innovation Award
PHP Programming Innovation award winner
December 2012
Winner
Periodic publications obey certain rules that determine not only the date of each publication, but also the numbering of issues and volumes.

This class provides a solution that can automatically calculate the dates and volume numbers of any issue.

Manuel Lemos
Picture of Frank Cauley
  Performance   Level  
Name: Frank Cauley is available for providing paid consulting. Contact Frank Cauley .
Classes: 2 packages by
Country: United States United States
Age: 91
All time rank: 1732249 in United States United States
Week rank: 420 Up49 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

Details

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="http://www.peggyjostudio.net/Events 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 simpletest.org. 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.

  Files folder image Files  
File Role Description
Plain text file evententry.php Class Publication date control
Accessible without login Plain text file license.txt Lic. License text
Plain text file PHPClassesClass_evententry.php Class Class source
Accessible without login HTML file readme.html Doc. Documentation
Accessible without login Plain text file readme.mkd Data Auxiliary data
Accessible without login Plain text file testPublishDate.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 83%
Total:363
This week:1
All time:6,876
This week:571Up
User Ratings User Comments (1)
 All time
Utility:75%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:-
Tests:-
Videos:-
Overall:45%StarStarStar
Rank:3335
 
good
11 years ago (harry)
60%StarStarStarStar