<div class="interest-user">
    <h3>Possibly interested people or topic</h3>
    <?php foreach($this->sidebar_recommend_users_topics AS $key => $val) { ?>
    <?php if ($val['topic_id']) { ?>
      	<p class="add_ls">
        <a href="topic/<?php echo $val['url_token']; ?>" class="addUser" ><img class="umsg" data-message="&uid=<?php echo $val['topic_id']; ?>&card=topic" src="<?php echo get_topic_pic_url('mid', $val['topic_pic']); ?>" alt="<?php echo $val['topic_title']; ?>" title="<?php echo $val['topic_title']; ?>"/></a>
		
        <a href="topic/<?php echo $val['url_token']; ?>" class="umsg" data-message="&uid=<?php echo $val['topic_id']; ?>&card=topic"><span class="glotopic" ><?php echo utf8_substr($val['topic_title'], 0, 10, 'UTF-8', '...'); ?></span></a>
        <a onclick="focus_topic($(this), $(this).find('em'), <?php echo $val['topic_id']; ?>);" rel="Add attention" class="add-attention" href="javascript:;"><em>Follow</em></a> 
        <span class="add_gray"><?php if ($val['focususers']['user_name']) { ?><a href="people/<?php echo $val['focususers']['url_token']; ?>"  data-message="&uid=<?php echo $val['focususers']['uid'];?>&card=user"><?php echo $val['focususers']['user_name']; ?></a> followed this topic<?php } ?></span>  
       </p>
	<?php } else { ?>
		<p class="add_ls">
          	<a href="people/<?php echo $val['url_token']; ?>" class="addUser" ><img class="umsg" data-message="&uid=<?php echo $val['uid'];?>&card=user" src="<?php echo get_avatar_url($val['uid'], 'min'); ?>" alt="<?php echo $val['user_name']; ?>" title="<?php echo $val['user_name']; ?>"/></a>
			
            <a href="people/<?php echo $val['url_token']; ?>" class="umsg" data-message="&uid=<?php echo $val['uid'];?>&card=user"><?php echo $val['user_name']; ?> </a><a onclick="follow_people($(this), $(this).find('em'), <?php echo $val['uid'];?>);" rel="Add attention" class="add-attention" href="javascript:void(0);"><em>Follow</em></a> <span class="add_gray"><?php if ($val['rtype']['type'] == 'friend') { ?><a href="people/<?php echo $val['friend_users']['url_token']; ?>" ><?php echo $val['friend_users']['user_name'];?></a> followed her/him<?php } else if ($val['rtype']['type'] == 'topic') { ?>She/he also followed <a href='topic/<?php echo $val['topic_info']['url_token']; ?>'><?php echo $val['topic_info']['topic_title'];?></a><?php } ?></span> </p>
	<?php } ?>
	<?php } ?>
</div>