示例#1
0
function display_page_content()
{
    $array_name = requestIdParam();
    $value = getRequestVarAtIndex(3);
    $_SESSION['blaster'][$array_name] = $value;
    print_r($_SESSION['blaster']);
}
示例#2
0
function display_page_content()
{
    $section_name = requestIdParam();
    $section = Sections::FindByName($section_name);
    $item_name = getRequestVarAtIndex(3);
    $item = Items::FindByName($item_name);
    $gallery = $item->getGallery();
    ?>

		<h1><?php 
    echo $item->display_name;
    ?>
</h1>
<?php 
    $next_item = $item->findNext($section);
    $prev_item = $item->findPrev($section);
    if ($prev_item) {
        echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $prev_item->name) . "\">previous</a>\n";
    }
    if ($next_item) {
        echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $next_item->name) . "\">next</a>\n";
    }
    echo $item->content;
    foreach ($gallery->get_photos() as $photo) {
        echo "<img src=\"/" . $photo->getPublicUrl() . "\" /><br />";
    }
}
示例#3
0
function display_page_content()
{
    $the_email = requestIdParam();
    $the_list = getRequestVarAtIndex(3);
    $list = NLLists::FindById($the_list);
    $email = NLEmails::FindByEmail($the_email);
    $email->detach($list);
}
示例#4
0
function display_page_content()
{
    $listname = getRequestVarAtIndex(2);
    switch ($listname) {
        case "portfolio":
            foreach ($_POST as $ordered_objects => $order_value) {
                // splits up the key to see if we are ordering a section, item or ignoring a portfolio area
                $ordered_parts = explode("_", $ordered_objects);
                // NOTICE: I have learned that when there are portfoli orphans, this reordering script breaks. I removed the hidden fields in the Orphans section, but check in on that if you notice reordering breaking again.
                //$debug = "";
                if ($ordered_parts[0] != "PortFolioAreas") {
                    if ($ordered_parts[0] == "SectionOrder") {
                        $section = Sections::FindById($ordered_parts[1]);
                        $section->display_order = $order_value;
                        $section->save();
                        //$debug .= $section->display_name." updated";
                    } else {
                        $section = Sections::FindById($ordered_parts[0]);
                        $item = Items::FindById($ordered_parts[1]);
                        $item->updateOrderInSection($section, $order_value);
                        //$debug .= $item->display_name." updated";
                    }
                }
                //setFlash( "<h3>".$debug."</h3>" );
                //setFlash( "<h3>".var_export( $_POST, true )."</h3>" );
            }
            break;
        case "areaspages":
            foreach ($_POST as $ordered_objects => $order_value) {
                // splits up the key to see if we are ordering a section, item or ignoring a portfolio area
                $ordered_parts = explode("_", $ordered_objects);
                //$debug = "";
                if ($ordered_parts[0] == "AreaOrder") {
                    $area = Areas::FindById($ordered_parts[1]);
                    $area->display_order = $order_value;
                    $area->save();
                    //$debug .= "$area->display_name updated";
                } else {
                    if ($ordered_parts[0] == "SubPage") {
                        $page = Pages::FindById($ordered_parts[1]);
                        $page->display_order = $order_value;
                        $page->save();
                        //$debug .= "$page->display_name sub page updated";
                    } else {
                        $area = Areas::FindById($ordered_parts[0]);
                        $page = Pages::FindById($ordered_parts[1]);
                        $page->updateOrderInArea($area, $order_value);
                        //$debug .= "$page->display_name updated in $area->display_name";
                    }
                }
            }
            //setFlash( "<h3>".$debug."</h3>" );
            //setFlash( "<h3>".var_export( $_POST, true )."</h3>" );
            break;
    }
}
示例#5
0
function display_page_content()
{
    $array_name = requestIdParam();
    if (strstr(getRequestVarAtIndex(3), ",")) {
        $value = array_slice(explode(",", getRequestVarAtIndex(3)), 0, -1);
    } else {
        $value = getRequestVarAtIndex(3);
    }
    $_SESSION['blaster'][$array_name] = $value;
    //print_r($_SESSION['blaster']);
}
示例#6
0
function display_page_content()
{
    $hash = requestIdParam();
    $email = getRequestVarAtIndex(3);
    $query = "SELECT * FROM mailblast WHERE hash = '{$hash}';";
    if ($result = mysql_query($query, MyActiveRecord::Connection())) {
        echo str_replace("{{-email-}}", $email, mysql_result($result, 0, 'content'));
    } else {
        redirect("/");
    }
}
示例#7
0
function display_page_content()
{
    //$images = Images::FindAll();
    //$images = array_reverse($images);
    $pagenum = getRequestVarAtIndex(2);
    $imagesperpage = 12;
    $lastpage = Images::FindLastPage($imagesperpage);
    $images = Images::FindByPagination($imagesperpage, $pagenum);
    $numbernav = "";
    if (count($images) > 0) {
        $pagenum = $pagenum == "" ? 1 : $pagenum;
        if ($pagenum > 1) {
            $numbernav .= "<a class=\"pageprev\" href=\"" . get_link("admin/list_images/" . ($pagenum - 1)) . "\">Newer</a>";
        }
        $counter = 1;
        while ($counter <= $lastpage) {
            $thispage = $counter == $pagenum ? " class=\"thispage\"" : "";
            $numbernav .= "<a{$thispage} href=\"" . get_link("admin/list_images/" . $counter) . "\">{$counter}</a>";
            $counter++;
        }
        if ($pagenum != $lastpage) {
            $numbernav .= "<a class=\"pagenext\" href=\"" . get_link("admin/list_images/" . ($pagenum + 1)) . "\">Older</a>";
        }
    }
    ?>

	<div id="edit-header" class="imagenav">
		<div class="nav-left column">
    		<h1>Choose an Image to Edit</h1>
		</div>
		<div class="nav-right column">
            <a href="<?php 
    echo get_link("admin/add_image");
    ?>
" class="hcd_button">Add a New Image</a>
		</div>
		<div class="clearleft"></div>
	</div>
	
	<div class="page-numbers">
		<?php 
    echo $numbernav;
    ?>

	</div>
<?php 
    if (count($images) > 0) {
        ?>

	<div id="imageDisplay">
<?php 
        foreach ($images as $image) {
            echo "\t\t<div class=\"image\"><a href=\"" . get_link("/admin/edit_image/{$image->id}") . "\">";
            //$image->displayThumbnail();
            echo '<img src="' . get_link('images/view/' . $image->id) . '" alt="' . $image->name . '">';
            echo "</a>{$image->name}</div>\n";
        }
        ?>
	
		<div class="clearleft"></div>
	</div>
<?php 
    } else {
        echo '<h3>There are no images yet! <a href="' . get_link("admin/add_image") . '">Add one if you like</a>.</h3>';
    }
    ?>

	<div class="page-numbers">
		<?php 
    echo $numbernav;
    ?>

	</div>

<?php 
}
示例#8
0
 function getDateLink($day, $month, $year)
 {
     if (!isset($this->calendar_id)) {
         $this->calendar_id = 1;
     }
     $events = Events::FindAllForDate($day, $month, $year, $this->calendar_id);
     $return = "";
     foreach ($events as $event) {
         if (!$event->notDate("{$year}-{$month}-{$day}")) {
             // some PHP installations don't like $event->getEventType()->name, so pull it into a variable first
             $type = $event->getEventType();
             $return .= "<a href=\"" . get_link("/" . getRequestVarAtIndex(0) . "/edit_event/{$year}/{$month}/{$event->id}") . "\" class=\"" . slug($type->name) . "\" style=\"border-right:5px solid {$type->color};\">" . $event->title . "</a>";
         }
     }
     return $return;
 }
