Hide records during Summer Months, then reveal once summer has ended and repeats annually

3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 11, 2011   (RSS)

By Zicky - August 10, 2011 - edited: August 11, 2011

I'm building a website that list 800 school schedules.

I need to be able to hide records for 700 of the schools when the month of July rolls around. The 700 schools will remain hidden until Sept starts, at which time the 700 schools will reappear in the list.

I also need to hide the remaining 100 schools of the total 800 schools when the month of August rolls around, then reveal the 100 schools in the list once Sept. rolls around for a total of 800 schools listed.

I then need this to function for every year going forward in the same manner.

Is it possible to create a feature like this that is automated som my client doesn't have to show/hide 800 schools every year using a hidden check box field?

I'm not even sure where to start to build something like this, but I was thinking I'd start with assigning the first 700 to a check box filed called GroupA then assign the remaining 100 schools to GroupB.

From there try to write some kind of string that would hide GroupA for the Months of July and August. then another string that would hide GroupB for the month of August.

Anyone have any suggestions where to begin and if this is even possible?

Thanks, Zick

Re: [zick] Hide records on specific Month, then reveal once month has passed and cycles annually

By gkornbluth - August 11, 2011

Hi Zick,

I like the idea of a check box but if all you need is July or not July how about expanding on something like this.
<?php $month = date("n")
// "n" shows current month as a number
?>
<?php if ($month == 7 && $record['dont_show_in_july'] == 0): ?>
foreach loop etc.
<?php endif ?>


Have fun.
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!

Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php