Beispiel #1
0
 public function show()
 {
     $modules = array();
     $sql = 'SELECT n.*, a.host AS ahost, a.dir AS adir, a.name AS aname  FROM ' . DB_PREFIX . 'node n LEFT JOIN ' . DB_PREFIX . 'applications a ON n.application_id = a.id ORDER BY order_id ASC';
     $q = $this->db->query($sql);
     while ($row = $this->db->fetch_array($q)) {
         $row['create_time'] = hg_get_date($row['create_time']);
         if (!$row['host']) {
             $row['host'] = $row['ahost'];
         }
         if (!$row['dir']) {
             $row['dir'] = $row['adir'];
         }
         $row['apifile'] = 'http://' . $row['host'] . '/' . $row['dir'] . $row['file_name'] . $row['file_type'];
         $row['return_var'] = '<span title="初始化选中数据时,定义 $hg_' . $row['return_var'] . '_selected = (选中值,多个使用数组);变量">$hg_' . $row['return_var'] . '</span>';
         $row['application_id'] = $row['aname'];
         $modules[$row['id']] = $row;
     }
     $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'name' => array('title' => '名称', 'exper' => '$v[name]'), 'application_id' => array('title' => '所属系统', 'exper' => '$v[application_id]'), 'apifile' => array('title' => '接口文件', 'exper' => '$v[apifile]'), 'func_name' => array('title' => '方法名', 'exper' => '$v[func_name]'), 'return_var' => array('title' => '返回变量', 'exper' => '$v[return_var]'), 'create_time' => array('title' => '创建时间', 'exper' => '$v[create_time]'));
     $op = array('form' => array('name' => '编辑', 'brief' => '', 'link' => '?a=form'), 'delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_post(this, \'删除\', 1);"', 'link' => '?a=delete'));
     $batch_op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_batchpost(this, \'delete\', \'删除\', 1,\'\',\'\',\'ajax\');"'));
     $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
     hg_add_head_element('js-c', $str);
     $this->tpl->addHeaderCode(hg_add_head_element('echo'));
     $this->tpl->addVar('list_fields', $list_fields);
     $this->tpl->addVar('op', $op);
     $this->tpl->addVar('batch_op', $batch_op);
     $this->tpl->addVar('close_search', true);
     $this->tpl->addVar('primary_key', 'id');
     $this->tpl->addVar('list', $modules);
     $this->tpl->outTemplate('node');
 }
Beispiel #2
0
 public function show()
 {
     $modules = array();
     $sql = 'SELECT *  FROM ' . DB_PREFIX . 'source_config where 1 ORDER BY id ASC';
     $q = $this->db->query($sql);
     while ($row = $this->db->fetch_array($q)) {
         $row['create_time'] = hg_get_date($row['create_time']);
         $row['apifile'] = 'http://' . $row['host'] . '/' . $row['dir'];
         $modules[$row['id']] = $row;
     }
     $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'name' => array('title' => '配置名称', 'exper' => '$v[name]'), 'apifile' => array('title' => '接口文件', 'exper' => '$v[apifile]'), 'create_time' => array('title' => '创建时间', 'exper' => '$v[create_time]'));
     /*'func_name' => array('title' => '方法名', 'exper' => '$v[func_name]'),*/
     $op = array('form' => array('name' => '配置', 'brief' => '', 'link' => '?a=form'), 'edit' => array('name' => '内容设置', 'brief' => '', 'link' => '?a=edit'), 'import' => array('name' => '导入', 'brief' => '', 'link' => '?a=import'), 'delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_post(this, \'删除\', 1);"', 'link' => '?a=delete'));
     $batch_op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_batchpost(this, \'delete\', \'删除\', 1,\'\',\'\',\'ajax\');"'));
     $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
     hg_add_head_element('js-c', $str);
     $this->tpl->addHeaderCode(hg_add_head_element('echo'));
     $this->tpl->addVar('list_fields', $list_fields);
     $this->tpl->addVar('op', $op);
     $this->tpl->addVar('batch_op', $batch_op);
     $this->tpl->addVar('close_search', true);
     $this->tpl->addVar('primary_key', 'id');
     $this->tpl->addVar('list', $modules);
     $this->tpl->outTemplate('source_config');
 }
Beispiel #3
0
 public function show()
 {
     $sql = 'SELECT * FROM ' . DB_PREFIX . 'applications ORDER BY id desc';
     $q = $this->db->query($sql);
     $applications = array();
     while ($row = $this->db->fetch_array($q)) {
         $row['create_time'] = hg_get_date($row['create_time']);
         $row['api'] = 'http://' . $row['host'] . '/' . $row['dir'];
         $applications[$row['id']] = $row;
         $applications_relate[$row['father_id']][] = $row['id'];
     }
     $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'name' => array('title' => '名称', 'exper' => '$v[name]'), 'softvar' => array('title' => '标识', 'exper' => '$v[softvar]'), 'api' => array('title' => '接口', 'exper' => '$v[api]'), 'create_time' => array('title' => '创建时间', 'exper' => '$v[create_time]'));
     $op = array('form' => array('name' => '编辑', 'brief' => '', 'link' => '?a=form'), 'delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_post(this, \'删除\', 1);"', 'link' => '?a=delete'), 'see_module' => array('name' => '查看模块', 'brief' => '', 'link' => 'modules.php?a=show'), 'export_xml' => array('name' => '导出应用xml', 'brief' => '', 'link' => '?a=export_xml'), 'app_publish' => array('name' => '发布至应用商店', 'brief' => '', 'link' => '?a=app_publish'));
     $batch_op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_batchpost(this, \'delete\', \'删除\', 1,\'\',\'\',\'ajax\');"'));
     $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
     hg_add_head_element('js-c', $str);
     $this->tpl->addHeaderCode(hg_add_head_element('echo'));
     $this->tpl->addVar('list_fields', $list_fields);
     $this->tpl->addVar('op', $op);
     $this->tpl->addVar('batch_op', $batch_op);
     $this->tpl->addVar('close_search', true);
     $this->tpl->addVar('primary_key', 'id');
     $this->tpl->addVar('applications', $applications);
     $this->tpl->addVar('applications_relate', $applications_relate);
     $this->tpl->outTemplate('application');
 }
Beispiel #4
0
 public function show()
 {
     $show_server_node = array();
     $server_cluster = $this->mServer_cluster;
     if ($server_cluster) {
         foreach ($server_cluster as $k => $v) {
             $show_server_node[] = array('id' => $k, "name" => $v, "fid" => 0, "depth" => 0, 'input_k' => '_type', 'attr' => 'attr', 'is_last' => 1);
         }
     }
     $modules = array();
     $type = intval($this->input['_type']);
     if ($type) {
         $template = 'servers_list';
         $cond = ' AND type=' . $type;
     } else {
         if (!$this->input['_type'] && $this->input['infrm']) {
             $template = 'servers_list';
         } else {
             $template = 'servers';
         }
     }
     $sql = 'SELECT * FROM ' . DB_PREFIX . 'servers WHERE 1' . $cond . ' ORDER BY id ASC';
     $q = $this->db->query($sql);
     while ($row = $this->db->fetch_array($q)) {
         $row['create_time'] = hg_get_date($row['create_time']);
         $servers[] = $row;
     }
     //$str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
     //hg_add_head_element('js-c',$str);
     $this->tpl->addHeaderCode(hg_add_head_element('echo'));
     $this->tpl->addVar('list_fields', $list_fields);
     $this->tpl->addVar('op', $op);
     $this->tpl->addVar('batch_op', $batch_op);
     $this->tpl->addVar('all_m', $all_m);
     $this->tpl->addVar('applications', $applications);
     $this->tpl->addVar('close_search', true);
     $this->tpl->addVar('primary_key', 'id');
     $this->tpl->addVar('list', $servers);
     $this->tpl->addVar('_selfurl', 'server.php?&infrm=1');
     $this->tpl->addVar('show_server_node', $show_server_node);
     $this->tpl->outTemplate($template);
 }
Beispiel #5
0
 public function show_notice()
 {
     $gScriptName = SCRIPTNAME;
     $n = intval($this->input['n']);
     $pp = intval($this->input['pp']) ? intval($this->input['pp']) : 0;
     $count = 50;
     switch ($n) {
         case 0:
             $this->page_title = '消息';
             include_once ROOT_PATH . 'lib/messages/messages.class.php';
             $mMessages = new messages();
             $msg_members = array();
             $from_who = $mMessages->get_members($this->user['id'], '', $pp, $count);
             $total = @array_shift($from_who);
             //分页
             $data['totalpages'] = $total;
             $data['perpage'] = $count;
             $data['curpage'] = $pp;
             $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=0\';$(this).addClass(\'pages_current\');" ';
             $showpages = hg_build_pagelinks($data);
             ob_start();
             include hg_load_template("user_msgs");
             $html = ob_get_contents();
             ob_end_clean();
             break;
         case 1:
             $this->page_title = '通知';
             include_once ROOT_PATH . 'lib/class/notify.class.php';
             $mNotify = new notify();
             $notice_arr = $un_notice = $notice = array();
             $notice_arr = $mNotify->notify_get($this->user['id'], -1, $pp, $count);
             //分页,这个通知要区分一下,已读的通知和未知的通知要分开
             $notice_count = $mNotify->notify_count($this->user['id'], -1);
             $total_count = $notice_count[0];
             $total1 = array_sum($total_count);
             $data['totalpages'] = $total1;
             $data['perpage'] = $count;
             $data['curpage'] = $pp;
             $data['onclick'] = ' onclick="javascript:document.location.href=re_back+\'?a=show_notice&pp=\'+(parseInt(this.title,10) - 1)+\'&n=1\';$(this).addClass(\'pages_current\');" ';
             $showpages = hg_build_pagelinks($data);
             if ($notice_arr) {
                 $sp = '';
                 foreach ($notice_arr as $key => $n) {
                     if ($n['is_read'] == 0) {
                         if (in_array($n['type'], array(0, 1, 2, 3))) {
                             $un_notice[$n['type']]['idstr'] .= $sp . $n['id'];
                             $un_notice[$n['type']]['content'] = unserialize($n['content']);
                         } else {
                             $un_notice[$n['type']][$n['id']]['content'] = unserialize($n['content']);
                             $un_notice[$n['type']][$n['id']]['content']['notify_time'] = hg_get_date($n['notify_time']);
                         }
                         $a = $mNotify->notify_send_read($key, $this->user['id'], $n['type']);
                         //将本页未读通知插入到已读表中
                         $sp = ',';
                     } else {
                         if ($n['type'] > 3) {
                             $notice[$n['type']][$n['id']]['content'] = unserialize($n['content']);
                             $notice[$n['type']][$n['id']]['content']['notify_time'] = hg_get_date($n['notify_time']);
                         }
                     }
                 }
             }
             ob_start();
             include hg_load_template("user_notices");
             $html = ob_get_contents();
             ob_end_clean();
             break;
     }
     hg_add_head_element('js', RESOURCE_DIR . 'scripts/' . 'user.js');
     include hg_load_template("user_show_n");
 }
Beispiel #6
0
			{if $friends}
			
			<ul class="status-item">		
				
				{foreach $friends as $k => $v}
				
					<li class="clear" id="delete_{$v['id']}">
						<div class="blog-content">
						
							<div class="attention clear">
								<p class="name"><a href="<?php 
echo hg_build_link(SNS_UCENTER . 'user.php', array('user_id' => $v['id']));
?>
" >{$v['username']}</a>:<span><a>{$v['followers_count']}</a>粉丝</span></p>
								<span style="color:gray;font-size:11px;"><?php 
echo hg_get_date($v['follow_time']);
?>
</span>
							</div>
							
							<div class="close-concern">
								<span style="float:left;width:18px;text-align:left;margin-right:5px;padding-right: 5px;display:block;"><a class="chat" href="javascript:void(0);" onclick="showMsgBox('<?php 
echo $v['username'];
?>
','<?php 
echo md5($v['id'] . $v['salt'] . $user_info['id'] . $user_info['salt']);
?>
')">&nbsp;&nbsp;</a></span>
							
							{if $is_my_page}
							
Beispiel #7
0
,<?php 
        echo $this->user['id'];
        ?>
)"><?php 
        echo $this->lang['comment'];
        ?>
