• Hi

    firstly, nice simple plugin. Thanks for that.

    I am playing with the free version before deciding on whether or not the pro version makes sense for me.
    One thing I want to do is let users create events on a separate page. I have thus attempted to make a page template (https://www.testing.fermunity.com/create-event/) similar to the create event field on the buddypress profile.

    I encountered two issues:

    1. I get a warning for the category field (as you can see on the link above): Warning: in_array() expects parameter 2 to be array, null given in /home/fermunit/public_html/testing/wp-content/themes/socialchef-child/profile-events-create.php on line 78

    the relevant code block is:

    <?php if( ! empty( $categories ) ) : ?>
    
    		<p>
    			<label for="event-cats"><?php echo __( 'Categories', 'bp-simple-events' ); ?>: <?php if( in_array('categories', $required_fields) ) echo __( '*', 'bp-simple-events' ); ?></label>
    			<?php
    				foreach( $categories as $category ) {
    
    					$checked = '';
    					if( in_array( $category->term_id, $pp_ec->cats_checked ) )
    						$checked = ' checked';
    
    					echo '&nbsp;&nbsp;<input type="checkbox" name="event-cats[]" value="' . $category->term_id . '"' . $checked . '/> ' . $category->name . '<br/>';
    				}
    			?>
    		</p>
    
    	<?php endif; ?>	

    Line 78 is if( in_array( $category->term_id, $pp_ec->cats_checked ) )

    2. The calendar & time pop-up does not show up on the page like it does on the buddypress profile page.

    Any suggestions would be appreciated.

    Thanks
    Simon

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author shanebp

    (@shanebp)

    #1: Try adding

    global $pp_ec;
    $required_fields = get_option( 'pp_events_required' );

    at the top of your template.

    #2: Probably the jquery date & time scripts are not being enqueued. Try hacking this function pp_events_profile_enqueue()
    in buddypress-simple-events\trunk\inc\pp-events-screens.php
    or write a separate function on the wp_enqueue_scripts hook.

    Thread Starter simon2902

    (@simon2902)

    Thanks for your response.

    on #1: I already had this code at the top of the template and the problem persists.

    on 2#: not sure where exactly to start here (not a fully fledged programmer myself), how would the wp_enqueue_scripts function look like (I only got errors when trying it out).

    Thanks
    Simon

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create event page’ is closed to new replies.