Пример #1
0
    function widget($args, $instance)
    {
        global $bp;
        extract($args);
        echo $before_widget;
        echo $before_title . $widget_name . $after_title;
        ?>

		<?php 
        if (bp_has_links('type=popular&per_page=' . $instance['max_links'] . '&max=' . $instance['max_links'])) {
            ?>
			<div class="item-options" id="links-list-options">
				<span class="ajax-loader" id="ajax-loader-links"></span>
				<a href="<?php 
            echo site_url() . '/' . bp_links_root_slug();
            ?>
" id="newest-links"><?php 
            _e("Newest", 'buddypress');
            ?>
</a> |
				<?php 
            if (bp_links_is_voting_enabled()) {
                ?>
				<a href="<?php 
                echo site_url() . '/' . bp_links_root_slug();
                ?>
" id="most-votes"><?php 
                _e("Votes", 'buddypress-links');
                ?>
</a> |
				<a href="<?php 
                echo site_url() . '/' . bp_links_root_slug();
                ?>
" id="high-votes"><?php 
                _e("Rating", 'buddypress-links');
                ?>
</a> |
				<a href="<?php 
                echo site_url() . '/' . bp_links_root_slug();
                ?>
" id="popular-links" class="selected"><?php 
                _e("Popular", 'buddypress');
                ?>
</a>
				<?php 
            } else {
                ?>
				<a href="<?php 
                echo site_url() . '/' . bp_links_root_slug();
                ?>
" id="active-links"><?php 
                _e("Active", 'buddypress');
                ?>
</a>
				<?php 
            }
            ?>
			</div>

			<ul id="links-list" class="item-list">
				<?php 
            while (bp_links()) {
                bp_the_link();
                ?>
					<li>
						<div class="item-avatar">
							<a href="<?php 
                bp_link_permalink();
                ?>
"><?php 
                bp_link_avatar(array('width' => bp_core_avatar_thumb_width(), 'height' => bp_core_avatar_thumb_height()));
                ?>
</a>
						</div>

						<div class="item">
							<div class="item-title"><a href="<?php 
                bp_link_permalink();
                ?>
" title="<?php 
                bp_link_name();
                ?>
"><?php 
                bp_link_name();
                ?>
</a></div>
							<?php 
                if (bp_links_is_voting_enabled()) {
                    ?>
							<div class="item-meta"><span class="activity"><?php 
                    printf(__('%+d rating', 'buddypress-links'), bp_get_link_vote_total());
                    ?>
</span></div>
							<?php 
                }
                ?>
						</div>
					</li>

				<?php 
            }
            ?>
			</ul>
			<?php 
            wp_nonce_field('bp_links_widget_links_list', '_wpnonce-links');
            ?>
			<input type="hidden" name="links_widget_max" id="links_widget_max" value="<?php 
            echo attribute_escape($instance['max_links']);
            ?>
" />

		<?php 
        } else {
            ?>

			<div class="widget-error">
				<?php 
            _e('There are no links to display.', 'buddypress-links');
            ?>
			</div>

		<?php 
        }
        ?>

		<?php 
        echo $after_widget;
        ?>
	<?php 
    }
Пример #2
0
    // spit out old containers
    ?>
		<div id="content">
			<div class="padder"><?php 
} else {
    // spit out legacy container
    ?>
		<div id="buddypress"><?php 
}
?>

	<div id="content" class="link-home">
		<div class="padder">
			<?php 
if (bp_has_links()) {
    while (bp_links()) {
        bp_the_link();
        ?>

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

			<div id="item-header">
				<?php 
        bp_links_locate_template(array('single/link-header.php'), true);
        ?>
			</div>

			<div id="item-nav">
				<div class="item-list-tabs no-ajax" id="object-nav">