<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KEN-G.COM &#187; script</title>
	<atom:link href="http://www.ken-g.com/blog/archives/category/script/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ken-g.com</link>
	<description></description>
	<lastBuildDate>Fri, 02 Jul 2010 05:55:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>BLOGの更新時間とタイトル</title>
		<link>http://www.ken-g.com/blog/archives/200402/blog%e3%81%ae%e6%9b%b4%e6%96%b0%e6%99%82%e9%96%93%e3%81%a8%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab.html</link>
		<comments>http://www.ken-g.com/blog/archives/200402/blog%e3%81%ae%e6%9b%b4%e6%96%b0%e6%99%82%e9%96%93%e3%81%a8%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab.html#comments</comments>
		<pubDate>Sun, 01 Feb 2004 16:05:19 +0000</pubDate>
		<dc:creator>KEN-G</dc:creator>
				<category><![CDATA[movable type]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[substr]]></category>

		<guid isPermaLink="false">http://www.ken-g.com/blog/archives/200402/blog%e3%81%ae%e6%9b%b4%e6%96%b0%e6%99%82%e9%96%93%e3%81%a8%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab.html</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>KEN-G.COMの<a href="http://www.ken-g.com/" target="_blank">Indexページ</a>に<br />
BlogのエントリーをMovableTypeのテンプレートとPHPを使って、最新2件表示するようにしました。</p>
<p>MovableTypeのテンプレート設定<br />
エントリーがPostされた時間とタイトルを表示するためのテンプレートを新規に作成<br />
TEMPLATES→Create new index template<br />
Template NameとOutput Fileを設定し、エントリーが追加された時に自動でRebuildされる必要があるので、Rebuild this template automatically when rebuilding index templatesをチェック。</p>
<form><textarea cols="50" rows="7"><br />
<MTEntries lastn="2"><br />
<$MTEntryDate format="%Y/%m/%d %A %H:%M:%S"$><br />
<$MTBlogTimezone$><br />
<a href="blog/index.php#<$MTEntryID pad="1"$>&#8220;><br />
<$MTEntryTitle remove_html="1" encode_xml="1"$></a><br />
</MTEntries><br />
</textarea></form>
<p>
KEN-G.COMのindexページにMovableTypeでPublishされたファイルを読み込み<br />
以下のPHPのスクリプトを表示したい場所に挿入<br />
require／includeでもOKですが、今回は、ファイル操作とsubstr関数を使用しています。<br />
&lt;?php<br />
//ファイルを開く<br />
$blogdate=@fopen(&quot;読み込むファイルのパス&quot;,&quot;r&quot;) or die(&quot;エラーメッセージ&quot;);<br />
//ファイルを読んで内容を$buffに入れる<br />
$buff=fgets($blogdate);<br />
//ファイルを閉じる<br />
fclose($blogdate);<br />
//先頭から読み込む文字数（下記では0〜500文字までを読み込み）<br />
echo substr($buff,0,500);<br />
;?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ken-g.com/blog/archives/200402/blog%e3%81%ae%e6%9b%b4%e6%96%b0%e6%99%82%e9%96%93%e3%81%a8%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cookie制御Javascript</title>
		<link>http://www.ken-g.com/blog/archives/200311/cookie%e5%88%b6%e5%be%a1javascript.html</link>
		<comments>http://www.ken-g.com/blog/archives/200311/cookie%e5%88%b6%e5%be%a1javascript.html#comments</comments>
		<pubDate>Sun, 16 Nov 2003 11:41:10 +0000</pubDate>
		<dc:creator>KEN-G</dc:creator>
				<category><![CDATA[script]]></category>
		<category><![CDATA[javascript_cookie]]></category>

		<guid isPermaLink="false">http://www.ken-g.com/blog/archives/200311/cookie%e5%88%b6%e5%be%a1javascript.html</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Case 01<br />
