当前位置: 首页>>代码示例>>PHP>>正文


PHP post_int函数代码示例

本文整理汇总了PHP中post_int函数的典型用法代码示例。如果您正苦于以下问题:PHP post_int函数的具体用法?PHP post_int怎么用?PHP post_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了post_int函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: do_updates

function do_updates()
{
    $id = post_int("id");
    $app = BoincApp::lookup_id($id);
    if (!$app) {
        admin_error_page("no such app");
    }
    $n = post_str("deprecated", true) ? 1 : 0;
    $app->update("deprecated={$n}");
    $n = post_num("weight");
    $app->update("weight={$n}");
    $n = post_int("homogeneous_redundancy");
    $app->update("homogeneous_redundancy={$n}");
    $n = post_int("target_nresults");
    $app->update("target_nresults={$n}");
    $n = post_str("homogeneous_app_version", true) ? 1 : 0;
    $app->update("homogeneous_app_version={$n}");
    $n = post_str("non_cpu_intensive", true) ? 1 : 0;
    $app->update("non_cpu_intensive={$n}");
    $n = post_str("beta", true) ? 1 : 0;
    $app->update("beta={$n}");
    $n = post_str("fraction_done_exact", true) ? 1 : 0;
    $app->update("fraction_done_exact={$n}");
    echo "Application {$id} updated.\n        <p>\n        You must restart the project for this to take effect.\n    ";
}
开发者ID:gchilders,项目名称:boinc,代码行数:25,代码来源:manage_apps.php

示例2: hide_explanation

function hide_explanation()
{
    switch (post_int("category", true)) {
        case 1:
            $c = "Obscene";
            break;
        case 2:
            $c = "Flame/Hate mail";
            break;
        case 3:
            $c = "Commercial spam";
            break;
        case 4:
            $c = "Double post";
            break;
        case 5:
            $c = "User Request";
            break;
        default:
            $c = "Other";
            break;
    }
    $x = "\nYour post was categorized as " . $c;
    $x .= mod_comment();
    return $x;
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:26,代码来源:forum_moderate_post_action.php

示例3: handle_add_confirm

function handle_add_confirm($user)
{
    $destid = post_int('userid');
    $destuser = BoincUser::lookup_id($destid);
    if (!$destuser) {
        error_page("No such user");
    }
    check_pending($user, $destuser);
    check_ignoring($user, $destuser);
    $msg = post_str('message', true);
    if ($msg) {
        $msg = sanitize_tags(BoincDb::escape_string($msg));
    }
    $now = time();
    $ret = BoincFriend::replace("user_src={$user->id}, user_dest={$destid}, message='{$msg}', create_time={$now}, reciprocated=0");
    if (!$ret) {
        error_page(tra("Database error"));
    }
    $now = time();
    $type = NOTIFY_FRIEND_REQ;
    BoincNotify::replace("userid={$destid}, create_time={$now}, type={$type}, opaque={$user->id}");
    BoincForumPrefs::lookup($destuser);
    if ($destuser->prefs->pm_notification == 1) {
        send_friend_request_email($user, $destuser, $msg);
    }
    page_head(tra("Friend request sent"));
    echo tra("We have notified %1 of your request.", "<b>" . $destuser->name . "</b>");
    page_tail();
}
开发者ID:maexlich,项目名称:boinc-igemathome,代码行数:29,代码来源:friend.php

示例4: user_permissions_action

function user_permissions_action()
{
    $bitset = '';
    for ($i = 0; $i < S_NFLAGS; $i++) {
        if (post_int("role" . $i, TRUE) == 1) {
            $bitset .= '1';
            echo "<br> setting {$i}";
        } else {
            $bitset .= '0';
        }
    }
    $userid = post_int("userid");
    $query = "UPDATE forum_preferences SET special_user='{$bitset}' WHERE userid={$userid}";
    _mysql_query($query);
    Header("Location: user_permissions.php");
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:16,代码来源:user_permissions.php

示例5: update

function update()
{
    $id = post_int("id");
    $av = BoincAppVersion::lookup_id($id);
    if (!$av) {
        error_page("no such app version");
    }
    $n = post_str("beta", true) ? 1 : 0;
    $av->update("beta={$n}");
    $n = post_str("deprecated", true) ? 1 : 0;
    $av->update("deprecated={$n}");
    $n = post_int("min_core_version");
    $av->update("min_core_version={$n}");
    $n = post_int("max_core_version");
    $av->update("max_core_version={$n}");
    echo "<b>Updated app version {$id}.  This change will take effect when you restart the project.</b><p>";
}
开发者ID:entibasse,项目名称:superhost,代码行数:17,代码来源:manage_app_versions.php

示例6: handle_suspend

function handle_suspend($user)
{
    global $g_logged_in_user;
    $dt = post_int('suspend_for', true);
    $reason = $_POST['suspend_reason'];
    if ($dt > 0 && empty($reason)) {
        admin_error_page("You must supply a reason for a suspension.\n            <p><a href=manage_user.php?userid={$user->id}>Try again</a>");
    } else {
        if (is_numeric($dt)) {
            $t = $dt > 0 ? time() + $dt : 0;
            $q = "UPDATE forum_preferences SET banished_until={$t} WHERE userid={$user->id}";
            _mysql_query($q);
            // put a timestamp in wiki to trigger re-validation of credentials
            if (function_exists('touch_wiki_user')) {
                touch_wiki_user($user);
            }
            // Send suspension e-mail to user and administrators
            if ($dt > 0) {
                $subject = PROJECT . " posting privileges suspended for " . $user->name;
                $body = "\nForum posting privileges for the " . PROJECT . " user \"" . $user->name . "\"\nhave been suspended for " . time_diff($dt) . " by " . $g_logged_in_user->name . ". \nThe reason given was:\n\n{$reason}\n\nThe suspension will end at " . time_str($t) . "\n";
            } else {
                $subject = PROJECT . " user " . $user->name . " unsuspended";
                $body = "\nForum posting privileges for the " . PROJECT . " user \"" . $user->name . "\"\nhave been restored by " . $g_logged_in_user->name . "\n";
                if ($reason) {
                    $body .= "The reason given was:\n\n   {$reason}\n";
                }
            }
            send_email($user, $subject, $body);
            $emails = explode(",", POST_REPORT_EMAILS);
            foreach ($emails as $email) {
                $admin->email_addr = $email;
                send_email($admin, $subject, $body);
            }
        }
    }
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:36,代码来源:manage_user.php

示例7: post_str

    }
    $images_as_links = $_POST["forum_images_as_links"] != "" ? 1 : 0;
    $link_popup = $_POST["forum_link_popup"] != "" ? 1 : 0;
    $hide_avatars = $_POST["forum_hide_avatars"] != "" ? 1 : 0;
    $hide_signatures = $_POST["forum_hide_signatures"] != "" ? 1 : 0;
    $highlight_special = $_POST["forum_highlight_special"] != "" ? 1 : 0;
    $jump_to_unread = $_POST["forum_jump_to_unread"] != "" ? 1 : 0;
    $ignore_sticky_posts = $_POST["forum_ignore_sticky_posts"] != "" ? 1 : 0;
    $no_signature_by_default = $_POST["signature_by_default"] != "" ? 0 : 1;
    $signature = post_str("signature", true);
    if (strlen($signature) > 250) {
        error_page(tra("Your signature was too long, please keep it less than 250 characters."));
    }
    $forum_sort = post_int("forum_sort");
    $thread_sort = post_int("thread_sort");
    $display_wrap_postcount = post_int("forum_display_wrap_postcount");
    if ($display_wrap_postcount < 1) {
        $display_wrap_postcount = 1;
    }
    $signature = BoincDb::escape_string($signature);
    $user->prefs->update("images_as_links={$images_as_links}, link_popup={$link_popup}, hide_avatars={$hide_avatars}, hide_signatures={$hide_signatures}, highlight_special={$highlight_special}, jump_to_unread={$jump_to_unread}, ignore_sticky_posts={$ignore_sticky_posts}, no_signature_by_default={$no_signature_by_default}, avatar='{$avatar_url}', signature='{$signature}', forum_sorting={$forum_sort}, thread_sorting={$thread_sort}, display_wrap_postcount={$display_wrap_postcount}");
}
// DISABLE_FORUMS
$add_user_to_filter = $_POST["add_user_to_filter"] != "";
if ($add_user_to_filter) {
    $user_to_add = trim($_POST["forum_filter_user"]);
    if ($user_to_add != "" and $user_to_add == strval(intval($user_to_add))) {
        $other_user = BoincUser::lookup_id($user_to_add);
        if (!$other_user) {
            echo tra("No such user:") . " " . $user_to_add;
        } else {
开发者ID:CalvinZhu,项目名称:boinc,代码行数:31,代码来源:edit_forum_preferences_action.php

示例8: post_int

// 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/util_ops.inc";
$cancel = post_int('cancel', true);
$hide_canceled = post_str('hide_canceled', true);
$hide_dlerr = post_str('hide_dlerr', true);
$appid = post_int('appid', true);
$WU = post_arr('WU', true);
$back = post_str('back', true);
$clause = post_str('clause', true);
$limit = post_int('limit', true);
if (!$limit || $limit == 0) {
    $limit = 20;
}
admin_page_head("Cancel Workunits");
// check for WUs to cancel
//
$WUs = "";
if ($cancel && $cancel == 1) {
    if ($WU) {
        foreach ($WU as $key => $value) {
            if ($WUs != "") {
                $WUs = $WUs . ",";
            }
            $WUs = $WUs . $value;
        }
开发者ID:aggroskater,项目名称:boinc,代码行数:31,代码来源:cancel_workunits_action.php

示例9: error_page

        $result = $thread->update("sticky=0");
        $action_name = "made non-sticky";
        break;
    case "lock":
        $result = $thread->update("locked=1");
        $action_name = "locked";
        break;
    case "unlock":
        $result = $thread->update("locked=0");
        $action_name = "unlocked";
        break;
    case "move":
        if ($forum->parent_type != 0) {
            error_page("No");
        }
        $fid = post_int('forumid');
        $new_forum = BoincForum::lookup_id($fid);
        $result = move_thread($thread, $forum, $new_forum);
        $action_name = "moved from {$forum->title} to {$new_forum->title}";
        break;
    case "title":
        $new_title = post_str('newtitle');
        $title = BoincDb::escape_string($new_title);
        $result = $thread->update("title='{$title}'");
        $action_name = "renamed from '{$thread->title}' to '{$new_title}'";
        break;
    default:
        error_page("Unknown action");
}
if (!$result) {
    error_page("Moderation failed");
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:31,代码来源:forum_moderate_thread_action.php

示例10: db_init

//
// 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/db_ops.inc";
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Manage special users action");
$bitset = '';
for ($i = 0; $i < S_NFLAGS; $i++) {
    if (post_int("role" . $i, TRUE) == '1') {
        $bitset = str_pad($bitset, $i + 1, '1');
    } else {
        $bitset = str_pad($bitset, $i + 1, '0');
    }
}
if ($bitset == "0000000") {
    $bitset = '';
}
$userid = post_int("userid");
$query = "UPDATE forum_preferences SET special_user='{$bitset}' WHERE userid='{$userid}'";
_mysql_query($query);
if (_mysql_affected_rows() == 1) {
    echo "<center><h2>Success</h2>";
} else {
    echo "<center><h2>Failure</h2>";
}
echo "Query was: {$query}</center>";
//echo "<br><a href=\"manage_special_users.php\">Manage users</a>";
admin_page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
开发者ID:ChristianBeer,项目名称:boinc,代码行数:31,代码来源:manage_special_users_action.php

示例11: exit_error

//   such as a week, before purging them.  So active users will always
//   have at least one result in the database.
require_once "../inc/util_ops.inc";
require_once "../inc/email.inc";
function exit_error($message)
{
    echo "Error: {$message} <br>";
    exit;
}
// These are set to large values because otherwise the script has
// a tendency to just stop after some time.
//
ini_set("memory_limit", "20M");
set_time_limit(3600);
$receiver = 0;
$receiver = post_int('receiver', true);
$subject = post_str('subject', true);
$body = post_str('body', true);
$body = stripslashes($body);
admin_page_head("Send mass email");
if ($receiver > 0) {
    db_init();
    switch ($receiver) {
        case 1:
            // all users
            $query = "select * from user where send_email > 0";
            break;
        case 2:
            // unsuccessful users
            $week_ago = time(0) - 7 * 86400;
            $query = "select user.id,user.name,user.email_addr from user left join result on user.id=result.userid where send_email>0 and total_credit=0 and user.create_time<{$week_ago} and isnull(result.id)";
开发者ID:happyj,项目名称:qcn,代码行数:31,代码来源:mass_email.php

示例12: error_page

if (!post_str('action', true)) {
    if (!get_str('action', true)) {
        error_page(tra("You must specify an action..."));
    } else {
        $action = get_str('action');
    }
} else {
    $action = post_str('action');
}
$userid = post_int('userid');
$user = BoincUser::lookup_id($userid);
if ($action != "start") {
    error_page("Unknown action");
}
// TODO: create a function for this in forum_banishment_vote.inc to make it more flexible
switch (post_int("category", true)) {
    case 1:
        $mod_category = tra("Obscene");
    case 2:
        $mod_category = tra("Flame/Hate mail");
    case 3:
        $mod_category = tra("User Request");
    default:
        $mod_category = tra("Other");
}
if (post_str('reason', true)) {
    start_vote($config, $logged_in_user, $user, $mod_category, post_str("reason"));
} else {
    start_vote($config, $logged_in_user, $user, $mod_category, "None given");
}
$cvs_version_tracker[] = "\$Id: forum_moderate_post_action.php 13718 2007-09-30 11:17:11Z Rytis \$";
开发者ID:nicolas17,项目名称:boincgit-test,代码行数:31,代码来源:forum_banishment_vote_action.php

示例13: get_logged_in_user

    $query .= " limit {$limit}";
    return BoincPost::enum_general($query);
}
$logged_in_user = get_logged_in_user(false);
BoincForumPrefs::lookup($logged_in_user);
if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)) {
    $show_hidden_posts = true;
} else {
    $show_hidden_posts = false;
}
page_head(tra("Forum search results"));
$search_keywords = post_str("search_keywords", true);
$search_author = post_int("search_author", true);
$search_max_time = post_int("search_max_time");
$search_forum = post_int("search_forum");
$search_sort = post_int("search_sort");
$search_list = explode(" ", $search_keywords);
if ($search_max_time) {
    $min_timestamp = time() - $search_max_time * 3600 * 24;
} else {
    $min_timestamp = 0;
}
$limit = 100;
if ($search_forum == -1) {
    $forum = null;
} else {
    if ($search_forum) {
        $forum = BoincForum::lookup_id($search_forum);
    }
}
$user = null;
开发者ID:CalvinZhu,项目名称:boinc,代码行数:31,代码来源:forum_search_action.php

示例14: do_confirmedblock

function do_confirmedblock($logged_in_user)
{
    check_tokens($logged_in_user->authenticator);
    $id = post_int("id");
    $blocked_user = BoincUser::lookup_id($id);
    if (!$blocked_user) {
        error_page(tra("no such user"));
    }
    add_ignored_user($logged_in_user, $blocked_user);
    page_head(tra("User %1 blocked", $blocked_user->name));
    echo "<div>" . tra("User %1 has been blocked from sending you private messages.", $blocked_user->name) . "\n";
    echo tra("To unblock, visit %1message board preferences%2", "<a href=\"edit_forum_preferences_form.php\">", "</a>") . "</div>\n";
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:13,代码来源:pm.php

示例15: db_init

require_once "../inc/db_ops.inc";
require_once "../project/common.inc";
db_init();
set_time_limit(600);
$user = get_logged_in_user(true);
// authenticate admin-level user
qcn_admin_user_auth($user, true);
$query = "SELECT id, fname, lname, email_addr, addr1, addr2, city, region, postcode, country, latitude, longitude, phone, fax, bshare_coord, bshare_map, bshare_ups, cpu_type, cpu_os, cpu_age, cpu_floor, cpu_admin, cpu_permission, cpu_firewall, cpu_proxy, cpu_internet, cpu_unint_power, sensor_distribute, comments,\n loc_home,\n loc_business,\n loc_affix_perm,\n loc_self_install,\n loc_day_install_sunday,\n loc_time_install_sunday,\n loc_day_install_monday,\n loc_time_install_monday,\n loc_day_install_tuesday,\n loc_time_install_tuesday,\n loc_day_install_wednesday,\n loc_time_install_wednesday,\n loc_day_install_thursday,\n loc_time_install_thursday,\n loc_day_install_friday,\n loc_time_install_friday,\n loc_day_install_saturday,\n loc_time_install_saturday,\n loc_years_host, \n  ramp_type, \n  quake_damage, \n  liquefaction,\n from_unixtime(time_added) time_add, \n from_unixtime(time_edit) time_ed,\n completed,\n from_unixtime(time_completed) time_comp\nfrom qcn_ramp_participant WHERE active=1 ";
$order = "order by country, lname, fname";
$show_aggregate = false;
// start $_POST
$nresults = post_int("nresults", true);
$last_pos = post_int("last_pos", true);
$bUseCSV = post_int("cbUseCSV", true);
$bUseRegional = post_int("cbUseRegional", true);
$bUseComp = post_int("cbUseComp", true);
/*$bUseArchive = post_int("cbUseArchive", true);
$bUseFile  = post_int("cbUseFile", true);
$bUseQuake = post_int("cbUseQuake", true);
$bUseQCNQuake = post_int("cbUseQCNQuake", true);
$bUseLat   = post_int("cbUseLat", true);
$bUseSensor = post_int("cbUseSensor", true);
$bUseTime  = post_int("cbUseTime", true);
$bUseHost = post_int("cbUseHost", true);
$strHostID = post_int("HostID", true);
*/
$selectSort = post_str("selectSort", true);
$strCountry = post_str("db_country", true);
if (!$selectSort) {
    $selectSort = "Last Name";
}
开发者ID:happyj,项目名称:qcn,代码行数:31,代码来源:ramp.php


注:本文中的post_int函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。