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


PHP Channel::get方法代码示例

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


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

示例1: edit

 function edit($ctx)
 {
     _render('form');
     try {
         $channel_id = (string) $_GET['id'] !== '' ? intval($_GET['id']) : '';
         $m = Channel::get($channel_id);
         if (!$m) {
             _redirect($this->_list_url());
             return;
         }
         $wx_info = WxChannelInfo::get($channel_id);
         if ($_POST) {
             $f = $_POST['f'];
             // 生成二维码 每次保存都更新一次 但是如果已经发放了 其实不能更新的 因为会过期 所以,永久的不能更新 临时的更新可以处理
             $expire_type = intval($f['expire_type']);
             $expire_seconds = intval($f['expire_seconds']);
             $expire_seconds = max(0, $expire_seconds);
             $status = intval($f['status']);
             $wx_info = WxChannelInfo::qrcode_create($channel_id, $expire_type, $expire_seconds, $status);
             _redirect($this->_list_url());
         }
         $ctx->wx_info = $wx_info;
         $ctx->m = $m;
     } catch (Exception $e) {
         $msg = $e->getMessage();
         $ctx->errmsg = $msg;
         $ctx->m = $m;
         $ctx->wx_info = $wx_info;
     }
 }
开发者ID:zxw5775,项目名称:yuhunclub,代码行数:30,代码来源:channel.php

示例2: channelInfo

    public function channelInfo()
    {
        if (isset($_GET['channel_disc'])) {
            try {
                $channel = Channel::get($_GET['channel_disc']);
                $view = <<<EOD
<div class="prg_rec_cfg ui-corner-all">
<div class="prg_title">{$channel->name}</div>

<table>
<tr>
  <td>種別</td><td>{$channel->type}</td>
</tr>
<tr>
  <td>物理チャンネル</td><td>{$channel->channel}</td>
</tr>
<tr>
  <td>サービスID</td>
  <td>
<form method="post" action="channelSetSID.php">
<input type="text" name="n_sid" size="20" id="id_sid" value="{$channel->sid}" />
<input type="hidden" name="n_channel_disc" id="id_disc" value="{$channel->channel_disc}" />
</form>
  </td>
</tr>
</table>
</div>
EOD;
                echo $view;
            } catch (Exception $e) {
                echo 'Error:チャンネル情報の取得に失敗';
            }
        }
    }
开发者ID:ha1t,项目名称:epgrec,代码行数:34,代码来源:api.php

示例3: check_channel_subscribe_keyword

 static function check_channel_subscribe_keyword($keyword)
 {
     $channel_info = null;
     $channel_pattern = '#' . self::CHANNEL_SUBSCRIBE_PREFIE . '([a-zA-Z0-9]+)#';
     if (preg_match($channel_pattern, $keyword, $arr)) {
         if (isset($arr[1])) {
             $channel_id = $arr[1];
             // 先尝试根据pcode取
             $channel_info = Channel::get_by_code($channel_id);
             if (!$channel_info) {
                 $channel_info = Channel::get($channel_id);
             }
         }
     }
     return $channel_info;
 }
开发者ID:zxw5775,项目名称:yuhunclub,代码行数:16,代码来源:WxReplyKeyword.php

示例4: get

 function get()
 {
     $profile_uid = intval($_GET['p']);
     $load = argc() > 1 && argv(1) == 'load' ? 1 : 0;
     header("Content-type: text/html");
     echo "<!DOCTYPE html><html><body>\r\n";
     /**
      * We can remove this hack once Internet Explorer recognises HTML5 natively
      */
     echo $_GET['msie'] == 1 ? '<div>' : '<section>';
     /**
      *
      * Grab the page inner contents by calling the content function from the profile module directly, 
      * but move any image src attributes to another attribute name. This is because 
      * some browsers will prefetch all the images for the page even if we don't need them.
      * The only ones we need to fetch are those for new page additions, which we'll discover
      * on the client side and then swap the image back.
      *
      */
     $mod = new Channel();
     $text = $mod->get($profile_uid, $load);
     $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
     $replace = "<img\${1} dst=\"\${2}\"";
     //	$text = preg_replace($pattern, $replace, $text);
     /*
     	if(! $load) {
     		$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
     		$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
     		$text = preg_replace($pattern, $replace, $text);
     		$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
     		$text = preg_replace($pattern, $replace, $text);
     		$pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
     		$text = preg_replace($pattern, $replace, $text);
         	$pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
         	$text = preg_replace($pattern, $replace, $text);
     	}
     */
     /**
      * reportedly some versions of MSIE don't handle tabs in XMLHttpRequest documents very well
      */
     echo str_replace("\t", '       ', $text);
     echo $_GET['msie'] == 1 ? '</div>' : '</section>';
     echo "</body></html>\r\n";
     killme();
 }
开发者ID:phellmes,项目名称:hubzilla,代码行数:45,代码来源:Update_channel.php

示例5: catch

<?php

// 指定のチャンネルのsidを変更する
require_once 'config.php';
if (isset($_POST['sid']) && isset($_POST['channel_disc'])) {
    try {
        $channel = Channel::get($_POST['channel_disc']);
        $channel->setSID($_POST['sid']);
    } catch (Exception $e) {
        throw $e;
    }
}
开发者ID:ha1t,项目名称:epgrec,代码行数:12,代码来源:channelSetSID.php

示例6: WEEKDAY

        $weekofday = $_POST['weekofday'];
        if ($weekofday != 7) {
            $options .= " AND WEEKDAY(starttime) = '" . $weekofday . "'";
        }
    }
}
$options .= " ORDER BY starttime ASC LIMIT 100";
$do_keyword = 0;
if ($search != "" || $type != "*" || $category_disc !== false || $station != 0) {
    $do_keyword = 1;
}
try {
    $db = DB::conn();
    $programs = Program::search($options, $args);
    foreach ($programs as $key => $program) {
        $channel = Channel::get($program['channel_disc']);
        $programs[$key]['station_name'] = $channel->name;
    }
} catch (Exception $e) {
    throw $e;
}
try {
    $k_category_name = "";
    $categories = $db->rows('SELECT * FROM ' . Category::TABLE);
    $first_category = array('id' => 0, 'name' => "すべて", 'selected' => $category_disc === false ? "selected" : "");
    foreach ($categories as $key => $category) {
        $categories[$key]['name'] = $category['name_jp'];
        $categories[$key]['selected'] = $category['category_disc'] === $category_disc ? "selected" : "";
        if ($category['category_disc'] === $category_disc) {
            $k_category_name = $category['name_jp'];
        }
开发者ID:ha1t,项目名称:epgrec,代码行数:31,代码来源:search.php

示例7: array

} else {
    if ($type == "GR") {
        $channel_map = ChannelMaster::$GR;
    } else {
        if ($type == "CS") {
            $channel_map = $CS_CHANNEL_MAP;
        }
    }
}
$db = DB::conn();
$st = 0;
$programs = array();
foreach ($channel_map as $channel_disc => $no_use) {
    $prev_end = $top_time;
    try {
        $channel = Channel::get($channel_disc);
        $items = $db->rows('SELECT * FROM Recorder_programTbl WHERE channel_disc = ? AND endtime > ? AND starttime < ? ORDER BY starttime ASC', array($channel_disc, date('Y-m-d H:i:s', $top_time), date('Y-m-d H:i:s', $last_time)));
        $programs[$st]["station_name"] = $channel->name;
        $programs[$st]["channel_disc"] = $channel->channel_disc;
        $programs[$st]['list'] = array();
        $num = 0;
        foreach ($items as $program) {
            // 前プログラムとの空きを調べる
            $start = strtotime($program['starttime']);
            if ($start - $prev_end > 0) {
                $height = ($start - $prev_end) * $settings->height_per_hour / 3600;
                $programs[$st]['list'][$num]['category_none'] = "none";
                $programs[$st]['list'][$num]['height'] = $height;
                $programs[$st]['list'][$num]['title'] = "";
                $programs[$st]['list'][$num]['starttime'] = "";
                $programs[$st]['list'][$num]['description'] = "";
开发者ID:ha1t,项目名称:epgrec,代码行数:31,代码来源:index.php


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