aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-08-18 17:46:31 -0400
committerNils Adermann <naderman@naderman.de>2011-08-18 17:46:31 -0400
commitd06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b (patch)
treefc60cf66ef1544b6fc72ac1b5f57d0bf4ae1d923 /phpBB
parent9589fbffe4cdad9fa35df2597c21fc0753ed1d52 (diff)
parent6330153937b9321ce71226a7692403b64ad8e0c7 (diff)
downloadforums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.tar
forums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.tar.gz
forums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.tar.bz2
forums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.tar.xz
forums-d06dcd69e60bc3e6eafb4a11dfb1639fa4e4646b.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/8571] Show age as 0 in birthday list when birthday is in the future. [ticket/8571] Show 'Age: 0' on viewprofile when birthday is in the future. [ticket/8571] Also display age on memberlist/viewprofile when age is 0. Conflicts: phpBB/index.php
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/index.php7
-rw-r--r--phpBB/memberlist.php2
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html2
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_view.html4
4 files changed, 9 insertions, 6 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index 419b66cfdb..63361c43c7 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -98,7 +98,7 @@ if ($config['load_birthdays'] && $config['allow_birthdays'])
{
$birthday_username = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
$birthday_year = (int) substr($row['user_birthday'], -4);
- $birthday_age = ($birthday_year) ? $now['year'] - $birthday_year : '';
+ $birthday_age = ($birthday_year) ? max(0, $now['year'] - $birthday_year) : '';
$template->assign_block_vars('birthdays', array(
'USERNAME' => $birthday_username,
@@ -106,7 +106,10 @@ if ($config['load_birthdays'] && $config['allow_birthdays'])
));
// For 3.0 compatibility
- $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
+ if ($age = (int) substr($row['user_birthday'], -4))
+ {
+ $birthday_list[] = $birthday_username . (($birthday_year) ? ' (' . $birthday_age . ')' : '');
+ }
}
$db->sql_freeresult($result);
}
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index ec245795ad..1b6cb5ef94 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -1699,7 +1699,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f
$diff = ($diff < 0) ? 1 : 0;
}
- $age = (int) ($now['year'] - $bday_year - $diff);
+ $age = max(0, (int) ($now['year'] - $bday_year - $diff));
}
}
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 74f563f17d..f254ed1463 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -28,7 +28,7 @@
<!-- ENDIF -->
<!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}:</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF -->
<!-- IF LOCATION --><dt>{L_LOCATION}:</dt> <dd>{LOCATION}</dd><!-- ENDIF -->
- <!-- IF AGE --><dt>{L_AGE}:</dt> <dd>{AGE}</dd><!-- ENDIF -->
+ <!-- IF AGE !== '' --><dt>{L_AGE}:</dt> <dd>{AGE}</dd><!-- ENDIF -->
<!-- IF OCCUPATION --><dt>{L_OCCUPATION}:</dt> <dd>{OCCUPATION}</dd><!-- ENDIF -->
<!-- IF INTERESTS --><dt>{L_INTERESTS}:</dt> <dd>{INTERESTS}</dd><!-- ENDIF -->
<!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html
index c24c93a8fa..5059be1cf9 100644
--- a/phpBB/styles/subsilver2/template/memberlist_view.html
+++ b/phpBB/styles/subsilver2/template/memberlist_view.html
@@ -148,10 +148,10 @@
<td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_LOCATION}: </td>
<td><!-- IF LOCATION --><b class="genmed">{LOCATION}</b><!-- ENDIF --></td>
</tr>
- <!-- IF AGE -->
+ <!-- IF AGE !== '' -->
<tr>
<td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_AGE}: </td>
- <td><b class="genmed"><!-- IF AGE -->{AGE}<!-- ELSE --> - <!-- ENDIF --></b></td>
+ <td><b class="genmed">{AGE}</b></td>
</tr>
<!-- ENDIF -->
<tr>