Pronoun field and display (closes #44)

This commit is contained in:
Xkeeper 2018-03-03 15:43:47 -08:00
parent 7a7e170e75
commit a52ce1e952
5 changed files with 48 additions and 39 deletions

View File

@ -30,9 +30,9 @@
$checked5[$loguser['pagestyle']]='checked=1'; $checked5[$loguser['pagestyle']]='checked=1';
$checked6[$loguser['pollstyle']]='checked=1'; $checked6[$loguser['pollstyle']]='checked=1';
$sexlist=" $sexlist="
$radio=sex value=0 $checked1[0]> Male &nbsp;&nbsp; $radio=sex value=0 $checked1[0]> <strong style='color: #". getnamecolor(0, $loguser['powerlevel'], false) ."'>Male</strong> &nbsp;&nbsp;
$radio=sex value=1 $checked1[1]> Female &nbsp;&nbsp; $radio=sex value=1 $checked1[1]> <strong style='color: #". getnamecolor(1, $loguser['powerlevel'], false) ."'>Female</strong> &nbsp;&nbsp;
$radio=sex value=2 $checked1[2]> N/A"; $radio=sex value=2 $checked1[2]> <strong style='color: #". getnamecolor(2, $loguser['powerlevel'], false) ."'>Other / N/A</strong>";
if ($loguser['sex'] > 2) if ($loguser['sex'] > 2)
$sexlist .= "$radio=sex value=$loguser[sex] checked style=\"display:none;\">"; $sexlist .= "$radio=sex value=$loguser[sex] checked style=\"display:none;\">";
@ -128,8 +128,10 @@
$tccell2l>$txta=signature ROWS=8 COLS=60 style='width: 100%;'>". htmlspecialchars($loguser['signature']) ."</TEXTAREA><tr> $tccell2l>$txta=signature ROWS=8 COLS=60 style='width: 100%;'>". htmlspecialchars($loguser['signature']) ."</TEXTAREA><tr>
$tccellh colspan='2'>Personal information</td><tr> $tccellh colspan='2'>Personal information</td><tr>
$tccell1><b>Gender:$descbr This determines your name color (for now).</td> $tccell1><b>Gender/Name color:$descbr This mostly determines your name color.</td>
$tccell2l>$sexlist<tr> $tccell2l>$sexlist<tr>
$tccell1><b>Pronouns:$descbr You can put your pronouns here (e.g. they/them, he/his, she/hers, etc).</td>
$tccell2l>$inpt=pronouns VALUE=\"". htmlspecialchars($loguser['pronouns']) ."\" SIZE=40 MAXLENGTH=50><tr>
<!-- $tccell1><b>Also known as:$descbr If you go by an alternate alias (or are constantly subjected to name changes), enter it here. It will be displayed in your profile if it doesn't match your current username.</td> <!-- $tccell1><b>Also known as:$descbr If you go by an alternate alias (or are constantly subjected to name changes), enter it here. It will be displayed in your profile if it doesn't match your current username.</td>
$tccell2l>$inpt=aka VALUE=\"$loguser[aka]\" SIZE=25 MAXLENGTH=25><tr> --> $tccell2l>$inpt=aka VALUE=\"$loguser[aka]\" SIZE=25 MAXLENGTH=25><tr> -->
$tccell1><b>Real name:$descbr Your real name (you can leave this blank).</td> $tccell1><b>Real name:$descbr Your real name (you can leave this blank).</td>
@ -272,9 +274,9 @@
`threadsperpage` = '$threadsperpage', `threadsperpage` = '$threadsperpage',
`viewsig` = '$viewsig', `viewsig` = '$viewsig',
`layout` = '$tlayout', `layout` = '$tlayout',
`moodurl` = '". $_POST['moodurl'] ."',". `moodurl` = '". $_POST['moodurl'] ."',
// `posttool` = '$posttool', `imood` = '$imood',
"`imood` = '$imood', `pronouns` = '{$_POST['pronouns']}',
`signsep` = '$signsep', `signsep` = '$signsep',
`pagestyle` = '$pagestyle', `pagestyle` = '$pagestyle',
`pollstyle` = '$pollstyle' `pollstyle` = '$pollstyle'

View File

@ -135,6 +135,7 @@
$hlft Personal information $hrgt $hlft Personal information $hrgt
$lft Sex $rgt$sexlist $lft Sex $rgt$sexlist
$lft Pronouns $rgt$inpt=pronouns VALUE=\"$user[pronouns]\" SIZE=40 MAXLENGTH=50>
$lft Real name $rgt$inpt=realname VALUE=\"$user[realname]\" SIZE=40 MAXLENGTH=60> $lft Real name $rgt$inpt=realname VALUE=\"$user[realname]\" SIZE=40 MAXLENGTH=60>
$lft Location $rgt$inpt=location VALUE=\"$user[location]\" SIZE=40 MAXLENGTH=60> $lft Location $rgt$inpt=location VALUE=\"$user[location]\" SIZE=40 MAXLENGTH=60>
$lft Birthday $rgt Month: $inpt=bmonth SIZE=2 MAXLENGTH=2 VALUE=$month> Day: $inpt=bday SIZE=2 MAXLENGTH=2 VALUE=$day> Year: $inpt=byear SIZE=4 MAXLENGTH=4 VALUE=$year> $lft Birthday $rgt Month: $inpt=bmonth SIZE=2 MAXLENGTH=2 VALUE=$month> Day: $inpt=bday SIZE=2 MAXLENGTH=2 VALUE=$day> Year: $inpt=byear SIZE=4 MAXLENGTH=4 VALUE=$year>

View File

@ -15,7 +15,8 @@
$set['userlink'] = "<a name={$p}></a>{$userlink}"; $set['userlink'] = "<a name={$p}></a>{$userlink}";
$set['date'] = date($dateformat,$post['date']+$tzoff); $set['date'] = date($dateformat,$post['date']+$tzoff);
if($post['location']) { $set['location']="<br>From: {$post['location']}"; } if($post['location']) { $set['location']="From: ". htmlspecialchars($post['location']); }
if($post['pronouns']) { $set['pronouns']="Pronouns: ". htmlspecialchars($post['pronouns']); }
if($post['picture'] || ($post['moodid'] && $post['moodurl'])){ if($post['picture'] || ($post['moodid'] && $post['moodurl'])){
$post['picture'] = str_replace('>','%3E',$post['picture']); $post['picture'] = str_replace('>','%3E',$post['picture']);

View File

@ -211,6 +211,7 @@ $tblend
<br>$tblstart <br>$tblstart
$tccellh colspan=2><center>Personal information<tr> $tccellh colspan=2><center>Personal information<tr>
$tccell1l width=150><b>Real name</td> $tccell2l>$user[realname]&nbsp;<tr> $tccell1l width=150><b>Real name</td> $tccell2l>$user[realname]&nbsp;<tr>
$tccell1l width=150><b>Pronouns</td> $tccell2l>". htmlspecialchars($user['pronouns']) ."&nbsp;<tr>
$tccell1l width=150><b>Location</td> $tccell2l>$user[location]&nbsp;<tr> $tccell1l width=150><b>Location</td> $tccell2l>$user[location]&nbsp;<tr>
$tccell1l width=150><b>Birthday</td> $tccell2l>$birthday $age&nbsp;<tr> $tccell1l width=150><b>Birthday</td> $tccell2l>$birthday $age&nbsp;<tr>
$tccell1l width=150><b>User bio</td> $tccell2l>". dofilters(doreplace2(doreplace($user['bio'], $user['posts'], (ctime()-$user['regdate'])/86400, $user['name']))) ."&nbsp;<tr> $tccell1l width=150><b>User bio</td> $tccell2l>". dofilters(doreplace2(doreplace($user['bio'], $user['posts'], (ctime()-$user['regdate'])/86400, $user['name']))) ."&nbsp;<tr>

View File

@ -1,18 +1,18 @@
<?php <?php
function userfields(){ function userfields(){
return 'posts,sex,powerlevel,birthday,aka,picture,moodurl,title,useranks,location,lastposttime,lastactivity,imood'; return 'posts,sex,powerlevel,birthday,aka,picture,moodurl,title,useranks,location,lastposttime,lastactivity,imood,pronouns';
} }
function postcode($post,$set){ function postcode($post,$set){
global $tzoff, $smallfont, $ip, $quote, $edit, $dateshort, $dateformat, $tlayout, $textcolor, $numdir, $numfil, $tblstart, $hacks, $x_hacks, $loguser; global $tzoff, $smallfont, $ip, $quote, $edit, $dateshort, $dateformat, $tlayout, $textcolor, $numdir, $numfil, $tblstart, $hacks, $x_hacks, $loguser;
$tblend = "</table>"; $tblend = "</table>";
$exp = calcexp($post['posts'],(ctime()-$post['regdate']) / 86400); $exp = calcexp($post['posts'],(ctime()-$post['regdate']) / 86400);
$lvl = calclvl($exp); $lvl = calclvl($exp);
$expleft = calcexpleft($exp); $expleft = calcexpleft($exp);
if ($tlayout == 1) { if ($tlayout == 1) {
$level = "Level: $lvl"; $level = "Level: $lvl";
$poststext = "Posts: "; $poststext = "Posts: ";
@ -21,11 +21,11 @@
$experience = "EXP: $exp<br>For next: $expleft"; $experience = "EXP: $exp<br>For next: $expleft";
$totalwidth = 96; $totalwidth = 96;
$barwidth = $totalwidth-round(@($expleft/totallvlexp($lvl))*$totalwidth); $barwidth = $totalwidth-round(@($expleft/totallvlexp($lvl))*$totalwidth);
if ($barwidth < 1) $barwidth=0; if ($barwidth < 1) $barwidth=0;
if ($barwidth > 0) $baron="<img src=images/$numdir"."bar-on.gif width=$barwidth height=8>"; if ($barwidth > 0) $baron="<img src=images/$numdir"."bar-on.gif width=$barwidth height=8>";
if ($barwidth < $totalwidth) $baroff="<img src=images/$numdir".'bar-off.gif width='.($totalwidth-$barwidth).' height=8>'; if ($barwidth < $totalwidth) $baroff="<img src=images/$numdir".'bar-off.gif width='.($totalwidth-$barwidth).' height=8>';
$bar="<br><img src=images/$numdir"."barleft.gif height=8>$baron$baroff<img src=images/$numdir".'barright.gif height=8>'; $bar="<br><img src=images/$numdir"."barleft.gif height=8>$baron$baroff<img src=images/$numdir".'barright.gif height=8>';
@ -37,32 +37,32 @@
$posttotal = "<img src=numgfx.php?n=$post[posts]&f=$numfil".($post['num']?'':'&l=4')." height=8>"; $posttotal = "<img src=numgfx.php?n=$post[posts]&f=$numfil".($post['num']?'':'&l=4')." height=8>";
$totalwidth = 56; $totalwidth = 56;
$barwidth = $totalwidth-round(@($expleft/totallvlexp($lvl))*$totalwidth); $barwidth = $totalwidth-round(@($expleft/totallvlexp($lvl))*$totalwidth);
if($barwidth<1) $barwidth=0; if($barwidth<1) $barwidth=0;
if($barwidth>0) $baron="<img src=images/$numdir"."bar-on.gif width=$barwidth height=8>"; if($barwidth>0) $baron="<img src=images/$numdir"."bar-on.gif width=$barwidth height=8>";
if($barwidth<$totalwidth) $baroff="<img src=images/$numdir".'bar-off.gif width='.($totalwidth-$barwidth).' height=8>'; if($barwidth<$totalwidth) $baroff="<img src=images/$numdir".'bar-off.gif width='.($totalwidth-$barwidth).' height=8>';
$bar="<br><img src=images/$numdir"."barleft.gif width=2 height=8>$baron$baroff<img src=images/$numdir".'barright.gif width=2 height=8>'; $bar="<br><img src=images/$numdir"."barleft.gif width=2 height=8>$baron$baroff<img src=images/$numdir".'barright.gif width=2 height=8>';
} }
if(!$post['num']){ if(!$post['num']){
$postnum = ''; $postnum = '';
if($postlayout==1) $posttotal="<img src=numgfx.php?n=$post[posts]&f=$numfil&l=4 height=8>"; if($postlayout==1) $posttotal="<img src=numgfx.php?n=$post[posts]&f=$numfil&l=4 height=8>";
} }
$reinf=syndrome(filter_int($post['act'])); $reinf=syndrome(filter_int($post['act']));
if ($post['lastposttime']) { if ($post['lastposttime']) {
$sincelastpost = 'Since last post: '.timeunits(ctime()-$post['lastposttime']); $sincelastpost = 'Since last post: '.timeunits(ctime()-$post['lastposttime']);
} }
$lastactivity = 'Last activity: '.timeunits(ctime()-$post['lastactivity']); $lastactivity = 'Last activity: '.timeunits(ctime()-$post['lastactivity']);
$since = 'Since: '.@date($dateshort,$post['regdate']+$tzoff); $since = 'Since: '.@date($dateshort,$post['regdate']+$tzoff);
$postdate = date($dateformat,$post['date']+$tzoff); $postdate = date($dateformat,$post['date']+$tzoff);
$threadlink = ""; $threadlink = "";
if (filter_string($set['threadlink'])) { if (filter_string($set['threadlink'])) {
$threadlink = ", in $set[threadlink]"; $threadlink = ", in $set[threadlink]";
@ -75,17 +75,17 @@
$sidebars = array(1, 3, 19, 89, 387, 45, 92, 47); $sidebars = array(1, 3, 19, 89, 387, 45, 92, 47);
$sidebars = array(1, 19, 89, 387, 45, 92, 47, 1420, 1090, 2100, 2069); $sidebars = array(19, 89, 387, 45, 92, 47, 1420, 1090, 2100, 2069);
// Large block of user-specific hacks follows // // Large block of user-specific hacks follows //
if ($post['uid'] == 1 && !$x_hacks['host'] && true) { if (false && $post['uid'] == 1 && !$x_hacks['host'] && true) {
global $numdir; global $numdir;
$numdir_ = $numdir; $numdir_ = $numdir;
$numdir = "num3/"; $numdir = "num3/";
if ($post['num']) { if ($post['num']) {
$numtext = generatenumbergfx($post['num'], 1, true) ."<br>". generatenumbergfx($post['posts']); $numtext = generatenumbergfx($post['num'], 1, true) ."<br>". generatenumbergfx($post['posts']);
} else { } else {
@ -246,7 +246,11 @@
$set[userpic]<br> $set[userpic]<br>
". (filter_bool($hacks['noposts']) ? "" : "$poststext$postnum$posttotal<br>") ." ". (filter_bool($hacks['noposts']) ? "" : "$poststext$postnum$posttotal<br>") ."
$experience<br><br> $experience<br><br>
$since<br>".str_ireplace("&lt;br&gt;", "<br>", substr(htmlspecialchars($set['location']),10))."<br><br> $since<br>
". (isset($set['pronouns']) ? "<br>".$set['pronouns'] : "")."
". (isset($set['location']) ? "<br>".$set['location'] : "")."
<br>
<br>
$sincelastpost<br>$lastactivity<br> $sincelastpost<br>$lastactivity<br>
</font> </font>
<br><img src=images/_.gif width=200 height=1> <br><img src=images/_.gif width=200 height=1>
@ -325,7 +329,7 @@
$fcol2 = "#3070a0"; $fcol2 = "#3070a0";
$fcol3 = "#f0f8ff"; $fcol3 = "#f0f8ff";
$lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
@ -366,7 +370,7 @@
$fcol2 = "#eebbff"; $fcol2 = "#eebbff";
$fcol3 = "#000000"; $fcol3 = "#000000";
} }
$lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
@ -421,7 +425,7 @@
$fcol2 = "#a07030"; $fcol2 = "#a07030";
$fcol3 = "#fff0f8"; $fcol3 = "#fff0f8";
$lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
@ -469,7 +473,7 @@
$fcol2 = "#eeeeee"; $fcol2 = "#eeeeee";
$fcol3 = "#000000"; $fcol3 = "#000000";
$lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago"; $lastactivity = 'Active </font>' .timeunits(ctime()-$post[lastactivity]) ."<font color=$fcol2> ago";
$postnum = ($post['num']) ."/"; $postnum = ($post['num']) ."/";
$posttotal = $post['posts']; $posttotal = $post['posts'];
@ -612,7 +616,7 @@
$set[tdbg] style=\"background: $fcol3; padding: 0;\" id=\"post". $post['id'] ."\">$post[headtext]$post[text]$post[signtext]</td>$tblend $set[tdbg] style=\"background: $fcol3; padding: 0;\" id=\"post". $post['id'] ."\">$post[headtext]$post[text]$post[signtext]</td>$tblend
"; ";
} elseif (($post['uid'] == "16" || $post['uid'] == "5") && !$x_hacks['host']) { } elseif (($post['uid'] == "16" || $post['uid'] == "5") && !$x_hacks['host']) {
// top bg #614735 // top bg #614735
@ -622,9 +626,9 @@
if (!function_exists("basestat")) { if (!function_exists("basestat")) {
require 'lib/rpg.php'; require 'lib/rpg.php';
} }
if (!$x_hacks['rpgstats'][$post['uid']]) { if (!$x_hacks['rpgstats'][$post['uid']]) {
$eq = array( $eq = array(
'1' => "<center style=\"text-align: center; color: #b09080;\">(Weapon)</center>", '1' => "<center style=\"text-align: center; color: #b09080;\">(Weapon)</center>",
'2' => "<center style=\"text-align: center; color: #b09080;\">(Armor)</center>", '2' => "<center style=\"text-align: center; color: #b09080;\">(Armor)</center>",
@ -686,7 +690,7 @@
<tr style=\"font-weight: bold;\"><td colspan=2 width=50% style=\"font-variant: small-caps;\">Post$postss</td><td style=\"text-align: right;\" colspan=2 width=50%>$postnum$posttotal</tr> <tr style=\"font-weight: bold;\"><td colspan=2 width=50% style=\"font-variant: small-caps;\">Post$postss</td><td style=\"text-align: right;\" colspan=2 width=50%>$postnum$posttotal</tr>
<tr style=\"font-weight: bold;\"><td colspan=2 width=50% style=\"font-variant: small-caps;\">Counter</td><td style=\"text-align: right;\" colspan=2 width=50%>2</td></tr> <tr style=\"font-weight: bold;\"><td colspan=2 width=50% style=\"font-variant: small-caps;\">Counter</td><td style=\"text-align: right;\" colspan=2 width=50%>2</td></tr>
<tr style=\"font-weight: bold;\"><td>Mv</td><td style=\"text-align: right;\">7</td><td style=\"padding: 0 0 0 5px;\">Jm</td><td style=\"text-align: right;\">26</td></tr> <tr style=\"font-weight: bold;\"><td>Mv</td><td style=\"text-align: right;\">7</td><td style=\"padding: 0 0 0 5px;\">Jm</td><td style=\"text-align: right;\">26</td></tr>
</table> </table>
<table width=100% cellspacing=0 cellpadding=0 style=\"color: #000; font-size: 12px; font-weight: bold;\"> <table width=100% cellspacing=0 cellpadding=0 style=\"color: #000; font-size: 12px; font-weight: bold;\">
<tr style=\"background: #d0bca4;\"><td style=\"font-variant: small-caps;\">Hp</td><td style=\"text-align: right;\" colspan=3>". $st['HP'] ."/". $st['HP'] ."</td></tr> <tr style=\"background: #d0bca4;\"><td style=\"font-variant: small-caps;\">Hp</td><td style=\"text-align: right;\" colspan=3>". $st['HP'] ."/". $st['HP'] ."</td></tr>
@ -709,7 +713,7 @@
<tr ><td colspan=4>". $st['eq'][4] ."</td></tr> <tr ><td colspan=4>". $st['eq'][4] ."</td></tr>
<tr ><td colspan=4>". $st['eq'][5] ."</td></tr> <tr ><td colspan=4>". $st['eq'][5] ."</td></tr>
<tr ><td colspan=4>". $st['eq'][6] ."</td></tr> <tr ><td colspan=4>". $st['eq'][6] ."</td></tr>
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>
@ -729,7 +733,7 @@
<br>$joindate <br>$joindate
<br>$lastactivity</font> <br>$lastactivity</font>
*/ */
} }
// BlackRose/Lain's sidebar // BlackRose/Lain's sidebar
@ -754,7 +758,7 @@
</table><tr> </table><tr>
$set[tdbg] height=220 id=\"post". $post['id'] ."\">$post[headtext]$post[text]$post[signtext]</td> $set[tdbg] height=220 id=\"post". $post['id'] ."\">$post[headtext]$post[text]$post[signtext]</td>
$tblend"; $tblend";
return $brsidebar; return $brsidebar;
} }