・Cookieが無い場合、functionを実行<br />
・ブラウザを閉じても、Cookieは消去されない<br />
・消去期限を書き込む</p>
<form>
<textarea cols="50" rows="10"><br />
<SCRIPT TYPE="text/javascript"><br />
<!--<br />
var access = GetCookie("KEN-GACCESS");<br />
var date   = GetCookie("KEN-GDATE");</p>
<p>if(access == ""){access = 0;}</p>
<p>var ndate = new Date();<br />
var year  = ndate.getYear();<br />
var month = ndate.getMonth() + 1;<br />
var day   = ndate.getDate();<br />
var hour  = ndate.getHours();<br />
var min   = ndate.getMinutes();<br />
var sec   = ndate.getSeconds();<br />
if(year < 1900){year += 1900;}<br />
if(month < 10){month = "0" + month;}<br />
if(day < 10){day = "0" + day;}<br />
if(hour < 10){hour = "0" + hour;}<br />
if(min < 10){min = "0" + min;}<br />
if(sec < 10){sec = "0" + sec;}</p>
<p>SetCookie("KEN-GACCESS", ++access);<br />
SetCookie("KEN-GDATE", year + "/" + month + "/" + day + " " + hour + ":" + min + ":" + sec);</p>
<p>function GetCookie(key){<br />
var tmp = document.cookie + ";";<br />
var index1 = tmp.indexOf(key, 0);<br />
if(index1 != -1){<br />
tmp = tmp.substring(index1,tmp.length);<br />
var index2 = tmp.indexOf("=",0) + 1;<br />
var index3 = tmp.indexOf(";",index2);<br />
return(unescape(tmp.substring(index2,index3)));<br />
}<br />
return("");<br />
}<br />
// 有効期限を規定<br />
function SetCookie(key, val){<br />
document.cookie = key + "=" + escape(val) + ";expires=Tue, 14-Oct-2004 03:15:00;";<br />
}<br />
//--><br />
</SCRIPT><br />
<script type="text/javascript">
function popupwin() {
popup_left=(window.screen.width/2)-(788/2+10);
popup_top=(window.screen.height/2)-(468/2+50);
var win = window.open('URL','window name','toolbar=no,location=no,status=no,menubar=no,scrollbars=0,resizable=no,width=788,height=468,left='+popup_left+',top='+popup_top+',screenX='+popup_left+',screenY='+popup_top);
win.focus();
}
</script><br />
<SCRIPT TYPE="text/javascript"><br />
<!--<br />
if(access == 1){ //もしアクセスが1なら実行<br />
popupwin();<br />
}<br />
//--><br />
</SCRIPT><br />
</textarea><br />
</form>
<p>Case 02<br />
・cookieが無い場合、functionを実行<br />
・ブラウザを閉じると、クッキー消去</p>
<form>
<textarea cols="50" rows="10"><br />
<SCRIPT TYPE="text/javascript"><br />
<!--</p>
<p>var access = GetCookie("SITEACCESS");</p>
<p>if(access == ""){access = 0;}</p>
<p>SetCookie("SITEACCESS", ++access);</p>
<p>function GetCookie(key){<br />
var tmp = document.cookie + ";";<br />
var index1 = tmp.indexOf(key, 0);<br />
if(index1 != -1){<br />
tmp = tmp.substring(index1,tmp.length);<br />
var index2 = tmp.indexOf("=",0) + 1;<br />
var index3 = tmp.indexOf(";",index2);<br />
return(unescape(tmp.substring(index2,index3)));<br />
}<br />
return("");<br />
}<br />
function SetCookie(key, val){<br />
document.cookie = key + "=" + escape(val) + ";";<br />
}</p>
<p>function popupwin() {<br />
// クッキーが0の場合、ここに起動したいスクリプトを入れる<br />
}</p>
<p>if(access == 1){<br />
popupwin();<br />
}<br />
//--><br />
</SCRIPT><br />
</textarea><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://www.ken-g.com/blog/archives/200311/cookie%e5%88%b6%e5%be%a1javascript.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pop up Window</title>
		<link>http://www.ken-g.com/blog/archives/200310/pop-up-window.html</link>
		<comments>http://www.ken-g.com/blog/archives/200310/pop-up-window.html#comments</comments>
		<pubDate>Fri, 31 Oct 2003 09:28:30 +0000</pubDate>
		<dc:creator>KEN-G</dc:creator>
				<category><![CDATA[script]]></category>
		<category><![CDATA[popupwindow]]></category>

		<guid isPermaLink="false">http://www.ken-g.com/blog/archives/200310/pop-up-window.html</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>ポップアップウィンドウ（親ウィンドウ操作）<br />
