本文整理汇总了PHP中hg_material_link函数的典型用法代码示例。如果您正苦于以下问题:PHP hg_material_link函数的具体用法?PHP hg_material_link怎么用?PHP hg_material_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hg_material_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: message_info
function message_info($condition = '', $orderby = ' i.id DESC ', $offset = 0, $count = 20)
{
$limit = " limit {$offset}, {$count}";
$sql = 'SELECT i.*,f.id as fid,f.file_name,f.file_path
FROM ' . DB_PREFIX . 'interview i
LEFT JOIN ' . DB_PREFIX . 'files f ON i.cover_pic = f.id
WHERE i.isclose=0 ' . $condition . $orderby . $limit;
$res = $this->db->query($sql);
$k = array();
while (!false == ($r = $this->db->fetch_array($res))) {
$arr['id'] = $r['id'];
$arr['title'] = $r['title'];
$arr['start_time'] = $r['start_time'];
$arr['end_time'] = $r['end_time'];
//$a = unserialize($r['moderator']);
//$r['moderator'] = $a[key($a)];
$r['moderator'] = unserialize($r['moderator']);
$arr['moderator'] = empty($r['moderator']) ? $r['moderator'] : '';
$b = unserialize($r['honor_guests']);
$arr['honor_guests'] = empty($b) ? '' : $b;
$arr['object_type'] = $this->settings['object_type'][$r['object_type']];
$arr['description'] = $r['description'];
$arr['is_pre_ask'] = $r['is_pre_ask'];
$arr['need_login'] = $r['nedd_login'];
$arr['cover_pic'] = $r['file_path'] && $r['file_name'] ? hg_material_link(IMG_URL, app_to_dir(APP_UNIQUEID), $r['file_path'], $r['file_name']) : '';
$k[] = $arr;
}
return $k;
}
开发者ID:h3len,项目名称:Project,代码行数:29,代码来源:infor.class.php
示例2: show
function show()
{
$channel_id = intval($this->input['channel_id']);
if (!$channel_id) {
$this->errorOutput('未传入频道id');
}
$sql = "SELECT id, start_time, toff, theme FROM " . DB_PREFIX . "program ";
$sql .= " WHERE channel_id = " . $channel_id . " AND start_time>=" . TIMENOW;
$sql .= " ORDER BY start_time ASC LIMIT 1";
$program_info = $this->db->query_first($sql);
$sql = "SELECT name, logo_info, stream_id FROM " . DB_PREFIX . "channel ";
$sql .= " WHERE id = " . $channel_id;
$channel_info = $this->db->query_first($sql);
$logo_url = '';
if ($channel_info['logo_info']) {
$logo_info = @unserialize($channel_info['logo_info']);
$logo_url = hg_material_link($logo_info['host'], $logo_info['dir'], $logo_info['filepath'], $logo_info['filename']);
}
header('Content-Type: text/xml; charset=UTF-8');
$dom = new DOMDocument('1.0', 'utf-8');
$channel = $dom->createElement('channel');
$channel->setAttribute('name', $channel_info['name']);
$channel->setAttribute('url', $logo_url);
$channel->setAttribute('current', $channel_info['stream_id']);
$logos = $dom->createElement('logos');
$item = $dom->createElement('item');
$item->setAttribute('url', $channel_info['logo']);
$logos->appendChild($item);
$channel->appendChild($logos);
$dom->appendChild($channel);
echo $dom->saveXml();
}
开发者ID:h3len,项目名称:Project,代码行数:32,代码来源:channel_xml.php
示例3: show
function show()
{
//权限判断
$this->verify_content_prms(array('_action' => 'manage_maga'));
$offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
$count = $this->input['count'] ? intval(urldecode($this->input['count'])) : 10;
$orderby = ' ORDER BY m.order_id DESC';
$condition = $this->get_condition();
if ($this->input['show_last_issue']) {
$condition .= ' AND m.issue_id > 0 ';
}
$res = $this->maga->show($condition, $orderby, $offset, $count);
if (!$this->input['show_last_issue']) {
foreach ($res as $k => $r) {
$r['url'] = hg_material_link($r['host'], $r['dir'], $r['file_path'], $r['file_name'], $size);
$this->addItem($r);
}
} else {
foreach ($res as $k => $v) {
$v['url'] = hg_material_link($v['host'], $v['dir'], $v['file_path'], $v['file_name'], $size);
$v['release_cycle'] = $this->settings['release_cycle'][$v['release_cycle']];
$arr[] = $v;
}
$this->addItem($arr);
}
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:27,代码来源:magazine.php
示例4: make_url
public function make_url($info, $size = '40x30/')
{
if ($info) {
$url = '';
$url = unserialize($info);
$url = hg_material_link($url['host'], $url['dir'], $url['filepath'], $url['filename'], $size);
}
return $url;
}
开发者ID:h3len,项目名称:Project,代码行数:9,代码来源:venue.class.php
示例5: memberAvatarDetail
/**
* 会员头像
* Enter description here ...
*/
public function memberAvatarDetail($member_id, $width, $height)
{
$condition = ' WHERE member_id IN (' . urldecode($this->input['member_id']) . ')';
$sql = "SELECT * FROM " . DB_PREFIX . "member_avatar " . $condition;
$row = $this->db->query_first($sql);
if (is_array($row) && $row) {
//40*40
$row['avatar_small'] = hg_material_link($row['host'], $row['dir'], $row['filepath'], $row['filename'], $width . 'x' . $height . '/');
$row['create_time'] = date('Y-m-d H:i:s', $row['create_time']);
return $row;
}
return false;
}
开发者ID:h3len,项目名称:Project,代码行数:17,代码来源:member_avatar.class.php
示例6: show
public function show()
{
$channel_id = intval($this->input['channel_id']);
$dates = $this->input['dates'] ? urldecode($this->input['dates']) : date('Y-m-d', TIMENOW);
$appid = intval($this->input['appid']);
if (!$channel_id) {
$this->errorOutput('NO_CHANNEL_ID');
}
//频道信息
$channel_info = $this->mChannel->get_channel_by_id($channel_id);
if (empty($channel_info)) {
$this->errorOutput('NO_CHANNEL_INFO');
}
if ($channel_info['client_logo'][$appid]) {
unset($channel_info['client_logo'][$appid]['appid'], $channel_info['client_logo'][$appid]['appname']);
$channel_info['logo_rectangle'] = $channel_info['client_logo'][$appid];
}
unset($channel_info['client_logo']);
if ($channel_info['logo_rectangle']) {
$channel_info['logo_url'] = hg_material_link($channel_info['logo_rectangle']['host'], $channel_info['logo_rectangle']['dir'], $channel_info['logo_rectangle']['filepath'], $channel_info['logo_rectangle']['filename'], '113x43/');
}
// unset($channel_info['logo_rectangle']);
$this->addItem_withkey('channel_info', $channel_info);
$this->addItem_withkey('dates', $dates);
//节目屏蔽
$condition = $this->get_condition();
$orderby = " ORDER BY start_time ASC ";
$ret_shield = $this->mProgramShield->show($channel_id, $dates, $condition, $orderby);
$start = strtotime($dates . ' ' . '00:00:00');
$end = strtotime($dates . ' ' . '23:59:59');
$tmp_time = 0;
$shield = array();
if (!empty($ret_shield)) {
foreach ($ret_shield as $v) {
if (!$tmp_time && $v['start_time'] > $start) {
$shield[] = $this->get_blank_time($start, $v['start_time'], $dates);
}
if ($tmp_time && $tmp_time != $v['start_time']) {
$shield[] = $this->get_blank_time($tmp_time, $v['start_time'], $dates);
}
$tmp_time = $v['start_time'] + $v['toff'];
$shield[] = $v;
}
}
$this->addItem($shield);
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:47,代码来源:program_shield.php
示例7: show
public function show()
{
$condition = $this->get_condition();
$offset = $this->input['offset'] ? $this->input['offset'] : 0;
$count = $this->input['count'] ? intval($this->input['count']) : 20;
$width = $this->settings['avatar_size']['width'];
$height = $this->settings['avatar_size']['height'];
$members = $this->mMember->show($condition, $offset, $count);
$this->setXmlNode('member', 'info');
if (!empty($members)) {
foreach ($members as $member) {
// hg_pre($member);
if ($member['filename']) {
$member['avatar_url'] = hg_material_link($member['host'], $member['dir'], $member['filepath'], $member['filename'], $width . 'x' . $height . '/');
}
$this->addItem($member);
}
}
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:20,代码来源:member.php
示例8: show
public function show()
{
$interviewid = $this->input['interview_id'];
if (empty($interviewid)) {
//$this->errorOutput('无效参数');
}
//首页图片
$res = $this->db->query_first('SELECT cover_pic FROM ' . DB_PREFIX . 'interview where id=' . $interviewid);
$cover_pic = $res['cover_pic'];
$offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
$count = $this->input['count'] ? intval(urldecode($this->input['count'])) : 10;
$limit = " limit {$offset}, {$count}";
$orderby = ' ORDER BY order_id DESC';
$condition = $this->get_condition();
$sql = 'SELECT * FROM ' . DB_PREFIX . 'files WHERE interview_id=' . $interviewid . $condition . $orderby . $limit;
$q = $this->db->query($sql);
while ($r = $this->db->fetch_array($q)) {
$r['interview_id'] = $interviewid;
$r['cover_pic'] = $cover_pic;
$r['create_time'] = date('Y-m-d H:i:s', $r['create_time']);
$r['file_size'] = round($r['file_size'] / 1024 / 8, 2) . ' KB';
switch ($r['show_pos']) {
case 0:
$r['show_pos'] = '头部';
break;
case 1:
$r['show_pos'] = '背景';
break;
case 2:
$r['show_pos'] = '其它';
break;
}
$r['ori_pic'] = hg_material_link(IMG_URL, app_to_dir(APP_UNIQUEID), $r['file_path'], $r['file_name']);
//$r['ori_pic'] = $this->obj->pic_path($r['server_mark'], $r['file_path'], $r['file_name'], '');
//$r['pic'] = $this->obj->pic_path($r['server_mark'], $r['file_path'], $r['file_name'], '50x50');
$r['pic'] = hg_material_link(IMG_URL, app_to_dir(APP_UNIQUEID), $r['file_path'], $r['file_name'], '40x30/');
$this->addItem($r);
}
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:40,代码来源:interview_pic.php
示例9: show
public function show()
{
//检测是否具有配置权限
if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
if (!$this->user['prms']['app_prms'][APP_UNIQUEID]['setting']) {
//$this->errorOutput(NO_PRIVILEGE);
}
}
$condition = $this->get_condition();
$offset = intval($this->input['offset']);
$count = intval($this->input['count']);
$mobileModuleList = $this->mMobileModule->show($condition, $offset, $count);
if ($mobileModuleList) {
foreach ($mobileModuleList as $mobileModule) {
if ($mobileModule['icon1']) {
$mobileModule['icon1'] = hg_material_link($mobileModule['icon1']['host'], $mobileModule['icon1']['dir'], $mobileModule['icon1']['filepath'], $mobileModule['icon1']['filename']);
} else {
if ($mobileModule['filename']) {
$mobileModule['icon1'] = hg_material_link($mobileModule['host'], $mobileModule['dir'], $mobileModule['filepath'], $mobileModule['filename']);
}
}
/*if ($mobileModule['icon2'])
{
$mobileModule['icon2'] = hg_material_link($mobileModule['icon2']['host'], $mobileModule['icon2']['dir'], $mobileModule['icon2']['filepath'], $mobileModule['icon2']['filename']);
}
if ($mobileModule['icon3'])
{
$mobileModule['icon3'] = hg_material_link($mobileModule['icon3']['host'], $mobileModule['icon3']['dir'], $mobileModule['icon3']['filepath'], $mobileModule['icon3']['filename']);
}
if ($mobileModule['icon4'])
{
$mobileModule['icon4'] = hg_material_link($mobileModule['icon4']['host'], $mobileModule['icon4']['dir'], $mobileModule['icon4']['filepath'], $mobileModule['icon4']['filename']);
}*/
//$info[] = $mobileModule;
$this->addItem($mobileModule);
}
//hg_pre($info,0);
}
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:40,代码来源:mobile_module.php
示例10: show_opration
/**
* 根据文章ID检索文章信息
* @name show_opration
* @access public
* @author wangleyuan
* @category hogesoft
* @copyright hogesoft
* @param id int 文章id
* @return array $return 文章信息
*/
public function show_opration()
{
if (!$this->input['id']) {
$this->errorOutput('ID不能为空');
}
$sql = "select a.* ,c.*,s.name from ((" . DB_PREFIX . "article a left join " . DB_PREFIX . "article_contentbody c on a.id=c.articleid) left join " . DB_PREFIX . "sort s on a.sort_id=s.id) where a.id=" . $this->input['id'];
$return = $this->db->query_first($sql);
if (!empty($return['indexpic'])) {
//查询索引图片地址
$sql = "select * from " . DB_PREFIX . "material where material_id=" . $return['indexpic'];
$q = $this->db->query_first($sql);
$size = array('label' => '400x300', 'width' => 400, 'height' => 300);
if (!empty($q)) {
$return['url'] = hg_material_link($q['host'], $q['dir'], $q['filepath'], $q['filename'], $size['label'] . '/');
}
}
if (!$return) {
$this->errorOutput('文章不存在或已被删除');
}
//记录页面的所处的类型与类别
if ($this->input['frame_type']) {
$return['frame_type'] = intval($this->input['frame_type']);
} else {
$return['frame_type'] = '';
}
if ($this->input['frame_sort']) {
$return['frame_sort'] = intval($this->input['frame_sort']);
} else {
$return['frame_sort'] = '';
}
$return['create_time'] = date('Y-m-d H:i', $return['create_time']);
$return['update_time'] = date('Y-m-d H:i', $return['update_time']);
$return['pub_time'] = date('Y-m-d H:i', $return['pub_time']);
$this->addItem($return);
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:46,代码来源:news_request_opration.php
示例11: show_win_info_more
public function show_win_info_more()
{
$id = intval($this->input['id']);
if (!$id) {
$this->errorOutput('活动id不存在');
}
$pp = $this->input['page'] ? intval($this->input['page']) : 1;
//如果没有传第几页,默认是第一页
$count = $this->input['count'] ? intval($this->input['count']) : 12;
$offset = intval(($pp - 1) * $count);
$limit = ' LIMIT ' . $offset . ' , ' . $count;
$orderby = ' ORDER BY red_bag DESC,create_time ASC ';
$sql = "SELECT * FROM " . DB_PREFIX . "win_info WHERE tv_interact_id = " . $id . $orderby . $limit;
$q = $this->db->query($sql);
$member_id = array();
while ($r = $this->db->fetch_array($q)) {
$r['create_time'] = date('Y-m-d H:i', $r['create_time']);
$info[] = $r;
$member_id[] = $r['member_id'];
}
if (!empty($member_id)) {
include_once ROOT_DIR . 'lib/class/members.class.php';
$obj = new members();
$member_id = implode(',', $member_id);
$member_info = array();
$member_info_tmp = array();
$member_info_tmp = $obj->get_member_info($member_id);
if (!empty($member_info_tmp)) {
$size = '82x62/';
foreach ($member_info_tmp as $val) {
$member_info[$val['member_id']]['member_name'] = $val['member_name'];
if (!empty($val['avatar'])) {
$member_info[$val['member_id']]['avatar'] = hg_material_link($val['avatar']['host'], $val['avatar']['dir'], $val['avatar']['filepath'], $val['avatar']['filename'], $size);
} else {
$member_info[$val['member_id']]['avatar'] = array();
}
$member_info[$val['member_id']]['phone_num'] = $val['mobile'];
}
}
}
if (!empty($info)) {
foreach ($info as $val) {
foreach ($val as $k => $v) {
if ($k == 'member_id' && $member_info[$v]) {
$val['member_name'] = $member_info[$v]['member_name'];
$val['phone_num'] = $member_info[$v]['phone_num'];
$val['avatar'] = $member_info[$v]['avatar'];
}
}
$ret[] = $val;
}
}
//分页信息
$sql = 'SELECT COUNT(*) AS total FROM ' . DB_PREFIX . 'win_info WHERE 1 AND tv_interact_id = ' . $id;
$re = $this->db->query_first($sql);
$total_num = $re['total'];
//总的记录数
//总页数
if (intval($total_num % $count) == 0) {
$return['total_page'] = intval($total_num / $count);
} else {
$return['total_page'] = intval($total_num / $count) + 1;
}
$return['total_num'] = $total_num;
//总的记录数
$return['page_num'] = $count;
//每页显示的个数
$return['current_page'] = $pp;
//当前页码
$data['info'] = $ret;
$data['page_info'] = $return;
$this->addItem($data);
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:74,代码来源:tv_interact.php
示例12: show
/**
* 显示节目单
*/
function show()
{
$condition = '';
$channel_id = intval($this->input['channel_id']) ? intval($this->input['channel_id']) : 0;
#####节点权限认证需要将节点数据放在nodes=>标志=>节点id=>节点所有父级节点
$dates = array();
if ($channel_id) {
$dates = $this->getWeekInfo($channel_id);
} else {
$this->errorOutput(NO_CHANNEL_ID);
}
if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
$is_action = trim($this->input['a']) == 'count' ? true : false;
if ($this->user['prms']['app_prms'][APP_UNIQUEID]['action']) {
foreach ($this->user['prms']['app_prms'][APP_UNIQUEID]['action'] as $k => $v) {
if ($v == $this->input['a']) {
$is_action = true;
}
}
}
if ($is_action && $this->user['prms']['app_prms'][APP_UNIQUEID]['nodes']) {
$all_node = $this->user['prms']['app_prms'][APP_UNIQUEID]['nodes'];
$cond = array();
if (intval($this->input['_id'])) {
if (in_array(intval($this->input['_id']), $all_node)) {
$cond['channel_id'] = intval($this->input['_id']);
}
} else {
$cond['channel_id'] = '';
$space = '';
foreach ($all_node as $k => $v) {
if ($v > 0) {
$cond['channel_id'] .= $space . $v;
$space = ',';
}
}
}
// echo $cond['node_id'].'<br/>';exit;
$cond['is_stream'] = 0;
$cond['field'] = 'id, name, code, is_control, is_audio, is_mobile_phone, server_id, logo_rectangle, logo_square, node_id';
$channel = $this->mNewLive->getChannelInfo($cond);
$channel_id = array();
if (!empty($channel)) {
foreach ($channel as $v) {
$channel_id[] = $v['id'];
}
}
if ($this->input['channel_id']) {
if (!in_array($this->input['channel_id'], $channel_id)) {
$this->errorOutput(NO_PRIVILEGE);
} else {
$channel_condition = intval($this->input['channel_id']);
}
} else {
$channel_condition = $channel_id ? implode(',', $channel_id) : '';
}
$channel_condition = $channel_condition ? $channel_condition : -1;
if ($channel_condition > -1) {
$condition .= ' AND channel_id = ' . $channel_condition;
} else {
$this->errorOutput(NO_PRIVILEGE);
}
}
} else {
$channel_condition = intval($this->input['channel_id']) ? intval($this->input['channel_id']) : -1;
}
$this->verify_content_prms();
#####节点权限认证需要将节点数据放在nodes=>标志=>节点id=>节点所有父级节点
$channel_id_info = $channel_id;
$channel_id = $channel_condition;
$week = array('日', '一', '二', '三', '四', '五', '六');
$get_week = $this->getWeek();
$channel = $this->mNewLive->getChannel();
$_dates = $short_week = array();
foreach ($get_week as $k => $v) {
$short_week[] = $week[date('w', strtotime($v))];
$_dates[$k] = 0;
}
$channel_info = array();
if (!empty($channel)) {
foreach ($channel as $k => $row) {
$row['is_schedule'] = $dates[$row['id']] ? $dates[$row['id']]['is_schedule'] : $_dates;
if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
if (in_array($row['id'], $channel_id_info)) {
if (empty($channel_info)) {
$channel_info['default'] = $row;
}
$row['logo_info'] = unserialize($row['logo_info']);
if ($row['logo_info']) {
$row['logo_url'] = hg_material_link($row['logo_info']['host'], $row['logo_info']['dir'], $row['logo_info']['filepath'], $row['logo_info']['filename'], '112x43/');
}
unset($row['logo_info']);
$channel_info[$row['id']] = $row;
}
} else {
if (empty($channel_info)) {
$channel_info['default'] = $row;
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:program.php
示例13: getThumbById
private function getThumbById($id, $size = array())
{
if (empty($id)) {
return false;
}
$sql = "SELECT * FROM " . DB_PREFIX . "material WHERE 1 AND material_id=" . $id;
$ret = $this->db->query_first($sql);
if (empty($ret)) {
return false;
}
if ($ret['mark'] != 'img') {
return false;
}
$size = $size ? $size : $this->settings['small_size'];
return hg_material_link($ret['host'], $ret['dir'], $ret['filepath'], $ret['filename'], $size['label'] . "/");
}
开发者ID:h3len,项目名称:Project,代码行数:16,代码来源:article.class.php
示例14: get_win_info
public function get_win_info()
{
$tv_interact_id = intval($this->input['tv_interact_id']);
if (!$tv_interact_id) {
$this->errorOutput(NOID);
}
$offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
$count = $this->input['count'] ? intval($this->input['count']) : 10;
$limit = ' LIMIT ' . $offset . ' , ' . $count;
$sql = "SELECT * FROM " . DB_PREFIX . "win_info WHERE tv_interact_id = " . $tv_interact_id . " ORDER BY create_time DESC LIMIT 0," . $count;
$q = $this->db->query($sql);
$info = array();
$member_id = array();
while ($r = $this->db->fetch_array($q)) {
$r['create_time'] = date('Y-m-d H:i:s', $r['create_time']);
$member_id[] = $r['member_id'];
$info[] = $r;
}
if (!empty($member_id)) {
include_once ROOT_PATH . 'lib/class/members.class.php';
$obj = new members();
$member_id = implode(',', $member_id);
$member_info = array();
$member_info_tmp = array();
$member_info_tmp = $obj->get_member_info($member_id);
if (!empty($member_info_tmp)) {
$size = '30x30/';
foreach ($member_info_tmp as $val) {
$member_info[$val['member_id']]['member_name'] = $val['member_name'];
if (!empty($val['avatar'])) {
$member_info[$val['member_id']]['avatar'] = hg_material_link($val['avatar']['host'], $val['avatar']['dir'], $val['avatar']['filepath'], $val['avatar']['filename'], $size);
} else {
$member_info[$val['member_id']]['avatar'] = array();
}
$member_info[$val['member_id']]['phone_num'] = $val['mobile'];
}
}
}
if (!empty($info) && $member_info) {
$win_info = array();
foreach ($info as $val) {
foreach ($val as $k => $v) {
if ($k == 'member_id' && $member_info[$v]) {
$val['member_name'] = $member_info[$v]['member_name'];
$val['phone_num'] = $member_info[$v]['phone_num'];
$val['avatar'] = $member_info[$v]['avatar'];
}
}
$this->addItem($val);
}
}
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:53,代码来源:tv_interact.php
示例15: detail_history
function detail_history()
{
if (empty($this->input['id'])) {
$this->errorOutput('未传入版本ID');
}
$id = intval($this->input['id']);
$sql = "SELECT * FROM " . DB_PREFIX . "article_history WHERE id=" . $id;
$f = $this->db->query_first($sql);
if (empty($f)) {
return FALSE;
}
$info = unserialize($f['content']);
$info['history_id'] = $f['id'];
$info['create_time'] = date('Y-m-d H:i:s', $info['create_time']);
$info['newcontent'] = $info['content'];
//分页
$info['allpages'] = $info['content'];
if (!empty($info['indexpic'])) {
//查找索引图
$info['indexpic_url'] = $this->getThumbById($info['indexpic'], $this->settings['default_index']);
} else {
$info['indexpic_url'] = '';
}
$ret = $this->getMaterialByMaterialId($info['material_id']);
if (!empty($ret)) {
foreach ($ret as $k => $v) {
// if(in_array($v['material_id'],$out['id'])) //去除文章中包含的素材图片
// {
// unset($ret[$k]);
// continue;
// }
switch ($v['mark']) {
case 'img':
//将缩略图信息加入info数组
$info['material'][$v['id']] = $v;
$info['material'][$v['id']]['filename'] = $v['filename'];
$info['material'][$v['id']]['path'] = $v['host'] . $v['dir'];
$info['material'][$v['id']]['dir'] = $v['filepath'];
$info['material'][$v['id']]['type'] = $v['type'];
$info['material'][$v['id']]['url'] = hg_material_link($v['host'], $v['dir'], $v['filepath'], $v['filename'], $this->settings['default_index']['label'] . '/');
$info['material'][$v['id']]['small_url'] = hg_material_link($v['host'], $v['dir'], $v['filepath'], $v['filename'], $this->settings['default_size']['label'] . '/');
$other_img .= '[img id="' . $v['id'] . '" width="' . $v['imgwidth'] . '" height="' . $v['imgheight'] . '"]' . $info['material'][$v['id']]['ori_url'] . '[/img]';
break;
case 'doc':
$info['material'][$v['id']] = $v;
$info['material'][$v['id']]['url'] = MATERIAL_TYPE_THUMB . "doc.png?" . hg_generate_user_salt(5);
//返回小图
$other_doc .= '[doc id="' . $v['id'] . '" width="' . $v['imgwidth'] . '" height="' . $v['imgheight'] . '"]' . $info['material'][$v['id']]['ori_url'] . '[/doc]';
break;
case 'real':
$info['material'][$v['id']] = $v;
$info['material'][$v['id']]['url'] = MATERIAL_TYPE_THUMB . "real.png?" . hg_generate_user_salt(5);
//返回小图
$other_real .= '[real id="' . $v['id'] . '" width="' . $v['imgwidth'] . '" height="' . $v['imgheight'] . '"]' . $info['material'][$v['id']]['ori_url'] . '[/real]';
break;
default:
break;
}
}
}
$info['pubstatus'] = $info['state'];
$info['status'] = $info['state'] ? 2 : 0;
$encode = array('user_name', 'content', 'newcontent', 'allpages');
foreach ($encode as $v) {
$info[$v] = rawurlencode($info[$v]);
}
$this->addItem($info);
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:69,代码来源:news.php
示例16: getChannelInfo
public function getChannelInfo($condition, $offset, $count, $width = '112', $height = '43')
{
$limit = " LIMIT " . $offset . " , " . $count;
$orderby = " ORDER BY id DESC ";
$sql = "SELECT id, name, code, server_id, logo_info, audio_only FROM " . DB_PREFIX . "channel ";
$sql .= " WHERE 1 " . $condition . $orderby . $limit;
$q = $this->db->query($sql);
$return = array();
while ($row = $this->db->fetch_array($q)) {
$row['logo_info'] = @unserialize($row['logo_info']);
if ($row['logo_info']) {
$imgsize = $width . 'x' . $height . '/';
$row['logo_url'] = hg_material_link($row['logo_info']['host'], $row['logo_info']['dir'], $row['logo_info']['filepath'], $row['logo_info']['filename'], $imgsize);
}
$return[$row['id']] = $row;
}
return $return;
}
开发者ID:h3len,项目名称:Project,代码行数:18,代码来源:channels.class.php
示例17: fetch_message
private function fetch_message($msg_id, $feedback_id, $no_btn = 0)
{
if ($msg_id) {
$this->curl = new curl($this->settings['App_im']['host'], $this->settings['App_im']['dir']);
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->initPostData();
$this->curl->addRequestData('session_id', $msg_id);
$this->curl->addRequestData('sort_type', 'ASC');
$this->curl->addRequestData('a', 'session_detail');
$message = $this->curl->request('message.php');
$message = $message[0];
$msg = $message['messages'][$msg_id];
$userinfo = $message['users'];
if ($feedback_id) {
$sql = 'SELECT admin_reply_count FROM ' . DB_PREFIX . 'record_person WHERE feedback_id = ' . $feedback_id . ' AND user_id = ' . $this->user['user_id'];
$back = $this->db->query_first($sql);
$reply = $back['admin_reply_count'];
$sql = 'UPDATE ' . DB_PREFIX . 'record_person SET admin_reply_count = 0 WHERE feedback_id = ' . $feedback_id . ' AND user_id = ' . $this->user['user_id'];
$this->db->query($sql);
if ($message['session_info']['id'] && $reply) {
/*************会员查看过消息之后,管理员的回复数量加新消息数************/
if ($this->settings['App_members']) {
require_once ROOT_PATH . 'lib/class/members.class.php';
$members = new members();
$data = array('member_id' => $this->user['user_id'], 'mark' => 'apply', 'math' => 2, 'total' => $reply);
$ret = $members->updateMyData($data);
}
/*************会员查看过消息之后,管理员的回复数量加新消息数************/
}
}
if ($userinfo && is_array($userinfo)) {
foreach ($userinfo as $k => $v) {
$user[$v['uid']] = $v['utype'];
}
}
if ($msg && is_array($msg)) {
$body_html = '';
$body_html .= '<ul class="talk-list">';
foreach ($msg as $k => $v) {
if ($user[$v['send_uid']] == 'admin') {
$body_html .= '<li class="feedback-flex">';
$body_html .= '<img class="service-provider-avatar" src="' . hg_material_link($v['send_uavatar']['host'], $v['send_uavatar']['dir'], $v['send_uavatar']['filepath'], $v['send_uavatar']['filename'], '48x48/') . '" />';
$body_html .= '<div class="feedback-flex-one">';
$body_html .= '<span class="msg service-provider">' . $v['message'] . '</span>';
$body_html .= '</div>';
$body_html .= '</li>';
} else {
$body_html .= '<li>';
$body_html .= '<span class="msg user">' . $v['message'] . '</span>';
$body_html .= '</li>';
}
}
$body_html .= '</ul>';
}
}
if ($msg_id && !$no_btn) {
$body_html .= '<div class="replay feedback-flex">';
$body_html .= '<input class="feedback-flex-one" type="text" name="replay" placeholder="在此输入回复内容">';
$body_html .= '<span class="btn-default replay-btn">发送</span>';
$body_html .= '</div>';
}
return $body_html;
}
开发者ID:h3len,项目名称:Project,代码行数:64,代码来源:feedback_update.php
示例18: query
public function query()
{
//require_once(ROOT_PATH . 'lib/class/publishcontent.class.php');
$this->puscont = new publishcontent();
$pp = $this->input['page'] ? intval($this->input['page']) : 1;
//如果没有传第几页,默认是第一页
$count = $this->input['count'] ? intval($this->input['count']) : 10;
$offset = intval(($pp - 1) * $count);
$data = array('offset' => $offset, 'count' => $count, 'client_type' => '2', 'need_count' => '1');
if ($this->input['site_id']) {
$data['site_id'] = intval($this->input['site_id']);
}
if ($this->input['info']) {
foreach ($this->input['info'] as $k => $v) {
$info[$v['name']] = $v['value'];
}
}
//查询
if ($info['special_modules']) {
$data['bundle_id'] = $info['special_modules'];
}
//查询时间
if ($info['special_date_search']) {
$data['date_search'] = $info['special_date_search'];
}
//查询标题
if ($info['k']) {
$data['k'] = $info['k'];
}
//查询创建的起始时间
if ($info['start_time']) {
$data['starttime'] = $info['start_time'];
}
//查询创建的结束时间
if ($info['end_time']) {
$data['endtime'] = $info['end_time'];
}
//查询权重
if (isset($info['start_weight']) && intval($info['start_weight']) >= 0) {
$data['start_weight'] = $info['start_weight'];
}
if (isset($info['end_weight']) && intval($info['end_weight']) >= 0) {
$data['end_weight'] = $info['end_weight'];
}
$re = $this->puscont->get_content($data);
$return = $this->publishcontent->get_pub_content_type();
if (is_array($return)) {
foreach ($return as $k => $v) {
$bundles[$v['bundle']] = $v['name'];
}
}
$columns = $this->get_column();
if (is_array($re['data'])) {
foreach ($re['data'] as $k => $v) {
$co_names = array();
if ($v['column_id']) {
$co_arr = explode(" ", $v['column_id']);
foreach ($co_arr as $ke => $va) {
$co_names[] = $columns[$va];
}
}
$v['column_name'] = implode(" ", $co_names);
//$v['app_name'] = $apps[$v['bundle_id']];
$v['module_name'] = $bundles[$v['bundle_id']];
$v['pic'] = json_encode($v['indexpic']);
$v['picture'] = hg_material_link($v['indexpic']['host'], $v['indexpic']['dir'], $v['indexpic']['filepath'], $v['indexpic']['filename']);
$ret[] = $v;
}
}
$total_num = $re['total'];
//总的记录数
//总页数
if (intval($total_num % $count) == 0) {
$return['total_page'] = intval($total_num / $count);
} else {
$return['total_page'] = intval($total_num / $count) + 1;
}
$return['total_num'] = $total_num;
//总的记录数
$return['page_num'] = $count;
//每页显示的个数
$return['current_page'] = $pp;
//当前页码
$retu['info'] = $ret;
$retu['page_info'] = $return;
$this->addItem($retu);
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:88,代码来源:publishcontent.php
示例19: show
public function show()
{
if ($this->user['user_id'] < 0) {
$this->errorOutput('请登录');
}
if ($this->settings['admin_type']['presenter'] == $this->user['group_type']) {
$this->errorOutput('您没有权限访问此页面');
}
$channel_id = intval($this->input['channel_id']);
if (!$channel_id) {
$this->errorOutput('未传入频道id');
}
//获取频道信息
$channel_info = $this->mInteractive->get_channel_info($channel_id);
$this->addItem_withkey('channel', $channel_info);
//获取主持人信息
$admin_info = $this->mInteractiveProgram->get_admin($this->settings['admin_type']['presenter']);
if (!empty($admin_info)) {
$presenter = array();
foreach ($admin_info as $v) {
$presenter[$v['id']] = $v['user_name'];
}
}
$this->addItem_withkey('presenter', $presenter);
//根据日期选择节目单
$dates = $this->input['dates'] ? urldecode($this->input['dates']) : date('Y-m-d');
$start_end = urldecode($this->input['start_end']);
$this->addItem_withkey('dates', $dates);
$program_start_end = $this->mInteractiveProgram->get_program_start_end($channel_id, $dates, $start_end);
$start_time = $program_start_end['start_time'];
$end_time = $program_start_end['end_time'];
$program = $program_start_end['program'];
$start_end = $program_start_end['start_end'];
$this->addItem_withkey(
|
请发表评论