當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。