本文整理汇总了PHP中hg_verify函数的典型用法代码示例。如果您正苦于以下问题:PHP hg_verify函数的具体用法?PHP hg_verify怎么用?PHP hg_verify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hg_verify函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* 获取评论信息
*/
function show()
{
$this->input['count'] = $this->input['count'] ? $this->input['count'] : 10;
$this->input['offset'] = $this->input['offset'] ? $this->input['offset'] : 0;
$sql = 'select * from ' . DB_PREFIX . 'status_comments where 1 ' . $this->get_condition() . ' order by comment_time desc limit ' . $this->input['offset'] . ',' . $this->input['count'];
//hg_pre($sql);
$comment_all_data = $this->db->query($sql);
$member_ids = array();
$status_ids = array();
while ($result = $this->db->fetch_array($comment_all_data)) {
$result['comment_time'] = date('Y-m-d H:i', $result['comment_time']);
//审核状态
$result['state'] = $result['flag'];
$result['flag'] = $result['flag'] ? '通过' : '待审';
$member_ids[] = $result['member_id'];
$status_ids[] = $result['status_id'];
$result['content'] = hg_verify($result['content']);
$comments[] = $result;
}
//获取评论相对应的用户信息
$userinfo = $this->get_user_info($member_ids);
//hg_pre($status_ids);
//获取评论相对应的点滴信息
$statusinfo = $this->get_status_info($status_ids);
//评论 用户 点滴信息的合并
foreach ($comments as $k => $v) {
$v['user'] = $userinfo[$v['member_id']];
$v['status'] = $statusinfo[$v['status_id']];
$this->addItem($v);
$a[] = $v;
}
//hg_pre($a);
$this->output();
}
示例2: send_msg
public function send_msg()
{
$sid = $this->input['sid'];
$content = $this->input['content'];
//解析表情$text = hg_verify($value['text']);
$content = hg_verify($content);
$to_name = $this->input['to_name'];
$users = $this->mUser->getUserByName($to_name);
$pid = intval($this->input['pid']);
$id = array();
if ($users) {
foreach ($users as $key => $user) {
$id[$user['id']] = $user['id'];
}
array_filter($id);
$ids = implode(',', array_keys($id));
$msg = $this->mMessages->send_message($sid, $ids, $content, $pid);
//print_r($msg);
$msg = $msg[0];
echo json_encode($msg);
} else {
echo '您选择的用户不存在';
}
}
示例3: detail
/**
* 获取单条数据
*/
public function detail()
{
$this->input['id'] = urldecode($this->input['id']);
if (!$this->input['id']) {
$condition = ' ORDER BY id DESC LIMIT 1';
} else {
$condition = ' WHERE id in(' . $this->input['id'] . ')';
}
$sql = "SELECT * FROM " . DB_PREFIX . "comments " . $condition;
$r = $this->db->query_first($sql);
$uid = $r['user_id'] . ',' . $r['reply_user_id'];
$userinfo = $this->mVideo->getUserById($uid);
$this->setXmlNode('comment', 'info');
if (is_array($r) && $r) {
if ($this->settings['rewrite']) {
$r['user_link'] = SNS_UCENTER . "user-" . $r['user_id'] . ".html";
if ($r['reply_user_id']) {
$r['reply_user_link'] = SNS_UCENTER . "user-" . $r['reply_user_id'] . ".html";
}
$r['pagelink'] = SNS_VIDEO . "video-" . $r['cid'] . ".html";
} else {
$r['user_link'] = SNS_UCENTER . "user.php?user_id=" . $r['user_id'];
if ($r['reply_user_id']) {
$r['reply_user_link'] = SNS_UCENTER . "user.php?user_id=" . $r['reply_user_id'];
}
$r['pagelink'] = SNS_VIDEO . "video_play.php?id=" . $r['cid'];
}
$r['create_time'] = date('Y-m-d H:i:s', $r['create_time']);
$r['user'] = $userinfo[$r['user_id']];
$r['content'] = hg_verify($r['content']);
$r['reply_user'] = $userinfo[$r['reply_user_id']];
$this->addItem($r);
$this->output();
} else {
$this->errorOutput('评论不存在');
}
}
示例4: pub_to_group
public function pub_to_group($status_id = "", $group_ids = "")
{
$group_ids = $this->input['group_ids'] ? $this->input['group_ids'] : $group_ids;
$status_id = $this->input['status_id'] ? $this->input['status_id'] : $status_id;
$status_info = $this->status->show(intval($status_id));
$status_info = $status_info[0];
$ip = $status_info['ip'];
$content = hg_verify($status_info['text']);
if (!empty($status_info['medias'])) {
$mediaInfo = $status_info['medias'];
foreach ($status_info['medias'] as $key => $mediaInfo) {
$type = $mediaInfo['type'];
$content .= $media_str = $type > 0 ? strstr($mediaInfo['link'], '.swf') ? ' [flash]' . $mediaInfo['link'] . '[/flash] <br />' : ' [real]' . $mediaInfo['link'] . '[/real] <br />' : ' [img]' . $mediaInfo['larger'] . '[/img] <br />';
}
}
$spe_char = array('#', '@');
$spe_replace = array('', '');
$text = str_replace($spe_char, $spe_replace, $status_info['text']);
$title = mb_substr(hg_move_face($text), 0, 30, 'utf-8');
$groupids = explode(',', $group_ids);
$tmp = array();
foreach ($groupids as $key => $idd) {
if ($idd) {
$tmp[$idd] = $idd;
}
}
include_once ROOT_PATH . 'lib/class/groups.class.php';
$groups = new Group();
foreach ($tmp as $gid) {
$rr = $groups->add_new_thread($gid, $title, $content, $ip);
}
if (empty($rr)) {
//echo json_encode('false');
} else {
//echo json_encode('true');
}
}
示例5: hg_load_template
<p class="subject">
<?php
echo $text_show . "<br/>";
?>
</p>
<?php
include hg_load_template('statusline_content');
?>
<div class="speak">
<div class="hidden" id="t_<?php
echo $value['id'];
?>
"><?php
echo hg_verify($title);
?>
</div>
<div class="hidden" id="f_<?php
echo $value['id'];
?>
"><?php
echo $forward_show;
?>
</div>
<span id = "<?php
echo "fa" . $value['id'];
?>
" style="position:relative;">
<?php
if ($is_my_page) {
示例6: strlen
$len = strlen('#' . $keywords . '#');
if (substr(trim($value['text']), $len - 1, 1) == '#') {
$value['text'] = substr(trim($value['text']), $len);
}
$text = hg_verify($value['text']);
$text_show = ':' . ($value['text'] ? $value['text'] : $this->lang['forward_null']);
if ($value['reply_status_id']) {
$forward_show = '//@' . $value['user']['username'] . ' ' . $text_show;
$title = $this->lang['forward_one'] . $value['retweeted_status']['text'];
$status_id = $value['reply_user_id'];
} else {
$forward_show = '';
$title = $this->lang['forward_one'] . $value['text'];
$status_id = $value['member_id'];
}
$text_show = hg_match_red(hg_verify($text_show), $keywords);
$transmit_info = $value['retweeted_status'];
?>
<li>
<span class="zhibo_huifu"><a href="javascript:void(0);" onclick="disreplyStatus(<?php
echo $value['id'];
?>
, '<?php
echo $value['user']['username'];
?>
');return false;">回复</a></span>
<a href="<?php
echo $user_url;
?>
" class="zhibo_name" target="_blank"><?php
echo $value['user']['username'];
示例7: foreach
<ul class="mblog">
<?php
foreach ($statusline as $key => $value) {
$user_url = hg_build_link('user.php', array('user_id' => $value['member_id']));
$text = hg_verify($value['text']);
$text_show = $value['text'] ? $value['text'] : $this->lang['forward_null'];
if ($value['reply_status_id']) {
$forward_show = '//@' . $value['user']['username'] . ' ' . $text_show;
$title = $this->lang['forward_one'] . $value['retweeted_status']['text'];
$status_id = $value['reply_user_id'];
} else {
$forward_show = '';
$title = $this->lang['forward_one'] . $value['text'];
$status_id = $value['member_id'];
}
$text_show = hg_verify($text_show);
$transmit_info = $value['retweeted_status'];
?>
<li class="my-blog" id="mid_<?php
echo $value['id'];
?>
" onmouseover="report_show(<?php
echo $value['id'];
?>
,<?php
echo $value['user']['id'];
?>
);" onmouseout="report_hide(<?php
echo $value['id'];
?>
,<?php
示例8: hg_build_link
echo 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="<?php
echo hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $value['user']['id']));
?>
">{$value['user']['username']}</a>
<div style="display:none;" id="cons_{$value['id']}_{$value['user']['id']}"><?php
echo hg_show_face($value['content']);
?>
</div>
<div style="display:none;" id="ava_{$value['id']}_{$value['user']['id']}">{$value['user']['middle_avatar']}</div>
<div style="display:none;" id="user_{$value['id']}_{$value['user']['id']}">{$value['user']['username']}</div>
<div style="display:none;" id="cons_{$value['id']}_{$value['user']['id']}"><?php
echo hg_verify($value['content']);
?>
</div>
{if $_INPUT['id']}
{code}
$type = 5;/*视频*/
$url = SNS_VIDEO.'video_play.php?id='.$cid.'#c'.$value['id'];
{/code}
{/if}
{if $_INPUT['sta_id']}
{code}
$type = 11;/*频道*/
$url = SNS_VIDEO.'station_play.php?sta_id='.$cid.'#c'.$value['id'];
{/code}
{/if}
<div style="display:none;" id="url_{$value['id']}_{$value['user']['id']}">{$url}</div>
示例9: hg_verify
</div>
{/if}
{if $transmit_info['text']||!empty($transmit_info['medias'])}
<div class="comment clear">
<div class="top"></div>
<div class="middle clear">
<p class="subject"><?php
echo hg_verify("@" . $transmit_info['user']['username'] . ":" . $transmit_info['text']);
?>
<br/>
</p>
<!-- <p class="subject"><?php
echo hg_verify("@" . $transmit_info['user']['username'] . ":" . $transmit_info['text']) . "<br/>";
?>
</p >-->
{if is_array($transmit_info['medias'])}
<input id="rot_{code} echo $transmit_info['id'] + $value['id'];{/code}" type="hidden" value="0"/>
<div id="prev_{code} echo $transmit_info['id'] + $value['id'];{/code}" style="display:{code} echo $show = $is_details ? 'none' : 'inline-block'{/code}">
{foreach $transmit_info['medias'] as $mk => $mv}
{code}
$var = array(
"url" => "",
"imgname" => "",
"ori" => "",
"video_url" => "",
示例10: hg_build_link
">
<img class="pic" src="<?php
echo $value['user']['middle_avatar'];
?>
">
</a>
<div class="ping_list_right">
<p class="title_name"><a href="<?php
echo hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $value['user']['id']));
?>
"><?php
echo $value['user']['username'];
?>
</a><span>:<?php
echo hg_verify($value['text']);
?>
</span> <span class="ping_date">(<?php
echo hg_get_date($value['create_at']);
?>
)</span></p>
<p class="huifu"><span class="huifu_span" id="speak_<?php
echo $value['id'];
?>
_<?php
echo $tag;
?>
"><?php
if ($this->user['id']) {
?>
<a onclick="report_play(<?php
示例11: hg_build_link
</div>
<a href="<?php
echo hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $v['id']));
?>
"><img src="<?php
echo $v['middle_avatar'];
?>
" title="<?php
echo $v['username'];
?>
" /></a>
<div style="margin:5px;" >
<?php
echo hg_verify($v['text']);
?>
</div>
</li>
<?php
}
?>
</ul>
<div style="clear:both;"></div>
<?php
echo $showpages;
?>
</div>
<?php
示例12: del_comment
public function del_comment()
{
$cid = intval($this->input['cid']);
$result = $this->mComment->del_comment($cid);
foreach ($result as $key => $value) {
if ($key == "content") {
$value = hg_verify($value);
}
}
$result = json_encode($result);
print_r($result);
}
示例13: status
/**
获取微博
*/
public function status($condition, $orderby = 's.create_at DESC', $offset = 0, $count = 20)
{
$offset = intval($offset);
$count = intval($count);
$offset = $offset ? $offset : 0;
$count = $count ? $count : 20;
if (!$orderby) {
$orderby = 's.create_at DESC';
}
$sql = 'SELECT *, (transmit_count + reply_count) AS transmit_count FROM ' . DB_PREFIX . 'status s
LEFT JOIN ' . DB_PREFIX . 'status_extra se
ON s.id=se.status_id
WHERE 1 ' . $condition . '
ORDER BY ' . $orderby . '
LIMIT ' . $offset . ',' . $count;
$q = $this->db->query($sql);
$status_info = array();
$trans_status = array();
$member_ids = array();
$status_ids = array();
while ($r = $this->db->fetch_array($q)) {
$r['create_at'] = date('Y-m-d H:i:s', $r['create_at']);
if ($r['status'] == 0) {
$r['audit'] = 1;
$r['status_show'] = '通过';
} else {
$r['audit'] = 0;
$r['status_show'] = '不通过';
}
if ($this->settings['rewrite']) {
$r['status_link'] = SNS_MBLOG . "status-" . $r['id'] . ".html";
} else {
$r['status_link'] = SNS_MBLOG . 'show.php?id=' . $r['id'];
}
$r['text'] = hg_verify($r['text']);
$status_info[$r['id']] = $r;
$member_ids[] = $r['member_id'];
$status_ids[] = $r['id'];
if ($r['reply_status_id']) {
$status_ids[] = $r['reply_status_id'];
$trans_status[$r['id']] = $r['reply_status_id'];
$member_ids[] = $r['reply_user_id'];
}
}
//获取转发信息
if ($trans_status) {
$sql = 'SELECT * FROM ' . DB_PREFIX . 'status s
LEFT JOIN ' . DB_PREFIX . 'status_extra se
ON s.id=se.status_id
WHERE id IN ( ' . implode(',', $trans_status) . ' )';
$q = $this->db->query($sql);
$trans_status = array();
while ($r = $this->db->fetch_array($q)) {
$r['create_at'] = date('Y-m-d H:i:s', $r['create_at']);
if ($this->settings['rewrite']) {
$r['status_link'] = SNS_MBLOG . "status-" . $r['id'] . ".html";
} else {
$r['status_link'] = SNS_MBLOG . 'show.php?id=' . $r['id'];
}
$r['text'] = hg_verify($r['text']);
if ($r['status'] == 0) {
$r['audit'] = 1;
$r['status_show'] = '通过';
} else {
$r['audit'] = 0;
$r['status_show'] = '不通过';
}
$trans_status[$r['id']] = $r;
}
}
//获取媒体信息
if ($status_ids) {
$condition = ' AND status_id IN (' . implode(',', $status_ids) . ')';
$medias = $this->media->media($condition);
}
//获取用户信息
if ($member_ids) {
$userinfo = $this->mUser->getUserById(implode(',', array_unique($member_ids)));
$members = array();
if ($userinfo) {
foreach ($userinfo as $user) {
$members[$user['id']] = $user;
}
}
}
//合并微博信息
if ($status_info) {
foreach ($status_info as $k => $v) {
$status_info[$k]['user'] = $members[$v['member_id']];
//合并用户
if ($v['reply_status_id']) {
if ($trans_status[$v['reply_status_id']]) {
$trans = $trans_status[$v['reply_status_id']];
} else {
$trans = array('id' => 0, 'text' => '该信息已删除');
}
$trans['user'] = $members[$v['reply_user_id']];
//.........这里部分代码省略.........
示例14: hg_verify
);"><?php
echo $this->lang['report'];
?>
</a></strong><?php
}
?>
<div style="display:none;" id="cons_<?php
echo $statusline['id'];
?>
_<?php
echo $statusline['user']['id'];
?>
">
<?php
echo hg_verify($statusline['text']);
?>
<?php
include hg_load_template("statusline_content");
?>
</div>
<div style="display:none;" id="ava_<?php
echo $statusline['id'];
?>
_<?php
echo $statusline['user']['id'];
?>
"><?php
echo $statusline['user']['small_avatar'];
?>
</div>
示例15: show
public function show()
{
$channel_id = $this->input['channel_id'];
if (!$channel_id) {
$this->errorOutput('未传入频道ID');
}
//$cond = ' AND status=1';
$sql = "select * from " . DB_PREFIX . "channel where id=" . $channel_id . $cond;
$channel_info = $this->db->query_first($sql);
if (!$channel_info) {
$this->errorOutput('指定频道不存在或被关闭');
}
$source = array('0' => '网站', '1' => 'Iphone客户端', '2' => 'android客户端');
$sql = "SELECT * FROM " . DB_PREFIX . "topic WHERE " . TIMENOW . " > start_time AND " . TIMENOW . " < end_time AND channel_id=" . $channel_id;
$f = $this->db->query_first($sql);
if (!empty($f)) {
$channel_topic = $f['name'];
} else {
$sql = "SELECT id,theme,start_time FROM " . DB_PREFIX . 'program WHERE channel_id =' . $channel_id . ' ';
$sql .= ' AND start_time + toff >= ' . TIMENOW . ' ORDER BY start_time ASC LIMIT 1';
$program = $this->db->query_first($sql);
$channel_topic = $program['theme'] ? $program['theme'] : $channel_info['name'];
}
$comments = array();
$return = array();
$return['show_topic'] = '关于#' . $channel_topic . '#的讨论';
$return['channel_topic'] = $channel_topic;
$count = intval($this->input['count']);
$count = $count ? $count : 20;
$page = intval($this->input['offset']) / $count;
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->initPostData();
$this->curl->addRequestData('q', $channel_topic);
$this->curl->addRequestData('page', $page);
$this->curl->addRequestData('order_type', 0);
$this->curl->addRequestData('newest_id', 0);
$this->curl->addRequestData('count', $count);
$comments = $this->curl->request('search.php');
$deal_comments = array();
unset($comments[0]);
$len = strlen('#' . $channel_topic . '#');
if ($comments) {
foreach ($comments as $value) {
if (substr(trim($value['text']), $len - 1, 1) == '#') {
$value['text'] = substr(trim($value['text']), $len);
}
$text = hg_verify($value['text']);
$text_show = ':' . ($value['text'] ? $value['text'] : $this->lang['forward_null']);
if ($value['reply_status_id']) {
$forward_show = '//@' . $value['user']['username'] . ' ' . $text_show;
$title = $this->lang['forward_one'] . $value['retweeted_status']['text'];
} else {
$forward_show = '';
$title = $this->lang['forward_one'] . $value['text'];
}
if ($value['source']) {
$value['source_text'] = '通过' . $source[$value['source']];
} else {
$value['source_text'] = '';
}
$comment = array('id' => $value['id'], 'content' => $title, 'source' => $value['source'], 'author' => $value['user']['username'], 'pubdate' => date('m月d日 H:i', $value['create_at']), 'source_text' => '通过' . $value['source']);
$deal_comments[] = $comment;
}
}
$return['comments'] = $deal_comments;
$this->addItem($return);
$this->output();
}