本文整理汇总了PHP中getJson函数的典型用法代码示例。如果您正苦于以下问题:PHP getJson函数的具体用法?PHP getJson怎么用?PHP getJson使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getJson函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: add
public function add()
{
$js = intval($_GET['js']);
$userid = aac('user')->isLogin(1);
//判断发布者状态
/*
if(aac('user')->isPublisher()==false) {
getJson('不好意思,你还没有权限发布内容!',$js);
}
*/
if ($_POST['token'] != $_SESSION['token']) {
getJson('非法操作!', $js);
}
$content = tsClean($_POST['content']);
if ($content == '') {
getJson('内容不能为空', $js);
}
$isaudit = 0;
//过滤内容开始
aac('system')->antiWord($content);
//过滤内容结束
$weiboid = $this->create('weibo', array('userid' => $userid, 'locationid' => aac('user')->getLocationId($userid), 'content' => $content, 'isaudit' => $isaudit, 'addtime' => date('Y-m-d H:i:s'), 'uptime' => date('Y-m-d H:i:s')));
//feed开始
$feed_template = '<span class="pl">说:</span><div class="quote"><span class="inq">{content}</span> <span><a class="j a_saying_reply" href="{link}" rev="unfold">回应</a></span></div>';
$feed_data = array('link' => tsurl('weibo', 'show', array('id' => $weiboid)), 'content' => cututf8(t($content), '0', '50'));
aac('feed')->add($userid, $feed_template, $feed_data);
//feed结束
getJson('发布成功!', $js, 2, tsurl('weibo', 'show', array('id' => $weiboid)));
}
开发者ID:omusico,项目名称:ThinkSAAS,代码行数:29,代码来源:action.weibo.php
示例2: getAnimals
function getAnimals()
{
$animals = [];
foreach (glob(__DIR__ . '/lib/animals/*.json') as $path) {
$info = pathinfo($path);
$animals[$info['filename']] = getJson($path);
}
return $animals;
}
开发者ID:jmonday-ci,项目名称:release-name-generator,代码行数:9,代码来源:generate.php
示例3: bindCacheSetting
function bindCacheSetting()
{
global $_FANWE;
$settings = array();
$js_settings = array();
$res = FDB::query("SELECT name,val,is_js FROM " . FDB::table('sys_conf') . " WHERE status = 1");
while ($data = FDB::fetch($res)) {
$name = strtolower($data['name']);
$settings[$name] = $data['val'];
if ($data['is_js'] == 1) {
$js_settings[$name] = $data['val'];
}
}
$settings['site_title'] .= ' - ' . 'F' . 'A' . 'N' . 'W' . 'E';
$settings['footer_html'] .= '<' . 'p' . '>' . '<' . 'a' . ' ' . 'h' . 'r' . 'e' . 'f' . '=' . '"' . 'h' . 't' . 't' . 'p' . ':' . '/' . '/' . 'w' . 'w' . 'w' . '.' . 'f' . 'a' . 'n' . 'w' . 'e' . '.' . 'c' . 'o' . 'm' . '"' . ' ' . 't' . 'a' . 'r' . 'g' . 'e' . 't' . '=' . '"' . '_' . 'b' . 'l' . 'a' . 'n' . 'k' . '"' . '>' . 'f' . 'a' . 'n' . 'w' . 'e' . '.' . 'i' . 'n' . 'c' . '<' . '/' . 'a' . '>' . '<' . '/' . 'p' . '>';
writeFile(PUBLIC_ROOT . './js/setting.js', 'var SETTING = ' . getJson($js_settings) . ';');
$config_file = @file_get_contents(PUBLIC_ROOT . 'config.global.php');
$config_file = trim($config_file);
$config_file = preg_replace("/[\$]config\\['time_zone'\\].*?=.*?'.*?'.*?;/is", "\$config['time_zone'] = '" . $settings['time_zone'] . "';", $config_file);
$config_file = preg_replace("/[\$]config\\['default_lang'\\].*?=.*?'.*?'.*?;/is", "\$config['default_lang'] = '" . $settings['default_lang'] . "';", $config_file);
@file_put_contents(PUBLIC_ROOT . 'config.global.php', $config_file);
unset($config_file);
$lang_arr = array();
$lang_files = array(FANWE_ROOT . './core/language/' . $settings['default_lang'] . '/template.lang.php', FANWE_ROOT . './tpl/' . $settings['site_tmpl'] . '/template.lang.php');
foreach ($lang_files as $lang_file) {
if (@(include $lang_file)) {
foreach ($lang as $lkey => $lval) {
$lang_pre = strtolower(substr($lkey, 0, 3));
if ($lang_pre == 'js_') {
$lang_key = substr($lkey, 3);
if ($lang_key != '') {
$lang_arr[$lang_key] = $lval;
}
}
}
}
}
writeFile(PUBLIC_ROOT . './js/lang.js', 'var LANG = ' . getJson($lang_arr) . ';');
clearDir(FANWE_ROOT . './public/data/tpl/css/');
clearDir(FANWE_ROOT . './public/data/tpl/js/');
$css_dir = FANWE_ROOT . './tpl/' . $settings['site_tmpl'] . '/css/';
$css_cache_dir = FANWE_ROOT . './public/data/tpl/css/';
$css_site_path = $_FANWE['site_root'] . 'tpl/' . $settings['site_tmpl'] . '/';
$directory = dir($css_dir);
while ($entry = $directory->read()) {
if ($entry != '.' && $entry != '..' && stripos($entry, '.css') !== false) {
$css_path = $css_dir . $entry;
$css_content = @file_get_contents($css_path);
$css_content = preg_replace("/\\.\\.\\//", $css_site_path, $css_content);
$css_cache_path = $css_cache_dir . '/' . $entry;
writeFile($css_cache_path, $css_content);
}
}
$directory->close();
FanweService::instance()->cache->saveCache('setting', $settings);
}
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:56,代码来源:setting.cache.php
示例4: pullDataForSign
function pullDataForSign(&$sign)
{
$sid = $sign->sid;
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $sid . ".json?key=TEST&date=2015-12-21");
// weekday
$sign->stopName = $result['data']['references']['stops'][0]['name'];
$stopSchedules = array();
$groupedSchedules = array();
// get weekday schedules
createSchedules($result, $stopSchedules, $groupedSchedules, 'wkday');
// get saturday schedules
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $sid . ".json?key=TEST&date=2015-12-19");
// saturday
createSchedules($result, $stopSchedules, $groupedSchedules, 'sat');
// get sunday schedules
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $sid . ".json?key=TEST&date=2015-12-20");
// sunday
createSchedules($result, $stopSchedules, $groupedSchedules, 'sun');
// Above we marked certain headsigns as "AMBIGUOUS"
// b/c the same text might be used for multiple directions of travel.
// Merge 'AMBIGUOUS' schedules with another schedule of the same route (MARTA 12).
$deleteCandidates = array();
foreach ($groupedSchedules as $ss) {
if ($ss['direction2'] == 'AMBIGUOUS') {
foreach ($groupedSchedules as &$ss1) {
if ($ss1['name'] == $ss['name'] && $ss1['direction2'] != 'AMBIGUOUS') {
array_push($deleteCandidates, $ss);
$ss1['wkday'] = array_merge($ss1['wkday'], $ss['wkday']);
$ss1['sat'] = array_merge($ss1['sat'], $ss['sat']);
$ss1['sun'] = array_merge($ss1['sun'], $ss['sun']);
sort($ss1['wkday']);
sort($ss1['sat']);
sort($ss1['sun']);
break;
}
}
}
}
foreach ($deleteCandidates as $dc) {
unset($groupedSchedules[$dc['finalDestination']]);
}
// // This is to center single schedules on the sheet.
// if (count($stopSchedules) == 1) {
// array_unshift($stopSchedules, null);
// array_push($stopSchedules, null);
// }
// if (count($groupedSchedules) == 1) {
// array_unshift($groupedSchedules, null);
// array_push($groupedSchedules, null);
// }
$sign->stopSchedules = $stopSchedules;
$sign->groupedSchedules = $groupedSchedules;
}
开发者ID:jrharshath,项目名称:martaarmy_barracks,代码行数:53,代码来源:signs.php
示例5: main
function main()
{
if (isset($_GET['lang']) && $_GET['lang'] == 'en') {
$lang = 'en';
} else {
$lang = 'no';
}
$json = getJson($lang);
$form = parsePost($json);
if (strlen($form['result']) > 0) {
// If all fields in $_POST were valid
saveForm($form['name'], $form['email'], $form['message']);
}
require 'cvLayout.php';
}
开发者ID:hansnn,项目名称:resume,代码行数:15,代码来源:index.php
示例6: seperateInfo
function seperateInfo()
{
$obj = getJson();
$amount = count($obj);
$objectenArray = [];
$infoArray = [];
for ($i = 0; $i < $amount; ++$i) {
$id = $obj[$i]['id'];
$foto = $obj[$i]['images']['standard_resolution']['url'];
array_push($infoArray, $id);
array_push($infoArray, $foto);
array_push($objectenArray, $infoArray);
$infoArray = [];
}
return $objectenArray;
}
开发者ID:JellyPuddingPie,项目名称:CravedOfficial,代码行数:16,代码来源:Functions.php
示例7: shareCount
function shareCount($url, $site)
{
function getJson($url)
{
$shareCountData = file_get_contents($url);
$result = json_decode($shareCountData);
return $result;
}
if ($site == 'facebook') {
$result = getJson('http://graph.facebook.com/?id=' . $url);
return intval($result->shares);
}
if ($site == 'twitter') {
$result = getJson('http://cdn.api.twitter.com/1/urls/count.json?url=' . $url);
return intval($result->count);
}
if ($site == 'linkedin') {
$result = getJson('http://www.linkedin.com/countserv/count/share?url=' . $url . '&format=json');
return intval($result->count);
}
if ($site == 'pinterest') {
$result = file_get_contents('http://api.pinterest.com/v1/urls/count.json?url=' . $url);
$result = json_decode(preg_replace('/^receiveCount\\((.*)\\)$/', "\\1", $result));
return intval($result->count);
}
if ($site == 'googleplus') {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://clients6.google.com/rpc");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, '[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"' . $url . '","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
$result = curl_exec($curl);
curl_close($curl);
$json = json_decode($result, true);
return intval($json[0]['result']['metadata']['globalCounts']['count']);
}
if ($site == 'stumbleupon') {
$result = getJson('http://www.stumbleupon.com/services/1.01/badge.getinfo?url=' . $url);
return $result->result->views;
}
return "invalid request";
}
开发者ID:sriraman,项目名称:Social-Share-Count-API,代码行数:43,代码来源:shareCount.function.php
示例8: printPageForStop
function printPageForStop($stop)
{
$agency = $stop[0];
$sid = $stop[1];
$stopId1 = $stop[0];
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $stopId1 . ".json?key=TEST&date=2015-09-08");
// weekday
$stopName = $result['data']['references']['stops'][0]['name'];
if (isset($_REQUEST['stopNameOverride']) && $_REQUEST['stopNameOverride'] != "") {
$stopName = $_REQUEST['stopNameOverride'];
}
$routes = $result['data']['references']['routes'];
$stopSchedules = array();
$groupedSchedules = array();
// FIRST bus stop
// get weekday schedules
createSchedules($result, $stopSchedules, 'wkday');
// get saturday schedules
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $stopId1 . ".json?key=TEST&date=2015-04-04");
// saturday
createSchedules($result, $stopSchedules, 'sat');
// get sunday schedules
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $stopId1 . ".json?key=TEST&date=2015-04-05");
// sunday
createSchedules($result, $stopSchedules, 'sun');
// SECOND BUS STOP if available
$stopId2 = $stop[1];
if ($stopId2 != "") {
// get weekday schedules
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $stopId2 . ".json?key=TEST&date=2015-09-08");
// weekday
createSchedules($result, $stopSchedules, 'wkday');
// get saturday schedules
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $stopId2 . ".json?key=TEST&date=2015-04-04");
// saturday
createSchedules($result, $stopSchedules, 'sat');
// get sunday schedules
$result = getJson("http://atlanta.onebusaway.org/api/api/where/schedule-for-stop/" . $stopId2 . ".json?key=TEST&date=2015-04-05");
// sunday
createSchedules($result, $stopSchedules, 'sun');
}
$groupedSchedules = createMergedSchedules($stopSchedules);
// Above we marked certain headsigns as "AMBIGUOUS"
// b/c the same text might be used for multiple directions of travel.
// Merge 'AMBIGUOUS' schedules with another schedule of the same route (MARTA 12).
$deleteCandidates = array();
foreach ($groupedSchedules as $ss) {
if ($ss['direction2'] == 'AMBIGUOUS') {
foreach ($groupedSchedules as &$ss1) {
if ($ss1['name'] == $ss['name'] && $ss1['direction2'] != 'AMBIGUOUS') {
array_push($deleteCandidates, $ss);
$ss1['wkday'] = array_merge($ss1['wkday'], $ss['wkday']);
$ss1['sat'] = array_merge($ss1['sat'], $ss['sat']);
$ss1['sun'] = array_merge($ss1['sun'], $ss['sun']);
sort($ss1['wkday']);
sort($ss1['sat']);
sort($ss1['sun']);
break;
}
}
}
}
foreach ($deleteCandidates as $dc) {
unset($groupedSchedules[$dc['finalDestination']]);
}
// print
echo "<div class='page'>";
echo "<div id='fold'></div>";
printPageHeader($stopName);
//echo "<div id='pageBody'>";
echo "<div id='mapFold'>";
echo "<img src='img/fakemap.png' style='width:100%; height:75%;' />";
echo "</div>";
echo "<div id='scheduleFold'>";
echo "<div class='buses'>";
//echo "<ul>";
foreach ($stopSchedules as $ss) {
//echo "<li>" . $ss['direction2'] . "</li>";
//printRouteInfo($ss);
}
foreach ($groupedSchedules as $ss) {
//echo "<li>" . $ss['direction2'] . "</li>";
printRouteInfo($ss);
}
//echo "</ul>";
echo "</div>";
echo <<<EOT
\t<div class='disclaimer'>
\t\t*Trip times are approximate, may change without notice, and may vary with road conditions, events, and holidays. Data provided by MARTA and OneBusAway.
\t\t<br /><span class='alt-lang'>*Los horarios son indicativos, pueden cambiar sin aviso previo y cambiar en función de las condiciones de circulación, eventos, y días festivos.</span>
\t</div>
EOT;
echo "</div>";
//echo "</div><!-- pageBody -->";
printPageFooter($sid);
echo "</div>";
echo "<div style='clear:both; page-break-after: always;'><" . "/div>";
}
开发者ID:jrharshath,项目名称:martaarmy_barracks,代码行数:98,代码来源:index_army_34.php
示例9: getJson
require_once "include/academic/lecturerexalresultdelete.php";
break;
case "UserManagement":
require_once "include/admission/usermanagement.php";
break;
default:
require_once "include/profile/default.php";
break;
}
// end content
// news
$template->loadTemplateFile("footer.tpl");
$template->setCurrentBlock("news");
$template->setVariable("NEWS", "Intranet News");
//$template->parseCurrentBlock();
$json = getJson($url_json);
//die($json);
$arr = json_decode($json);
//var_dump($arr);
$template->setCurrentBlock("article");
foreach ($arr as $obj) {
//die$obj->guid;
$template->setVariable("NEWSLINK", $obj->guid);
$template->setVariable("NEWSTITLE", $obj->post_title);
$template->setVariable("NEWSCONTENT", limit_text($obj->post_content, 15));
$template->setVariable("NEWSDATE", $obj->post_date);
$template->setVariable("NEWSAUTHOR", $obj->user_nicename);
$template->parseCurrentBlock();
}
$template->parse("newsinner");
$template->show();
开发者ID:cmaere,项目名称:saris_dev,代码行数:31,代码来源:controller.php
示例10: json_decode
//Define Lastfm API calls
$lastfmApi = "http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=" . $request['user'] . "&period=" . $request['period'] . "&api_key=" . $config['api_key'] . "&limit={$limit}&format=json";
$validUser = "http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=" . $request['user'] . "&api_key=" . $config['api_key'] . "&format=json";
//Check if a valid user
$infoJson = json_decode(getJson($validUser));
//If an error is thrown, generate an error image and exit
if (isset($infoJson->{"error"})) {
header("Content-Type: image/png");
error_log($infoJson->{"message"} . " - " . $request['user']);
imagepng(errorImage($infoJson->{"message"}));
$sns = SnsClient::factory(array('credentials.cache' => $cache, 'region' => 'eu-west-1'));
$sns->publish(array('TopicArn' => 'arn:aws:sns:eu-west-1:346795263809:LastFM-Errors', 'Message' => $infoJson->{"message"} . " - " . $request['user'], 'Subject' => "Lastfm Error: " . $infoJson->{"error"}));
return;
}
//Get User's albums and generate a MD5 hash based on this
$json = getJson($lastfmApi);
$sns = SnsClient::factory(array('credentials.cache' => $cache, 'region' => 'eu-west-1'));
$sns->publish(array('TopicArn' => 'arn:aws:sns:eu-west-1:346795263809:LastFM-API-CAlls', 'Message' => $json, 'Subject' => $user . "s JSON API Call"));
$jsonhash = md5($json);
//Cache based on user set variables and JSON hash
$filename = "images/{$user}.{$period}.{$rows}.{$cols}.{$albumInfo}.{$plays}.{$jsonhash}";
//if a previous file exists - request is cached, serve from cache and exit
if (file_exists($filename)) {
header("Content-Type: image/jpeg");
error_log("Serving from cache - " . $filename);
echo file_get_contents($filename);
exit;
}
//otherwise carry on and getAlbums from LastFM.
$albums = getAlbums(json_decode($json));
//Pass the Albums to getArt to download the art into a $covers array
开发者ID:samithaj,项目名称:LastFM-PHP-Album-Collage,代码行数:31,代码来源:lastfm.php
示例11: getJson
if ($info["state"] == 'SUCCESS') {
echo getJson('0', 'success', array('file' => getFileInfo($target . $info["name"], $ROOT)));
} else {
echo getJson('1', $info["state"], array('file' => getFileInfo($target . $info["name"], $ROOT)));
}
break;
case 'download':
$path = $ROOT . $target;
$info = getFileInfo($target, $ROOT);
downloadFile($path, $info['name']);
break;
case 'info':
echo getJson('0', 'success', array('file' => getFileInfo($target, $ROOT)));
break;
default:
echo getJson('1', 'unknow command');
break;
}
function listFile($dir, $ROOT)
{
if ($handle = opendir($ROOT . $dir)) {
$output = array();
$dir = $dir[strlen($dir) - 1] == '/' ? $dir : $dir . '/';
while (false !== ($item = readdir($handle))) {
if ($item != "." && $item != "..") {
$output[] = getFileInfo($dir . $item, $ROOT);
}
}
closedir($handle);
return $output;
} else {
开发者ID:zeroman1212,项目名称:ufinder,代码行数:31,代码来源:ufinder.php
示例12: header
<?php
header('Content-Type: application/json');
define('WEBSITE', 'http://www.studentenwerk-oldenburg.de/de');
define('OVERVIEW_URI', '/gastronomie/speiseplaene.html');
define('DETAILVIEW_URI', '/gastronomie/speiseplaene/%s.html');
define('OVERVIEW', isset($_GET['mensa']) ? FALSE : TRUE);
define('SCRIPT_URL', "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
require_once 'simple_html_dom.php';
require_once 'functions.php';
$output = '';
if (OVERVIEW) {
$url = WEBSITE . OVERVIEW_URI;
$output = getJson($url, '7 days');
} else {
$url = WEBSITE . sprintf(DETAILVIEW_URI, $_GET['mensa']);
$output = getJson($url, '120 minutes');
}
echo $output;
开发者ID:panic175,项目名称:mensa-parser,代码行数:19,代码来源:index.php
示例13: bindCacheSetting
function bindCacheSetting()
{
global $_FANWE;
$settings = array();
$js_settings = array();
$res = FDB::query("SELECT name,val,is_js FROM " . FDB::table('sys_conf') . " WHERE status = 1");
while ($data = FDB::fetch($res)) {
$name = strtolower($data['name']);
$settings[$name] = $data['val'];
if ($data['is_js'] == 1) {
$js_settings[$name] = $data['val'];
}
}
writeFile(PUBLIC_ROOT . './js/setting.js', 'var SETTING = ' . getJson($js_settings) . ';');
$pingJs = '';
//采集JS初始化
$pingJs = @file_get_contents(PUBLIC_ROOT . './js/demo.js');
$domain = 'var domain = "' . $_FANWE['site_url'] . '"; ';
$host_name = 'var hostName = "' . str_replace("http://", "", $_FANWE['site_url']) . '"; ';
$tpl_name = 'var tplName = "' . $_FANWE['setting']['site_tmpl'] . '"; ';
$yz_name = 'var global="TUPU";document[global]=document[global] || {};';
$im_ping_js = '';
$im_ping_js = $host_name . $domain . $tpl_name . $yz_name . $pingJs;
writeFile(PUBLIC_ROOT . './js/im.ping.js', $im_ping_js);
$config_file = @file_get_contents(PUBLIC_ROOT . 'config.global.php');
$config_file = trim($config_file);
$config_file = preg_replace("/[\$]config\\['time_zone'\\].*?=.*?'.*?'.*?;/is", "\$config['time_zone'] = '" . $settings['time_zone'] . "';", $config_file);
$config_file = preg_replace("/[\$]config\\['default_lang'\\].*?=.*?'.*?'.*?;/is", "\$config['default_lang'] = '" . $settings['default_lang'] . "';", $config_file);
@file_put_contents(PUBLIC_ROOT . 'config.global.php', $config_file);
unset($config_file);
$lang_arr = array();
$lang_files = array(FANWE_ROOT . './core/language/' . $settings['default_lang'] . '/template.lang.php', FANWE_ROOT . './tpl/' . $settings['site_tmpl'] . '/template.lang.php');
foreach ($lang_files as $lang_file) {
if (@(include $lang_file)) {
foreach ($lang as $lkey => $lval) {
$lang_pre = strtolower(substr($lkey, 0, 3));
if ($lang_pre == 'js_') {
$lang_key = substr($lkey, 3);
if ($lang_key != '') {
$lang_arr[$lang_key] = $lval;
}
}
}
}
}
writeFile(PUBLIC_ROOT . './js/lang.js', 'var LANG = ' . getJson($lang_arr) . ';');
clearDir(FANWE_ROOT . './public/data/tpl/css/');
clearDir(FANWE_ROOT . './public/data/tpl/js/');
$css_dir = FANWE_ROOT . './tpl/' . $settings['site_tmpl'] . '/css/';
$css_cache_dir = FANWE_ROOT . './public/data/tpl/css/';
$css_site_path = $_FANWE['site_root'] . 'tpl/' . $settings['site_tmpl'] . '/';
$directory = dir($css_dir);
while ($entry = $directory->read()) {
if ($entry != '.' && $entry != '..' && stripos($entry, '.css') !== false) {
$css_path = $css_dir . $entry;
$css_content = @file_get_contents($css_path);
$css_content = preg_replace("/\\.\\.\\//", $css_site_path, $css_content);
$css_cache_path = $css_cache_dir . '/' . $entry;
writeFile($css_cache_path, $css_content);
}
}
$directory->close();
FanweService::instance()->cache->saveCache('setting', $settings);
}
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:64,代码来源:setting.cache.php
示例14: getCustomersByName
function getCustomersByName($customerName, $format)
{
global $apiId, $apiKey;
if ($format == "xml") {
return getXml($apiId, $apiKey, "Customers", "customerName={$customerName}");
} else {
return getJson($apiId, $apiKey, "Customers", "customerName={$customerName}");
}
}
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce-unleashed,代码行数:9,代码来源:unleashed.php
示例15: getStockOnHand
function getStockOnHand($format)
{
global $apiId, $apiKey;
if ($format == "xml") {
return getXml($apiId, $apiKey, "StockOnHand", "");
} else {
return getJson($apiId, $apiKey, "StockOnHand", "pageSize=300");
}
}
开发者ID:Qualitair,项目名称:ecommerce,代码行数:9,代码来源:unleashedAPI.php
示例16: array
<?php
if (!isset($_FILES['image']) || empty($_FILES['image'])) {
exit;
}
$result = array();
$pic = $_FILES['image'];
include_once fimport('class/image');
$image = new Image();
if (intval($_FANWE['setting']['max_upload']) > 0) {
$image->max_size = intval($_FANWE['setting']['max_upload']);
}
$image->init($pic);
if ($image->save()) {
//$type = $_FANWE['request']['photo_type'];
//if(empty($type) || !in_array($type,array('default', 'dapei', 'look')))
//$type = 'default';
$result['img'] = $image->file['target'];
$result['status'] = 1;
$info = array('path' => $image->file['local_target'], 'type' => $_FANWE['request']['photo_type']);
$result['info'] = authcode(serialize($info), 'ENCODE');
$args = array('result' => $result);
$result['html'] = tplFetch("services/share/pic_item", $args);
} else {
$result['status'] = 0;
}
$json = getJson($result);
echo "<textarea>{$json}</textarea>";
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:28,代码来源:uploadpic.php
示例17: header
} else {
header('HTTP/1.0 404 not found');
}
break;
case 'getall':
$posts = Post::getList();
$hc = new HtmlConstructor();
$hc->displayAllPosts($posts);
break;
case 'getjson':
if ($params['resource'] == 'comment') {
$r = new Comment();
} elseif ($params['resource'] == 'post') {
$r = new Post();
}
print getJson($r);
break;
case 'login':
$hc = new HtmlConstructor();
$hc->displayLoginPage();
break;
case 'edit':
$hc = new HtmlConstructor();
$post = Post::get($params["id"]);
$hc->editPost('edit', $post);
break;
case 'create':
$hc = new HtmlConstructor();
$hc->editPost('create', null);
//edition and creation of post use share tamplate
break;
开发者ID:asgardxf,项目名称:phpblog,代码行数:31,代码来源:index.php
示例18: header
<?php
header("content-type:text/html;charset:utf-8");
set_time_limit(0);
date_default_timezone_set("Asia/Shanghai");
$domains = array("crusher.com", "jawcrusher.co.in", "mobilecrusher.pw", "conecrusher.co.in", "lxpdeyumng.com");
$start = date("Y-m-d") . " 03:55:00";
$end = date("Y-m-d") . " 04:30:00";
$json = getJson($domains);
$domain_status = getDomainStatus($json, $domains);
print_r(checkAvailable($domain_status));
//检查可以注册的域名
function checkAvailable($domains_status)
{
$arrayKeys = array_keys($domains_status);
$i = 0;
foreach ($arrayKeys as $domain) {
if ($domains_status[$domain]["status"] == "available") {
$ava_domains[$i] = $domain;
$i++;
}
}
return $ava_domains;
}
//获取域名状态json数据
function getJson($domains)
{
return sendData(getDomainCheckUrl(getDomainConsist($domains)));
}
/**
* 获取需要注册域名的status
开发者ID:DulJuly,项目名称:Info,代码行数:31,代码来源:autoReg.php
示例19: getJson
} else {
$json = '{ "Error": "Database già esistente!" }';
}
}
//Show all arguments.
if (isset($_GET['arguments'])) {
$stmt = $db->query('SELECT * FROM argomenti;');
$json = getJson($stmt->fetchAll(PDO::FETCH_ASSOC));
}
//Show all solutions.
if (isset($_GET['solutions']) && (isset($_GET['argument']) && $_GET['argument'] != "")) {
$stmt = $db->query('SELECT id, soluzione
FROM soluzioni
WHERE id IN (SELECT soluzione FROM domandeALG WHERE argomento = ' . $_GET['argument'] . ')
OR id IN (SELECT soluzione FROM domandeSQL WHERE argomento = ' . $_GET['argument'] . ')');
$json = getJson($stmt->fetchAll(PDO::FETCH_ASSOC));
print_json($json);
return;
}
//Submit newQuestion, INSERT argomento, soluzioni and domandeALG/SQL.
function submitNewQuestion($db, $argumentId, $solutionId)
{
$stmt = $db->query("INSERT INTO " . $_GET['type'] . " (testo,db_connesso,soluzione,argomento)\n VALUES ('" . $_GET['text'] . "','" . $_GET['db'] . "'," . $solutionId . "," . $argumentId . ");");
$json = '{ "Success": "Domanda aggiunta!" }';
print_json($json);
}
function getIdArgument($db)
{
$stmt = $db->query("SELECT id FROM argomenti WHERE argomento = '" . $_GET['new_argument'] . "';");
return $stmt->fetchColumn();
}
开发者ID:Helias,项目名称:Database-Exercise-System,代码行数:31,代码来源:APIadmin.php
示例20: json_decode
<div class="panel-body">
<textarea placeholder="Write something..." class="form-control"></textarea>
</div><!-- panel-body -->
<div class="panel-footer">
<div class="timeline-btns pull-left">
<a href="#" class="tooltips" data-toggle="tooltip" title="" data-original-title="Add Photo"><i class="glyphicon glyphicon-picture"></i></a>
<a href="#" class="tooltips" data-toggle="tooltip" title="" data-original-title="Add Video"><i class="glyphicon glyphicon-facetime-video"></i></a>
<a href="#" class="tooltips" data-toggle="tooltip" title="" data-original-title="Check In"><i class="glyphicon glyphicon-map-marker"></i></a>
<a href="#" class="tooltips" data-toggle="tooltip" title="" data-original-title="Tag User"><i class="glyphicon glyphicon-user"></i></a>
</div><!--timeline-btns -->
<button class="btn btn-primary pull-right">Submit Post</button>
</div><!-- panel-footer -->
</div>
</div><!-- col-sm-6 -->
<?php
$feed = json_decode(getJson("http://hummingbird.me/api/v1/users/" . $user["name"] . "/feed"), true);
$i = 0;
while ($i < count($feed)) {
if ($feed[$i]["story_type"] == "comment") {
?>
<div class="col-sm-6" style="position: absolute; left: 0px; top: 0px;">
<div class="panel panel-default panel-timeline">
<div class="panel-heading">
<div class="media">
<a href="#" class="pull-left">
</a>
<div class="media-body">
<h4 class="text-primary"><?php
echo $feed[$i]["user"]["name"];
?>
<small></small></h4>
开发者ID:sachaw,项目名称:HBSS,代码行数:31,代码来源:index.php
注:本文中的getJson函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论