
<div class="w97p pdl10">
				<ul >
			<?php 
				$total_like = '';
				$contnet_class = '';
				
				foreach ($blogs as $blog): 
				
					$total_like = sizeof($blog['Contentlike']);
						if(!empty($blog['Contentlike'])):
							foreach ($blog['Contentlike'] as $contentlike):
													
								if($contentlike['user_id']== $loggedUser['id']):
									$lun = 'Liked';
									$fun_n = 'unlike_by_wall_id';
									break;
								else:
									$lun = 'Like';
									$fun_n = 'like_by_wall_id';
								endif;
							endforeach;
						else:
							$lun = 'Like';
							$fun_n = 'like_by_wall_id';
						endif;
				?>
				<li>
				<div class="shdw brd pd10 mrb10">
					<div class="borb mrb5">
						<div class='row-fluid'>
						 	<div class='span10'><b><?php echo $this->Html->link($blog['Content']['title'],array('action'=>'blogdetails',$blog['Content']['id']),array());?></b></div>
						 	<div class='span2 tar'>
						 		<?php 
								if(empty($owneruserId)): 
									echo $this->Form->postLink('', array('action' => 'delete', $blog['Content']['id']),array('class'=>'iconlink linkdelete','escape' =>false), __('Are you sure you want to delete this blog?', $blog['Content']['id']));
								endif;
								?>
						 	</div>
						</div>
						
					</div>
					
					<div class="row-fluid">
					<div class='span2 ih300'>
					<?php if (!empty($blog['Content']['link1'])){?>
					<img  src="<?php echo $blog['Content']['link1'];?>" class="img-responsive icimage2" style="float:left;padding-bottom:7px;margin-top: 5px;padding-right: 10px;">
					<?php }else {
						echo  $this->Html->image('noimagefound.jpg',array('style'=>'float:left;padding-bottom:7px;margin-top: 5px;padding-right: 10px;'));
					}?>	
					</div>
						<div class="fnt80" style="margin-top: 4px;">
							<?php  
							if (strlen($blog['Content']['content'])>350){
								$reading=$this->Html->link('...Continue reading',array('controller'=>'contents','action'=>'blogdetails',$blog['Content']['slug']),array('style'=>'color:#5050df'));
								echo substr(strip_tags($blog['Content']['content']),0,350).$reading;
							}else{
								echo strip_tags($blog['Content']['content']);
							}
							?>
						</div>
					</div>
					<div class="fl fnt80" style="margin-top: 12px; ">
						<?php 
						echo sizeof($blog['Contentcomment']).' Comment(s)';
						?>
					</div>
					<div class="tar mrt5 bort pdt5 fnt80">
						
                        	<a onclick="<?php echo $fun_n?>('https://foqas.com/contentlikes',<?php echo $blog['Content']['id']?>,<?php echo $total_like;?>)" id="<?php echo 'lun'.$blog['Content']['id'] ?>" style="cursor:pointer;margin-right:0px;">
								<?php echo $lun.'('.$total_like.')' ?>
							</a>
							<?php if ($blog['Content']['status']==2) {
                        		$publish= $this->Form->input('Unpublish',array('id'=>'df'.$blog['Content']['id'],'style'=>'float:left; padding: 1px 12px;','type'=>'button','class'=>'btn','label'=>false,'div'=>false,'onclick'=>'courseunpublish('.$blog['Content']['id'].');'));
                        		
                        	}else {
                        		$publish= $this->Form->input('Publish',array('id'=>'rf'.$blog['Content']['id'],'style'=>'margin-right:5px','type'=>'button','class'=>'btn btn-mini','label'=>false,'div'=>false,'onclick'=>'blogpublished('.$blog['Content']['id'].');'));
                        	}
                        	echo $publish;
                        	?>
						<?php 
						if(empty($owneruserId)): 
							echo $this->Html->link('',array('action'=>'edit',base64_encode($blog['Content']['id']),base64_encode($blog['Content']['slug'])),array('class'=>'iconlink linkedit','title'=>'Edit'));
						endif;
						?>
					</div>
				</div>
				
				</li>
			<?php endforeach;?>
			
				</ul>
			</div>