- if ((strtolower($mailbox) == 'inbox') || ($unseen_notify == 3)) {
- $unseen_string = $unseen;
-
-
- /* If users requests, display message count too */
- if (isset($unseen_type) && ($unseen_type == 2)) {
- $numMessages = $boxes->total;
- $unseen_string .= '/' . $numMessages;
- }
-
- $unseen_string = "<font color=\"$color[11]\">($unseen_string)</font>";
-
- /*
- Finally allow the script to display the values by setting a boolean.
- This can only occur if the unseen count is great than 0 (if you have
- unseen count only), or you have the message count too.
- */
- if (($unseen > 0) || (isset($unseen_type) && ($unseen_type ==2))) {
- $unseen_found = true;
- }
-
- }
-
+ /* get unseen/total messages information */
+ /* Only need to display info when option is set */
+ if (isset($unseen_notify) && ($unseen_notify > 1) &&
+ (($boxes->unseen !== false) || ($boxes->total !== false))) {
+
+ if ($boxes->unseen !== false)
+ $unseen = $boxes->unseen;
+
+ /*
+ Should only display unseen info if the folder is inbox
+ or you set the option for all folders
+ */
+
+ if ((strtolower($mailbox) == 'inbox') || ($unseen_notify == 3)) {
+ $unseen_string = $unseen;
+
+ /* If users requests, display message count too */
+ if (isset($unseen_type) && ($unseen_type == 2) && ($boxes->total !== false)) {
+ $unseen_string .= '/' . $boxes->total;
+ }
+
+ $unseen_string = "<font color=\"$color[11]\">($unseen_string)</font>";
+
+ /*
+ Finally allow the script to display the values by setting a boolean.
+ This can only occur if the unseen count is great than 0 (if you have
+ unseen count only), or you have the message count too.
+ */
+ if (($unseen > 0) || (isset($unseen_type) && ($unseen_type ==2))) {
+ $unseen_found = true;
+ }