1.新規ウィンドウを画面センターポップアップ。<br />
2.開きもとの親ウィンドウを子ウィンドウから操作<br />
3.親ウインドウが閉じられた場合、新規にウィンドウを開く</p>
<form>
<textarea cols="50" rows="10"><br />
SAMPLE01(normal ver.)</p>
<p><script language="JavaScript">
function WinPopup() {
popup_left=(window.screen.width/2)-(AAA/2+10);
popup_top=(window.screen.height/2)-(BBB/2+50);
var win1 = window.open('index_popup.html','name','toolbar=no,location=no,status=no,menubar=no,scrollbars=0,resizable=no,width=AAA,height=BBB,left='+popup_left+',top='+popup_top+',screenX='+popup_left+',screenY='+popup_top);
win1.focus();
}
</script></p>
<p>SAMPLE02(parent window ver.)</p>
<p><script language="JavaScript">
function WinPopup() {
popup_left=(window.screen.width/2)-(AAA/2+10);
popup_top=(window.screen.height/2)-(BBB/2+50);
window.open('index_popup.html','name','toolbar=no,location=no,status=no,menubar=no,scrollbars=0,resizable=no,width=AAA,height=BBB,left='+popup_left+',top='+popup_top+',screenX='+popup_left+',screenY='+popup_top);
window.self.name="Win_main";
location.href= "http://www.ken-g.com/";
}
</script></p>
<p>under script is in child window</p>
<p><script language="JavaScript" type="text/javascript">
<!--
function openerJump(url) {
app = navigator.appName.charAt(0);
if ((navigator.appVersion.indexOf('Win',0) != -1) &#038;&#038; (app == "M")) {
if ( !window.opener.closed ) {
opener.self.location.href=url;
window.opener.blur();
} else {
window.open(url,"Win_main","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1");
window.self.focus();
}
} else {
if ( openerSur() == true ) {
top.opener.top.location.href=url;
window.top.opener.blur();
} else {
window.open(url,"Win_main","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1");
window.self.focus();
}
}
}
function openerSur() {
var ua = navigator.userAgent;
if( !!window.top.opener ) {
if( ua.indexOf('MSIE 4')!=-1 &#038;&#038; ua.indexOf('Win')!=-1 ) {
return !window.top.opener.closed;
} else {
return typeof window.top.opener.document  == 'object';
}
} else {
return false
}
}
//-->
</script></p>
<p><A href="http://www.ken-g.com/" target="WIN_main" onclick="openerJump('http://www.ken-g.com/')"onFocus="this.blur();">LINK HERE</A><br />
</textarea><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://www.ken-g.com/blog/archives/200310/pop-up-window.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>modifications of Flash, IE</title>
		<link>http://www.ken-g.com/blog/archives/200310/modifications-of-flash-ie.html</link>
		<comments>http://www.ken-g.com/blog/archives/200310/modifications-of-flash-ie.html#comments</comments>
		<pubDate>Mon, 27 Oct 2003 17:53:15 +0000</pubDate>
		<dc:creator>KEN-G</dc:creator>
				<category><![CDATA[script]]></category>
		<category><![CDATA[flash_embed]]></category>

		<guid isPermaLink="false">http://www.ken-g.com/blog/archives/200310/modifications-of-flash-ie.html</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Microsoft 社が<a href="http://msdn.microsoft.com/ieupdate" target="_blank">発表</a>した Internet Explorer 仕様変更に対応するための情報。</p>
<p>仕様変更の影響を受けるのは、HTML内に object、embed、applet タグを使用して、アクティブコンテンツを埋め込んでいる場合。以下が該当する可能性がある。<br />
Flash、Shockwave、Java アプレット、Real、QuickTime、Acrobat、ActiveX コントロール</p>
<p>対処法<br />
・Macromediaからのツールのリリースを待つ。<br />
・object、embedタグの代わりに外部jsを作成しdocument.writeを使い、埋め込みタグを動的に書き出す。外部jsを読み込ませ、Flashを表示したい部分に外部js内のfunctionを呼び出すscriptを入れる。</p>
<p>参考<br />
FlashのPluginの有無、Javascript OFF、versionによる振り分けの組み合わせ。<br />
<textarea cols="50" rows="10"><br />
<script language=JavaScript>
<!--
var plugin = (navigator.mimeTypes &#038;&#038; navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 6; // version
}
else if (navigator.userAgent &#038;&#038; navigator.userAgent.indexOf("MSIE")>=0
&#038;&#038; (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT") || navigator.userAgent.indexOf("Windows XP")>=0)) {
document.write('<SCRIPT LANGUAGE=VBScript¥> ¥n');
document.write('on error resume next ¥n');
document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))¥n');
document.write('</SCRIPT¥> ¥n');
}
if ( plugin ) {
document.write('<OBJECT classid="AAAAAA"');
document.write('  codebase="AAAAAA" ');
document.write(' ID=main WIDTH=000 HEIGHT=000>');
document.write(' <PARAM NAME=movie VALUE="AAAAAA.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  ');
document.write(' <EMBED src="AAAAAA.swf" quality=high bgcolor=#FFFFFF  ');
document.write(' swLiveConnect=FALSE WIDTH=000 HEIGHT=000');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
document.write(' </EMBED>');
document.write(' </OBJECT>');
} else if (!(navigator.appName &#038;&#038; navigator.appName.indexOf("Netscape")>=0 &#038;&#038; navigator.appVersion.indexOf("2.")>=0)){
document.write('<IMG SRC="noflash.gif" WIDTH=000 HEIGHT=000 usemap="#noflash" BORDER=0>');
document.write('
<map name="noflash">MAPをとる場合</map>
<p>');
}
//-->
</script><NOEMBED><br />
<img src="noflash.gif" width="000" height="000" usemap="#noflash" border="0"></p>
<map name="noflash"> MAPをとる場合</map>
<p></NOEMBED> <noscript> <img src="noflash.gif" width="000" height="000" usemap="#noflash" border="0"><br />
</noscript><br />
</textarea></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ken-g.com/blog/archives/200310/modifications-of-flash-ie.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
