コード例 #1
0
ファイル: screens.php プロジェクト: MartinPaulEve/humcore
/**
 * Output the search sidebar facet list content.
 */
function humcore_directory_sidebar_content()
{
    $extended_query_string = humcore_get_search_request_querystring();
    humcore_has_deposits($extended_query_string);
    $facet_display_counts = humcore_get_facet_counts();
    $facet_display_titles = humcore_get_facet_titles();
    $query_args = wp_parse_args($extended_query_string);
    ?>
	<ul class="facet-set"><?php 
    foreach ($facet_display_counts as $facet_key => $facet_values) {
        if (!in_array($facet_key, array('genre_facet', 'subject_facet', 'pub_date_facet'))) {
            continue;
        }
        $facet_list_count = 0;
        ?>
		<li class="facet-set-item">Browse by <?php 
        echo esc_html(trim($facet_display_titles[$facet_key]));
        ?>
		<ul id="<?php 
        echo sanitize_title_with_dashes(trim($facet_key));
        ?>
-list" class="facet-list"><?php 
        $sorted_counts = $facet_values['counts'];
        if ("pub_date_facet" === $facet_key) {
            arsort($sorted_counts);
        }
        foreach ($sorted_counts as $facet_value_counts) {
            if (!empty($facet_value_counts[0])) {
                $facet_list_item_selected = false;
                if (!empty($query_args['facets'][$facet_key])) {
                    if (in_array($facet_value_counts[0], $query_args['facets'][$facet_key])) {
                        $facet_list_item_selected = true;
                    }
                }
                $display_count = sprintf('<span class="count facet-list-item-count"%1$s>%2$s</span>', $facet_list_item_selected ? ' style="display: none;"' : '', $facet_value_counts[1]);
                echo sprintf('<li class="facet-list-item"%1$s><a class="facet-search-link" href="/deposits/?facets[%2$s][]=%3$s">%4$s %5$s</a></li>', $facet_list_count < 4 || $facet_list_item_selected ? '' : ' style="display: none;"', trim($facet_key), urlencode(trim($facet_value_counts[0])), trim($facet_value_counts[0]), $display_count);
                // XSS OK.
                $facet_list_count++;
            }
        }
        if (4 < $facet_list_count) {
            echo '<div class="facet-display-button"><span class="show-more button white right">' . esc_attr__('more>>', 'humcore_domain') . '</span></div>';
        }
        ?>
			</ul>
		</li>
	<?php 
    }
    ?>
	</ul>
<?php 
}
コード例 #2
0
$my_querystring = '';
// If the ajax string is empty, that usually means that
// it's the first page of the "everything" filter.
$querystring = bp_ajax_querystring('deposits');
if (empty($querystring)) {
    $querystring = $my_querystring;
}
// Handle subsequent pages of the "Everything" filter
if ('page' == substr($querystring, 0, 4) && strlen($querystring) < 8) {
    $querystring = $my_querystring . '&' . $querystring;
}
?>
 

<?php 
if (humcore_has_deposits($querystring)) {
    ?>

	<?php 
    if (1 == 1 || empty($_POST['page'])) {
        //disable for now
        ?>
 

		<ul id="deposits-stream" class="deposits-list item-list">

	<?php 
    }
    ?>

	<?php 
コード例 #3
0
<div id="content" role="main" class="<?php 
do_action('content_class');
?>
">
<div class="padder">

<h3><?php 
_e('CORE Deposits Listing ', 'humcore_domain');
?>

<?php 
do_action('bp_before_deposits_list_loop');
?>

<?php 
if (humcore_has_deposits('&per_page=250')) {
    ?>

	<div id="deposits-stream" class="item-list">

	<?php 
    while (humcore_deposits()) {
        humcore_the_deposit();
        ?>

		<?php 
        do_action('bp_before_deposit_item');
        ?>

                <?php 
        do_action('humcore_deposits_list_entry_content');
コード例 #4
0
// it's the first page of the "everything" filter.
$querystring = bp_ajax_querystring('deposits');
if (empty($querystring)) {
    $querystring = $my_querystring;
} else {
    $querystring = implode('&', array($my_querystring, $querystring));
}
// Handle subsequent pages of the "Everything" filter
if ('page' == substr($querystring, 0, 4) && strlen($querystring) < 8) {
    $querystring = $my_querystring . '&' . $querystring;
}
?>
 

<?php 
if (!empty($displayed_user_fullname) && humcore_has_deposits($querystring)) {
    ?>

	<?php 
    if (1 == 1 || empty($_POST['page'])) {
        ?>

		<ul id="deposits-stream" class="deposits-list item-list">

	<?php 
    }
    ?>

	<?php 
    while (humcore_deposits()) {
        humcore_the_deposit();
コード例 #5
0
 /**
  * Show deposit button to logged in users.
  */
 public function humcore_before_directory_deposits_content()
 {
     if (is_user_logged_in() && humcore_is_deposit_directory()) {
         echo '<a href="/deposits/item/new/" class="bp-deposits-deposit button" title="Deposit an Item">Deposit an Item</a>';
     }
     humcore_has_deposits(bp_ajax_querystring('deposits'));
 }
コード例 #6
0
ファイル: functions.php プロジェクト: MartinPaulEve/humcore
/**
 * Load the Deposits item review screen.
 */
function humcore_deposits_item_review_screen()
{
    global $wp;
    if (humcore_is_deposit_item_review()) {
        bp_update_is_directory(false, 'humcore_deposits');
        $deposit_id = $wp->query_vars['deposits_item'];
        if (empty($deposit_id)) {
            bp_do_404();
            return;
        }
        $item_found = humcore_has_deposits('include=' . $deposit_id);
        if ($item_found) {
            do_action('humcore_deposits_item_review_screen');
            add_action('wp_head', 'humcore_deposit_item_search_meta');
            bp_core_load_template(apply_filters('humcore_deposits_item_review_screen', 'deposits/single/review'));
        } else {
            bp_do_404();
        }
    }
}