示例#9
0
function display_page_content()
{
    $image_id = getRequestVarAtIndex(2);
    $image = Images::FindById($image_id);
    //$imagenum = $image->howManyReferencing();
    ?>

	<div id="edit-header" class="imagenav">
		<h1>Edit Image</h1>
	</div>
	
	<form method="POST" id="edit_image" enctype="multipart/form-data">
		<input type="hidden" name="MAX_FILE_SIZE" value="8400000">
		
		<?php 
    //<p><strong>Number of references: <?php echo $imagenum </strong></p>
    ?>
		
		<img src="<?php 
    echo get_link('images/view/' . $image->id);
    ?>
" alt="<?php 
    echo $image->get_title();
    ?>
" />
		<p><span class="hint">The CSS will restrict the display width of this image to a max of 360 pixels wide. Don&rsquo;t worry if it appears smaller than normal. <!--[if IE 6]><br /><b>IE 6 Users: The CSS can only force the image to be 240 pixels high, which for some images, may be larger than normal, resulting in pixellation. </b><![endif]--></span></p>
		
		<!--<p>
			<label for="new_image">Select a new image to replace the current one:</label>
			<input type="file" name="new_image" id="new_image" value="" class="required: true" />
		</p>-->
		
		<p class="display_name">
			<label for="title">Title:</label>
			<?php 
    textField("title", $image->get_title(), "required: true");
    ?>
<br />
			<span class="hint">The Proper &ndash; or Pretty &ndash; name. Spaces, commas and quotes are acceptable. </span>
		</p>
		
		<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
		<p>
			<label for="name">Short Name: </label> 
			<span class="hint">This will be used by the database only and in links. No spaces, commas or quotes please. </span><br />
			<?php 
        textField("name", $image->name, "");
        ?>
		</p>
		<?php 
    }
    ?>
		
		<p>
			<label for="description">Caption:</label>
			<?php 
    textField("description", esc_html($image->description), "");
    ?>
<br />
			<span class="hint">A caption may or may not be used on the front-end display. This field can be left blank.</span>
		</p>
		
		<p><strong>A Trick:</strong> If the caption starts with &ldquo;http://&rdquo;, the system will treat the image as a link (called a &ldquo;hot-link&rdquo;). In this case, the title will become the text for the link, displayed under the image, and the image will be clickable (the cursor will turn into a hand when passed over the image). The image can still be placed to float right or left, or not float at all. </p>
		<p>If you are linking to your own page, use the full URL= <em>http://<?php 
    echo SITE_URL;
    ?>
/thearea/thepage</em>. </p>
		
		
		<div id="edit-footer" class="imagenav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Image" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
			<?php 
    $user = Users::GetCurrentUser();
    if ($user->has_role()) {
        ?>
				
				<p>
					<label for="delete">Delete this image?</label>
					<input name="delete" class="boxes" type="checkbox" value='<?php 
        echo $image->id;
        ?>
' />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this image from the database</span>
				</p>
			<?php 
    }
    ?>
			
			</div>
		</div>
	
    </form>
    
    <script type="text/javascript">
		$().ready(function() {
			$("#edit_image").validate({
				rules : {
					title: "required",
					image: "required"
				},
				messages: {
						title: "Please enter a title for this image<br/>",
						image: "Please select a file<br/>"
					}
			});
		});
	</script>
    
<?php 
}
示例#10
0
 function is_paged()
 {
     return getRequestVarAtIndex() == "blog" && getRequestVarAtIndex(1) == "view" && getRequestVarAtIndex(2) == "page" ? true : false;
 }
示例#11
0
function initialize_page()
{
    // If the user requested the login page but has a bookmarked place to go (or they were logged out while working)
    $optionalredirect = "";
    if (getRequestVarAtIndex(1) != "" && getRequestVarAtIndex(1) != " " && getRequestVarAtIndex(1) != "login") {
        $optionalredirect .= getRequestVarAtIndex(1);
    }
    if (getRequestVarAtIndex(2) != "" && getRequestVarAtIndex(2) != " ") {
        $optionalredirect .= "/" . getRequestVarAtIndex(2);
    }
    if (getRequestVarAtIndex(3) != "") {
        $optionalredirect .= "/" . getRequestVarAtIndex(3);
    }
    if (getRequestVarAtIndex(4) != "") {
        $optionalredirect .= "/" . getRequestVarAtIndex(4);
    }
    if (getRequestVarAtIndex(5) != "") {
        $optionalredirect .= "/" . getRequestVarAtIndex(5);
    }
    if (getRequestVarAtIndex(6) != "") {
        $optionalredirect .= "/" . getRequestVarAtIndex(6);
    }
    if (Users::GetCurrentUser()) {
        // If the user is still logged in and they hit this page, redirect them to the homepage or somewhere else
        redirect("/admin" . $optionalredirect);
    }
    $post_action = "";
    if (isset($_POST['submit'])) {
        $post_action = $_POST['submit'];
    }
    if ($post_action == "Login") {
        $email = $_POST['email'];
        $password = $_POST['password'];
        if ($email == "" || $password == "") {
            setFlash("<h3>Please enter a username and password</h3>");
        } else {
            $user = Users::FindByEmail($email);
            if (is_object($user)) {
                /* Check to see if we are in maintenance mode */
                if (MAINTENANCE_MODE) {
                    if ($user->email != "*****@*****.**") {
                        setFlash("<h3>We are sorry, the site is in maintenance mode right now. Please try to log-in later.</h3>");
                    } else {
                        if ($user->authenticate($password)) {
                            $user->set_ticket();
                            setFlash("<h3>Thank you for logging in during Maintenance Mode, Admin</h3>");
                            redirect(Users::GetRedirect("/admin/" . $optionalredirect));
                        }
                    }
                } else {
                    if ($user->authenticate($password)) {
                        $user->set_ticket();
                        // Backup database on successful Log in
                        $params = @parse_url(MYACTIVERECORD_CONNECTION_STR) or trigger_error("MyActiveRecord::Connection() - could not parse connection string: " . MYACTIVERECORD_CONNECTION_STR, E_USER_ERROR);
                        $backupDatabase = new Backup_Database($params['host'], $params['user'], $params['pass'], trim($params['path'], ' /'));
                        $success = $backupDatabase->backupDatabase(SERVER_DBBACKUP_ROOT, 5) ? 'The database has been archived.' : 'The database archive FAILED.';
                        setFlash("<h3>Thank you for logging in. {$success}</h3>");
                        redirect(Users::GetRedirect("/admin/" . $optionalredirect));
                    } else {
                        $_SESSION[LOGIN_TICKET_NAME] = NULL;
                        setFlash("<h3>User not found, or password incorrect</h3>");
                    }
                }
            }
        }
    }
}
示例#12
0
}
if (getRequestVarAtIndex(5) != "") {
    $optionalredirect .= "/" . getRequestVarAtIndex(5);
}
if (getRequestVarAtIndex(6) != "") {
    $optionalredirect .= "/" . getRequestVarAtIndex(6);
}
$userroles = explode(',', USER_ROLES);
//$userroles = array( "admin", "staff" );
if (!(getRequestVarAtIndex(0) == "admin" && getRequestVarAtIndex(1) == "login")) {
    LoginRequired("/admin/login/" . $optionalredirect, $userroles);
}
$page = get_content_page();
$area = get_content_area();
$user = Users::GetCurrentUser();
$pagename = getRequestVarAtIndex(1);
$pagetitle = $pagename != "" ? ucwords(unslug($pagename)) : "Backend GUI";
$bodyclass = $pagename != "" ? $pagename : "home";
$maintenancemode = MAINTENANCE_MODE ? ' {Maintenance Mode}' : '';
?>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js">
	<head>
		<meta charset="utf-8">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title><?php 
echo $pagetitle . " | " . SITE_NAME;
?>
</title>
		
		<meta name="ROBOTS" content="NOARCHIVE" /><meta name="ROBOTS" content="NOINDEX,NOFOLLOW" /><meta name="Googlebot" content="NOINDEX,NOFOLLOW" />
示例#13
0
function display_page_content()
{
    //$events = Events::FindAll("DESC");
    $year = getRequestVarAtIndex(2);
    $month = getRequestVarAtIndex(3);
    ?>

    <div id="edit-header" class="eventnav">
		<div class="nav-left column">
    		<h1>Choose an Event to Edit</h1>
		</div>
		<div class="nav-right column">
            <a href="<?php 
    echo get_link("admin/add_event");
    ?>
" class="hcd_button">Add a New Event</a> 
            <?php 
    if (ALLOW_EVENT_TYPES) {
        ?>
            <a href="<?php 
        echo get_link("admin/list_event_types");
        ?>
" class="hcd_button">List Event Types</a>
            <?php 
    }
    ?>
		</div>
		<div class="clearleft"></div>
	</div>
	
<?php 
    // Check conf file to see if we need to display events as a list instead...
    if (DISPLAY_EVENTS_AS_LIST) {
        ?>

	<div id="table-header" class="eventlist">
		<strong class="item-link">Click Name to Edit</strong>
		<span class="item-filename">Event Type and Date Range</span>
	</div>
	<ul id="listitems" class="managelist">
<?php 
        $events = Events::FindAll("DESC");
        $month = "";
        $year = "";
        foreach ($events as $event) {
            $title = "";
            if ($event->title != "") {
                $title = $event->title;
            } else {
                $title = "(no title given)";
            }
            $eventyear = parseDate($event->date_start, "Y");
            $eventmonth = parseDate($event->date_start, "m");
            $eventmonthname = parseDate($event->date_start, "F");
            if ($eventmonthname == $month) {
                $year = $eventyear;
                $month = $eventmonthname;
            } else {
                echo "\t\t\t<li class=\"monthname\">{$eventmonthname} {$eventyear}</li>";
                $year = $eventyear;
                $month = $eventmonthname;
            }
            echo "\t\t\t<li><a class=\"item-link\" href=\"" . get_link("/admin/edit_event/{$eventyear}/{$eventmonth}/{$event->id}") . "\">{$title}</a> <span class=\"item-filename\">";
            $eventtype = $event->getEventType();
            if ($event->date_start == $event->date_end) {
                // this is a one day event
                echo $eventtype->name . " " . formatDateView($event->date_start);
            } else {
                // this event spans a range of dates
                echo $eventtype->name . " " . formatDateView($event->date_start) . " to " . formatDateView($event->date_end);
            }
            echo "</span></li>\n";
        }
        echo "</ul>";
    } else {
        // Display as a calendar
        $cal = new AdminCalendar();
        if ($month != "" && $year != "") {
            echo $cal->getMonthView($month, $year);
        } else {
            echo $cal->getCurrentMonthView();
        }
    }
}
示例#14
0
    $current_permalink .= "/" . $var1;
}
if ($var2 != "") {
    $current_permalink .= "/" . $var2;
}
if ($var3 != "") {
    $current_permalink .= "/" . $var3;
}
if (getRequestVarAtIndex(4) != "") {
    $current_permalink .= "/" . getRequestVarAtIndex(4);
}
if (getRequestVarAtIndex(5) != "") {
    $current_permalink .= "/" . getRequestVarAtIndex(5);
}
if (getRequestVarAtIndex(6) != "") {
    $current_permalink .= "/" . getRequestVarAtIndex(6);
}
?>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# website: http://ogp.me/ns/website# article: http://ogp.me/ns/article#">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    <!--<link rel="prefetch" href="//fonts.googleapis.com/css?family=Domine:700,400">
    <link rel="prefetch" href="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">-->
    
    <meta name="apple-mobile-web-app-title" content="<?php 
echo SITE_NAME;
?>
">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
示例#15
0
function display_page_content()
{
    echo "<hr />\r\n";
    $upcoming_event_num = requestIdParam();
    if ($upcoming_event_num) {
        $upcoming = Events::FindUpcoming($upcoming_event_num);
        $upcoming_csv = "";
        ?>
		
			<p><span class="hint">Click the [<u>X</u>] to remove an event from list</span></p>
			<h2>Upcoming Events that will be included in this email:</h2>
			<table cellpadding="3" cellspacing="0" border="0">
				<tbody>

	<?php 
        foreach ($upcoming as $event) {
            echo "<tr>\n\t\t\t\t\t<td>[<a href=\"javascript;:\" class=\"remove_uevent\" title=\"{$event->id}\">X</a>]&nbsp;</td>\n\t\t\t\t\t<td>" . $event->getDateStart("date") . "&nbsp;</td>\n\t\t\t\t\t<td><b>{$event->title}</b>&nbsp;</td>\n\t\t\t\t</tr>";
            $upcoming_csv .= $event->id . ",";
        }
    }
    ?>
		
				</tbody>
			</table>
	<?php 
    $ongoing_event_num = getRequestVarAtIndex(3);
    if ($ongoing_event_num) {
        $ongoing = Events::FindOngoing($ongoing_event_num);
        $ongoing_csv = "";
        ?>
	
			<h2 style="padding-top: 1em;">Ongoing Events that will be included in this email:</h2>
			<table cellpadding="3" cellspacing="0" border="0">
				<tbody>
	<?php 
        foreach ($ongoing as $event) {
            echo "<tr>\n\t\t\t\t\t<td>[<a href=\"javascript;:\" class=\"remove_oevent\" title=\"{$event->id}\">X</a>]&nbsp;</td>\n\t\t\t\t\t<td>" . $event->getDateStart("date") . " &ndash; " . $event->getDateEnd("date") . "&nbsp;</td>\n\t\t\t\t\t<td><b>{$event->title}</b>&nbsp;</td>\n\t\t\t\t</tr>";
            $ongoing_csv .= $event->id . ",";
        }
    }
    ?>
				
				</tbody>
			</table>

		
	<script type="text/javascript">
		$().ready(function() {
			$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/session_add/upcoming_events/<?php 
    echo $upcoming_csv;
    ?>
', function() {
				$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/session_add/ongoing_events/<?php 
    echo $ongoing_csv;
    ?>
');
			});
			
			$("a.remove_uevent").click(function() {
				var event_id = $(this).attr('title');
				$("#session_add").load('<?php 
    echo BASEHREF;
    ?>
blaster/remove_uevent/'+event_id);
				$(this).parent().parent().css({ "background-color" : "#999"});
				return false;
			});
			
			
			$("a.remove_oevent").click(function() {
				var event_id = $(this).attr('title');
				$("#session_add").load('<?php 
    echo BASEHREF;
    ?>
blaster/remove_oevent/'+event_id);
				$(this).parent().parent().css({ "background-color" : "#999"});
				return false;
			});

		});
	</script>
<?php 
}
示例#16
0
function display_page_content()
{
    $event_id = getRequestVarAtIndex(4);
    $event = Events::FindById($event_id);
    $event_types = EventTypes::FindAll();
    $event_periods = EventPeriods::FindAll();
    $year = getRequestVarAtIndex(2);
    $month = getRequestVarAtIndex(3);
    $recurrences = Recurrence::FindForEvent($event_id);
    $days = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    $user = Users::GetCurrentUser();
    ?>

<script type="text/javascript">
	//<![CDATA[
	$().ready(function() {
		setupDateFields("<?php 
    echo $event->eventperiod_id;
    ?>
");
		
		$.datepicker.setDefaults({
            showButtonPanel: true,
			showOtherMonths: true,
			selectOtherMonths: true
        });
        
        $( "#date_start" ).datepicker();
		$( "#time_start" ).timepicker({timeFormat: 'hh:mm:ss tt',stepMinute: 5});
		$( "#date_end" ).datepicker();
		$( "#time_end" ).timepicker({timeFormat: 'hh:mm:ss tt',stepMinute: 5});
		$( "#not_date" ).datepicker();
		
		$("a#notdate_add").click(function() {
			var date = $("input[name='not_date']").val();
			if (date != "") {
				$("input[name='not_date']").val('');
				var all_dates_vis = $("span#notdates").html();
				$("span#notdates").html("<label for=\"notdates[]\">"+date+"&nbsp;<a href=\"javascript:;\" onClick=\"$(this).parent().remove();\">X</a><input type=\"hidden\" name=\"notdates[]\" value=\""+date+"\" /></label>"+all_dates_vis);
			}
		});
		
		$("#eventperiod_id").change(function() { 
			var selected = $(this).val();
			setupDateFields(selected);
		});

		$("#edit_event").validate({
			rules: {
				title: "required",
				date_start: "required",
			},
			messages: {
				title: "Please enter a title for this event",
				date_start: "Please at least a start date for this event",
			}
		});
	});
	//]]>
</script>

<div id="edit-header" class="event">
	<h1>Edit Event</h1>
</div>

<div id="calendar_div"></div>

<form method="POST" id="edit_event">
	
	<p class="display_name">
        <label for="title">Title</label>
    	<?php 
    textField("title", $event->title, "required: true");
    ?>
	</p>
    
    <?php 
    if (ALLOW_EVENT_TYPES && count($event_types) > 1) {
        ?>
	<p>
	    <label for="eventtype_id">Event Type</label>
    	<select name="eventtype_id" id="eventtype_id">
		<?php 
        foreach ($event_types as $event_type) {
            echo "<option value='{$event_type->id}' ";
            if ($event_type->id == $event->eventtype_id) {
                echo " selected ";
            }
            echo ">{$event_type->name}</option>\r\n";
        }
        ?>
    	</select>
	</p>
    <?php 
    }
    ?>
    
	<div id="eventdateselects" class="dropslide">
		<p><label for="eventperiod_id">Event Period:</label>
    		<select name="eventperiod_id" id="eventperiod_id">
			<?php 
    foreach ($event_periods as $event_period) {
        echo "<option value='{$event_period->id}' ";
        if ($event_period->id == $event->eventperiod_id) {
            echo " selected ";
        }
        echo ">{$event_period->name}</option>\r\n";
    }
    ?>
    		</select>
		</p>
	
		<p>
		    <label for="date_start">Start Date / Time</label>
    		<input type="text" name="date_start" id="date_start" style="width: 6.5em;" value="<?php 
    echo $event->getDateStart("date");
    ?>
" class="required: true" />&nbsp;
    		<input type="text" name="time_start" id="time_start" style="width: 6.5em;" value="<?php 
    echo $event->getDateStart("time");
    ?>
" />&nbsp;&nbsp; 
		
    		<label for="date_start">End Date / Time</label>
    		<input type="text" name="date_end" id="date_end" style="width: 6.5em;" value="<?php 
    echo $event->getDateEnd("date");
    ?>
" />&nbsp;
    		<input type="text" name="time_end" id="time_end" style="width: 6.5em;" value="<?php 
    echo $event->getDateEnd("time");
    ?>
" />
        </p>
		
		<div id="recurrence_rules" <?php 
    if ($event->eventperiod_id != 3) {
        echo "style=\"display: none; \"";
    }
    ?>
>
			<p><label for="not_date">Exclusion Date(s)</label>
				<input type="text" name="not_date" id="not_date" style="width: 6.5em;"/>&nbsp;<a href="javascript:;" id="notdate_add">Add to list&rarr;</a> 
				<span id="notdates">
				<?php 
    foreach (explode(",", $event->getNotDates()) as $date) {
        if ($date != "") {
            echo "<label for=\"{$date}\">{$date} &nbsp;<a href=\"javascript:;\" onClick=\"\$(this).parent().remove();\">&times;</a><input type=\"hidden\" name=\"notdates[]\" value=\"{$date}\" /></label>";
        }
    }
    ?>
				</span>
			</p>
	
			<label>Recurrence Rules</label>
			<table>
				<tbody>
					<tr>
						<th>&nbsp;</th>
						<th>Sunday</th>
						<th>Monday</th>
						<th>Tuesday</th>
						<th>Wednesday</th>
						<th>Thursday</th>
						<th>Friday</th>
						<th>Saturday</th>
					</tr>
					<tr>
						<td>Every</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 0);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>First</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 1);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Second</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 2);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Third</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 3);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Fourth</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 4);
        echo "</td>";
    }
    ?>
					</tr>
					<tr>
						<td>Last</td>
						<?php 
    foreach ($days as $day) {
        echo "<td>";
        get_recurrence_tag($recurrences, $day, 5);
        echo "</td>";
    }
    ?>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	
    <p>
        <label for="name">Event Description</label><br />
        <?php 
    textArea("description", $event->description, 98, EDIT_WINDOW_HEIGHT);
    ?>
    </p>
	
	<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
	
	<div id="edit-footer" class="eventnav clearfix">
		<div class="column half">
			<p>
				<input type="submit" class="submitbutton" name="submit" value="Edit Event" /> <br />
				<input type="submit" class="submitbuttonsmall" name="submit" value="Edit and Return to List" />
			</p>
		</div>
		<div class="column half last">
			
		<?php 
    if ($user->has_role()) {
        ?>
			
			<p><label for="delete">Delete this Event? <input name="delete" id="delete" class="boxes" type="checkbox" value="<?php 
        echo $event->id;
        ?>
"></label>
    		<span class="hint">Check the box and click &ldquo;Save&rdquo; to delete this event from the database</span></p>
		<?php 
    }
    ?>
		
		</div>
	</div>
	
</form>
<?php 
}
示例#17
0
 and the <span class="pre">Providence Preservation Society.</span> <br>
                Site design and CMS donated in part by <a href="http://www.highchairdesign.com" title="Web design and development in Providence RI" class="pre">Highchair designhaus</a>. </p>
            </div>
            
        </div><!-- end .container -->
        
    </footer>

<?php 
// HCd Edit Window
//$additional = "<a href=\"".get_link("admin/edit_gallery/7")."\">Edit Home Gallery</a>";
$additional = isset($additional) ? $additional : "";
if (getRequestVarAtIndex() == BLOG_STATIC_AREA || get_class($page) != "StaticPage") {
    if (getRequestVarAtIndex() == BLOG_STATIC_AREA) {
        echo Blogs::DisplayBlogEditLinks();
    } elseif (getRequestVarAtIndex() == "events") {
        echo Events::DisplayCalendarEditLinks($event);
    } else {
        if ($page && isset($item)) {
            echo $page->getPageEditLinks($area, $additional, $item);
        } else {
            echo $page->getPageEditLinks($area, $additional);
        }
    }
}
?>
  
    
    <!--[if lt IE 8]>
    <div id="oldie-warning">
        <p class=chromeframe>Your browser is <em>ancient</em> and <a href="http://www.ie6countdown.com/">Microsoft agrees</a>. <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience a better web.</p>
示例#18
0
function display_page_content()
{
    error_reporting(E_ALL);
    // Set the Header! Important for compliance.
    header('Content-type: application/rss+xml');
    // Create additional parameters here, and edit the Channel info below for each site
    echo "<?xml version=\"1.0\"?>\n";
    ?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
	<channel>
		<title><?php 
    echo SITE_NAME;
    ?>
 RSS Feed</title>
		<link>http://<?php 
    echo SITE_URL;
    ?>
</link>
		<atom:link rel="self" type="application/rss+xml" href="http://<?php 
    echo SITE_URL . BASEHREF . getRequestVarAtIndex(0) . "/" . getRequestVarAtIndex(1);
    ?>
" />
		<description><?php 
    echo SITE_NAME;
    ?>
 RSS Feed</description>
		<language>en-us</language>	
<?php 
    /* We can feed this RSS loop any number of parameters, but for now we feed it a path and then we iterate on what is supplied. Customize and add to this as needed:
    	For example:
    		/feed/rss/
    		/events/rss/
    	*/
    if (getRequestVarAtIndex(0) == "feed" || getRequestVarAtIndex(0) == "blog") {
        // Default action = Blog Posts
        $the_blog = Blogs::FindByID(1);
        $entries = $the_blog->getEntries();
        //print_r($entries);
        $firstentry = $entries;
        $firstentry = array_shift($firstentry);
        $buildDate = date('r');
        $rss = "\t\t<pubDate>{$buildDate}</pubDate>\n";
        $rss .= "\t\t<lastBuildDate>{$buildDate}</lastBuildDate>\n\n";
        foreach ($entries as $entry) {
            $bloglink = "http://" . SITE_URL . get_link("blog/view/1/" . $entry->id);
            $rss .= "\t\t<item>\n";
            $rss .= "\t\t\t<title>" . cleanupSpecialChars($entry->title) . "</title>\n";
            $rss .= "\t\t\t<pubDate>" . date('r', strtotime($entry->date)) . "</pubDate>\n";
            $rss .= "\t\t\t<link>{$bloglink}</link>\n";
            $rss .= "\t\t\t<guid isPermaLink=\"true\">{$bloglink}</guid>\n";
            $rss .= "\t\t\t<description><![CDATA[";
            //$blogcontent = scrub_HCd_Tags( $entry->content );
            //$blogcontent = strip_tags( $blogcontent );
            $blogcontent = $entry->rss_getContent();
            $rss .= cleanupSpecialChars($blogcontent);
            $rss .= "]]></description>\n";
            if (RSS_AUTHOR) {
                $rss .= "\t\t\t<dc:creator>{$entry->user}</dc:creator>\n";
            }
            $rss .= "\t\t</item>\n";
        }
    } else {
        if (getRequestVarAtIndex(0) == "events") {
            $entries = Events::FindUpcomingWithinDateRange(12, "ASC", 90);
            $firstentry = $entries;
            $firstentry = array_shift($firstentry);
            $buildDate = date('r');
            $rss = "\t\t<pubDate>{$buildDate}</pubDate>\n";
            $rss .= "\t\t<lastBuildDate>{$buildDate}</lastBuildDate>\n\n";
            foreach ($entries as $entry) {
                $type = $entry->getEventType();
                if ($entry->time_start != "04:00:00") {
                    $entrydate = substr($entry->date_start, 0, 10) . " " . $entry->time_start;
                } else {
                    $entrydate = substr($entry->date_start, 0, 10) . " 12:00:00";
                }
                $dateLink = explode("/", $entry->getDateStart("date"));
                $eventlink = "http://" . SITE_URL . get_link("events/calendar/" . $dateLink[2] . "/" . $dateLink[0] . "/" . $dateLink[1] . "/" . $entry->id);
                $rss .= "\t\t<item>\n";
                $rss .= "\t\t\t<title>" . htmlentities($entry->title, ENT_QUOTES) . " (" . htmlentities($type->name, ENT_QUOTES) . ")</title>\n";
                date_default_timezone_set('EST');
                $rss .= "\t\t\t<pubDate>" . date('r', strtotime($entrydate)) . "</pubDate>\n";
                $rss .= "\t\t\t<link>{$eventlink}</link>\n";
                $rss .= "\t\t\t<guid isPermaLink=\"true\">{$eventlink}</guid>\n";
                $rss .= "\t\t\t<description>";
                if (RSS_IMAGE) {
                    if ($entry->hasImage()) {
                        $rss .= "&lt;img src=&quot;http://" . SITE_URL . get_link("/images/eventsimage/" . $entry->id) . "&quot; alt=&quot;" . htmlentities($entry->title, ENT_QUOTES) . "&quot; &gt;\n";
                    }
                }
                if (substr($entry->description, 0, 1) == "<") {
                    $rss .= htmlentities($entry->description, ENT_QUOTES) . "</description>\n";
                } else {
                    $rss .= $entry->description . "</description>\n";
                }
                if (RSS_AUTHOR) {
                    $rss .= "\t\t\t<dc:creator>{$entry->user}</dc:creator>\n";
                }
                $rss .= "\t\t</item>\n";
            }
        }
    }
    echo $rss;
    ?>

	</channel>
</rss>
<?php 
}
示例#19
0
function display_page_content()
{
    $event_types = EventTypes::FindAll();
    $year = getRequestVarAtIndex(2);
    $month = getRequestVarAtIndex(3);
    $day = getRequestVarAtIndex(4);
    $event_id = getRequestVarAtIndex(5);
    ?>

			<script language="javascript" type="text/javascript">
				//<![CDATA[
				$().ready(function() {
					$("#eventtype").change(function() {
						var selected = $("#eventtype").val();
						if(selected == "All")
						{
							$("table.calendarTable td a").show();
						}
						else
						{
							$("table.calendarTable td a:not(." + selected + ")").hide();
							$("." + selected).show();
						}
					});
				});
				//]]>
			</script>
			
		<?php 
    if ($event_id != "") {
        $event = Events::FindById($event_id);
        $cal = new Calendar();
        echo $cal->getMiniMonthView("events", "calendar", $month, $year, $day, $event_id);
        ?>
			
			<div class="event_details">
				<h1><?php 
        echo $event->title;
        ?>
</h1>
				<h3><?php 
        echo $event->getDateRangeString();
        ?>
</h3>

				<div class="event_description">
					<?php 
        echo $event->getDescription();
        ?>
					
				</div>
			</div>
			
		<?php 
    } else {
        if ($day != "") {
            $event = Events::FindAllForDate($day, $month, $year);
            $cal = new Calendar();
            echo $cal->getMiniMonthView("events", "calendar", $month, $year, $day, $event_id);
            if (substr($day, 0, 1) == "0") {
                $properday = substr($day, 1, 1);
            } else {
                $properday = $day;
            }
            echo "\t\t\t<h2>Events for " . getFullMonthName($month) . " " . $properday . ", " . $year . "</h2>\n";
            foreach ($event as $theevent) {
                ?>
		
			<div class="event_details">
				<h1><?php 
                echo $theevent->title;
                ?>
</h1>
				<h3><?php 
                echo $theevent->getDateRangeString();
                ?>
</h3>
				
				<div class="event_description">
					<?php 
                echo chopText($theevent->getDescription(true), 100);
                ?>
				</div>
				<a href="<?php 
                echo get_link("/events/calendar/{$year}/{$month}/{$day}/{$theevent->id}");
                ?>
">Read More</a>
			</div>
		<?php 
            }
        } else {
            ?>
			
			<p>Below is our Event Calendar engine, which displays all the past and future events for your website. Use the double arrows to go back or forward in time and view previous or upcoming months. Click on any event to find out more about it. Notice how we can handle recurring events &ndash; repetitive events every week, every first day, second, third, or last. </p>
			
			<select name="eventtype" id="eventtype">
				<?php 
            echo "<option value='All' selected>All Events</option>";
            foreach ($event_types as $event_type) {
                echo "<option value='{$event_type->slug()}' ";
                echo ">{$event_type->name}</option>\r\n";
            }
            ?>
			</select>
			<p>&nbsp;</p>

<?php 
            $cal = new Calendar();
            if ($month != "" && $year != "") {
                echo $cal->getMonthView($month, $year);
            } else {
                echo $cal->getCurrentMonthView();
            }
        }
    }
    // end the if statement
}
        echo ">\n";
    } else {
        echo " style=\"display: none;\">\n";
    }
    SUB_PAGES ? require_once snippetPath("admin-area_child") : (require_once snippetPath("admin-area"));
    echo "\t</div>\n";
}
$documents = Documents::FindAll();
require_once snippetPath("admin-insertDoc");
$images = Images::FindAll();
require_once snippetPath("admin-insertImage");
if (GALLERY_INSTALL && !in_array(getRequestVarAtIndex(1), $portfolio)) {
    $galleries = Galleries::FindAll("DESC");
    require_once snippetPath("admin-insertGallery");
}
if (PORTFOLIO_INSTALL && (ITEM_GALLERY_INSERT && !in_array(getRequestVarAtIndex(1), $portfolio))) {
    //$galleries = Galleries::FindAll();
    require_once snippetPath("admin-insertItemGallery");
}
if (VIDEO_INSTALL) {
    require_once snippetPath("admin-insertVideo");
}
if (TESTIMONIAL_INSTALL) {
    require_once snippetPath("admin-insertTestimonial");
}
if (PRODUCT_INSTALL) {
    $products = Product::FindAll();
    require_once snippetPath("admin-insertProduct");
}
?>