本文整理汇总了PHP中get_str函数的典型用法代码示例。如果您正苦于以下问题:PHP get_str函数的具体用法?PHP get_str怎么用?PHP get_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_str函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:34,代码来源:lib_flickr_users.php
示例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);
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:31,代码来源:lib_api_flickr_photos_geo.php
示例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();
}
}
开发者ID:whosonfirst,项目名称:flamework-api,代码行数:10,代码来源:lib_api_output_jsonp.php
示例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);
}
开发者ID:whosonfirst,项目名称:flamework-api,代码行数:11,代码来源:lib_api_test.php
示例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);
}
开发者ID:alokc83,项目名称:flamework-api,代码行数:14,代码来源:lib_api_test.php
示例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;
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:14,代码来源:concierge.php
示例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}");
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:16,代码来源:bossa_example4.php
示例8: index
/**
* 上传列表
* @author jry <[email protected]>
*/
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();
}
开发者ID:varphper,项目名称:corethink,代码行数:22,代码来源:PublicUploadController.class.php
示例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"));
}
}
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:19,代码来源:team_admins.php
示例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();
}
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:20,代码来源:validate_email_addr.php
示例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);
}
开发者ID:nilswalk,项目名称:privatesquare,代码行数:31,代码来源:user_history.php
示例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"));
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:31,代码来源:delete_profile.php
示例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;
开发者ID:netcon-source,项目名称:dotspotting,代码行数:31,代码来源:reset.php
示例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) {
开发者ID:CalvinZhu,项目名称:boinc,代码行数:31,代码来源:forum_get_data.php
示例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"));
开发者ID:CalvinZhu,项目名称:boinc,代码行数:31,代码来源:prefs_remove.php
示例16:
include("include/init.php");
#
# do we have a valid cookie set?
#
if (!login_check_login()){
$GLOBALS['error']['badcookies'] = 1;
$smarty->display("page_checkcookie.txt");
exit;
}
#
# where shall we bounce to?
#
$redir = $GLOBALS['cfg']['abs_root_url'];
if ($_redir = get_str("redir")){
$redir .= $_redir;
}
#
# go!
#
header("location: {$redir}");
exit;
?>
开发者ID:nvkelso,项目名称:reverse-geoplanet,代码行数:29,代码来源:checkcookie.php
示例17: show_team_xml
//make sure only numbers get through
$team = BoincTeam::lookup_id($team_id);
if ($team) {
show_team_xml($team);
$total++;
if ($total == 100) {
break;
}
}
//do not error out
}
}
echo "</teams>\n";
exit;
}
$team_name = get_str("team_name");
$name_lc = strtolower($team_name);
$name_lc = escape_pattern($name_lc);
$clause = "name like '%" . BoincDb::escape_string($name_lc) . "%' order by expavg_credit desc limit 100";
$teams = BoincTeam::enum($clause);
if ($format == 'xml') {
echo "<teams>\n";
$total = 0;
foreach ($teams as $team) {
show_team_xml($team);
$total++;
if ($total == 100) {
break;
}
}
echo "</teams>\n";
开发者ID:gchilders,项目名称:boinc,代码行数:31,代码来源:team_lookup.php
示例18: get_str
// Object-caching and full-file caching is used to speed up queries
// for data from this page.
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
require_once "../inc/cache.inc";
require_once "../inc/util.inc";
require_once "../inc/xml.inc";
require_once "../inc/boinc_db.inc";
require_once "../inc/user.inc";
require_once "../inc/forum.inc";
require_once "../project/project.inc";
$auth = get_str("auth", true);
if (!$auth) {
$id = get_int("userid");
}
$format = get_str("format", true);
if ($format == "xml") {
// don't do caching for XML
xml_header();
$retval = db_init_xml();
if ($retval) {
xml_error($retval);
}
if ($auth) {
$user = lookup_user_auth($auth);
$show_hosts = true;
} else {
$user = lookup_user_id($id);
$show_hosts = false;
}
if (!$user) {
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:31,代码来源:show_user.php
示例19: count_uotd_candidates
}
$uotd_candidates = count_uotd_candidates();
if ($uotd_candidates >= 0) {
if ($uotd_candidates >= UOTD_THRESHOLD * 2) {
$color = "#00aa00";
} elseif ($uotd_candidates < UOTD_THRESHOLD) {
$color = "#ff0000";
} else {
$color = "#ff9900";
}
echo "<li><span style=\"color: " . $color . "\">There are " . $uotd_candidates . " remaining\r\n\t\tcandidates for User of the Day.</span></li>\n";
}
echo "</ul>\n";
echo "\r\n\t<p>\r\n\t<table border=\"0\"><tr valign=\"top\">\r\n\t<td><b>Browse database:</b>\r\n\t<ul> \r\n\t\t<li><a href=\"db_action.php?table=platform\">Platforms</a></li>\r\n\t\t<li><a href=\"db_action.php?table=app\">Applications</a></li>\r\n\t\t<li><a href=\"db_form.php?table=app_version\">Application versions</a></li>\r\n\t\t<li><a href=\"db_form.php?table=user\">Users</a> (<a href=\"list_new_users.php\">recently registered</a>)</li>\r\n\t\t<li><a href=\"db_form.php?table=team\">Teams</a></li>\r\n\t\t<li><a href=\"db_form.php?table=host&detail=low\">Hosts</a></li>\r\n\t\t<li><a href=\"db_form.php?table=workunit\">Workunits</a></li>\r\n\t\t<li><a href=\"db_form.php?table=result&detail=low\">Results</a></li>\r\n\t\t<li><a href=dbinfo.php>DB row counts and disk usage</a>\r\n\t</ul>\r\n\t\r\n\t</td> \r\n\t<td><b>Regular Operations:</b>\r\n\t<ul>\r\n\t\t<li><a href=\"profile_screen_form.php\">Screen user profiles </a></li>\r\n\t\t<li><a href=\"manage_special_users.php\">Manage special users</a></li>\r\n\t</ul>\r\n\t\r\n\t</td> \r\n\t<td><b>Special Operations:</b>\r\n\t<ul>\r\n\t\t<li><a href=\"manage_apps.php\">Manage applications</a></li>\r\n\t\t<li><a href=\"manage_app_versions.php\">Manage application versions</a></li>\r\n\t\t<li><a href=\"mass_email.php\">Send mass email to a selected set of users</a></li>\r\n\t\t<li><a href=\"problem_host.php\">Email user with misconfigured host</a></li>\r\n\t\t<li><a href=\"job_times.php\">FLOP count statistics</a>\r\n\t\t<li><a href=\"cancel_wu_form.php\">Cancel workunits</a></li>\r\n\t\t<li><form action=\"manage_user.php\">\r\n\t\t\t<input type=\"submit\" value=\"Manage user\">\r\n\t\t\tID: <input name=\"userid\">\r\n\t\t\t</form>\r\n\t\t</li>\r\n\t\t<li>\r\n\t\t\t<form method=\"get\" action=\"clear_host.php\">\r\n\t\t\tClear Host: \r\n\t\t\t<input type=\"text\" size=\"5\" name=\"hostid\">\r\n\t\t\t<input type=\"submit\" value=\"Clear RPC\">\r\n\t\t\t</form>\r\n\t\t</li>\r\n\t</ul>\r\n\t</td>\r\n\t</tr>\r\n\t</table>\r\n";
// Application Result Summaries:
$show_deprecated = get_str("show_deprecated", true);
$show_only = array("all");
// Add all appids you want to display, or "all"
$result = mysql_query("select id, name, deprecated from app");
while ($app = mysql_fetch_object($result)) {
if (in_array($app->id, $show_only) || in_array("all", $show_only) && (!$app->deprecated || $show_deprecated)) {
echo "\r\n\t<b>Result summary for <tt>{$app->name}</tt>:</b>\r\n\t<ul>\r\n\t<li> Past 24 hours:\r\n\t\t<a href=\"result_summary.php?appid={$app->id}&nsecs=86400\">summary</a> |\r\n\t\t<a href=\"pass_percentage_by_platform.php?appid={$app->id}&nsecs=86400\">pass percentage by platform</a> | \r\n\t\t<a href=\"failure_result_summary_by_host.php?appid={$app->id}&nsecs=86400\">failure by host</a> |\r\n\t\t<a href=\"failure_result_summary_by_platform.php?appid={$app->id}&nsecs=86400\"> failure by platform</a>\r\n\t<li>Past 7 days:\r\n\t\t<a href=\"result_summary.php?appid={$app->id}&nsecs=604800\">summary</a> |\r\n\t\t<a href=\"pass_percentage_by_platform.php?appid={$app->id}&nsecs=604800\">pass percentage by platform</a> |\r\n\t\t<a href=\"failure_result_summary_by_host.php?appid={$app->id}&nsecs=604800\">failure by host</a> |\r\n\t\t<a href=\"failure_result_summary_by_platform.php?appid={$app->id}&nsecs=604800\">failure by platform</a>\r\n\t</ul>\r\n\t";
}
}
mysql_free_result($result);
if ($show_deprecated) {
echo "<a href=\"index.php?show_deprecated=0\">Hide deprecated applications</a>";
} else {
echo "<a href=\"index.php?show_deprecated=1\">Show deprecated applications</a>";
}
// Periodic tasks
开发者ID:Turante,项目名称:boincweb,代码行数:31,代码来源:index.php
示例20: explode
if (isset($place[$type])) {
$woeid = $place[$type]['woeid'];
$parts = explode(",", $place[$type]['_content']);
$name = trim($parts[0]);
$hier[] = array('woeid' => $woeid, 'placetype' => $type, 'name' => $name);
}
}
$hier = array_reverse($hier);
$GLOBALS['smarty']->assign_by_ref("place", $place);
$GLOBALS['smarty']->assign_by_ref("hierarchy", $hier);
# now get the photos
$more = array('viewer_id' => $GLOBALS['cfg']['user']['id']);
if ($page = get_int32("page")) {
$more['page'] = $page;
}
if ($context = get_str("context")) {
$str_map = flickr_photos_geo_context_map("string keys");
if (isset($str_map[$context])) {
$geo_context = $str_map[$context];
$more['geocontext'] = $geo_context;
$GLOBALS['smarty']->assign("context", $context);
$GLOBALS['smarty']->assign("geo_context", $geo_context);
}
} else {
$rsp = flickr_photos_places_contexts_for_user_and_place($owner, $place, $more);
if ($rsp['ok']) {
$GLOBALS['smarty']->assign("geo_contexts", $rsp['contexts']);
$ctx_map = flickr_photos_geo_context_map();
$GLOBALS['smarty']->assign_by_ref("geo_contexts_map", $ctx_map);
}
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:31,代码来源:flickr_photos_user_place.php
注:本文中的get_str函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论