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


PHP Events::FindAll方法代码示例

本文整理汇总了PHP中Events::FindAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::FindAll方法的具体用法?PHP Events::FindAll怎么用?PHP Events::FindAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Events的用法示例。


在下文中一共展示了Events::FindAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: howManyReferencing

 function howManyReferencing()
 {
     $pagecount = $eventcount = $entrycount = 0;
     $placement_descriptions = '';
     $pages = Pages::FindAll();
     if (CALENDAR_INSTALL) {
         $events = Events::FindAll();
     }
     if (BLOG_INSTALL) {
         $entries = Blog_Entries::FindAll();
     }
     $pattern_recog = array("left" => array("{", "{"), "right" => array("}", "}"), "reg" => array("{", "}"));
     foreach ($pattern_recog as $float => $direction) {
         $imagePattern = "*" . $direction[0] . "{2}(" . $this->name . ")" . $direction[1] . "{2}*";
         foreach ($pages as $page) {
             $imageIds = getFilterIds($page->content, $imagePattern);
             //print_r($imageIds);
             if (count($imageIds) >= 1) {
                 $pagecount++;
                 $placement_descriptions .= '<a href="' . get_link('admin/edit_page/' . $page->id) . '">' . $page->display_name . '</a>, ';
             }
         }
         if (CALENDAR_INSTALL) {
             foreach ($events as $event) {
                 $imageIds = getFilterIds($event->description, $imagePattern);
                 if (count($imageIds) >= 1) {
                     $eventcount++;
                 }
             }
         }
         if (BLOG_INSTALL) {
             foreach ($entries as $entry) {
                 $imageIds = getFilterIds($entry->content, $imagePattern);
                 if (count($imageIds) >= 1) {
                     $entrycount++;
                 }
             }
         }
     }
     $message = $pagecount . " Pages";
     if (CALENDAR_INSTALL) {
         $message .= ", " . $eventcount . " Events";
     }
     if (BLOG_INSTALL) {
         $message .= ", " . $entrycount . " Blog Entries";
     }
     return $message . ' | ' . $placement_descriptions;
 }
开发者ID:highchair,项目名称:hcd-trunk,代码行数:48,代码来源:image.php

示例2: display_page_content

function display_page_content()
{
    ?>
	
	<script type="text/javascript">
		//<![CDATA[
		$().ready(function() {
			$('select#featured-event-select').change(function() {
				$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/session_add/featured_event/'+$(this).val(), function() { 
					if ($('select#featured-event-select').val()) {
						$("#featured_event_removed").slideUp(0);
						$("#featured_event_added").slideDown();
					} else {
						$("#featured_event_added").slideUp(0);
						$("#featured_event_removed").slideDown();
					}
				});
			});
		});
		//]]>
	</script>
	
	<b>Select your featured event.</b><br />
	<select id="featured-event-select">
		<option value="">Select an Event</option>
	<?php 
    print_r($_SESSION["blaster"]);
    $pot_events = Events::FindAll();
    foreach ($pot_events as $event) {
        if ($event->hasImage() && !$event->isPast()) {
            echo "\t\t<option value=\"{$event->id}\">" . date("M d", strtotime($event->date_start)) . " :: {$event->title}</option>\r\n";
        }
    }
    ?>
	
	</select>
	<div id="featured_event_added" class="blast_notice" style="display: none;">Featured Event Added <small>(to remove, reset the drop-down menu to the first option, &ldquo;Select an Event&rdquo;)</small></div>
	<div id="featured_event_removed" class="blast_notice" style="display: none;">Featured Event Removed</div>
	<?php 
}
开发者ID:highchair,项目名称:hcd-trunk,代码行数:43,代码来源:featured_options.php

示例3: print_r

$entry_column_query = MyActiveRecord::FindBySQL( "Blog_Entries", "SHOW COLUMNS FROM blog_entries" );
print_r( $entry_column_query ); 

	[] => Blog_Entries Object
	(
	    [id] => 
	    [title] => 
	    [slug] => 
	    [date] => CURRENT_TIMESTAMP
	    [blog_id] => 
	    [author_id] => 
	    [content] => 
	    [public] => 0
	)
*/
$all_events = Events::FindAll();
$counter = 0;
foreach ($all_events as $event) {
    //if ( $counter == 1 ) break; // For testing
    $newentry = MyActiveRecord::Create('Blog_Entries');
    $newentry->title = esc_html($event->title);
    $newentry->slug = slug($event->title);
    $newentry->date = $event->date_start . " " . $event->time_start;
    // format = 2012-03-14 08:03:17
    $newentry->blog_id = 1;
    $newentry->author_id = 2;
    // manually set to the owner of the site
    $newentry->content = $event->description;
    $newentry->public = 1;
    if ($newentry->save()) {
        echo "&ldquo;" . esc_html($newentry->title) . "&rdquo; saved<br />";
开发者ID:highchair,项目名称:hcd-trunk,代码行数:31,代码来源:change_events_to_entries.php

示例4: display_page_content

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();
        }
    }
}
开发者ID:highchair,项目名称:hcd-trunk,代码行数:84,代码来源:list_events.php


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