g4s merge 충돌 수정
This commit is contained in:
@ -998,7 +998,7 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
|
||||
if ($config['cf_use_member_icon'] == 2) // 회원아이콘+이름
|
||||
$tmp_name = $tmp_name.' '.$name;
|
||||
} else {
|
||||
$tmp_name = $tmp_name.' '.$name;
|
||||
$tmp_name = $tmp_name." ".$name;
|
||||
}
|
||||
} else {
|
||||
$tmp_name = $tmp_name.' '.$name;
|
||||
@ -2038,4 +2038,37 @@ function board_notice($bo_notice, $wr_id, $insert=false)
|
||||
}
|
||||
return implode(",", $notice_array);
|
||||
}
|
||||
|
||||
|
||||
// goo.gl 짧은주소 만들기
|
||||
function googl_short_url($longUrl)
|
||||
{
|
||||
global $config;
|
||||
|
||||
// Get API key from : http://code.google.com/apis/console/
|
||||
// URL Shortener API ON
|
||||
$apiKey = $config['cf_googl_shorturl_apikey'];
|
||||
|
||||
$postData = array('longUrl' => $longUrl, 'key' => $apiKey);
|
||||
$jsonData = json_encode($postData);
|
||||
|
||||
$curlObj = curl_init();
|
||||
|
||||
curl_setopt($curlObj, CURLOPT_URL, 'https://www.googleapis.com/urlshortener/v1/url');
|
||||
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($curlObj, CURLOPT_HEADER, 0);
|
||||
curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content-type:application/json'));
|
||||
curl_setopt($curlObj, CURLOPT_POST, 1);
|
||||
curl_setopt($curlObj, CURLOPT_POSTFIELDS, $jsonData);
|
||||
|
||||
$response = curl_exec($curlObj);
|
||||
|
||||
//change the response json string to object
|
||||
$json = json_decode($response);
|
||||
|
||||
curl_close($curlObj);
|
||||
|
||||
return $json->id;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user