Added missing setting
authorMarcel Werk <burntime@woltlab.com>
Fri, 7 Jun 2013 21:33:42 +0000 (23:33 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 7 Jun 2013 21:33:42 +0000 (23:33 +0200)
com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/page/UserPage.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 95d3511b036da1839476a5481e93a6ed7f7b06c5..847bda13a1329ca8f9a44d0228b3f01e29fd21fd 100644 (file)
@@ -874,6 +874,11 @@ no:!cache_source_memcached_host]]></enableoptions>
                                <defaultvalue>182</defaultvalue>
                                <minvalue>0</minvalue>
                        </option>
+                       <option name="profile_enable_visitors">
+                               <categoryname>user.profile</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <defaultvalue>1</defaultvalue>
+                       </option>
                        <!-- /user.profile -->
                        
                        <!-- user.list.members -->
index a8f2687734c505ea0fec50f4e4cc1792ae01c6c9..31ee1367fb6f86af0eed94ebad51dc8278f5efd2 100644 (file)
@@ -143,10 +143,12 @@ class UserPage extends AbstractPage {
                $this->followingList->readObjects();
                
                // get visitors
-               $this->visitorList = new UserProfileVisitorList();
-               $this->visitorList->getConditionBuilder()->add('user_profile_visitor.ownerID = ?', array($this->userID));
-               $this->visitorList->sqlLimit = 10;
-               $this->visitorList->readObjects();
+               if (PROFILE_ENABLE_VISITORS) {
+                       $this->visitorList = new UserProfileVisitorList();
+                       $this->visitorList->getConditionBuilder()->add('user_profile_visitor.ownerID = ?', array($this->userID));
+                       $this->visitorList->sqlLimit = 10;
+                       $this->visitorList->readObjects();
+               }
                
                MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('User', array('object' => $this->user->getDecoratedObject())), true);
                MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'profile', true);
@@ -171,8 +173,8 @@ class UserPage extends AbstractPage {
                        'followerCount' => $this->followerList->countObjects(),
                        'following' => $this->followingList->getObjects(),
                        'followingCount' => $this->followingList->countObjects(),
-                       'visitors' => $this->visitorList->getObjects(),
-                       'visitorCount' => $this->visitorList->countObjects(),
+                       'visitors' => ($this->visitorList !== null ? $this->visitorList->getObjects() : array()),
+                       'visitorCount' => ($this->visitorList !== null ? $this->visitorList->countObjects() : 0),
                        'allowSpidersToIndexThisPage' => true
                ));
        }
@@ -187,7 +189,7 @@ class UserPage extends AbstractPage {
                        $editor->updateCounters(array('profileHits' => 1));
                        
                        // save visitor
-                       if (WCF::getUser()->userID && !WCF::getUser()->invisible) {
+                       if (PROFILE_ENABLE_VISITORS && WCF::getUser()->userID && !WCF::getUser()->invisible) {
                                if (($visitor = UserProfileVisitor::getObject($this->user->userID, WCF::getUser()->userID)) !== null) {
                                        $editor = new UserProfileVisitorEditor($visitor);
                                        $editor->update(array(
index eeae882054be131f45a3e3a12ce04bcc31f52d57..c6b049fa407e98167ebc802447fc19afb8e265aa 100644 (file)
                <item name="wcf.acp.option.module_members_list"><![CDATA[Mitgliederliste]]></item>
                <item name="wcf.acp.option.footer_code"><![CDATA[Footer-Code]]></item>
                <item name="wcf.acp.option.footer_code.description"><![CDATA[Der hier angegebene Code wird im Fußbereich jeder Seite ausgegeben. Der Footer-Code eignet sich z.B. sehr gut für die Einbindung von Diensten wie „Google Analytics“ oder „Piwik“.]]></item>
+               <item name="wcf.acp.option.profile_enable_visitors"><![CDATA[Profil-Besucher anzeigen]]></item>
        </category>
        
        <category name="wcf.acp.package">
index 2d19e03039d80ab8527ae3f254bea13dba38ece8..fd6b253218cfaa706b62d4f1cc8b73bbb828de47 100644 (file)
@@ -781,6 +781,7 @@ Examples for medium ID detection:
                <item name="wcf.acp.option.module_members_list"><![CDATA[Members List]]></item>
                <item name="wcf.acp.option.footer_code"><![CDATA[TOOD: Footer-Code]]></item>
                <item name="wcf.acp.option.footer_code.description"><![CDATA[TOOD: Der hier angegebene Code wird im Fußbereich jeder Seite ausgegeben. Der Footer-Code eignet sich z.B. sehr gut für die Einbindung von Diensten wie „Google Analytics“ oder „Piwik“.]]></item>
+               <item name="wcf.acp.option.profile_enable_visitors"><![CDATA[TODO: Profil-Besucher anzeigen]]></item>
        </category>
        
        <category name="wcf.acp.package">