changeset 125:ef3df87f3c7d

mod: チャンネルスキップの大まかな実装終了
author Sushi-k <epgrec@park.mda.or.jp>
date Wed, 17 Mar 2010 18:12:01 +0900
parents aa48eb5f1993
children b491e7136044
files channelSetSID.php storeProgram.inc.php templates/index.html
diffstat 3 files changed, 27 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/channelSetSID.php	Wed Mar 17 01:34:26 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?php
-include_once('config.php');
-include_once( INSTALL_PATH . "/DBRecord.class.php" );
-include_once( INSTALL_PATH . "/Settings.class.php" );
-
-
-if( isset($_POST['sid']) && isset($_POST['channel_disc']) ) {
-	
-	try {
-		$crec = new DBRecord( CHANNEL_TBL, "channel_disc", $_POST['channel_disc'] );
-		$crec->sid = trim($_POST['sid']);
-	}
-	catch( Exception $e ) {
-		// ∴
-	}
-}
-?>
\ No newline at end of file
--- a/storeProgram.inc.php	Wed Mar 17 01:34:26 2010 +0900
+++ b/storeProgram.inc.php	Wed Mar 17 18:12:01 2010 +0900
@@ -29,6 +29,7 @@
 
 function storeProgram( $type, $xmlfile ) {
 	global $BS_CHANNEL_MAP, $GR_CHANNEL_MAP, $CS_CHANNEL_MAP;
+	
 	// c潟<ゃ羣
 	$map = array();
 	if( $type == "BS" ) $map = $BS_CHANNEL_MAP;
@@ -71,10 +72,21 @@
 	// programme 緇
 	
 	foreach( $xml->programme as $program ) {
+		$channel_rec = null;
+		
 		$channel_disc = $program['channel']; 
 		if( ! array_key_exists( "$channel_disc", $map ) ) continue;
+		$channel = $map["$channel_disc"];
 		
-		$channel = $map["$channel_disc"];
+		try {
+			$channel_rec = new DBRecord(CHANNEL_TBL, "channel_disc", "$channel_disc" );
+		}
+		catch( Exception $e ) {
+			// ∴
+		}
+		if( $channel_rec == null ) continue;	// 緇莎激
+		if( $channel_rec->skip == 1 ) continue;	// 篆<c潟
+		
 		$starttime = str_replace(" +0900", '', $program['start'] );
 		$endtime = str_replace( " +0900", '', $program['stop'] );
 		$title = $program->title;
@@ -101,8 +113,7 @@
 		 }
 		 else
 			$cat_rec = new DBRecord(CATEGORY_TBL, "category_disc" , $category_disc );
-		  //
-		 $channel_rec = new DBRecord(CHANNEL_TBL, "channel_disc", $channel_disc );
+		 //
 		 $num = DBRecord::countRecords(PROGRAM_TBL, "WHERE program_disc = '".$program_disc."'" );
 		 if( $num == 0 ) {
 			// 域腟
--- a/templates/index.html	Wed Mar 17 01:34:26 2010 +0900
+++ b/templates/index.html	Wed Mar 17 18:12:01 2010 +0900
@@ -91,14 +91,15 @@
 			str += '</div>';
 			str += '<form method="post" action="setChannelInfo.php">';
 			// 鴻
-			str += '<div class="prg_channel"><span class="labelLeft">c潟荀眼鐚</span>';
+			str += '<div class="prg_channel"><span class="labelLeft">荀眼鐚</span>';
+			str += '<span>';
 			if( skip == 1 ) {
 				str += '<input type="checkbox" name="n_skip_name" id="id_ch_skip" value="'+skip+'" checked />';
 			}
 			else {
 				str += '<input type="checkbox" name="n_skip_name" id="id_ch_skip" value="'+skip+'" />';
 			}
-			str += '</div>';
+			str += '</span></div>';
 			// 泣若ID
 			str += '<div class="prg_channel"><span class="labelLeft">泣若ID鐚</span>';
 			str += '<span><input type="text" name="n_sid" size="20" id="id_sid" value="';
@@ -125,17 +126,18 @@
 			var v_channel_disc = $('#id_disc').val();
 			var v_hash = $('#id_hash').val();
 			var v_skip = $('#id_ch_skip').attr('checked');
-			
+			var n_skip = v_skip ? 1 : 0;
+
 			$.post('setChannelInfo.php', { channel_disc: v_channel_disc,
 						      sid: v_sid,
-						      skip: v_skip
+						      skip: n_skip
 						    }, function(data) {
 				if(data.match(/^error/i)){
 					alert(data);
 				}
 				else {
 					var old_skip = $('#ch_title_'+v_hash+' .ch_skip').html();
-					if( old_skip != v_skip ) {
+					if( old_skip != n_skip ) {
 						if( v_skip ) {
 							(INISet.num_ch)--;
 							$('#ch_title_'+v_hash ).addClass('ch_title_skip');
@@ -148,6 +150,7 @@
 							$('#tv_chs_'+v_hash ).removeClass('ch_set_skip');
 							$('#ch_title_'+v_hash+' .ch_skip').html('0');
 						}
+						if( PRG.F_Skip == 1 ) PRG.chSkipHide();
 					}
 				}
 				$('#channelDialog').dialog('close');
@@ -247,7 +250,7 @@
 			tvtimes_scroll();
 			$('#ch_title_bar div.ch_title_skip').show();
 			$('#tv_chs div.ch_set_skip').show();
-			this.F_Skip = 0;
+			nowBar.INI();
 		},
 		chSkipHide:function() {
 			$('#ch_title_bar div.ch_title_skip').hide();
@@ -256,14 +259,16 @@
 			$('#tv_chs').width( INISet.num_ch * INISet.ch_width );
 			$('#tvtimes2').css( { left: INISet.num_ch * INISet.ch_width  + 40 }).show();
 			tvtimes_scroll();
-			this.F_Skip = 1;
+			nowBar.INI();
 		},
 		toggle:function() {
 			if( this.F_Skip ) {
 				this.chSkipShow();
+				this.F_Skip = 0;
 			}
 			else {
 				this.chSkipHide();
+				this.F_Skip = 1;
 			}
 		}
 	}
@@ -392,7 +397,7 @@
 		DG.dialog('close');
 
 		var DG2 = $('#channelDialog');
-		DG2.dialog({title:'c潟',width:600});
+		DG2.dialog({title:'c潟',width:480});
 		DG2.dialog('close');
 
 //		PRG.toggle();