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


PHP get_events函数代码示例

本文整理汇总了PHP中get_events函数的典型用法代码示例。如果您正苦于以下问题:PHP get_events函数的具体用法?PHP get_events怎么用?PHP get_events使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: widget

 /** Display widget instance
  * 
  * using extract(), it seems, to me, not be a good idea, 
  * but also seems very conventional.
  * echo() from this method is rendered on the page.
  *
  * @param array $args displaying arguments name, id, [before|after]_[widget|title], widget_[id, name]
  * @param array $inst setting of each instance
  */
 function widget($args, $inst)
 {
     //error_log('MeetupEverywhere::widget');
     /*
     $is_tag_exists = function_exists('is_tag');
     $mega_tags     = array();
     if (is_single()) {
       $the_tags = get_the_tags(get_the_ID());
       foreach ($the_tags as $tag) {
         array_push($mega_tags, $tag->term_id);
       }
     }
     
     extract($args);
     $tags       = get_tags(array('orderby' => '', 'hide_empty' => false));
     $tag_length = count($tags);
     $i          = 1;
     //error_log(print_r($tags, true));
     if (strlen($inst['title'])) {
       echo $before_title . $inst['title'] . $after_title;
     }
     */
     echo $before_widget;
     if (self::$is_showable) {
         $events = get_events(self::$settings['api_key'], self::$settings['container_id']);
         include 'html/widget.php';
     } else {
         echo "NOT configured";
     }
     echo $after_widget;
 }
开发者ID:beatak,项目名称:Meetup-Everywhere-WordPress-plugin,代码行数:40,代码来源:meetup_everywhere.php

示例2: get_content

    function get_content() {
        global $CFG;
        if ($this->content !== NULL) {
            return $this->content;
        }
		if(!isloggedin()){
			return $this->content;
		}
		//if(is_siteadmin()){
		//	return $this->content;
		//}
		//if(has_capability('local_collegestructure:manage', context_system::instance())){
		//	return $this->content;
		//}

      
        // Prep the content
        $this->content = new stdClass();
		require_once('events.php');
		$events = get_events();
        $this->content->text = $events;
        return $this->content;
        // Prepare the footer for this block
        // No footer to display
        $this->content->footer = '';
		// Return the content object
        return $this->content;
    }
开发者ID:anilch,项目名称:Personel,代码行数:28,代码来源:block_events.php

示例3: submit_date

function submit_date()
{
    $newdate1 = $_POST['sendDate1'];
    $newdate2 = $_POST['sendDate2'];
    $args = array('post_type' => 'epsa_events', 'posts_per_page' => 5, 'order' => 'ASC', 'meta_query' => array(array('key' => 'start_time', 'value' => array($newdate1, $newdate2), 'compare' => 'BETWEEN')));
    get_events($args);
    wp_die();
}
开发者ID:rmilosic,项目名称:mobile.epsa,代码行数:8,代码来源:functions.php

示例4: admin_calendar

