Esempio n. 1
0
?>
">{$v['user']['username']}</a>
							<div class="bar-right">
								<span><?php 
echo hg_get_date($v['create_time']);
?>
</span>
								{if $state != 2}
								<a href="javascript:void(0);" onclick="del_comment({$v['id']},{$v['cid']},{$type});">删除</a>
								{else}
								<a href="javascript:void(0);" onclick="recover_comment({$v['id']},{$v['cid']},{$type});">恢复</a>
								{/if}
							</div>
						</div>
						<div class="comment-con"><?php 
echo hg_show_face($value['content']);
?>
</div>
					</li>
				{/foreach}
				</ul>
				{/if}
				</li>
				{/foreach}
				
			</ul>
			{else}
			{code}
				$null_title = "I’m Sorry";
				$null_text = "暂无评论";
				$null_url = $_SERVER['HTTP_REFERER'];
Esempio n. 2
0
 /**
  * 获取单条评论信息
  */
 public function detail()
 {
     $id = urldecode($this->input['id']);
     $condition = $this->get_condition();
     if (!$id) {
         $condition .= ' LIMIT 1';
     } else {
         $extra = " AND p.post_id=" . $id;
     }
     $sql = "SELECT group_id,name FROM " . DB_PREFIX . "group ";
     $q = $this->db->query($sql);
     while ($r = $this->db->fetch_array($q)) {
         $group[$r['group_id']] = $r['name'];
     }
     $sql = "SELECT p.post_id,p.pagetext,p.user_id,p.user_name,p.pub_time,p.poll_id,p.state,t.thread_id,t.title,t.group_id,t.user_id as tuid,t.user_name as tname FROM " . DB_PREFIX . "post p \r\n\t\t\t\t\tLEFT JOIN " . DB_PREFIX . "thread t ON t.thread_id = p.thread_id \r\n\t\t\t\t\tWHERE p.post_id <> t.first_post_id " . $extra;
     $sql = $sql . $condition . $data_limit;
     $q = $this->db->query($sql);
     $poll_id = $space = '';
     while ($row = $this->db->fetch_array($q)) {
         $row['pub_time'] = date('Y-m-d H:i:s', $row['pub_time']);
         $row['group_name'] = $group[$row['group_id']];
         $row['audit'] = $row['state'];
         $row['state_tags'] = $this->settings['state'][$row['state']];
         if ($row['poll_id']) {
             $poll[$row['post_id']] = array('user_name' => $row['user_name'], 'poll_id' => $row['poll_id'], 'pagetext' => unserialize($row['pagetext']));
             $poll_id .= $space . $row['poll_id'];
             $space = ',';
         }
         $info[] = $row;
     }
     if (is_array($poll) && $poll_id) {
         $sql = "select poll_id,title,pollresult,user_id,user_name from " . DB_PREFIX . "poll where poll_id IN(" . $poll_id . ")";
         $q = $this->db->query($sql);
         while ($row = $this->db->fetch_array($q)) {
             $row['pollresult'] = unserialize($row['pollresult']);
             $all_poll[$row['poll_id']] = $row;
         }
         foreach ($poll as $key => $value) {
             $poll[$key]['poll'] = $value['user_name'] . "参与了《" . $all_poll[$value['poll_id']]['title'] . "》的投票 ,结果为:";
             if (is_array($value['pagetext'])) {
                 $result = $space = '';
                 foreach ($value['pagetext'] as $k => $v) {
                     if (is_int($k)) {
                         $result .= $space . $all_poll[$value['poll_id']]['pollresult'][$v]['poll_opt'];
                         $space = ",";
                     }
                 }
             }
             $poll[$key]['poll'] .= $result;
         }
     }
     $this->setXmlNode('comment', 'info');
     if (is_array($info)) {
         foreach ($info as $key => $value) {
             if ($this->settings['rewrite']) {
                 $value['user_link'] = SNS_UCENTER . "user-" . $value['user_id'] . ".html";
                 $value['pub_user_link'] = SNS_UCENTER . "user-" . $value['tuid'] . ".html";
                 $value['pagelink'] = SNS_TOPIC . "thread-" . $value['thread_id'] . ".html#" . $value['post_id'];
                 $value['group_link'] = SNS_TOPIC . "group-" . $value['group_id'] . ".html";
             } else {
                 $value['user_link'] = SNS_UCENTER . "user.php?user_id=" . $value['user_id'];
                 $value['pub_user_link'] = SNS_UCENTER . "user.php?user_id=" . $value['tuid'];
                 $value['pagelink'] = SNS_TOPIC . "?m=thread&thread_id=" . $value['thread_id'] . "&a=detail&group_id=" . $value['group_id'] . "#" . $value['post_id'];
                 $value['group_link'] = SNS_TOPIC . "?m=thread&group_id=" . $value['group_id'];
             }
             if ($value['poll_id']) {
                 $value['poll'] = $poll[$value['post_id']]['poll'];
             } else {
                 $value['poll'] = hg_show_face($value['pagetext']);
             }
             $this->addItem($value);
         }
     }
     $this->output();
 }
Esempio n. 3
0
 /**
  * 获取单条评论信息
  */
 public function detail()
 {
     $id = urldecode($this->input['id']);
     $condition = $this->get_condition();
     if (!$id) {
         $condition .= ' LIMIT 1';
     } else {
         $extra = "AND c.comment_id=" . $id;
     }
     $sql = "SELECT group_id,name FROM " . DB_PREFIX . "group ";
     $q = $this->db->query($sql);
     while ($r = $this->db->fetch_array($q)) {
         $group[$r['group_id']] = $r['name'];
     }
     $sql = "SELECT c.comment_id,c.user_id,c.user_name,c.content,c.pub_time,c.state,c.poll_id,a.albums_id,a.user_id as auid,a.user_name as aname,a.albums_name\r\n\t\t\t\tFROM " . DB_PREFIX . "comment c \r\n\t\t\t\t\tLEFT JOIN " . DB_PREFIX . "albums a ON a.albums_id = c.albums_id \r\n\t\t\t\t\tWHERE a.albums_id <> '' " . $extra;
     $sql = $sql . $condition;
     $q = $this->db->query($sql);
     $this->setXmlNode('comment', 'info');
     while ($row = $this->db->fetch_array($q)) {
         if ($this->settings['rewrite']) {
             $row['user_link'] = SNS_UCENTER . "user-" . $row['user_id'] . ".html";
             $row['pub_user_link'] = SNS_UCENTER . "user-" . $row['auid'] . ".html";
             $row['pagelink'] = SNS_ALBUMS . "albums-show-" . $row['albums_id'] . ".html";
         } else {
             $row['user_link'] = SNS_UCENTER . "user.php?user_id=" . $row['user_id'];
             $row['pub_user_link'] = SNS_UCENTER . "user.php?user_id=" . $row['auid'];
             $row['pagelink'] = SNS_ALBUMS . "?m=albums&albums_id=" . $row['albums_id'] . "&a=albums_view";
         }
         $row['pub_time'] = date('Y-m-d H:i:s', $row['pub_time']);
         $row['group_name'] = $group[$row['group_id']];
         $row['audit'] = $row['state'];
         $row['state_tags'] = $this->settings['state'][$row['state']];
         $row['content'] = hg_show_face($row['content']);
         $this->addItem($row);
     }
     //	hg_pre($info);
     $this->output();
 }
Esempio n. 4
0
);"><span class="txt">最近点滴:</span>
        <?php 
$url = hg_build_link(SNS_MBLOG . 'show.php', array('id' => $last_status['id']));
$status = $last_status['text'] ? hg_cutchars(strip_tags($last_status['text']), 40, " ") : "暂无";
if (!$last_status['text']) {
    echo hg_show_face($status);
} else {
    ?>
        	<a href="<?php 
    echo $url;
    ?>
" title="<?php 
    echo hg_show_face(strip_tags($last_status['text']));
    ?>
"><?php 
    echo hg_show_face($status);
    ?>
</a>
        <?php 
}
echo hg_get_date($last_status['create_at']);
?>
		<?php 
if ($this->user['id']) {
    ?>
<a onclick="report_play(<?php 
    echo $user_info['id'];
    ?>
,<?php 
    echo $user_info['id'];
    ?>
Esempio n. 5
0
	{/code}
{/if}
			<div style="display:none;" id="url_{$v['id']}_{$v['user']['id']}">{$url}</div>
			<div style="display:none;" id="type_{$v['id']}_{$v['user']['id']}">{$type}</div>					
					<div class="bar-right">
						<span><?php 
echo hg_get_date($v['create_time']);
?>
</span>
						{if $_user['id']&&$_settings['report']}<a onclick="report_play({$v['id']},{$v['user']['id']});" href="javascript:void(0);" style="display:none;" id="re_{$v['id']}_{$v['user']['id']}">{$_lang['report']}</a>{/if}
						<a href="javascript:void(0);" onclick="reply_comment({$value['cid']},{$value['id']},{$value['user']['id']});">回复</a>
						{if $v['relation']}
							<a href="javascript:void(0);" onclick="del_comment({$v['id']},{$v['cid']},{$type});">删除</a>
						{/if}
					</div>
				</div>
				<div class="comment-con"><?php 
echo hg_show_face($v['content']);
?>
</div>
			</li>
		{/foreach}
		</ul>
		{/if}
	</li>
{/if}
{/foreach}
</ul>
{/if}
{$showpages}
</div>
Esempio n. 6
0
            ?>
</a>&nbsp;<?php 
        }
        ?>
</span>
			<span class="ping_date">回复了我的<?php 
        echo $eend;
        ?>
:<a href="<?php 
        echo hg_build_link('show.php', array('id' => $value['status']['id']));
        ?>
" ><?php 
        if ($flag) {
            echo hg_show_face($value['status']['text']);
        } else {
            echo hg_show_face($value['reply_comment_text']);
        }
        ?>
</a></span>
			<input type="hidden" name="commids" value="<?php 
        echo $value['id'];
        ?>
" id="commids_<?php 
        echo $value['id'];
        ?>
_<?php 
        echo $tag;
        ?>
