Show age restriction icon in site scheme entry and reply pages.

        Patch by fu. 

diffs (80 lines):

diff -r 1d5cfe1a8dab -r 64626eb6ccee bin/upgrading/en.dat
--- a/bin/upgrading/en.dat      Tue Apr 19 17:05:23 2011 +0800
+++ b/bin/upgrading/en.dat      Tue Apr 19 17:47:18 2011 +0800
@@ -3734,6 +3734,10 @@ taglib.error.mergetoexisting=The tag nam
 
 taglib.error.toomany2=This would make you exceed your maximum of [[max]] tags. 
 Please remove at least [[excess]] of the following new tags: [[tags]].
 
+talk.agerestriction.18plus=18+
+
+talk.agerestriction.nsfw=NSFW
+
 talk.anonwrote=Someone wrote,
 
 talk.anonwrote_comm=Someone wrote in [[commlink]],
diff -r 1d5cfe1a8dab -r 64626eb6ccee cgi-bin/imageconf.pl
--- a/cgi-bin/imageconf.pl      Tue Apr 19 17:05:23 2011 +0800
+++ b/cgi-bin/imageconf.pl      Tue Apr 19 17:47:18 2011 +0800
@@ -371,14 +371,14 @@ our %img;
     src => '/icon_nsfw.png',
     width => 16,
     height => 16,
-    alt => '',  # S2::PROPS
+    alt => 'talk.agerestriction.nsfw',  # overridden by S2::PROPS
 };
 
 $img{'adult-18'} = {
     src => '/icon_18.png',
     width => 16,
     height => 16,
-    alt => '',  # S2::PROPS
+    alt => 'talk.agerestriction.18plus',  # overridden by S2::PROPS
 };
 
 $img{'sticky-entry'} = {
diff -r 1d5cfe1a8dab -r 64626eb6ccee htdocs/talkpost.bml
--- a/htdocs/talkpost.bml       Tue Apr 19 17:05:23 2011 +0800
+++ b/htdocs/talkpost.bml       Tue Apr 19 17:47:18 2011 +0800
@@ -303,8 +303,17 @@ body<=
         }
     }
 
-    $sec .= "<br />\n" unless $sec eq "" or $parpost->{'subject'};
-    $ret .= $sec;
+    # age restriction settings
+    my $age_restriction = "";
+    my $entry_age_prop = $item->{props}->{adult_content} || "";
+    if ( $entry_age_prop eq "explicit" ) {
+        $age_restriction = LJ::img( "adult-18" );
+    } elsif ( $entry_age_prop eq "concepts" ) {
+        $age_restriction = LJ::img( "adult-nsfw" );
+    }
+
+    $ret .= $sec . $age_restriction;
+    $ret .= "<br />\n" unless ( $sec eq "" && $age_restriction eq "" ) or 
$parpost->{subject};
 
     ###
     if ($parpost->{'subject'}) {
diff -r 1d5cfe1a8dab -r 64626eb6ccee htdocs/talkread.bml
--- a/htdocs/talkread.bml       Tue Apr 19 17:05:23 2011 +0800
+++ b/htdocs/talkread.bml       Tue Apr 19 17:47:18 2011 +0800
@@ -309,8 +309,17 @@ body<=
         }
     }
 
-    $sec .= "<br />\n" unless $sec eq "" or $item->{'subject'};
-    $ret .= $sec;
+    # age restriction settings
+    my $age_restriction = "";
+    my $entry_age_prop = $item->{props}->{adult_content} || "";
+    if ( $entry_age_prop eq "explicit" ) {
+        $age_restriction = LJ::img( "adult-18" );
+    } elsif ( $entry_age_prop eq "concepts" ) {
+        $age_restriction = LJ::img( "adult-nsfw" );
+    }
+
+    $ret .= $sec . $age_restriction;
+    $ret .= "<br />\n" unless ( $sec eq "" && $age_restriction eq "" ) or 
$item->{subject};
 
     ###
     if ($item->{'subject'}) {
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to