mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Enable display of birthday listing ... controlled via ACP Load Settings
git-svn-id: file:///svn/phpbb/trunk@4034 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
70634a792e
commit
9ce38e6977
6 changed files with 70 additions and 10 deletions
|
@ -331,6 +331,7 @@ switch ($mode)
|
|||
$activation_none = ($new['require_activation'] == USER_ACTIVATION_NONE) ? 'checked="checked"' : '';
|
||||
$activation_user = ($new['require_activation'] == USER_ACTIVATION_SELF) ? 'checked="checked"' : '';
|
||||
$activation_admin = ($new['require_activation'] == USER_ACTIVATION_ADMIN) ? 'checked="checked"' : '';
|
||||
$activation_user_admin = ($new['require_activation'] == USER_ACTIVATION_SELF_ADMIN) ? 'checked="checked"' : '';
|
||||
$activation_disable = ($new['require_activation'] == USER_ACTIVATION_DISABLE) ? 'checked="checked"' : '';
|
||||
|
||||
$privmsg_on = (!$new['privmsg_disable']) ? 'checked="checked"' : '';
|
||||
|
@ -356,11 +357,11 @@ switch ($mode)
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['ACC_ACTIVATION']; ?>: <br /><span class="gensmall"><?php echo $user->lang['ACC_ACTIVATION_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /><?php echo $user->lang['ACC_NONE']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /><?php echo $user->lang['ACC_USER']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /><?php echo $user->lang['ACC_ADMIN']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /><?php echo $user->lang['ACC_DISABLE']; ?></td>
|
||||
<td class="row2"><input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /> <?php echo $user->lang['ACC_NONE']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /> <?php echo $user->lang['ACC_USER']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /> <?php echo $user->lang['ACC_ADMIN']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF_ADMIN; ?>" <?php echo $activation_user_admin; ?> /> <?php echo $user->lang['ACC_USER_ADMIN']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /> <?php echo $user->lang['ACC_DISABLE']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['VISUAL_CONFIRM']; ?>: <br /><span class="gensmall"><?php echo $user->lang['VISUAL_CONFIRM_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="enable_confirm" value="1"<?php echo $confirm_enabled ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="enable_confirm" value="0" <?php echo $confirm_disabled ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
<td class="row2"><input type="radio" name="enable_confirm" value="1"<?php echo $confirm_enabled ?> /> <?php echo $user->lang['YES'] ?> <input type="radio" name="enable_confirm" value="0" <?php echo $confirm_disabled ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -538,6 +539,8 @@ switch ($mode)
|
|||
$load_db_lastread_no = (!$new['load_db_lastread']) ? 'checked="checked"' : '';
|
||||
$load_online_yes = ($new['load_online']) ? 'checked="checked"' : '';
|
||||
$load_online_no = (!$new['load_online']) ? 'checked="checked"' : '';
|
||||
$load_birthdays_yes = ($new['load_birthdays']) ? 'checked="checked"' : '';
|
||||
$load_birthdays_no = (!$new['load_birthdays']) ? 'checked="checked"' : '';
|
||||
$moderators_yes = ($new['load_moderators']) ? 'checked="checked"' : '';
|
||||
$moderators_no = (!$new['load_moderators']) ? 'checked="checked"' : '';
|
||||
$search_yes = ($new['load_search']) ? 'checked="checked"' : '';
|
||||
|
@ -576,6 +579,10 @@ switch ($mode)
|
|||
<td class="row1"><?php echo $user->lang['VIEW_ONLINE_TIME']; ?>: <br /><span class="gensmall"><?php echo $user->lang['VIEW_ONLINE_TIME_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="4" maxlength="3" name="load_online_time" value="<?php echo $new['load_online_time']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['YES_BIRTHDAYS']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="load_birthdays" value="1"<?php echo $load_birthdays_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_birthdays" value="0" <?php echo $load_birthdays_no ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['YES_MODERATORS']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="load_moderators" value="1"<?php echo $moderators_yes ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="load_moderators" value="0" <?php echo $moderators_no ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
|
|
|
@ -47,6 +47,7 @@ class ucp_profile extends ucp
|
|||
'string' => array(
|
||||
'username' => '2,30',
|
||||
'email' => '7,60',
|
||||
'email_confirm' => '7,60',
|
||||
'password_confirm' => '6,255',
|
||||
'new_password' => '6,255',
|
||||
'cur_password' => '6,255',
|
||||
|
@ -59,6 +60,7 @@ class ucp_profile extends ucp
|
|||
'compare' => array(
|
||||
'password_confirm' => ($data['new_password']) ? $data['new_password'] : '',
|
||||
'cur_password' => ($data['new_password'] || $data['email'] != $user->data['user_email']) ? $user->data['user_password'] : '',
|
||||
'email_confirm' => ($data['email'] != $user->data['user_email']) ? $data['email'] : '',
|
||||
),
|
||||
'function' => array(
|
||||
'username' => ($data['username'] != $user->data['username']) ? 'validate_username' : '',
|
||||
|
@ -147,7 +149,7 @@ class ucp_profile extends ucp
|
|||
'user_from' => $data['location'],
|
||||
'user_occ' => $data['occupation'],
|
||||
'user_interests'=> $data['interests'],
|
||||
'user_birthday' => implode('-', array($data['bday_day'], $data['bday_month'], $data['bday_year'])),
|
||||
'user_birthday' => sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']),
|
||||
);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
|
@ -170,14 +172,14 @@ class ucp_profile extends ucp
|
|||
list($bday_day, $bday_month, $bday_year) = explode('-', $user->data['user_birthday']);
|
||||
}
|
||||
|
||||
$s_birthday_day_options = '';
|
||||
$s_birthday_day_options = '<option value="0"' . ((!$bday_day) ? ' selected="selected"' : '') . '>--</option>';
|
||||
for ($i = 1; $i < 32; $i++)
|
||||
{
|
||||
$selected = ($i == $bday_day) ? ' selected="selected"' : '';
|
||||
$s_birthday_day_options .= "<option value=\"$i\"$selected>$i</option>";
|
||||
}
|
||||
|
||||
$s_birthday_month_options = '';
|
||||
$s_birthday_month_options = '<option value="0"' . ((!$bday_month) ? ' selected="selected"' : '') . '>--</option>';
|
||||
for ($i = 1; $i < 13; $i++)
|
||||
{
|
||||
$selected = ($i == $bday_month) ? ' selected="selected"' : '';
|
||||
|
@ -186,6 +188,7 @@ class ucp_profile extends ucp
|
|||
$s_birthday_year_options = '';
|
||||
|
||||
$now = getdate();
|
||||
$s_birthday_year_options = '<option value="0"' . ((!$bday_year) ? ' selected="selected"' : '') . '>--</option>';
|
||||
for ($i = $now['year'] - 100; $i < $now['year']; $i++)
|
||||
{
|
||||
$selected = ($i == $bday_year) ? ' selected="selected"' : '';
|
||||
|
|
|
@ -110,6 +110,31 @@ while ($row = $db->sql_fetchrow($result))
|
|||
{
|
||||
$legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</span>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
// Generate birthday list if required ...
|
||||
$birthday_list = '';
|
||||
if ($config['load_birthdays'])
|
||||
{
|
||||
$now = getdate();
|
||||
$sql = 'SELECT user_id, username, user_colour, user_birthday
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_birthday LIKE '" . sprintf('%2d-%2d-', $now['mday'], $now['mon']) . "%'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '';
|
||||
$birthday_list .= (($birthday_list != '') ? ', ' : '') . '<a' . $user_colour . " href=\"memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $row['username'] . '</a>';
|
||||
|
||||
if ($age = (int)substr($row['user_birthday'], -4))
|
||||
{
|
||||
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Assign index specific vars
|
||||
$template->assign_vars(array(
|
||||
|
@ -117,12 +142,14 @@ $template->assign_vars(array(
|
|||
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
|
||||
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "<a href=\"memberlist.$phpEx$SID&mode=viewprofile&u=$newest_uid \">", $newest_user, '</a>'),
|
||||
'LEGEND' => $legend,
|
||||
'BIRTHDAY_LIST' => ($birthday_list) ? $birthday_list : $user->lang['NO_BIRTHDAYS'],
|
||||
|
||||
'FORUM_IMG' => $user->img('forum', 'NO_NEW_POSTS'),
|
||||
'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'),
|
||||
'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'),
|
||||
|
||||
'S_LOGIN_ACTION' => "ucp.php?$SID&mode=login",
|
||||
'S_LOGIN_ACTION' => "ucp.php?$SID&mode=login",
|
||||
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
|
||||
|
||||
'U_MARK_READ' => "index.$phpEx$SID&mark=forums")
|
||||
);
|
||||
|
|
|
@ -492,6 +492,7 @@ $lang = array_merge($lang, array(
|
|||
'VIEW_ONLINE_TIME_EXPLAIN' => 'How long before users drop out of the viewonline listings, lower equals less processing.',
|
||||
'YES_ONLINE' => 'Enable online user listings',
|
||||
'YES_ONLINE_EXPLAIN' => 'Display online user information on index, forum and topic pages.',
|
||||
'YES_BIRTHDAYS' => 'Enable birthday listing',
|
||||
'YES_MODERATORS' => 'Enable display of Moderators',
|
||||
'YES_SEARCH' => 'Enable search facilities',
|
||||
'YES_SEARCH_EXPLAIN' => 'User and backend search functions including fulltext updates when posting.',
|
||||
|
@ -528,11 +529,12 @@ $lang = array_merge($lang, array(
|
|||
'SITE_DESC' => 'Site description',
|
||||
'BOARD_DISABLE' => 'Disable board',
|
||||
'BOARD_DISABLE_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.',
|
||||
'ACC_ACTIVATION' => 'Enable account activation',
|
||||
'ACC_ACTIVATION' => 'Account activation',
|
||||
'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.',
|
||||
'ACC_NONE' => 'None',
|
||||
'ACC_USER' => 'User',
|
||||
'ACC_ADMIN' => 'Admin',
|
||||
'ACC_USER_ADMIN' => 'User + Admin',
|
||||
'ACC_DISABLE' => 'Disable',
|
||||
'VISUAL_CONFIRM' => 'Enable visual confirmation',
|
||||
'VISUAL_CONFIRM_EXPLAIN' => 'Requires new users enter a random code matching an image to help prevent mass registrations.',
|
||||
|
|
|
@ -297,17 +297,22 @@ $lang = array(
|
|||
'LOGIN_FORUM' => 'To view or post in this forum you must enter a password.',
|
||||
'WRONG_PASSWORD'=> 'You entered an incorrect password.',
|
||||
|
||||
|
||||
'INDEX' => 'Index page',
|
||||
'REDIRECTS' => 'Total redirects',
|
||||
'WHO_IS_ONLINE' => 'Who is Online',
|
||||
'BIRTHDAYS' => 'Birthdays',
|
||||
|
||||
'SEARCH_NEW' => 'View posts since last visit',
|
||||
'SEARCH_SELF' => 'View your posts',
|
||||
'SEARCH_UNANSWERED' => 'View unanswered posts',
|
||||
|
||||
|
||||
'MARK_FORUMS_READ' => 'Mark all forums read',
|
||||
'FORUMS_MARKED' => 'All forums have been marked read',
|
||||
|
||||
'CONGRATULATIONS' => 'Congratulations to',
|
||||
'NO_BIRTHDAYS' => 'No birthdays today',
|
||||
|
||||
'RECORD_ONLINE_USERS' => 'Most users ever online was <b>%1$s</b> on %2$s',
|
||||
'ONLINE_USERS_ZERO_TOTAL' => 'In total there are <b>0</b> users online :: ',
|
||||
'ONLINE_USERS_TOTAL' => 'In total there are <b>%d</b> users online :: ',
|
||||
|
@ -659,7 +664,8 @@ $lang = array(
|
|||
|
||||
'UCP_PROFILE' => 'Profile',
|
||||
|
||||
'UCP_REG_DETAILS' => 'Registration details',
|
||||
'UCP_REG_DETAILS' => 'Registration details',
|
||||
'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing your email address.',
|
||||
|
||||
'UCP_PROFILE_INFO' => 'Your Profile',
|
||||
'PROFILE_INFO_NOTICE' => 'Please note that this information will be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.',
|
||||
|
@ -817,6 +823,7 @@ $lang = array(
|
|||
'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password',
|
||||
'ACCOUNT_INACTIVE' => 'Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information',
|
||||
'ACCOUNT_INACTIVE_ADMIN'=> 'Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated',
|
||||
'ACCOUNT_INACTIVE_SELF_ADMIN'=> 'Your account has been created. However, this forum requires account activation by both yourself and the administrator. An activation key has been sent to the email address you provided. Please follow the directions in that message. Once activated an administrator will need to approve your account. You will be notified when this occcurs.',
|
||||
'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.',
|
||||
|
||||
'Wrong_activation' => 'The activation key you supplied does not match any in the database',
|
||||
|
|
|
@ -63,9 +63,9 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- IF S_DISPLAY_ONLINE_LIST -->
|
||||
<br clear="all" />
|
||||
|
||||
<!-- IF S_DISPLAY_ONLINE_LIST -->
|
||||
<table class="tablebg" width="100%" cellspacing="1" cellpadding="2" border="0">
|
||||
<tr>
|
||||
<td class="cat" colspan="2" height="28"><a class="cattitle" href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></td>
|
||||
|
@ -82,6 +82,20 @@
|
|||
</table>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_BIRTHDAY_LIST -->
|
||||
<br clear="all" />
|
||||
|
||||
<table class="tablebg" width="100%" cellspacing="1" cellpadding="2" border="0">
|
||||
<tr>
|
||||
<td class="cat" colspan="2" height="28"><span class="cattitle">{L_BIRTHDAYS}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="46" align="center" valign="middle"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
|
||||
<td class="row1" width="100%" align="left"><span class="gensmall">{L_CONGRATULATIONS}: <b>{BIRTHDAY_LIST}</b></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF not S_USER_LOGGED_IN -->
|
||||
<form method="post" action="{S_LOGIN_ACTION}"><table class="tablebg" width="100%" cellspacing="1" cellpadding="3" border="0">
|
||||
<tr>
|
||||
|
|
Loading…
Add table
Reference in a new issue