Add proper support for stacked notifications triggered by guests (WIP)
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 Jul 2014 12:22:15 +0000 (14:22 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Jul 2014 12:22:15 +0000 (14:22 +0200)
15 files changed:
com.woltlab.wcf/templates/notificationList.tpl
wcfsetup/install/files/lib/data/user/notification/UserNotificationAction.class.php
wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php
wcfsetup/install/files/lib/system/user/notification/event/AbstractSharedUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/IUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentUserNotificationEvent.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml
wcfsetup/setup/db/install.sql

index 5bf55adc748e66ef9e5b7ca83d2cbc3678a1cc45..6c4843ac00e1ea4cb5f4a73a3bbacb4641643969 100644 (file)
                                                                                {if !$notification[confirmed]}<span class="badge label newContentBadge">{lang}wcf.message.new{/lang}</span>{/if}
                                                                                
                                                                                {$notification[event]->getTitle()}
-                                                                       </h3> 
+                                                                       </h3>
                                                                        <small>{@$notification[time]|time}</small>
                                                                </div>
                                                                
                                                                <p>{@$notification[event]->getMessage()}</p>
                                                                
-                                                               <ul style="margin-top: 4px">
+                                                               <ul class="marginTopTiny">
                                                                        {foreach from=$notification[event]->getAuthors() item=author}
-                                                                               <li style="display: inline-block" class="jsTooltip" title="{$author->username}"><a href="{link controller='User' object=$author}{/link}" class="framed">{@$author->getAvatar()->getImageTag(24)}</a></li>
+                                                                               {if $author->userID}
+                                                                                       <li style="display: inline-block" class="jsTooltip" title="{$author->username}"><a href="{link controller='User' object=$author}{/link}" class="framed">{@$author->getAvatar()->getImageTag(24)}</a></li>
+                                                                               {/if}
                                                                        {/foreach}
                                                                </ul>
                                                                
index 9df95207f7fca06d3ef1b07bc70c56fcb15495fe..b41b058e9517a8514c9131ac0774cfc77e704ac5 100644 (file)
@@ -59,22 +59,20 @@ class UserNotificationAction extends AbstractDatabaseObjectAction {
                }
                
                // insert author
-               if ($this->parameters['authorID']) {
-                       $sql = "INSERT INTO     wcf".WCF_N."_user_notification_author
-                                               (notificationID, authorID, time)
-                               VALUES          (?, ?, ?)";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       
-                       WCF::getDB()->beginTransaction();
-                       foreach ($notifications as $notificationData) {
-                               $statement->execute(array(
-                                       $notificationData['object']->notificationID,
-                                       $this->parameters['authorID'],
-                                       TIME_NOW
-                               ));
-                       }
-                       WCF::getDB()->commitTransaction();
+               $sql = "INSERT INTO     wcf".WCF_N."_user_notification_author
+                                       (notificationID, authorID, time)
+                       VALUES          (?, ?, ?)";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               
+               WCF::getDB()->beginTransaction();
+               foreach ($notifications as $notificationData) {
+                       $statement->execute(array(
+                               $notificationData['object']->notificationID,
+                               $this->parameters['authorID'] ?: null,
+                               TIME_NOW
+                       ));
                }
+               WCF::getDB()->commitTransaction();
                
                return $notifications;
        }
@@ -114,26 +112,25 @@ class UserNotificationAction extends AbstractDatabaseObjectAction {
                }
                
                // insert author
-               if ($this->parameters['authorID']) {
-                       $sql = "INSERT IGNORE INTO      wcf".WCF_N."_user_notification_author
-                                                       (notificationID, authorID, time)
-                               VALUES                  (?, ?, ?)";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       
-                       WCF::getDB()->beginTransaction();
-                       foreach ($notifications as $notificationData) {
-                               $statement->execute(array(
-                                       $notificationData['object']->notificationID,
-                                       $this->parameters['authorID'],
-                                       TIME_NOW
-                               ));
-                       }
-                       WCF::getDB()->commitTransaction();
+               $sql = "INSERT IGNORE INTO      wcf".WCF_N."_user_notification_author
+                                               (notificationID, authorID, time)
+                       VALUES                  (?, ?, ?)";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               
+               WCF::getDB()->beginTransaction();
+               foreach ($notifications as $notificationData) {
+                       $statement->execute(array(
+                               $notificationData['object']->notificationID,
+                               $this->parameters['authorID'] ?: null,
+                               TIME_NOW
+                       ));
                }
+               WCF::getDB()->commitTransaction();
                
                // update trigger count
                $sql = "UPDATE  wcf".WCF_N."_user_notification
-                       SET     timesTriggered = timesTriggered + ?
+                       SET     timesTriggered = timesTriggered + ?,
+                               guestTimesTriggered = guestTimesTriggered + ?
                        WHERE   notificationID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                
@@ -141,6 +138,7 @@ class UserNotificationAction extends AbstractDatabaseObjectAction {
                foreach ($notifications as $notificationData) {
                        $statement->execute(array(
                                1,
+                               $this->parameters['authorID'] ? 0 : 1,
                                $notificationData['object']->notificationID
                        ));
                }
index 486fd56ce16889b2cf5f5fe42bf86482550ecab6..166bb0119ca6b17e6ce4921759df847c8977d943 100644 (file)
@@ -110,15 +110,14 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                $statement->execute($conditions->getParameters());
                $authorIDs = $authorToNotification = array();
                while ($row = $statement->fetchArray()) {
-                       if (!$row['authorID']) {
-                               continue;
+                       if ($row['authorID']) {
+                               $authorIDs[] = $row['authorID'];
                        }
                        
                        if (!isset($authorToNotification[$row['notificationID']])) {
                                $authorToNotification[$row['notificationID']] = array();
                        }
                        
-                       $authorIDs[] = $row['authorID'];
                        $authorToNotification[$row['notificationID']][] = $row['authorID'];
                }
                
@@ -155,15 +154,17 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                                        $notification,
                                        $objectTypes[$notification->objectType]['objects'][$notification->objectID],
                                        (isset($authors[$notification->authorID]) ? $authors[$notification->authorID] : $unknownAuthor),
-                                       $notification->additionalData,
-                                       $notification->timesTriggered
+                                       $notification->additionalData
                                );
                                $class->setLanguage($user->getLanguage());
                                
                                if (isset($authorToNotification[$notification->notificationID])) {
                                        $eventAuthors = array();
                                        foreach ($authorToNotification[$notification->notificationID] as $userID) {
-                                               if (isset($authors[$userID])) {
+                                               if (!$userID) {
+                                                       $eventAuthors[0] = $unknownAuthor;
+                                               }
+                                               else if (isset($authors[$userID])) {
                                                        $eventAuthors[$userID] = $authors[$userID];
                                                }
                                        }
index a7322d3ccfe0ed5b447df472b31edaf68d10d07d..a4c6cb69ee68d71d8a67c5115e69b226a3bdcee5 100644 (file)
@@ -142,7 +142,8 @@ class UserNotificationHandler extends SingletonFactory {
                                $notificationIDs[] = $row['notificationID'];
                        }
                        
-                       // filter array of existing notifications and remove values which do not have a notification from this author yet (inverse logic!)
+                       // filter array of existing notifications and remove values which
+                       // do not have a notification from this author yet (inverse logic!)
                        foreach ($notifications as $userID => $notificationID) {
                                if (!in_array($notificationID, $notificationIDs)) {
                                        unset($notifications[$userID]);
@@ -152,7 +153,8 @@ class UserNotificationHandler extends SingletonFactory {
                        if (!empty($notificationIDs)) { 
                                // update trigger count
                                $sql = "UPDATE  wcf".WCF_N."_user_notification
-                                       SET     timesTriggered = timesTriggered + ?
+                                       SET     timesTriggered = timesTriggered + ?,
+                                               guestTimesTriggered = guestTimesTriggered + ?
                                        WHERE   notificationID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
                                
@@ -160,6 +162,7 @@ class UserNotificationHandler extends SingletonFactory {
                                foreach ($notificationIDs as $notificationID) {
                                        $statement->execute(array(
                                                1,
+                                               $notificationObject->getAuthorID() ? 0 : 1,
                                                $notificationID
                                        ));
                                }
@@ -236,7 +239,7 @@ class UserNotificationHandler extends SingletonFactory {
                        if (WCF::getUser()->userID) {
                                // load storage data
                                UserStorageHandler::getInstance()->loadStorage(array(WCF::getUser()->userID));
-                                       
+                               
                                // get ids
                                $data = UserStorageHandler::getInstance()->getStorage(array(WCF::getUser()->userID), 'userNotificationCount');
                                
@@ -344,15 +347,14 @@ class UserNotificationHandler extends SingletonFactory {
                $statement->execute($conditions->getParameters());
                $authorIDs = $authorToNotification = array();
                while ($row = $statement->fetchArray()) {
-                       if (!$row['authorID']) {
-                               continue;
+                       if ($row['authorID']) {
+                               $authorIDs[] = $row['authorID'];
                        }
                        
                        if (!isset($authorToNotification[$row['notificationID']])) {
                                $authorToNotification[$row['notificationID']] = array();
                        }
                        
-                       $authorIDs[] = $row['authorID'];
                        $authorToNotification[$row['notificationID']][] = $row['authorID'];
                }
                
@@ -380,8 +382,7 @@ class UserNotificationHandler extends SingletonFactory {
                                $notification,
                                $objectTypes[$notification->objectType]['objects'][$notification->objectID],
                                (isset($authors[$notification->authorID]) ? $authors[$notification->authorID] : $unknownAuthor),
-                               $notification->additionalData,
-                               $notification->timesTriggered
+                               $notification->additionalData
                        );
                        
                        if (!$class->checkAccess()) {
@@ -391,7 +392,10 @@ class UserNotificationHandler extends SingletonFactory {
                        if (isset($authorToNotification[$notification->notificationID])) {
                                $eventAuthors = array();
                                foreach ($authorToNotification[$notification->notificationID] as $userID) {
-                                       if (isset($authors[$userID])) {
+                                       if (!$userID) {
+                                               $eventAuthors[0] = $unknownAuthor;
+                                       }
+                                       else if (isset($authors[$userID])) {
                                                $eventAuthors[$userID] = $authors[$userID];
                                        }
                                }
index 14ea0b97043bc7b82243c91a09d471689c4a0b11..672f9955edec8ef64879434de20d5c5ab1ef8bf8 100644 (file)
@@ -18,8 +18,8 @@ abstract class AbstractSharedUserNotificationEvent extends AbstractUserNotificat
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::setObject()
         */
-       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = array(), $timesTriggered = 0) {
-               parent::setObject($notification, $object, $author, $additionalData, $timesTriggered);
+       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = array()) {
+               parent::setObject($notification, $object, $author, $additionalData);
                
                $this->prepare();
        }
index c61a4b2249175d616bc4159e624a8fe958667566..46ae4eae46af3df1a94443741124275496a671b8 100644 (file)
@@ -72,12 +72,6 @@ abstract class AbstractUserNotificationEvent extends DatabaseObjectDecorator imp
         */
        protected static $periods = array();
        
-       /**
-        * notification trigger count
-        * @var integer
-        */
-       protected $timesTriggered = 0;
-       
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::setAuthors()
         */
@@ -88,12 +82,11 @@ abstract class AbstractUserNotificationEvent extends DatabaseObjectDecorator imp
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::setObject()
         */
-       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = array(), $timesTriggered = 0) {
+       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = array()) {
                $this->notification = $notification;
                $this->userNotificationObject = $object;
                $this->author = $author;
                $this->additionalData = $additionalData;
-               $this->timesTriggered = $timesTriggered;
        }
        
        /**
index b258146f3c4305d4591b1066fe55cc0f6b0efa5c..a52420d79adede9cc5f291d476e20e8ddae4c757 100644 (file)
@@ -102,9 +102,8 @@ interface IUserNotificationEvent extends IDatabaseObjectProcessor {
         * @param       \wcf\system\user\notification\object\IUserNotificationObject    $object
         * @param       \wcf\data\user\UserProfile                                      $author
         * @param       array<mixed>                                                    $additionalData
-        * @param       integer                                                         $timesTriggered
         */
-       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = array(), $timesTriggered = 0);
+       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = array());
        
        /**
         * Sets the language for the event
index 04e1c6ce66338d3d123e1e1ab7b0c41c27541662..0f2c50abc2d9f8329ed0dd0b80e98bb8fd47f1f0 100644 (file)
@@ -35,7 +35,7 @@ class UserProfileCommentLikeUserNotificationEvent extends AbstractSharedUserNoti
                if ($count > 1) {
                        return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.like.title.stacked', array(
                                'count' => $count,
-                               'timesTriggered' => $this->timesTriggered
+                               'timesTriggered' => $this->notification->timesTriggered
                        ));
                }
                
index 42087966c78fef494982c3f4c328943e143c79b8..210ae34b267bf43237fcfccee6df08ee46466c57 100644 (file)
@@ -36,7 +36,7 @@ class UserProfileCommentResponseLikeUserNotificationEvent extends AbstractShared
                if ($count > 1) {
                        return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.like.title.stacked', array(
                                'count' => $count,
-                               'timesTriggered' => $this->timesTriggered
+                               'timesTriggered' => $this->notification->timesTriggered
                        ));
                }
                
index 8db5e47fe23c007ac47b3a4525ae856637f29c06..41a1407e694758014f3bfe2d667192938f7c8823 100644 (file)
@@ -38,7 +38,7 @@ class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractShare
                if ($count > 1) {
                        return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.title.stacked', array(
                                'count' => $count,
-                               'timesTriggered' => $this->timesTriggered
+                               'timesTriggered' => $this->notification->timesTriggered
                        ));
                }
                
index e25d587a32af399cafa8c2312d39fd0aa270e137..5623160c93ee14f9f6c20085bf751321028f16ef 100644 (file)
@@ -37,7 +37,7 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUser
                if ($count > 1) {
                        return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.title.stacked', array(
                                'count' => $count,
-                               'timesTriggered' => $this->timesTriggered
+                               'timesTriggered' => $this->notification->timesTriggered
                        ));
                }
                
index 4e29a2f437871319c983a8f1ec9bb21969247404..80e9a03327e0c376e7692495d107c3fe6f3fb596 100644 (file)
@@ -29,7 +29,7 @@ class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEv
                if ($count > 1) {
                        return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.title.stacked', array(
                                'count' => $count,
-                               'timesTriggered' => $this->timesTriggered
+                               'timesTriggered' => $this->notification->timesTriggered
                        ));
                }
                
@@ -40,15 +40,19 @@ class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEv
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
         */
        public function getMessage() {
-               $authors = array_values($this->getAuthors());
-               $count = count($authors);
-               
-               if ($count > 1) {
+               $authors = $this->getAuthors();
+               if (count($authors) > 1) {
+                       if (isset($authors[0])) {
+                               unset($authors[0]);
+                       }
+                       $count = count($authors);
+                       
                        return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message.stacked', array(
                                'author' => $this->author,
-                               'authors' => $authors,
+                               'authors' => array_values($authors),
                                'count' => $count,
-                               'others' => $count - 1
+                               'others' => $count - 1,
+                               'guestTimesTriggered' => $this->notification->guestTimesTriggered
                        ));
                }
                
@@ -61,18 +65,23 @@ class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEv
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
         */
        public function getEmailMessage($notificationType = 'instant') {
-               $authors = array_values($this->getAuthors());
-               $count = count($authors);
                $user = new User($this->userNotificationObject->objectID);
                
-               if ($count > 1) {
+               $authors = $this->getAuthors();
+               if (count($authors) > 1) {
+                       if (isset($authors[0])) {
+                               unset($authors[0]);
+                       }
+                       $count = count($authors);
+                       
                        return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail.stacked', array(
                                'author' => $this->author,
-                               'authors' => $authors,
+                               'authors' => array_values($authors),
                                'count' => $count,
                                'others' => $count - 1,
                                'owner' => $user,
-                               'notificationType' => $notificationType
+                               'notificationType' => $notificationType,
+                               'guestTimesTriggered' => $this->notification->guestTimesTriggered
                        ));
                }
                
index e878c771d8f4823db328cbafd2b9d5d2abdebd4b..700865cbdbdfe8059e056e383c4cfe7d04654e39 100644 (file)
@@ -2945,19 +2945,19 @@ Möchten Sie diese E-Mail-Benachrichtigung in Zukunft nicht mehr erhalten, könn
                <item name="wcf.user.notification.comment.title"><![CDATA[Neuer Kommentar (Pinnwand)]]></item>
                <item name="wcf.user.notification.comment.title.stacked"><![CDATA[{#$timesTriggered} neue Kommentare (Pinnwand)]]></item>
                <item name="wcf.user.notification.comment.message"><![CDATA[Hat einen Kommentar an Ihrer Pinnwand verfasst.]]></item>
-               <item name="wcf.user.notification.comment.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere{/if} haben Kommentare an <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">Ihrer Pinnwand</a> verfasst.]]></item>
+               <item name="wcf.user.notification.comment.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count != 1}{if $count == 2 && !$guestTimesTriggered} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3}{if !$guestTimesTriggered} und {else}, {/if} {@$authors[2]->getAnchorTag()}{/if}{/if}{if $guestTimesTriggered} und {if $guestTimesTriggered == 1}ein Gast{else}Gäste{/if}{/if}{else}{@$authors[0]->getAnchorTag()}{if $guestTimesTriggered},{else} und{/if} {#$others} weitere Benutzer {if $guestTimesTriggered}und {if $guestTimesTriggered == 1}ein Gast{else}Gäste{/if}{/if}{/if} haben Kommentare an <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">Ihrer Pinnwand</a> verfasst..]]></item>
                <item name="wcf.user.notification.comment.like.title"><![CDATA[Gefällt ein Kommentar (Pinnwand)]]></item>
                <item name="wcf.user.notification.comment.like.title.stacked"><![CDATA[{#$count} Benutzern gefällt Ihr Kommentar (Pinnwand)]]></item>
                <item name="wcf.user.notification.comment.like.message"><![CDATA[Gefällt Ihr Kommentar an {if $owner === null}Ihrer Pinnwand{else}der Pinnwand von {$owner->username}{/if}.]]></item>
                <item name="wcf.user.notification.comment.like.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weiteren{/if} gefällt Ihr Kommentar an {if $owner === null}<a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">Ihrer Pinnwand</a>{else}der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a>{/if}.]]></item>
-               <item name="wcf.user.notification.comment.mail"><![CDATA[{@$author->username} hat einen Kommentar an Ihrer Pinnwand verfasst:
+               <item name="wcf.user.notification.comment.mail"><![CDATA[{if !$author->userID}ein Gast{else}{@$author->username}{/if} hat einen Kommentar an Ihrer Pinnwand verfasst:
 {if $notificationType == 'instant'}
 ---------------------------------
 {@$comment->message} 
 ---------------------------------
-{/if}{link controller='User' object=$owner isEmail=true}{/link}#wall]]></item>
-               <item name="wcf.user.notification.comment.mail.stacked"><![CDATA[{if $count < 4}{@$authors[0]->username}{if $count == 2} und {else}, {/if}{@$authors[1]->username}{if $count == 3} und {@$authors[2]->username}{/if}{else}{@$authors[0]->username} und {#$others} weitere{/if} haben Kommentare an Ihrer Pinnwand verfasst:
-{link controller='User' object=$owner isEmail=true}{/link}#wall]]></item>
+{/if}{link controller='User' object=$owner isEmail=true}#wall{/link}]]></item>
+               <item name="wcf.user.notification.comment.mail.stacked"><![CDATA[{if $count < 4}{@$authors[0]->username}{if $count != 1}{if $count == 2 && !$guestTimesTriggered} und {else}, {/if}{@$authors[1]->username}{if $count == 3}{if !$guestTimesTriggered} und {else}, {/if} {@$authors[2]->username}{/if}{/if}{if $guestTimesTriggered} und {if $guestTimesTriggered == 1}ein Gast{else}Gäste{/if}{/if}{else}{@$authors[0]->username}{if $guestTimesTriggered},{else} und{/if} {#$others} weitere Benutzer {if $guestTimesTriggered}und {if $guestTimesTriggered == 1}ein Gast{else}Gäste{/if}{/if}{/if} haben Kommentare an Ihrer Pinnwand verfasst:
+{link controller='User' object=$owner isEmail=true}#wall{/link}]]></item>
                <item name="wcf.user.notification.commentResponse.title"><![CDATA[Neue Antwort (Pinnwand)]]></item>
                <item name="wcf.user.notification.commentResponse.title.stacked"><![CDATA[{#$timesTriggered} neue Antworten (Pinnwand)]]></item>
                <item name="wcf.user.notification.commentResponse.message"><![CDATA[Hat eine Antwort zu Ihrem Kommentar an der Pinnwand von {$owner->username} verfasst.]]></item>
@@ -2966,7 +2966,7 @@ Möchten Sie diese E-Mail-Benachrichtigung in Zukunft nicht mehr erhalten, könn
                <item name="wcf.user.notification.commentResponse.like.title.stacked"><![CDATA[{#$count} Benutzern gefällt Ihre Antwort auf einen Kommentar (Pinnwand)]]></item>
                <item name="wcf.user.notification.commentResponse.like.message"><![CDATA[Gefällt Ihre Antwort auf einen Kommentar an {if $owner === null}Ihrer Pinnwand{else}der Pinnwand von {$owner->username}{/if}.]]></item>
                <item name="wcf.user.notification.commentResponse.like.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weiteren{/if} gefällt Ihre Antwort auf einen Kommentar an {if $owner === null}<a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">Ihrer Pinnwand</a>{else}der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a>{/if}.]]></item>
-               <item name="wcf.user.notification.commentResponse.mail"><![CDATA[{@$author->username} hat eine Antwort zu Ihrem Kommentar an der Pinnwand von "{@$owner->username}" verfasst:
+               <item name="wcf.user.notification.commentResponse.mail"><![CDATA[{if !$author->userID}ein Gast{else}{@$author->username}{/if} hat eine Antwort zu Ihrem Kommentar an der Pinnwand von "{@$owner->username}" verfasst:
 {if $notificationType == 'instant'}
 ---------------------------------
 {@$response->message} 
index a94b1ddb6a03365379ef1f1a77f6160c2e218019..8d7303f5fef517173c6ab139a2ed51fb5ffb5ce8 100644 (file)
@@ -2805,18 +2805,18 @@ If you do not want to receive further email notifications for this event, you ca
                <item name="wcf.user.notification.comment.title"><![CDATA[New Comment (Wall)]]></item>
                <item name="wcf.user.notification.comment.title.stacked"><![CDATA[{#$timesTriggered} new comments (Wall)]]></item>
                <item name="wcf.user.notification.comment.message"><![CDATA[Wrote a comment on your wall.]]></item>
-               <item name="wcf.user.notification.comment.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} others{/if} wrote comments on <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">your wall</a>.]]></item>
+               <item name="wcf.user.notification.comment.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count != 1}{if $count == 2 && !$guestTimesTriggered} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3}{if !$guestTimesTriggered} and {else}, {/if} {@$authors[2]->getAnchorTag()}{/if}{/if}{if $guestTimesTriggered} and {if $guestTimesTriggered == 1}a guest{else}guests{/if}{/if}{else}{@$authors[0]->getAnchorTag()}{if $guestTimesTriggered},{else} and{/if} {#$others} other users {if $guestTimesTriggered}and {if $guestTimesTriggered == 1}a guest{else}guests{/if}{/if}{/if} wrote comments on <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">your wall</a>.]]></item>
                <item name="wcf.user.notification.comment.like.title"><![CDATA[Likes a comment (Wall)]]></item>
                <item name="wcf.user.notification.comment.like.title.stacked"><![CDATA[{#$count} users like your comment (Wall)]]></item>
                <item name="wcf.user.notification.comment.like.message"><![CDATA[Likes your comment on {if $owner === null}your wall{else}{$owner->username}’s wall{/if}.]]></item>
                <item name="wcf.user.notification.comment.like.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} others{/if} like your comment on {if $owner === null}<a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">your wall</a>{else}<a href="{link controller='User' object=$owner}#wall{/link}">{$owner->username}’s wall</a>{/if}.]]></item>
-               <item name="wcf.user.notification.comment.mail"><![CDATA[{@$author->username} wrote a comment on your wall:
+               <item name="wcf.user.notification.comment.mail"><![CDATA[{if !$author->userID}a guest{else}{@$author->username}{/if} wrote a comment on your wall:
 {if $notificationType == 'instant'}
 ---------------------------------
 {@$comment->message} 
 ---------------------------------
 {/if}{link controller='User' object=$owner isEmail=true}#wall{/link}]]></item>
-               <item name="wcf.user.notification.comment.mail.stacked"><![CDATA[{if $count < 4}{@$authors[0]->username}{if $count == 2} and {else}, {/if}{@$authors[1]->username}{if $count == 3} and {@$authors[2]->username}{/if}{else}{@$authors[0]->username} and {#$others} others{/if} wrote comments on your wall:
+               <item name="wcf.user.notification.comment.mail.stacked"><![CDATA[{if $count < 4}{@$authors[0]->username}{if $count != 1}{if $count == 2 && !$guestTimesTriggered} and {else}, {/if}{@$authors[1]->username}{if $count == 3}{if !$guestTimesTriggered} and {else}, {/if} {@$authors[2]->username}{/if}{/if}{if $guestTimesTriggered} and {if $guestTimesTriggered == 1}a guest{else}guests{/if}{/if}{else}{@$authors[0]->username}{if $guestTimesTriggered},{else} and{/if} {#$others} other users {if $guestTimesTriggered}and {if $guestTimesTriggered == 1}a guest{else}guests{/if}{/if}{/if} wrote comments on your wall:
 {link controller='User' object=$owner isEmail=true}#wall{/link}]]></item>
                <item name="wcf.user.notification.commentResponse.title"><![CDATA[New Reply (Wall)]]></item>
                <item name="wcf.user.notification.commentResponse.title.stacked"><![CDATA[{#$timesTriggered} new replies (Wall)]]></item>
@@ -2826,7 +2826,7 @@ If you do not want to receive further email notifications for this event, you ca
                <item name="wcf.user.notification.commentResponse.like.title.stacked"><![CDATA[{#$count} users like your reply to a comment (Wall)]]></item>
                <item name="wcf.user.notification.commentResponse.like.message"><![CDATA[Likes your reply to a comment on {if $owner === null}your wall{else}{$owner->username}’s wall{/if}.]]></item>
                <item name="wcf.user.notification.commentResponse.like.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} others{/if} like your reply to a comment on {if $owner === null}<a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">your wall</a>{else}<a href="{link controller='User' object=$owner}#wall{/link}">{$owner->username}’s wall</a>{/if}.]]></item>
-               <item name="wcf.user.notification.commentResponse.mail"><![CDATA[{@$author->username} wrote a reply to your comment on {@$owner->username}’s wall:
+               <item name="wcf.user.notification.commentResponse.mail"><![CDATA[{if !$author->userID}a guest{else}{@$author->username}{/if} wrote a reply to your comment on {@$owner->username}’s wall:
 {if $notificationType == 'instant'}
 ---------------------------------
 {@$response->message} 
index 9075e2585aa1951edf9c20ad66e394fb3e8c800d..0d8c2ec0f81efa913c51068f3cd773b3b5b2664b 100644 (file)
@@ -1260,6 +1260,7 @@ CREATE TABLE wcf1_user_notification (
        eventHash VARCHAR(40) NOT NULL DEFAULT '',
        authorID INT(10) NULL,
        timesTriggered INT(10) NOT NULL DEFAULT 0,
+       guestTimesTriggered INT(10) NOT NULL DEFAULT 0,
        userID INT(10) NOT NULL,
        time INT(10) NOT NULL DEFAULT 0,
        mailNotified TINYINT(1) NOT NULL DEFAULT 0,
@@ -1272,7 +1273,7 @@ CREATE TABLE wcf1_user_notification (
 DROP TABLE IF EXISTS wcf1_user_notification_author;
 CREATE TABLE wcf1_user_notification_author (
        notificationID INT(10) NOT NULL,
-       authorID INT(10) NOT NULL,
+       authorID INT(10),
        time INT(10) NOT NULL DEFAULT 0,
        UNIQUE KEY (notificationID, authorID)
 );