(<span id="comm_<?php 
        echo $value['id'];
        ?>
"><?php 
        echo $value['comment_count'];
        ?>
</span>)</a>
				</span>
				<strong><?php 
        echo hg_get_date($value['create_at']);
        ?>
</strong>
				<strong class="overflow" style="max-width:230px"><?php 
        echo $this->lang['source'] . $value['source'];
        ?>
</strong>
				<?php 
        if ($this->user['id']) {
            ?>
				<a onclick="report_play(<?php 
            echo $value['id'];
            ?>
,<?php 
            echo $value['user']['id'];
            ?>
Beispiel #8
0
        $class = 'liBgDif';
    } else {
        $class = '';
    }
    ?>
								<li id="pm_<?php 
    echo $p_info['pid'];
    ?>
" class="<?php 
    echo $class;
    ?>
"><div class="eachMessage clearfix"><div class="left"><span  class="user_name"><?php 
    echo $p_info['fromwho'];
    ?>
</span></div><div class="right"><?php 
    echo hg_get_date($p_info['stime']);
    ?>
</div><div style="color: rgb(125, 125, 125);" class="eachMessageCon"><?php 
    echo $p_info['content'];
    ?>
</div></div></li>
								<?php 
}
?>
								</ul> 
							</div>
						</div>
						<div class="MBBottom">
							<div class="MMessageBox">
								<div class="GUserAvatar"><img src="<?php 
echo $user_info['middle_avatar'];
Beispiel #9
0
 public function show()
 {
     $count = intval($this->input['count']);
     $count = $count ? $count : 20;
     $extralink = '';
     if ($this->input['count']) {
         $extralink .= '&amp;count=' . $this->input['count'];
     }
     if ($this->input['hgorder']) {
         $extralink .= '&amp;hgorder=' . $this->input['hgorder'];
     }
     if ($this->input['hgupdn']) {
         $extralink .= '&amp;hgupdn=' . $this->input['hgupdn'];
     }
     $condition = array();
     if ($this->input['type']) {
         $condition[] = ' type = ' . $this->input['type'];
         $extralink .= '&amp;type=' . $this->input['type'];
     }
     if ($this->user['group_type'] != 1) {
         $condition[] = ' group_type != 1';
     }
     if ($condition) {
         $conditions = ' WHERE ' . implode(',', $condition);
     }
     $page = intval($this->input['pp']);
     $sql = 'SELECT count(*) AS total FROM ' . DB_PREFIX . 'log' . $conditions;
     $total = $this->db->query_first($sql);
     $total = intval($total['total']);
     $data = array();
     $data['totalpages'] = $total;
     $data['perpage'] = $count;
     $data['curpage'] = $page;
     $data['pagelink'] = '?' . $extralink;
     $pagelink = hg_build_pagelinks($data);
     $sql = 'SELECT * FROM ' . DB_PREFIX . 'log' . $conditions . " ORDER BY id DESC LIMIT {$page},{$count}";
     $q = $this->db->query($sql);
     $admin = array();
     while ($row = $this->db->fetch_array($q)) {
         $row['create_time'] = hg_get_date($row['create_time']);
         $admin[$row['id']] = $row;
     }
     $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'content' => array('title' => '日志', 'exper' => '$v[content]<br />$v[script_name]'), 'user_name' => array('title' => '操作人', 'exper' => '$v[user_name]'), 'ip' => array('title' => '操作IP', 'exper' => '$v[ip]'), 'create_time' => array('title' => '操作时间', 'exper' => '$v[create_time]'));
     /*
     
     'authorize' => array(
     	'name' =>'授权', 
     	'brief' =>'权限管理',
     	'link' => '?a=sys_authorize'),
     */
     $op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_post(this, \'删除\', 1);"', 'link' => '?a=delete'));
     $batch_op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_batchpost(this, \'delete\', \'删除\', 1,\'\',\'\',\'ajax\');"'));
     $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
     hg_add_head_element('js-c', $str);
     $this->tpl->addHeaderCode(hg_add_head_element('echo'));
     $this->tpl->addVar('list_fields', $list_fields);
     $this->tpl->addVar('pagelink', $pagelink);
     $this->tpl->addVar('op', $op);
     $this->tpl->addVar('batch_op', $batch_op);
     $this->tpl->addVar('close_search', true);
     $this->tpl->addVar('primary_key', 'id');
     $this->tpl->addVar('list', $admin);
     $this->tpl->outTemplate('log');
 }
Beispiel #10
0
    public function show()
    {
        //导航设置
        $this->append_nav(array('name' => '权限控制', 'link' => '###'));
        //查找应用下面模块
        $curl = new curl($this->settings['App_auth']['host'], $this->settings['App_auth']['dir']);
        $curl->setSubmitType('get');
        $curl->initPostData();
        $curl->addRequestData('a', 'get_mod_info');
        //$this->input['app_un_id'] = 'liv_mms';
        if ($this->input['app_un_id']) {
            $curl->addRequestData('app_en', $this->input['app_un_id']);
        }
        $return = $curl->request('get_app_info.php');
        //file_put_contents('1.txt',var_export($return,1));
        $return = $return[0];
        $applications = array();
        //默认模块id
        $DefaultMid = urldecode($return[0]['module_en']);
        $mod = urldecode($this->input['_type']);
        if (is_array($return) && count($return) > 0) {
            foreach ($return as $key => $val) {
                foreach ($val as $k => $v) {
                    if ($k == 'module_en') {
                        $module[$v] = $val['module_name'];
                        if ($mod == $v) {
                            $this->append_nav(array('name' => $val['module_name'], 'link' => '?_type=' . $v));
                        }
                    }
                    if ($k == 'app_en') {
                        $applications[] = $val['app_name'];
                    }
                }
            }
        }
        $server_cluster = $module;
        $show_server_node = array();
        if ($server_cluster) {
            foreach ($server_cluster as $k => $v) {
                $show_server_node[] = array('id' => $k, "name" => $v, "fid" => 0, "depth" => 0, 'input_k' => '_type', 'attr' => 'attr', 'is_last' => 1);
            }
        }
        $modules = array();
        $kind = $this->input['kind'];
        if ($mod) {
            if (!$kind || $kind == 'group') {
                $template = 'privilege_admin_group';
                $this->append_nav(array('name' => '用户组', 'link' => '#'));
            } else {
                if ($kind == 'user') {
                    $template = 'privilege_admin_group';
                    $this->append_nav(array('name' => '用户', 'link' => '#'));
                }
            }
        } else {
            if (!$mod && $this->input['infrm']) {
                $template = 'privilege_admin_group';
            } else {
                $template = 'privilege';
            }
        }
        $this->tpl->addVar('_nav', $this->nav);
        //用户组列表
        if ($kind == 'group' || !$kind) {
            //查询用户组信息
            if ($this->user['group_type'] != 1) {
                $condition = ' WHERE group_type != 1';
            }
            $sql = 'SELECT * FROM ' . DB_PREFIX . 'admin_group ' . $condition . ' ORDER BY id ASC';
            $q = $this->db->query($sql);
            $admin_group = array();
            while ($row = $this->db->fetch_array($q)) {
                $row['create_time'] = hg_get_date($row['create_time']);
                $row['group_type'] = $this->settings['group_types'][$row['group_type']];
                $admin_group[$row['id']] = $row;
            }
            $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'name' => array('title' => '用户组名称', 'exper' => '$v[name]'), 'brief' => array('title' => '描述', 'exper' => '$v[brief]'), 'group_type' => array('title' => '组类型', 'exper' => '$v[group_type]'), 'create_time' => array('title' => '创建时间', 'exper' => '$v[create_time]'));
            $op = array('authorize' => array('name' => '功能授权', 'brief' => '权限管理', 'link' => '?a=sys_authorize&mod=' . $mod), 'authorize_node' => array('name' => '节点授权', 'brief' => '权限管理', 'link' => '?a=accredit_node&mod=' . $mod));
            //print_r($this->nav);exit;
            $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
            hg_add_head_element('js-c', $str);
            $this->tpl->addHeaderCode(hg_add_head_element('echo'));
            $this->tpl->addVar('list_fields', $list_fields);
            $this->tpl->addVar('op', $op);
            $this->tpl->addVar('batch_op', $batch_op);
            $this->tpl->addVar('close_search', true);
            $this->tpl->addVar('primary_key', 'id');
            $this->tpl->addVar('defaultmid', $DefaultMid);
            $this->tpl->addVar('list', $admin_group);
            $this->tpl->addVar('_selfurl', 'privilege.php?infrm=1');
            $this->tpl->addVar('show_server_node', $show_server_node);
            $this->tpl->outTemplate($template);
        } else {
            $count = intval($this->input['count']);
            $count = $count ? $count : 20;
            $extralink = '';
            if ($this->input['count']) {
                $extralink .= '&amp;count=' . $this->input['count'];
            }
            if ($this->input['hgorder']) {
                $extralink .= '&amp;hgorder=' . $this->input['hgorder'];
            }
            if ($this->input['hgupdn']) {
                $extralink .= '&amp;hgupdn=' . $this->input['hgupdn'];
            }
            $condition = array();
            if ($this->user['group_type'] != 1) {
                $condition[] = ' t2.group_type != 1';
            }
            if ($this->input['admin_group_id']) {
                $condition[] = ' t1.admin_group_id = ' . $this->input['admin_group_id'];
                $extralink .= '&amp;admin_group_id=' . $this->input['admin_group_id'];
            }
            if ($condition) {
                $conditions = ' WHERE ' . implode(',', $condition);
            }
            $page = intval($this->input['pp']);
            $sql = 'SELECT count(*) AS total FROM ' . DB_PREFIX . 'admin t1
						left join ' . DB_PREFIX . 'admin_group t2
							on t1.admin_group_id=t2.id' . $conditions;
            $total = $this->db->query_first($sql);
            $total = intval($total['total']);
            $data = array();
            $data['totalpages'] = $total;
            $data['perpage'] = $count;
            $data['curpage'] = $page;
            $data['pagelink'] = '?' . $extralink;
            $pagelink = hg_build_pagelinks($data);
            $sql = 'SELECT t1.*,t2.name FROM ' . DB_PREFIX . 'admin t1
					left join ' . DB_PREFIX . 'admin_group t2
						on t1.admin_group_id=t2.id' . $conditions . " LIMIT {$page},{$count}";
            $q = $this->db->query($sql);
            $admin = array();
            while ($row = $this->db->fetch_array($q)) {
                $row['create_time'] = hg_get_date($row['create_time']);
                $row['cardid'] = $row['cardid'] ? '已绑定' : '未绑定';
                $admin[$row['id']] = $row;
            }
            $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'user_name' => array('title' => '用户名', 'exper' => '$v[user_name]'), 'group_name' => array('title' => '用户组', 'exper' => '$v[name]'), 'cardid' => array('title' => '是否绑定密保', 'exper' => '$v[cardid]'), 'create_time' => array('title' => '创建时间', 'exper' => '$v[create_time]'));
            /*
            
            'authorize' => array(
            	'name' =>'授权',
            	'brief' =>'权限管理',
            	'link' => '?a=sys_authorize'),
            */
            $op = array('authorize' => array('name' => '功能授权', 'brief' => '权限管理', 'link' => '?a=sys_authorize&type=user&mod=' . $mod), 'authorize_node' => array('name' => '节点授权', 'brief' => '权限管理', 'link' => '?a=accredit_node&type=user&mod=' . $mod));
            $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
            hg_add_head_element('js-c', $str);
            $this->tpl->addHeaderCode(hg_add_head_element('echo'));
            $this->tpl->addVar('list_fields', $list_fields);
            $this->tpl->addVar('pagelink', $pagelink);
            $this->tpl->addVar('op', $op);
            $this->tpl->addVar('batch_op', $batch_op);
            $this->tpl->addVar('close_search', true);
            $this->tpl->addVar('primary_key', 'id');
            $this->tpl->addVar('_selfurl', 'privilege.php');
            $this->tpl->addVar('show_server_node', $show_server_node);
            $this->tpl->addVar('list', $admin);
            $this->tpl->outTemplate($template);
        }
    }
