本文整理汇总了PHP中get_str函数的典型用法代码示例。如果您正苦于以下问题:PHP get_str函数的具体用法?PHP get_str怎么用?PHP get_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_str函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flickr_users_get_by_url
function flickr_users_get_by_url($error_404 = 1)
{
$path = get_str("path");
$nsid = get_str("nsid");
if ($path && $GLOBALS['cfg']['enable_feature_path_alias_redirects']) {
loadlib("flickr_users_path_aliases");
$alias = flickr_users_path_aliases_get_by_alias($path);
if ($alias && $alias['redirect_to']) {
$new_path = urlencode($alias['redirect_to']);
$redir = str_replace($path, $new_path, $_SERVER['REQUEST_URI']);
header("location: {$redir}");
}
}
if ($path) {
$flickr_user = flickr_users_get_by_path_alias($path);
# see also: notes in flickr_users_create_user()
# see also: inc_path_alias_conflict.txt
if ($flickr_user && $GLOBALS['cfg']['enable_feature_path_alias_redirects']) {
$other_flickr_user = _flickr_users_get_by_path_alias($path);
$other_user = users_get_by_id($other_flickr_user['user_id']);
$GLOBALS['smarty']->assign("path_alias_conflict", 1);
$GLOBALS['smarty']->assign_by_ref("path_alias_other_user", $other_user);
$GLOBALS['smarty']->assign_by_ref("path_alias_other_flickr_user", $other_flickr_user);
}
} else {
if ($nsid) {
$flickr_user = flickr_users_get_by_nsid($nsid);
}
}
if (!$flickr_user && $error_404) {
error_404();
}
return $flickr_user;
}
示例2: api_flickr_photos_geo_possibleCorrections
function api_flickr_photos_geo_possibleCorrections()
{
$photo_id = get_int64("photo_id");
$photo = _api_flickr_photos_geo_get_photo($photo_id);
$type = get_str("place_type");
if (!$type) {
api_output_error(999, "Missing place type");
}
if (!flickr_places_is_valid_placetype($type)) {
api_output_error(999, "Invalid place type");
}
# TO DO: calculate based on $type
$radius = 1.5;
$bbox = geo_utils_bbox_from_point($photo['latitude'], $photo['longitude'], $radius, 'km');
$bbox = implode(",", array($bbox[1], $bbox[0], $bbox[3], $bbox[2]));
$method = 'flickr.places.placesForBoundingBox';
$args = array('bbox' => $bbox, 'place_type' => $type);
$rsp = flickr_api_call($method, $args);
if (!$rsp['ok']) {
api_output_error(999, "Flickr API error");
}
$possible = array();
if ($rsp['rsp']['places']['total']) {
foreach ($rsp['rsp']['places']['place'] as $place) {
$possible[] = array('woeid' => $place['woeid'], 'placetype' => $place['place_type'], 'name' => $place['_content']);
}
}
$parent = flickr_places_parent_placetype($type);
$out = array('place_type' => $type, 'parent_place_type' => $parent, 'places' => $possible);
return api_output_ok($out);
}
示例3: api_output_jsonp_ensure_valid_callback
function api_output_jsonp_ensure_valid_callback()
{
# see http://stackoverflow.com/questions/3128062/is-this-safe-for-providing-jsonp
$callback = get_str("callback");
if (api_output_jsonp_ensure_valid_function_name($callback) && api_output_jsonp_ensure_no_reserved_words($callback)) {
return $callback;
} else {
api_output_jsonp_send_fatal();
}
}
示例4: api_test_echo
function api_test_echo()
{
$out = array();
foreach ($_GET as $k => $ignore) {
if ($k = filter_strict($k)) {
$v = filter_strict(get_str($k));
$out[$k] = $v;
}
}
api_output_ok($out);
}
示例5: api_test_echo
function api_test_echo()
{
$out = array();
foreach ($_GET as $k => $ignore) {
if ($GLOBALS['cfg']['api_auth_type'] == 'oauth2' && $k == 'access_token') {
continue;
}
if ($k = filter_strict($k)) {
$v = filter_strict(get_str($k));
$out[$k] = $v;
}
}
api_output_ok($out);
}
示例6: get_download_url
function get_download_url($pname, $need_vbox)
{
global $platforms;
global $url_base;
$need_vbox = get_str("need_vbox", true);
$p = $platforms[$pname];
$v = latest_version($p);
$file = $v['file'];
if ($need_vbox && array_key_exists('vbox_file', $v)) {
$file = $v['vbox_file'];
}
$url = $url_base . $file;
return $url;
}
示例7: handle_add
function handle_add($job, $inst)
{
$f = null;
$f->x = get_int('pic_x');
$f->y = get_int('pic_y');
$f->type = sanitize_tags(get_str('type'));
$c = sanitize_tags(get_str('comment', true));
if (strstr($c, "(optional)")) {
$c = "";
}
$f->comment = $c;
$output = $inst->get_opaque_data();
$output->features[] = $f;
$inst->set_opaque_data($output);
header("location: bossa_example4.php?bji={$inst->id}");
}
示例8: index
/**
* 上传列表
* @author jry <598821125@qq.com>
*/
public function index()
{
//搜索
$keyword = I('keyword', '', 'string');
$condition = array('like', '%' . $keyword . '%');
$map['id|path'] = array($condition, $condition, '_multi' => true);
//获取所有上传
$map['status'] = array('egt', '0');
//禁用和正常状态
$data_list = D('PublicUpload')->page(!empty($_GET["p"]) ? $_GET["p"] : 1, C('ADMIN_PAGE_ROWS'))->where($map)->order('sort desc,id desc')->select();
$page = new \Common\Util\Page(D('PublicUpload')->where($map)->count(), C('ADMIN_PAGE_ROWS'));
foreach ($data_list as &$data) {
$data['name'] = get_str($data['name'], 0, 30) . '<input class="form-control input-sm" value="' . $data['path'] . '">';
}
//使用Builder快速建立列表页面。
$builder = new \Common\Builder\ListBuilder();
$builder->setMetaTitle('上传列表')->addTopButton('resume')->addTopButton('forbid')->addTopButton('delete')->setSearch('请输入ID/上传关键字', U('index'))->addTableColumn('id', 'ID')->addTableColumn('show', '文件')->addTableColumn('name', '文件名及路径')->addTableColumn('size', '大小')->addTableColumn('ctime', '创建时间', 'time')->addTableColumn('sort', '排序')->addTableColumn('status', '状态', 'status')->addTableColumn('right_button', '操作', 'btn')->setTableDataList($data_list)->setTableDataPage($page->show())->addRightButton('forbid')->addRightButton('delete')->display();
}
示例9: add_admin
function add_admin($team)
{
$email_addr = get_str('email_addr');
$user = BoincUser::lookup("email_addr='{$email_addr}'");
if (!$user) {
error_page(tra("no such user"));
}
if ($user->teamid != $team->id) {
error_page(tra("User is not member of team"));
}
if (is_team_admin($user, $team)) {
error_page(tra("%1 is already an admin of %2", $email_addr, $team->name));
}
$now = time();
$ret = BoincTeamAdmin::insert("(teamid, userid, create_time) values ({$team->id}, {$user->id}, {$now})");
if (!$ret) {
error_page(tra("Couldn't add admin"));
}
}
示例10: validate
function validate()
{
$x = get_str("x");
$u = get_int("u");
$user = lookup_user_id($u);
if (!$user) {
error_page(tra("No such user."));
}
$x2 = $user->signature;
if ($x2 != $x) {
error_page(tra("Error in URL data - can't validate email address"));
}
$result = $user->update("email_validated=1");
if (!$result) {
error_page(tra("Database update failed - please try again later."));
}
page_head(tra("Validate email address"));
echo tra("The email address of your account has been validated.");
page_tail();
}
示例11: login_ensure_loggedin
login_ensure_loggedin($history_url);
$fsq_user = foursquare_users_get_by_foursquare_id($fsq_id);
if (!$fsq_user) {
error_404();
}
$owner = users_get_by_id($fsq_user['user_id']);
$is_own = $owner['id'] == $GLOBALS['cfg']['user']['id'] ? 1 : 0;
# for now...
if (!$is_own) {
error_403();
}
$more = array();
if ($page = get_int32("page")) {
$more['page'] = $page;
}
if ($when = get_str("when")) {
$more['when'] = $when;
$history_url .= urlencode($when) . "/";
# TO DO: find some better heuristic for this number
# besides "pull it out of my ass" (20120206/straup)
$more['per_page'] = 100;
}
$more['inflate_locality'] = 1;
$rsp = privatesquare_checkins_for_user($owner, $more);
# TO DO: oh god...timezones :-(
if ($when) {
list($start, $stop) = datetime_when_parse($more['when']);
$GLOBALS['smarty']->assign("when", $when);
$GLOBALS['smarty']->assign("start", $start);
$GLOBALS['smarty']->assign("stop", $stop);
}
示例12: get_logged_in_user
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/boinc_db.inc";
require_once "../inc/util.inc";
require_once "../inc/profile.inc";
$user = get_logged_in_user();
$cmd = get_str("cmd", true);
if ($cmd == "delete") {
$result = delete_profile($user);
if (!$result) {
error_page(tra("couldn't delete profile - please try again later"));
}
delete_user_pictures($user->id);
page_head(tra("Delete Confirmation"));
$user->update("has_profile=0");
echo tra("Your profile has been deleted.") . "<br>";
page_tail();
exit;
}
page_head(tra("Profile delete confirmation"));
echo "\n <h2>" . tra("Are you sure?") . "</h2><p>\n " . tra("Deleted profiles are gone forever and cannot be recovered --\nyou will have to start from scratch\nif you want another profile in the future.") . "\n <p>\n " . tra("If you're sure, click 'Yes'\nto remove your profile from our database.") . "\n <p>\n";
show_button("delete_profile.php?cmd=delete", tra("Yes"), tra("Delete my profile"));
示例13: post_str
include("include/init.php");
if (! $GLOBALS['cfg']['enable_feature_password_retrieval']){
error_404();
}
if ($GLOBALS['cfg']['user']['id']){
header("location: /");
exit();
}
$reset_code = post_str('reset');
if (! $reset_code){
$reset_code = get_str('reset');
}
if (! $reset_code){
# seriously, go away...
header("location: /");
exit();
}
$user = users_get_by_password_reset_code($reset_code);
if (! $user){
$GLOBALS['error']['nouser'] = 1;
示例14: xml_header
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/forum_db.inc";
require_once "../inc/util.inc";
require_once "../inc/xml.inc";
xml_header();
if (DISABLE_FORUMS) {
xml_error(-1, "Forums are disabled");
}
$retval = db_init_xml();
if ($retval) {
xml_error($retval);
}
$method = get_str("method", true);
if ($method != "user_posts" && $method != "user_threads") {
xml_error(-1);
}
$userid = get_int("userid", true);
$user = BoincUser::lookup_id($userid);
if (!$user) {
xml_error(ERR_DB_NOT_FOUND);
}
if ($method == "user_posts") {
$count = get_int("count", true);
if (!$count || $count <= 0 || $count > 50) {
$count = 10;
}
$length = get_int("contentlength", true);
if ($length == null || $length <= 0) {
示例15: check_get_args
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
include_once "../inc/util.inc";
include_once "../inc/prefs.inc";
include_once "../inc/prefs_project.inc";
check_get_args(array("subset", "venue", "confirmed", "cols", "tnow", "ttok"));
$user = get_logged_in_user();
check_tokens($user->authenticator);
$subset = get_str("subset");
$venue = get_str("venue");
$confirmed = get_str("confirmed", true);
$columns = get_int("cols", true);
$c = $columns ? "&cols={$columns}" : "";
if ($confirmed) {
if ($subset == "global") {
$main_prefs = prefs_parse_global($user->global_prefs);
$main_prefs->{$venue} = null;
global_prefs_update($user, $main_prefs);
} else {
$main_prefs = prefs_parse_project($user->project_prefs);
$main_prefs->{$venue} = null;
project_prefs_update($user, $main_prefs);
}
Header("Location: prefs.php?subset={$subset}{$c}");
} else {
page_head(tra("Confirm delete preferences"));