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


PHP espresso_reg_url函数代码示例

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


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

示例1: espresso_ical_prepare_by_meta

 function espresso_ical_prepare_by_meta($meta, $title = '', $image = '', $link_only = FALSE)
 {
     global $org_options, $wpdb;
     do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, '');
     if (!empty($org_options['display_ical_download']) && $org_options['display_ical_download'] == 'N' || !isset($org_options['display_ical_download'])) {
         return;
     }
     $start_date = strtotime($meta['start_date'] . ' ' . $meta['start_time']);
     $end_date = strtotime($meta['end_date'] . ' ' . $meta['end_time']);
     $title = empty($text) ? __('iCal Import', 'event_espresso') : $title;
     $image = empty($image) ? '<img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/icons/calendar_link.png">' : $image;
     if ($link_only == TRUE) {
         $image = $title;
     }
     $array = array('iCal' => 'true', 'currentyear' => date('Y'), 'currentmonth' => date('m'), 'currentday' => date('d'), 'currenttime' => date('His'), 'event_id' => $meta['event_id'], 'registration_id' => !empty($meta['registration_id']) ? $meta['registration_id'] : $_SESSION['espresso_session']['id'], 'contact_email' => $meta['contact_email'], 'startyear' => date('Y', $start_date), 'startmonth' => date('m', $start_date), 'startday' => date('d', $start_date), 'starttime' => date('His', $start_date), 'endyear' => date('Y', $end_date), 'endmonth' => date('m', $end_date), 'endday' => date('d', $end_date), 'endtime' => date('His', $end_date), 'event_summary' => stripslashes($meta['event_name']), 'eereg_url' => espresso_reg_url($meta['event_id']), 'site_url' => site_url(), 'organization' => $org_options['organization'], 'location' => str_replace(array('<br>', '<br />'), ' ', $meta['location']));
     $url = add_query_arg($array, site_url());
     $html = '<a  href="' . wp_kses($url, '') . '" target="_blank" id="espresso_ical_' . $meta['event_id'] . '" class="espresso_ical_link" title="' . $title . '">' . $image . '</a>';
     return $html;
 }
开发者ID:sriram911,项目名称:pls,代码行数:19,代码来源:ical.php

示例2: espresso_display_featured_image

 function espresso_display_featured_image($event_id, $image_url, $class = '', $title = '')
 {
     global $org_options;
     if (!empty($org_options['display_featured_image']) && $org_options['display_featured_image'] == 'N' || !isset($org_options['display_featured_image'])) {
         return;
     }
     if (empty($image_url)) {
         return;
     }
     $class = empty($class) ? 'ee-featured-image' : $class;
     $title = empty($title) ? __('Featured Image', 'event_espresso') : $title;
     $align = empty($align) ? 'right' : $align;
     $output = '<div class="' . $class . '" id="espresso_featured_image-' . $event_id . '"><a href="' . espresso_reg_url($event_id) . '"><img title="' . $title . '" src="' . $image_url . '" /></a></div>';
     return $output;
 }
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:15,代码来源:main.php

示例3: espresso_pending_registration_approval

function espresso_pending_registration_approval($registration_id)
{
    global $wpdb, $org_options;
    //Get the event information
    $events = $wpdb->get_results("SELECT ed.* FROM " . EVENTS_DETAIL_TABLE . " ed \n\t\t\t\t\tJOIN " . EVENTS_ATTENDEE_TABLE . " ea\n\t\t\t\t\tON ed.id = ea.event_id\n\t\t\t\t\tWHERE ea.registration_id='" . $registration_id . "'");
    foreach ($events as $event) {
        $event_id = $event->id;
        $event_name = stripslashes_deep($event->event_name);
        $event_desc = stripslashes_deep($event->event_desc);
        $display_desc = $event->display_desc;
        $event_identifier = $event->event_identifier;
        $reg_limit = $event->reg_limit;
        $active = $event->is_active;
        $send_mail = $event->send_mail;
        $conf_mail = $event->conf_mail;
        $email_id = $event->email_id;
        $alt_email = $event->alt_email;
        $start_date = event_date_display($event->start_date);
        $end_date = $event->end_date;
        $virtual_url = $event->virtual_url;
        $virtual_phone = $event->virtual_phone;
        $event_address = $event->address;
        $event_address2 = $event->address2;
        $event_city = $event->city;
        $event_state = $event->state;
        $event_zip = $event->zip;
        $event_country = $event->country;
        $location = ($event_address != '' ? $event_address : '') . ($event_address2 != '' ? '<br />' . $event_address2 : '') . ($event_city != '' ? '<br />' . $event_city : '') . ($event_state != '' ? ', ' . $event_state : '') . ($event_zip != '' ? '<br />' . $event_zip : '') . ($event_country != '' ? '<br />' . $event_country : '');
        $location_phone = $event->phone;
        $require_pre_approval = $event->require_pre_approval;
        $google_map_link = espresso_google_map_link(array('address' => $event_address, 'city' => $event_city, 'state' => $event_state, 'zip' => $event_zip, 'country' => $event_country));
    }
    //Build links
    $event_url = espresso_reg_url($event_id);
    $event_link = '<a href="' . $event_url . '">' . $event_name . '</a>';
    $sql = "SELECT * FROM " . EVENTS_ATTENDEE_TABLE;
    if ($registration_id != '') {
        $sql .= " WHERE registration_id = '" . $registration_id . "' ";
    } elseif ($attendee_id != '') {
        $sql .= " WHERE id = '" . $attendee_id . "' ";
    } else {
        _e('No ID Supplied', 'event_espresso');
    }
    $sql .= " ORDER BY id ";
    $sql .= " LIMIT 0,1 ";
    //Get the first attendees details
    $attendees = $wpdb->get_results($sql);
    //global $attendee_id;
    foreach ($attendees as $attendee) {
        $attendee_id = $attendee->id;
        $attendee_email = $attendee->email;
        $lname = $attendee->lname;
        $fname = $attendee->fname;
        $address = $attendee->address;
        $address2 = $attendee->address2;
        $city = $attendee->city;
        $state = $attendee->state;
        $zip = $attendee->zip;
        $payment_status = $attendee->payment_status;
        $txn_type = $attendee->txn_type;
        $amount_pd = $attendee->amount_pd;
        $event_cost = $attendee->amount_pd;
        $payment_date = $attendee->payment_date;
        $phone = $attendee->phone;
        $event_time = $attendee->event_time;
        $end_time = $attendee->end_time;
        $date = $attendee->date;
        $pre_approve = $attendee->pre_approve;
    }
    event_espresso_send_attendee_registration_approval_pending($registration_id);
    require_once EVENT_ESPRESSO_PLUGINFULLPATH . "templates/pending_approval.php";
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:72,代码来源:pending_approval_page.php

示例4: event_espresso_edit_list


//.........这里部分代码省略.........
            $event_zip = isset($event->zip) ? $event->zip : '';
            $event_country = isset($event->country) ? $event->country : '';
            //added new
            $venue_title = isset($event->venue_title) ? $event->venue_title : '';
            $venue_locale = isset($event->locale_name) ? $event->locale_name : '';
            $wp_user = isset($event->wp_user) ? $event->wp_user : '';
            $location = (!empty($event_address) ? $event_address : '') . (!empty($event_address2) ? '<br />' . $event_address2 : '') . (!empty($event_city) ? '<br />' . $event_city : '') . (!empty($event_state) ? ', ' . $event_state : '') . (!empty($event_zip) ? '<br />' . $event_zip : '') . (!empty($event_country) ? '<br />' . $event_country : '');
            $dow = date("D", strtotime($start_date));
            ob_start();
            ?>
						<tr>
							<td class="check-column" style="padding:7px 0 22px 7px; vertical-align:top;"><!--Delete Events-->
								<?php 
            echo '<input name="checkbox[' . $event_id . ']" type="checkbox"  title="Delete Event ' . $event_name . '" />';
            ?>
</td>

							<td class="column-comments" style="padding-top:3px;"><?php 
            echo $event_id;
            ?>
</td>

							<td class="post-title page-title"><strong><a class="row-title" href="admin.php?page=events&action=edit&event_id=<?php 
            echo $event_id;
            ?>
"><?php 
            echo $event_name;
            ?>
</a> <?php 
            echo $recurrence_id > 0 ? $recurrence_icon : '';
            ?>
 </strong>
								<div class="row-actions"><span><a href="<?php 
            echo espresso_reg_url($event_id);
            ?>
" target="_blank"><?php 
            _e('View', 'event_espresso');
            ?>
</a> | </span><span class='edit'><a href="admin.php?page=events&amp;action=edit&amp;event_id=<?php 
            echo $event_id;
            ?>
"><?php 
            _e('Edit', 'event_espresso');
            ?>
</a> | </span><span class='delete'><a onclick="return confirmDelete();" href='admin.php?page=events&amp;action=delete&amp;event_id=<?php 
            echo $event_id;
            ?>
'><?php 
            _e('Delete', 'event_espresso');
            ?>
</a></span> | <span><a href="admin.php?page=events&amp;event_admin_reports=list_attendee_payments&amp;event_id=<?php 
            echo $event_id;
            ?>
"><?php 
            _e('Attendees', 'event_espresso');
            ?>
</a> | </span><span><a href="#" onclick="window.location='<?php 
            echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&amp;event_id=" . $event_id . "&amp;export=report&action=payment&amp;type=excel";
            ?>
'" title="<?php 
            _e('Export to Excel', 'event_espresso');
            ?>
"><?php 
            _e('Export', 'event_espresso');
            ?>
</a></span></div></td>
开发者ID:sriram911,项目名称:pls,代码行数:67,代码来源:event_list.php

示例5: event_espresso_send_attendee_registration_approval_pending

 function event_espresso_send_attendee_registration_approval_pending($registration_id)
 {
     global $org_options, $wpdb;
     do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, '');
     //Get the event information
     $events = $wpdb->get_results("SELECT ed.* FROM " . EVENTS_DETAIL_TABLE . " ed\n\t\t\t\t\t\tJOIN " . EVENTS_ATTENDEE_TABLE . " ea\n\t\t\t\t\t\tON ed.id = ea.event_id\n\t\t\t\t\t\tWHERE ea.registration_id='" . $registration_id . "'");
     foreach ($events as $event) {
         $event_id = $event->id;
         $event_name = stripslashes_deep($event->event_name);
         $event_desc = stripslashes_deep($event->event_desc);
         $display_desc = $event->display_desc;
         $event_identifier = $event->event_identifier;
         $reg_limit = $event->reg_limit;
         $active = $event->is_active;
         $send_mail = $event->send_mail;
         $conf_mail = $event->conf_mail;
         $email_id = $event->email_id;
         $alt_email = $event->alt_email;
         $start_date = event_date_display($event->start_date);
         $end_date = $event->end_date;
         $virtual_url = $event->virtual_url;
         $virtual_phone = $event->virtual_phone;
         $event_address = $event->address;
         $event_address2 = $event->address2;
         $event_city = $event->city;
         $event_state = $event->state;
         $event_zip = $event->zip;
         $event_country = $event->country;
         $location = ($event_address != '' ? $event_address : '') . ($event_address2 != '' ? '<br />' . $event_address2 : '') . ($event_city != '' ? '<br />' . $event_city : '') . ($event_state != '' ? ', ' . $event_state : '') . ($event_zip != '' ? '<br />' . $event_zip : '') . ($event_country != '' ? '<br />' . $event_country : '');
         $location_phone = $event->phone;
         $require_pre_approval = $event->require_pre_approval;
         $google_map_link = espresso_google_map_link(array('address' => $event_address, 'city' => $event_city, 'state' => $event_state, 'zip' => $event_zip, 'country' => $event_country));
     }
     //Build links
     $event_url = espresso_reg_url($event_id);
     $event_link = '<a href="' . $event_url . '">' . $event_name . '</a>';
     $sql = "SELECT * FROM " . EVENTS_ATTENDEE_TABLE;
     if ($registration_id != '') {
         $sql .= " WHERE registration_id = '" . $registration_id . "' ";
     } elseif ($attendee_id != '') {
         $sql .= " WHERE id = '" . $attendee_id . "' ";
     } else {
         _e('No ID Supplied', 'event_espresso');
     }
     $sql .= " ORDER BY id ";
     $sql .= " LIMIT 0,1 ";
     //Get the first attendees details
     $attendees = $wpdb->get_results($sql);
     //global $attendee_id;
     foreach ($attendees as $attendee) {
         $attendee_id = $attendee->id;
         $attendee_email = $attendee->email;
         $lname = $attendee->lname;
         $fname = $attendee->fname;
         $address = $attendee->address;
         $address2 = $attendee->address2;
         $city = $attendee->city;
         $state = $attendee->state;
         $zip = $attendee->zip;
         $payment_status = $attendee->payment_status;
         $txn_type = $attendee->txn_type;
         $amount_pd = $attendee->amount_pd;
         $event_cost = $attendee->amount_pd;
         $payment_date = event_date_display($attendee->payment_date);
         $phone = $attendee->phone;
         $event_time = event_date_display($attendee->event_time, get_option('time_format'));
         $end_time = event_date_display($attendee->end_time, get_option('time_format'));
         $date = event_date_display($attendee->date);
         $pre_approve = $attendee->pre_approve;
     }
     $admin_email = $alt_email == '' ? $org_options['contact_email'] : $alt_email . ',' . $org_options['contact_email'];
     if (!empty($admin_email)) {
         $subject = "New attendee registration approval pending";
         $body = "\nEvent title: {$event_name}\n<br/>\nAttendee name: {$fname}&nbsp;{$lname}\n<br/>\nThank You.\n";
         $email_params = array('send_to' => $admin_email, 'email_subject' => __($subject, 'event_espresso'), 'email_body' => $body);
         event_espresso_send_email($email_params);
     }
     if (!empty($attendee_email)) {
         $subject = "Event registration pending";
         $body = "\nEvent title: {$event_name}\n<br/>\nAttendee name: {$fname}&nbsp;{$lname}\n<br/>\nYour registration is pending for approval from event admin. You will receive an email with payment info when admin approves your registration.\n<br/><br/>\nThank You.\n";
         $email_params = array('send_to' => $attendee_email, 'email_subject' => __($subject, 'event_espresso'), 'email_body' => $body);
         event_espresso_send_email($email_params);
     }
 }
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:84,代码来源:email.php

示例6: register_attendees


