本文整理汇总了PHP中Events::FindAllForDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::FindAllForDate方法的具体用法?PHP Events::FindAllForDate怎么用?PHP Events::FindAllForDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::FindAllForDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDateLink
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;
}
示例2: 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()}' ";
//.........这里部分代码省略.........
示例3: getMiniDateLink
function getMiniDateLink($day, $month, $year)
{
if (!isset($this->calendar_id)) {
$this->calendar_id = 1;
}
$events = Events::FindAllForDate($day, $month, $year, $this->calendar_id);
$event = array_shift($events);
if (is_object($event)) {
return "<a href=\"" . get_link("/events/calendar/{$year}/{$month}/{$day}") . "\">" . $day . "</a>";
}
}