alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[livejournal] r19804: LJSUP-9482: Replace ad slots for singapo...

Committer: afedorov
LJSUP-9482: Replace ad slots for singapore.sg

U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2011-08-22 07:42:53 UTC (rev 19803)
+++ trunk/cgi-bin/LJ/User.pm	2011-08-23 03:34:47 UTC (rev 19804)
@@ -1821,16 +1821,19 @@
     croak "Invalid user object" unless LJ::isu($u);
 
     my $gender = $u->prop('gender') || '';
+    $gender = uc(substr($gender, 0, 1));
     if ($format eq '6a') {
         if ($gender && $gender !~ /^U/i) {
-            return uc(substr($gender, 0, 1)); # M|F
+            return $gender; # M|F
         } else {
             return "unspecified";
         }
     } elsif ($format eq 'dc') {
-        $gender = uc(substr($gender, 0, 1)) || '';
         return  ($gender eq 'M') ? 1 :
                 ($gender eq 'F') ? 2 : 0;
+    } elsif ($format eq 'ga') {
+        return  ($gender eq 'M') ? 'male' :
+                ($gender eq 'F') ? 'female' : 'all';
     } else {
         return;
     }

Tags: livejournal, pm, red_alf
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments