当前位置: 首页>>代码示例>>PHP>>正文


PHP Events::FindAllForDate方法代码示例

本文整理汇总了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;
 }
开发者ID:highchair,项目名称:hcd-trunk,代码行数:16,代码来源:admin_calendar.php

示例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 &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()}' ";
//.........这里部分代码省略.........
开发者ID:highchair,项目名称:hcd-trunk,代码行数:101,代码来源:events_calendar.php

示例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>";
     }
 }
开发者ID:highchair,项目名称:hcd-trunk,代码行数:11,代码来源:calendar.php


注:本文中的Events::FindAllForDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。