Plugin: BP Group Reviews

Join this plugin group to follow comments, support topics and reviews.

Custom activity filter – showin brocken image for the link to the review (5 posts)

Started 1 year ago by: nit3watch

  • Profile picture of nit3watch nit3watch said 1 year ago:

    Hi

    Basically I have added custom activities to my home page being filtered by different things. The activity is also limited to a certain number of characters. The reviews render as the image below:

    Image and video hosting by TinyPic

    function bp_limit_activity_content() {
    
    $limit_activity_length = 130; //character limit
    
    $limit_excerpt = substr(bp_get_activity_content_body(), 0, $limit_activity_length); //truncate excerpt according to lenngth
    if(strlen($limit_excerpt) < strlen(bp_get_activity_content_body())) {
        $limit_excerpt = $limit_excerpt.'..' ;
    }
    
    echo "<p>".$limit_excerpt."</p>"; //finally display excerpt
    }
    
    /* Limit Site Activity */
    function limit_site_activity() {
    
    	global $wpdb;
    
    ?>
    
    <?php if ( bp_has_activities('per_page=3') ) : ?>
    <div id="news-container">
    
    	<ul id="activity-stream" class="activity-list item-list">
    
    	<?php while ( bp_activities() ) : bp_the_activity(); ?>
    
    		<li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>">
    
    			<div class="activity-content-gactivity">
    
    				<div class="activity-header">
    					<?php bp_activity_action() ?>
    				</div>
    
    				<a href="<?php bp_activity_thread_permalink() ?>"><?php bp_limit_activity_content() ?></a>
    
    				<?php do_action( 'bp_activity_entry_content' ) ?>
    
    			</div>
    		</li>
    
    	<?php endwhile; ?>
    
    	</ul>
    </div>
    <?php else : ?>
    	<div id="message" class="info">
    		<p><?php _e( 'Join groups to get feed.', 'buddypress' ) ?></p>
    	</div>
    <?php endif; ?>
    
    <?php
    
    }

    Is there anything I should be adding to my loop?

  • Profile picture of nit3watch nit3watch said 1 year ago:

    Else is there a way I can exclude the reviews from my custom above?

  • Profile picture of prertenmofil prertenmofil said 5 months, 1 week ago:

    Better a little fire to warm us, than a great one to burn us!

  • Profile picture of kumbmotoprat kumbmotoprat said 4 months ago:

    Don’t keep a dog and bark yourself

  • Profile picture of trosminimort trosminimort said 4 months ago:

    Easier said than done ????? ???????, ??? ???????