• The Youzer plugin records photo media uploads pretty much like facebook does – I am trying to integrate MediaPress to allow Youzer to style the activity record when uploading new photos in mediapress

    There exists in Youzer the following function that creates the fb styled thumbnails. How can i get MediaPress to hook into this and where in activity code would i do this? Or could we include this function below in MediaPress?

    	/**
    	 * Photo Post.
    	 */
    	function get_wall_post_images( $attachments, $activity_id ) {
    
    		// Get Attachments number.
    		$count_atts = count( $attachments );
    		
    		if ( 1 == $count_atts && ! empty( $attachments[0] ) ) { ?>
    			
    			<?php $img_url = yz_get_file_url( $attachments[0] ); ?>
    			<?php 
    				$size = yz_get_image_size( $img_url ); 
    				$class = isset( $size[0] ) && ( $size[0] < 800 ) ? 'yz-img-with-padding' : 'yz-full-width-img';
    			 ?>
    			<a href="<?php echo $img_url; ?>" class="<?php echo $class; ?>" data-lightbox="yz-post-<?php echo $activity_id; ?>">
    				<?php if ( yz_limit_wall_posts_image_height() ) : ?>
    					<div class="yz-limited-image-height" style="background-image: url(<?php echo $img_url; ?>)"></div>
    					<?php else : ?>
    					<img src="<?php echo $img_url; ?>" alt="" />
    				<?php endif; ?>
    			</a>
    			
    			<?php } elseif ( 2 == $count_atts || 3 == $count_atts ) { ?>
    
    			<div class="yz-post-<?php echo $count_atts; ?>imgs">
    
    				<?php foreach( $attachments as $i => $attachment ) : ?>
    					
    					<?php $img_url = yz_get_file_url( $attachment ); ?>
    					<a class="yz-post-img<?php echo $i + 1;?>" href="<?php echo $img_url; ?>" data-lightbox="yz-post-<?php echo $activity_id; ?>">
    						<div class="yz-post-img" style="background-image: url(<?php echo $img_url; ?>)"></div>
    					</a>
    
    				<?php endforeach; ?>
    
    			</div>
    
    		<?php } elseif ( 4 <= $count_atts ) { ?>
    
    			<div class="yz-post-4imgs">
    				
    				<?php foreach( $attachments as $i => $attachment ) : ?>
    				<?php $img_url = yz_get_file_url( $attachment ); ?>
    				<a class="yz-post-img<?php echo $i + 1; if ( 3 == $i && $count_atts > 4  ) { echo ' yz-post-plus4imgs'; }?>" href="<?php echo $img_url; ?>" data-lightbox="yz-post-<?php echo $activity_id; ?>">
    					<div class="yz-post-img" style="background-image: url(<?php echo $img_url; ?>)">
    						<?php 
    							if ( 3 == $i && $count_atts > 4 ) {
    								$images_nbr = $count_atts - 4;
    								echo '<span class="yz-post-imgs-nbr">+' . $images_nbr . '</span>';
    							}
    						?>
    					</div>
    				</a>
    
    				<?php endforeach; ?>
    
    			</div>
    			<?php
    		}
    	}
Viewing 1 replies (of 1 total)
  • Plugin Author Brajesh Singh

    (@sbrajesh)

    Hi Greg,
    Thank you for the post. It is certainly easily doable. I will ask one of our team members to look and see if they can provide some update on this next week.

    PS:- In MediaPress you can achieve on your own by overwriting the template for activity. It is available in wp-content/plugins/mediapress/templates/default/buddypress/activity/views/grid-photo.php copy it to
    yourtheme/mediapress/default/buddypress/views/grid-photo.php and modify.

    Regards
    Brajesh

Viewing 1 replies (of 1 total)
  • The topic ‘Integrating with Youzer – Styling of MediaPress Activity Thumbnails’ is closed to new replies.