Beispiel #11
0
 public function reply_comment()
 {
     $status_id = intval($this->input['status_id']);
     $reply_id = intval($this->input['reply_id']);
     $text = $this->input['text'];
     $transmit_type = intval($this->input['transmit_type']);
     $result = $this->mComment->reply_comment($reply_id, $status_id, $text);
     if ($result && is_array($result)) {
         $result['content'] = hg_verify($result['content']);
         $result['comment_time'] = $result['comment_time'];
         $result['create_at'] = hg_get_date($result['create_at']);
     }
     //同时转发到我的点滴
     if ($transmit_type == 1) {
         $status = new status();
         $status->update($text, '点滴', $status_id);
     }
     $result = json_encode($result);
     //echo "<pre>";
     print_r($result);
 }
Beispiel #12
0
				{if is_array($value['reply'])}
				<ul class="reply_list" id="rep_{$value['id']}">
				{foreach $value['reply'] as $k=>$v}
					<li id="com_{$v['id']}" class="clear">
						<div class="comment-img"><a href="<?php 
echo hg_build_link('user.php', array('user_id' => $v['user']['id']));
?>
"><img src="{$v['user']['middle_avatar']}"/></a></div>
						<div class="comment-bar">
							<a class="bar-left" href="<?php 
echo hg_build_link('user.php', array('user_id' => $v['user']['id']));
?>
">{$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}
Beispiel #13
0
 public function show()
 {
     $modules_op = array();
     $yesno = array(0 => '否', 1 => '是');
     $this->cache->check_cache('applications');
     $applications = $this->cache->cache['applications'];
     $module_id = intval($this->input['id']);
     if ($module_id) {
         $where = ' WHERE module_id IN (0,' . $module_id . ')';
     } else {
         $where = ' WHERE module_id = 0';
     }
     $sql = 'SELECT m.*, a.host AS ahost, a.dir AS adir FROM ' . DB_PREFIX . 'modules m LEFT JOIN ' . DB_PREFIX . 'applications a ON m.application_id=a.id WHERE m.id=' . $module_id;
     $modules = $this->db->query_first($sql);
     if (!$modules['host']) {
         $host = $modules['ahost'];
     } else {
         $host = $modules['host'];
     }
     if (!$modules['dir']) {
         $dir = $modules['adir'];
     } else {
         $dir = $modules['dir'];
     }
     $sql = 'SELECT * FROM ' . DB_PREFIX . 'module_op ' . $where . ' ORDER BY order_id ASC';
     $q = $this->db->query($sql);
     while ($row = $this->db->fetch_array($q)) {
         if (!$row['host']) {
             $row['host'] = $host;
         }
         if (!$row['dir']) {
             $row['dir'] = $dir;
         }
         if ($row['file_name']) {
             $file_name = unserialize($row['file_name']);
             if (!$file_name) {
                 $file_name = $row['file_name'];
             } else {
                 $file_name = $file_name[$module_id];
             }
             $row['file_name'] = $file_name;
         }
         if ($row['template']) {
             $template = unserialize($row['template']);
             if (!$template) {
                 $template = $row['template'];
             } else {
                 $template = $template[$module_id];
             }
         } else {
             $template = $row['template'];
         }
         if (!$row['file_name']) {
             if (!$row['template']) {
                 $row['file_name'] = $modules['file_name'] . '_update';
             } else {
                 $row['file_name'] = $modules['file_name'];
             }
         }
         $row['template'] = $template;
         if ($row['callback']) {
             $callback = unserialize($row['callback']);
             if (!$callback) {
                 $callback = $row['callback'];
             } else {
                 $callback = $callback[$module_id];
             }
         } else {
             $callback = $row['callback'];
         }
         $row['callback'] = $callback;
         if ($row['request_type']) {
             $request_type = unserialize($row['request_type']);
             if (!$request_type) {
                 $request_type = $row['request_type'];
             } else {
                 $request_type = $request_type[$module_id];
             }
         } else {
             $request_type = $row['request_type'];
         }
         $row['request_type'] = $request_type;
         if ($row['direct_return']) {
             $direct_return = unserialize($row['direct_return']);
             if (!$direct_return) {
                 $direct_return = $row['direct_return'];
             } else {
                 $direct_return = $direct_return[$module_id];
             }
         } else {
             $direct_return = $row['direct_return'];
         }
         $row['direct_return'] = $direct_return;
         $row['apifile'] = 'http://' . $row['host'] . '/' . $row['dir'] . $row['file_name'] . $row['file_type'];
         $row['create_time'] = hg_get_date($row['create_time']);
         $row['nameop'] = $row['name'] . '(' . $row['op'] . ')';
         if ($template) {
             $row['nameop'] .= '<br />Tpl:' . $template;
         }
         if ($callback) {
             $row['nameop'] .= ', callback:' . $callback;
         }
         $row['has_batch'] = $yesno[$row['has_batch']];
         $row['is_show'] = $yesno[$row['is_show']];
         if ($row['module_id']) {
             $row['module'] = $modules['name'];
         } else {
             $row['module'] = '全局';
         }
         $modules_op[$row['id']] = $row;
     }
     $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'nameop' => array('title' => '名称', 'exper' => '$v[nameop]'), 'apifile' => array('title' => '接口', 'exper' => '$v[apifile]'), 'func_name' => array('title' => '方法名', 'exper' => '$v[func_name]'), 'has_batch' => array('title' => '批', 'brief' => '是否支持批量操作', 'exper' => '$v[has_batch]'), 'is_show' => array('title' => '显示', 'exper' => '$v[is_show]'));
     $op = array('form' => array('name' => '编辑', 'brief' => '', 'link' => '?a=form&module_id=' . $module_id), 'delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_post(this, \'删除\', 1);"', 'link' => '?a=delete'), 'append' => array('name' => '关联数据', 'brief' => '', 'link' => '?a=append&module_id=' . $module_id));
     $batch_op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_batchpost(this, \'delete\', \'删除\', 1);"'));
     $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
     hg_add_head_element('js-c', $str);
     $this->tpl->addHeaderCode(hg_add_head_element('echo'));
     $this->tpl->addVar('module_id', $module_id);
     $this->tpl->addVar('modules', $modules);
     $this->tpl->addVar('list_fields', $list_fields);
     $this->tpl->addVar('op', $op);
     $this->tpl->addVar('batch_op', $batch_op);
     $this->tpl->addVar('close_search', true);
     $this->tpl->addVar('primary_key', 'id');
     $this->tpl->addVar('list', $modules_op);
     $this->tpl->outTemplate('modules_op');
 }
Beispiel #14
0
 private function get_data()
 {
     $modules = array();
     $yesno = array(0 => '否', 1 => '是');
     $appid = intval($this->input['application_id']);
     $appid = $appid ? $appid : intval($this->input['id']);
     if ($appid) {
         $cond = ' AND m.application_id=' . $appid;
     }
     $fatherid = intval($this->input['fatherid']);
     if ($fatherid) {
         $cond .= ' AND m.fatherid=' . $fatherid;
     }
     $sql = 'SELECT m.*, a.host AS ahost, a.dir AS adir, a.name AS aname FROM ' . DB_PREFIX . 'modules m LEFT JOIN ' . DB_PREFIX . 'applications a ON m.application_id = a.id WHERE 1' . $cond . ' ORDER BY m.order_id ASC';
     $q = $this->db->query($sql);
     $this->cache->check_cache('modules');
     $all_modules = $this->cache->cache['modules'];
     while ($row = $this->db->fetch_array($q)) {
         $row['create_time'] = hg_get_date($row['create_time']);
         if (!$row['host']) {
             $row['host'] = $row['ahost'];
             if (!$row['dir']) {
                 $row['dir'] = $row['adir'];
             }
         }
         if ($row['file_name']) {
             $row['apifile'] = 'http://' . $row['host'] . '/' . $row['dir'] . $row['file_name'] . $row['file_type'];
             $t = array('apifile' => $row['apifile'], 'app_uniqueid' => $row['app_uniqueid'], 'mod_uniqueid' => $row['mod_uniqueid'], 'menu_pos' => $row['menu_pos']);
             $modules[$row['id']] = $t;
         }
     }
     if ($modules) {
         $data = array();
         foreach ($modules as $app) {
             $specifytime = $this->mSettime[$app['app_uniqueid'] . '_specify'][$app['mod_uniqueid']];
             $runtime = $this->mRuntime[$app['app_uniqueid']][$app['mod_uniqueid']];
             if ($specifytime) {
                 if (!$runtime) {
                     $runtime = time() - 86400;
                 }
                 $nextruntime = strtotime(date('Y-m-d ' . $specifytime, $runtime)) + 86400;
                 if (time() < $nextruntime) {
                     continue;
                 }
             } else {
                 $setruntime = $this->mSettime[$app['app_uniqueid']][$app['mod_uniqueid']];
                 if (!$setruntime) {
                     $setruntime = $this->mSettime['app'];
                 }
                 if (time() - $runtime < $setruntime) {
                     continue;
                 }
             }
             $this->mRuntime[$app['app_uniqueid']][$app['mod_uniqueid']] = time();
             if ($app['app_uniqueid'] != 'news') {
                 //continue;
             }
             $condition = $this->mCondition[$app['app_uniqueid']][$app['mod_uniqueid']];
             if ($condition) {
                 $datapara = array('a' => 'count', 'm2o_ckey' => CUSTOM_APPKEY, 'appid' => APPID, 'appkey' => APPKEY, 'access_token' => $this->input['access_token']);
                 foreach ($condition as $k => $c) {
                     $ttmp = array();
                     foreach ($c as $in => $val) {
                         $ttmp[$in] = $val;
                     }
                     $ttmp = array_merge($datapara, $ttmp);
                     $count = $this->curl($app['apifile'], $ttmp);
                     $count = $count['total'];
                     $data[$app['app_uniqueid']][$app['mod_uniqueid']][$k] = $count;
                 }
             }
             if ($key = $this->mState[$app['app_uniqueid']][$app['mod_uniqueid']]['key']) {
                 $states = $this->mState[$app['app_uniqueid']][$app['mod_uniqueid']]['state'];
                 $datapara = array('a' => 'count', 'm2o_ckey' => CUSTOM_APPKEY, 'appid' => APPID, 'appkey' => APPKEY, 'access_token' => $this->input['access_token']);
                 foreach ($states as $state) {
                     $datapara[$key] = $state;
                     $count = $this->curl($app['apifile'], $datapara);
                     $count = $count['total'];
                     $data[$app['app_uniqueid']][$app['mod_uniqueid']][$state] = $count;
                 }
             } else {
                 $datapara = array('a' => 'count', 'm2o_ckey' => CUSTOM_APPKEY, 'appid' => APPID, 'appkey' => APPKEY, 'access_token' => $this->input['access_token']);
                 $count = $this->curl($app['apifile'], $datapara);
                 $count = $count['total'];
                 if ($count) {
                     $data[$app['app_uniqueid']][$app['mod_uniqueid']][0] = $count;
                 }
             }
         }
     }
     return $data;
 }
