Permalink
Browse files

domaintags default change, required for Memcached.

  • Loading branch information...
1 parent f6162e6 commit 03c2a8e5cc927980e4417aad3b9e73581410f9b5 @jamiemccarthy jamiemccarthy committed Jul 15, 2003
Showing with 12 additions and 11 deletions.
  1. +5 −6 Slash/Utility/Data/Data.pm
  2. +7 −5 Slash/Utility/Environment/Environment.pm
View
@@ -1859,18 +1859,17 @@ sub parseDomainTags {
my $user = getCurrentUser();
- # default is 2
- my $udt = exists($user->{domaintags}) ? $user->{domaintags} : 2;
-
- $udt =~ /^(\d+)$/; # make sure it's numeric, sigh
- $udt = 2 if !length($1);
+ # The default is 2 ("always show"); note this default is enforced in
+ # prepareUser(). Note also that if I were being smart I'd use
+ # constants for 0, 1 and 2...
+ my $udt = $user->{domaintags};
my $want_tags = 1; # assume we'll be displaying the [domain.tags]
$want_tags = 0 if # but, don't display them if...
$udt == 0 # the user has said they never want the tags
|| ( # or
$udt == 1 # the user leaves it up to us
- and $recommended # and we think the poster has earned tagless posting
+ && $recommended # and we think the poster has earned tagless posting
);
if ($want_tags && !$notags) {
@@ -1269,6 +1269,7 @@ sub prepareUser {
$user->{exboxes} = _testExStr($user->{exboxes}) if $user->{exboxes};
$user->{extid} = _testExStr($user->{extid}) if $user->{extid};
$user->{points} = 0 unless $user->{willing}; # No points if you dont want 'em
+ $user->{domaintags} = 2 if !defined($user->{domaintags}) || $user->{domaintags} !~ /^\d+$/;
# This is here so when user selects "6 ish" it
# "posted by xxx around 6 ish" instead of "on 6 ish"
@@ -1286,11 +1287,12 @@ sub prepareUser {
$user->{currentPage} = 'misc';
}
- if (($user->{currentPage} eq 'article'
- || $user->{currentPage} eq 'comments')
- && ($user->{commentlimit} > $constants->{breaking}
- && $user->{mode} ne 'archive'
- && $user->{mode} ne 'metamod')) {
+ if ( ( $user->{currentPage} eq 'article'
+ || $user->{currentPage} eq 'comments' )
+ && ( $user->{commentlimit} > $constants->{breaking}
+ && $user->{mode} ne 'archive'
+ && $user->{mode} ne 'metamod' )
+ ) {
$user->{commentlimit} = int($constants->{breaking} / 2);
$user->{breaking} = 1;
} else {

0 comments on commit 03c2a8e

Please sign in to comment.