if (PHP_VERSION >= '5.1.0') {
//if (function_exists("date_default_timezone_set")) date_default_timezone_set("Asia/Seoul");
date_default_timezone_set("Asia/Seoul");
}
$config["push_server"] = "www.pushwing.com";
$config["mysql_id"] = "디비아이디";
$config["mysql_password"] = "디비 비번";
$config["client_id"] = "클라이언트 코드";
$hp = "휴대폰번호"; // 푸시 받을 휴대폰 번호를 입력합니다.
$subject_msg = $obj->title;
$content_msg = "블로그에 새글이 작성되었습니다. 웹사이트바로가기를 눌러주세요.";
$url = "http://블로그도메인/". $output->get('document_srl');
$idata = array(
"hp" => $hp,
"client_id" => $config["client_id"],
"subject" => $subject_msg,
"contents" => $content_msg,
"url" => $url,
"ymd" => date("ymd"),
"time" => date("H")
);
function send_pushwing($config, $idata)
{
$columns = "";
$values = "";
foreach($idata as $column => $value)
{
$columns .= $column . ", ";
$values .= ("'" . $value . "', ");
}
$con = mysql_connect($config["push_server"], $config["mysql_id"], $config["mysql_password"]);
mysql_select_db("pushwing", $con);
mysql_query("set names utf8");
mysql_query(sprintf("INSERT INTO push_wait (%s timestamp) VALUES (%s UNIX_TIMESTAMP())", $columns, $values));
mysql_close($con);
}
send_pushwing($config,$idata);
코멘트 작성 시 ( procBoardInsertComment )
if (PHP_VERSION >= '5.1.0') {
//if (function_exists("date_default_timezone_set")) date_default_timezone_set("Asia/Seoul");
date_default_timezone_set("Asia/Seoul");
}
$config["push_server"] = "www.pushwing.com";
$config["mysql_id"] = "디비 아이디";
$config["mysql_password"] = "디비 비번";
$config["client_id"] = "클라이언트코드";
$hp = "휴대폰번호"; // 푸시 받을 휴대폰 번호
$subject_msg = $obj->title;
if($subject_msg=="")
{
$subject_msg = "블로그에 새 코멘트가 작성되었습니다. 웹사이트바로가기를 눌러주세요.";
}
$content_msg = "블로그에 새 코멘트가 작성되었습니다. 웹사이트바로가기를 눌러주세요.";
$url = "http://블로그도메인/". $obj->document_srl;
$idata = array(
"hp" => $hp,
"client_id" => $config["client_id"],
"subject" => $subject_msg,
"contents" => $content_msg,
"url" => $url,
"ymd" => date("ymd"),
"time" => date("H")
);
function send_pushwing($config, $idata)
{
$columns = "";
$values = "";
foreach($idata as $column => $value)
{
$columns .= $column . ", ";
$values .= ("'" . $value . "', ");
}
$con = mysql_connect($config["push_server"], $config["mysql_id"], $config["mysql_password"]);
mysql_select_db("pushwing", $con);
mysql_query("set names utf8");
mysql_query(sprintf("INSERT INTO push_wait (%s timestamp) VALUES (%s UNIX_TIMESTAMP())", $columns, $values));
mysql_close($con);
}
send_pushwing($config,$idata);