//.........这里部分代码省略.........
            $all_meta = array('event_id' => $event_id, 'event_name' => stripslashes_deep($event_name), 'event_desc' => stripslashes_deep($event_desc), 'event_address' => $event_address, 'event_address2' => $event_address2, 'event_city' => $event_city, 'event_state' => $event_state, 'event_zip' => $event_zip, 'event_country' => $event_country, 'venue_title' => $venue_title, 'venue_address' => $venue_address, 'venue_address2' => $venue_address2, 'venue_city' => $venue_city, 'venue_state' => $venue_state, 'venue_country' => $venue_country, 'location' => $location, 'is_active' => $data->event->is_active, 'event_status' => $data->event->event_status, 'contact_email' => empty($data->event->alt_email) ? $org_options['contact_email'] : $data->event->alt_email, 'start_time' => empty($data->event->start_time) ? '' : $data->event->start_time, 'end_time' => empty($data->event->end_time) ? '' : $data->event->end_time, 'registration_startT' => $data->event->registration_startT, 'registration_start' => $data->event->registration_start, 'registration_endT' => $data->event->registration_endT, 'registration_end' => $data->event->registration_end, 'start_date' => event_espresso_no_format_date($start_date, get_option('date_format')), 'end_date' => event_date_display($end_date, get_option('date_format')), 'google_map_link' => $google_map_link);
            //print_r($all_meta);
            //This function gets the status of the event.
            $is_active = array();
            $is_active = event_espresso_get_is_active(0, $all_meta);
            //echo '<p>'.print_r(event_espresso_get_is_active($event_id, $all_meta)).'</p>';;
            if ($org_options['use_captcha'] == 'Y' && empty($_REQUEST['edit_details'])) {
                ?>
                <script type="text/javascript">
                    var RecaptchaOptions = {
                        theme : '<?php 
                echo $org_options['recaptcha_theme'] == '' ? 'red' : $org_options['recaptcha_theme'];
                ?>
',
                        lang : '<?php 
                echo $org_options['recaptcha_language'] == '' ? 'en' : $org_options['recaptcha_language'];
                ?>
'
                    };
                </script>
                <?php 
            }
            //This is the start of the registration form. This is where you can start editing your display.
            //(Shows the regsitration form if enough spaces exist)
            if ($num_attendees >= $reg_limit) {
                ?>
                <div class="espresso_event_full event-display-boxes" id="espresso_event_full-<?php 
                echo $event_id;
                ?>
">
                    <h3 class="event_title"><?php 
                echo stripslashes_deep($event_name);
                ?>
</h3>
                    <div class="event-messages">
                        <p class="event_full"><strong><?php 
                _e('We are sorry but this event has reached the maximum number of attendees!', 'event_espresso');
                ?>
</strong></p>
                        <p class="event_full"><strong><?php 
                _e('Please check back in the event someone cancels.', 'event_espresso');
                ?>
</strong></p>
                        <p class="num_attendees"><?php 
                _e('Current Number of Attendees:', 'event_espresso');
                ?>
 <?php 
                echo $num_attendees;
                ?>
</p>
                    </div>
                <?php 
                $num_attendees = get_number_of_attendees_reg_limit($event_id, 'num_attendees');
                //Get the number of attendees. Please visit http://eventespresso.com/forums/?p=247 for available parameters for the get_number_of_attendees_reg_limit() function.
                if ($num_attendees >= $reg_limit && ($allow_overflow == 'Y' && $overflow_event_id != 0)) {
                    ?>
                        <p id="register_link-<?php 
                    echo $overflow_event_id;
                    ?>
" class="register-link-footer"><a class="a_register_link ui-button ui-button-big ui-priority-primary ui-state-default ui-state-hover ui-state-focus ui-corner-all" id="a_register_link-<?php 
                    echo $overflow_event_id;
                    ?>
" href="<?php 
                    echo espresso_reg_url($overflow_event_id);
                    ?>
" title="<?php 
                    echo stripslashes_deep($event_name);
                    ?>
"><?php 
                    _e('Join Waiting List', 'event_espresso');
                    ?>
</a></p>
                    <?php 
                }
                ?>
                </div>

                    <?php 
            } else {
                $member_options = get_option('events_member_settings');
                //echo "<pre>".print_r($member_options,true)."</pre>";
                //If enough spaces exist then show the form
                //Check to see if the Members plugin is installed.
                if (function_exists('espresso_members_installed') && espresso_members_installed() == true && !is_user_logged_in() && ($member_only == 'Y' || $member_options['member_only_all'] == 'Y')) {
                    event_espresso_user_login();
                } else {
                    //Serve up the registration form
                    //As of version 3.0.17 the registration details have been moved to registration_form.php
                    require 'registration_page_display.php';
                }
            }
            //End if ($num_attendees >= $reg_limit) (Shows the regsitration form if enough spaces exist)
        } else {
            //If there are no results from the query, display this message
            echo '<h3>' . __('This event has expired or is no longer available.', 'event_espresso') . '</h3>';
        }
        echo espresso_registration_footer();
        //Check to see how many database queries were performed
        //echo '<p>Database Queries: ' . get_num_queries() .'</p>';
    }
开发者ID:sriram911,项目名称:pls,代码行数:101,代码来源:registration_page.php

示例7: event_espresso_edit_list


//.........这里部分代码省略.........
            $registration_end = $event_meta['registration_end'] = $event->registration_end;
            $registration_endT = $event_meta['registration_endT'] = $event->registration_endT;
            $status = event_espresso_get_is_active($event_id, $event_meta);
            //Get number of attendees
            $num_attendees = isset($attendees[$event_id]) ? $attendees[$event_id]->quantity : 0;
            $location = (!empty($event_address) ? $event_address : '') . (!empty($event_address2) ? '<br />' . $event_address2 : '') . (!empty($event_city) ? '<br />' . $event_city : '') . (!empty($event_state) ? ', ' . $event_state : '') . (!empty($event_zip) ? '<br />' . $event_zip : '') . (!empty($event_country) ? '<br />' . $event_country : '');
            $dow = date("D", strtotime($start_date));
            ob_start();
            ?>
						<tr>
							<td class="check-column" style="padding:7px 0 22px 7px; vertical-align:top;"><!--Delete Events-->
			<?php 
            echo '<input name="checkbox[' . $event_id . ']" type="checkbox"  title="Delete Event ' . $event_name . '" />';
            ?>
</td>

							<td class="column-comments" style="padding-top:3px;"><?php 
            echo $event_id;
            ?>
</td>

							<td class="post-title page-title">
								<strong><a class="row-title" href="admin.php?page=events&action=edit&event_id=<?php 
            echo $event_id;
            ?>
"><?php 
            echo $event_name;
            ?>
</a> <?php 
            echo $recurrence_id > 0 ? $recurrence_icon : '';
            ?>
 </strong>
								<div class="row-actions"><span><a href="<?php 
            echo espresso_reg_url($event_id);
            ?>
" target="_blank"><?php 
            _e('View', 'event_espresso');
            ?>
</a> | </span><span class='edit'><a href="admin.php?page=events&amp;action=edit&amp;event_id=<?php 
            echo $event_id;
            ?>
"><?php 
            _e('Edit', 'event_espresso');
            ?>
</a> | </span><span class='delete'><a onclick="return confirmDelete();" href='admin.php?page=events&amp;action=delete&amp;event_id=<?php 
            echo $event_id;
            ?>
'><?php 
            _e('Delete', 'event_espresso');
            ?>
</a></span> | <span><a href="admin.php?page=events&amp;event_admin_reports=list_attendee_payments&amp;event_id=<?php 
            echo $event_id;
            ?>
"><?php 
            _e('Attendees', 'event_espresso');
            ?>
</a> | </span><span><a href="#" onclick="window.location='<?php 
            echo get_bloginfo('wpurl') . "/wp-admin/admin.php?event_espresso&amp;event_id=" . $event_id . "&amp;export=report&action=payment&amp;type=excel";
            ?>
'" title="<?php 
            _e('Export to Excel', 'event_espresso');
            ?>
"><?php 
            _e('Export', 'event_espresso');
            ?>
</a></span></div>
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:67,代码来源:event_list.php

示例8: add_event_to_db


//.........这里部分代码省略.........
                } else {
                    _e('There was error finding a post template. Please verify your post templates are available.', 'event_espresso');
                }
            } elseif ($post_type == 'espresso_event') {
                ob_start();
                echo $event_desc;
                $post_content = ob_get_contents();
                ob_end_clean();
            }
            $my_post = array();
            $my_post['post_title'] = esc_html($_REQUEST['event']);
            $my_post['post_content'] = $post_content;
            $my_post['post_status'] = 'publish';
            $my_post['post_author'] = $_REQUEST['user'];
            $my_post['post_category'] = $_REQUEST['post_category'];
            $my_post['tags_input'] = $_REQUEST['post_tags'];
            $my_post['post_type'] = $post_type;
            //print_r($my_post);
            // Insert the post into the database
            $post_id = wp_insert_post($my_post);
            // Store the POST ID so it can be displayed on the edit page
            $sql = array('post_id' => $post_id, 'post_type' => $post_type);
            add_post_meta($post_id, 'event_id', $last_event_id);
            add_post_meta($post_id, 'event_identifier', $event_identifier);
            add_post_meta($post_id, 'event_start_date', $_REQUEST['start_date']);
            add_post_meta($post_id, 'event_end_date', $_REQUEST['end_date']);
            add_post_meta($post_id, 'event_location', $event_location);
            add_post_meta($post_id, 'virtual_url', $virtual_url);
            add_post_meta($post_id, 'virtual_phone', $virtual_phone);
            add_post_meta($post_id, 'event_address', $address);
            add_post_meta($post_id, 'event_address2', $address2);
            add_post_meta($post_id, 'event_city', $city);
            add_post_meta($post_id, 'event_state', $state);
            add_post_meta($post_id, 'event_country', $country);
            add_post_meta($post_id, 'event_phone', $phone);
            add_post_meta($post_id, 'venue_title', $venue_title);
            add_post_meta($post_id, 'venue_url', $venue_url);
            add_post_meta($post_id, 'venue_phone', $venue_phone);
            add_post_meta($post_id, 'venue_image', $venue_image);
            add_post_meta($post_id, 'event_externalURL', $externalURL);
            add_post_meta($post_id, 'event_reg_limit', $reg_limit);
            add_post_meta($post_id, 'event_start_time', time_to_24hr($start_time));
            add_post_meta($post_id, 'event_end_time', time_to_24hr($end_time));
            add_post_meta($post_id, 'event_registration_start', $registration_start);
            add_post_meta($post_id, 'event_registration_end', $registration_end);
            add_post_meta($post_id, 'event_registration_startT', $registration_startT);
            add_post_meta($post_id, 'event_registration_endT', $registration_endT);
            //add_post_meta( $post_id, 'timezone_string', $_REQUEST['timezone_string'] );
            $sql_data = array('%d', '%s');
            $update_id = array('id' => $last_event_id);
            $wpdb->update(EVENTS_DETAIL_TABLE, $sql, $update_id, $sql_data, array('%d'));
        }
        if (empty($error)) {
            ?>
            <div id="message" class="updated fade"><p><strong><?php 
            _e('The event', 'event_espresso');
            ?>
                        <a href="<?php 
            echo espresso_reg_url($last_event_id);
            ?>
" target="_blank"><?php 
            echo stripslashes_deep($_REQUEST['event']);
            ?>
</a>

            <?php 
            _e('has been added for ', 'event_espresso');
            echo date("m/d/Y", strtotime($start_date));
            ?>
 <a href="admin.php?page=events&action=edit&event_id=<?php 
            echo $last_event_id;
            ?>
"><?php 
            _e('Edit this event?', 'event_espresso');
            ?>
</a></strong></p></div>
        <?php 
        } else {
            ?>
            <div id="message" class="error"><p><strong><?php 
            _e('There was an error in your submission, please try again. The event was not saved!', 'event_espresso');
            print $wpdb->print_error();
            ?>
.</strong></p></div>
            <?php 
        }
    }
    /*
     * With the recursion of this function, additional recurring events will be added
     */
    if (isset($recurrence_dates) && count($recurrence_dates) > 0) {
        foreach ($recurrence_dates as $k => $v) {
            add_event_to_db(array('recurrence_id' => $recurrence_id, 'recurrence_start_date' => $v['start_date'], 'recurrence_event_end_date' => $v['event_end_date'], 'registration_start' => $v['registration_start'], 'registration_end' => $v['registration_end'], 'visible_on' => $v['visible_on']));
        }
    }
    /*
     * End recursion, as part of recurring events.
     */
    return $last_event_id;
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:101,代码来源:insert_event.php

示例9: get_number_of_attendees_reg_limit

        $use_groupon_code = $data->event->use_groupon_code;
    }
    //Set a default value for additional limit
    if ($additional_limit == '') {
        $additional_limit = '5';
    }
    $num_attendees = get_number_of_attendees_reg_limit($event_id, 'num_attendees');
    //Get the number of attendees
    $available_spaces = get_number_of_attendees_reg_limit($event_id, 'available_spaces');
    //Gets a count of the available spaces
    $number_available_spaces = get_number_of_attendees_reg_limit($event_id, 'number_available_spaces');
    //Gets the number of available spaces
    //echo $number_available_spaces;
    global $all_meta;
    $all_meta = array('event_name' => '<p class="section-title">' . stripslashes_deep($event_name) . '</span>', 'event_desc' => stripslashes_deep($event_desc), 'event_address' => $event_address, 'event_address2' => $event_address2, 'event_city' => $event_city, 'event_state' => $event_state, 'event_zip' => $event_zip, 'event_country' => $event_country, 'venue_title' => '<span class="section-title">' . $venue_title . '</span>', 'venue_address' => $venue_address, 'venue_address2' => $venue_address2, 'venue_city' => $venue_city, 'venue_state' => $venue_state, 'venue_country' => $venue_country, 'is_active' => $data->event->is_active, 'event_status' => $data->event->event_status, 'start_time' => $data->event->start_time, 'start_time' => empty($data->event->start_time) ? '' : $data->event->start_time, 'registration_startT' => $data->event->registration_startT, 'registration_start' => $data->event->registration_start, 'registration_endT' => $data->event->registration_endT, 'registration_end' => $data->event->registration_end, 'event_address' => empty($data->event->event_address) ? '' : $data->event->event_address, 'start_date' => '<span class="section-title">' . event_espresso_no_format_date($start_date, get_option('date_format')) . '</span>', 'end_date' => '<span class="section-title">' . event_date_display($end_date, get_option('date_format')) . '</span>', 'google_map_link' => $google_map_link);
    $registration_url = $externalURL != '' ? $externalURL : espresso_reg_url($event_id);
    //print_r($all_meta);
    //This function gets the status of the event.
    $is_active = array();
    $is_active = event_espresso_get_is_active(0, $all_meta);
}
/**
 * this is the original database stuff
 */
/*
	$sql  = "SELECT * FROM " .EVENTS_DETAIL_TABLE. " WHERE event_status != 'D' AND id = " . $event_id;

	if ($wpdb->get_results($sql)){
			$events = $wpdb->get_results($sql);
			foreach ($events as $event){ //These are the variables that can be used throughout the regsitration page
					$event_id = $event->id;
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:31,代码来源:event_post.php

示例10: ee_create_autocomplete_search

function ee_create_autocomplete_search()
{
    global $wpdb, $espresso_manager, $current_user, $org_options;
    $array = array('ee_search' => 'true');
    $url = add_query_arg($array, get_permalink($org_options['event_page_id']));
    ob_start();
    ?>
	<div id="espresso-search-form-dv" class="ui-widget">
		<form name="form" method="post" action="<?php 
    echo $url;
    ?>
">
			<input id="ee_autocomplete" name="ee_name" class="ui-autocomplete-input ui-corner-all" />
			<input id="ee_search_submit" name="ee_search_submit" class="ui-button ui-button-big ui-priority-primary ui-state-default ui-state-hover ui-state-focus ui-corner-all" type="submit" value="Search" />
			<input id="event_id" name="event_id" type="hidden">
		</form>
	</div>
<?php 
    $ee_autocomplete_params = array();
    $SQL = "SELECT e.*";
    if (isset($org_options['use_venue_manager']) && $org_options['use_venue_manager'] == 'Y') {
        $SQL .= ", v.city venue_city, v.state venue_state, v.name venue_name, v.address venue_address, v.city venue_city, v.state venue_state, v.zip venue_zip, v.country venue_country, v.meta venue_meta ";
    }
    $SQL .= " FROM " . EVENTS_DETAIL_TABLE . " e ";
    if (isset($org_options['use_venue_manager']) && $org_options['use_venue_manager'] == 'Y') {
        $SQL .= " LEFT JOIN " . EVENTS_VENUE_REL_TABLE . " vr ON vr.event_id = e.id LEFT JOIN " . EVENTS_VENUE_TABLE . " v ON v.id = vr.venue_id ";
    }
    $SQL .= " WHERE e.is_active = 'Y' ";
    $SQL .= " AND e.event_status != 'D' ";
    //echo '<p>$sql = '.$sql.'</p>';
    $events = $wpdb->get_results($SQL);
    $num_rows = $wpdb->num_rows;
    if ($num_rows > 0) {
        foreach ($events as $event) {
            $venue_city = !empty($event->venue_city) ? stripslashes_deep($event->venue_city) : '';
            $venue_state = !empty($event->venue_state) ? (!empty($event->venue_city) ? ', ' : '') . stripslashes_deep($event->venue_state) : '';
            $venue_name = !empty($event->venue_name) ? ' @' . stripslashes_deep($event->venue_name) . ' - ' . $venue_city . $venue_state . '' : '';
            //An Array of Objects with label and value properties:
            $ee_autocomplete_params[] = array('url' => espresso_reg_url($event->id), 'value' => stripslashes_deep($event->event_name) . $venue_name, 'id' => $event->id);
            //echo '{ url:"'.espresso_reg_url($event->id).'", value: "'.stripslashes_deep($event->event_name) . $venue_name .'", id: "'.$event->id.'" },';
        }
    }
    wp_register_script('espresso_autocomplete', EVENT_ESPRESSO_PLUGINFULLURL . "scripts/espresso_autocomplete.js", array('jquery-ui-autocomplete'), '1.0.0', TRUE);
    wp_enqueue_script('espresso_autocomplete');
    wp_localize_script('espresso_autocomplete', 'ee_autocomplete_params', $ee_autocomplete_params);
    //Load scripts
    add_action('wp_footer', 'ee_load_jquery_autocomplete_scripts');
    $buffer = ob_get_contents();
    ob_end_clean();
    return $buffer;
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:51,代码来源:shortcodes.php

示例11: espresso_confirm_registration

function espresso_confirm_registration()
{
    do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, '');
    global $wpdb, $org_options;
    if (!empty($_POST['confirm_registration'])) {
        $registration_id = sanitize_text_field($_POST['registration_id']);
    } else {
        wp_die(__('An error has occured. The registration ID could not be found.', 'event_espresso'));
    }
    echo '<div id="espresso-payment_page-dv" >';
    do_action('action_hook_espresso_confirmation_page_before', $registration_id);
    //Get the questions for the attendee
    $SQL = "SELECT ea.answer, eq.question FROM " . EVENTS_ANSWER_TABLE . " ea ";
    $SQL .= "LEFT JOIN " . EVENTS_QUESTION_TABLE . " eq ON eq.id = ea.question_id ";
    $SQL .= "WHERE ea.registration_id = %s ";
    $SQL .= "AND system_name IS NULL ORDER BY eq.sequence asc ";
    $questions = $wpdb->get_results($wpdb->prepare($SQL, $registration_id));
    //echo $wpdb->last_query;
    $display_questions = '';
    foreach ($questions as $question) {
        $question->question = trim(stripslashes(str_replace('&#039;', "'", $question->question)));
        $question->question = htmlspecialchars($question->question, ENT_QUOTES, 'UTF-8');
        $question->answer = trim(stripslashes(str_replace('&#039;', "'", $question->answer)));
        $question->answer = htmlspecialchars($question->answer, ENT_QUOTES, 'UTF-8');
        $display_questions .= '<p class="espresso_questions"><strong>' . $question->question . '</strong>:<br /> ' . str_replace(',', '<br />', $question->answer) . '</p>';
    }
    //Get the event information
    $SQL = "SELECT ed.*  FROM " . EVENTS_DETAIL_TABLE . " ed ";
    $SQL .= "JOIN " . EVENTS_ATTENDEE_TABLE . " ea ON ed.id = ea.event_id ";
    $SQL .= "WHERE ea.registration_id=%s";
    $events = $wpdb->get_results($wpdb->prepare($SQL, $registration_id));
    foreach ($events as $event) {
        $event_id = $event->id;
        $event_name = stripslashes_deep($event->event_name);
        $event_desc = stripslashes_deep($event->event_desc);
        $display_desc = $event->display_desc;
        $event_identifier = $event->event_identifier;
        $reg_limit = $event->reg_limit;
        $active = $event->is_active;
        $send_mail = $event->send_mail;
        $conf_mail = $event->conf_mail;
        $email_id = $event->email_id;
        $alt_email = $event->alt_email;
        $start_date = event_date_display($event->start_date);
        $end_date = $event->end_date;
        $virtual_url = $event->virtual_url;
        $virtual_phone = $event->virtual_phone;
        $event_address = $event->address;
        $event_address2 = $event->address2;
        $event_city = $event->city;
        $event_state = $event->state;
        $event_zip = $event->zip;
        $event_country = $event->country;
        $location = ($event_address != '' ? $event_address : '') . ($event_address2 != '' ? '<br />' . $event_address2 : '') . ($event_city != '' ? '<br />' . $event_city : '') . ($event_state != '' ? ', ' . $event_state : '') . ($event_zip != '' ? '<br />' . $event_zip : '') . ($event_country != '' ? '<br />' . $event_country : '');
        $location_phone = $event->phone;
        $require_pre_approval = $event->require_pre_approval;
        $google_map_link = espresso_google_map_link(array('address' => $event_address, 'city' => $event_city, 'state' => $event_state, 'zip' => $event_zip, 'country' => $event_country));
    }
    //Build links
    $event_url = espresso_reg_url($event_id);
    $event_link = '<a href="' . $event_url . '">' . $event_name . '</a>';
    $SQL = "SELECT * FROM " . EVENTS_ATTENDEE_TABLE;
    if ($registration_id != '') {
        $SQL .= " WHERE registration_id = '" . $registration_id . "' ";
    } elseif ($attendee_id != '') {
        $SQL .= " WHERE id = '" . $attendee_id . "' ";
    } else {
        _e('No ID Supplied', 'event_espresso');
    }
    $SQL .= " AND is_primary = 1 ";
    $SQL .= " ORDER BY id ";
    $SQL .= " LIMIT 0,1 ";
    //Get the first attendees details
    if (!($attendee = $wpdb->get_row($wpdb->prepare($SQL, NULL)))) {
        wp_die(__('An error occured. The primary attendee could not be found.', 'event_espresso'));
    }
    $attendee_id = $attendee->id;
    $attendee_email = isset($attendee->email) ? $attendee->email : '';
    $lname = isset($attendee->lname) ? htmlspecialchars(stripslashes($attendee->lname), ENT_QUOTES, 'UTF-8') : '';
    $fname = isset($attendee->fname) ? htmlspecialchars(stripslashes($attendee->fname), ENT_QUOTES, 'UTF-8') : '';
    $address = isset($attendee->address) ? htmlspecialchars(stripslashes($attendee->address), ENT_QUOTES, 'UTF-8') : '';
    $address2 = isset($attendee->address2) ? htmlspecialchars(stripslashes($attendee->address2), ENT_QUOTES, 'UTF-8') : '';
    $city = isset($attendee->city) ? htmlspecialchars(stripslashes($attendee->city), ENT_QUOTES, 'UTF-8') : '';
    $state = isset($attendee->state) ? htmlspecialchars(stripslashes($attendee->state), ENT_QUOTES, 'UTF-8') : '';
    $country = isset($attendee->country) ? htmlspecialchars(stripslashes($attendee->country), ENT_QUOTES, 'UTF-8') : '';
    $zip = isset($attendee->zip) ? $attendee->zip : '';
    $payment_status = $attendee->payment_status;
    $txn_type = $attendee->txn_type;
    $amount_pd = (double) $attendee->amount_pd;
    $total_cost = (double) $attendee->total_cost;
    $payment_date = $attendee->payment_date;
    $phone = $attendee->phone;
    $event_time = $attendee->event_time;
    $end_time = $attendee->end_time;
    $date = $attendee->date;
    $pre_approve = $attendee->pre_approve;
    $session_id = $attendee->attendee_session;
    if ($attendee->is_primary) {
        $event_cost = $total_cost;
    }
//.........这里部分代码省略.........
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:101,代码来源:payment_page.php

示例12: event_espresso_get_event_details


//.........这里部分代码省略.........
         $event_address = $event->address;
         $event_address2 = $event->address2;
         $event_city = $event->city;
         $event_state = $event->state;
         $event_zip = $event->zip;
         $event_country = $event->country;
         $member_only = $event->member_only;
         $externalURL = $event->externalURL;
         $recurrence_id = $event->recurrence_id;
         $display_reg_form = $event->display_reg_form;
         $allow_overflow = $event->allow_overflow;
         $overflow_event_id = $event->overflow_event_id;
         $event_desc = array_shift(explode('<!--more-->', $event_desc));
         global $event_meta;
         $event_meta = unserialize($event->event_meta);
         $event_meta['is_active'] = $event->is_active;
         $event_meta['event_status'] = $event->event_status;
         $event_meta['start_time'] = empty($event->start_time) ? '' : $event->start_time;
         $event_meta['start_date'] = $event->start_date;
         $event_meta['registration_start'] = $event->registration_start;
         $event_meta['registration_startT'] = $event->registration_startT;
         $event_meta['registration_end'] = $event->registration_end;
         $event_meta['registration_endT'] = $event->registration_endT;
         //Venue information
         if ($org_options['use_venue_manager'] == 'Y') {
             $event_address = empty($event->venue_address) ? '' : $event->venue_address;
             $event_address2 = empty($event->venue_address2) ? '' : $event->venue_address2;
             $event_city = empty($event->venue_city) ? '' : $event->venue_city;
             $event_state = empty($event->venue_state) ? '' : $event->venue_state;
             $event_zip = empty($event->venue_zip) ? '' : $event->venue_zip;
             $event_country = empty($event->venue_country) ? '' : $event->venue_country;
             //Leaving these variables intact, just in case people want to use them
             $venue_title = empty($event->venue_name) ? '' : $event->venue_name;
             $venue_address = $event_address;
             $venue_address2 = $event_address2;
             $venue_city = $event_city;
             $venue_state = $event_state;
             $venue_zip = $event_zip;
             $venue_country = $event_country;
             global $venue_meta;
             $add_venue_meta = array('venue_title' => $venue_title, 'venue_address' => $event_address, 'venue_address2' => $event_address2, 'venue_city' => $event_city, 'venue_state' => $event_state, 'venue_country' => $event_country);
             $venue_meta = !empty($event->venue_meta) && !empty($add_venue_meta) ? array_merge(unserialize($event->venue_meta), $add_venue_meta) : '';
             //print_r($venue_meta);
         }
         //Address formatting
         $location = ($event_address != '' ? $event_address : '') . ($event_address2 != '' ? '<br />' . $event_address2 : '') . ($event_city != '' ? '<br />' . $event_city : '') . ($event_state != '' ? ', ' . $event_state : '') . ($event_zip != '' ? '<br />' . $event_zip : '') . ($event_country != '' ? '<br />' . $event_country : '');
         //Google map link creation
         $google_map_link = espresso_google_map_link(array('address' => $event_address, 'city' => $event_city, 'state' => $event_state, 'zip' => $event_zip, 'country' => $event_country, 'text' => 'Map and Directions', 'type' => 'text'));
         global $all_meta;
         $all_meta = array('event_name' => stripslashes_deep($event_name), 'event_desc' => stripslashes_deep($event_desc), 'event_address' => $event_address, 'event_address2' => $event_address2, 'event_city' => $event_city, 'event_state' => $event_state, 'event_zip' => $event_zip, 'is_active' => $event->is_active, 'event_status' => $event->event_status, 'start_time' => empty($event->start_time) ? '' : $event->start_time, 'registration_startT' => $event->registration_startT, 'registration_start' => $registration_start, 'registration_endT' => $event->registration_endT, 'registration_end' => $registration_end, 'is_active' => empty($is_active) ? '' : $is_active, 'event_country' => $event_country, 'start_date' => event_date_display($start_date, get_option('date_format')), 'end_date' => event_date_display($end_date, get_option('date_format')), 'time' => empty($event->start_time) ? '' : $event->start_time, 'google_map_link' => $google_map_link, 'price' => empty($event->event_cost) ? '' : $event->event_cost, 'event_cost' => empty($event->event_cost) ? '' : $event->event_cost);
         //Debug
         //echo '<p>'.print_r($all_meta).'</p>';
         //These variables can be used with other the espresso_countdown, espresso_countup, and espresso_duration functions and/or any javascript based functions.
         //Warning: May cause additional database queries an should only be used for sites with a small amount of events.
         // $start_timestamp = espresso_event_time($event_id, 'start_timestamp');
         //$end_timestamp = espresso_event_time($event_id, 'end_timestamp');
         //This can be used in place of the registration link if you are using the external URL feature
         $registration_url = $externalURL != '' ? $externalURL : espresso_reg_url($event_id);
         if (!is_user_logged_in() && get_option('events_members_active') == 'true' && $member_only == 'Y') {
             //Display a message if the user is not logged in.
             //_e('Member Only Event. Please ','event_espresso') . event_espresso_user_login_link() . '.';
         } else {
             //Serve up the event list
             //As of version 3.0.17 the event list details have been moved to event_list_display.php
             switch (event_espresso_get_status($event_id)) {
                 case 'NOT_ACTIVE':
                     //Don't show the event if any of the above are true
                     break;
                 default:
                     /* skip secondary (waitlist) events */
                     $event_status = event_espresso_get_is_active($event_id);
                     if ($event_status['status'] == 'SECONDARY') {
                         break;
                     }
                     /* group recurring events */
                     $is_new_event_type = $last_recurrence_id == 0 || $last_recurrence_id != $recurrence_id;
                     if ($is_new_event_type) {
                         $events_type_index++;
                         $events_of_same_type[$events_type_index] = array();
                     }
                     $event_data = array('event_id' => $event_id, 'event_page_id' => $event_page_id, 'event_name' => $event_name, 'event_desc' => $event_desc, 'start_date' => $start_date, 'end_date' => $end_date, 'reg_limit' => $reg_limit, 'registration_url' => $registration_url, 'overflow_event_id' => $overflow_event_id);
                     array_push($events_of_same_type[$events_type_index], $event_data);
                     $last_recurrence_id = $recurrence_id;
                     break;
             }
         }
     }
     /* group recurring events */
     foreach ($events_of_same_type as $events_group) {
         if (empty($path)) {
             include $template_name;
         } else {
             include $path;
         }
     }
     /* end group recurring events */
     //Check to see how many database queries were performed
     //echo '<p>Database Queries: ' . get_num_queries() .'</p>';
     espresso_registration_footer();
 }
开发者ID:hhgr,项目名称:uksoccer,代码行数:101,代码来源:event_list.php

示例13: get_calendar_events


//.........这里部分代码省略.........
                //				echo '<h4>$path_to_thumbnail : ' . $path_to_thumbnail . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
                if ($path_to_thumbnail) {
                    $events[$cntr]['event_img_thumb'] = '
					<span class="thumb-wrap">
						<img id="ee-event-thumb-' . $event->id . '" class="ee-event-thumb" src="' . $path_to_thumbnail . '" alt="image of ' . $events[$cntr]['title'] . '" />
					</span>';
                    $events[$cntr]['className'] .= ' event-has-thumb';
                }
            }
            //Custom fields:
            //These can be used to perform special functions in your display.
            //This decalares the category ID as the CSS class name
            $events[$cntr]['eventType'] = '';
            if ($use_categories) {
                if ($enable_cat_classes) {
                    if (isset($event_categories[$event->id])) {
                        foreach ($event_categories[$event->id] as $cat) {
                            //This is the css class name
                            $events[$cntr]['className'] .= ' ' . $cat->category_identifier;
                        }
                        // set event type to the category id
                        $events[$cntr]['eventType'] = isset($primary_cat->category_name) && !empty($primary_cat->category_name) ? $primary_cat->category_name : '';
                    } else {
                        //This is the css class name
                        $events[$cntr]['className'] .= isset($event->category_identifier) ? ' ' . $event->category_identifier : '';
                        // set event type to the category id
                        $events[$cntr]['eventType'] .= isset($event->category_name) ? ' ' . $event->category_name : '';
                    }
                }
            }
            //			$this->timer->stop();
            //			echo $this->timer->get_elapse( __LINE__ );
            //			$this->timer->start();
            if ($show_tooltips) {
                // gets the description of the event. This can be used for hover effects such as jQuery Tooltips or QTip
                $event_desc = do_shortcode($event->event_desc);
                $events[$cntr]['description'] = wpautop(stripslashes($event_desc));
                // use short descriptions
                $event_desc_short = explode('<!--more-->', $events[$cntr]['description']);
                $event_desc_short = reset($event_desc_short);
                $events[$cntr]['description'] = $event_desc_short;
                // tooltip wrapper
                $events[$cntr]['tooltip'] = '<div class="ui-tooltip-content qtip_info">';
                // show time ?
                $events[$cntr]['tooltip'] .= $show_time && $startTime ? '<p class="time_cal_qtip">' . __('Event Time: ', 'event_espresso') . $startTime . ' - ' . $endTime . '</p>' : '';
                // check attendee reg limit
                $num_completed = 0;
                $a_sql = "SELECT SUM(quantity) quantity FROM " . EVENTS_ATTENDEE_TABLE . " WHERE event_id=%d AND (payment_status='Completed' OR payment_status='Pending' OR payment_status='Refund') ";
                $wpdb->get_results($wpdb->prepare($a_sql, $event->id), ARRAY_A);
                if ($wpdb->num_rows > 0 && $wpdb->last_result[0]->quantity != NULL) {
                    $num_completed = $wpdb->last_result[0]->quantity;
                }
                $reg_limit = $event->reg_limit;
                $allow_overflow = $event->allow_overflow;
                // add attendee limit if set
                if ($show_attendee_limit) {
                    $attendee_limit = $reg_limit >= 999999 ? __('Available Spaces: unlimited', 'event_espresso') : __('Registrations / Spaces: ', 'event_espresso') . $num_completed . ' / ' . $reg_limit;
                    $events[$cntr]['tooltip'] .= ' <p class="attendee_limit_qtip">' . $attendee_limit . '</p>';
                }
                //add link
                $regButtonText = $event->display_reg_form == 'Y' ? __('Register Now', 'event_espresso') : __('View Details', 'event_espresso');
                // reg open
                if (!$expired && $not_open) {
                    $events[$cntr]['tooltip'] .= '<div class="sold-out-dv">' . __('Registration Not Open', 'event_espresso') . '</div>';
                } else {
                    if ($num_completed < $reg_limit && !$expired) {
                        $events[$cntr]['tooltip'] .= '<a class="ui-state-active reg-now-btn" href="' . $events[$cntr]['url'] . '">' . $regButtonText . '</a>';
                    } else {
                        if ($num_completed >= $reg_limit && $allow_overflow == 'N' && !$expired) {
                            $events[$cntr]['tooltip'] .= '<div class="sold-out-dv">' . __('Sold Out', 'event_espresso') . '</div>';
                        } else {
                            if ($num_completed >= $reg_limit && $allow_overflow == 'Y' && !$expired) {
                                $overflow_event_id = $event->overflow_event_id;
                                $overflow_event_url = espresso_reg_url($overflow_event_id);
                                $events[$cntr]['tooltip'] .= '<a class="ui-state-active reg-now-btn" href="' . $overflow_event_url . '">' . __('Join Waiting List', 'event_espresso') . '</a>';
                            } else {
                                $events[$cntr]['tooltip'] .= '<div class="sold-out-dv">' . __('Registration Closed', 'event_espresso') . '</div>';
                            }
                        }
                    }
                }
                $events[$cntr]['tooltip'] .= '<div class="clear"></div>';
                $events[$cntr]['tooltip'] .= '</div>';
                // Position my top left...
                $events[$cntr]['tooltip_my'] = $tooltip_my;
                $events[$cntr]['tooltip_at'] = $tooltip_at;
                $events[$cntr]['tooltip_style'] = $tooltip_style;
            } else {
                $events[$cntr]['show_tooltips'] = FALSE;
            }
            // If set to true, events will be shown as all day events
            $events[$cntr]['allDay'] = FALSE;
            $cntr++;
            //			$this->timer->stop();
            //			echo $this->timer->get_elapse( __LINE__ );
        }
        //		echo '<h3>$events</h3><pre style="height:auto;border:2px solid lightblue;">' . print_r( $events, TRUE ) . '</pre><br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>';
        echo json_encode($events);
        die;
    }
