本文整理汇总了PHP中getJSON函数的典型用法代码示例。如果您正苦于以下问题:PHP getJSON函数的具体用法?PHP getJSON怎么用?PHP getJSON使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getJSON函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actEdit
function actEdit()
{
global $ST, $get;
$field = array('u_id' => $get->getInt('id'), 'login' => '', 'status' => 1, 'name' => '', 'company' => '', 'last_name' => '', 'first_name' => '', 'middle_name' => '', 'phone' => '', 'city' => '', 'address' => '', 'street' => '', 'house' => '', 'flat' => '', 'porch' => '', 'floor' => '', 'mail' => '', 'avat' => '', 'balance' => 0, 'discount' => 0, 'type' => '', 'other_info' => '');
$other_info = array('inn' => '');
if ($field['u_id']) {
$rs = $ST->select("SELECT " . join(',', array_keys($field)) . " FROM sc_users WHERE u_id=" . $field['u_id']);
if ($rs->next()) {
$field = $rs->getRow();
if ($oi = getJSON($field['other_info'])) {
$field = array_merge($field, $oi);
}
if (in_array($field['type'], array('partner'))) {
$rs = $ST->select("SELECT * FROM sc_partner_data WHERE userid=" . $field['u_id']);
if ($rs->next()) {
$field['ank'] = $rs->getRow();
$field['ank']['flowers'] = @unserialize($field['ank']['flowers']);
}
}
}
}
$field['ank_flowers'] = $this->enum('ank_flowers');
$field['groups'] = $this->enum('u_type');
$this->explorer[] = array('name' => 'Редактировать');
$this->display($field, dirname(__FILE__) . '/users_edit.tpl.php');
}
示例2: actULogin
/**
* http://ulogin.ru/constructor.php
*
*/
function actULogin()
{
$s = file_get_contents('http://ulogin.ru/token.php?token=' . $_POST['token'] . '&host=' . $_SERVER['HTTP_HOST']);
$user = getJSON($s);
//$user['network'] - соц. сеть, через которую авторизовался пользователь
//$user['identity'] - уникальная строка определяющая конкретного пользователя соц. сети
//$user['first_name'] - имя пользователя
//$user['last_name'] - фамилия пользователя
my_session_start();
$login = $user['network'] . $user['uid'];
$rs = DB::select("SELECT * FROM sc_users WHERE login='{$login}'");
$data = array('name' => "{$user['first_name']} {$user['last_name']}");
if ($rs->next()) {
DB::update('sc_users', $data, "u_id={$rs->getInt('u_id')}");
$_SESSION['_USER']['u_id'] = $rs->getInt('u_id');
$this->setUser($rs->getRow());
} else {
$data['login'] = $login;
$data['type'] = 'user';
$id = DB::insert('sc_users', $data);
$_SESSION['_USER']['u_id'] = $id;
$this->setUser($data);
}
header('Location: /');
exit;
}
示例3: __construct
public function __construct()
{
$this->projects = getJSON('projects.php');
if (file_exists(BASE_PATH . "/data/" . $_SESSION['user'] . '_acl.php')) {
$this->assigned = getJSON($_SESSION['user'] . '_acl.php');
}
}
示例4: Load
public function Load()
{
if (!file_exists(DATA . "/settings.php")) {
saveJSON('settings.php', array($this->username => array('codiad.username' => $this->username)));
}
$settings = getJSON('settings.php');
echo formatJSEND("success", $settings[$this->username]);
}
示例5: getOwnDictionary
function getOwnDictionary()
{
if (!file_exists(DATA . "/config/" . USERDIC)) {
return "";
}
$content = getJSON(USERDIC, "config");
return $content['dictionary'];
}
示例6: centerMap
function centerMap($location)
{
$rawjson = getJSON($location);
$json = json_decode($rawjson);
$general_lat = $json->results[0]->geometry->location->lat;
$general_lng = $json->results[0]->geometry->location->lng;
return $general_lat . " " . $general_lng;
}
示例7: requireParam
function requireParam($argName)
{
$body = getJSON();
if (!isset($body) || !property_exists($body, $argName)) {
error('Missing parameter: ' . $argName, 501);
return;
}
return $body->{$argName};
}
示例8: getJSON
public function getJSON()
{
$o_return = array();
if (!is_null($this->is_type)) {
$o_return["push_notification_type"] = $this->is_type;
}
if (!is_null($this->io_settlement_batch)) {
$o_return["push_notification_settlement_batch"] = $this->io_settlement_batch . getJSON();
}
if (!is_null($this->io_bank_account_transaciton)) {
$o_return["push_notification_bank_account_transaction"] = $this->io_bank_account_transaciton . getJSON();
}
return $o_return;
}
示例9: open
public function open()
{
$this->existDir();
$msg = array();
$msg['content'] = json_encode(getJSON($this->getFileName(), "config"));
$msg['name'] = basename($this->getFileName(), ".php") . ".json";
$msg['mtime'] = filemtime($this->getFilePath());
if ($msg['content'] !== false) {
$msg['status'] = "success";
} else {
$msg['status'] = "error";
$msg['message'] = "Failed to open file!";
}
return json_encode($msg);
}
示例10: getByIp
public function getByIp($ip)
{
if (count(explode(".", $ip)) != 4) {
return getJSON($this->err['wrong_ip']);
}
$ip = $this->padIP($ip);
if (!$ip) {
return $this->getJSON($this->err['wrong_ip']);
}
$this->get_by_ip->execute(array(":ip" => $ip));
$rs = $this->get_by_ip->fetch(PDO::FETCH_ASSOC);
if (!$rs) {
return $this->getJSON($this->err['no_ip']);
}
$answer = array("country_code" => $rs['country_code'], "country_name" => $rs['country_name'], "isp_name" => $rs['isp_name'], "range" => array("start" => $this->padIP($rs['ipv4_range_start'], true), "end" => $this->padIP($rs['ipv4_range_end'], true)));
return $this->getJSON($answer);
}
示例11: Authenticate
public function Authenticate()
{
$pass = false;
$this->EncryptPassword();
$users = getJSON('users.php');
foreach ($users as $user) {
if ($user['username'] == $this->username && $user['password'] == $this->password) {
$pass = true;
$_SESSION['user'] = $this->username;
if ($user['project'] != '') {
$_SESSION['project'] = $user['project'];
}
}
}
if ($pass) {
echo formatJSEND("success", array("username" => $this->username));
} else {
echo formatJSEND("error", "Incorrect Username or Password");
}
}
示例12: KeywordLink_insTB
function KeywordLink_insTB($target, $mother)
{
global $configVal;
requireComponent('Textcube.Function.misc');
$data = setting::fetchConfigVal($configVal);
if (!$data['apikey']) {
return $target . "<p><font color=red>※API 키가 입력되어있지 않습니다 by KeywordLink Plugin※</font></p>";
} else {
$apikey = $data['apikey'];
}
$obj = getJSON($target, $apikey);
//JSON결과 OBJ변수에 담기
$itemCount = $obj->itemCount;
//키워드 문맥 추출 결과 총 갯수
// 본문 키워드 추출후 카운트 갯수에 따라 테이블 줄수를 증가시켜 출력
if ($itemCount > 0) {
$target = $target . "\r\n\t\t\t<p>\r\n\t\t\t<table border=0 cellpadding=0 cellspacing=0> \r\n \r\n\r\n\t\t\t<table border=0 cellpadding=5 cellspacing=1> \r\n\t\t\t<tr>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>키워드</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>중요도</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>반복 횟수</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>키워드 위치</font></td>\r\n\t\t\t</tr>";
for ($i = 0; $i < $itemCount; $i++) {
$target .= "<td bgcolor=white width=110>" . $obj->items[$i]->keyword . "</td>";
$target .= "<td bgcolor=white width=110><center>" . $obj->items[$i]->score . "</td>";
$target .= "<td bgcolor=white width=110><center>" . $obj->items[$i]->count . "</center></td>";
$locationCount = $obj->items[$i]->count;
if ($locationCount > 1) {
for ($j = 0; $j < $locationCount; $j++) {
$target .= "<td><center>" . $obj->items[$i]->locations[$j] . "</center></td>";
}
} else {
$target .= "<td><center>" . $obj->items[$i]->locations[0] . "</center></td>";
}
$target .= "</tr>";
}
//}
$target = $target . "</table>";
} else {
return $target . '<p><font color=red>※키워드 추출 결과 : 결과값이 없습니다※</font></p>';
}
return $target;
}
示例13: pull
public function pull()
{
$cli_params = array();
$cli_params[] = "--non-interactive";
if ($this->username != '') {
$cli_params[] = "--username " . $this->username;
}
if ($this->password != '') {
//Need to clean up the password so it can be passed to the cli, If anyone find's or thinks of more let me know tholum@couleetechlink.com
$this->password = str_replace(array("*", "^", "&", '"'), array('\\*', '\\^', '\\&', '\\"'), $this->password);
$cli_params[] = "--password " . $this->password;
}
if ($this->svnrepo) {
if (!$this->isAbsPath($this->path)) {
if (!file_exists(WORKSPACE . '/' . $this->path)) {
$this->command_exec = "cd " . WORKSPACE . " && svn co \"" . $this->svnrepo . "\" " . $this->path . " " . implode(" ", $cli_params);
} else {
die(formatJSEND("success", array("message" => "Folder already exists")));
}
} else {
if (!file_exists($this->path)) {
$this->command_exec = "cd " . WORKSPACE . " && svn co \"" . $this->svnrepo . "\" " . $this->path . " " . implode(" ", $cli_params);
} else {
die(formatJSEND("success", array("message" => "Folder already exists")));
}
}
if ($this->newproject) {
$this->projects = getJSON('projects.php');
$this->projects[] = array("name" => $this->name, "path" => $this->path);
saveJSON('projects.php', $this->projects);
}
$this->ExecuteCMD();
echo formatJSEND("success", array("message" => "Repo cloned"));
} else {
echo formatJSEND("error", array("message" => "No Repo specified"));
}
}
示例14: session_start
<!DOCTYPE html>
<html lang="en">
<?php
include_once './funcs.php';
session_start();
handleAction();
if (!isset($_SESSION['id'])) {
$pessoa = getJSON();
}
?>
<head>
<meta charset="utf-8">
<title>SafeGuard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="./css/bootstrap.css" rel="stylesheet">
<link href="./css/bootstrap-responsive.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
#map-canvas { height: 100% }
}
</style>
示例15: getLocalVersion
public function getLocalVersion()
{
if (file_exists(BASE_PATH . "/.git/HEAD")) {
$tmp = file_get_contents(BASE_PATH . "/.git/HEAD");
if (strpos($tmp, "ref:") === false) {
$data[0]['version'] = trim($tmp);
} else {
$data[0]['version'] = trim(file_get_contents(BASE_PATH . "/.git/" . trim(str_replace('ref: ', '', $tmp))));
}
$data[0]['name'] = "";
if (file_exists(DATA . "/version.php")) {
$data[0]['optout'] = "true";
}
} else {
$data = getJSON('version.php');
}
return $data;
}