本文整理汇总了PHP中Lookup::Pronoun方法的典型用法代码示例。如果您正苦于以下问题:PHP Lookup::Pronoun方法的具体用法?PHP Lookup::Pronoun怎么用?PHP Lookup::Pronoun使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lookup
的用法示例。
在下文中一共展示了Lookup::Pronoun方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$r = $personInfo[0];
$fname = $r["fname"];
//First Name
$lname = $r["lname"];
//Last Name
$dob = $r["dob"];
//Date of Birth
$domail = $r["do_mail"];
//Can we email them?
$gender_index = $r["gender"];
//Gender
$bio = $r["bio"];
//Biography
$gender = Lookup::Gender($gender_index);
//Gender string
$pronoun = Lookup::Pronoun($gender_index);
//Pronoun to describe user's gender
$privacy = json_decode($r["privacy"], true);
//The privacy array
$privacy = !$privacy ? array() : $privacy;
$rank = json_decode($r["rank"], true);
//The user's rankings
} catch (Exception $e) {
}
?>
<div id="edit_profile" class="profile_tab_content">
<div class="edit_parent">
<div id="change_info" class="edit_section">
<h3>Basics</h3>
<input type="text" id="user_fname" name="fname" class="small_text uk-width-2-3" placeholder="First Name" value="<?php
echo $fname;
示例2: offer
private function offer($id, $offer)
{
global $con;
if (!isset($id) || !isset($offer)) {
return 401;
} else {
if (!isset($_SESSION)) {
return 403;
} else {
$offer_info = $this->get(array("id" => $offer));
if (trim($offer_info[0]["usr"]) != $_SESSION["userid"]) {
return 406;
exit;
}
$item_info = $this->get(array("id" => $id));
$offer_array = json_decode($item_info[0]["offers"], true);
if (!is_array($offer_array)) {
$offer_array = array();
}
$msg = "";
$remindex = -1;
for ($i = 0; $i < count($offer_array); $i++) {
if ($offer_array[$i]["id"] == $offer) {
$remindex = $i;
}
}
if ($remindex == -1) {
$new_offer = array("id" => $offer, "timestamp" => time());
array_push($offer_array, $new_offer);
$this->update($offer, array("status" => "2"), array());
$update_query = "UPDATE `item` SET `offers`='" . mysqli_real_escape_string($con, json_encode($offer_array)) . "' WHERE `id`='" . mysqli_real_escape_string($con, $id) . "'";
mysqli_query($con, $update_query);
$offeredItem = new Item(array("action" => "get", "filter[id]" => $offer));
$offeredInfo = $offeredItem->run();
$name = $offeredInfo[0]["name"];
if (!$_SESSION["userid"] || $_SESSION["userid"] != $offeredInfo[0]["usr"]) {
return 401;
exit;
}
$offerAuth = new User(array("action" => "get", "id" => $offeredInfo[0]["usr"]));
$authInfo = $offerAuth->run();
$offermsg = $authInfo[0]["fname"] . " made an offer on your item: " . $item_info[0]["name"];
$link = "view.php?itemid=" . $item_info[0]["id"] . "&userid=" . $item_info[0]["usr"];
sendNotify($item_info[0]["usr"], $offermsg, $link);
$vowels = array('a', 'e', 'i', 'o', 'u');
$a_str = in_array($item_info[0]["name"][0], $vowels) ? "an" : "a";
$pronoun = Lookup::Pronoun($authInfo[0]["gender"]);
$feed = new Feed();
$feed->add($_SESSION["userid"], "offered {$pronoun} {$offeredInfo[0]["name"]} for {$a_str} {$item_info[0]["name"]}", time(), $link);
} else {
$query = "UPDATE `item` SET `status`='1' WHERE `id`='" . mysqli_real_escape_string($con, $offer) . "'";
mysqli_query($con, $query);
unset($offer_array[$remindex]);
}
return 200;
}
}
}