[Plugin: EventPress] Events for group
-
Hello
I’d ask if is it possible to easily make integration of groups and events?
I have added such function to
views/admin.php
/** * Metabox for the group. * * @param int $id Groups to choose * @param mixed $default The default value for this * * @since 0.1 */ function metabox_group( $id, $default ) { global $post; $author = $post->post_author; ?> <label for = 'ep-<?php echo $id; ?>-input'><?php _e('Connected to group', 'eventpress') ?></label> <select name = 'ep-meta[<?php echo $id; ?>]'> <? $groups = groups_get_user_groups( $author ); foreach($groups[groups] as $key=>$eachgroup){ $temp = new BP_Groups_Group($eachgroup); foreach ($temp->admins as $key2=>$eachadmin){ if (($eachadmin->user_id == $author)&&(($eachadmin->is_mod==1)||($eachadmin->is_admin==1))) { ?> <option value = '<?php echo $temp->slug ?>'><?php echo $temp->name ?></option> <? } }; } ?> </select> <?php }
and modified:
function metabox() { global $post; $grid = Array( Array( Array( 'width' => 10, 'id' => 'group', 'contents' => Array(&$this, 'metabox_group') ) ), (...rest of code...)
and in file
controllers/wp.php
modified fallowing function:
function save_meta( $eventid, $event ) {
by adding:if ( !empty( $meta['group'] ) ) $group = esc_html( $meta['group'] );
and:
$metalist = Array( 'limitreg', 'venue', 'group', 'startreg', 'stopreg', 'start', 'end', 'map', 'latlong', 'confirmreg');
It works fine, but I would get listing of chosen group by such such URL:
https://site/events/my_group
or
https://site/my_group/eventsPlease, write how to do it?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: EventPress] Events for group’ is closed to new replies.