Changeset 505
- Timestamp:
- 05/10/08 20:22:59 (5 years ago)
- Location:
- profile.lastvisitors
- Files:
-
- 1 removed
- 5 modified
-
files/lib/system/event/listener/ProfilelastVisitorsListener.class.php (modified) (5 diffs)
-
files/lib/system/event/listener/ProfilelastVisitorsRenameListener.class.php (modified) (2 diffs)
-
package.xml (modified) (10 diffs)
-
template.diff (deleted)
-
templates/profilelastVisitor.tpl (modified) (3 diffs)
-
templates/profilelastVisitorSmall.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
profile.lastvisitors/files/lib/system/event/listener/ProfilelastVisitorsListener.class.php
r490 r505 3 3 4 4 class ProfilelastVisitorsListener implements EventListener { 5 5 6 6 public $visitorCount = 0; 7 7 public $visitors = array(); 8 8 public $profileID = 0; 9 9 10 10 11 11 /** … … 14 14 public function execute($eventObj, $className, $eventName){ 15 15 16 //Mit dieser IF Abfrage wird geschaut, ob der Visitor ein GAST oder ob er INVISIBLE ist. Sollte eines zustreffen, wird die Eingabe in die Datenbank nicht ausgefà ¯Ã¿Ãœhrt17 if (WCF::getUser()->userID != 0 && $eventObj->userID != WCF::getUser()->userID && WCF::getUser()->getPermission('admin.profile.lastvisitor.isinvisible') != 1 ){18 16 //Mit dieser IF Abfrage wird geschaut, ob der Visitor ein GAST oder ob er INVISIBLE ist. Sollte eines zustreffen, wird die Eingabe in die Datenbank nicht ausgefÃÆÃ¯ÃâÿÃâÜhrt 17 if (WCF::getUser()->userID != 0 && $eventObj->userID != WCF::getUser()->userID && WCF::getUser()->getPermission('admin.profile.lastvisitor.isinvisible') != 1 && WCF::getUser()->invisible != 1){ 18 19 19 $username = WCF::getUser()->username; 20 20 $escapedUsername = escapeString($username); 21 21 22 22 $sql = "INSERT INTO wcf".WCF_N."_profile_lastvisitors (profileID, userID, username, time) 23 23 VALUES ('".$eventObj->userID."', '".WCF::getUser()->userID."', '".$escapedUsername."', '".TIME_NOW."') … … 26 26 WCF::getDB()->sendQuery($sql); 27 27 } 28 28 29 29 // Ab hier wird die Anzeige gemacht. Es werden keine Daten mehr in die Datenbank eingespielt 30 30 // Hier werden die Daten der Besucher des angeschauten Profils gesammelt 31 $sql = "SELECT profile.userID, profile.username, profile.time, user.lastActivityTime 31 $sql = "SELECT profile.userID, profile.username, profile.time, user.lastActivityTime 32 32 FROM wcf".WCF_N."_profile_lastvisitors profile 33 33 LEFT OUTER JOIN wcf".WCF_N."_user user 34 34 ON (user.userID = profile.userID) 35 WHERE profile.profileID = '".$eventObj->userID."' 35 WHERE profile.profileID = '".$eventObj->userID."' 36 36 ORDER BY profile.time DESC LIMIT 0,".SHOW_LASTVISITOR_AMOUNT; 37 37 $result = WCF::getDB()->sendQuery($sql); … … 48 48 'visitorCount' => $this->visitorCount, 49 49 'profileID' => $eventObj->userID, 50 50 51 51 )); 52 52 //Datenbank wird hier aufgeraeumt... Hier werden alle Visitors geloescht, die nicht mehr angezeigt werden koennen (Visitors groesser 100) … … 69 69 WCF::getDB()->sendQuery($sql); 70 70 } 71 71 72 72 //Hier werden die Templates in die Platzhalter der userProfile.tpl geladen 73 73 WCF::getTPL()->append('additionalBoxes5', WCF::getTPL()->fetch('profilelastVisitorSmall')); 74 74 WCF::getTPL()->append('additionalContents3', WCF::getTPL()->fetch('profilelastVisitor')); 75 75 76 76 } 77 77 } -
profile.lastvisitors/files/lib/system/event/listener/ProfilelastVisitorsRenameListener.class.php
r496 r505 3 3 4 4 class ProfilelastVisitorsRenameListener implements EventListener { 5 public $username = 0; 5 public $username = 0; 6 6 7 7 /** … … 9 9 */ 10 10 public function execute($eventObj, $className, $eventName){ 11 11 12 12 13 13 if (isset($_POST['username'])) $this->username = StringUtil::trim($_POST['username']); 14 14 15 //Hier wird der Username in der Datenbank von dem alten auf den neuen Usernamen geÀndert. 15 if (WCF::getUser()->lastUsernameChange + WCF::getUser()->getPermission('user.profile.renamePeriod') * 86400 < TIME_NOW){ 16 17 //Hier wird der Username in der Datenbank von dem alten auf den neuen Usernamen geÃÆÃ€ndert. 16 18 $sql = "UPDATE wcf".WCF_N."_profile_lastvisitors 17 SET username = '". escapeString($this->username)."'19 SET username = '".$this->username."' 18 20 WHERE userID = '".WCF::getUser()->userID."'"; 19 21 WCF::getDB()->sendQuery($sql); 22 } 20 23 } 21 24 22 25 } 23 26 ?> -
profile.lastvisitors/package.xml
r495 r505 8 8 <packagedescription>Shows the last profile visitors in the user profile.</packagedescription> 9 9 <packagedescription language="de"><![CDATA[Mit diesem PlugIn werden die letzten Besucher im Profil angezeigt.]]></packagedescription> 10 <version>1.1. 7</version>11 <date>2008-05- 08</date>10 <version>1.1.8</version> 11 <date>2008-05-10</date> 12 12 <plugin>com.woltlab.wcf</plugin> 13 13 <isunique>1</isunique> … … 38 38 <userprofilemenu>userprofilemenu.xml</userprofilemenu> 39 39 </instructions> 40 40 41 41 <instructions type="update" fromversion="1.1.0"> 42 42 <files>files.tar</files> … … 51 51 <eventlistener>eventlistener.xml</eventlistener> 52 52 </instructions> 53 53 54 54 <instructions type="update" fromversion="1.1.1"> 55 55 <files>files.tar</files> … … 64 64 <eventlistener>eventlistener.xml</eventlistener> 65 65 </instructions> 66 66 67 67 <instructions type="update" fromversion="1.1.1 pl 1"> 68 68 <files>files.tar</files> … … 77 77 <eventlistener>eventlistener.xml</eventlistener> 78 78 </instructions> 79 79 80 80 <instructions type="update" fromversion="1.1.2"> 81 81 <files>files.tar</files> … … 89 89 <eventlistener>eventlistener.xml</eventlistener> 90 90 </instructions> 91 91 92 92 <instructions type="update" fromversion="1.1.3"> 93 93 <files>files.tar</files> … … 101 101 <eventlistener>eventlistener.xml</eventlistener> 102 102 </instructions> 103 103 104 104 <instructions type="update" fromversion="1.1.4"> 105 105 <files>files.tar</files> … … 113 113 <options>options.xml</options> 114 114 </instructions> 115 115 116 116 <instructions type="update" fromversion="1.1.5"> 117 117 <files>files.tar</files> … … 125 125 <options>options.xml</options> 126 126 </instructions> 127 127 128 128 <instructions type="update" fromversion="1.1.5 pl 1"> 129 129 <files>files.tar</files> … … 132 132 <languages languagecode="en">en.xml</languages> 133 133 <languages languagecode="fr">fr.xml</languages> 134 <languages languagecode="hr">hr.xml</languages> 134 <languages languagecode="hr">hr.xml</languages> 135 135 <templates>templates.tar</templates> 136 <eventlistener>eventlistener.xml</eventlistener> 136 <eventlistener>eventlistener.xml</eventlistener> 137 137 </instructions> 138 138 139 139 <instructions type="update" fromversion="1.1.6"> 140 140 <files>files.tar</files> 141 <templates>templates.tar</templates> 141 142 <languages languagecode="hr">hr.xml</languages> 142 143 <eventlistener>eventlistener.xml</eventlistener> 143 144 </instructions> 144 145 145 146 <instructions type="update" fromversion="1.1.6 pl 1"> 146 147 <files>files.tar</files> 148 <templates>templates.tar</templates> 147 149 <eventlistener>eventlistener.xml</eventlistener> 148 150 </instructions> 151 152 <instructions type="update" fromversion="1.1.7"> 153 <files>files.tar</files> 154 <templates>templates.tar</templates> 155 </instructions> 149 156 </package> -
profile.lastvisitors/templates/profilelastVisitor.tpl
r436 r505 15 15 <div class="{cycle}"> 16 16 <div class="fieldTitle"><a href="index.php?page=User&userID={$besucher["userID"]}">{$besucher["username"]}</a> 17 {if $besucher["lastActivityTime"] > TIME_NOW - USER_ONLINE_TIMEOUT && SHOW_LASTVISITOR_ONLINE == 1 }17 {if $besucher["lastActivityTime"] > TIME_NOW - USER_ONLINE_TIMEOUT && SHOW_LASTVISITOR_ONLINE == 1 && $this->user->invisible != 1 || $besucher["lastActivityTime"] > TIME_NOW - USER_ONLINE_TIMEOUT && SHOW_LASTVISITOR_ONLINE == 1 && $this->user->getPermission('admin.general.canViewInvisible') == 1} 18 18 <img src="{@RELATIVE_WCF_DIR}icon/onlineS.png" alt="" title="{lang}wcf.user.option.profile.lastvisitor.online{/lang}" /> 19 19 {elseif SHOW_LASTVISITOR_ONLINE == 1} 20 20 <img src="{@RELATIVE_WCF_DIR}icon/offlineS.png" alt="" title="{lang}wcf.user.option.profile.lastvisitor.offline{/lang}" /> 21 21 {/if} 22 </div> 23 <div class="fieldValue">{@$besucher["time"]|time}</div> 22 </div> 23 <div class="fieldValue">{@$besucher["time"]|time}</div> 24 24 </div> 25 25 {/foreach} … … 27 27 {if SHOW_LASTVISITOR_MOREVISITORS == 1 && $visitorCount >= SHOW_LASTVISITOR_AMOUNT} 28 28 <div class="cycle"> 29 <div class="fieldTitle"><a href="index.php?page=MoreVisitors{if SHOW_LASTVISITOR_MOREVISITORS_ONTAB_LINK == 1 && SHOW_LASTVISITOR_MOREVISITORS == 1}Tab{/if}&userID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 29 <div class="fieldTitle"><a href="index.php?page=MoreVisitors{if SHOW_LASTVISITOR_MOREVISITORS_ONTAB_LINK == 1 && SHOW_LASTVISITOR_MOREVISITORS == 1}Tab{/if}&userID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 30 30 </div> 31 31 {/if} … … 47 47 {if SHOW_LASTVISITOR_MOREVISITORS == 1 && $visitorCount >= SHOW_LASTVISITOR_AMOUNT} 48 48 <div class="cycle"> 49 <div class="fieldTitle"><a href="index.php?page=MoreVisitors&profileID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 49 <div class="fieldTitle"><a href="index.php?page=MoreVisitors&profileID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 50 50 </div> 51 51 {/if} -
profile.lastvisitors/templates/profilelastVisitorSmall.tpl
r436 r505 8 8 <div class="pageMenu"> 9 9 <ul> 10 {foreach from=$visitors item=$besucher} 10 {foreach from=$visitors item=$besucher} 11 11 <li><a href="index.php?page=User&userID={$besucher["userID"]}"> 12 {if $besucher["lastActivityTime"] > TIME_NOW - USER_ONLINE_TIMEOUT && SHOW_LASTVISITOR_ONLINE == 1 }12 {if $besucher["lastActivityTime"] > TIME_NOW - USER_ONLINE_TIMEOUT && SHOW_LASTVISITOR_ONLINE == 1 && $this->user->invisible != 1 || $besucher["lastActivityTime"] > TIME_NOW - USER_ONLINE_TIMEOUT && SHOW_LASTVISITOR_ONLINE == 1 && $this->user->getPermission('admin.general.canViewInvisible') == 1} 13 13 <img src="{@RELATIVE_WCF_DIR}icon/onlineS.png" alt="" title="{lang}wcf.user.option.profile.lastvisitor.online{/lang}" /> 14 14 {elseif SHOW_LASTVISITOR_ONLINE == 1} … … 19 19 {if SHOW_LASTVISITOR_MOREVISITORS == 1 && $visitorCount >= SHOW_LASTVISITOR_AMOUNT} 20 20 <div class="cycle"> 21 <div class="fieldTitle"><a href="index.php?page=MoreVisitors{if SHOW_LASTVISITOR_MOREVISITORS_ONTAB_LINK == 1 && SHOW_LASTVISITOR_MOREVISITORS == 1}Tab{/if}&userID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 21 <div class="fieldTitle"><a href="index.php?page=MoreVisitors{if SHOW_LASTVISITOR_MOREVISITORS_ONTAB_LINK == 1 && SHOW_LASTVISITOR_MOREVISITORS == 1}Tab{/if}&userID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 22 22 </div> 23 23 {/if}
