/**
 * List galleries drop down
 * 
 * @param type $args
 * @return string
 */
function mpp_list_galleries_dropdown($args = null)
{
    $default = array('name' => 'mpp-gallery-list', 'id' => 'mpp-gallery-list', 'selected' => 0, 'type' => '', 'status' => '', 'component' => '', 'component_id' => '', 'posts_per_page' => -1, 'echo' => 1, 'label_empty' => '');
    $args = wp_parse_args($args, $default);
    extract($args);
    if (!$component || !$component_id) {
        return;
    }
    $mppq = new MPP_Gallery_Query($args);
    $html = '';
    $selected_attr = '';
    if ($label_empty) {
        $html .= "<option value='0'" . selected(0, $selected, false) . ">" . $label_empty . "</option>";
    }
    while ($mppq->have_galleries()) {
        $mppq->the_gallery();
        $selected_attr = selected($selected, mpp_get_gallery_id(), false);
        $html .= "<option value='" . mpp_get_gallery_id() . "'" . $selected_attr . " data-mpp-type='" . mpp_get_gallery_type() . "'>" . mpp_get_gallery_title() . "</option>";
    }
    //reset current gallery
    mpp_reset_gallery_data();
    if (!empty($html)) {
        $html = "<select name='{$name}' id='{$id}'>" . $html . "</select>";
    }
    if (!$echo) {
        return $html;
    } else {
        echo $html;
    }
}
Beispiel #2
0
    ?>
		
		<?php 
    mpp_locate_template(array('buddypress/activity/post-form.php'), true);
    ?>

	<?php 
}
?>
	
	<?php 
do_action('mpp_before_activity_loop');
?>
	
	<?php 
if (mpp_gallery_has_activity(array('gallery_id' => mpp_get_gallery_id()))) {
    ?>

		<?php 
    /* Show pagination if JS is not enabled, since the "Load More" link will do nothing */
    ?>
		<noscript>
			<div class="pagination">
				<div class="pag-count"><?php 
    bp_activity_pagination_count();
    ?>
</div>
				<div class="pagination-links"><?php 
    bp_activity_pagination_links();
    ?>
</div>