function admin_calendar()
{
    global $db, $countries;
    $tpl = new smarty();
    $tpl->assign('events', get_events());
    $tpl->assign('lang', get_languages());
    $tpl->assign('rights', get_form_rights());
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/calendar.html');
    $content = ob_get_contents();
    ob_end_clean();
    main_content(CALENDAR, $content, '', 1);
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:13,代码来源:calendar.php

示例5: create_month

function create_month($month, $year)
{
    global $phpcdb, $phpc_cal, $phpcid;
    $weeks = weeks_in_month($month, $year);
    $first_day = 1 - day_of_week($month, 1, $year);
    $from_stamp = mktime(0, 0, 0, $month, $first_day, $year);
    $last_day = $weeks * 7 - day_of_week($month, 1, $year);
    $to_stamp = mktime(23, 59, 59, $month, $last_day, $year);
    $days_events = get_events($from_stamp, $to_stamp);
    $week_list = array();
    for ($week_of_month = 1; $week_of_month <= $weeks; $week_of_month++) {
        // We could be showing a week from the previous or next year
        $days = ($week_of_month - 1) * 7;
        $start_stamp = strtotime("+{$days} day", $from_stamp);
        $week_list[] = create_week($start_stamp, $year, $days_events);
    }
    return $week_list;
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:18,代码来源:display_month.php

示例6: display_week

function display_week()
{
    global $vars, $phpc_home_url, $phpcid, $phpc_year, $phpc_month, $phpc_day;
    if (!isset($vars['week'])) {
        $week_of_year = week_of_year($phpc_month, $phpc_day, $phpc_year);
    } else {
        if (!is_numeric($vars['week'])) {
            soft_error(__('Invalid date.'));
        }
        $week_of_year = $vars['week'];
    }
    $day_of_year = 1 + ($week_of_year - 1) * 7 - day_of_week(1, 1, $phpc_year);
    $from_stamp = mktime(0, 0, 0, 1, $day_of_year, $phpc_year);
    $start_day = date("j", $from_stamp);
    $start_month = date("n", $from_stamp);
    $start_year = date("Y", $from_stamp);
    $last_day = $day_of_year + 6;
    $to_stamp = mktime(23, 59, 59, 1, $last_day, $phpc_year);
    $end_day = date("j", $to_stamp);
    $end_month = date("n", $to_stamp);
    $end_year = date("Y", $to_stamp);
    $title = month_name($start_month) . " {$start_year}";
    if ($end_month != $start_month) {
        $title .= " - " . month_name($end_month) . " {$end_year}";
    }
    $prev_week = $week_of_year - 1;
    $prev_year = $phpc_year;
    if ($prev_week < 1) {
        $prev_year--;
        $prev_week = week_of_year($start_month, $start_day - 7, $start_year);
    }
    $next_week = $week_of_year + 1;
    $next_year = $phpc_year;
    if ($next_week > weeks_in_year($phpc_year)) {
        $next_week = week_of_year($end_month, $end_day + 1, $end_year);
        $next_year++;
    }
    $heading = tag('', tag('a', attrs('class="phpc-icon-link"', "href=\"{$phpc_home_url}?action=display_week&amp;phpcid={$phpcid}&amp;week={$prev_week}&amp;year={$prev_year}\""), tag('span', attrs('class="fa fa-chevron-left"'), '')), $title, tag('a', attrs('class="phpc-icon-link"', "href=\"{$phpc_home_url}?action=display_week&amp;phpcid={$phpcid}&amp;week={$next_week}&amp;year={$next_year}\""), tag('span', attrs('class="fa fa-chevron-right"'), '')));
    return create_display_table($heading, create_week($from_stamp, $phpc_year, get_events($from_stamp, $to_stamp)));
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:40,代码来源:display_week.php

示例7: area_notifs

 function area_notifs()
 {
     global $user, $fs, $page, $db;
     require_once BASEDIR . '/includes/events.inc.php';
     $events_since = strtotime(Get::val('events_since', '-1 week'));
     $tasks = $db->x->getAll('SELECT h.task_id, t.*, p.project_prefix
                            FROM {history} h
                       LEFT JOIN {tasks} t ON h.task_id = t.task_id
                       LEFT JOIN {projects} p ON t.project_id = p.project_id
                       LEFT JOIN {notifications} n ON t.task_id = n.task_id
                           WHERE h.event_date > ? AND h.task_id > 0 AND n.user_id = ?
                                 AND event_type NOT IN (9,10,5,6,8,17,18)
                        GROUP BY h.task_id
                        ORDER BY h.event_date DESC', null, array($events_since, $user->id));
     $task_events = array();
     foreach ($tasks as $task) {
         $task_events[$task['task_id']] = get_events($task['task_id'], 'AND event_type NOT IN (9,10,5,6,8,17,18) AND h.event_date > ' . $events_since, 'DESC');
     }
     $page->assign('task_events', $task_events);
     $page->assign('tasks', $tasks);
     $page->setTitle($fs->prefs['page_title'] . L('mynotifications'));
 }
开发者ID:negram,项目名称:flyspray,代码行数:22,代码来源:myprofile.php

示例8: network_content


//.........这里部分代码省略.........
        $contacts = expand_groups(array($group));
        $contact_str_self = "";
        if (is_array($contacts) && count($contacts)) {
            $contact_str = implode(',', $contacts);
            $self = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self`", intval($_SESSION['uid']));
            if (count($self)) {
                $contact_str_self = "," . $self[0]["id"];
            }
        } else {
            $contact_str = ' 0 ';
            info(t('Group is empty'));
        }
        //$sql_post_table = " INNER JOIN (SELECT DISTINCT(`parent`) FROM `item` WHERE (`contact-id` IN ($contact_str) OR `allow_gid` like '".protect_sprintf('%<'.intval($group).'>%')."') and deleted = 0 ORDER BY `created` DESC) AS `temp1` ON $sql_table.$sql_parent = `temp1`.`parent` ";
        $sql_extra3 .= " AND `contact-id` IN ({$contact_str}{$contact_str_self}) ";
        $sql_extra3 .= " AND EXISTS (SELECT id FROM `item` WHERE (`contact-id` IN ({$contact_str}) \n\t\t\t\tOR `allow_gid` like '" . protect_sprintf('%<' . intval($group) . '>%') . "') and deleted = 0 \n\t\t\t\tAND parent = {$sql_table}.{$sql_parent}) ";
        $o = replace_macros(get_markup_template("section_title.tpl"), array('$title' => sprintf(t('Group: %s'), $r[0]['name']))) . $o;
    } elseif ($cid) {
        $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d\n\t\t\t\tAND `blocked` = 0 AND `pending` = 0 LIMIT 1", intval($cid));
        if (count($r)) {
            $sql_post_table = " INNER JOIN (SELECT DISTINCT(`parent`) FROM `item` \n\t\t\t\t\t    WHERE 1 {$sql_options} AND `contact-id` = " . intval($cid) . " and deleted = 0 \n\t\t\t\t\t    ORDER BY `item`.`received` DESC) AS `temp1` \n\t\t\t\t\t    ON {$sql_table}.{$sql_parent} = `temp1`.`parent` ";
            $sql_extra = "";
            $o = replace_macros(get_markup_template("section_title.tpl"), array('$title' => sprintf(t('Contact: %s'), $r[0]['name']))) . $o;
            if ($r[0]['network'] === NETWORK_OSTATUS && $r[0]['writable'] && !get_pconfig(local_user(), 'system', 'nowarn_insecure')) {
                notice(t('Private messages to this person are at risk of public disclosure.') . EOL);
            }
        } else {
            notice(t('Invalid contact.') . EOL);
            goaway($a->get_baseurl(true) . '/network');
            // NOTREACHED
        }
    }
    if (!$group && !$cid && !$update && !get_config('theme', 'hide_eventlist')) {
        $o .= get_birthdays();
        $o .= get_events();
    }
    if ($datequery) {
        $sql_extra3 .= protect_sprintf(sprintf(" AND {$sql_table}.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(), '', $datequery))));
    }
    if ($datequery2) {
        $sql_extra3 .= protect_sprintf(sprintf(" AND {$sql_table}.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(), '', $datequery2))));
    }
    //$sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` ");
    $sql_extra2 = $nouveau ? '' : $sql_extra2;
    $sql_extra3 = $nouveau ? '' : $sql_extra3;
    $sql_order = "";
    $order_mode = "received";
    $tag = false;
    if (x($_GET, 'search')) {
        $search = escape_tags($_GET['search']);
        if (strpos($search, '#') === 0) {
            $tag = true;
            $search = substr($search, 1);
        }
        if (get_config('system', 'only_tag_search')) {
            $tag = true;
        }
        if ($tag) {
            $sql_extra = "";
            $sql_post_table = sprintf("INNER JOIN (SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d ORDER BY `tid` DESC) AS `term` ON `item`.`id` = `term`.`oid` ", dbesc(protect_sprintf($search)), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), intval(local_user()));
            $sql_order = "`item`.`id`";
            $order_mode = "id";
        } else {
            if (get_config('system', 'use_fulltext_engine')) {
                $sql_extra = sprintf(" AND MATCH (`item`.`body`, `item`.`title`) AGAINST ('%s' in boolean mode) ", dbesc(protect_sprintf($search)));
            } else {
                $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search))));
开发者ID:rahmiyildiz,项目名称:friendica,代码行数:67,代码来源:network.php

示例9: get_events_attended

if (check_id_exists($facebook_id, $conn) == 0) {
    echo "-1";
    return;
}
$A_perm = get_events_attended($facebook_id, $conn);
$N_perm = get_events_not_attended($facebook_id, $conn);
$user_ids = get_user_ids($facebook_id, $conn);
//echo "count : ", count($user_ids), "<br>";
$similarity_indices = array();
foreach ($user_ids as $id) {
    $A_2 = get_events_attended($id, $conn);
    $N_2 = get_events_attended($id, $conn);
    $similarity_indices["{$id}"] = calculate_similarity_index($A_perm, $N_perm, $A_2, $N_2);
    //echo $id, " ------ ", $similarity_indices["$id"], "<br>";
}
$event_ids = get_events($conn);
$event_probablity = array();
foreach ($event_ids as $event_id) {
    //echo $event_id, " : ";
    $users_attending = get_attendance($event_id, $facebook_id, $conn);
    $sum_similarity;
    settype($sum_similarity, "float");
    $sum_similarity = 0.0;
    foreach ($users_attending as $user) {
        //echo "sim of user_index(" , $user, ") is ---", $similarity_indices["$user"], "<br>";
        $sum_similarity += $similarity_indices["{$user}"];
    }
    if (count($users_attending) != 0) {
        $event_probablity["{$event_id}"] = floatval($sum_similarity / count($users_attending));
    } else {
        $event_probablity["{$event_id}"] = 0.0;
开发者ID:cs411-campuscalendar,项目名称:CampusCalendar,代码行数:31,代码来源:events_recommended.php

示例10: get_events

<?php

include_once 'database.php';
$json = get_events();
$arr = array();
foreach ($json as $value) {
    $arr[] = array('id' => $value['eventID'], 'title' => $value['title'], 'start' => $value['event_date']);
}
echo json_encode($arr);
开发者ID:phDirectory,项目名称:phdirectory,代码行数:9,代码来源:get-events.php

示例11: generate_coordinate_array

<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php 
// get db login
require '../include/db_login.php';
require '../include/yahoo_geocoding.php';
// make empty arrays
$latitudes = generate_coordinate_array();
$longitudes = generate_coordinate_array();
// get existing events along with locations
try {
    // get all the coordinates available
    $conn = get_db_connection($db_user, $db_passwd, $db_name);
    $events_query_results = get_events();
    $row_count = mysql_num_rows($events_query_results);
    //
    for ($row = 0; $row < $row_count; $row++) {
        $event_row = mysql_fetch_array($events_query_results);
        extract($event_row);
        $latitudes[$event_id] = $latitude;
        $longitudes[$event_id] = $longitude;
    }
    $event_id = 0;
    $db_status_close = close_db_connection($conn);
} catch (exception $e) {
    $event_query_exception = $e;
}
// get the remote IP
$ip = getenv('REMOTE_ADDR');
// find location posted by user
if ($_POST) {
开发者ID:rheotaxis,项目名称:cuervos,代码行数:31,代码来源:index.php

示例12: widget

 function widget($args, $instance)
 {
     global $wp_query;
     extract($args);
     /* User-selected settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $limit = $instance['limit'];
     $noUpcomingEvents = $instance['no_upcoming_events'];
     $start = $instance['start'];
     $startTime = $instance['start-time'];
     $end = $instance['end'];
     $endTime = $instance['end-time'];
     $venue = $instance['venue'];
     $address = $instance['address'];
     $city = $instance['city'];
     $state = $instance['state'];
     $province = $instance['province'];
     $zip = $instance['zip'];
     $country = $instance['country'];
     $phone = $instance['phone'];
     $cost = $instance['cost'];
     if (eventsGetOptionValue('viewOption') == 'upcoming') {
         $event_url = events_get_listview_link();
     } else {
         $event_url = events_get_gridview_link();
     }
     if (function_exists('get_events')) {
         $old_display = $wp_query->get('eventDisplay');
         $wp_query->set('eventDisplay', 'upcoming');
         $posts = get_events($limit, The_Events_Calendar::CATEGORYNAME);
     }
     /* Before widget (defined by themes). */
     /* Title of widget (before and after defined by themes). */
     if ($title && !$noUpcomingEvents) {
         echo $before_widget . $before_title . $title . $after_title;
     }
     if ($posts) {
         /* Display list of events. */
         if (function_exists('get_events')) {
             echo '<ul class="upcoming">';
             $templateOverride = locate_template(array('events/events-list-load-widget-display.php'));
             $templateLoc = $templateOverride ? $templateOverride : dirname(__FILE__) . '/views/events-list-load-widget-display.php';
             foreach ($posts as $post) {
                 setup_postdata($post);
                 include $templateLoc;
             }
             echo "</ul>";
             $wp_query->set('eventDisplay', $old_display);
         }
         /* Display link to all events */
         echo '<div class="dig-in"><a href="' . $event_url . '">' . __('View All Events', $this->pluginDomain) . '</a></div>';
     } else {
         if (!$noUpcomingEvents) {
             _e('There are no upcoming events at this time.', $this->pluginDomain);
         }
     }
     /* After widget (defined by themes). */
     if (!$noUpcomingEvents) {
         echo $after_widget;
     }
 }
开发者ID:hypenotic,项目名称:slowfood,代码行数:61,代码来源:events-list-widget.class.php

示例13: add_event

function add_event($event_name)
{
    debugger("Memory: Usage add_event: " . memory_get_usage() . "\n");
    $db = db_connect();
    $sql = "INSERT INTO lookups.l_event(event_name) VALUES ('" . strtolower($event_name) . "'); COMMIT; ";
    $results = run_sql($db, $sql);
    echo "NOTE: New event added : {$event_name}.\n";
    $latest_events = get_events();
    mysqli_close($db);
    return $latest_events;
}
开发者ID:rjevansatari,项目名称:Analytics,代码行数:11,代码来源:poll_flurry4.php

示例14: display_events

function display_events($header = 'h2')
{
    ?>
	<?php 
    $options = get_option(THEME_OPTIONS_NAME);
    ?>
	<?php 
    $count = $options['events_max_items'];
    ?>
	<?php 
    $events = get_events(0, $count ? $count : 3);
    ?>
	<?php 
    if (count($events)) {
        ?>
		<<?php 
        echo $header;
        ?>
><a href="<?php 
        echo $events[0]->get_feed()->get_link();
        ?>
"><?php 
        echo $events[0]->get_feed()->get_title();
        ?>
</a></<?php 
        echo $header;
        ?>
>
		<table class="events">
			<?php 
        foreach ($events as $item) {
            ?>
			<tr class="item">
				<td class="date">
					<?php 
            $month = $item->get_date("M");
            $day = $item->get_date("j");
            ?>
					<div class="month"><?php 
            echo $month;
            ?>
</div>
					<div class="day"><?php 
            echo $day;
            ?>
</div>
				</td>
				<td class="title">
					<a href="<?php 
            echo $item->get_link();
            ?>
" class="wrap ignore-external"><?php 
            echo $item->get_title();
            ?>
</a>
				</td>
			</tr>
			<?php 
        }
        ?>
		</table>
	<?php 
    } else {
        ?>
		<p>Unable to fetch events</p>
	<?php 
    }
}
开发者ID:rolandinsh,项目名称:Pegasus-Theme,代码行数:68,代码来源:feeds.php

示例15: get_events

<?php

$events = get_events();
if (empty($events)) {
    echo '<p>Currently no events available. Please contact us for more information</p>';
    include 'inc.form.contact.php';
} else {
    foreach ($events as $event) {
        echo '<div class="event-listing"><a href="' . SITE_URL . '/event/' . $event['sefURL'] . '">';
        echo '<div class="event-listing-top"><img src="' . $event['smallPic'] . '" alt="' . $event['title'] . '" /></div>';
        echo '<div class="event-listing-bottom"><span class="event-listing-title">' . $event['title'] . '</span><span class="event-listing-date">' . date('D m/d/y :: h:iA', $event['start']) . '</span></div>';
        echo '</a></div>';
    }
}
开发者ID:david-ievents,项目名称:iEvents.com-Dev,代码行数:14,代码来源:inc.listing.event.php


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