当前位置: 首页>>代码示例>>PHP>>正文


PHP access::add_access方法代码示例

本文整理汇总了PHP中access::add_access方法的典型用法代码示例。如果您正苦于以下问题:PHP access::add_access方法的具体用法?PHP access::add_access怎么用?PHP access::add_access使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在access的用法示例。


在下文中一共展示了access::add_access方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: channels


//.........这里部分代码省略.........
                 //直播
                 $live_wowzaip_output = $server_info['live_wowzaip_output'];
                 //录制
                 $record_wowzaip_output = $server_info['record_wowzaip_output'];
                 if ($channel['client_logo'][$appid]) {
                     unset($channel['client_logo'][$appid]['appid'], $channel['client_logo'][$appid]['appname']);
                     $channel['logo_rectangle'] = $channel['client_logo'][$appid];
                 }
                 $logo = array('rectangle' => $channel['logo_rectangle'], 'square' => $channel['logo_rectangle']);
                 $snap = array('host' => $this->mImgUrl . LIVE_CONTROL_LIST_PREVIEWIMG_URL, 'dir' => '', 'filepath' => date('Y') . '/' . date('m') . '/', 'filename' => 'live_' . $channel['id'] . '.png?time=' . TIMENOW);
                 if ($channel['is_audio']) {
                     if ($channel['logo_audio']) {
                         $snap = $channel['logo_audio'];
                     } else {
                         $snap = $channel['logo_rectangle'];
                     }
                 }
                 $channel_stream = $record_stream = array();
                 if ($channel['channel_stream']) {
                     foreach ($channel['channel_stream'] as $kk => $vv) {
                         if ($channel['m3u8_stream_name']) {
                             $stream_n = $channel['m3u8_stream_name'];
                         } else {
                             $stream_n = $channel['main_stream_name'];
                         }
                         $vv['code'] = $channel['code'];
                         $function = 'set_url_info_' . $type;
                         $set_url_info = $this->mChannel->{$function}(array(), $vv);
                         $app_name = $set_url_info['app_name'];
                         $stream_name = $set_url_info['stream_name'];
                         $m3u8_type = $set_url_info['m3u8_type'];
                         $flv = $set_url_info['flv'];
                         $url = hg_set_stream_url($wowzaip_output, $app_name, $stream_name, $flv);
                         if ($channel['is_mobile_phone']) {
                             if ($this->settings['signleliveaddr']) {
                                 $m3u8 = $this->settings['signleliveaddr'] . $channel['code'] . '.stream/playlist.m3u8';
                             } else {
                                 $m3u8 = hg_set_stream_url($wowzaip_output, $app_name, $stream_name, $m3u8_type, '', '', '', 'http://', '/' . $vv['stream_name'] . '/live.m3u8');
                             }
                             if ($live_wowzaip_output && $channel['is_live']) {
                                 $m3u8 = hg_set_stream_url($live_wowzaip_output, $app_name, $stream_name, $m3u8_type);
                             }
                         }
                         //直播
                         if ($live_wowzaip_output && $channel['is_live']) {
                             $live_url = hg_set_stream_url($live_wowzaip_output, $app_name, $stream_name, $flv);
                             if ($channel['is_mobile_phone']) {
                                 if ($this->settings['signleliveaddr']) {
                                     $live_m3u8 = $this->settings['signleliveaddr'] . $channel['code'] . '.stream/playlist.m3u8';
                                 } else {
                                     $live_m3u8 = hg_set_stream_url($live_wowzaip_output, $app_name, $stream_name, $m3u8_type);
                                 }
                             }
                         } else {
                             $live_url = $url;
                             $live_m3u8 = $m3u8;
                         }
                         //录制
                         if ($record_wowzaip_output && $channel['is_record']) {
                             $record_stream[$kk]['url'] = hg_set_stream_url($record_wowzaip_output, $app_name, $stream_name, $flv);
                             if ($channel['is_mobile_phone']) {
                                 if ($this->settings['signleliveaddr']) {
                                     $record_stream[$kk]['m3u8'] = $this->settings['signleliveaddr'] . $channel['code'] . '.stream/playlist.m3u8';
                                 } else {
                                     $record_stream[$kk]['m3u8'] = hg_set_stream_url($record_wowzaip_output, $app_name, $stream_name, $m3u8_type);
                                 }
                             }
                         } else {
                             $record_stream[$kk]['url'] = $url;
                             $record_stream[$kk]['m3u8'] = $m3u8;
                         }
                         $bitrate = $vv['bitrate'];
                         $channel_stream[] = array('url' => $url, 'name' => $vv['name'], 'stream_name' => $vv['stream_name'], 'm3u8' => $m3u8, 'bitrate' => $bitrate);
                     }
                 }
                 //节目单
                 $program_info = $this->mProgram->getCurrentNextProgram($channel['id']);
                 $cur_program = array('start_time' => $program_info[0]['start'] ? $program_info[0]['start'] : date('H:i'), 'program' => $program_info[0]['theme'] ? $program_info[0]['theme'] : '精彩节目');
                 $next_program = array('start_time' => $program_info[1]['start'] ? $program_info[1]['start'] : date('H:i', TIMENOW + 3600), 'program' => $program_info[1]['theme'] ? $program_info[1]['theme'] : '精彩节目');
                 $return = array('id' => $channel['id'], 'name' => $channel['name'], 'logo' => $logo, 'snap' => $snap, 'm3u8' => $url, 'cur_program' => $cur_program, 'save_time' => $channel['time_shift'], 'next_program' => $next_program, 'audio_only' => $channel['is_audio'], 'aspect' => $channel['aspect'], 'cmid' => $channel['cmid'], 'channel_stream' => $channel_stream);
                 if (($this->input['id'] || $this->input['channel_id']) && $return['id'] && $this->user['user_id'] && $this->input['iscreditsrule']) {
                     $credit_rules = $this->callMemberCreditsRules($this->user['user_id'], APP_UNIQUEID, MOD_UNIQUEID, 0, $return['id']);
                     /**积分文案处理**/
                     $return['copywriting_credit'] = $this->members->copywriting_credit(array($credit_rules));
                 }
                 //统计
                 if ($this->input['need_access']) {
                     include_once ROOT_PATH . 'lib/class/access.class.php';
                     $access_obj = new access();
                     $ret = $access_obj->add_access($return['id'], 0, APP_UNIQUEID, MOD_UNIQUEID, $return['name']);
                 }
                 if ($this->input['ad_group']) {
                     $return['ad'] = $this->getAds($this->input['ad_group'], $return);
                 }
                 $this->addItem($return);
             }
         }
     }
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:channel.php