" /> 
			<input type="hidden" id="rp_<?php 
        echo $value['id'] . '_' . $tag;
Esempio n. 7
0
        ?>
<a href="<?php 
        echo hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $value['status']['user']['id']));
        ?>
"><?php 
        echo $value['status']['user']['username'];
        ?>
</a><?php 
        echo $eend;
        ?>
:<a href="<?php 
        echo hg_build_link('show.php', array('id' => $value['status']['id']));
        ?>
" >
						<?php 
        echo $text = $flag == 1 ? hg_show_face($value['status']['text']) : hg_show_face($value['reply_comment_text']);
        ?>
						</a></span>
					</p>  
				</div>
				<br class="clear" />
			</li>
		 <?php 
    }
    ?>
		</ul>
		<p class="ping_quan pingbg">
		 <input type="checkbox" name="sel_all" value=0 class="checks" onClick="select_all(this,<?php 
    echo $tag;
    ?>
);" id="_bot_" />&nbsp;<label for="_bot_" style="cursor:pointer;"><?php 
Esempio n. 8
0
    /**
     * 评论分页ajax
     * @param $pp 评论ID
     * @param $cid 评论对象ID
     * @param $user_id 评论对象的user_id
     * @param $type (0视频、1网台、2用户)
     * @param $count 每页显示条数
     * @return $ret 评论信息
     */
    function comment_list()
    {
        $state = 1;
        //评论状态,0-待审核,1-已审核通过
        $cid = $this->input['cid'] ? $this->input['cid'] : 0;
        $user_id = $this->input['user_id'] ? $this->input['user_id'] : 0;
        $type = $this->input['type'] ? $this->input['type'] : 0;
        $count = $this->input['count'] ? $this->input['count'] : 0;
        $page = intval($this->input['pp']) / $count;
        $html = "";
        if ($cid && $user_id && count) {
            $comment_list = $this->mVideo->get_comment_list($user_id, $cid, $type, $state, $page, $count);
            if (is_array($comment_list)) {
                $total_nums = $comment_list['total'];
                unset($comment_list['total']);
                $data['totalpages'] = $total_nums;
                $data['perpage'] = $count;
                $data['curpage'] = $this->input['pp'];
                $data['onclick'] = ' onclick="comment_page(this,' . $cid . ',' . $user_id . ',' . $type . ',' . $count . ');"';
                $data['pagelink'] = $this->input['user_id'] ? hg_build_link('', array('user_id' => $this->input['user_id'])) : "";
                $showpages = hg_build_pagelinks($data);
                $html = '<ul class="comment_list" id="comment_list">';
                $li = "";
                foreach ($comment_list as $key => $value) {
                    if (!$value['reply_id']) {
                        $li .= '<li id="com_' . $value['id'] . '" class="clear">
						<div class="comment-img"><a target="_blank" href="' . hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $value['user']['id'])) . '"><img src="' . $value['user']['middle_avatar'] . '"/></a></div>
						<div class="comment-bar">
						<a class="bar-left" target="_blank" href="' . hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $value['user']['id'])) . '">' . $value['user']['username'] . '</a>
							<div class="bar-right">
								<span>' . hg_get_date($value['create_time']) . '</span>
									<a href="javascript:void(0);" onclick="reply_comment(' . $value['cid'] . ',' . $value['id'] . ',' . $value['user']['id'] . ');">回复</a>';
                        if ($value['relation']) {
                            $li .= '<a href="javascript:void(0);" onclick="del_comment(' . $value['id'] . ',' . $value['cid'] . ',' . $type . ');">删除</a>';
                        }
                        $li .= '</div></div><div class="comment-con">' . hg_show_face($value['content']) . '</div>';
                        if (is_array($value['reply'])) {
                            $li .= '<ul class="reply_list" id="rep_' . $value['id'] . '">';
                            $uli = '';
                            foreach ($value['reply'] as $k => $v) {
                                $uli .= '<li id="com_' . $v['id'] . '" class="clear">
									<div class="comment-img"><a target="_blank" href="' . hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $v['user']['id'])) . '"><img src="' . $v['user']['middle_avatar'] . '"/></a></div>
									<div class="comment-bar">
										<a class="bar-left" target="_blank" href="' . hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $v['user']['id'])) . '">' . $v['user']['username'] . '</a>
										<div class="bar-right">
											<span>' . hg_get_date($v['create_time']) . '</span>
											<a href="javascript:void(0);" onclick="reply_comment(' . $value['cid'] . ',' . $value['id'] . ',' . $value['user']['id'] . ');">回复</a>';
                                if ($v['relation']) {
                                    $uli .= '<a href="javascript:void(0);" onclick="del_comment(' . $v['id'] . ',' . $v['cid'] . ',' . $type . ');">删除</a>';
                                }
                                $uli .= '</div></div><div class="comment-con">' . hg_show_face($value['content']) . '</div></li>';
                            }
                            $li .= $uli . '</ul>';
                        }
                        $li .= '</li>';
                    }
                }
                $html .= $li . '</ul>' . $showpages;
            }
        }
        ob_end_clean();
        echo $html;
        exit;
    }