Beispiel #15
0
 public function show()
 {
     $modules = array();
     $yesno = array(0 => '否', 1 => '是');
     $appid = intval($this->input['application_id']);
     $appid = $appid ? $appid : intval($this->input['id']);
     if ($appid) {
         $cond = ' AND m.application_id=' . $appid;
     }
     $fatherid = intval($this->input['fatherid']);
     if ($fatherid) {
         $cond .= ' AND m.fatherid=' . $fatherid;
     }
     $sql = 'SELECT m.*, a.host AS ahost, a.dir AS adir, a.name AS aname FROM ' . DB_PREFIX . 'modules m LEFT JOIN ' . DB_PREFIX . 'applications a ON m.application_id = a.id WHERE 1' . $cond . ' ORDER BY m.order_id ASC';
     $q = $this->db->query($sql);
     $this->cache->check_cache('modules');
     $all_modules = $this->cache->cache['modules'];
     while ($row = $this->db->fetch_array($q)) {
         $row['create_time'] = hg_get_date($row['create_time']);
         if (!$row['host']) {
             $row['host'] = $row['ahost'];
             if (!$row['dir']) {
                 $row['dir'] = $row['adir'];
             }
         }
         if ($row['file_name']) {
             $row['apifile'] = 'http://' . $row['host'] . '/' . $row['dir'] . $row['file_name'] . $row['file_type'];
         }
         $row['is_pages'] = $yesno[$row['is_pages']];
         $row['application_id'] = $row['aname'];
         $row['fatherid'] = $row['fatherid'] ? $all_modules[$row['fatherid']]['name'] : '无';
         $modules[$row['id']] = $row;
     }
     $list_fields = array('id' => array('title' => 'ID', 'exper' => '$v[id]'), 'name' => array('title' => '名称', 'exper' => '$v[name]'), 'application_id' => array('title' => '所属系统', 'exper' => '$v[application_id]', 'width' => ' width="120"'), 'fatherid' => array('title' => '上级模块', 'exper' => '$v[fatherid]', 'width' => ' width="120"'), 'apifile' => array('title' => '接口文件', 'exper' => '$v[apifile]'), 'func_name' => array('title' => '方法名', 'exper' => '$v[func_name]'), 'template' => array('title' => '模板', 'exper' => '$v[template]'), 'is_pages' => array('title' => '分页', 'exper' => '$v[is_pages]'));
     $op = array('view' => array('name' => '查看', 'brief' => '', 'link' => 'modules_op.php?'), 'form_set' => array('name' => '表单', 'brief' => '', 'link' => '?a=form_set'), 'form' => array('name' => '编辑', 'brief' => '', 'link' => '?a=form'), 'delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_post(this, \'删除\', 1);"', 'link' => '?a=delete'), 'pub_setting' => array('name' => '发布设置', 'brief' => '', 'link' => '?a=pub_setting'), 'app_design' => array('name' => '应用设计', 'brief' => '', 'link' => '?a=app_design'));
     $batch_op = array('delete' => array('name' => '删除', 'brief' => '', 'attr' => ' onclick="return hg_ajax_batchpost(this, \'delete\', \'删除\', 1,\'\',\'\',\'ajax\');"'));
     $this->cache->check_cache('applications');
     $applications = array(0 => ' 全部 ');
     foreach ($this->cache->cache['applications'] as $k => $v) {
         $applications[$k] = $v['name'];
     }
     $all_m = array(0 => ' 全部 ');
     foreach ($this->cache->cache['modules'] as $k => $v) {
         if ($v['fatherid']) {
             continue;
         }
         $all_m[$k] = $v['name'];
     }
     $str = 'var gBatchAction = new Array();gBatchAction[\'delete\'] = \'?a=delete\';';
     hg_add_head_element('js-c', $str);
     $this->tpl->addHeaderCode(hg_add_head_element('echo'));
     $this->tpl->addVar('list_fields', $list_fields);
     $this->tpl->addVar('op', $op);
     $this->tpl->addVar('batch_op', $batch_op);
     $this->tpl->addVar('all_m', $all_m);
     $this->tpl->addVar('applications', $applications);
     $this->tpl->addVar('close_search', true);
     $this->tpl->addVar('primary_key', 'id');
     $this->tpl->addVar('list', $modules);
     $this->tpl->addVar('appid', $appid);
     $this->tpl->outTemplate('modules');
 }
Beispiel #16
0
					            <a onclick="setFous(<?php 
echo $status_id;
?>
,<?php 
echo $this->user['id'];
?>
)" href="javascript:void(0);">评论(<span id="coms_<?php 
echo $statusline['id'];
?>
"><?php 
echo $statusline['comment_count'];
?>
</span>)</a>
						    </span>
						    <strong><?php 
echo hg_get_date($statusline['create_at']);
?>
</strong>
							<strong>来自 <?php 
echo $statusline['source'];
?>
</strong> 
							<?php 
if ($this->user['id']) {
    ?>
<strong><a href="javascript:void(0);" onclick="report_play(<?php 
    echo $statusline['id'];
    ?>
,<?php 
    echo $statusline['user']['id'];
    ?>
Beispiel #17
0
 public function show()
 {
     #####
     $this->verify_content_prms();
     #####
     $offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
     $count = $this->input['count'] ? intval($this->input['count']) : 15;
     $limit = " limit {$offset}, {$count}";
     $condition = $this->get_condition();
     //查询出顶级类别供下面没有分类的时候用
     $sql = "SELECT * FROM " . DB_PREFIX . "vod_media_node WHERE fid = 0";
     $q = $this->db->query($sql);
     $top_sorts = array();
     while ($r = $this->db->fetch_array($q)) {
         $top_sorts[$r['id']] = $r;
     }
     $orderby = $this->input['orderby_id'] ? ' ORDER BY v.id ASC,v.video_order_id DESC' : ' ORDER BY v.video_order_id DESC, v.id DESC';
     //根据发布库栏目搜索
     if ($this->input['pub_column_id']) {
         $condition .= " GROUP BY v.id";
         $sql = "SELECT v.*, vs.name AS sort_name,vs.color AS vod_sort_color  \r\n                    FROM " . DB_PREFIX . "vodinfo v \r\n                    LEFT JOIN " . DB_PREFIX . "vod_media_node vs \r\n                        ON v.vod_sort_id = vs.id\r\n                    LEFT JOIN " . DB_PREFIX . "pub_column pc\r\n                        ON v.id = pc.aid     \r\n                    WHERE 1 " . $condition . $orderby . $limit;
     } else {
         $sql = "SELECT v.*, vs.name AS sort_name,vs.color AS vod_sort_color  FROM " . DB_PREFIX . "vodinfo v LEFT JOIN " . DB_PREFIX . "vod_media_node vs ON v.vod_sort_id = vs.id WHERE 1 " . $condition . $orderby . $limit;
     }
     $q = $this->db->query($sql);
     $this->setXmlNode('vod', 'item');
     $vod_info = array();
     //判断outpush状态
     $outpushInfo = $this->outpush->getOutpushInfoByAppid(APPLICATION_ID, $_REQUEST['access_token']);
     $outpush = $outpushInfo[0] ? $outpushInfo[0]['status'] : 0;
     while ($r = $this->db->fetch_array($q)) {
         if ($r['sort_name']) {
             $r['vod_sort_id'] = $r['sort_name'];
         } else {
             $r['vod_sort_id'] = $top_sorts[$r['vod_leixing']]['name'];
             $r['vod_sort_color'] = $top_sorts[$r['vod_leixing']]['color'];
         }
         $collects = unserialize($r['collects']);
         if ($collects) {
             $r['collects'] = $collects;
         } else {
             $r['collects'] = '';
         }
         $img_arr = $r['img_info'] = unserialize($r['img_info']);
         $r['img'] = '';
         if ($img_arr['filename'] == '<') {
             $img_arr = '';
             $r['img_info'] = '';
         }
         if ($img_arr) {
             $r['img'] = $img_arr['host'] . $img_arr['dir'] . '80x60/' . $img_arr['filepath'] . $img_arr['filename'];
         }
         $rgb = $r['bitrate'] / 100;
         if ($rgb < 10) {
             $r['bitrate_color'] = $this->settings['bitrate_color'][$rgb];
         } else {
             $r['bitrate_color'] = $this->settings['bitrate_color'][9];
         }
         if ($r['starttime']) {
             $r['starttime'] = '(' . date('Y-m-d', $r['starttime']) . ')';
         } else {
             $r['starttime'] = '';
         }
         $r['start'] = $r['start'] + 1;
         $r['etime'] = intval($r['duration']) + intval($r['start']);
         if ($r['duration']) {
             $r['video_duration'] = hg_timeFormatChinese($r['duration']);
             //时长
         } else {
             $r['video_duration'] = '无';
         }
         if ($r['isfile']) {
             $r['start'] = 0;
             $r['isfile_name'] = '是';
         } else {
             $r['isfile_name'] = '否';
         }
         $r['duration'] = time_format($r['duration']);
         $r['status_display'] = intval($r['status']);
         $r['status'] = $this->settings['video_upload_status'][$r['status']];
         $r['create_time'] = hg_get_date($r['create_time']);
         $r['update_time'] = date('Y-m-d H:i', $r['update_time']);
         $r['pub'] = unserialize($r['column_id']);
         $r['pub_url'] = unserialize($r['column_url']);
         $pub_column = array();
         if ($r['pub']) {
             foreach ($r['pub'] as $k => $v) {
                 $pub_column[] = array('column_id' => $k, 'column_name' => $v, 'pub_id' => intval($r['pub_url'][$k]));
             }
         }
         $r['pub_column'] = $pub_column;
         if ($r['is_link']) {
             $r['video_url'] = $r['hostwork'] . '/' . $r['video_path'];
         } else {
             $r['video_url'] = $r['hostwork'] . '/' . $r['video_path'] . MAINFEST_F4M;
         }
         $r['video_m3u8'] = $r['hostwork'] . '/' . $r['video_path'] . str_replace('.mp4', '.m3u8', $r['video_filename']);
         $r['frame_rate'] = number_format($r['frame_rate'], 3) . 'fps';
         if ($this->settings['App_mediaserver']) {
             if (!$this->settings['App_mediaserver']['protocol']) {
                 $this->settings['App_mediaserver']['protocol'] = 'http://';
             }
             $r['download'] = $this->settings['App_mediaserver']['protocol'] . $this->settings['App_mediaserver']['host'] . '/' . $this->settings['App_mediaserver']['dir'] . '/admin/download.php';
             $r['retranscode_url'] = $this->settings['App_mediaserver']['protocol'] . $this->settings['App_mediaserver']['host'] . '/' . $this->settings['App_mediaserver']['dir'] . '/admin/retranscode.php';
         } else {
             $r['download'] = '';
             $r['retranscode_url'] = '';
         }
         if ($r['totalsize']) {
             $r['video_totalsize'] = hg_fetch_number_format($r['totalsize'], 1);
         } else {
             $r['video_totalsize'] = '无';
         }
         $r['format_duration'] = hg_timeFormatChinese($r['duration']);
         //时长
         $r['resolution'] = $r['width'] . '*' . $r['height'];
         //分辨率
         $audio_status = check_str('L', 'R', $r['audio_channels']);
         switch ($audio_status) {
             case 0:
                 $r['video_audio_channels'] = '无';
                 break;
             case 1:
                 $r['video_audio_channels'] = '右';
                 break;
             case 2:
                 $r['video_audio_channels'] = '左';
                 break;
             case 3:
                 $r['video_audio_channels'] = '左右';
                 break;
             default:
                 $r['video_audio_channels'] = '无';
                 break;
         }
         $r['video_resolution'] = $r['width'] . '*' . $r['height'];
         //分辨率
         //多码流的状态
         if ($r['clarity']) {
             $r['is_do_morebit'] = '是';
         } else {
             $r['is_do_morebit'] = '否';
         }
         if ($r['is_morebitrate']) {
             $r['is_morebitrate_ok'] = '是';
         } else {
             $r['is_morebitrate_ok'] = '否';
         }
         if ($r['is_forcecode']) {
             $r['is_forcecode_ok'] = '是';
         } else {
             $r['is_forcecode_ok'] = '否';
         }
         //应用
         if (!$r['app_uniqueid']) {
             $r['app_uniqueid'] = APP_UNIQUEID;
         }
         if (!empty($r['right_info'])) {
             $tmp_data = json_decode($r['right_info'], 1);
             $r['object_id'] = $tmp_data['ObjectID'] ? $r['id'] : 0;
         }
         $vod_info[$r['id']] = $r;
         if ($r['catalog']) {
             $r['catalog'] = unserialize($r['catalog']);
         }
         $r['outpush'] = $outpush;
         $this->addItem($r);
     }
     $this->output();
 }
Beispiel #18
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;
    }
Beispiel #19
0
	<div class="photo">
    	<div style="font-size:0px;line-height:0px;"><img src="./res/img/hc_toppic.gif" width="215" height="3" /></div>
        <div class="pdline"><img src="<?php 
echo $user_info['larger_avatar'];
?>
" width="192" height="192" style="margin-top:6px;"/></div>
        <div style="font-size:0px;line-height:0"><img src="./res/img/hc_toppic3.gif" width="215" height="10" /></div>
    </div>
    <div class="pho_cot">
    	<div class="pho_hd"><span class="namecs"><?php 
echo $user_info['username'];
?>
</span><!--已有<span class="txt">113</span>人访问,<span class="txt">517</span>个积分--></div>
        <div class="pho_bk"><span class="txt">最近点滴:</span><?php 
echo $last_status['text'] ? hg_cutchars($last_status['text'], 40, " ") : "暂无";
echo hg_get_date($last_status['create_at']);
?>
<!--<span class="pho_hf"><a href="#">回复</a></span>--></div>
        <div class="pho_ar">
        	<div class="pho_1">
            	<ul>
                	<li>性    别:<span class="txt">
                	<?php 
switch ($user_info['sex']) {
    case 0:
        echo "保密";
        break;
    case 1:
        echo "男";
        break;
    case 2: