本文整理汇总了PHP中getReferralPage函数的典型用法代码示例。如果您正苦于以下问题:PHP getReferralPage函数的具体用法?PHP getReferralPage怎么用?PHP getReferralPage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getReferralPage函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAlert
addAlert("danger", lang("ACCESS_DENIED"));
if (isset($_POST['ajaxMode']) and $_POST['ajaxMode'] == "true") {
echo json_encode(array("errors" => 1, "successes" => 0));
} else {
header('Location: ../pm.php');
}
exit;
}
if (isset($msg_id) && $msg_id >= 1) {
$parent_id = $msg_id;
} else {
$parent_id = NULL;
}
// Call the function to create a message with the required data
if ($isreply = '0' or '1') {
if (!createMessage($sender_id, $receiver_id, $title, $message, $parent_id)) {
echo json_encode(array("errors" => 1, "successes" => 0));
exit;
}
} else {
addAlert("danger", "some bad data here");
echo json_encode(array("errors" => 1, "successes" => 0));
exit;
}
restore_error_handler();
if (isset($_POST['ajaxMode']) and $_POST['ajaxMode'] == "true") {
echo json_encode(array("errors" => 0, "successes" => 1));
} else {
header('Location: ' . getReferralPage());
exit;
}
示例2: foreach
// Add alerts for any failed input validation
foreach ($validator->errors as $error) {
addAlert("danger", $error);
}
if (count($validator->errors) > 0) {
apiReturnError($ajax, getReferralPage());
}
if ($user_id) {
// Special case to load groups for the logged in user
if ($user_id == "0") {
$user_id = $loggedInUser->user_id;
}
// Attempt to load group information for the specified user.
if (!($results = loadUserGroups($user_id))) {
apiReturnError($ajax, getReferralPage());
}
} else {
if ($group_id) {
// Attempt to load information for the specified group.
if (!($results = loadGroup($group_id))) {
apiReturnError($ajax, getReferralPage());
}
} else {
// Attempt to load information for all groups
if (!($results = loadGroups())) {
apiReturnError($ajax, getReferralPage());
}
}
}
restore_error_handler();
echo json_encode($results);
示例3: checkLoggedInUser
function checkLoggedInUser($ajax)
{
if (!isUserLoggedIn()) {
addAlert("danger", lang("LOGIN_REQUIRED"));
apiReturnError($ajax, getReferralPage());
}
}
示例4: explode
} else {
$error_count++;
}
}
}
// Add groups
if (!empty($add_groups)) {
// Convert string of comma-separated group_id's into array
$group_ids_arr = explode(',', $add_groups);
foreach ($group_ids_arr as $group_id) {
if (addUserToGroup($user_id, $group_id)) {
$success_count++;
} else {
$error_count++;
}
}
}
// Set primary group (must be done after group membership is set)
if ($primary_group_id && $userdetails['primary_group_id'] != $primary_group_id) {
if (updateUserPrimaryGroup($user_id, $primary_group_id)) {
$success_count++;
} else {
$error_count++;
}
}
restore_error_handler();
if ($error_count > 0) {
apiReturnError($ajax, getReferralPage());
} else {
apiReturnSuccess($ajax, getReferralPage());
}
示例5: json_encode
require_once "../models/config.php";
// Recommended admin-only access
if (!securePage(__FILE__)) {
if (isset($_POST['ajaxMode']) and $_POST['ajaxMode'] == "true") {
echo json_encode(array("errors" => 1, "successes" => 0));
} else {
header("Location: " . getReferralPage());
}
exit;
}
$validator = new Validator();
// Look up specified user
$selected_user_id = $validator->requiredGetVar('id');
if (!is_numeric($selected_user_id) || !userIdExists($selected_user_id)) {
addAlert("danger", "I'm sorry, the user id you specified is invalid!");
header("Location: " . getReferralPage());
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>PHP Reports Admin - User Details</title>
<?php