• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP message_redirect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: calendar_delete

function calendar_delete()
{
    global $vars, $phpcdb, $phpc_script;
    $html = tag('div', attributes('class="phpc-container"'));
    if (empty($vars["cid"])) {
        $html->add(tag('p', __('No calendar selected.')));
        return $html;
    }
    $id = $vars["cid"];
    $calendar = $phpcdb->get_calendar($id);
    if (empty($calendar)) {
        soft_error(__("Invalid calendar ID."));
    }
    if (empty($vars["confirm"])) {
        $html->add(tag('p', __('Confirm you want to delete calendar:') . $calendar->get_title()));
        $html->add(" [ ", create_action_link(__('Confirm'), "calendar_delete", array("cid" => $id, "confirm" => "1")), " ] ");
        $html->add(" [ ", create_action_link(__('Deny'), "display_month"), " ] ");
        return $html;
    }
    if (!$calendar->can_admin()) {
        $html->add(tag('p', __("You do not have permission to remove calendar") . ": {$id}"));
        return $html;
    }
    if ($phpcdb->delete_calendar($id)) {
        $html->add(tag('p', __("Removed calendar") . ": {$id}"));
    } else {
        $html->add(tag('p', __("Could not remove calendar") . ": {$id}"));
    }
    return message_redirect($html, "{$phpc_script}?action=admin");
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:30,代码来源:calendar_delete.php


示例2: occurrence_delete

function occurrence_delete()
{
    global $vars, $phpcdb, $phpcid, $phpc_script;
    $html = tag('div', attributes('class="phpc-container"'));
    if (empty($vars["oid"])) {
        $message = __('No occurrence selected.');
        $html->add(tag('p', $message));
        return $html;
    }
    if (is_array($vars["oid"])) {
        $oids = $vars["oid"];
    } else {
        $oids = array($vars["oid"]);
    }
    $removed_occurs = array();
    $unremoved_occurs = array();
    $permission_denied = array();
    foreach ($oids as $oid) {
        $occur = $phpcdb->get_occurrence_by_oid($oid);
        if (!$occur->can_modify()) {
            $permission_denied[] = $oid;
        } else {
            if ($phpcdb->delete_occurrence($oid)) {
                $removed_occurs[] = $oid;
                // TODO: Verify that the event still has occurences.
                $eid = $occur->get_eid();
            } else {
                $unremoved_occurs[] = $oid;
            }
        }
    }
    if (sizeof($removed_occurs) > 0) {
        if (sizeof($removed_occurs) == 1) {
            $text = __("Removed occurrence");
        } else {
            $text = __("Removed occurrences");
        }
        $text .= ': ' . implode(', ', $removed_occurs);
        $html->add(tag('p', $text));
    }
    if (sizeof($unremoved_occurs) > 0) {
        if (sizeof($unremoved_occurs) == 1) {
            $text = __("Could not remove occurrence");
        } else {
            $text = __("Could not remove occurrences");
        }
        $text .= ': ' . implode(', ', $unremoved_occurs);
        $html->add(tag('p', $text));
    }
    if (sizeof($permission_denied) > 0) {
        if (sizeof($permission_denied) == 1) {
            $text = __("You do not have permission to remove the occurrence.");
        } else {
            $text = __("You do not have permission to remove occurrences.");
        }
        $text .= ': ' . implode(', ', $permission_denied);
        $html->add(tag('p', $text));
    }
    return message_redirect($html, "{$phpc_script}?action=display_event&phpcid={$phpcid}&eid={$eid}");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:60,代码来源:occurrence_delete.php


示例3: category_delete

function category_delete()
{
    global $vars, $phpcdb, $phpcid, $phpc_script;
    $html = tag('div', attributes('class="phpc-container"'));
    if (empty($vars["catid"])) {
        return message_redirect(__('No category selected.'), "{$phpc_script}?action=cadmin&phpcid={$phpcid}");
    }
    if (is_array($vars["catid"])) {
        $ids = $vars["catid"];
    } else {
        $ids = array($vars["catid"]);
    }
    $categories = array();
    foreach ($ids as $id) {
        $categories[] = $phpcdb->get_category($id);
    }
    foreach ($categories as $category) {
        if (empty($category['cid']) && !is_admin() || !$phpcdb->get_calendar($category['cid'])->can_admin()) {
            $html->add(tag('p', __("You do not have permission to delete category: ") . $category['catid']));
            continue;
        }
        if ($phpcdb->delete_category($category['catid'])) {
            $html->add(tag('p', __("Removed category: ") . $category['catid']));
        } else {
            $html->add(tag('p', __("Could not remove category: ") . $category['catid']));
        }
    }
    return message_redirect($html, "{$phpc_script}?action=cadmin&phpcid={$phpcid}");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:29,代码来源:category_delete.php


示例4: user_permissions_submit

function user_permissions_submit()
{
    global $phpcid, $phpc_cal, $vars, $phpcdb, $phpc_script;
    if (!$phpc_cal->can_admin()) {
        return tag('div', __('Permission denied'));
    }
    if (empty($vars['uid'])) {
        return tag('div', __('No users'));
    }
    $users = array();
    foreach ($vars['uid'] as $uid) {
        $perm_names = array('read', 'write', 'readonly', 'modify', 'admin');
        $old_perms = $phpcdb->get_permissions($phpcid, $uid);
        $new_perms = array();
        $different = false;
        foreach ($perm_names as $perm_name) {
            $new_perms[$perm_name] = asbool(!empty($vars["{$perm_name}{$uid}"]));
            if (empty($old_perms[$perm_name]) != empty($vars["{$perm_name}{$uid}"])) {
                $different = true;
            }
        }
        if ($different) {
            $user = $phpcdb->get_user($uid);
            $users[] = $user->get_username();
            $phpcdb->update_permissions($phpcid, $uid, $new_perms);
        }
    }
    if (sizeof($users) == 0) {
        $message = __('No changes to make.');
    } else {
        $message = __('Updated user(s):') . ' ' . implode(', ', $users);
    }
    return message_redirect($message, "{$phpc_script}?action=cadmin&phpcid={$phpcid}");
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:34,代码来源:user_permissions_submit.php


示例5: user_settings_submit

function user_settings_submit()
{
    global $phpcid, $vars, $phpcdb, $phpc_user_tz, $phpc_user_lang, $phpc_prefix, $phpc_user, $phpc_script;
    verify_token();
    // If we have a timezone, make sure it's valid
    if (!empty($vars["timezone"]) && !in_array($vars['timezone'], timezone_identifiers_list())) {
        soft_error(__("Invalid timezone."));
    }
    // Expire 20 years in the future, give or take.
    $expiration_time = time() + 20 * 365 * 24 * 60 * 60;
    // One hour in the past
    $past_time = time() - 3600;
    if (!empty($vars["timezone"])) {
        setcookie("{$phpc_prefix}tz", $vars['timezone'], $expiration_time);
    } else {
        setcookie("{$phpc_prefix}tz", '', $past_time);
    }
    if (!empty($vars["language"])) {
        setcookie("{$phpc_prefix}lang", $vars['language'], $expiration_time);
    } else {
        setcookie("{$phpc_prefix}lang", '', $past_time);
    }
    if (is_user()) {
        $uid = $phpc_user->get_uid();
        $phpcdb->set_user_default_cid($uid, $vars['default_cid']);
        $phpcdb->set_timezone($uid, $vars['timezone']);
        $phpcdb->set_language($uid, $vars['language']);
        $phpc_user_tz = $vars["timezone"];
        $phpc_user_lang = $vars["language"];
    }
    return message_redirect(__('Settings updated.'), "{$phpc_script}?action=user_settings&phpcid={$phpcid}");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:32,代码来源:user_settings_submit.php


示例6: user_enable

function user_enable()
{
    global $vars, $phpcid, $phpcdb, $phpc_script;
    $html = tag('div', attributes('class="phpc-container"'));
    if (!is_admin()) {
        $html->add(tag('p', __('You must be an admin to enable users.')));
        return $html;
    }
    if (empty($vars["uid"])) {
        $html->add(tag('p', __('No user selected.')));
        return $html;
    }
    if (is_array($vars["uid"])) {
        $ids = $vars["uid"];
    } else {
        $ids = array($vars["uid"]);
    }
    foreach ($ids as $id) {
        if ($phpcdb->enable_user($id)) {
            $html->add(tag('p', __("Enabled user: {$id}")));
        } else {
            $html->add(tag('p', __("Could not enable user: {$id}")));
        }
    }
    return message_redirect($html, "{$phpc_script}?action=admin&phpcid={$phpcid}");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:26,代码来源:user_enable.php


示例7: category_submit

function category_submit()
{
    global $vars, $phpcdb, $phpc_script, $phpc_cal;
    if (empty($vars["text-color"]) || empty($vars["bg-color"])) {
        $page = "{$phpc_script}?action=category_form";
        if (!empty($vars["cid"])) {
            $page .= "&cid={$vars["cid"]}";
        }
        if (!empty($vars["catid"])) {
            $page .= "&catid={$vars["catid"]}";
        }
        return message_redirect(__("Color not specified."), $page);
    }
    // The current widget produces hex values without the "#".
    //   We may in the future want to allow different input, so store the
    //   values with the "#"
    $text_color = '#' . $vars["text-color"];
    $bg_color = '#' . $vars["bg-color"];
    if (empty($vars['gid']) || strlen($vars['gid']) == 0) {
        $gid = 0;
    } else {
        $gid = $vars['gid'];
    }
    if (!check_color($text_color) || !check_color($bg_color)) {
        soft_error(__("Invalid color."));
    }
    if (!isset($vars['catid'])) {
        $modify = false;
        if (!isset($vars['cid'])) {
            $cid = null;
            if (!is_admin()) {
                permission_error(__('You do not have permission to add categories to all calendars.'));
            }
        } else {
            $cid = $vars['cid'];
            $calendar = $phpcdb->get_calendar($cid);
            if (!$calendar->can_admin()) {
                permission_error(__('You do not have permission to add categories to this calendar.'));
            }
        }
        $catid = $phpcdb->create_category($cid, $vars["name"], $text_color, $bg_color, $gid);
    } else {
        $modify = true;
        $catid = $vars['catid'];
        $category = $phpcdb->get_category($catid);
        if (!(empty($category['cid']) && is_admin() || $phpcdb->get_calendar($category["cid"])->can_admin())) {
            soft_error(__("You do not have permission to modify this category."));
        }
        $phpcdb->modify_category($catid, $vars['name'], $text_color, $bg_color, $gid);
    }
    $page = "{$phpc_script}?action=cadmin&phpcid=" . $vars['phpcid'];
    if ($modify) {
        return message_redirect(__("Modified category: ") . $catid, $page);
    }
    if ($catid > 0) {
        return message_redirect(__("Created category: ") . $catid, $page);
    }
    return tag('div', attributes('class="phpc-error"'), __('Error submitting category.'));
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:59,代码来源:category_submit.php


示例8: field_submit

function field_submit()
{
    global $vars, $phpcdb, $phpc_script, $phpc_cal;
    $form_page = "{$phpc_script}?action=field_form";
    if (!empty($vars["cid"])) {
        $form_page .= "&cid={$vars["cid"]}";
    }
    if (!empty($vars["fid"])) {
        $form_page .= "&fid={$vars["fid"]}";
    }
    if (empty($vars["name"])) {
        return input_error(__("Name not specified."), $form_page);
    }
    $required = !empty($vars['name']) && $vars['required'] == '1';
    if (empty($vars['format'])) {
        $format = false;
    } else {
        $format = $vars['format'];
    }
    if (!isset($vars['fid'])) {
        $modify = false;
        if (!isset($vars['cid'])) {
            $cid = null;
            if (!is_admin()) {
                permission_error(__('You do not have permission to add fields to all calendars.'));
            }
        } else {
            $cid = $vars['cid'];
            $calendar = $phpcdb->get_calendar($cid);
            if (!$calendar->can_admin()) {
                permission_error(__('You do not have permission to add fields to this calendar.'));
            }
        }
        $fid = $phpcdb->create_field($cid, $vars["name"], $required, $format);
    } else {
        $modify = true;
        $fid = $vars['fid'];
        $field = $phpcdb->get_field($fid);
        if (!(empty($field['cid']) && is_admin() || $phpcdb->get_calendar($field["cid"])->can_admin())) {
            permission_error(__("You do not have permission to modify this field."));
        }
        $phpcdb->modify_field($fid, $vars['name'], $required, $format);
    }
    $page = "{$phpc_script}?action=cadmin&phpcid={$vars['phpcid']}#phpc-fields";
    if ($modify) {
        return message_redirect(__("Modified field: ") . $fid, $page);
    }
    if ($fid > 0) {
        return message_redirect(__("Created field: ") . $fid, $page);
    }
    return tag('div', attributes('class="phpc-error"'), __('Error submitting field.'));
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:52,代码来源:field_submit.php


示例9: default_calendar

function default_calendar()
{
    global $vars, $phpcdb, $phpc_script, $phpc_user;
    $html = tag('div', attributes('class="phpc-container"'));
    if (empty($vars["cid"])) {
        $html->add(tag('p', __('No calendar selected.')));
        return $html;
    }
    if ($phpc_user->is_admin()) {
        $phpcdb->set_config('default_cid', $vars['cid']);
        $html->add(tag('p', __('Default calendar set to: ') . $vars['cid']));
    }
    return message_redirect($html, "{$phpc_script}?action=admin");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:14,代码来源:default_calendar.php


示例10: group_delete

function group_delete()
{
    global $vars, $phpcdb, $phpcid, $phpc_script;
    $html = tag('div', attributes('class="phpc-container"'));
    if (empty($vars["gid"])) {
        return message_redirect(__('No group selected.'), "{$phpc_script}?action=cadmin&phpcid={$phpcid}");
    }
    if (is_array($vars["gid"])) {
        $ids = $vars["gid"];
    } else {
        $ids = array($vars["gid"]);
    }
    $groups = array();
    foreach ($ids as $id) {
        $groups[] = $phpcdb->get_group($id);
    }
    if (empty($vars["confirm"])) {
        $list = tag('ul');
        foreach ($groups as $group) {
            $list->add(tag('li', "{$id}: " . $group['name']));
        }
        $html->add(tag('p', __('Confirm you want to delete:')));
        $html->add($list);
        $html->add(" [ ", create_action_link(__('Confirm'), "group_delete", array("gid" => $ids, "confirm" => "1")), " ] ");
        $html->add(" [ ", create_action_link(__('Deny'), "display_month"), " ] ");
        return $html;
    }
    foreach ($groups as $group) {
        if (empty($group['cid']) && !is_admin() || !$phpcdb->get_calendar($group['cid'])->can_admin()) {
            $html->add(tag('p', __("You do not have permission to delete group: ") . $group['gid']));
            continue;
        }
        if ($phpcdb->delete_group($group['gid'])) {
            $html->add(tag('p', __("Removed group: ") . $group['gid']));
        } else {
            $html->add(tag('p', __("Could not remove group: ") . $group['gid']));
        }
    }
    return message_redirect($html, "{$phpc_script}?action=cadmin&phpcid={$phpcid}");
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:40,代码来源:group_delete.php


示例11: calendar_delete

function calendar_delete()
{
    global $vars, $phpcdb, $phpc_script;
    $html = tag('div', attributes('class="phpc-container"'));
    if (empty($vars["cid"])) {
        $html->add(tag('p', __('No calendar selected.')));
        return $html;
    }
    if (is_array($vars["cid"])) {
        $ids = $vars["cid"];
    } else {
        $ids = array($vars["cid"]);
    }
    if (empty($vars["confirm"])) {
        $list = tag('ul');
        foreach ($ids as $id) {
            $calendar = $phpcdb->get_calendar($id);
            $list->add(tag('li', "{$id}: " . $calendar->get_title()));
        }
        $html->add(tag('p', __('Confirm you want to delete:')));
        $html->add($list);
        $html->add(" [ ", create_action_link(__('Confirm'), "calendar_delete", array("cid" => $ids, "confirm" => "1")), " ] ");
        $html->add(" [ ", create_action_link(__('Deny'), "display_month"), " ] ");
        return $html;
    }
    foreach ($ids as $id) {
        $calendar = $phpcdb->get_calendar($id);
        if (!$calendar->can_admin()) {
            $html->add(tag('p', __("You do not have permission to remove calendar") . ": {$id}"));
            continue;
        }
        if ($phpcdb->delete_calendar($id)) {
            $html->add(tag('p', __("Removed calendar") . ": {$id}"));
        } else {
            $html->add(tag('p', __("Could not remove calendar") . ": {$id}"));
        }
    }
    return message_redirect($html, "{$phpc_script}?action=admin");
}
开发者ID:Godjqb,项目名称:Php-test,代码行数:39,代码来源:calendar_delete.php


示例12: user_delete

function user_delete()
{
    global $vars, $phpcid, $phpcdb, $phpc_script;
    $html = tag('div', attributes('class="phpc-container"'));
    if (!is_admin()) {
        $html->add(tag('p', __('You must be an admin to delete users.')));
        return $html;
    }
    if (empty($vars["uid"])) {
        $html->add(tag('p', __('No user selected.')));
        return $html;
    }
    if (is_array($vars["uid"])) {
        $ids = $vars["uid"];
    } else {
        $ids = array($vars["uid"]);
    }
    if (empty($vars["confirm"])) {
        $list = tag('ul');
        foreach ($ids as $id) {
            $user = $phpcdb->get_user($id);
            $list->add(tag('li', "{$id}: " . $user->get_username()));
        }
        $html->add(tag('p', __('Confirm you want to delete:')));
        $html->add($list);
        $html->add(" [ ", create_action_link(__('Confirm'), "user_delete", array("uid" => $ids, "confirm" => "1")), " ] ");
        $html->add(" [ ", create_action_link(__('Deny'), "display_month"), " ] ");
        return $html;
    }
    foreach ($ids as $id) {
        if ($phpcdb->delete_user($id)) {
            $html->add(tag('p', __("Removed user: {$id}")));
        } else {
            $html->add(tag('p', __("Could not remove user: {$id}")));
        }
    }
    return message_redirect($html, "{$phpc_script}?action=admin&phpcid={$phpcid}");
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:38,代码来源:user_delete.php


示例13: calendar_delete

function calendar_delete()
{
    global $vars, $phpcdb, $phpc_script;
    $html = tag('div', attributes('class="phpc-container"'));
    if (empty($vars["cid"])) {
        $html->add(tag('p', __('No calendar selected.')));
        return $html;
    }
    $id = $vars["cid"];
    $calendar = $phpcdb->get_calendar($id);
    if (empty($calendar)) {
        soft_error(__("Calendar does not exist") . ": {$id}");
    }
    if (!$calendar->can_admin()) {
        soft_error(__("You do not have permission to remove calendar") . ": {$id}");
    }
    if ($phpcdb->delete_calendar($id)) {
        $html->add(tag('p', __("Removed calendar") . ": {$id}"));
    } else {
        $html->add(tag('p', __("Could not remove calendar") . ": {$id}"));
    }
    return message_redirect($html, "{$phpc_script}?action=admin");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:23,代码来源:calendar_delete.php


示例14: group_submit

function group_submit()
{
    global $vars, $phpcdb, $phpc_script, $phpc_cal;
    if (!isset($vars['gid'])) {
        $modify = false;
        if (!isset($vars['cid'])) {
            $cid = null;
            if (!is_admin()) {
                permission_error(__('You do not have permission to add a global group.'));
            }
        } else {
            $cid = $vars['cid'];
            $calendar = $phpcdb->get_calendar($cid);
            if (!$calendar->can_admin()) {
                permission_error(__('You do not have permission to add a group to this calendar.'));
            }
        }
        $gid = $phpcdb->create_group($cid, $vars["name"]);
    } else {
        $modify = true;
        $gid = $vars['gid'];
        $group = $phpcdb->get_group($gid);
        if (!(empty($group['cid']) && is_admin() || $phpcdb->get_calendar($group["cid"])->can_admin())) {
            soft_error(__("You do not have permission to modify this group."));
        }
        $phpcdb->modify_group($gid, $vars['name']);
    }
    $page = "{$phpc_script}?action=cadmin&phpcid=" . $vars['cid'];
    if ($modify) {
        return message_redirect(__("Modified group: ") . $gid, $page);
    }
    if ($gid > 0) {
        return message_redirect(__("Created group: ") . $gid, $page);
    }
    return tag('div', attributes('class="phpc-error"'), __('Error submitting group.'));
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:36,代码来源:group_submit.php


示例15: cadmin_submit

function cadmin_submit()
{
    global $phpcid, $phpc_cal, $vars, $phpcdb, $phpc_script;
    if (!$phpc_cal->can_admin()) {
        return tag('div', __('Permission denied'));
    }
    foreach (get_config_options() as $item) {
        if ($item[2] == PHPC_CHECK) {
            if (isset($vars[$item[0]])) {
                $value = "1";
            } else {
                $value = "0";
            }
        } else {
            if (isset($vars[$item[0]])) {
                $value = $vars[$item[0]];
            } else {
                soft_error($item[0] . __(" was not set."));
            }
        }
        $phpcdb->update_config($phpcid, $item[0], $value);
    }
    return message_redirect(__('Updated options'), "{$phpc_script}?action=cadmin&phpcid={$phpcid}");
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:24,代码来源:cadmin_submit.php


示例16: db_query

            $addtime = $board_time;
            // write postdata
            db_query("INSERT INTO " . $pref . "post SET\n\t\t\t     user_id='" . U_ID . "',\n\t\t\t\t post_time='{$addtime}',\n\t\t\t\t post_text='" . addslashes($text) . "',\n\t\t\t\t guest_name='" . (U_ID == 0 ? $autor : '') . "',\n\t\t\t\t thread_id='{$threadid}',\n\t\t\t\t board_id='{$boardid}',\n\t\t\t\t post_ip='" . getenv('REMOTE_ADDR') . "',\n\t\t\t\t post_smilies='" . (isset($do_smilies) ? '1' : '0') . "',\n\t\t\t\t bcode='" . (isset($b_code) ? '1' : '0') . "',\n\t\t\t\t sendmail='" . (isset($abbo) ? '1' : '0') . "'");
            // update thread --------------------------------------
            $last_post_id = mysql_insert_id();
            $replies = $thread['replies'] + 1;
            db_query("UPDATE " . $pref . "thread SET\n\t\t\t     last_act_time='{$addtime}',\n\t\t\t     last_act_user='{$autor}',\n\t\t\t     last_post_id='{$last_post_id}',\n\t\t\t\t replies='{$replies}'\n\t\t\t WHERE thread_id='{$threadid}'");
            // boarddata
            $posts = $board['posts'] + 1;
            db_query("UPDATE " . $pref . "board SET\n\t\t\t     last_act_time='{$addtime}',\n\t\t\t\t last_post_id='{$last_post_id}',\n\t\t\t\t last_thread_id='{$threadid}',\n\t\t\t\t last_act_user='{$autor}',\n\t\t\t\t last_act_thread='" . addslashes($new['topic']) . "',\n\t\t\t\t posts='{$posts}'\n\t\t\t WHERE board_id='{$boardid}'");
            // update userdata
            if (U_ID != 0) {
                $post_count = U_COUNT + 1;
                db_query("UPDATE " . $pref . "user SET\n\t\t\t\t     user_lastacttime='{$addtime}',\n\t\t\t\t\t post_count='{$post_count}',\n\t\t\t\t\t user_lasttopic='" . addslashes($new['topic']) . "',\n\t\t\t\t\t user_lastpostt='{$addtime}',\n\t\t\t\t\t user_lastpostid='{$last_post_id}'\n\t\t\t\t WHERE user_id='" . U_ID . "'");
            }
            // statiks
            $r_stats = db_query("SELECT\n\t\t\t     posts\n\t\t\t FROM " . $pref . "stats");
            $stats = db_result($r_stats);
            $stats['posts']++;
            db_query("UPDATE " . $pref . "stats SET\n\t\t\t     posts='" . $stats['posts'] . "'");
            // last_act_time
            if (U_ID == 0) {
                db_query("UPDATE " . $pref . "guest SET\n\t\t\t\t     last_act_time='{$addtime}'\n\t\t\t\t WHERE session_id='{$sid}'");
            } else {
                db_query("UPDATE " . $pref . "user SET\n\t\t\t\t     user_lastpostt='{$addtime}'\n\t\t\t\t WHERE user_id='" . U_ID . "'");
            }
            message_redirect('Danke für Deinen Beitrag, bitte warten ...', 'showtopic.php?boardid=' . $boardid . '&threadid=' . $threadid . '&page=last#p' . $last_post_id);
        }
    }
}
echo Output(Template($TBoard));
开发者ID:BackupTheBerlios,项目名称:thwc,代码行数:31,代码来源:reply.php


示例17: process_form


//.........这里部分代码省略.........
        }
    }
    verify_token();
    if (!isset($vars['cid'])) {
        throw new Exception(__("Calendar ID is not set."));
    }
    $cid = $vars['cid'];
    $calendar = $phpcdb->get_calendar($cid);
    if (!$calendar->can_write()) {
        permission_error(__('You do not have permission to write to this calendar.'));
    }
    if ($calendar->can_create_readonly() && !empty($vars['readonly'])) {
        $readonly = true;
    } else {
        $readonly = false;
    }
    $catid = empty($vars['catid']) ? false : $vars['catid'];
    if (!isset($vars['eid'])) {
        $modify = false;
        $eid = $phpcdb->create_event($cid, $phpc_user->get_uid(), $vars["subject"], $vars["description"], $readonly, $catid);
    } else {
        $modify = true;
        $eid = $vars['eid'];
        $phpcdb->modify_event($eid, $vars['subject'], $vars['description'], $readonly, $catid);
        if ($modify_occur) {
            $phpcdb->delete_occurrences($eid);
        }
    }
    foreach ($phpc_cal->get_fields() as $field) {
        $fid = $field['fid'];
        if (empty($vars["phpc-field-{$fid}"])) {
            if ($field['required']) {
                throw new Exception(sprintf(__('Field "%s" is required but was not set.'), $field['name']));
            }
            continue;
        }
        $phpcdb->add_event_field($eid, $fid, $vars["phpc-field-{$fid}"]);
    }
    if ($modify_occur) {
        $occurrences = 0;
        $n = 1;
        $until = $start_ts;
        switch ($vars['repeats']) {
            case 'daily':
                check_input("every-day");
                $n = $vars["every-day"];
                $until = get_timestamp("daily-until");
                break;
            case 'weekly':
                check_input("every-week");
                $n = $vars["every-week"] * 7;
                $until = get_timestamp("weekly-until");
                break;
            case 'monthly':
                check_input("every-month");
                $n = $vars["every-month"];
                $until = get_timestamp("monthly-until");
                break;
            case 'yearly':
                check_input("every-year");
                $n = $vars["every-year"];
                $until = get_timestamp("yearly-until");
                break;
        }
        if ($n < 1) {
            soft_error(__('Increment must be 1 or greater.'));
        }
        while ($occurrences <= 730 && days_between($start_ts, $until) >= 0) {
            $oid = $phpcdb->create_occurrence($eid, $time_type, $start_ts, $end_ts);
            $occurrences++;
            switch ($vars["repeats"]) {
                case 'daily':
                case 'weekly':
                    $start_ts = add_days($start_ts, $n);
                    $end_ts = add_days($end_ts, $n);
                    break;
                case 'monthly':
                    $start_ts = add_months($start_ts, $n);
                    $end_ts = add_months($end_ts, $n);
                    break;
                case 'yearly':
                    $start_ts = add_years($start_ts, $n);
                    $end_ts = add_years($end_ts, $n);
                    break;
                default:
                    break 2;
            }
        }
    }
    if ($eid != 0) {
        if ($modify) {
            $message = __("Modified event: ");
        } else {
            $message = __("Created event: ");
        }
        return message_redirect(tag('', $message, create_event_link($eid, 'display_event', $eid)), "{$phpc_script}?action=display_event&eid={$eid}");
    } else {
        return message_redirect(__('Error submitting event.'), "{$phpc_script}?action=display_month&phpcid={$cid}");
    }
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:101,代码来源:event_form.php


示例18: phpc_updatedb

function phpc_updatedb($dbh)
{
    global $phpc_script, $phpcdb;
    $message_tags = tag('div', tag('div', __("Updating calendar")));
    $updated = false;
    foreach (phpc_table_schemas() as $table) {
        $tags = $table->update($dbh);
        $message_tags->add($tags);
        if (sizeof($tags) > 0) {
            $updated = true;
        }
    }
    $phpcdb->set_config("version", PHPC_DB_VERSION);
    if (!$updated) {
        $message_tags->add(tag('div', __('Already up to date.')));
    }
    message_redirect($message_tags, $phpc_script);
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:18,代码来源:schema.php


示例19: db_query

        }
    }
}
// read styles
$r_style = db_query("SELECT\n     *\n FROM " . $pref . "style WHERE " . $where . " ");
$style = db_result($r_style);
$style['smallfont'] = '<font size="1">';
$style['smallfontend'] = '</font>';
// script basename
$basename = basename($HTTP_SERVER_VARS["SCRIPT_NAME"]);
$data['loginscript'] = $basename;
if ($basename == 'category.php') {
    $data['loginscript'] = $basename . '?catid=' . $catid;
}
if ($basename == 'board.php') {
    $data['loginscript'] = $basename . '?boardid=' . $boardid;
}
if ($basename == 'showtopic.php') {
    $data['loginscript'] = $basename . '?boardid=' . $boardid . '&threadid=' . $threadid;
}
// U_ID == 0 then Logintemplate
if (U_ID == 0) {
    $data['login'] = Template(Get_Template('templates/' . $style['styletemplate'] . '/login.html'));
}
$data['javascript'] = '';
// JUMP ----- if boardid negativ then it is catid
if (isset($boardid)) {
    if ($boardid < 0) {
        message_redirect('Du wirst zur gew&uuml;nschten Kategorie weiter geleitet, bitte warten ...', 'category.php?catid=' . abs($boardid));
    }
}
开发者ID:BackupTheBerlios,项目名称:thwc,代码行数:31,代码来源:header.inc.php


示例20: db_query

<?php

/* $Id: login.php,v 1.3 2003/06/16 18:08:20 master_mario Exp $ */
include 'inc/header.inc.php';
$r_login = db_query("SELECT\n     user_id,\n     user_pw,\n     user_lastacttime\n FROM " . $pref . "user WHERE user_name='" . addslashes($login['name']) . "'");
if (db_rows($r_login) == 1) {
    $a_login = db_result($r_login);
    if (md5(addslashes($login['pw'])) == $a_login['user_pw']) {
        // login --------------------------
        db_query("UPDATE " . $pref . "user SET\n             user_session='" . $sid . "',\n             user_oldsavet='" . $a_login['user_lastacttime'] . "'\n         WHERE user_id='" . $a_login['user_id'] . "'");
        // gast l�schen -------------------
        db_query("DELETE FROM " . $pref . "guest WHERE session_id='{$sid}'");
        db_query("OPTIMIZE TABLE " . $pref . "guest");
        setNewposts($a_login['user_lastacttime']);
        // Weiterleitung ------------------
        message_redirect('Du hast Dich erfolgreich eingeloggt, bitte warten ...', $loginscript);
    } else {
        $TBoard = Get_Template('templates/' . $style['styletemplate'] . '/board.html');
        message('Das Passwort ist falsch.', 'Fehler', 0);
    }
} else {
    $TBoard = Get_Template('templates/' . $style['styletemplate'] . '/board.html');
    message('Es ist kein User mit diesem Namen registriert.', 'Fehler', 0);
}
开发者ID:BackupTheBerlios,项目名称:thwc,代码行数:24,代码来源:login.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP message_remove_contact函数代码示例发布时间:2022-05-15
下一篇:
PHP message_provider_uninstall函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap