<name>com.woltlab.wcf.like</name>
<definitionname>com.woltlab.wcf.statDailyHandler</definitionname>
<classname><![CDATA[wcf\system\stat\LikeStatDailyHandler]]></classname>
- <categoryname>com.woltlab.wcf.general</categoryname>
+ <categoryname>com.woltlab.wcf.user</categoryname>
</type>
<type>
<name>com.woltlab.wcf.dislike</name>
<definitionname>com.woltlab.wcf.statDailyHandler</definitionname>
<classname><![CDATA[wcf\system\stat\DislikeStatDailyHandler]]></classname>
- <categoryname>com.woltlab.wcf.general</categoryname>
+ <categoryname>com.woltlab.wcf.user</categoryname>
+ </type>
+ <type>
+ <name>com.woltlab.wcf.userProfileComment</name>
+ <definitionname>com.woltlab.wcf.statDailyHandler</definitionname>
+ <classname><![CDATA[wcf\system\stat\UserProfileCommentStatDailyHandler]]></classname>
+ <categoryname>com.woltlab.wcf.user</categoryname>
</type>
<!-- /stat handlers -->
--- /dev/null
+<?php
+namespace wcf\system\stat;
+use wcf\system\comment\CommentHandler;
+use wcf\system\exception\SystemException;
+use wcf\system\WCF;
+
+/**
+ * Abstract implementation of a comment stat handler.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.stat
+ * @category Community Framework
+ */
+abstract class AbstractCommentStatDailyHandler extends AbstractStatDailyHandler {
+ /**
+ * name of the comment object type
+ * @var string
+ */
+ protected $objectType = '';
+
+ /**
+ * @see \wcf\system\stat\IStatDailyHandler::getData()
+ */
+ public function getData($date) {
+ $objectTypeID = CommentHandler::getInstance()->getObjectTypeID($this->objectType);
+ if ($objectTypeID === null) {
+ throw new SystemException("Unknown comment object type '".$this->objectType."'");
+ }
+
+ $sql = "SELECT (
+ SELECT COUNT(*)
+ FROM wcf".WCF_N."_comment
+ WHERE objectTypeID = ?
+ AND time BETWEEN ? AND ?
+ ) + (
+ SELECT COUNT(*)
+ FROM wcf".WCF_N."_comment_response comment_response
+ LEFT JOIN wcf".WCF_N."_comment comment
+ ON (comment.commentID = comment_response.commentID)
+ WHERE comment.objectTypeID = ?
+ AND comment_response.time BETWEEN ? AND ?
+ )";
+ $statement = WCF::getDB()->prepareStatement($sql);
+ $statement->execute(array(
+ $objectTypeID,
+ $date,
+ $date + 86399,
+ $objectTypeID,
+ $date,
+ $date + 86399
+ ));
+ $counter = $statement->fetchColumn();
+
+ $sql = "SELECT (
+ SELECT COUNT(*)
+ FROM wcf".WCF_N."_comment
+ WHERE objectTypeID = ?
+ AND time < ?
+ ) + (
+ SELECT COUNT(*)
+ FROM wcf".WCF_N."_comment_response comment_response
+ LEFT JOIN wcf".WCF_N."_comment comment
+ ON (comment.commentID = comment_response.commentID)
+ WHERE comment.objectTypeID = ?
+ AND comment_response.time < ?
+ )";
+ $statement = WCF::getDB()->prepareStatement($sql);
+ $statement->execute(array(
+ $objectTypeID,
+ $date + 86400,
+ $objectTypeID,
+ $date + 86400
+ ));
+ $total = $statement->fetchColumn();
+
+ return array(
+ 'counter' => $counter,
+ 'total' => $total
+ );
+ }
+}
--- /dev/null
+<?php
+namespace wcf\system\stat;
+
+/**
+ * Stat handler implementation for user profile comments.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.stat
+ * @category Community Framework
+ */
+class UserProfileCommentStatDailyHandler extends AbstractCommentStatDailyHandler {
+ /**
+ * @see \wcf\system\stat\AbstractCommentStatDailyHandler::$objectType
+ */
+ protected $objectType = 'com.woltlab.wcf.user.profileComment';
+}
<item name="wcf.acp.stat.com.woltlab.wcf.attachment.diskUsage"><![CDATA[Dateianhänge-Speicherbedarf (MB)]]></item>
<item name="wcf.acp.stat.com.woltlab.wcf.like"><![CDATA[Likes]]></item>
<item name="wcf.acp.stat.com.woltlab.wcf.dislike"><![CDATA[Dislikes]]></item>
+ <item name="wcf.acp.stat.com.woltlab.wcf.userProfileComment"><![CDATA[Benutzerprofil-Pinnwand]]></item>
<item name="wcf.acp.stat.dateGrouping"><![CDATA[Zeiteinheit]]></item>
<item name="wcf.acp.stat.dateGrouping.daily"><![CDATA[Tag]]></item>
<item name="wcf.acp.stat.dateGrouping.weekly"><![CDATA[Woche]]></item>
<item name="wcf.acp.stat.dateGrouping.monthly"><![CDATA[Monat]]></item>
<item name="wcf.acp.stat.dateGrouping.yearly"><![CDATA[Jahr]]></item>
<item name="wcf.acp.stat.category.com.woltlab.wcf.general"><![CDATA[Allgemeine Daten]]></item>
+ <item name="wcf.acp.stat.category.com.woltlab.wcf.user"><![CDATA[Benutzer-Daten]]></item>
</category>
<category name="wcf.acp.updateServer">
<item name="wcf.acp.stat.com.woltlab.wcf.attachment.diskUsage"><![CDATA[TODO: Dateianhänge-Speicherbedarf (MB)]]></item>
<item name="wcf.acp.stat.com.woltlab.wcf.like"><![CDATA[Likes]]></item>
<item name="wcf.acp.stat.com.woltlab.wcf.dislike"><![CDATA[Dislikes]]></item>
+ <item name="wcf.acp.stat.com.woltlab.wcf.userProfileComment"><![CDATA[Wall Comments]]></item>
<item name="wcf.acp.stat.dateGrouping"><![CDATA[Time Unit]]></item>
<item name="wcf.acp.stat.dateGrouping.daily"><![CDATA[Day]]></item>
<item name="wcf.acp.stat.dateGrouping.weekly"><![CDATA[Week]]></item>
<item name="wcf.acp.stat.dateGrouping.monthly"><![CDATA[Month]]></item>
<item name="wcf.acp.stat.dateGrouping.yearly"><![CDATA[Year]]></item>
<item name="wcf.acp.stat.category.com.woltlab.wcf.general"><![CDATA[General Data]]></item>
+ <item name="wcf.acp.stat.category.com.woltlab.wcf.user"><![CDATA[User Data]]></item>
</category>
<category name="wcf.acp.updateServer">