开发者ID:hhgr,项目名称:uksoccer,代码行数:101,代码来源:espresso-calendar.php

示例14: espresso_calendar_do_stuff


//.........这里部分代码省略.........
        $this_event_id = $event->id;
        //Get details about the category of the event
        if ($use_categories) {
            // extract info from separate array of category data ?
            if (isset($event_categories[$event->id]) && $type == 'all') {
                // get first element of array without modifying original array
                $primary_cat = array_shift(array_values($event_categories[$event->id]));
                $category_data['category_meta'] = unserialize($primary_cat->category_meta);
            } else {
                if ($type == 'cat') {
                    // or was one category set via the shortcode
                    $category_data['category_meta'] = unserialize($event->category_meta);
                } else {
                    $category_data['category_meta'] = array();
                }
            }
            //Assign colors to events by category
            if (isset($category_data['category_meta']['use_pickers']) && $category_data['category_meta']['use_pickers'] == 'Y') {
                $eventArray['color'] = $category_data['category_meta']['event_background'];
                $eventArray['textColor'] = $category_data['category_meta']['event_text_color'];
            }
        }
        $event_meta = unserialize($event->event_meta);
        //If the version of Event Espresso is 3.2 or older, we need to use the new permalink structure. If not, then we need to default to the structure.
        if (function_exists('espresso_version')) {
            if (espresso_version() >= '3.2.P') {
                switch ($espresso_calendar['espresso_page_post']) {
                    case 'P':
                        $registration_url = get_permalink($event->post_id);
                        break;
                    case 'R':
                    default:
                        //$registration_url = get_home_url(). '/?page_id=' . $org_options['event_page_id'] . '&regevent_action=register&event_id=' . $event->id;
                        $registration_url = espresso_reg_url($event->id, $event->slug);
                        break;
                }
            } else {
                switch ($espresso_calendar['espresso_page_post']) {
                    case 'P':
                        $registration_url = get_home_url() . '/?p=' . $event->post_id;
                        break;
                    case 'R':
                    default:
                        $registration_url = get_home_url() . '/?page_id=' . $org_options['event_page_id'] . '&regevent_action=register&event_id=' . $event->id;
                        break;
                }
            }
        }
        //Checkthe status of the event. If the event is expired, the link to the registration page will be deactivated.
        $eventArray['url'] = '';
        $status = '';
        //Changed 8-30-2011 by Seth
        /* switch (event_espresso_get_status($event->id)){
        	  case 'NOT_ACTIVE':
        	  $status = ' - ' . __('Expired','event_espresso');
        	  break;
        	  case 'ACTIVE':
        	  $status = '';
        	  break;
        	  } */
        //End Seth
        // Build calendar array from $event data
        //Gets the URL of the event and links the event to the registration form.
        $eventArray['url'] = $event->externalURL != '' ? htmlspecialchars_decode($event->externalURL) : $registration_url;
        //Id of the event
        $eventArray['id'] = $event->id;
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:67,代码来源:espresso-calendar.php

示例15: add_event_to_db


//.........这里部分代码省略.........
            $my_post = array();
            $my_post['post_title'] = sanitize_text_field($_REQUEST['event']);
            $my_post['post_content'] = $post_content;
            $my_post['post_status'] = 'publish';
            $my_post['post_author'] = !empty($_REQUEST['user']) ? $_REQUEST['user'] : '';
            $my_post['post_category'] = !empty($_REQUEST['post_category']) ? $_REQUEST['post_category'] : '';
            $my_post['tags_input'] = !empty($_REQUEST['post_tags']) ? $_REQUEST['post_tags'] : '';
            $my_post['post_type'] = !empty($post_type) ? $post_type : 'post';
            //print_r($my_post);
            // Insert the post into the database
            $post_id = wp_insert_post($my_post);
            // Store the POST ID so it can be displayed on the edit page
            $sql = array('post_id' => $post_id, 'post_type' => $post_type);
            add_post_meta($post_id, 'event_id', $last_event_id);
            add_post_meta($post_id, 'event_meta', $event_meta);
            add_post_meta($post_id, 'event_identifier', $event_identifier);
            add_post_meta($post_id, 'event_start_date', $start_date);
            add_post_meta($post_id, 'event_end_date', $end_date);
            add_post_meta($post_id, 'event_location', $event_location);
            add_post_meta($post_id, 'event_thumbnail_url', $event_thumbnail_url);
            add_post_meta($post_id, 'virtual_url', $virtual_url);
            add_post_meta($post_id, 'virtual_phone', $virtual_phone);
            add_post_meta($post_id, 'event_address', $address);
            add_post_meta($post_id, 'event_address2', $address2);
            add_post_meta($post_id, 'event_city', $city);
            add_post_meta($post_id, 'event_state', $state);
            add_post_meta($post_id, 'event_country', $country);
            add_post_meta($post_id, 'event_phone', $phone);
            add_post_meta($post_id, 'venue_title', $venue_title);
            add_post_meta($post_id, 'venue_url', $venue_url);
            add_post_meta($post_id, 'venue_phone', $venue_phone);
            add_post_meta($post_id, 'venue_image', $venue_image);
            add_post_meta($post_id, 'event_externalURL', $externalURL);
            add_post_meta($post_id, 'event_reg_limit', $reg_limit);
            add_post_meta($post_id, 'event_start_time', time_to_24hr($start_time));
            add_post_meta($post_id, 'event_end_time', time_to_24hr($end_time));
            add_post_meta($post_id, 'event_registration_start', $registration_start);
            add_post_meta($post_id, 'event_registration_end', $registration_end);
            add_post_meta($post_id, 'event_registration_startT', $registration_startT);
            add_post_meta($post_id, 'event_registration_endT', $registration_endT);
            //add_post_meta( $post_id, 'timezone_string', $_REQUEST['timezone_string'] );
            $sql_data = array('%d', '%s');
            $update_id = array('id' => $last_event_id);
            $wpdb->update(EVENTS_DETAIL_TABLE, $sql, $update_id, $sql_data, array('%d'));
        }
        if (empty($error)) {
            ?>
			<div id="message" class="updated fade"><p><strong><?php 
            _e('The event', 'event_espresso');
            ?>
			<a href="<?php 
            echo espresso_reg_url($last_event_id);
            ?>
" target="_blank">
				<?php 
            echo htmlentities(stripslashes(sanitize_text_field($_REQUEST['event'])), ENT_QUOTES, 'UTF-8');
            ?>
				
			</a>

			<?php 
            _e('has been added for ', 'event_espresso');
            echo date("m/d/Y", strtotime($start_date));
            ?>
 <a href="<?php 
            echo admin_url();
            ?>
admin.php?page=events&action=edit&event_id=<?php 
            echo $last_event_id;
            ?>
"><?php 
            _e('Edit this event?', 'event_espresso');
            ?>
</a></strong></p></div>
		<?php 
        } else {
            ?>
			<div id="message" class="error"><p><strong><?php 
            _e('There was an error in your submission. The event was not saved! Please try again.', 'event_espresso');
            ?>
 <?php 
            print $wpdb->print_error();
            ?>
</strong></p></div>
			<?php 
        }
    }
    //With the recursion of this function, additional recurring events will be added
    if (isset($recurrence_dates) && count($recurrence_dates) > 0) {
        foreach ($recurrence_dates as $k => $v) {
            add_event_to_db(array('recurrence_id' => $recurrence_id, 'recurrence_start_date' => $v['start_date'], 'recurrence_event_end_date' => $v['event_end_date'], 'registration_start' => $v['registration_start'], 'registration_end' => $v['registration_end']));
        }
    }
    $_REQUEST['event_id'] = !empty($last_event_id) ? $last_event_id : '';
    do_action('action_hook_espresso_insert_event_success', $_REQUEST);
    //If not using the FEM addon, then we return the event id
    if (!$use_fem === TRUE) {
        return @$last_event_id;
    }
}
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:101,代码来源:insert_event.php


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