Support

Home Forums Event Espresso Premium customize available spaces

customize available spaces

Posted: August 30, 2012 at 6:34 pm

Viewing 8 reply threads


emoria

August 30, 2012 at 6:34 pm

Hello,

I’d like to follow this doc but it looks incomplete and I’m having trouble finding some of the code it says to replace.

https://eventespresso.com/wiki/how-to-customize-your-available-spaces-text/

  • This topic was modified 12 years, 3 months ago by emoria.


Dean

August 31, 2012 at 5:49 am

Hello Emoria,

Yes that doc definitely needs some work!

In the mean time I have crafted some code for you. This goes in the event_list_display.php at the same place (around line 94) and replaces the code there.

It works on a testing server but make sure you back things up before using it to be on the safe side, as it isn’t fully tested.

screenshot

$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-"> 

        &lt;p id=&quot;register_link-" class="register-link-footer"&gt;&lt;a class=&quot;a_register_link&quot; id=&quot;a_register_link-" href="" title=""&gt;</a>
                    &lt;p id=&quot;available_spaces-" class="spaces-available"&gt; 
        = $reg_limit) {
    ?&gt;
    &lt;p id=&quot;available_spaces-"&gt; 

        &lt;p id=&quot;register_link-" class="register-link-footer"&gt;&lt;a class=&quot;a_register_link&quot; id=&quot;a_register_link-" href="" title=""&gt;</a>
        = 11 ) {
        ?&gt;           &lt;p id=&quot;available_spaces-" class="spaces-available"&gt; 
        &lt;?php

} else {
    if($dr_free_spaces 
      &lt;p id=&quot;available_spaces-" class="spaces-available"&gt;   

<?php
}


emoria

August 31, 2012 at 12:24 pm

I’m not sure what to replace I only have 91 lines in my event_list_display.php

<?php
//This is the event list template page.
//This is a template file for displaying an event lsit on a page.
//There should be a copy of this file in your wp-content/uploads/espresso/ folder.
/*
* use the following shortcodes in a page or post:
* [EVENT_LIST]
* [EVENT_LIST limit=1]
* [EVENT_LIST show_expired=true]
* [EVENT_LIST show_deleted=true]
* [EVENT_LIST show_secondary=true]
* [EVENT_LIST show_recurrence=true]
* [EVENT_LIST category_identifier=your_category_identifier]
*
* Example:
* [EVENT_LIST limit=5 show_recurrence=true category_identifier=your_category_identifier]
*
*/
$first_event_instance = $events_group[0];
$first_event_excerpt = array_shift(explode('‘, html_entity_decode($first_event_instance[‘event_desc’])));

?>

<div id="event_data-” class=”event_data subpage_excerpt r event-data-display event-list-display event-display-boxes”>

&lt;h2 id=&quot;event_title-" class="event_title"&gt;

 1) :
        //Show short descriptions
        if ($first_event_excerpt != '' &amp;&amp; isset($org_options['display_short_description_in_event_list']) &amp;&amp; $org_options['display_short_description_in_event_list'] == 'Y') { ?&gt;




        $jaer = jQuery.noConflict();


    &lt;a href=&quot;#&quot; onClick=&quot;$jaer(&#039;#date_picker_').slideDown('slow');$jaer(this).parent().slideUp('slow');return false;" class="register_date" id="register_date_"&gt;Register Now</a>
    &lt;div class=&quot;date_picker&quot; id=&quot;date_picker_"&gt;



            &lt;?php foreach ($events_group as $e) :
                $num_attendees = get_number_of_attendees_reg_limit($e[&#039;event_id&#039;], &#039;num_attendees&#039;);//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.
                echo &#039;';
                if ($num_attendees &gt;= $e['reg_limit']) : 
                    echo '';
                else :
                    echo '<a href="'.$e['registration_url'].'">';
                endif;
                if ($e['start_date'] != $e['end_date']) : 
                    echo event_date_display($e['start_date'], 'F j, Y').'–'.event_date_display($e['end_date'], 'F j, Y'); 
                else : 
                    echo event_date_display($e['start_date'], 'l, F j, Y');
                endif;
                if ($num_attendees &gt;= $e['reg_limit']) : 
                    echo ' Sold Out <a href="'.get_option('siteurl').'/?page_id='.$e['event_page_id'].'&amp;regevent_action=register&amp;event_id='.$e['overflow_event_id'].'&amp;name_of_event='.stripslashes_deep($e['event_name']).'">'.__('(Join Waiting List)').'</a>';
                else :
                    echo '</a>';
                endif;
                echo '';
            endforeach; ?&gt;













    = $events_group[0]['reg_limit']) : ?&gt;

        Sold Out &lt;a href=&quot;/?page_id=&amp;regevent_action=register&amp;event_id=&amp;name_of_event=" title=""&gt;</a> 



        &lt;a href=&quot;" title=""&gt;</a>


Dean

August 31, 2012 at 1:26 pm

They are virtually the same code, in what you have its the block of code that starts

$num_attendees = get_number_of_attendees_reg_limit

and there a gap after it (in the code above) thats what you need to replace.


emoria

September 6, 2012 at 10:11 am

I get “Parse error: syntax error, unexpected ‘;’ in ” for the following line of the new code.

if ($num_attendees >= $reg_limit) {

  • This reply was modified 12 years, 3 months ago by emoria.


Dean

September 6, 2012 at 10:24 am

Hi

Revert the file back to what it was. What version of Event Espresso are you running? Im guessing it isnt the latest?


emoria

September 6, 2012 at 10:42 am

I am running 3.1.26p. with event_list_display.php from REM and this as my event_list.php.
https://gist.github.com/3165268


Dean

September 7, 2012 at 12:06 am

Thanks for that, the code I did goes into the event_list_display.php. I emailed you the code.


emoria

September 10, 2012 at 2:10 pm

I put a customiation request in. I’ll let you guys handle this as I’m having trouble getting the it to work.

Viewing 8 reply threads

The support post ‘customize available spaces’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso