Wesley
September 14, 2012 at 11:54 am
New to Event Espresso and I am having a difficult time navigating through the documentation.
We are trying to edit registration_page_display.php to include the number of remaining seats.
Is this possible?
If so, could you help point us in the right direction to generating the appropriate code?
Thank you!
Wesley
September 17, 2012 at 1:22 pm
Add New Note to this Reply
We’ve been working on including the Available Seats in our registration page all weekend. The following code is the best we have come up with. Can anyone explain why it causes an error?
The following code was taken from the event_list_display file, where it works fine. I have only closed the php tags to make it fit in the registration_page_display file.` = $reg_limit) {
?>
<p id="available_spaces-“>
<p id="register_link-" class="register-link-footer"><a class="a_register_link" id="a_register_link-" href="" title=""></a>
<p id="available_spaces-" class="spaces-available">
`
Once we put this into the registration_page_display file, we get a syntax error on line 311.
Here is the full code with our attempts to include the available seats:
<h3 class="event_title ui-widget-header ui-corner-top" id="event_title-"> <?php echo $is_active['status'] == 'EXPIRED' ? ' - Event Expired' : ''; ?> <?php echo $is_active['status'] == 'PENDING' ? ' - Event is Pending' : ''; ?> <?php echo $is_active['status'] == 'DRAFT' ? ' - Event is a Draft' : ''; ?>
<div class="event_espresso_form_wrapper event-data-display ui-widget-content “>
<strong>
</strong>
<strong>
</strong>
<?php
}
echo event_date_display($start_date, get_option('date_format'));
if ($end_date !== $start_date) {
echo '';
?>
<strong>
</strong> <?php echo event_date_display($end_date, get_option('date_format'));
echo '';
}?>
<?php //This block of code is used to display the times of an event in either a dropdown or text format.
if (isset($time_selected) && $time_selected == true) {//If the customer is coming from a page where the time was preselected.
echo event_espresso_display_selected_time($time_id); //Optional parameters start, end, default
} else {
echo event_espresso_time_dropdown($event_id);
}//End time selected
echo '';
?>
<?php // echo ''; ?>
<?php // echo '' . __('Venue Details', 'event_espresso') . ''; ?>
<?php // echo $venue_title != ''?''.stripslashes_deep($venue_title).'':''?>
<?php // echo $venue_address != ''?''.stripslashes_deep($venue_address).'':''?>
<?php // echo $venue_address2 != ''?''.stripslashes_deep($venue_address2).'':''?>
<?php // echo $venue_city != ''?''.stripslashes_deep($venue_city).'':''?>
<?php // echo $venue_state != ''?''.stripslashes_deep($venue_state).'':''?>
<?php // echo $venue_zip != ''?''.stripslashes_deep($venue_zip).'':''?>
<?php // echo $venue_country != ''?''.stripslashes_deep($venue_country).'':''?>
<?php // echo ''; ?>
<?php
}//End display description
switch ($is_active['status']) {
case 'EXPIRED': //only show the event description.
_e('This event has passed.', 'event_espresso');
break;
case 'REGISTRATION_CLOSED': //only show the event description.
// if todays date is after $reg_end_date
?>
<strong>
</strong>
<strong>
<?php _e('Please <a href="contact" title="contact us">contact us</a> if you would like to know if spaces are still available.', 'event_espresso'); ?>
</strong>
<strong>
</strong>
<strong>
</strong>
<form method="post" action="/?page_id=" id="registration_form">
<p class="event_address" id="event_address-">
= $reg_limit) {
?>
<p id="available_spaces-">
<p id="register_link-" class="register-link-footer"><a class="a_register_link" id="a_register_link-" href="" title=""></a>
<p id="available_spaces-" class="spaces-available">
<input type="text" name="seat_id" value="" class="ee_s_select_seat required" title="" event_id="" readonly="readonly" />
get_row("select * from " . EVENTS_SEATING_CHART_TABLE . " where id = $seating_chart_id");
if (trim($seating_chart->image_name) != "" && file_exists(EVENT_ESPRESSO_UPLOAD_DIR . 'seatingchart/images/' . $seating_chart->image_name)) {
?>
<a href="image_name; ?>" target="_blank"></a>
1));
?>
1) {
//This returns the additional attendee form fields. Can be overridden in the custom files addon.
echo event_espresso_additional_attendees($event_id, $additional_limit, $number_available_spaces, __('Number of Tickets', 'event_espresso'), true, $event_meta);
} else {
?>
<input type="hidden" name="num_people" id="num_people-" value="1">
<input type="hidden" name="regevent_action" id="regevent_action-" value="post_attendee">
<input type="hidden" name="event_id" id="event_id-" value="">
<p class="event_form_field" id="captcha-">
<p class="event_form_submit" id="event_form_submit-">
<input class="btn_event_form_submit ui-button ui-button-big ui-priority-primary ui-state-default ui-state-hover ui-state-focus ui-corner-all" id="event_form_field-" type="submit" name="Submit" value="">
<?php echo '’ . espresso_edit_this($event_id) . ” ?>
Wesley
September 17, 2012 at 1:23 pm
Add New Note to this Reply
Here’s the line with the syntax error:
<?php echo '' . espresso_edit_this($event_id) . '' ?>
Wesley
September 17, 2012 at 4:34 pm
Add New Note to this Reply
Hi, I don’t know how to edit my post. I see the preview is below the reply box now. I was looking for a preview button.
The code above looks like it came out like gibberish. I’m not sure if anyone can tell what’s going on with it, but it worked to display the Available Spaces, as we wanted. I just had to delete a small section that was causing problems. I now have the Available Seats listed in the form, but everything below the Available Seats in the form is gone.
The working code looks like this:
<p id="available_spaces-">
<p id="register_link-"class="register-link-footer">
<a class="a_register_link"
id="a_register_link-"
href=""
title="">
<p id="available_spaces-"
class="spaces-available">
<?php
}
I can’t tell in the below preview if my code is showing right or not. I’ve put it in a notepad in order to remove formatting, and also put line breaks in it that are not actually there, in order to get it to fit in the post field properly. And I’ve used the tag instead of the brackets graphic. I'll post it again without the line breaks, if this doesn't make it readable.
Wesley
September 17, 2012 at 4:36 pm
Add New Note to this Reply
That didn’t work at all. I’ll search how to post code in a forum. I don’t know how anyone can help, if they can’t see the code.
Wesley
September 17, 2012 at 4:50 pm
Add New Note to this Reply
This is a link to the code.
The entire file is there to look at. The problem is the rest of the Registration Form not showing after the Available Seats. I apologize for all the messy posts above.
Dean
September 18, 2012 at 3:00 am
Add New Note to this Reply
Hi Wesley,
Dont worry about the messy posts it happens.
It looks like the code you supplied was missing some of the code to begin with and also a closing }
this should do what you were trying to achieve
<?php
$num_attendees = get_number_of_attendees_reg_limit($event_id, 'num_attendees'); //Get the number of attendees. Please visit https://eventespresso.com/forums/?p=247 for available parameters for the get_number_of_attendees_reg_limit() function.
if ($num_attendees >= $reg_limit) { ?>
<p id="available_spaces-<?php echo $event_id ?>"><span class="section-title"><?php _e('Available Spaces:', 'event_espresso') ?> </span><?php echo get_number_of_attendees_reg_limit($event_id, 'available_spaces', 'All Seats Reserved') ?></p>
<?php if ($overflow_event_id != '0' && $allow_overflow == 'Y') { ?>
<p id="register_link-<?php echo $overflow_event_id ?>" class="register-link-footer"><a class="a_register_link" id="a_register_link-<?php echo $overflow_event_id ? rel="nofollow">" 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
}
} else {
if ($display_reg_form == 'Y' && $externalURL == '') {
?> <p id="available_spaces-<?php echo $event_id ?>" class="spaces-available"><span class="section-title"><?php _e('Available Spaces:', 'event_espresso') ?></span> <?php echo get_number_of_attendees_reg_limit($event_id, 'available_spaces') ?></p>
<?php
}
}
This reply was modified 12 years, 3 months ago by Dean .
Wesley
September 18, 2012 at 6:29 pm
Add New Note to this Reply
Thank you Dean!