<?php if ($this->posts_list) { ?>
<?php foreach($this->posts_list as $key => $val) { ?>
<div class="aw-item <?php if ($val['question_id']) { ?><?php if ($val['answer_count'] == 0) { ?>active<?php } ?><?php } else {?>article<?php } ?>">
<?php if ($val['anonymous'] == 0) { ?><a class="aw-user-name hidden-xs" data-id="<?php echo $val['user_info']['uid']; ?>" href="people/<?php echo $val['user_info']['url_token']; ?>" rel="nofollow"><img src="<?php echo get_avatar_url($val['user_info']['uid'], 'max'); ?>" alt="" /></a><?php } else { ?><a class="aw-user-name hidden-xs" href="javascript:;"><img src="<?php echo G_STATIC_URL; ?>/common/avatar-max-img.png" alt="<?php _e('匿名用户'); ?>" title="<?php _e('匿名用户'); ?>" /></a><?php } ?>
<div class="aw-question-content">
<h4>
<?php if ($val['question_id']) { ?>
<a href="question/<?php echo $val['question_id']; ?>"><?php echo $val['question_content']; ?></a>
<?php } else { ?>
<a href="<?php echo $val['post_type'].'/'.$val['id']; ?>"><?php echo $val['title']; ?></a>
<?php } ?>
<?php if (is_array($val['topics'])){ ?>
<?php foreach ($val['topics'] AS $t_key => $t_val) { ?>
<a href="topic/<?php echo $t_val['url_token']; ?>" class="aw-topic-name" data-id="<?php echo $t_val['topic_id']; ?>"><span><?php echo $t_val['topic_title']; ?></span></a><?php } ?>
<?php } ?>
</h4>
<?php if (is_array($val['answer_users'])) { ?>
<div class="pull-right hidden-xs contribute">
<span><?php _e('贡献'); ?>:</span>
<?php foreach ($val['answer_users'] AS $answer_user) { ?>
<a class="aw-user-name" data-id="<?php echo $answer_user['uid']; ?>" href="people/<?php echo $answer_user['url_token']; ?>" rel="nofollow"><img src="<?php echo get_avatar_url($answer_user['uid'], 'mid'); ?>" alt="" /></a>
<?php } ?>
</div>
<?php } ?>
<p>
<?php if ($_GET['category'] != $val['category_id'] AND $val['category_info']['title']) { ?>
<span class="aw-question-tags">
<i class="fa fa-caret-left"></i>
<a href="explore/category-<?php echo $val['category_info']['url_token']; ?>"><?php echo $val['category_info']['title']; ?></a>
</span> • <?php } ?>
<?php if ($val['question_id']) { ?>
<?php if ($val['answer_count'] > 0) { ?>
<?php if ($val['answer']['anonymous']) { ?>
<a href="javascript:;" class="aw-user-name"><?php _e('匿名用户'); ?></a><?php } else { ?><a href="people/<?php echo $val['answer']['user_info']['url_token']; ?>" class="aw-user-name" data-id="<?php echo $val['answer']['user_info']['uid']; ?>"><?php echo $val['answer']['user_info']['user_name']; ?></a><?php } ?>
<span class="aw-text-color-999"><?php _e('回复了问题'); ?> • <?php _e('%s 人关注', $val['focus_count']); ?> • <?php _e('%s 个回复', $val['answer_count']); ?> • <?php _e('%s 次浏览', $val['view_count']); ?> • <?php echo date_friendly($val['update_time']); ?>
</span>
<?php } else { ?>
<?php if ($val['anonymous'] == 0) { ?>
<a href="people/<?php echo $val['user_info']['url_token']; ?>" class="aw-user-name"><?php echo $val['user_info']['user_name']; ?></a><?php } else { ?><a href="javascript:;" class="aw-user-name" data-id="<?php echo $val['uid']; ?>"><?php _e('匿名用户'); ?></a><?php } ?>
<span class="aw-text-color-999"><?php _e('发起了问题'); ?> • <?php _e('%s 人关注', $val['focus_count']); ?> • <?php _e('%s 个回复', $val['answer_count']); ?> • <?php _e('%s 次浏览', $val['view_count']); ?> • <?php echo date_friendly($val['add_time']); ?>
</span>
<?php } ?>
<?php } else { ?>
<a href="people/<?php echo $val['user_info']['url_token']; ?>" class="aw-user-name"><?php echo $val['user_info']['user_name']; ?></a> <span class="aw-text-color-999"><?php _e('发表了文章'); ?> • <?php _e('%s 个评论', $val['comments']); ?> • <?php _e('%s 次浏览', $val['views']); ?> • <?php echo date_friendly($val['add_time']); ?></span>
<?php } ?>
</p>
</div>
</div>
<?php } ?>
<?php } ?>
阅读全文
收起全文