//If a user is not logged in require $baseDir . 'includes/templates/public_left_menu.php'; } else { //If a user is logged in require $baseDir . 'includes/templates/left_menu.php'; } ?> <div class="content-wrapper"> <?php ##################################################### /** * Get the data for the calendar */ //Instantiate the Calendar Class depending on page parameters $UserCalendars = new UserCalendars($_GET["m"], $_GET["y"], $Database); //Variables for the calender $empty = $UserCalendars->getEmpty(); //The number of empty boxes at start of the month $month = $UserCalendars->getMonth(); //The numeric representation of the month $year = $UserCalendars->getYear(); //The numeric representation of the year $total = $UserCalendars->getTotal(); //The total number of days for the specified month $calendar = $UserCalendars->getCalendar($_GET["cid"]); if (!isset($Feed)) { $Feed = new Feed($Database); } //Instantiate the feed class $feed = $Feed->getUserCalendarFeed($month, $year, $_GET["cid"]);
//The html for the heading of the page ?> <div class="wrapper"> <?php require $baseDir . 'includes/templates/left_menu.php'; /*Display the default left menu*/ ?> <div class="content-wrapper" style="text-align:left;"> <div style="text-align:center;" id="feed-content"> <?php //Initialize the class for user calendars if it hasn't been already if (!isset($UserCalendars)) { $UserCalendars = new UserCalendars(date('m'), date('Y'), $Database); } /** * Switch the type of calendar feed based on the page parameter that is * supplied. If none then display the default */ switch ($_GET["type"]) { case 'popular': //Get the most popular calendars foreach ($UserCalendars->getTop20() as $calendar) { //Cycle through the array returned by the query require $baseDir . 'includes/templates/calendar_preview_box.php'; } break; case 'public': require $baseDir . 'includes/templates/public_calendar.php';
<div class="clear"></div> </div> <!--End Edit Profile Hidden Forms--> <?php } ?> <strong>Calendars (<?php echo $profile["num_calendars"]; ?> )</strong> <div style="margin-top:5px;"> <?php if (!isset($UserCalendars)) { $UserCalendars = new UserCalendars(date('m'), date('Y'), $Database); } $calendarCount = 0; //Display a list of the calendars created by the user foreach ($UserCalendars->getUserCalendars($profile["id"]) as $calendar) { require $baseDir . 'includes/templates/calendar_preview_box.php'; $calendarCount++; } if ($calendarCount == 0) { echo '<br/><em>This user hasn\'t created any calendars yet</em>'; } ?> <div class="clear"></div> </div> </div>
</div> <div class="clear"></div> </div> <div class="popup-contain" style="text-align:center;"> <form action="" method="post" style="padding:15px;"> <input type="text" class="post-input" name="calendar_title" style="width:375px;" placeholder="Calendar Title" required /> <br/> <textarea name="calendar_description" class="post-input" style="width:375px;max-width:375px;height:70px;" placeholder="Calendar Description (100 characters)" required></textarea> <br/> <input type="submit" value="Add Calendar" name="add_calendar_submit" class="a-button" /> </form> </div> </div> <?php $UserCalendars = new UserCalendars(date('m'), date('Y'), $Database); $calendarCount = 0; foreach ($UserCalendars->getUserCalendars($user["id"]) as $calendar) { require $baseDir . 'includes/templates/calendar_preview_box.php'; $calendarCount++; } if ($calendarCount == 0) { echo '<div style="background:#062327;color:#fff;padding:5px 25px;float:left;margin:5px 20px;">Before you can make a post you must <a href="#add-calendar-box" rel="popup" style="font-weight:bold;color:#fff;" class="no-underline">create</a> a calendar</div>'; } ?> <div class="clear"></div> </div> </div> <?php require $baseDir . 'includes/templates/page_footer.php';