This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
使用方法 | |
$('input[name="date"]').dateSelector({ | |
format:'y-m-d', //日付選択後、hiddenフォームに入る日付の形式。「y」「m」「d」(すべて小文字)がそれぞれ置換されます | |
date:'today', //初期表示日付。yyyy-mm-ddまたはyyyy/mm/ddまたは「today」もしくは「now」に対応 | |
year:'2000,+2' //年の範囲。「最小年,最大年」の形式で、年そのものか、「+2(年)」「-3(年)」に対応 | |
block:false, //年、月、日のプルダウンがまとまったものをブロック要素(div)にするか、インライン要素(span)にするか | |
before:false, //hiddenフォームの前に挿入する場合はtrue | |
onchange:function(y,m,d){} //各プルダウンの選択後(全て値が入っている場合)に実行する関数。年、月、日の数値が渡される | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
TwitterのNotification Bar風のやつ | |
【使い方】 | |
<button onclick="$.notifyBar('表示したい文字');return false;">押して</button> | |
<a href="#" onclick="$.notifyBar('表示したい文字','warning');return false;">ここクリック</a> | |
など |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function shorten($arg){ | |
if(empty($arg)){ | |
return NULL; | |
} | |
static $_out; | |
if(!empty($_out[$arg])){ | |
return $_out[$arg]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function complementary($hex){ | |
static $_out; | |
if(!empty($_out[$hex])){ | |
return $_out[$hex]; | |
} | |
$_out=array(); | |
$in=(strpos($hex,'#')===0) ? substr($hex,1) : $hex; | |
$in=strtoupper($in); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function str_wordwrap($str,$max=NULL,$indent=NULL,$firstindent=true,$charset='utf8'){ | |
$max=(empty($max) ? 74 : (($max%2==0) ? $max-1 : $max)); | |
$str=str_replace("\r\n","\n",$str); | |
$sindent=mb_convert_encoding($indent,'sjis',$charset); | |
$ilen=(!empty($indent)) ? strlen($sindent) : 0; | |
$arr=array(); | |
$out=NULL; | |
foreach(explode("\n",$str) as $line){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var adoModal_initialized=false; | |
$.fn.extend({ | |
adoModal:function(options){ | |
if($.browser.msie && $.browser.version<=6){ | |
return false; | |
} | |
options=$.extend({ | |
fade:100, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var u='/redirect/path.html';//リダイレクト先のURL | |
var mes='スマートフォン用サイトに移動しますか?';//アラートのメッセージ | |
var cn='smartphone_redirect_canceled';//Cookie名 | |
var cm=60;//Cookieのキャッシュ時間(分) | |
var cp='/';//Cookieのパス | |
var ua=navigator.userAgent; | |
//スマホページから来た場合は表示しない | |
if(document.referrer && document.referrer.indexOf(u)!=-1){ | |
//Cookieに書き込む |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sitemap_send($urls=NULL){ | |
if(empty($urls)){ | |
return NULL; | |
} | |
$pings=array( | |
'google'=>array( | |
'ping'=>'http://www.google.com/webmasters/sitemaps/ping?sitemap=', | |
'reg'=>'/successfully added/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER // | |
DROP FUNCTION IF EXISTS `CONVERT_JPNUM`// | |
CREATE FUNCTION `CONVERT_JPNUM`(`_amount` INT) RETURNS varchar(50) COMMENT '数値を日本の形式で返す' | |
BEGIN | |
DECLARE _oku INT UNSIGNED; | |
DECLARE _man INT UNSIGNED; | |
DECLARE _etc INT UNSIGNED; | |
DECLARE _res VARCHAR(50) DEFAULT ''; | |
SET _oku=IF(_amount>=100000000,FLOOR(_amount/100000000),NULL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER // | |
DROP FUNCTION IF EXISTS `YOUBI`// | |
CREATE FUNCTION YOUBI( _DATE_ VARCHAR(20)) RETURNS CHAR(1) | |
LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA | |
BEGIN | |
DECLARE w TINYINT(1) UNSIGNED; | |
DECLARE you CHAR(1); | |
SET w=CASE | |
WHEN _DATE_ REGEXP '^[0-9]{10}$' THEN FROM_UNIXTIME(_DATE_,'%w') |