From 816f9b3de5ace2a2a1ad5ae8fe2facdc72868b9d Mon Sep 17 00:00:00 2001 From: Git Date: Mon, 3 Dec 2012 08:00:16 +0000 Subject: [PATCH] Empty commit --- classes/class_text.php | 20 +++++++++++++++++++- sections/forums/thread.php | 11 +++++------ sections/user/edit.php | 9 +++++++++ sections/user/takeedit.php | 1 + 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/classes/class_text.php b/classes/class_text.php index 384c497b..1df1fc8a 100644 --- a/classes/class_text.php +++ b/classes/class_text.php @@ -1,7 +1,7 @@ max number of attributes - private $ValidTags = array('b'=>0, 'u'=>0, 'i'=>0, 's'=>0, '*'=>0, '#'=>0, 'artist'=>0, 'user'=>0, 'n'=>0, 'inlineurl'=>0, 'inlinesize'=>1, 'headline'=>1, 'align'=>1, 'color'=>1, 'colour'=>1, 'size'=>1, 'url'=>1, 'img'=>1, 'quote'=>1, 'pre'=>1, 'code'=>1, 'tex'=>0, 'hide'=>1, 'plain'=>0, 'important'=>0, 'torrent'=>0, 'rule'=>0, + private $ValidTags = array('b'=>0, 'u'=>0, 'i'=>0, 's'=>0, '*'=>0, '#'=>0, 'artist'=>0, 'user'=>0, 'n'=>0, 'inlineurl'=>0, 'inlinesize'=>1, 'headline'=>1, 'align'=>1, 'color'=>1, 'colour'=>1, 'size'=>1, 'url'=>1, 'img'=>1, 'quote'=>1, 'pre'=>1, 'code'=>1, 'tex'=>0, 'hide'=>1, 'plain'=>0, 'important'=>0, 'torrent'=>0, 'rule'=>0, 'mature'=>1, ); private $Smileys = array( @@ -463,6 +463,9 @@ private function parse ($Str) { case 'hide': $Array[$ArrayPos] = array('Type'=>'hide', 'Attr'=>$Attrib, 'Val'=>$this->parse($Block)); break; + case 'mature': + $Array[$ArrayPos] = array('Type'=>'mature', 'Attr'=>$Attrib, 'Val'=>$this->parse($Block)); + break; case '#': case '*': $Array[$ArrayPos] = array('Type'=>'list'); @@ -699,6 +702,21 @@ private function to_html ($Array) { $Str.=''.(($Block['Attr']) ? $Block['Attr'] : 'Hidden text').': Show'; $Str.=''; break; + case 'mature': + global $LoggedUser; + if($LoggedUser['EnableMatureContent']) { + if(!empty($Block['Attr'])) { + $Str.='Mature content: ' . $Block['Attr'] . '
Show'; + $Str.=''; + } + else { + $Str .= 'Use of the [mature] tag requires a description. The correct format is as follows: [mature=description] ...content... [/mature], where "description" is a mandatory description of the post. Misleading descriptions will be penalized. For further information on our mature content policies, please refer to this wiki.'; + } + } + else { + $Str .= 'Mature content has been blocked. You can choose to view mature content by editing your settings.'; + } + break; case 'img': if($this->NoImg>0 && $this->valid_url($Block['Val'])) { $Str.=''.$Block['Val'].' (image)'; diff --git a/sections/forums/thread.php b/sections/forums/thread.php index ea447aaf..8a951cea 100644 --- a/sections/forums/thread.php +++ b/sections/forums/thread.php @@ -144,12 +144,11 @@ $DB->query("UPDATE users_notify_quoted SET Unread = '0' WHERE UserID = '$LoggedUser[ID]' AND TopicID = '$ThreadID'"); -$QuoteNotifiactionsCount = $Cache->get_value('forums_quotes_'.$LoggedUser['ID']); -if($QuoteNotificationsCount > 0) { - $Cache->cache_value('forums_quotes_'.$LoggedUser['ID'], $QuoteNotificationsCount - 1, 0); -} -else { - $Cache->delete_value('forums_quotes_'.$LoggedUser['ID']); +$QuoteNotificationsCount = $Cache->get_value('forums_quotes_' . $LoggedUser['ID']); +if ($QuoteNotificationsCount > 0) { + $Cache->cache_value('forums_quotes_' . $LoggedUser['ID'], $QuoteNotificationsCount - 1, 0); +} else { + $Cache->delete_value('forums_quotes_' . $LoggedUser['ID']); } // Start printing diff --git a/sections/user/edit.php b/sections/user/edit.php index 3c4e4e63..96ef4756 100644 --- a/sections/user/edit.php +++ b/sections/user/edit.php @@ -220,6 +220,15 @@ function checked($Checked) { + + + Mature Content + + checked="checked" /> + + + + Avatars diff --git a/sections/user/takeedit.php b/sections/user/takeedit.php index 3349b1f2..cc9a5cfe 100644 --- a/sections/user/takeedit.php +++ b/sections/user/takeedit.php @@ -190,6 +190,7 @@ $Options['ShowTags'] = (!empty($_POST['showtags']) ? 1 : 0); $Options['AutoSubscribe'] = (!empty($_POST['autosubscribe']) ? 1 : 0); $Options['DisableSmileys'] = (!empty($_POST['disablesmileys']) ? 1 : 0); +$Options['EnableMatureContent'] = (!empty($_POST['enablematurecontent']) ? 1 : 0); $Options['DisableAvatars'] = db_string($_POST['disableavatars']); $Options['Identicons'] = (!empty($_POST['identicons']) ? (int) $_POST['identicons'] : 0); $Options['DisablePMAvatars'] = (!empty($_POST['disablepmavatars']) ? 1 : 0);