Exemplo n.º 1
0
            $display = 'block';
        }
        $i++;
        ?>
									<li class="cf" style="opacity: 1; display: <?php 
        echo $display;
        ?>
;">
										<div class="content_conmment">
											<div class="content_asit_img"><a href="###"><img src="<?php 
        echo $comment_list['user_list'][$tmp['uid']]['avatar'];
        ?>
" /></a></div>
											<div class="content_custom">
												<div class="content_time"><a href="###"><?php 
        echo anonymous($comment_list['user_list'][$tmp['uid']]['nickname']);
        ?>
</a></div>
												<p><?php 
        echo date('Y-m-d H:i:s', $tmp['dateline']);
        ?>
</p>
											</div>
											<div class="content_comment_txt"><?php 
        echo htmlspecialchars($tmp['content']);
        ?>
</div>
										</div>
									</li>
								<?php 
    }
Exemplo n.º 2
0
.attachment_detail {width:100px; height:100px; border:1px solid gray; float:left; margin-right:10px;}
.attachment_detail img {cursor:pointer;}
</style>
<div class="appraise_li-list">
	<dl>
		<?php 
foreach ($comment_list as $comment) {
    ?>
			<dd>
				<div class="appraise_li-list_img">
					<div class="appraise_li-list_icon"><img src="<?php 
    echo $user_list[$comment['uid']]['avatar'];
    ?>
" /></div>
					<p><?php 
    echo anonymous(htmlspecialchars($user_list[$comment['uid']]['nickname']));
    ?>
</p>
				</div>
				<div class="appraise_li-list_right" >
					<div class="appraise_li-list_top">
						<div class="appraise_li-list_top_icon <?php 
    echo $comment['score'] >= 4 ? 'manyi' : ($comment['score'] == 3 ? 'yiban' : 'bumanyi');
    ?>
">
							<span><?php 
    echo $comment['score'] >= 4 ? '满意' : ($comment['score'] == 3 ? '一般' : '不满意');
    ?>
</span>
						</div>
						<?php 
Exemplo n.º 3
0
function get_pinlun_list($product_id)
{
    require_once dirname(__FILE__) . '/global.php';
    $page = $_GET['page'] + 0;
    $id = $_GET['id'];
    $type = $_GET['type'];
    $tab = $_GET['tab'];
    $has_image = $_GET['has_image'];
    if (empty($id)) {
        echo json_encode(array('status' => false, 'msg' => '参数错误'));
        exit;
    }
    $type_arr = array('PRODUCT', 'STORE');
    if (!in_array($type, $type_arr)) {
        echo json_encode(array('status' => false, 'msg' => '参数错误'));
        exit;
    }
    $where = array();
    $where['type'] = $type;
    if (!empty($has_image)) {
        $where['has_image'] = 1;
    }
    $where['relation_id'] = $id;
    $where['status'] = 1;
    $where['delete_flg'] = 0;
    switch ($tab) {
        case 'HAO':
            $where['score'] = array('>=', 4);
            break;
        case 'ZHONG':
            $where['score'] = 3;
            break;
        case 'CHA':
            $where['score'] = array('<=', 2);
            break;
        default:
            break;
    }
    $comment_model = M('Comment');
    $count = $comment_model->getCount($where);
    $comment_list = array();
    $pages = '';
    $limit = 10;
    $total_page = ceil($count / $limit);
    if ($count > 0) {
        $page = min($page, ceil($count / $limit));
        $offset = ($page - 1) * $limit;
        $comment_list = $comment_model->getList($where, 'id desc', $limit, $offset, true);
    }
    $user_list = array();
    if ($comment_list['user_list']) {
        foreach ($comment_list['user_list'] as $key => $user) {
            $tmp = array();
            $tmp['nickname'] = anonymous($user['nickname']);
            $tmp['avatar'] = $user['avatar'];
            $user_list[$key] = $tmp;
        }
    }
    $list = array();
    if ($comment_list['comment_list']) {
        foreach ($comment_list['comment_list'] as $tmp) {
            $tmp['content'] = htmlspecialchars($tmp['content']);
            $list[] = $tmp;
        }
    }
    $json_return['list'] = $list;
    //$json_return['tag_list'] = $comment_list['comment_tag_list'];
    $json_return['userlist'] = $user_list;
    $json_return['count'] = $count;
    $json_return['maxpage'] = ceil($count / $limit);
    $json_return['noNextPage'] = false;
    if (count($json_return['list']) < $limit || $total_page <= $page) {
        $json_return['noNextPage'] = true;
    }
    json_return(0, $json_return);
}