mimikakimemo

自分用メモ。

epgrec assist の導入

epgrec assist を入れると epgrec の UI がいい感じになるらしい。というわけで導入。

以下に作業ログを書いておくが、公式ページにちゃんとした説明が書いてあるのでそれに従えばよい。

インストール

まず最新版(現在は 0.1.2)の ZIP をダウンロードして展開し、中にある assist ディレクトリを epgrec ディレクトリに入れる。/var/www/epgrec/assist/ のような感じ。

あとはテンプレート末尾の </body> タグ直前に次の scipt 要素を挿入。

<script type="text/javascript" src="assist/js/epgrec_assist.js"></script>

具体的には以下の4ファイルを編集する。

番組表
epgrec/templates/index.html
録画済一覧
epgrec/templates/recordedTable.html
録画予約一覧
epgrec/templates/reservationTable.html
検索
epgrec/templates/programTable.html

これだけでOK。

設定

epgrec/assist/js/epgrec_assist.js の冒頭で少し設定をいじれるようになっている。

ASSIST_INI.time_ap を 0 に変更し、24時間表示にしておいた。

独自拡張

録画済一覧で番組の長さを表示

epgrec/recordedTable.php
@@ -57,6 +57,7 @@
 		$arr['station_name'] = $ch->name;
 		$arr['starttime'] = $r->starttime;
 		$arr['endtime'] = $r->endtime;
+		$arr['duration'] = strtotime($r->endtime) - strtotime($r->starttime);
 		$arr['asf'] = "".$settings->install_url."/viewer.php?reserve_id=".$r->id;
 		$arr['title'] = htmlspecialchars($r->title,ENT_QUOTES);
 		$arr['description'] = htmlspecialchars($r->description,ENT_QUOTES);
epgrec/templates/recordedTable.html
@@ -180,7 +180,7 @@
  </tr>
 
 {foreach from=$records item=rec }
- <tr id="resid_{$rec.id}" class="ctg_{$rec.cat}">
+ <tr id="resid_{$rec.id}" class="ctg_{$rec.cat}" data-dur="{$rec.duration}">
   <td>{$rec.starttime}</td>
   <td>{$rec.station_name}</td>
   <td>{$rec.mode}</td>

録画予約一覧でチャンネル名を表示

epgrec/reservationTable.php
@@ -9,8 +9,10 @@
 	$reservations = array();
 	foreach( $rvs as $r ) {
 		$cat = new DBRecord(CATEGORY_TBL, "id", $r->category_id );
+		$ch  = new DBRecord(CHANNEL_TBL,  "id", $r->channel_id );
 		$arr = array();
 		$arr['id'] = $r->id;
+		$arr['station_name'] = $ch->name;
 		$arr['type'] = $r->type;
 		$arr['channel'] = $r->channel;
 		$arr['starttime'] = $r->starttime;
epgrec/templates/reservationTable.html
@@ -144,7 +144,7 @@
  </tr>
 
 {foreach from=$reservations item=reserve}
- <tr id="resid_{$reserve.id}" class="ctg_{$reserve.cat}">
+ <tr id="resid_{$reserve.id}" class="ctg_{$reserve.cat}" data-chname="{$reserve.station_name}">
   <td>{$reserve.id}</td>
   <td>{$reserve.type}</td>
   <td id="chid_{$reserve.id}">{$reserve.channel}</td>