示例2: get_content_by_rid


//.........这里部分代码省略.........
             }
         }
         $info1 = $info;
         $info1['id'] = $info['id'];
         if ($info['use_maincolumn']) {
             $column_data = $this->column->get_site_column_first(' id,name,site_id,fid,childdomain,father_domain,column_dir,relate_dir,col_con_maketype ', $info['main_column_id']);
             $site_data = $column_data['site_data'];
             $info['content_url'] = $info['outlink'] ? $info['outlink'] : mk_content_url($site_data, $column_data, array('column_id' => $info['main_column_id']) + $info1);
         } else {
             $info['content_url'] = $info['outlink'] ? $info['outlink'] : mk_content_url($site_data, $column_data, $info1);
         }
         $info['column_info'] = $column_data;
         if ($this->input['video2index'] && $result['content_material_list']) {
             foreach ($result['content_material_list'] as $k => $v) {
                 if ($v['app'] == 'livmedia') {
                     $videourl = parse_url($v['video_url']);
                     $info['video'] = array('host' => $videourl['scheme'] . '://' . $videourl['host'], 'dir' => '', 'filepath' => $videourl['path'], 'filename' => '');
                     $info['is_have_video'] = '1';
                     break;
                 }
             }
         }
         if ($this->input['shorturl'] && $this->settings['App_shorturl']) {
             $curl = new curl($this->settings['App_shorturl']['host'], $this->settings['App_shorturl']['dir']);
             $curl->setReturnFormat('str');
             $curl->setSubmitType('post');
             $curl->initPostData();
             $curl->addRequestData('str', $info['content_url']);
             $ret = $curl->request('shorturl.php');
             if ($ret) {
                 $info['content_url'] = $ret;
             }
         }
         if ($this->settings['App_catalog']) {
             //取编目信息
             $catalog_data = array();
             include ROOT_PATH . 'lib/class/catalog.class.php';
             $catalogobj = new catalog();
             $catalog = $catalogobj->get_catalog($info['bundle_id'], $info['module_id'], $info['content_fromid']);
             $result['catalog_new'] = $catalog;
         }
         $result['source'] = isset($result['source']) ? $result['source'] : '';
         $info['source'] = isset($info['source']) ? $info['source'] : $result['source'];
         if ($result) {
             $result = $info + $result;
         } else {
             $result = $info;
         }
         //统计
         if ($this->input['need_access']) {
             include_once ROOT_PATH . 'lib/class/access.class.php';
             $access_obj = new access();
             $fromType = $this->input['fromType'] ? trim($this->input['fromType']) : "";
             $ret = $access_obj->add_access($info['content_id'], $info['column_id'], $info['bundle_id'], $info['module_id'], $info['title'], $info['content_fromid'], $fromType);
         }
         //加广告
         if ($this->input['ad_group']) {
             $r = array();
             $r['id'] = $result['rid'];
             $r['colid'] = $result['column_id'];
             $r['title'] = $result['title'];
             $r['brief'] = $result['brief'];
             $r['keywords'] = $result['keywords'];
             $r['appid'] = $result['appid'];
             $r['appname'] = $result['appname'];
             $r['create_user'] = $result['create_user'];
             $r['publish_user'] = $result['publish_user'];
             $r['group'] = $this->input['ad_group'];
             $result['ad'] = $this->getAds($this->input['ad_group'], $r, $r['colid']);
         }
         //取这条内容发布到的专题
         if ($need_special && $info['content_id']) {
             $sql = "SELECT relation_data FROM " . DB_PREFIX . "content_push WHERE type=1 AND content_id=" . $info['content_id'];
             $content_push = $this->db->query_first($sql);
             if ($content_push) {
                 $special_data = @unserialize($content_push['relation_data']);
                 if ($special_data) {
                     $special_ids = array();
                     foreach ($special_data as $k => $v) {
                         if ($v['special_id'] = intval($v['special_id'])) {
                             $special_ids[] = $v['special_id'];
                         }
                     }
                     if ($special_ids) {
                         include ROOT_PATH . 'lib/class/special.class.php';
                         $special_obj = new special();
                         $special_datas = $special_obj->get_special_by_ids(implode(',', $special_ids));
                         if (is_array($special_datas)) {
                             $result['special_datas'] = $special_datas;
                         }
                     }
                 }
             }
         }
         $this->addItem($result);
         $this->output();
     } else {
         $this->errorOutput('NO_ID');
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:content.php


注:本文中的access::add_access方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。