• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP espresso_member_data函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: espresso_is_my_event

 function espresso_is_my_event($event_id)
 {
     global $wpdb;
     if (current_user_can('administrator') || espresso_member_data('role') == 'espresso_event_admin') {
         return true;
     }
 }
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:7,代码来源:espresso-permissions.php


示例2: edit_event_venue

function edit_event_venue()
{
    global $wpdb;
    $id = $_REQUEST['id'];
    $sql = "SELECT * FROM " . EVENTS_VENUE_TABLE . " v WHERE v.id ='" . $id . "' ";
    if (function_exists('espresso_member_data') && espresso_member_data('role') == 'espresso_event_manager') {
        $sql .= " AND v.wp_user = '" . espresso_member_data('id') . "' ";
    }
    //echo $sql;
    $results = $wpdb->get_results($sql);
    if (!$wpdb->num_rows > 0) {
        return;
    }
    foreach ($results as $result) {
        $venue_id = $result->id;
        $name = stripslashes_deep($result->name);
        $address = stripslashes_deep($result->address);
        $address2 = stripslashes_deep($result->address2);
        $city = stripslashes_deep($result->city);
        $state = stripslashes_deep($result->state);
        $zip = stripslashes_deep($result->zip);
        $country = stripslashes_deep($result->country);
        $meta = unserialize($result->meta);
        $last_locale_id = $wpdb->get_var("SELECT locale_id FROM " . EVENTS_LOCALE_REL_TABLE . " WHERE venue_id='" . $id . "'");
    }
    ?>
<!--Add event display-->

<div id="add-edit-venue" class="metabox-holder">
  <div class="postbox">
    <h3>
      <?php 
    _e('Edit Venue:', 'event_espresso');
    ?>
      <?php 
    echo stripslashes($name);
    ?>
</h3>
    <div class="inside">
      <form method="post" action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
">
        <input type="hidden" name="venue_id" value="<?php 
    echo $venue_id;
    ?>
">
        <input type="hidden" name="action" value="update">
        <table width="100%" border="0">
          <tr>
            <td align="left" valign="top">
								<ul>
                <li>
                  <label for="name">
                    <?php 
    _e('Name', 'event_espresso');
    ?>
                  </label>
                  <input type="text" id="name" name="name" size="25" value="<?php 
    echo $name;
    ?>
">
                </li>
                <li>
                  <label for="address">
                    <?php 
    _e('Address', 'event_espresso');
    ?>
                  </label>
                  <input type="text" id="address" name="address" size="25" value="<?php 
    echo $address;
    ?>
">
                </li>
                <li>
                  <label for="address2">
                    <?php 
    _e('Address 2', 'event_espresso');
    ?>
                  </label>
                  <input type="text" id="address2" name="address2" size="25" value="<?php 
    echo $address2;
    ?>
">
                </li>
                <li>
                  <label for="city">
                    <?php 
    _e('City', 'event_espresso');
    ?>
                  </label>
                  <input type="text" id="city" name="city" size="25" value="<?php 
    echo $city;
    ?>
">
                </li>
                <li>
                  <label for="state">
                    <?php 
    _e('State', 'event_espresso');
//.........这里部分代码省略.........
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:101,代码来源:edit_venue.php


示例3: event_espresso_edit_list

function event_espresso_edit_list()
{
    global $wpdb, $org_options;
    define('EVT_ADMIN_URL', admin_url('admin.php?page=events'));
    $max_rows = isset($_REQUEST['max_rows']) & !empty($_REQUEST['max_rows']) ? absint($_REQUEST['max_rows']) : 50;
    $start_rec = isset($_REQUEST['start_rec']) && !empty($_REQUEST['start_rec']) ? absint($_REQUEST['start_rec']) : 0;
    $records_to_show = " LIMIT {$max_rows} OFFSET {$start_rec} ";
    //Dates
    $curdate = date('Y-m-d');
    $this_year_r = date('Y');
    $this_month_r = date('m');
    $days_this_month = date('t', strtotime($curdate));
    $month_range = isset($_REQUEST['month_range']) && !empty($_REQUEST['month_range']) ? sanitize_text_field($_REQUEST['month_range']) : FALSE;
    $category_id = isset($_REQUEST['category_id']) && !empty($_REQUEST['category_id']) ? sanitize_text_field($_REQUEST['category_id']) : FALSE;
    $today_filter = isset($_REQUEST['today']) && $_REQUEST['today'] == 'true' ? TRUE : FALSE;
    $this_month_filter = isset($_REQUEST['this_month']) && $_REQUEST['this_month'] == 'true' ? TRUE : FALSE;
    $event_status = isset($_POST['event_status']) && !empty($_POST['event_status']) ? sanitize_text_field($_REQUEST['event_status']) : FALSE;
    if (isset($_POST['delete_event'])) {
        if (is_array($_POST['checkbox'])) {
            while (list($key, $value) = each($_POST['checkbox'])) {
                $del_id = $key;
                event_espresso_delete_event($del_id);
            }
        }
        ?>
		<div id="message" class="updated fade">
			<p><strong>
					<?php 
        _e('Event(s) have been permanently deleted.', 'event_espresso');
        ?>
				</strong></p>
		</div>
		<?php 
    }
    if (isset($_POST['perm_delete_event'])) {
        if (is_array($_POST['checkbox'])) {
            while (list($key, $value) = each($_POST['checkbox'])) {
                $del_id = $key;
                event_espresso_empty_event_trash($del_id);
            }
        }
        ?>

		<div id="message" class="updated fade">
			<p><strong>
					<?php 
        _e('Event(s) have been permanently deleted.', 'event_espresso');
        ?>
				</strong></p>
		</div>
		<?php 
    }
    $recurrence_icon = '';
    if (defined('EVENT_ESPRESSO_RECURRENCE_MODULE_ACTIVE')) {
        $recurrence_icon = '<img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/arrow_rotate_clockwise.png" alt="Recurring Event" title="Recurring Event" class="re_fr" />';
    }
    require_once 'queries.php';
    if (file_exists(EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/admin_reports_filters.php')) {
        require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/admin-files/admin_reports_filters.php';
    } else {
        echo '<p><strong>' . __('Advanced filters are now available in the premium versions.', 'event_espresso') . '</strong> <a href="http://eventespresso.com/download/" target="_blank">' . __('Upgrade Now!', 'event_espresso') . '</a></p>';
        //$total_events = espresso_total_events();
    }
    if ($month_range !== FALSE) {
        $pieces = explode('-', $month_range, 3);
        $year_r = $pieces[0];
        $month_r = $pieces[1];
    }
    $group = '';
    $sql = '';
    //Check if the venue manager is turned on
    $use_venue_manager = isset($org_options['use_venue_manager']) && $org_options['use_venue_manager'] == 'Y' ? TRUE : FALSE;
    $is_regional_manager = FALSE;
    //This checks to see if the user is a regional manager and creates a union to join the events that are in the users region based on the venue/locale combination
    if (function_exists('espresso_member_data') && espresso_member_data('role') == 'espresso_group_admin') {
        $is_regional_manager = TRUE;
        $group = get_user_meta(espresso_member_data('id'), "espresso_group", TRUE);
        if ($group != '0' && !empty($group)) {
            $sql = "(SELECT e.id event_id, e.event_name, e.event_identifier, e.reg_limit, e.registration_start, ";
            $sql .= " e.start_date, e.is_active, e.recurrence_id, e.registration_startT, e.wp_user ";
            //Get the venue information
            if ($use_venue_manager) {
                $sql .= ", v.name AS venue_title, v.address AS venue_address, v.address2 AS venue_address2, v.city AS venue_city, v.state AS venue_state, v.zip AS venue_zip, v.country AS venue_country ";
            } else {
                $sql .= ", e.venue_title, e.phone, e.address, e.address2, e.city, e.state, e.zip, e.country ";
            }
            //Get the locale fields
            if ($use_venue_manager) {
                $sql .= ", lc.name AS locale_name, e.wp_user ";
            }
            $sql .= " FROM " . EVENTS_DETAIL_TABLE . " e ";
            //Join the categories
            if ($today_filter) {
                $sql .= " JOIN " . EVENTS_CATEGORY_REL_TABLE . " cr ON cr.event_id = e.id ";
                $sql .= " JOIN " . EVENTS_CATEGORY_TABLE . " c ON  c.id = cr.cat_id ";
            }
            //Join the venues and locales
            if (!empty($group) && $use_venue_manager) {
                $sql .= " LEFT JOIN " . EVENTS_VENUE_REL_TABLE . " vr ON vr.event_id = e.id ";
                $sql .= " LEFT JOIN " . EVENTS_VENUE_TABLE . " v ON v.id = vr.venue_id ";
//.........这里部分代码省略.........
开发者ID:sriram911,项目名称:pls,代码行数:101,代码来源:event_list.php


示例4: add_event_espresso_menus


//.........这里部分代码省略.........
     add_submenu_page('event_espresso', __('Event Espresso - General Settings', 'event_espresso'), __('General Settings', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_general']), 'event_espresso', 'organization_config_mnu');
     //Event Setup
     add_submenu_page('event_espresso', __('Event Espresso - Event Overview', 'event_espresso'), __('Event Overview', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_events']), 'events', 'event_espresso_manage_events');
     //Seating chart management
     if (defined('ESPRESSO_SEATING_CHART')) {
         add_submenu_page('event_espresso', __('Event Espresso - Seating Chart', 'event_espresso'), __('Seating Chart', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_seating']), 'seating_chart', 'event_espresso_manage_seating_chart');
     }
     //Venues
     if (isset($org_options['use_venue_manager']) && $org_options['use_venue_manager'] == 'Y' && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Venue Manager', 'event_espresso'), __('Venue Manager', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_venue_manager']), 'event_venues', 'event_espresso_venue_config_mnu');
         //add_submenu_page('event_espresso', __('Event Espresso - Locales/Regions Manager','event_espresso'), __('Locale Manager','event_espresso'), 'administrator', 'event_locales', 'event_espresso_locale_config_mnu');
     }
     //Personnel
     if (isset($org_options['use_personnel_manager']) && $org_options['use_personnel_manager'] == 'Y' && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Staff Manager', 'event_espresso'), __('Staff Manager', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_personnel_manager']), 'event_staff', 'event_espresso_staff_config_mnu');
     }
     //Form Questions
     add_submenu_page('event_espresso', __('Event Espresso - Questions', 'event_espresso'), __('Questions', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_form_builder']), 'form_builder', 'event_espresso_questions_config_mnu');
     //Questions Groups
     add_submenu_page('event_espresso', __('Event Espresso - Question Groups', 'event_espresso'), __('Question Groups', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_form_groups']), 'form_groups', 'event_espresso_question_groups_config_mnu');
     //EventCategories
     add_submenu_page('event_espresso', __('Event Espresso - Manage Event Categories', 'event_espresso'), __('Categories', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_categories']), 'event_categories', 'event_espresso_categories_config_mnu');
     do_action('action_hook_espresso_add_new_ee_submenu');
     //Discounts
     if (function_exists('event_espresso_discount_config_mnu') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Promotional Codes', 'event_espresso'), __('Promotional Codes', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_discounts']), 'discounts', 'event_espresso_discount_config_mnu');
     }
     //Groupons
     if (function_exists('event_espresso_groupon_config_mnu') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Groupons', 'event_espresso'), __('Groupon Codes', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_groupons']), 'groupons', 'event_espresso_groupon_config_mnu');
     }
     //Email Manager
     if (function_exists('event_espresso_email_config_mnu') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Email Manager', 'event_espresso'), __('Email Manager', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_event_emails']), 'event_emails', 'event_espresso_email_config_mnu');
     }
     //Event styles & templates
     if (function_exists('event_espresso_manage_templates') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Template Settings', 'event_espresso'), __('Template Settings', 'event_espresso'), 'administrator', 'template_confg', 'event_espresso_manage_templates');
     }
     //Calendar Settings
     if (function_exists('espresso_calendar_config_mnu') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Calendar Settings', 'event_espresso'), __('Calendar Settings', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_calendar']), 'espresso_calendar', 'espresso_calendar_config_mnu');
     }
     //Payment Settings
     if (function_exists('event_espresso_gateways_options')) {
         add_submenu_page('event_espresso', __('Event Espresso - Payment Settings', 'event_espresso'), __('Payment Settings', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_payment_gateways']), 'payment_gateways', 'event_espresso_gateways_options');
     }
     //Member Settings
     if (function_exists('event_espresso_member_config_mnu') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Member Settings', 'event_espresso'), __('Member Settings', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_members']), 'members', 'event_espresso_member_config_mnu');
     }
     //MailChimp Integration Settings
     if (function_exists('event_espresso_mailchimp_settings') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - MailChimp Integration', 'event_espresso'), __('MailChimp Integration', 'event_espresso'), 'administrator', 'espresso-mailchimp', 'event_espresso_mailchimp_settings');
     }
     //Ticketing Settings
     if (function_exists('espresso_ticket_config_mnu') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Ticket Customization', 'event_espresso'), __('Ticket Templates', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_ticketing']), 'event_tickets', 'espresso_ticket_config_mnu');
     }
     //Facebook Event Integration Settings
     if (function_exists('espresso_fb_settings') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Facebook Settings', 'event_espresso'), __('Facebook Settings', 'event_espresso'), 'administrator', 'espresso_facebook', 'espresso_fb_settings');
     }
     //Reports
     if (function_exists('espresso_reports') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Reports', 'event_espresso'), __('Reports', 'event_espresso'), 'administrator', 'espresso_reports', 'espresso_reports');
     }
     //Attendee Import
     if (function_exists('espresso_attendee_import') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Attendee Import Tool', 'event_espresso'), __('Attendee Import', 'event_espresso'), 'administrator', 'espresso_attendee_import', 'espresso_attendee_import');
     }
     //Voucher Import
     if (function_exists('espresso_voucher_import') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Voucher Import Tool', 'event_espresso'), __('Voucher Import', 'event_espresso'), 'administrator', 'espresso_voucher_import', 'espresso_voucher_import');
     }
     //Social Media Settings
     if (function_exists('espresso_social_config_mnu') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Social Media Settings', 'event_espresso'), __('Social Media', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_social']), 'espresso_social', 'espresso_social_config_mnu');
     }
     //Addons
     // add_submenu_page('event_espresso', __('Event Espresso - Addons', 'event_espresso'), __('Addons', 'event_espresso'), 'administrator', 'admin_addons', 'event_espresso_addons_mnu');
     //Test Drive Pro
     if ($espresso_premium != true) {
         add_submenu_page('event_espresso', __('Event Espresso - Test Drive Pro', 'event_espresso'), __('Test Drive Pro', 'event_espresso'), 'administrator', 'test_drive', 'event_espresso_test_drive');
     }
     //Help/Support
     add_submenu_page('event_espresso', __('Event Espresso - Help/Support', 'event_espresso'), __('<span style="color: red;">Help/Support</span>', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_support']), 'support', 'event_espresso_support');
     add_submenu_page('events', __('Event Espresso - Permissions Settings', 'event_espresso'), '<span class="ee_menu_group"  onclick="return false;">' . __('Permissions', 'event_espresso') . '</span>', 'administrator', 'espresso_permissions', 'espresso_permissions_config_mnu');
     //Permissions settings
     if (function_exists('espresso_manager_version') && $espresso_premium == true) {
         add_submenu_page('event_espresso', __('Event Espresso - Event Manager Permissions', 'event_espresso'), __('User Permissions', 'event_espresso'), 'administrator', 'espresso_permissions', 'espresso_permissions_config_mnu');
         add_submenu_page('event_espresso', __('Event Espresso - Event Manager Roles', 'event_espresso'), __('User Roles', 'event_espresso'), 'administrator', 'roles', 'espresso_permissions_roles_mnu');
         if ($org_options['use_venue_manager'] == 'Y' && function_exists('espresso_permissions_user_groups')) {
             if (espresso_member_data('role') == "administrator") {
                 add_submenu_page('event_espresso', __('Event Espresso - Locales/Regions', 'event_espresso'), __('Locales/Regions', 'event_espresso'), apply_filters('espresso_management_capability', 'administrator', $espresso_manager['espresso_manager_venue_manager']), 'event_locales', 'event_espresso_locale_config_mnu');
             }
             add_submenu_page('event_espresso', __('Event Espresso - Regional Managers', 'event_espresso'), __('Regional Managers', 'event_espresso'), 'administrator', 'event_groups', 'espresso_permissions_user_groups');
         }
     }
 }
开发者ID:sriram911,项目名称:pls,代码行数:101,代码来源:admin_menu.php


示例5: espresso_edit_this

function espresso_edit_this($event_id)
{
    global $espresso_premium;
    if ($espresso_premium != true) {
        return;
    }
    global $current_user;
    wp_get_current_user();
    $curauth = wp_get_current_user();
    $user_id = $curauth->ID;
    $user = new WP_User($user_id);
    foreach ($user->roles as $role) {
        //echo $role;
        //Build the edit event link
        $edit_link = '<a class="post-edit-link" href="' . site_url() . '/wp-admin/admin.php?page=events&action=edit&event_id=' . $event_id . '">' . __('Edit Event') . '</a>';
        switch ($role) {
            case 'administrator':
            case 'espresso_event_admin':
            case 'espresso_event_manager':
            case 'espresso_group_admin':
                //If user is an event manager, then show the edit link for their events
                if (function_exists('espresso_member_data') && espresso_member_data('role') == 'espresso_eventmanager' && espresso_member_data('id') != espresso_is_my_event($event_id)) {
                    return;
                }
                return $edit_link;
                break;
        }
    }
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:29,代码来源:main.php


示例6: event_espresso_staff_config_mnu


//.........这里部分代码省略.........
        <table id="table" class="widefat manage-discounts"> 
          <thead>
            <tr>
              <th class="manage-column column-cb check-column" id="cb" scope="col" style="width:2.5%;"><input type="checkbox"></th>
              <th class="manage-column column-comments num" id="id" style="padding-top:7px; width:2.5%;" scope="col" title="Click to Sort"><?php 
    _e('ID', 'event_espresso');
    ?>
</th>
              <th class="manage-column column-title" id="name" scope="col" title="Click to Sort" style="width:20%;"><?php 
    _e('Name', 'event_espresso');
    ?>
</th>
              <?php 
    if (function_exists('espresso_is_admin') && espresso_is_admin() == true) {
        ?>
              <th class="manage-column column-creator" id="creator" scope="col" title="Click to Sort" style="width:10%;"><?php 
        _e('Creator', 'event_espresso');
        ?>
</th>
              <?php 
    }
    ?>

              <th class="manage-column column-author" id="start" scope="col" title="Click to Sort" style="width:20%;"><?php 
    _e('Shortcode', 'event_espresso');
    ?>
</th>             
            </tr>
          </thead>
          <tbody>
<?php 
    $limitstaff = false;
    global $espresso_manager;
    if (function_exists('espresso_member_data')) {
        if (function_exists('espresso_member_data') && espresso_member_data('role') == 'espresso_group_admin') {
            if ($espresso_manager['event_manager_staff'] == "Y") {
                $limitstaff = true;
            }
        } else {
            if (function_exists('espresso_member_data') && espresso_member_data('role') == 'espresso_event_manager') {
                $limitstaff = true;
            }
        }
    }
    $sql = "SELECT * FROM " . EVENTS_PERSONNEL_TABLE . " p";
    if ($limitstaff) {
        $sql .= " JOIN {$wpdb->users} u on u.ID = p.wp_user WHERE p.wp_user = " . $current_user->ID;
    }
    $wpdb->query($sql);
    if ($wpdb->num_rows > 0) {
        $results = $wpdb->get_results($sql . " ORDER BY p.id ASC");
        foreach ($results as $result) {
            $staff_id = $result->id;
            $name = isset($result->name) ? stripslashes_deep($result->name) : '';
            $staff_desc = isset($result->staff_desc) ? stripslashes_deep($result->staff_desc) : '';
            $wp_user = isset($result->wp_user) ? $result->wp_user : '';
            ?>
            <tr>
              <td class="check-column" style="padding:7px 0 22px 5px; vertical-align:top;"><input name="checkbox[<?php 
            echo $staff_id;
            ?>
]" type="checkbox"  title="Delete <?php 
            echo stripslashes($name);
            ?>
"></td>
               <td class="column-comments" style="padding-top:3px;"><?php 
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:67,代码来源:index.php


示例7: espresso_generate_events_page_list_table_sql

/**
 * 	espresso_get_events_page_list_table_results
 *
 * @access public
 * @param boolean $count whether this query will return field data or COUNT events or SUM attendee quantity
 * @param boolean $attendees whether this query will return data from the events table or the attendee table
 * @param string $filters whether a particular filter is active or not; mostly used in conjunction with the $count parameter ie: COUNT events this_month
 * @param mixed boolean | array $group_admin_locales array og R&P member group IDs or FALSE if not used
 * @return string
 */
function espresso_generate_events_page_list_table_sql($count = FALSE, $attendees = FALSE, $filters = '', $group_admin_locales = FALSE)
{
    global $org_options, $espresso_premium;
    if (!$group_admin_locales) {
        $member_id = FALSE;
    }
    $max_rows = isset($_REQUEST['max_rows']) & !empty($_REQUEST['max_rows']) ? absint($_REQUEST['max_rows']) : 50;
    $max_rows = min($max_rows, 100000);
    $start_rec = isset($_REQUEST['start_rec']) && !empty($_REQUEST['start_rec']) ? absint($_REQUEST['start_rec']) : 0;
    $records_to_show = ' LIMIT ' . $max_rows . ' OFFSET ' . $start_rec;
    //Dates
    $curdate = date('Y-m-d');
    $this_year_r = date('Y');
    $this_month_r = date('m');
    $days_this_month = date('t', strtotime($curdate));
    // event date filters
    $month_range = isset($_REQUEST['month_range']) && !empty($_REQUEST['month_range']) ? sanitize_text_field($_REQUEST['month_range']) : FALSE;
    $this_month_filter = isset($_REQUEST['this_month']) && $_REQUEST['this_month'] == 'true' ? TRUE : FALSE;
    $today_filter = isset($_REQUEST['today']) && $_REQUEST['today'] == 'true' ? TRUE : FALSE;
    // attendee date filters
    $this_month_filter = isset($_REQUEST['this_month_a']) && $_REQUEST['this_month_a'] == 'true' ? TRUE : $this_month_filter;
    $today_filter = isset($_REQUEST['today_a']) && $_REQUEST['today_a'] == 'true' ? TRUE : $today_filter;
    // toggle filters based on value passed from "count functions" (date filters)
    switch ($filters) {
        case 'this_month':
            $month_range = FALSE;
            $this_month_filter = TRUE;
            $today_filter = FALSE;
            break;
        case 'today':
            $month_range = FALSE;
            $this_month_filter = FALSE;
            $today_filter = TRUE;
            break;
        case 'none':
            $month_range = FALSE;
            $this_month_filter = FALSE;
            $today_filter = FALSE;
            break;
    }
    $event_id = isset($_REQUEST['event_id']) && $_REQUEST['event_id'] != '' ? absint($_REQUEST['event_id']) : FALSE;
    $category_id = isset($_REQUEST['category_id']) && !empty($_REQUEST['category_id']) ? absint($_REQUEST['category_id']) : FALSE;
    $event_status = isset($_REQUEST['event_status']) && !empty($_REQUEST['event_status']) ? sanitize_text_field($_REQUEST['event_status']) : FALSE;
    $payment_status = isset($_REQUEST['payment_status']) ? wp_strip_all_tags($_REQUEST['payment_status']) : FALSE;
    if ($month_range) {
        $pieces = explode('-', $month_range, 3);
        $year_r = $pieces[0];
        $month_r = $pieces[1];
    }
    //Check if the venue manager is turned on
    $use_venue_manager = isset($org_options['use_venue_manager']) && $org_options['use_venue_manager'] == 'Y' ? TRUE : FALSE;
    $SQL = '';
    $close_union = FALSE;
    //Roles & Permissions
    //This checks to see if the user is a regional manager and creates a union to join the events that are in the users region based on the venue/locale combination
    if (!$group_admin_locales && function_exists('espresso_member_data') && current_user_can('espresso_group_admin') && !current_user_can('administrator')) {
        $member_id = espresso_member_data('id');
        $group_admin_locales = get_user_meta($member_id, 'espresso_group', TRUE);
        $group_admin_locales = is_array($group_admin_locales) ? implode(',', $group_admin_locales) : FALSE;
        if ($group_admin_locales) {
            $SQL .= '( ';
            $SQL .= espresso_generate_events_page_list_table_sql($count, $attendees, $filters, $group_admin_locales);
            $SQL .= ' ) UNION ( ';
            $close_union = TRUE;
        }
    }
    //If this is an event manager
    $event_manager = function_exists('espresso_member_data') && (current_user_can('espresso_event_manager') && !current_user_can('administrator')) ? true : false;
    $event_admin = function_exists('espresso_member_data') && current_user_can('espresso_event_admin') ? true : false;
    $SQL .= 'SELECT ';
    if ($count && $attendees) {
        // count attendees
        $SQL .= 'SUM(a.quantity) quantity';
    } else {
        if (!$count && $attendees) {
            // get attendees
            $SQL .= 'a.*, e.id event_id, e.event_name, checked_in';
        } else {
            if ($count && !$attendees) {
                // count events
                $SQL .= 'COUNT(e.id) events';
                //, t.start_time
            } else {
                if (!$count && !$attendees) {
                    // get events
                    $SQL .= 'e.id event_id, e.event_name, e.event_identifier, e.registration_start, e.registration_startT, e.registration_end, e.registration_endT, e.start_date, e.end_date, e.is_active, e.recurrence_id, e.wp_user, e.event_status, e.reg_limit';
                    //, t.start_time
                }
            }
        }
//.........这里部分代码省略.........
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:101,代码来源:queries.php


示例8: add_event_to_db

function add_event_to_db($recurrence_arr = array())
{
    global $wpdb, $org_options, $current_user, $espresso_premium;
    //Security check using nonce
    if (empty($_POST['nonce_verify_insert_event']) || !wp_verify_nonce($_POST['nonce_verify_insert_event'], 'espresso_verify_insert_event_nonce')) {
        if (!isset($recurrence_arr['bypass_nonce'])) {
            print '<h3 class="error">' . __('Sorry, there was a security error and your event was not saved.', 'event_espresso') . '</h3>';
            return;
        }
    }
    //Set FEM to false
    $use_fem = FALSE;
    $is_espresso_event_manager = false;
    //If using FEM
    if (isset($_REQUEST['ee_fem_action']) && $_REQUEST['ee_fem_action'] == 'ee_fem_add') {
        $use_fem = TRUE;
        if (function_exists('espresso_member_data') && espresso_member_data('role') == 'espresso_event_manager') {
            global $espresso_manager;
            $event_manager_approval = isset($espresso_manager['event_manager_approval']) && $espresso_manager['event_manager_approval'] == 'Y' ? true : false;
            $is_espresso_event_manager = TRUE;
        }
    }
    //Don't show sql errors if using the FEM
    if ($use_fem === FALSE) {
        $wpdb->show_errors();
    }
    static $recurrence_id = null;
    if (defined('EVENT_ESPRESSO_RECURRENCE_TABLE')) {
        require_once EVENT_ESPRESSO_RECURRENCE_FULL_PATH . "functions/re_functions.php";
        $recurrence_id = array_key_exists('recurrence_id', $recurrence_arr) ? $recurrence_arr['recurrence_id'] : Null;
        if ($_POST['recurrence'] == 'Y' && count($recurrence_arr) < 2) {
            if (is_null($recurrence_id)) {
                $recurrence_id = add_recurrence_master_record();
            }
            $re_params = array('start_date' => $_POST['recurrence_type'] == 'a' ? sanitize_text_field($_POST['recurrence_start_date']) : sanitize_text_field($_POST['recurrence_manual_dates']), 'event_end_date' => $_POST['recurrence_type'] == 'a' ? sanitize_text_field($_POST['recurrence_event_end_date']) : sanitize_text_field($_POST['recurrence_manual_end_dates']), 'end_date' => $_POST['recurrence_type'] == 'a' ? sanitize_text_field($_POST['recurrence_end_date']) : sanitize_text_field($_POST['end_date']), 'registration_start' => sanitize_text_field($_POST['recurrence_regis_start_date']), 'registration_end' => sanitize_text_field($_POST['recurrence_regis_end_date']), 'frequency' => sanitize_text_field($_POST['recurrence_frequency']), 'interval' => sanitize_text_field($_POST['recurrence_interval']), 'type' => sanitize_text_field($_POST['recurrence_type']), 'weekdays' => isset($_POST['recurrence_weekday']) ? $_POST['recurrence_weekday'] : '', 'repeat_by' => $_POST['recurrence_repeat_by'], 'recurrence_regis_date_increment' => $_POST['recurrence_regis_date_increment'], 'recurrence_manual_dates' => $_POST['recurrence_manual_dates'], 'recurrence_manual_end_dates' => $_POST['recurrence_manual_end_dates'], 'recurrence_id' => $recurrence_id, 'adding_to_db' => 'Y');
            $recurrence_dates = $_POST['recurrence_type'] == 'm' ? find_recurrence_manual_dates($re_params) : find_recurrence_dates($re_params);
        }
    }
    //echo_f('re array', $recurrence_dates);
    if (defined('EVENT_ESPRESSO_RECURRENCE_MODULE_ACTIVE') && $_POST['recurrence'] == 'Y' && count($recurrence_arr) == 0) {
        //skip the first insert because we do not have the start dates
    } else {
        $event_meta = array();
        //will be used to hold event meta data
        //Filters the event description based on user level
        $user_access = apply_filters('filter_hook_espresso_event_unfiltered_description', current_user_can('administrator'));
        $_REQUEST['event_desc'] = is_admin() || $user_access ? $_REQUEST['event_desc'] : apply_filters('filter_hook_espresso_event_wp_kses_post_description', wp_kses_post($_REQUEST['event_desc']));
        $event_code = uniqid($current_user->ID . '-');
        $event_name = !empty($_REQUEST['event']) ? sanitize_text_field($_REQUEST['event']) : $event_code;
        if (!isset($_REQUEST['event_identifier']) || $_REQUEST['event_identifier'] == '') {
            $event_identifier = sanitize_title_with_dashes($event_name . '-' . $event_code);
        } else {
            $event_identifier = sanitize_title_with_dashes($_REQUEST['event_identifier']) . $event_code;
        }
        $event_desc = !empty($_REQUEST['event_desc']) ? $_REQUEST['event_desc'] : '';
        $display_desc = !empty($_REQUEST['display_desc']) ? sanitize_text_field($_REQUEST['display_desc']) : 'Y';
        $display_reg_form = !empty($_REQUEST['display_reg_form']) ? sanitize_text_field($_REQUEST['display_reg_form']) : 'Y';
        $externalURL = isset($_REQUEST['externalURL']) ? sanitize_text_field($_REQUEST['externalURL']) : '';
        $post_type = !empty($_REQUEST['espresso_post_type']) ? sanitize_text_field($_REQUEST['espresso_post_type']) : '';
        $reg_limit = !empty($_REQUEST['reg_limit']) ? sanitize_text_field($_REQUEST['reg_limit']) : '999999';
        $_REQUEST['reg_limit'] = $reg_limit;
        $allow_multiple = !empty($_REQUEST['allow_multiple']) ? sanitize_text_field($_REQUEST['allow_multiple']) : 'N';
        $additional_limit = !empty($_REQUEST['additional_limit']) && $_REQUEST['additional_limit'] > 0 ? sanitize_text_field($_REQUEST['additional_limit']) : '5';
        $_REQUEST['additional_limit'] = $additional_limit;
        $member_only = !empty($_REQUEST['member_only']) ? sanitize_text_field($_REQUEST['member_only']) : 'N';
        $is_active = !empty($_REQUEST['is_active']) ? sanitize_text_field($_REQUEST['is_active']) : 'Y';
        $event_status = !empty($_REQUEST['event_status']) ? sanitize_text_field($_REQUEST['event_status']) : 'A';
        $use_coupon_code = !empty($_REQUEST['use_coupon_code']) ? sanitize_text_field($_REQUEST['use_coupon_code']) : 'N';
        $ticket_id = empty($_REQUEST['ticket_id']) ? 0 : sanitize_text_field($_REQUEST['ticket_id']);
        //Get the first instance of the start and end times
        $start_time = !empty($_REQUEST['start_time'][0]) ? sanitize_text_field($_REQUEST['start_time'][0]) : '8:00 AM';
        $_REQUEST['event_start_time'] = $start_time;
        $end_time = !empty($_REQUEST['end_time'][0]) ? sanitize_text_field($_REQUEST['end_time'][0]) : '5:00 PM';
        $_REQUEST['event_end_time'] = $end_time;
        // Add Timezone
        $timezone_string = isset($_REQUEST['timezone_string']) ? sanitize_text_field($_REQUEST['timezone_string']) : '';
        //Early discounts
        $early_disc = !empty($_REQUEST['early_disc']) ? sanitize_text_field($_REQUEST['early_disc']) : '';
        $early_disc_date = !empty($_REQUEST['early_disc_date']) ? sanitize_text_field($_REQUEST['early_disc_date']) : '';
        $early_disc_percentage = !empty($_REQUEST['early_disc_percentage']) ? sanitize_text_field($_REQUEST['early_disc_percentage']) : '';
        //Alternate email address field
        $alt_email = !empty($_REQUEST['alt_email']) ? sanitize_text_field($_REQUEST['alt_email']) : '';
        //Send a custom emal
        $send_mail = !empty($_REQUEST['send_mail']) ? sanitize_text_field($_REQUEST['send_mail']) : 'N';
        //Custom email content
        $conf_mail = !empty($_REQUEST['conf_mail']) ? esc_html($_REQUEST['conf_mail']) : '';
        //Use a premade custom email
        $email_id = isset($_REQUEST['email_name']) ? (int) $_REQUEST['email_name'] : '0';
        //Venue Information
        $venue_title = isset($_REQUEST['venue_title']) ? sanitize_text_field($_REQUEST['venue_title']) : '';
        $venue_url = isset($_REQUEST['venue_url']) ? sanitize_text_field($_REQUEST['venue_url']) : '';
        $venue_phone = isset($_REQUEST['venue_phone']) ? sanitize_text_field($_REQUEST['venue_phone']) : '';
        $venue_image = isset($_REQUEST['venue_image']) ? sanitize_text_field($_REQUEST['venue_image']) : '';
        //Virtual location
        $virtual_url = !empty($_REQUEST['virtual_url']) ? sanitize_text_field($_REQUEST['virtual_url']) : '';
        $virtual_phone = !empty($_REQUEST['virtual_phone']) ? sanitize_text_field($_REQUEST['virtual_phone']) : '';
        //Address/venue information
        $address = isset($_REQUEST['address']) ? sanitize_text_field($_REQUEST['address']) : '';
        $address2 = isset($_REQUEST['address2']) ? sanitize_text_field($_REQUEST['address2']) : '';
        $city = isset($_REQUEST['city']) ? sanitize_text_field($_REQUEST['city']) : '';
//.........这里部分代码省略.........
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:101,代码来源:insert_event.php


示例9: event_espresso_discount_config_mnu

function event_espresso_discount_config_mnu()
{
    global $wpdb;
    ?>
	<div class="wrap">
		<div id="icon-options-event" class="icon32"> </div>
		<h2><?php 
    echo _e('Manage Event Promotional Codes', 'event_espresso');
    ?>
			<?php 
    if (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'edit' && $_REQUEST['action'] != 'new') {
        echo '<a href="admin.php?page=discounts&amp;action=new" class="button add-new-h2" style="margin-left: 20px;">' . __('Add New Code', 'event_espresso') . '</a>';
    }
    ?>
		</h2>

		<?php 
    ob_start();
    if (isset($_REQUEST['action'])) {
        switch ($_REQUEST['action']) {
            case 'add':
                require_once "add_discount.php";
                add_discount_to_db();
                //Add the discount to the DB
                break;
            case 'new':
                require_once "new_discount.php";
                add_new_event_discount();
                //Add new discount form
                break;
            case 'edit':
                require_once "edit_discount.php";
                edit_event_discount();
                //Edit discount form
                break;
            case 'update':
                require_once "update_discount.php";
                update_event_discount();
                //Update discount in DB
                break;
            case 'delete_discount':
                require_once "delete_discount.php";
                delete_event_discount();
                //Delete discount in DB
                break;
        }
    }
    if (!empty($_REQUEST['delete_discount'])) {
        //This is for the delete checkboxes
        require_once "delete_discount.php";
        delete_event_discount();
    }
    ?>

		<form id="form1" name="form1" method="post" action="<?php 
    echo $_SERVER["REQUEST_URI"];
    ?>
">
			<table id="table" class="widefat manage-discounts">
				<thead>
					<tr>
						<th class="manage-column column-cb check-column" id="cb" scope="col" style="width:2.5%;"><input type="checkbox"></th>
						<th class="manage-column column-comments num" id="id" style="padding-top:7px; width:2.5%;" scope="col" title="Click to Sort"><?php 
    _e('ID', 'event_espresso');
    ?>
</th>
						<th class="manage-column column-title" id="name" scope="col" title="Click to Sort" style="width:20%;"><?php 
    _e('Name', 'event_espresso');
    ?>
</th>
						<?php 
    if (function_exists('espresso_is_admin') && espresso_is_admin() == true) {
        ?>
							<th class="manage-column column-creator" id="creator" scope="col" title="Click to Sort" style="width:10%;"><?php 
        _e('Creator', 'event_espresso');
        ?>
</th>
	<?php 
    }
    ?>
						<th class="manage-column column-author" id="start" scope="col" title="Click to Sort" style="width:20%;"><?php 
    _e('Amount', 'event_espresso');
    ?>
</th>
						<th class="manage-column column-date" id="begins" scope="col" title="Click to Sort" style="width:20%;"><?php 
    _e('Percentage', 'event_espresso');
    ?>
</th>
					</tr>
				</thead>
				<tbody>
					<?php 
    $sql = "SELECT * FROM " . EVENTS_DISCOUNT_CODES_TABLE;
    if (function_exists('espresso_member_data') && (espresso_member_data('role') == 'espresso_event_manager' || espresso_member_data('role') == 'espresso_group_admin')) {
        $sql .= " WHERE wp_user = '" . espresso_member_data('id') . "' ";
    }
    $event_discounts = $wpdb->get_results($sql);
    if ($wpdb->num_rows > 0) {
        foreach ($event_discounts as $event_discount) {
            $discount_id = $event_discount->id;
//.........这里部分代码省略.........
开发者ID:sriram911,项目名称:pls,代码行数:101,代码来源:index.php


示例10: event_espresso_venue_config_mnu


//.........这里部分代码省略.........
    ?>
</th>
								<?php 
    if (function_exists('espresso_is_admin') && espresso_is_admin() == true && $espresso_premium == true) {
        ?>
								<th class="manage-column column-creator" id="creator" scope="col" title="Click to Sort" style="width:20%;"><?php 
        _e('Locale', 'event_espresso');
        ?>
</th>
								<?php 
    }
    ?>
								<?php 
    if (function_exists('espresso_is_admin') && espresso_is_admin() == true && $espresso_premium == true) {
        ?>
								<th class="manage-column column-creator" id="creator" scope="col" title="Click to Sort" style="width:20%;"><?php 
        _e('Creator', 'event_espresso');
        ?>
</th>
								<?php 
    }
    ?>
								<th class="manage-column column-author" id="start" scope="col" title="Click to Sort" style="width:20%;"><?php 
    _e('Shortcode', 'event_espresso');
    ?>
</th>
							</tr>
						</thead>
						<tbody>
							<?php 
    global $espresso_manager;
    // If user is an event manager, then show only their venues
    $sql = "( SELECT v.* FROM " . EVENTS_VENUE_TABLE . " v ";
    if (function_exists('espresso_member_data') && espresso_member_data('role') == 'espresso_group_admin') {
        if ($espresso_manager['event_manager_venue'] == "Y") {
            //	show only venues inside their assigned locales.
            $group = get_user_meta(espresso_member_data('id'), "espresso_group", true);
            $sql .= " LEFT JOIN " . EVENTS_LOCALE_REL_TABLE . " l ON  l.venue_id = v.id ";
            $sql .= " WHERE l.locale_id IN (" . implode(",", $group) . ")";
            $sql .= ") UNION ( ";
            $sql .= "SELECT v.* FROM " . EVENTS_VENUE_TABLE . " v ";
        }
    }
    if (function_exists('espresso_member_data') && (espresso_member_data('role') == 'espresso_event_manager' || espresso_member_data('role') == 'espresso_group_admin')) {
        $sql .= "  WHERE v.wp_user = " . $current_user->ID;
    }
    $sql .= ")";
    #echo $sql;
    #exit("TEST");
    $wpdb->query($sql);
    if ($wpdb->num_rows > 0) {
        $results = $wpdb->get_results($sql . " ORDER BY id ASC");
        foreach ($results as $result) {
            $venue_id = $result->id;
            $name = isset($result->name) ? stripslashes_deep($result->name) : '';
            $venue_desc = isset($result->venue_desc) ? stripslashes_deep($result->venue_desc) : '';
            $wp_user = isset($result->wp_user) ? $result->wp_user : '';
            ?>
							<tr>
								<td class="check-column" style="padding:7px 0 22px 5px; vertical-align:top;"><input name="checkbox[<?php 
            echo $venue_id;
            ?>
]" type="checkbox"  title="Delete <?php 
            echo stripslashes($name);
            ?>
"></td>
开发者ID:sriram911,项目名称:pls,代码行数:67,代码来源:index.php


示例11: event_espresso_categories_config_mnu


//.........这里部分代码省略.........

                        <table id="table" class="widefat manage-categories">
                            <thead>
                                <tr>
                                    <th class="manage-column column-cb check-column" id="cb" scope="col" style="width:2.5%;"><input type="checkbox"></th>
                                    <th class="manage-column column-comments num" id="id" style="padding-top:7px; width:2.5%;" scope="col" title="Click to Sort"><?php 
    _e('ID', 'event_espresso');
    ?>
</th>
            

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP espresso_reg_url函数代码示例发布时间:2022-05-15
下一篇:
PHP espresso_is_admin函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap