diff --git a/editpost.php b/editpost.php index b12596a..a3b671d 100644 --- a/editpost.php +++ b/editpost.php @@ -134,6 +134,7 @@ $ppost['signtext']=$sign; $ppost['text']=$message; $ppost['options']=$poptions; + $ppost['moodid']=$_POST['moodid']; // Edited notice $ppost['edited'] = $edited; @@ -152,7 +153,7 @@ $tblend
$tblstart $tccellh width=150> $tccellh colspan=2>  $tccell1>Header: $tccell2l width=800px valign=top>$txta=head ROWS=8 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\">". htmlspecialchars($head) ." - $tccell2l width=* rowspan=3>".moodlist($moodid)." + $tccell2l width=* rowspan=3>".moodlist($ppost['moodid'])." $tccell1>Post: $tccell2l width=800px valign=top>$txta=message ROWS=12 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\">". htmlspecialchars($message) ." $tccell1>Signature: $tccell2l width=800px valign=top>$txta=sign ROWS=8 COLS=$numcols style=\"width: 100%; max-width: 800px; resize:vertical;\">". htmlspecialchars($sign) ." $tccell1> $tccell2l colspan=2> diff --git a/faq.php b/faq.php index 774fee0..1fad95f 100644 --- a/faq.php +++ b/faq.php @@ -45,7 +45,7 @@
  • Don't be a jerk. If you don't have something constructive to say, don't say it!
  • No slurs, hate speech, or homo-/trans-phobia. If you can't respect your fellow posters, you aren't welcome here.
  • Post legibly. Keep it readable — you don't have to be perfect, but be understandable and don't post like this is an AOL chatroom. -
  • Don't spam. Posting over and over without adding to a conversation is annoying. +
  • Don't spam. Posting over and over without adding to a conversation is annoying.
  • Don't get in fights. If you're having trouble with another user, contact an administrator.
  • No illegal content. Don't post stuff that would get you (or us) in legal trouble. @@ -171,6 +171,10 @@ &lvllen& EXP needed to go through your current level. + + &mood& + Selected mood number for this post (default: 0) + For an explanation of how the Level and EXP tags work, hover over the highlighted parts below. (The percentages are useful when creating 'EXP bars', as you can use them as a width value.)
    diff --git a/lib/function.php b/lib/function.php index c7bab23..4404c8e 100644 --- a/lib/function.php +++ b/lib/function.php @@ -500,7 +500,9 @@ function escape_codeblock($text) { return "

    ". str_replace($list, $list2, $text[0]) ."

    "; } -function doreplace2($msg, $options='0|0'){ +function doreplace2($msg, $options = null, $mood = 0) { + // @TODO php7.4 or w/e null coalescing + if ($options === null) $options = '0|0'; // options will contain smiliesoff|htmloff $options = explode("|", $options); $smiliesoff = $options[0]; @@ -526,15 +528,19 @@ function doreplace2($msg, $options='0|0'){ } } - $msg=str_replace('[red]', '',$msg); - $msg=str_replace('[green]', '',$msg); - $msg=str_replace('[blue]', '',$msg); - $msg=str_replace('[orange]','',$msg); - $msg=str_replace('[yellow]','',$msg); - $msg=str_replace('[pink]', '',$msg); - $msg=str_replace('[white]', '',$msg); - $msg=str_replace('[black]', '' ,$msg); - $msg=str_replace('[/color]','',$msg); + // &mood& pseudo-tag + $msg=str_replace('&mood&', $mood, $msg); + + $msg=str_replace('[red]', '', $msg); + $msg=str_replace('[green]', '', $msg); + $msg=str_replace('[blue]', '', $msg); + $msg=str_replace('[orange]','', $msg); + $msg=str_replace('[yellow]','', $msg); + $msg=str_replace('[pink]', '', $msg); + $msg=str_replace('[white]', '', $msg); + $msg=str_replace('[black]', '', $msg); + $msg=str_replace('[/color]','', $msg); + $msg=preg_replace("'\[quote=(.*?)\]'si", '
    Originally posted by \\1
    ', $msg); $msg=str_replace('[quote]','

    ',$msg); $msg=str_replace('[/quote]','
    ',$msg); @@ -1114,7 +1120,7 @@ function boardmessage($text, $title = "Message") { function moodlist($sel = 0, $return = false) { global $loguserid, $log, $loguser; - //$sel = $sel; + $sel = intval($sel); $moodlist = array( "(default)", @@ -1141,7 +1147,7 @@ function moodlist($sel = 0, $return = false) { $ret = "\n"; diff --git a/lib/threadpost.php b/lib/threadpost.php index c94653d..9d628d7 100644 --- a/lib/threadpost.php +++ b/lib/threadpost.php @@ -7,9 +7,9 @@ $set['bg'] = ${"tablebg$bg"}; $set['tdbg'] = "'uid'), $linkclass); - unset($postuser); + $linkclass = "url".$post['uid']; + $userlink = getuserlink($post, array('id'=>'uid'), $linkclass); + unset($postuser); $set['userrank'] = getrank($post['useranks'],str_replace("idiot", $post['title']),$post['posts'],$post['powerlevel']); $set['userlink'] = "{$userlink}"; @@ -37,7 +37,7 @@ $set['threadlink'] = "{$pthread['title']}"; } - $post['text']=doreplace2($post['text'], $post['options']); + $post['text']=doreplace2($post['text'], $post['options'], $post['moodid']); if (filter_int($post['editdate'])) { $post['edited'] = " (last edited by {$post['edited']} at ".date($dateformat,$post['editdate']+$tzoff).")"; @@ -98,8 +98,8 @@ $post['headtext']=doreplace($post['headtext'],$post['num'],($post['date']-$post['regdate'])/86400,$post['name']); $post['signtext']=doreplace($post['signtext'],$post['num'],($post['date']-$post['regdate'])/86400,$post['name']); } - $post['headtext']=doreplace2($post['headtext']); - $post['signtext']=doreplace2($post['signtext']); + $post['headtext']=doreplace2($post['headtext'], null, $post['moodid']); + $post['signtext']=doreplace2($post['signtext'], null, $post['moodid']); // $post['text']=doreplace2($post['text'], $post['options']); return $post; }