本文整理汇总了PHP中Events::FindById方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::FindById方法的具体用法?PHP Events::FindById怎么用?PHP Events::FindById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::FindById方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_page_content
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 – 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()}' ";
//.........这里部分代码省略.........
示例2: display_page_content
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+" <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">
//.........这里部分代码省略.........
示例3: elseif
$category = Categories::FindByName($var2);
$description = $category->get_excerpt(160);
$page_title = $category->get_seo_title(" | " . $blogarea->get_seo_title() . " | " . SITE_NAME);
$bodyclass = "blog category-archive";
}
if ($var1 == "view" && $var2 != "") {
$blogitem = Blog_Entries::FindById($var2);
$description = $blogitem->get_excerpt(160);
$page_title = $blogitem->get_seo_title(" | " . $blogarea->get_seo_title() . " | " . SITE_NAME);
$bodyclass = "blog single-entry";
}
} elseif (CALENDAR_INSTALL && $var0 == CALENDAR_STATIC_AREA) {
$page_title = "Event Calendar | " . SITE_NAME;
$bodyclass = "calendar";
if (getRequestVarAtIndex(5)) {
$event = Events::FindById(getRequestVarAtIndex(5));
$description = $event->get_excerpt(160);
$page_title = $event->get_seo_title(" | Event Calendar | " . SITE_NAME);
$bodyclass = "calendar single-event";
} elseif (getRequestVarAtIndex(4)) {
$page_title = "Event Calendar for " . date('F j, Y', mktime(0, 0, 0, $var3, getRequestVarAtIndex(4), $var2)) . " | " . SITE_NAME;
$bodyclass = "calendar events-for-day";
}
} elseif (PORTFOLIO_INSTALL && isset($area) && $area->is_portfolioarea()) {
// With Item
if (!empty($var2)) {
$item = ITEM_ID_IN_URL ? Items::FindById($var2) : Items::FindByName($var2);
$description = $item->get_excerpt(160);
$page_title = $item->get_seo_title(" | " . $page->get_title() . " | " . $area->get_title() . " | " . SITE_NAME);
$bodyclass = "portarea-{$area->id} section-{$page->id} single-item item-{$item->id}";
// No item but a port area and section
示例4: initialize_page
function initialize_page()
{
$event_types = EventTypes::FindAll();
$event_periods = EventPeriods::FindAll();
$post_action = "";
if (isset($_POST['submit'])) {
$post_action = $_POST['submit'];
if ($post_action == "Add Event and add another" || $post_action == "Add and Return to List") {
$event = MyActiveRecord::Create('Events', $_POST);
if (!getPostValue('time_start')) {
$event->setDateStart(getPostValue('date_start'), "04:00:00");
} else {
$event->time_start = date("H:i:s", strtotime(getPostValue('time_start')));
}
if (!getPostValue('date_end') && !getPostValue('time_end')) {
$event->setDateEnd(getPostValue('date_start'), "04:00:00");
} else {
if (!getPostValue('date_end') && getPostValue('time_end')) {
$event->setDateEnd(getPostValue('date_start'), date("H:i:s", strtotime(getPostValue('time_end'))));
} else {
$event->setDateEnd(getPostValue('date_end'), date("H:i:s", strtotime(getPostValue('time_end'))));
}
}
$event->eventtype_id = isset($_POST['eventtype_id']) ? $_POST['eventtype_id'] : 1;
$event->eventperiod_id = $_POST['eventperiod_id'];
$event->save();
$notdates = getPostValue('notdates');
if (is_array($notdates)) {
foreach ($notdates as $date) {
if (strlen($date) > 4) {
$query = "INSERT INTO events_notdate VALUES('{$event->id}','" . formatDateView($date, "Y-m-d") . "')";
mysql_query($query, MyActiveRecord::Connection()) or die($query);
}
}
}
add_eventUpdateRecurrences($event);
$thisnewevent = Events::FindById($event->id);
if ($thisnewevent->date_end < $thisnewevent->date_start) {
setFlash("<h3>Whoops! Event Starts after it Ends! Please correct dates...</h3>");
$eventyear = parseDate($thisnewevent->date_start, "Y");
$eventmonth = parseDate($thisnewevent->date_start, "n");
redirect("/admin/edit_event/{$eventyear}/{$eventmonth}/{$thisnewevent->id}");
} else {
setFlash("<h3>Event added</h3>");
if ($post_action == "Add and Return to List") {
// Redirect user to the Main Event List
$datestart = explode("/", getPostValue('date_start'));
setFlash("<h3>Event added</h3>");
redirect("/admin/list_events/{$datestart['2']}/{$datestart['0']}");
}
}
}
}
}
示例5: ob_get_contents
$thisevent->the_URL("members", "calendar", true);
?>
">Read More</a></p>
</div>
</div>
<?php
}
$upcoming_html = ob_get_contents();
ob_clean();
}
if (is_array($blast_config['ongoing_events'])) {
// ! Ongoing Events
ob_start();
echo "<h2 class=\"blast-title\">Ongoing Events</h2>\n";
foreach ($blast_config['ongoing_events'] as $event_id) {
$thisevent = Events::FindById($event_id);
//$type = $thisevent->getEventType();
//$venue = $thisevent->getVenue($thisevent->id);
?>
<div class="event">
<h3 class="event-title"><a href="<?php
$thisevent->the_url("members", "calendar", true);
?>
"><?php
$thisevent->the_title();
?>
</a></h3>
<?php
//if ($venue->name != "" && $venue->name != "None Selected") {
?>