Wordpress engine. After translating two words into Russian, I uploaded a file to the server. Edited using Sublime Text 2 program. Issued an error:
Parse error: syntax error, unexpected '}' in /var/www/u0164453/public_html/sunnyge.com/wp-content/themes/BookYourTravel/single-accommodation.php on line 1
The file put everything in place, but the error does not disappear. Found the source file, uploaded to the server, everything just does not disappear error.
After the file from the backup rests on the server (and most likely, when an error occurs on the site when accessing this file), the code in the file changes (line breaks disappear):
<?php get_header(); BYT_Theme_Utils::breadcrumbs();get_sidebar('under-header'); global $post, $current_user, $accommodation_obj, $entity_obj, $score_out_of_10, $default_accommodation_tabs, $byt_accommodations_post_type, $byt_theme_of_custom;$enable_reviews = $byt_theme_globals->enable_reviews();$enable_accommodations = $byt_theme_globals->enable_accommodations();$accommodation_extra_fields = $byt_theme_globals->get_accommodation_extra_fields();$location_extra_fields = $byt_theme_globals->get_location_extra_fields();$tab_array = $byt_theme_globals->get_accommodation_tabs();$price_decimal_places = $byt_theme_globals->get_price_decimal_places();$default_currency_symbol = $byt_theme_globals->get_default_currency_symbol();$show_currency_symbol_after = $byt_theme_globals->show_currency_symbol_after();if ( have_posts() ) { the_post(); $accommodation_obj = new byt_accommodation($post); $entity_obj = $accommodation_obj; $accommodation_id = $accommodation_obj->get_id(); $base_accommodation_id = $accommodation_obj->get_base_id(); $accommodation_location = $accommodation_obj->get_location(); $is_self_catered = $accommodation_obj->get_is_self_catered(); $accommodation_latitude = $accommodation_obj->get_custom_field('latitude'); $accommodation_longitude = $accommodation_obj->get_custom_field('longitude'); $accommodation_count_children_stay_free = $accommodation_obj->get_count_children_stay_free(); $accommodation_is_price_per_person = $accommodation_obj->get_is_price_per_person(); $accommodation_is_reservation_only = $accommodation_obj->get_is_reservation_only(); $total_price_label = __('Total price', 'bookyourtravel'); if ($accommodation_is_price_per_person && $accommodation_count_children_stay_free > 0) $total_price_label = sprintf(__('Total price (first %d children stay free)', 'bookyourtravel'), $accommodation_count_children_stay_free); $max_count = $max_child_count = 0; if ($is_self_catered) { $max_count = $accommodation_obj->get_custom_field('max_count'); $max_count = isset($max_count) ? intval($max_count) : 5; $max_child_count = $accommodation_obj->get_custom_field('max_child_count'); $max_child_count = isset($max_child_count) ? intval($max_child_count) : 5; } $min_days_stay = $accommodation_obj->get_custom_field('min_days_stay'); $min_days_stay = isset($min_days_stay) ? intval($min_days_stay) : 0; $accommodation_check_in_time = $accommodation_obj->get_custom_field('check_in_time'); $accommodation_check_out_time = $accommodation_obj->get_custom_field('check_out_time'); $check_in_out_times = array(); $check_in_out_times[] = array('value' => '', 'label' => __('Flexible', 'bookyourtravel')); for ($i=0; $i<24;$i++) $check_in_out_times[] = array('value' => sprintf("%02s:00", $i), 'label' => sprintf("%02s:00", $i)); $check_in_time = $accommodation_check_in_time == '' ? __('Flexible', 'bookyourtravel') : $accommodation_check_in_time; $check_out_time = $accommodation_check_out_time == '' ? __('Flexible', 'bookyourtravel') : $accommodation_check_out_time; // include various forms (booking, review, confirmation) if ($enable_reviews) { get_template_part('includes/parts/review', 'form'); } ?> <script> window.postType = 'accommodation'; </script> <?php get_template_part('includes/parts/inquiry', 'form'); ?> <!--accommodation three-fourth content--> <section class="three-fourth"> <?php get_template_part('includes/parts/accommodation', 'booking-form'); get_template_part('includes/parts/accommodation', 'confirmation-form'); ?> <script> window.minDaysStayError = <?php echo json_encode(sprintf(__('Accommodation requires %d minimum days stay!', 'bookyourtravel'), $min_days_stay)); ?>; window.formSingleError = <?php echo json_encode(__('You failed to provide 1 field. It has been highlighted below.', 'bookyourtravel')); ?>; window.formMultipleError = <?php echo json_encode(__('You failed to provide {0} fields. They have been highlighted below.', 'bookyourtravel')); ?>; window.accommodationId = <?php echo $base_accommodation_id; ?>; window.roomTypeId = 0; window.accommodationIsSelfCatered = <?php echo $is_self_catered; ?>; window.accommodationIsReservationOnly = <?php echo $accommodation_is_reservation_only; ?>; window.accommodationIsPricePerPerson = <?php echo $accommodation_is_price_per_person; ?>; window.accommodationCountChildrenStayFree = <?php echo $accommodation_count_children_stay_free; ?>; <?php if ($is_self_catered) { ?> window.accommodationMaxCount = <?php echo $max_count; ?>; window.accommodationMaxChildCount = <?php echo $max_child_count; ?>; <?php } ?> window.accommodationMinDaysStay = <?php echo $min_days_stay; ?>; window.entityLatitude = <?php echo json_encode($accommodation_latitude); ?>; window.entityLongitude = <?php echo json_encode($accommodation_longitude); ?>; window.entityInfoboxText = <?php echo json_encode('<strong>' . $accommodation_obj->get_title() . '</strong><br />' . $accommodation_obj->get_custom_field('address') . '<br />' . $accommodation_obj->get_custom_field('website_address')); ?>; window.currentMonth = <?php echo date('n'); ?>; window.currentYear = <?php echo date('Y'); ?>; window.adultCountLabel = <?php echo json_encode(__('Adults', 'bookyourtravel')); ?>; window.pricePerAdultLabel = <?php echo json_encode(__('Price per adult', 'bookyourtravel')); ?>; window.childCountLabel = <?php echo json_encode(__('Children', 'bookyourtravel')); ?>; window.pricePerChildLabel = <?php echo json_encode(__('Price per child', 'bookyourtravel')); ?>; window.pricePerDayLabel = <?php echo json_encode(__('Price per day', 'bookyourtravel')); ?>; window.priceTotalLabel = <?php echo json_encode($total_price_label); ?>; window.dateLabel = <?php echo json_encode(__('Date', 'bookyourtravel')); ?>; </script> <?php $accommodation_obj->render_image_gallery(); ?> <!--inner navigation--> <nav class="inner-nav"> <ul> <?php do_action( 'byt_show_single_accommodation_tab_items_before' ); $first_display_tab = ''; $i = 0; if (is_array($tab_array) && count($tab_array) > 0) { foreach ($tab_array as $tab) { if (!isset($tab['hide']) || $tab['hide'] != '1') { $tab_label = ''; if (isset($tab['label'])) { $tab_label = $tab['label']; $tab_label = $byt_theme_of_custom->get_translated_dynamic_string($byt_theme_of_custom->get_option_id_context('accommodation_tabs') . ' ' . $tab['label'], $tab_label); } if($i==0) $first_display_tab = $tab['id']; if ($tab['id'] == 'reviews' && $enable_reviews) { BYT_Theme_Utils::render_tab("accommodation", $tab['id'], '', '<a href="#' . $tab['id'] . '" title="' . $tab_label . '">' . $tab_label . '</a>'); } elseif ($tab['id'] == 'location' && !empty($accommodation_latitude) && !empty($accommodation_longitude)) { BYT_Theme_Utils::render_tab("accommodation", $tab['id'], '', '<a href="#' . $tab['id'] . '" title="' . $tab_label . '">' . $tab_label . '</a>'); } elseif ($tab['id'] == 'things-to-do' && isset($accommodation_location)) { BYT_Theme_Utils::render_tab("accommodation", $tab['id'], '', '<a href="#' . $tab['id'] . '" title="' . $tab_label . '">' . $tab_label . '</a>'); } elseif ($tab['id'] == 'description' || $tab['id'] == 'availability' || $tab['id'] == 'facilities') { BYT_Theme_Utils::render_tab("tour", $tab['id'], '', '<a href="#' . $tab['id'] . '" title="' . $tab_label . '">' . $tab_label . '</a>'); } else { $all_empty_fields = BYT_Theme_Utils::are_tab_fields_empty('accommodation_extra_fields', $accommodation_extra_fields, $tab['id'], $accommodation_obj); if (!$all_empty_fields) { BYT_Theme_Utils::render_tab("accommodation", $tab['id'], '', '<a href="#' . $tab['id'] . '" title="' . $tab_label . '">' . $tab_label . '</a>'); } } $i++; } } } do_action( 'byt_show_single_accommodation_tab_items_after' ); ?> </ul> </nav> <!--//inner navigation--> <?php do_action( 'byt_show_single_accommodation_tab_content_before' ); ?> <script> window.moreInfoText = '<?php echo __('+ more info', 'bookyourtravel'); ?>'; window.lessInfoText = '<?php echo __('+ less info', 'bookyourtravel'); ?>'; </script> <section id="availability" class="tab-content <?php echo $first_display_tab == 'availability' ? 'initial' : ''; ?>"> <article> <?php do_action( 'byt_show_single_accommodation_availability_before' ); ?> <h1><?php _e('Availability', 'bookyourtravel'); ?></h1> <?php BYT_Theme_Utils::render_field("text-wrap", "", "", $accommodation_obj->get_custom_field('availability_text'), '', false, true); $room_type_ids = $accommodation_obj->get_room_types(); if ($room_type_ids && count($room_type_ids) > 0) { ?> <ul class="room-types"> <?php // Loop through the items returned for ( $z = 0; $z < count($room_type_ids); $z++ ) { $room_type_id = $room_type_ids[$z]; $room_type_obj = new byt_room_type(intval($room_type_id)); $room_type_min_price = $byt_accommodations_post_type->get_accommodation_min_price($accommodation_id, $room_type_id); ?> <!--room_type--> <li id="room_type_<?php echo $room_type_id; ?>"> <div class="row"> <?php if ($room_type_obj->get_main_image('medium')) { ?> <figure class="left"><img src="<?php echo esc_url($room_type_obj->get_main_image('medium')) ?>" alt="<?php echo $room_type_obj->get_title() ?>" /><a href="<?php echo esc_url($room_type_obj->get_main_image()); ?>" class="image-overlay" rel="prettyPhoto[gallery1]"></a></figure> <?php } ?> <div class="meta room_type"> <h2><?php echo $room_type_obj->get_title(); ?></h2> <?php BYT_Theme_Utils::render_field('', '', '', $room_type_obj->get_custom_field('meta'), '', true, true); ?> <?php BYT_Theme_Utils::render_link_button("#", "more-info", "", __('+ more info', 'bookyourtravel')); ?> </div> <div class="room-information"> <div class="row"> <span class="first"><?php _e('Max:', 'bookyourtravel'); ?></span> <span class="second"> <?php for ( $j = 0; $j < $room_type_obj->get_custom_field('max_count'); $j++ ) { ?> <img src="<?php echo BYT_Theme_Utils::get_file_uri('/images/ico/person.png'); ?>" alt="" /> <?php } ?> </span> </div> <?php if ($room_type_min_price > 0) { ?> <div class="row"> <span class="first"><?php _e('Price from:', 'bookyourtravel'); ?></span> <div class="second price"> <em> <?php if (!$show_currency_symbol_after) { ?> <span class="curr"><?php echo $default_currency_symbol; ?></span> <span class="amount"><?php echo number_format_i18n( $room_type_min_price, $price_decimal_places ); ?></span> <?php } else { ?> <span class="amount"><?php echo number_format_i18n( $room_type_min_price, $price_decimal_places ); ?></span> <span class="curr"><?php echo $default_currency_symbol; ?></span> <?php } ?> </em> <input type="hidden" class="max_count" value="<?php echo esc_attr($room_type_obj->get_custom_field('max_count')); ?>" /> <input type="hidden" class="max_child_count" value="<?php echo esc_attr($room_type_obj->get_custom_field('max_child_count')); ?>" /> </div> </div> <?php BYT_Theme_Utils::render_link_button("#", "gradient-button book-accommodation-select-dates", "book-accommodation-$room_type_id", __('Select dates', 'bookyourtravel')); ?> <?php } ?> </div> <div class="more-information"> <?php BYT_Theme_Utils::render_field('', '', __('Room facilities:', 'bookyourtravel'), $room_type_obj->get_facilities_string(), '', true, true); ?> <?php echo $room_type_obj->get_description(); ?> <?php BYT_Theme_Utils::render_field('', '', __('Bed size:', 'bookyourtravel'), $room_type_obj->get_custom_field('bed_size'), '', true, true); ?> <?php BYT_Theme_Utils::render_field('', '', __('Room size:', 'bookyourtravel'), $room_type_obj->get_custom_field('room_size'), '', true, true); ?> </div> </div> <div class="step1_controls" style="display:none"></div> </li> <!--//room--> <?php } // Reset Second Loop Post Data wp_reset_postdata(); // end while ?> </ul> <?php } else if ($accommodation_obj->get_is_self_catered()) { $accommodation_min_price = $byt_accommodations_post_type->get_accommodation_min_price($accommodation_id, 0); if ($accommodation_min_price > 0) { ?> <div class="step1_controls" style="display:none"></div> <?php } else { echo '<p>' . __('We are sorry, this accommodation is not available to book at the moment', 'bookyourtravel') . '</p>'; } } else { BYT_Theme_Utils::render_field('text-wrap', '', '', __('We are sorry, there are no rooms available at this accommodation at the moment', 'bookyourtravel'), '', true, true); } ?> <?php BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, 'availability', $accommodation_obj); ?> <?php do_action( 'byt_show_single_accommodation_availability_after' ); ?> </article> </section> <!--description--> <section id="description" class="tab-content <?php echo $first_display_tab == 'description' ? 'initial' : ''; ?>"> <article> <?php do_action( 'byt_show_single_accommodation_description_before' ); BYT_Theme_Utils::render_field("text-wrap", "", "", $accommodation_obj->get_description(), __('General', 'bookyourtravel'), false, false, false); BYT_Theme_Utils::render_field("text-wrap", "", "", $check_in_time, __('Check-in time', 'bookyourtravel'), false, false, false); BYT_Theme_Utils::render_field("text-wrap", "", "", $check_out_time, __('Check-out time', 'bookyourtravel'), false, false, false); BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, 'description', $accommodation_obj); do_action( 'byt_show_single_accommodation_description_after' ); ?> </article> </section> <!--//description--> <!--facilities--> <section id="facilities" class="tab-content <?php echo $first_display_tab == 'facilities' ? 'initial' : ''; ?>"> <article> <?php do_action( 'byt_show_single_accommodation_facilites_before' ); ?> <?php $facilities = $accommodation_obj->get_facilities(); if ($facilities && count($facilities) > 0) { ?> <h1><?php _e('Facilities', 'bookyourtravel'); ?></h1> <div class="text-wrap"> <ul class="three-col"> <?php for( $i = 0; $i < count($facilities); $i++) { $accommodation_facility = $facilities[$i]; echo '<li>' . $accommodation_facility->name . '</li>'; } ?> </ul> </div> <?php } // endif (!empty($accommodation_facilities)) ?> <?php BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, 'facilities', $accommodation_obj); ?> <?php do_action( 'byt_show_single_accommodation_facilites_after' ); ?> </article> </section> <!--//facilities--> <?php if ((!empty($accommodation_latitude)) && (!empty($accommodation_longitude))) { ?> <!--location--> <section id="location" class="tab-content <?php echo $first_display_tab == 'location' ? 'active' : ''; ?>"> <article> <?php do_action( 'byt_show_single_accommodation_location_before' ); ?> <!--map--><div class="gmap" id="map_canvas"></div><!--//map--> <?php BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, 'location', $accommodation_obj); ?> <?php do_action( 'byt_show_single_accommodation_location_after' ); ?> </article> </section> <!--//location--> <?php } ?> <?php if ($enable_reviews) { ?> <!--reviews--> <section id="reviews" class="tab-content <?php echo $first_display_tab == 'review' ? 'initial' : ''; ?>"> <?php do_action( 'byt_show_single_accommodation_reviews_before' ); get_template_part('includes/parts/review', 'item'); BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, 'reviews', $accommodation_obj); do_action( 'byt_show_single_accommodation_reviews_after' ); ?> </section> <!--//reviews--> <?php } // if ($enable_reviews) ?> <?php if ($accommodation_location != null) { ?> <!--things to do--> <section id="things-to-do" class="tab-content <?php echo $first_display_tab == 'things-to-do' ? 'initial' : ''; ?>"> <article> <?php do_action( 'byt_show_single_accommodation_location_before' ); ?> <?php $sports_and_nature_field = BYT_Theme_Utils::find_extra_field($location_extra_fields, 'sports_and_nature'); $culture_and_history_field = BYT_Theme_Utils::find_extra_field($location_extra_fields, 'culture_and_history'); $nightlife_field = BYT_Theme_Utils::find_extra_field($location_extra_fields, 'nightlife'); $sports_and_nature_field_label = __('Sports and nature', 'bookyourtravel'); if (isset($sports_and_nature_field) && isset($sports_and_nature_field['label'])) { $sports_and_nature_field_label = $sports_and_nature_field['label']; $sports_and_nature_field_label = $byt_theme_of_custom->get_translated_dynamic_string($byt_theme_of_custom->get_option_id_context('location_extra_fields') . ' ' . $sports_and_nature_field_label, $sports_and_nature_field_label); } $culture_and_history_field_label = __('Culture & history', 'bookyourtravel'); if (isset($culture_and_history_field) && isset($culture_and_history_field['label'])) { $culture_and_history_field_label = $culture_and_history_field['label']; $culture_and_history_field_label = $byt_theme_of_custom->get_translated_dynamic_string($byt_theme_of_custom->get_option_id_context('location_extra_fields') . ' ' . $culture_and_history_field_label, $culture_and_history_field_label); } $nightlife_field_label = __('Nightlife', 'bookyourtravel'); if (isset($nightlife_field) && isset($nightlife_field['label'])) { $nightlife_field_label = $nightlife_field['label']; $nightlife_field_label = $byt_theme_of_custom->get_translated_dynamic_string($byt_theme_of_custom->get_option_id_context('location_extra_fields') . ' ' . $nightlife_field_label, $nightlife_field_label); } BYT_Theme_Utils::render_field("", "", "", BYT_Theme_Utils::render_image('', '', $accommodation_location->get_main_image(), $accommodation_location->get_title(), $accommodation_location->get_title(), false) . $accommodation_location->get_excerpt(), $accommodation_location->get_title()); BYT_Theme_Utils::render_field("", "", "", BYT_Theme_Utils::render_image('', '', $accommodation_location->get_custom_field_image_uri('sports_and_nature_image', 'medium'), $sports_and_nature_field_label, $sports_and_nature_field_label, false) . $accommodation_location->get_custom_field('sports_and_nature'), $sports_and_nature_field_label); BYT_Theme_Utils::render_field("", "", "", BYT_Theme_Utils::render_image('', '', $accommodation_location->get_custom_field_image_uri('nightlife_image', 'medium'), $nightlife_field_label, $nightlife_field_label, false) . $accommodation_location->get_custom_field('nightlife'), $nightlife_field_label); BYT_Theme_Utils::render_field("", "", "", BYT_Theme_Utils::render_image('', '', $accommodation_location->get_custom_field_image_uri('culture_and_history_image', 'medium'), $culture_and_history_field_label, $culture_and_history_field_label, false) . $accommodation_location->get_custom_field('culture_and_history'), $culture_and_history_field_label); ?> <hr /> <?php BYT_Theme_Utils::render_link_button(get_permalink($accommodation_location->get_id()), "gradient-button right", "", __('Read more', 'bookyourtravel')); ?> <?php BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, 'things-to-do', $accommodation_obj); ?> <?php do_action( 'byt_show_single_accommodation_location_after' ); ?> </article> </section> <!--//things-to-do--> <?php } ?> <?php foreach ($tab_array as $tab) { if (count(BYT_Theme_Utils::custom_array_search($default_accommodation_tabs, 'id', $tab['id'])) == 0) { $all_empty_fields = BYT_Theme_Utils::are_tab_fields_empty('accommodation_extra_fields', $accommodation_extra_fields, $tab['id'], $accommodation_obj); if (!$all_empty_fields) { ?> <section id="<?php echo esc_attr($tab['id']); ?>" class="tab-content <?php echo ($first_display_tab == $tab['id'] ? 'initial' : ''); ?>"> <article> <?php do_action( 'byt_show_single_accommodation_' . $tab['id'] . '_before' ); ?> <?php BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, $tab['id'], $accommodation_obj); ?> <?php do_action( 'byt_show_single_accommodation_' . $tab['id'] . '_after' ); ?> </article> </section> <?php } } } do_action( 'byt_show_single_accommodation_tab_content_after' ); ?> </section> <!--//accommodation content--> <?php get_sidebar('right-accommodation'); } // end if?><div class="step1_controls_holder" style="display:none"> <div class="row calendar"> <div class="f-item"> <label><?php _e('Select booking dates:', 'bookyourtravel') ?></label> <div class="datepicker_holder"></div> </div> </div> <div class="row loading" id="datepicker_loading" style="display:none"> <div class="ball"></div> <div class="ball1"></div> </div> <div class="error step1_error" style="display:none;"><div><p></p></div></div> <div class="row twins"> <div class="f-item dates_row dates_row_from" style="display:none"> <label><?php _e('Check-in', 'bookyourtravel') ?></label> <span id="date_from_text"></span> <input type="hidden" name="selected_date_from" id="selected_date_from" value="" /> <?php if (!empty($accommodation_check_in_time)) { echo ' ' . $accommodation_check_in_time; } ?> </div> <div class="f-item dates_row dates_row_to" style="display:none"> <label><?php _e('Check out', 'bookyourtravel') ?></label> <span id="date_to_text"></span> <input type="hidden" name="selected_date_to" id="selected_date_to" value="" /> <?php if (!empty($accommodation_check_out_time)) { echo ' ' . $accommodation_check_out_time; } ?> </div> </div> <div class="row twins bf_room_type_row" style="display:none"> <div class="f-item"> <label for="booking_form_adults"><?php _e('Adults', 'bookyourtravel') ?></label> <select class="dynamic_control" id="booking_form_adults" name="booking_form_adults"></select> </div> <div class="f-item booking_form_children"> <label for="booking_form_children"><?php _e('Children', 'bookyourtravel') ?></label> <select class="dynamic_control" id="booking_form_children" name="booking_form_children"></select> </div> </div> <div class="row bf_room_type_row" style="display:none"> <div class="f-item bf_room_type_cell"> <label><?php _e('Room type', 'bookyourtravel') ?></label> <span id="room_type"></span> <input type="hidden" name="room_type_id" id="room_type_id" /> </div> </div> <div class="row price_row" style="display:none"> <div class="f-item"> <table class="breakdown tablesorter responsive"> <thead></thead> <tfoot></tfoot> <tbody></tbody> </table> </div> </div> <div class='booking-commands'> <?php BYT_Theme_Utils::render_link_button("#", "gradient-button book-accommodation-reset", "book-accommodation-rest", __('Reset', 'bookyourtravel')); BYT_Theme_Utils::render_link_button("#", "gradient-button book-accommodation-next", "book-accommodation-next", __('Proceed', 'bookyourtravel')); ?> </div></div><?phpget_footer();