# # Translators: msgid "" msgstr "" "Project-Id-Version: fedora-initscripts\n" "PO-Revision-Date: 2011-02-16 14:39+0000\n" "Last-Translator: \n" "Language-Team: Breton (http://www.transifex.com/projects/p/fedora/language/" "br/)\n" "Language: br\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../sysconfig/network-scripts/ifup-eth:231 msgid "Error, some other host already uses address ${ipaddr[$idx]}." msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:904 msgid "No parameters given to setup a default route" msgstr "" #: ../sysconfig/network-scripts/ifup-aliases:67 msgid "usage: ifup-aliases []\n" msgstr "" #: ../sysconfig/network-scripts/ifup-sit:63 msgid "Missing remote IPv4 address of tunnel, configuration is not valid" msgstr "" #: ../service:78 msgid "Redirecting to /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE}.service" msgstr "" #: ../rc.d/init.d/functions:410 msgid "${base} status unknown due to insufficient privileges." msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:145 msgid "Missing parameter 'IPv6-address' (arg 2)" msgstr "" #: ../rc.d/init.d/functions:239 ../rc.d/init.d/functions:249 msgid "Usage: killproc [-p pidfile] [ -d delay] {program} [-signal]" msgstr "" #: ../ppp/ip-up.ipv6to4:123 ../sysconfig/network-scripts/ifup-ipv6:226 msgid "" "Warning: configured MTU '$IPV6TO4_MTU' for 6to4 exceeds maximum limit of " "'$tunnelmtu', ignored" msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:964 msgid "Unsupported reason '$reason' for sending trigger to radvd" msgstr "" #: ../sysconfig/network-scripts/ifup:103 #: ../sysconfig/network-scripts/ifup-eth:78 msgid "" "$alias device ${DEVICE} does not seem to be present, delaying initialization." msgstr "" #: ../rc.d/init.d/functions:406 msgid "${base} dead but pid file exists" msgstr "" #: ../sysconfig/network-scripts/ifup-ipv6:100 #: ../sysconfig/network-scripts/ifup-ipv6:117 msgid "Please restart network with '/sbin/service network restart'" msgstr "" #: ../systemd/rhel-autorelabel:21 msgid "*** when you leave the shell." msgstr "" #: ../sysconfig/network-scripts/ifup-ppp:75 msgid "ifup-ppp for ${DEVNAME} exiting" msgstr "" #: ../sysconfig/network-scripts/ifup-ppp:142 msgid "pppd started for ${DEVNAME} on ${MODEMPORT} at ${LINESPEED}" msgstr "" #: ../rc.d/init.d/functions:463 msgid "WARNING" msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:61 msgid "Missing parameter 'IPv6-gateway' (arg 2)" msgstr "" #: ../rc.d/init.d/functions:330 msgid "Usage: pidfileofproc {program}" msgstr "" #: ../rc.d/init.d/functions:229 msgid "$base startup" msgstr "" #: ../ppp/ip-down.ipv6to4:35 ../ppp/ip-up.ipv6to4:41 msgid "" "Argument 1 is empty but should contain interface name - skip IPv6to4 " "initialization" msgstr "" #: ../ppp/ip-up.ipv6to4:189 ../sysconfig/network-scripts/ifup-ipv6:292 msgid "radvd control enabled, but config is not complete" msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:383 msgid "Missing parameter 'address' (arg 1)" msgstr "" #: ../rc.d/init.d/netconsole:76 msgid "Server address not specified in /etc/sysconfig/netconsole" msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:798 msgid "Missing parameter 'IPv6 MTU' (arg 2)" msgstr "" #: ../rc.d/init.d/network:67 msgid "Bringing up loopback interface: " msgstr "" #: ../rc.d/init.d/functions:452 msgid "PASSED" msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:394 msgid "Given address '$addr' is not a global IPv4 one (arg 1)" msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:706 msgid "Missing parameter 'selection' (arg 2)" msgstr "" #: ../ppp/ip-up.ipv6to4:91 ../sysconfig/network-scripts/ifup-ipv6:211 msgid "" "IPv6to4 configuration needs an IPv4 address on related interface or " "otherwise specified" msgstr "" #: ../sysconfig/network-scripts/ifup-aliases:190 msgid "error iN $FILE: didn't specify netmask or prefix" msgstr "" #: ../sysconfig/network-scripts/ifdown-tunnel:36 #: ../sysconfig/network-scripts/ifup-tunnel:63 msgid "Device '$DEVICE' isn't supported as a valid GRE device name." msgstr "" #: ../sysconfig/network-scripts/ifup-eth:43 msgid "Device ${DEVICE} has different MAC address than expected, ignoring." msgstr "" #: ../sysconfig/network-scripts/ifup-aliases:264 msgid "Error, some other host already uses address ${IPADDR}." msgstr "" #: ../rc.d/init.d/network:271 msgid "Usage: $0 {start|stop|status|restart|reload|force-reload}" msgstr "" #: ../sysconfig/network-scripts/network-functions-ipv6:603 msgid "Tunnel device '$device' creation didn't work" msgstr "" #: ../rc.d/init.d/netconsole:91 msgid "Initializing netconsole" msgstr "" #: ../sysconfig/network-scripts/ifdown-eth:42 #: ../sysconfig/network-scripts/ifdown-eth:48 msgid "" "Device ${DEVICE} has MAC address ${FOUNDMACADDR}, instead of configured " "address ${HWADDR}. Ignoring." msgstr "" #: ../rc.d/init.d/functions:441 msgid "FAILED" msgstr "" #: ../sysconfig/network-scripts/ifup-eth:287 msgid "Determining IPv6 information for ${DEVICE}..." msgstr "" #: ../rc.d/init.d/functions:422 msgid "${base} is stopped" msgstr "" #: ../rc.d/init.d/functions:151 ../rc.d/init.d/functions:187 msgid "$0: Usage: daemon [+/-nicelevel] {program}" msgstr "" #: ../sysconfig/network-scripts/ifup- made folder usable within the template (especially custom folder) git-svn-id: file:///svn/phpbb/trunk@5048 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/functions_privmsgs.php81
-rw-r--r--phpBB/includes/ucp/ucp_pm.php27
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php6
3 files changed, 58 insertions, 56 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index b2a43ec1e6..1682df0d1e 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -100,63 +100,57 @@ $global_rule_conditions = array(
RULE_IS_GROUP => 'group'
);
-// Get number of unread messages from all folder
-function get_unread_pm($user_id)
-{
- global $db;
-
- $unread_pm = array();
-
- $sql = 'SELECT folder_id, SUM(unread) as sum_unread
- FROM ' . PRIVMSGS_TO_TABLE . "
- WHERE user_id = $user_id
- AND folder_id <> " . PRIVMSGS_OUTBOX . '
- GROUP BY folder_id';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['sum_unread'])
- {
- $unread_pm[$row['folder_id']] = $row['sum_unread'];
- }
- }
- $db->sql_freeresult($result);
-
- return $unread_pm;
-}
-
// Get all folder
-function get_folder($user_id, &$folder)
+function get_folder($user_id, &$folder, $folder_id = false, $mode = '')
{
- global $db, $user;
+ global $db, $user, $template;
if (!is_array($folder))
{
$folder = array();
}
- $sql = 'SELECT folder_id, COUNT(msg_id) as num_messages
+ if ($mode == 'unread')
+ {
+ $folder['unread'] = array('folder_name' => $user->lang['UNREAD_MESSAGES']);
+ }
+
+ // Get folder informations
+ $sql = 'SELECT folder_id, COUNT(msg_id) as num_messages, SUM(unread) as num_unread
FROM ' . PRIVMSGS_TO_TABLE . "
WHERE user_id = $user_id
AND folder_id <> " . PRIVMSGS_NO_BOX . '
GROUP BY folder_id';
$result = $db->sql_query($sql);
- $num_messages = array();
+ $num_messages = $num_unread = array();
while ($row = $db->sql_fetchrow($result))
{
$num_messages[(int) $row['folder_id']] = $row['num_messages'];
+ $num_unread[(int) $row['folder_id']] = $row['num_unread'];
}
$db->sql_freeresult($result);
- if (!isset($num_messages[PRIVMSGS_OUTBOX]))
+ // Make sure the default boxes are defined
+ foreach (array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX) as $default_folder)
{
- $num_messages[PRIVMSGS_OUTBOX] = 0;
+ if (!isset($num_messages[$default_folder]))
+ {
+ $num_messages[$default_folder] = 0;
+ }
+
+ if (!isset($num_unread[$default_folder]))
+ {
+ $num_unread[$default_folder] = 0;
+ }
}
- $folder[PRIVMSGS_INBOX] = array('folder_name' => $user->lang['PM_INBOX'], 'num_messages' => (int) $num_messages[PRIVMSGS_INBOX]);
+ // Adjust unread status for outbox
+ $num_unread[PRIVMSGS_OUTBOX] = $num_messages[PRIVMSGS_OUTBOX];
+
+ $folder[PRIVMSGS_INBOX] = array('folder_name' => $user->lang['PM_INBOX'], 'num_messages' => $num_messages[PRIVMSGS_INBOX], 'unread_messages' => $num_unread[PRIVMSGS_INBOX]);
+ // Custom Folder
$sql = 'SELECT folder_id, folder_name, pm_count
FROM ' . PRIVMSGS_FOLDER_TABLE . "
WHERE user_id = $user_id";
@@ -164,12 +158,27 @@ function get_folder($user_id, &$folder)
while ($row = $db->sql_fetchrow($result))
{
- $folder[$row['folder_id']] = array('folder_name' => $row['folder_name'], 'num_messages' => $row['pm_count']);
+ $folder[$row['folder_id']] = array('folder_name' => $row['folder_name'], 'num_messages' => $row['pm_count'], 'unread_messages' => ((isset($num_unread[$row['folder_id']])) ? $num_unread[$row['folder_id']] : 0));
}
$db->sql_freeresult($result);
- $folder[PRIVMSGS_OUTBOX] = array('folder_name' => $user->lang['PM_OUTBOX'], 'num_messages' => (int) $num_messages[PRIVMSGS_OUTBOX]);
- $folder[PRIVMSGS_SENTBOX] = array('folder_name' => $user->lang['PM_SENTBOX'], 'num_messages' => (int) $num_messages[PRIVMSGS_SENTBOX]);
+ $folder[PRIVMSGS_OUTBOX] = array('folder_name' => $user->lang['PM_OUTBOX'], 'num_messages' => $num_messages[PRIVMSGS_OUTBOX], 'unread_messages' => $num_unread[PRIVMSGS_OUTBOX]);
+ $folder[PRIVMSGS_SENTBOX] = array('folder_name' => $user->lang['PM_SENTBOX'], 'num_messages' => $num_messages[PRIVMSGS_SENTBOX], 'unread_messages' => $num_unread[PRIVMSGS_SENTBOX]);
+
+ // Define Folder Array for template designers (and for making custom folders usable by the template too)
+ foreach ($folder as $f_id => $folder_ary)
+ {
+ $template->assign_block_vars('folder', array(
+ 'FOLDER_ID' => $f_id,
+ 'FOLDER_NAME' => $folder_ary['folder_name'],
+ 'NUM_MESSAGES' => $folder_ary['num_messages'],
+ 'UNREAD_MESSAGES' => $folder_ary['unread_messages'],
+
+ 'S_CUR_FOLDER' => ($f_id == $folder_id) ? true : false,
+ 'S_UNREAD_MESSAGES' => ($folder_ary['unread_messages']) ? true : false,
+ 'S_CUSTOM_FOLDER' => ($f_id > 0) ? true : false)
+ );
+ }
return;
}
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index 964077a2c1..ab2b7b9b50 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -82,7 +82,7 @@ class ucp_pm extends module
}
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
-
+
$tpl_file = 'ucp_pm_' . $mode . '.html';
switch ($mode)
{
@@ -114,7 +114,9 @@ class ucp_pm extends module
// Compose message
case 'compose':
$action = request_var('action', 'post');
-
+
+ get_folder($user->data['user_id'], $folder);
+
if (!$auth->acl_get('u_sendpm'))
{
trigger_error('NO_AUTH_SEND_MESSAGE');
@@ -127,11 +129,14 @@ class ucp_pm extends module
break;
case 'options':
+ get_folder($user->data['user_id'], $folder);
+
include($phpbb_root_path . 'includes/ucp/ucp_pm_options.'.$phpEx);
message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions);
break;
case 'drafts':
+ get_folder($user->data['user_id'], $folder);
include($phpbb_root_path . 'includes/ucp/ucp_main.'.$phpEx);
$module = new ucp_main($id, $mode);
unset($module);
@@ -268,30 +273,16 @@ class ucp_pm extends module
update_unread_status($message_row['unread'], $message_row['msg_id'], $user->data['user_id'], $folder_id);
}
- $unread_pm = array();
- if ($user->data['user_unread_privmsg'])
- {
- $unread_pm = get_unread_pm($user->data['user_id']);
- }
- $folder = array();
-
- if ($mode == 'unread')
- {
- $folder['unread'] = array('folder_name' => $user->lang['UNREAD_MESSAGES']);
- }
- get_folder($user->data['user_id'], $folder);
+ get_folder($user->data['user_id'], $folder, $folder_id, $mode);
$s_folder_options = $s_to_folder_options = '';
foreach ($folder as $f_id => $folder_ary)
{
- $unread = ((isset($unread_pm[$f_id]) || ($f_id == PRIVMSGS_OUTBOX && $folder_ary['num_messages'])) ? ' [' . (($f_id == PRIVMSGS_OUTBOX) ? $folder_ary['num_messages'] : $unread_pm[$f_id]) . ']' : '');
-
- $option = '<option' . ((!in_array($f_id, array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX))) ? ' class="blue"' : '') . ' value="' . $f_id . '"' . ((($f_id == $folder_id && $mode != 'unread') || ($f_id === 'unread' && $mode == 'unread')) ? ' selected="selected"' : '') . '>' . $folder_ary['folder_name'] . $unread . '</option>';
+ $option = '<option' . ((!in_array($f_id, array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX))) ? ' class="blue"' : '') . ' value="' . $f_id . '"' . ((($f_id == $folder_id && $mode != 'unread') || ($f_id === 'unread' && $mode == 'unread')) ? ' selected="selected"' : '') . '>' . $folder_ary['folder_name'] . (($folder_ary['unread_messages']) ? ' [' . $folder_ary['unread_messages'] . '] ' : '') . '</option>';
$s_to_folder_options .= ($f_id != PRIVMSGS_OUTBOX && $f_id != PRIVMSGS_SENTBOX) ? $option : '';
$s_folder_options .= $option;
}
-
clean_sentbox($folder[PRIVMSGS_SENTBOX]['num_messages']);
// Header for message view - folder and so on
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 7b4a213e0b..53946e3c00 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -564,9 +564,9 @@ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary)
);
}
-function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions, &$rule_save_ary)
+function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions)
{
- global $db, $template, $_REQUEST;
+ global $db, $template;
$template->assign_vars(array(
'S_COND_DEFINED' => true,
@@ -612,6 +612,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
FROM ' . USERS_TABLE . "
WHERE username = '" . $db->sql_escape($rule_string) . "'";
$result = $db->sql_query($sql);
+
if (!($rule_user_id = $db->sql_fetchfield('user_id', 0, $result)))
{
$rule_string = '';
@@ -624,6 +625,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
FROM ' . USERS_TABLE . "
WHERE user_id = $rule_user_id";
$result = $db->sql_query($sql);
+
if (!($rule_string = $db->sql_fetchfield('username', 0, $result)))
{
$rule_user_id = 0;