本文整理汇总了PHP中Respond::PrintResult方法的典型用法代码示例。如果您正苦于以下问题:PHP Respond::PrintResult方法的具体用法?PHP Respond::PrintResult怎么用?PHP Respond::PrintResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Respond
的用法示例。
在下文中一共展示了Respond::PrintResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('visibility' => array('int', 0, 3)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.link");
requireStrictRoute();
$respond = array();
list($result, $visibility) = toggleLinkVisibility($blogid, $suri['id'], $_POST['visibility']);
Respond::PrintResult(array('error' => $result ? 0 : 1, 'visibility' => $visibility), false);
示例2: Recaptcha_AddingCommentHandler
function Recaptcha_AddingCommentHandler($target, $mother)
{
$context = Model_Context::getInstance();
$config = $context->getProperty('plugin.config');
if (doesHaveOwnership() || doesHaveMembership()) {
return true;
}
/* Skip validation if signed-in. */
if (!is_null($config) && isset($config['secretKey'])) {
$recaptcha_response = $_POST["g-recaptcha-response"];
$reqURL = "https://www.google.com/recaptcha/api/siteverify?secret={$config['secretKey']}&response={$recaptcha_response}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $reqURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
if ($output === false) {
Respond::PrintResult(array('error' => 2, 'description' => 'Cannot connect to the Google reCAPTCHA server.'));
return false;
} else {
$resp = json_decode($output, true);
if ($resp['success'] === true) {
/* Yay! The user is human. */
return true;
} else {
$err = implode(' ', $resp['error-codes']);
if (strpos($err, 'missing-input-secret') !== false) {
Respond::PrintResult(array('error' => 2, 'description' => 'Missing reCAPTCHA secret key!'));
} elseif (strpos($err, 'missing-input-response') !== false) {
Respond::PrintResult(array('error' => 2, 'description' => 'Missing reCAPTCHA response!'));
} elseif (strpos($err, 'invalid-input-secret') !== false) {
Respond::PrintResult(array('error' => 2, 'description' => 'Invalid reCAPTCHA secret key.'));
} elseif (strpos($err, 'invalid-input-response') !== false) {
Respond::PrintResult(array('error' => 2, 'description' => 'Invalid reCAPTCHA response.'));
}
}
}
/* It seems to be a robot! Silently fail. */
return false;
}
/* If the plugin is not configured yet, bypass validation. */
return true;
}
示例3: array
<?php
/// Copyright (c) 2004-2016, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('allowBlogVisibility' => array('bool'), 'requireLogin' => array('bool'), 'encoding' => array('string'), 'faviconDailyTraffic' => array('int'), 'flashClipboardPoter' => array('bool'), 'flashUploader' => array('bool'), 'language' => array('string'), 'serviceurl' => array('string'), 'cookieprefix' => array('string', 'mandatory' => false, 'default' => ''), 'skin' => array('string'), 'timeout' => array('int'), 'autologinTimeout' => array('int'), 'timezone' => array('string'), 'useDebugMode' => array('bool'), 'useEncodedURL' => array('bool'), 'useNumericRSS' => array('bool'), 'usePageCache' => array('bool'), 'useCodeCache' => array('bool'), 'useReader' => array('bool'), 'useRewriteDebugMode' => array('bool'), 'useSessionDebugMode' => array('bool'), 'useSkinCache' => array('bool'), 'useMemcached' => array('bool'), 'useExternalResource' => array('bool'), 'externalResourceURL' => array('string', 'mandatory' => false, 'default' => '')));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.service');
requireStrictRoute();
$matchTable = array('timeout' => 'timeout', 'autologinTimeout' => 'autologinTimeout', 'skin' => 'skin', 'language' => 'language', 'timezone' => 'timezone', 'encoding' => 'encoding', 'serviceurl' => 'serviceURL', 'cookieprefix' => 'cookie_prefix', 'usePageCache' => 'pagecache', 'useCodeCache' => 'codecache', 'useSkinCache' => 'skincache', 'useMemcached' => 'memcached', 'useReader' => 'reader', 'useNumericRSS' => 'useNumericRSS', 'useEncodedURL' => 'useEncodedURL', 'useExternalResource' => 'externalresources', 'externalResourceURL' => 'resourcepath', 'allowBlogVisibility' => 'allowBlogVisibilitySetting', 'requireLogin' => 'requirelogin', 'flashClipboardPoter' => 'flashclipboardpoter', 'flashUploader' => 'flashuploader', 'useDebugMode' => 'debugmode', 'useSessionDebugMode' => 'debug_session_dump', 'useRewriteDebugMode' => 'debug_rewrite_module', 'faviconDailyTraffic' => 'favicon_daily_traffic');
$description = array('server' => 'Database server location. Can be socket or address.', 'database' => 'Database name.', 'username' => 'Database username.', 'password' => 'Database password.', 'dbms' => 'Database engine.', 'prefix' => 'Table prefix in database.', 'type' => 'Service type. [single|path|domain] e.g. [http://www.example.com/blog | http://www.example.com/blog/blog1 | http://blog1.example.com].', 'domain' => 'Service domain. (http://www.example.com)', 'path' => 'Service path. (e.g. /blog)', 'timeout' => 'Session timeout limit (sec.)', 'autologinTimeout' => 'Automatic login timeout (sec.)', 'skin' => 'Default blog skin name.', 'language' => 'Server language', 'timezone' => 'Server timezone', 'encoding' => 'Character encoding', 'serviceURL' => 'Specify the default service URL. Useful if using other web program under the same domain.', 'cookie_prefix' => 'Service cookie prefix. Default cookie prefix is Textcube_[VERSION_NUMBER].', 'pagecache' => 'Use pagecache function.', 'codecache' => 'Use codecache function.', 'skincache' => 'Use skin pre-fetching.', 'memcached' => 'Use memcache to handle session and cache', 'reader' => 'Use Textcube reader. You can set it to false if you do not use Textcube reader, and want to decrease DB load.', 'useNumericRSS' => 'Can force permalink to numeric format on RSS output.', 'useEncodedURL' => 'URL encoding using RFC1738', 'externalresources' => 'Loads resources from external CDN from resourceURL.', 'resourcepath' => 'Specify the full URI of external resource.', 'useSSL' => 'Use SSL connection. Every http:// will be replaced with https://', 'allowBlogVisibilitySetting' => 'Allow service users to change blog visibility.', 'requirelogin' => 'Force log-in process to every blogs. (for private blog service)', 'flashclipboardpoter' => 'Use Flash clipboard copy to support one-click trackback address copy.', 'flashuploader' => 'Use Flash uploader to upload multiple files.', 'debugmode' => 'Textcube debug mode. (for core / plugin debug or optimization)', 'debug_session_dump' => 'session info debuging.', 'debug_rewrite_module' => 'rewrite handling module info debuging.', 'favicon_daily_traffic' => 'Set favicon traffic limitation. default is 10MB.');
/* Exception handling */
$config = array();
foreach ($matchTable as $abs => $real) {
if ($_POST[$abs] === 1) {
$config[$real] = true;
} else {
if ($_POST[$abs] === 0) {
$config[$real] = false;
} else {
$config[$real] = $_POST[$abs];
}
}
}
$result = writeConfigFile($config, $description);
if ($result === true) {
Respond::PrintResult(array('error' => 0));
} else {
Respond::PrintResult(array('error' => 1, 'msg' => $result));
}
示例4: array
<?php
/// Copyright (c) 2004-2014, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('target' => array('any', 'mandatory' => true)));
require ROOT . '/library/preprocessor.php';
require ROOT . '/library/error.php';
requireStrictRoute();
if (substr($_POST['target'], 0, 7) != '/owner/') {
errorExit(404);
}
if (!defined('__TEXTCUBE_GAE__')) {
Respond::PrintResult(array('error' => 0, 'url' => $_POST['target']));
exit;
}
use google\appengine\api\cloud_storage\CloudStorageTools;
$options = ['gs_bucket_name' => $_SERVER['blog_fs_bucket']];
$upload_url = CloudStorageTools::createUploadUrl($_POST['target'], $options);
Respond::PrintResult(array('error' => 0, 'url' => $upload_url));
示例5: array
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('entriesOnPage' => array('int'), 'entriesOnList' => array('int'), 'entriesOnRecent' => array('int'), 'noticesOnRecent' => array('int'), 'commentsOnRecent' => array('int'), 'commentsOnGuestbook' => array('int'), 'archivesOnPage' => array('int'), 'tagboxAlign' => array('int'), 'tagsOnTagbox' => array('int'), 'trackbacksOnRecent' => array('int'), 'showListOnCategory' => array('int'), 'showListOnArchive' => array('int'), 'showListOnTag' => array('int'), 'showListOnAuthor' => array('int'), 'showListOnSearch' => array('int'), 'expandComment' => array('int'), 'expandTrackback' => array('int'), 'sortCommentsBy' => array('string'), 'recentNoticeLength' => array('int'), 'recentPageLength' => array('int'), 'recentEntryLength' => array('int'), 'recentCommentLength' => array('int'), 'recentTrackbackLength' => array('int'), 'linkLength' => array('int'), 'useAjaxComment' => array('int'), 'useMicroformat' => array('int'), 'useFOAF' => array('int')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (setSkinSetting($blogid, $_POST)) {
Respond::PrintResult(array('error' => 0));
} else {
Respond::PrintResult(array('error' => 1, 'msg' => POD::error()));
}
示例6: array
<?php
/// Copyright (c) 2004-2015, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('item' => array('string')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
requirePrivilege('group.creators');
$items = explode(",", $_GET['item']);
if (in_array(getServiceSetting("defaultBlogId", 1), $items)) {
$result = _t('대표 블로그는 삭제할 수 없습니다.');
Respond::PrintResult(array('error' => -1, 'result' => $result));
}
foreach ($items as $item) {
$result = removeBlog($item);
if ($result !== true) {
Respond::PrintResult(array('error' => -1, 'result' => $result));
}
}
Respond::PrintResult(array('error' => 0));
示例7: setEntryStar
if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) {
@header("location:" . $context->getProperty('uri.blog') . "/owner/entry");
exit;
}
}
//$isAjaxRequest = checkAjaxRequest();
if (!isset($_GET['command'])) {
$temp = setEntryStar($suri['id'], isset($_GET['mark']) ? $_GET['mark'] : 1) == true ? 0 : 1;
$countResult = POD::queryExistence("SELECT id \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = " . getBlogId() . " AND starred = " . $_GET['mark']);
if ($countResult == false) {
$countResult = 0;
} else {
$countResult = 1;
fireEvent('ChangeStarred', $_GET['mark'], $suri['id']);
}
Respond::PrintResult(array('error' => $temp), false);
} else {
switch ($_GET['command']) {
case "unmark":
$_GET['command'] = 1;
break;
case "mark":
$_GET['command'] = 2;
break;
default:
$_GET['command'] = 0;
break;
}
setEntryStar($suri['id'], $_GET['command']);
header("Location: " . $_SERVER['HTTP_REFERER']);
}
示例8: sendCommentPing
$pool->setQualifier('visibility', 'equals', 3);
$pool->setQualifier('acceptcomment', 'equals', 1);
$row = $pool->getAll('*');
if (!empty($row)) {
sendCommentPing($entryId, $context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$row['slogan']}" : $entryId), is_null($user) ? $comment['name'] : $user['name'], is_null($user) ? $comment['homepage'] : $user['homepage']);
}
}
importlib('model.blog.skin');
$skin = new Skin($context->getProperty('skin.skin'));
if ($entryId > 0) {
$commentBlock = getCommentView($entry, $skin);
dress('article_rep_id', $entryId, $commentBlock);
$commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
$recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), null, $skin->recentCommentItem)));
$commentCount = getCommentCount($blogid, $entryId);
$commentCount = $commentCount > 0 ? $commentCount : 0;
list($tempTag, $commentView) = getCommentCountPart($commentCount, $skin);
} else {
$commentView = '';
$commentBlock = getCommentView($entry, $skin);
dress('article_rep_id', $entryId, $commentBlock);
$commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
$commentCount = 0;
$recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), $skin->recentComment, $skin->recentCommentItem)));
}
Respond::PrintResult(array('error' => 0, 'commentView' => $commentView, 'commentCount' => $commentCount, 'commentBlock' => $commentBlock, 'recentCommentBlock' => $recentCommentBlock));
exit;
}
}
}
}
示例9: array
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('parent' => array('int')));
require ROOT . '/library/preprocessor.php';
requireModel('blog.attachment');
$result = getAttachmentSizeLabel($blogid, $_GET['parent']);
Respond::PrintResult(array('error' => empty($result) ? 1 : 0, 'result' => $result));
?>
示例10: array
<?php
/// Copyright (c) 2004-2016, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('identify' => array('string', 'min' => 1), 'owner' => array('email')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
requirePrivilege('group.creators');
if ($uid = User::getUserIdByEmail($_GET['owner'])) {
$result = addBlog('', $uid, $_GET['identify']);
if ($result === true) {
if ($_GET['owner'] == User::getEmail(getUserId())) {
/// Update current user's access list.
$priv = array();
array_push($priv, "group.administrators");
Acl::setAcl($rec['blogid'], $priv, true);
}
Respond::PrintResult(array('error' => 0));
} else {
Respond::PrintResult(array('error' => -1, 'result' => $result));
}
} else {
Respond::PrintResult(array('error' => -2, 'result' => _t('등록되지 않은 소유자 E-mail 입니다.')));
}
示例11: array
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('command' => array('any', 'mandatory' => false, 'default' => 'block'), 'id' => array('id', 'mandatory' => false), 'mode' => array(array('ip', 'url', 'content', 'name', 'whiteurl')), 'value' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
$isAjaxRequest = checkAjaxRequest();
$filter = new Filter();
if ($_GET['command'] == 'unblock') {
if (empty($_GET['id'])) {
$filter->type = $_GET['mode'];
$filter->pattern = $_GET['value'];
} else {
$filter->id = $_GET['id'];
}
if ($filter->remove()) {
$isAjaxRequest ? Respond::PrintResult(array('error' => 0)) : header("Location: " . $_SERVER['HTTP_REFERER']);
} else {
$isAjaxRequest ? Respond::PrintResult(array('error' => 1, 'msg' => POD::error())) : header("Location: " . $_SERVER['HTTP_REFERER']);
}
} else {
$filter->type = $_GET['mode'];
$filter->pattern = $_GET['value'];
if ($filter->add()) {
$isAjaxRequest ? Respond::PrintResult(array('error' => 0, 'id' => $filter->id)) : header("Location: " . $_SERVER['HTTP_REFERER']);
} else {
$isAjaxRequest ? Respond::PrintResult(array('error' => 1, 'msg' => POD::error())) : header("Location: " . $_SERVER['HTTP_REFERER']);
}
}
示例12: array
<?php
/// Copyright (c) 2004-2015, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
$IV = array('POST' => array('targets' => array('list'), 'userid' => array('id')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
importlib("model.blog.entry");
$username = User::getName($_POST['userid']);
if (Acl::check('group.administrators')) {
if (!is_null($username) && changeAuthorOfEntries($blogid, $_POST['targets'], $_POST['userid'])) {
Respond::PrintResult(array('error' => 0, 'name' => $username));
} else {
Respond::PrintResult(array('error' => 1, 'message' => _t('존재하지 않은 사용자입니다')));
}
} else {
Respond::PrintResult(array('error' => 1, 'message' => _t('권한이 없습니다.')));
}
示例13: list
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
list($status, $url) = updateRandomFeed();
Respond::PrintResult(array('error' => $status, 'url' => $url));
示例14: array
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
$IV = array('GET' => array('name' => array('string'), 'email' => array('email')));
requireStrictRoute();
$result = User::add($_GET['email'], $_GET['name']);
if ($result === true) {
Respond::PrintResult(array('error' => 0));
} else {
Respond::PrintResult(array('error' => -1, 'result' => $result));
}
示例15: requireModel
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
requireModel('blog.trash');
requireModel('blog.response.remote');
requireModel('blog.sidebar');
requireLibrary('blog.skin');
requireStrictRoute();
$blogid = getBlogId();
$entryId = trashTrackback($blogid, $suri['id']);
if ($entryId !== false) {
$skin = new Skin($skinSetting['skin']);
$trackbackCount = getTrackbackCount($blogid, $entryId);
list($tempTag, $trackbackCountContent) = getTrackbackCountPart($trackbackCount, $skin);
$recentTrackbackContent = getRecentTrackbacksView(getRecentTrackbacks($blogid), $skin->recentTrackback, $skin->recentTrackbackItem);
$entry = array();
$entry['id'] = $entryId;
$entry['slogan'] = getSloganById($blogid, $entry['id']);
$trackbackListContent = getTrackbacksView($entry, $skin, true);
}
if ($trackbackListContent === false) {
Respond::PrintResult(array('error' => 1));
} else {
Respond::PrintResult(array('error' => 0, 'trackbackList' => $trackbackListContent, 'trackbackCount' => $trackbackCountContent, 'recentTrackbacks' => $recentTrackbackContent));
}