// ass解析 $ass_structs = analyze_ass($assfile); //****************** 2重縁clip部分生成 // style複製 $tmp_ass_structs = copy_style($ass_structs, 'songInfo2', 'songInfo2_uti'); $tmp_ass_structs = copy_event($tmp_ass_structs, ' songInfo2', 'songInfo2_uti'); $tmp_ass_structs = copy_style($tmp_ass_structs, 'songInfo1', 'songInfo1_uti'); $tmp_ass_structs = copy_event($tmp_ass_structs, ' songInfo1', 'songInfo1_uti'); $tmp_ass_structs = copy_style($tmp_ass_structs, 'songInfo', 'songInfo_uti'); $tmp_ass_structs = copy_event($tmp_ass_structs, ' songInfo', 'songInfo_uti'); $tmp_ass_structs = copy_style($tmp_ass_structs, 'Kanji1', 'Kanji1_uti'); $tmp_ass_structs = copy_event($tmp_ass_structs, ' Kanji1', 'Kanji1_uti'); $tmp_ass_structs = copy_style($tmp_ass_structs, 'Ruby1', 'Ruby1_uti'); $tmp_ass_structs = copy_event($tmp_ass_structs, ' Ruby1', 'Ruby1_uti'); $tmp_ass_structs = copy_style($tmp_ass_structs, 'whosing1', 'whosing1_uti'); $tmp_ass_structs = copy_event($tmp_ass_structs, ' whosing1', 'whosing1_uti'); //色&縁サイズ指定 //内縁:メイン歌詞&曲情報:曲名 $beforewp_color = '&H00FFFFFF'; //文字色 白 $beforewpfuti_color = '&H00253378'; //内縁色 茶 $beforewpshadow_color = '&H00253378'; //影色 茶 $beforewpsotofuti_color = '&H00FFFFFF'; //外縁色 白 $changestyle = array('PrimaryColour' => $beforewp_color, 'SecondaryColour' => $beforewp_color, 'OutlineColour' => $beforewpfuti_color, 'BackColour' => $beforewpshadow_color, 'Outline' => '4', 'Shadow' => '1'); $tmp_ass_structs = mod_style($tmp_ass_structs, 'Kanji1_uti', $changestyle); $tmp_ass_structs = mod_style($tmp_ass_structs, 'songInfo1_uti', $changestyle); //内縁: ルビ、曲情報曲名以外、曲中曲情報 $changestyle = array('PrimaryColour' => $beforewp_color, 'SecondaryColour' => $beforewp_color, 'OutlineColour' => $beforewpfuti_color, 'BackColour' => $beforewpshadow_color, 'Outline' => '3', 'Shadow' => '1');
function event_espresso_manage_events() { global $wpdb, $org_options; ?> <div id="configure_organization_form" class="wrap meta-box-sortables ui-sortable"> <div id="event_reg_theme" class="wrap"> <div id="icon-options-event" class="icon32"></div> <h2> <?php if ($_REQUEST['page'] == 'events' && isset($_REQUEST['event_admin_reports'])) { switch ($_REQUEST['event_admin_reports']) { case 'charts': _e('Attendee Reports', 'event_espresso'); break; case 'event_list_attendees': case 'resend_email': case 'list_attendee_payments': _e('Attendee Reports', 'event_espresso'); if (!empty($_REQUEST['event_id']) && $_REQUEST['event_admin_reports'] != 'add_new_attendee') { echo '<a href="admin.php?page=events&event_admin_reports=add_new_attendee&event_id=' . $_REQUEST['event_id'] . '" class="button add-new-h2" style="margin-left: 20px;">' . __('Add New Attendee', 'event_espresso') . '</a>'; } break; case 'edit_attendee_record': _e('Edit Attendee Data', 'event_espresso'); break; case 'enter_attendee_payments': _e('Edit Attendee Payment Record', 'event_espresso'); break; case 'add_new_attendee': _e('Add New Attendee', 'event_espresso'); break; case 'event_newsletter': _e('Email Event Attendees', 'event_espresso'); break; } } else { _e('Event Overview', 'event_espresso'); if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'edit' || $_REQUEST['action'] == 'add_new_event')) { } else { echo '<a href="admin.php?page=events&action=add_new_event" class="button add-new-h2" style="margin-left: 20px;">' . __('Add New Event', 'event_espresso') . '</a>'; } } ?> </h2> <?php if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'copy_event') { require_once "copy_event.php"; copy_event(); } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete') { event_espresso_delete_event(); } //Delete recurrence series of events if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete_recurrence_series') { $r = $wpdb->get_results("SELECT id FROM " . EVENTS_DETAIL_TABLE . " ed WHERE recurrence_id = " . $_REQUEST['recurrence_id']); if ($wpdb->num_rows > 0) { foreach ($r as $row) { event_espresso_delete_event($row->id); } } } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'csv_import') { require_once 'csv_import.php'; csv_import(); } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') { require_once "insert_event.php"; add_event_to_db(); } //Update the event if (isset($_REQUEST['edit_action']) && $_REQUEST['edit_action'] == 'update') { require_once "update_event.php"; update_event(); } //If we need to add or edit a new event then we show the add or edit forms if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'add_new_event' || $_REQUEST['action'] == 'edit')) { ?> <form id="espresso_event_editor" name="form" method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?> "> <?php if ($_REQUEST['action'] == 'edit') { //show the edit form require_once "edit_event.php"; edit_event($_REQUEST['event_id']); } else { //Show the add new event form require_once "add_new_event.php"; add_new_event(); } ?> <br class="clear" /> </form> <!-- /event_reg_theme --> <?php } else { //If we are not adding or editing an event then show the list of events if (isset($_REQUEST['event_admin_reports'])) { switch ($_REQUEST['event_admin_reports']) { case 'charts': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/charts.php"; espresso_charts(); break; case 'list_attendee_payments': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; event_list_attendees(); break; case 'event_list_attendees': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; event_list_attendees(); break; case 'edit_attendee_record': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/edit_attendee_record.php"; edit_attendee_record(); break; case 'enter_attendee_payments': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/enter_attendee_payments.php"; enter_attendee_payments(); break; case 'add_new_attendee': require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/event_list_attendees.php"; require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-reports/add_new_attendee.php"; add_new_attendee($_REQUEST['event_id']); break; case 'event_newsletter': if (file_exists(EVENT_ESPRESSO_INCLUDES_DIR . "admin-files/event_newsletter.php")) { require_once EVENT_ESPRESSO_INCLUDES_DIR . "admin-files/event_newsletter.php"; event_newsletter($_REQUEST['event_id']); } else { require_once "event_newsletter.php"; } break; case 'resend_email': require_once EVENT_ESPRESSO_INCLUDES_DIR . "/admin-reports/event_list_attendees.php"; echo '<div id="message" class="updated fade"><p><strong>Resending email to attendee.</strong></p></div>'; event_espresso_email_confirmations(array('registration_id' => $_REQUEST['registration_id'], 'send_admin_email' => 'false', 'send_attendee_email' => 'true')); event_list_attendees(); break; default: event_espresso_edit_list(); break; } } else { event_espresso_edit_list(); } } //Do not remove anything below this line. These are the color box popups. ?> </div> </div> <div id="email_manager_info" style="display:none"> <h2><?php _e('Pre-existing Emails', 'event_espresso'); ?> </h2> <p><?php _e('These emails will override the custom email if a pre-existing email is selected. You must select "Yes" in the "Send custom confirmation emails for this event?" above.', 'event_espresso'); ?> </p> </div> <div id="coupon_code_info" style="display:none"> <h2><?php _e('Coupon/Promo Code', 'event_espresso'); ?> </h2><p><?php _e('This is used to apply discounts to events.', 'event_espresso'); ?> </p><p><?php _e('A coupon or promo code could can be anything you want. For example: Say you have an event that costs', 'event_espresso'); ?> <?php echo $org_options['currency_symbol']; ?> 200. <?php _e('If you supplied a promo like "PROMO50" and entered 50.00 into the "Discount w/Promo Code" field your event will be discounted', 'event_espresso'); ?> <?php echo $org_options['currency_symbol']; ?> 50.00, <?php _e('Bringing the cost of the event to', 'event_espresso'); ?> <?php echo $org_options['currency_symbol']; ?> 150. </p> <p><?php _e("Note: Promo Codes which are marked to 'apply to all events', although not explicitly enumerated, can also be used for this event, provided it allows promo codes.", "event_espresso"); ?> </p> </div> <div id="unique_id_info" style="display:none"> <h2><?php _e('Event Identifier', 'event_espresso'); ?> </h2><p><?php _e('This should be a unique identifier for the event. Example: "Event1" (without quotes.)</p><p>The unique ID can also be used in individual pages using the', 'event_espresso'); ?> [SINGLEEVENT single_event_id="<?php _e('Unique Event ID', 'event_espresso'); ?> "] <?php _e('shortcode', 'event_espresso'); ?> .</p> </div> <div id="secondary_info" style="display:none"> <h2><?php _e('Waitlist Events', 'event_espresso'); ?> </h2> <p><?php _e('These types of events can be used as a overflow or waiting list events.', 'event_espresso'); ?> </p> <p><?php _e('If an event is set up as an "Waitlist Event," it can be set to not appear in your event listings template. You may need to customize your event_listing.php file to make this work. For more information, please', 'event_espresso'); ?> <a href="http://eventespresso.com/forums/?p=512" target="_blank"><?php _e('visit the forums', 'event_espresso'); ?> </a>.</p> </div> <div id="external_URL_info" style="display:none"> <h2><?php _e('Off-site Registration Page', 'event_espresso'); ?> </h2> <p><?php _e('If an off-site registration page is entered, it will override your registration page and send attendees to the URL that is entered.', 'event_espresso'); ?> </p> </div> <div id="alt_email_info" style="display:none"> <h2><?php _e('Alternate Email Address', 'event_espresso'); ?> </h2> <p><?php _e('If an alternate email address is entered. Admin email notifications wil be sent to this address instead.', 'event_espresso'); ?> </p> </div> <div id="status_types_info" style="display:none;"> <h2><?php _e('Event Status Types', 'event_espresso'); ?> </h2> <ul> <li><strong><?php _e('Public', 'event_espresso'); ?> </strong><br /><?php _e('This type if event will appear in the event listings. It is a live event (not deleted, ongoing or secondary.)', 'event_espresso'); ?> </li> <li><strong><?php _e('Waitlist', 'event_espresso'); ?> </strong><br /><?php _e('This type of event can be hidden and used as a waiting list for a primary event. Template customizations may be required. For more information, please', 'event_espresso'); ?> <a href="http://eventespresso.com/forums/?p=512" target="_blank"><?php _e('visit the forums', 'event_espresso'); ?> </a></li> <li><strong><?php _e('Ongoing', 'event_espresso'); ?> </strong><br /><?php _e('This type of an event can be set to appear in your event listings and display a registration page. Template customizations are required. For more information, please', 'event_espresso'); ?> <a href="http://eventespresso.com/forums/?p=518" target="_blank"><?php _e('visit the forums', 'event_espresso'); ?> </a></li> <li><strong><?php _e('Deleted', 'event_espresso'); ?> </strong><br /><?php _e('This is event type will not appear in the event listings and will not dispaly a registrations page. Deleted events can still be accessed in the', 'event_espresso'); ?> <a href="admin.php?page=events"><?php _e('Attendee Reports', 'event_espresso'); ?> </a> <?php _e('page', 'event_espresso'); ?> .</li> </ul> </div> <?php echo event_espresso_custom_email_info(); }
function copy_event($recurrence_arr = array()) { global $wpdb, $current_user; $event_id = array_key_exists('event_id', $recurrence_arr) ? $recurrence_arr['event_id'] : $_REQUEST['event_id']; $results = $wpdb->get_results("SELECT * FROM " . EVENTS_DETAIL_TABLE . " WHERE id ='" . $event_id . "'"); foreach ($results as $result) { $event_id = $result->id; $display_reg_form = $result->display_reg_form; $event_name = $result->event_name; $event_desc = $result->event_desc; $display_desc = $result->display_desc; $event_identifier = $result->event_identifier . '-' . time(); $reg_limit = $result->reg_limit; $allow_multiple = $result->allow_multiple; $additional_limit = $result->additional_limit; $registration_start = array_key_exists('registration_start', $recurrence_arr) ? $recurrence_arr['registration_start'] : $result->registration_start; $registration_end = array_key_exists('registration_end', $recurrence_arr) ? $recurrence_arr['registration_end'] : $result->registration_end; $start_date = array_key_exists('start_date', $recurrence_arr) ? $recurrence_arr['start_date'] : $result->start_date; $end_date = array_key_exists('end_date', $recurrence_arr) ? $recurrence_arr['end_date'] : $result->end_date; $start_time = $result->start_time; $end_time = $result->end_time; $is_active = $result->is_active; $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); $phone = $result->phone; $send_mail = $result->send_mail; $conf_mail = $result->conf_mail; $email_id = $result->email_id; $use_coupon_code = $result->use_coupon_code; $question_groups = $result->question_groups; $allow_overflow = $result->allow_overflow; $overflow_event_id = $result->overflow_event_id; $event_code = uniqid($current_user->ID . '-'); $registration_startT = $result->registration_startT; $registration_endT = $result->registration_endT; $event_status = $result->event_status; $virtual_url = $result->virtual_url; $virtual_phone = $result->virtual_phone; $member_only = $result->member_only; $post_id = $result->post_id; $post_type = $result->post_type; $post_type = $result->post_type; $externalURL = $result->externalURL; $early_disc = $result->early_disc; $early_disc_date = $result->early_disc_date; $early_disc_percentage = $result->early_disc_percentage; $venue_title = $result->venue_title; $venue_url = $result->venue_url; $venue_phone = $result->venue_phone; $venue_image = $result->venue_image; $event_meta = $result->event_meta; $require_pre_approval = $result->require_pre_approval; $timezone_string = $result->timezone_string; $sql = array('event_code' => $event_code, 'event_name' => $event_name, 'event_desc' => $event_desc, 'display_desc' => $display_desc, 'display_reg_form' => $display_reg_form, 'event_identifier' => $event_identifier, 'address' => $address, 'address2' => $address2, 'city' => $city, 'state' => $state, 'zip' => $zip, 'country' => $country, 'phone' => $phone, 'virtual_url' => $virtual_url, 'virtual_phone' => $virtual_phone, 'registration_start' => $registration_start, 'registration_end' => $registration_end, 'start_date' => $start_date, 'end_date' => $end_date, 'allow_multiple' => $allow_multiple, 'send_mail' => $send_mail, 'is_active' => $is_active, 'event_status' => $event_status, 'conf_mail' => $conf_mail, 'use_coupon_code' => $use_coupon_code, 'member_only' => $member_only, 'externalURL' => $externalURL, 'early_disc' => $early_disc, 'early_disc_date' => $early_disc_date, 'early_disc_percentage' => $early_disc_percentage, 'alt_email' => $alt_email, 'question_groups' => $question_groups, 'post_type' => $post_type, 'registration_startT' => $registration_startT, 'registration_endT' => $registration_endT, 'venue_title' => $venue_title, 'venue_url' => $venue_url, 'venue_phone' => $venue_phone, 'venue_image' => $venue_image, 'event_meta' => $event_meta, 'require_pre_approval' => $require_pre_approval, 'timezone_string' => $timezone_string, 'submitted' => date('Y-m-d H:i:s', time()), 'reg_limit' => $reg_limit, 'additional_limit' => $additional_limit, 'recurrence_id' => $recurrence_id, 'email_id' => $email_id, 'wp_user' => $current_user->ID, 'post_id' => $post_id); } $sql_data = array('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%d'); /*//check the counts to make sure the data is matched up correctly echo 'SQL Count '; print count ($sql); echo '<br />SQL Data Count '; print count($sql_data); //Output the data echo '<br />SQL Values: '; print_r($sql);*/ //Add groupon reference if installed if (function_exists('event_espresso_add_event_to_db_groupon')) { $sql = event_espresso_add_event_to_db_groupon($sql, $_REQUEST['use_groupon_code']); //print count ($sql); $sql_data = array_merge((array) $sql_data, (array) '%s'); //print count($sql_data); if (!$wpdb->insert(EVENTS_DETAIL_TABLE, $sql, $sql_data)) { $error = true; } } else { if (!$wpdb->insert(EVENTS_DETAIL_TABLE, $sql, $sql_data)) { $error = true; } } $new_id = $wpdb->insert_id; $event_categories = $wpdb->get_results("SELECT * FROM " . EVENTS_CATEGORY_REL_TABLE . " WHERE event_id = '" . $event_id . "' ORDER BY id"); foreach ($event_categories as $category) { if ($category->event_id != '') { foreach (array($category->event_id) as $k => $v) { if ($v != '') { $insert_cat = "INSERT INTO " . EVENTS_CATEGORY_REL_TABLE . " (event_id, cat_id) VALUES ('" . $new_id . "', '" . $category->cat_id . "')"; if (!$wpdb->query($insert_cat)) { $error = true; } } } } } $event_venues = $wpdb->get_results("SELECT * FROM " . EVENTS_VENUE_REL_TABLE . " WHERE event_id = '" . $event_id . "' ORDER BY id"); foreach ($event_venues as $venue) { if ($venue->event_id != '') { foreach (array($venue->event_id) as $k => $v) { if ($v != '') { $insert_venue = "INSERT INTO " . EVENTS_VENUE_REL_TABLE . " (event_id, venue_id) VALUES ('" . $new_id . "', '" . $venue->venue_id . "')"; if (!$wpdb->query($insert_venue)) { $error = true; } } } } } $event_persons = $wpdb->get_results("SELECT * FROM " . EVENTS_PERSONNEL_REL_TABLE . " WHERE event_id = '" . $event_id . "' ORDER BY id"); foreach ($event_persons as $person) { if ($person->event_id != '') { foreach (array($person->event_id) as $k => $v) { if ($v != '') { $insert_person = "INSERT INTO " . EVENTS_PERSONNEL_REL_TABLE . " (event_id, person_id) VALUES ('" . $new_id . "', '" . $person->person_id . "')"; if (!$wpdb->query($insert_person)) { $error = true; } } } } } $event_discounts = $wpdb->get_results("SELECT * FROM " . EVENTS_DISCOUNT_REL_TABLE . " WHERE event_id = '" . $event_id . "' ORDER BY id"); foreach ($event_discounts as $discount) { if ($discount->event_id != '') { foreach (array($discount->event_id) as $k => $v) { if ($v != '') { $insert_discount = "INSERT INTO " . EVENTS_DISCOUNT_REL_TABLE . " (event_id, discount_id) VALUES ('" . $new_id . "', '" . $discount->discount_id . "')"; if (!$wpdb->query($insert_discount)) { $error = true; } } } } } $event_times = $wpdb->get_results("SELECT * FROM " . EVENTS_START_END_TABLE . " WHERE event_id = '" . $event_id . "' ORDER BY id"); foreach ($event_times as $event_time) { if ($event_time->start_time != '') { foreach (array($event_time->start_time) as $k => $v) { if ($v != '') { $sql3 = "INSERT INTO " . EVENTS_START_END_TABLE . " (event_id, start_time, end_time) VALUES ('" . $new_id . "', '" . $v . "', '" . $event_time->end_time . "')"; //echo "$sql3 <br>"; if (!$wpdb->query($sql3)) { $error = true; } } } } } $event_prices = $wpdb->get_results("SELECT * FROM " . EVENTS_PRICES_TABLE . " WHERE event_id = '" . $event_id . "' ORDER BY id"); foreach ($event_prices as $event_price) { if ($event_price->event_cost != '') { foreach (array($event_price->event_cost) as $k => $v) { if ($v != '') { $prices_sql = "INSERT INTO " . EVENTS_PRICES_TABLE . " (event_id, event_cost, surcharge, price_type, member_price, member_price_type) VALUES ('" . $new_id . "', '" . $v . "', {$event_price->surcharge}, '" . $event_price->price_type . "', '" . $event_price->member_price . "', '" . $event_price->member_price_type . "')"; //echo "$sql6 <br>"; if (!$wpdb->query($prices_sql)) { $error = true; } } } } } if ($error != true) { ?> <div id="message" class="updated fade"><p><strong><?php _e('The event', 'event_espresso'); ?> <a href="<?php echo $_SERVER["REQUEST_URI"]; ?> #event-id-<?php echo $wpdb->insert_id; ?> "><?php echo stripslashes($event_name); ?> </a> <?php _e('has been added.', 'event_espresso'); ?> </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 */ static $counter = 1; if (count($recurrence_arr) > 0) { //$recurrence_dates = array_shift($recurrence_dates); //Remove the first item from the array since it will be added after this recursion foreach ($recurrence_arr as $r_a) { echo_f($event_id, $r_a['start_date']); copy_event(array('event_id' => $event_id, 'recurrence_id' => $recurrence_id, 'start_date' => $r_a['start_date'], 'registration_start' => $r_a['registration_start'], 'registration_end' => $r_a['registration_end'])); $counter++; if ($counter > 20) { exit; } } } /* * End recursion, as part of recurring events. */ }