七行プログラミング (452レス)
七行プログラミング http://medaka.5ch.net/test/read.cgi/php/1036141603/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
438: nobodyさん [sage] 2007/12/01(土) 02:02:19 ID:??? 月次移動可能なカレンダー。c.phpで保存。 <?php $a=q("Y-m-t","$_GET[y]-1");$d=explode("-",$a);$y="<a href=?y=";$v=$d[0]; $w=$d[1];$z="</tr><tr>";$m="$v-$w";$p=q("Y-m",$w-1,1,$v);$n=q("Y-m",$w+1,1,$v) ;echo"<html>$y$p><</a>$m$y$n>></a> $y c.php>now</a><table border=1><tr>$z";$f= q("w","$m-1");for($i=-6-$f;$i<$d[2]-q("w",$a)+7;$i++){echo($i<1-$f)?"<th>".q( "D",$w,$i,$v)."</th>":(($i<1||$i>$d[2])?"<td></td>":"<td>$i</td>");if(($i+$f)% 7==0)echo$z;}echo"</tr></table></html>";function q($x,$w,$i=0,$v=0){return($i) ?date($x,mktime(0,0,0,$w,$i,$v)):date($x,strtotime($w));}?> http://medaka.5ch.net/test/read.cgi/php/1036141603/438
439: nobodyさん [sage] 2007/12/06(木) 09:44:33 ID:??? >>438 「now」も要らんと思う。 <?php list($v,$w,$d)=explode("-",$a=q("$_GET[y]-1","Y-m-t"));$f=q("$v-$w-1","w" );echo$l="<a href=?y=",q($w-1,"Y-m",1,$v),"><</a>$v-$w$l",q($w+1,"Y-m",1,$v) ,">></a> $l>now</a><table><tr>";for($i=-6-$f;$i<$d-q($a,"w")+7;){echo$i<1-$f ?"<th>".q($w,"D",$i,$v)."</th>":"<td>".(($i<1||$i>$d)?"":$i)."</td>";if(($i++ + $f)%7==0)echo"</tr><tr>";}function q($w,$x,$i=0,$v=0){return date($x,$i?mktime( 0,0,0,$w,$i,$v):strtotime($w));}?></tr></table> PHPは不得手なんで、これよりもっと縮む筈。 http://medaka.5ch.net/test/read.cgi/php/1036141603/439
440: 438 [sage] 2007/12/08(土) 01:17:01 ID:??? >>439 凄いですね。いろんなことができるんだ、と感心しきり。 少しだけ縮めた。 <?php list($v,$w,$d)=explode("-",$a=q("$_GET[y]-1","Y-m-t"));$f=q("$v-$w-1","w" );echo$l="<a href=?y=",q($w-1,"Y-m",1),"><</a>$v-$w$l",q($w+1,"Y-m",1),">></a> $l>now</a><table><tr>";for($i=-6-$f;$i<$d-q($a,"w")+7;){echo$i<1-$f?"<th>".q($w ,"D",$i)."</th>":"<td>".($i<1||$i>$d?"":$i)."</td>";if(($f+$i++)%7==0)echo"</tr ><tr>";}function q($w,$x,$i=0){global$v;return date($x,$i?mktime(0,0,0,$w,$i,$v ):strtotime($w));}?></tr></table> http://medaka.5ch.net/test/read.cgi/php/1036141603/440
441: 438 [sage] 2007/12/08(土) 02:02:58 ID:??? 手抜きバージョン。取り合えず表示されるみたいなので… <?php function q($w,$x,$i=0){global$v;return date($x,$i?mktime(0,0,0,$w,$i,$v): strtotime($w));}list($v,$w,$d)=explode("-",$a=q("$_GET[y]-1","Y-m-t"));echo$l=" <a href=?y=",q($w-1,"Y-m",1),"><</a>$v-$w$l",q($w+1,"Y-m",1),">></a> $l>now</a> <table><tr>";for($i=-6-$f=q("$v-$w-1","w");$i<32;){echo$i<1-$f?"<th>".q($w,"D", $i)."</th>":"<td>".($i<1||$i>$d?"":$i)."</td>";if(($f+$i++)%7==0)echo"</tr><tr> ";}?></tr></table> http://medaka.5ch.net/test/read.cgi/php/1036141603/441
442: 438 [sage] 2007/12/08(土) 02:37:04 ID:??? HTMLダメダメの超手抜きバージョン。無理やり5行にしてみた。 <?php list($v,$w,$d)=explode("-",q("$_GET[y]-1","Y-m-t"));echo$l="<a href=?y=", q($w-1,"Y-m",1),"><</a>$v-$w$l",q($w+1,"Y-m",1),">></a> $l>now</a><table>";for( $i=-6-$f=q("$v-$w-1","w");$i<32;){echo$i<1-$f?"<th>".q($w,"D",$i)."</th>":"<td> ".($i<1||$i>$d?"":$i)."</td>";if(($f+$i++)%7==0)echo"</tr><tr>";}function q($w, $x,$i=0){global$v;return date($x,$i?mktime(0,0,0,$w,$i,$v):strtotime($w));}?> http://medaka.5ch.net/test/read.cgi/php/1036141603/442
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.024s