Changeset 505

Show
Ignore:
Timestamp:
05/10/08 20:22:59 (5 years ago)
Author:
MDMAN
Message:

new Version 1.1.8 added (profile.lastvisitors)

Location:
profile.lastvisitors
Files:
1 removed
5 modified

Legend:

Unmodified
Added
Removed
  • profile.lastvisitors/files/lib/system/event/listener/ProfilelastVisitorsListener.class.php

    r490 r505  
    33 
    44class ProfilelastVisitorsListener implements EventListener { 
    5      
     5 
    66    public $visitorCount = 0; 
    77    public $visitors = array(); 
    88    public $profileID = 0; 
    9     
     9 
    1010 
    1111    /** 
     
    1414    public function execute($eventObj, $className, $eventName){ 
    1515 
    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){ 
    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 
    1919                        $username = WCF::getUser()->username; 
    2020                        $escapedUsername = escapeString($username); 
    21                  
     21 
    2222                $sql = "INSERT INTO wcf".WCF_N."_profile_lastvisitors (profileID, userID, username, time) 
    2323                VALUES ('".$eventObj->userID."', '".WCF::getUser()->userID."', '".$escapedUsername."', '".TIME_NOW."') 
     
    2626            WCF::getDB()->sendQuery($sql); 
    2727        } 
    28          
     28 
    2929        // Ab hier wird die Anzeige gemacht. Es werden keine Daten mehr in die Datenbank eingespielt 
    3030        // 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 
    3232                FROM                    wcf".WCF_N."_profile_lastvisitors profile 
    3333                LEFT OUTER JOIN wcf".WCF_N."_user user 
    3434                ON                              (user.userID = profile.userID) 
    35                 WHERE                   profile.profileID = '".$eventObj->userID."'  
     35                WHERE                   profile.profileID = '".$eventObj->userID."' 
    3636                ORDER BY                profile.time DESC LIMIT 0,".SHOW_LASTVISITOR_AMOUNT; 
    3737        $result = WCF::getDB()->sendQuery($sql); 
     
    4848                'visitorCount' => $this->visitorCount, 
    4949                                'profileID' => $eventObj->userID, 
    50                  
     50 
    5151                )); 
    5252        //Datenbank wird hier aufgeraeumt... Hier werden alle Visitors geloescht, die nicht mehr angezeigt werden koennen (Visitors groesser 100) 
     
    6969            WCF::getDB()->sendQuery($sql); 
    7070        } 
    71         
     71 
    7272        //Hier werden die Templates in die Platzhalter der userProfile.tpl geladen 
    7373        WCF::getTPL()->append('additionalBoxes5', WCF::getTPL()->fetch('profilelastVisitorSmall')); 
    7474        WCF::getTPL()->append('additionalContents3', WCF::getTPL()->fetch('profilelastVisitor')); 
    75          
     75 
    7676   } 
    7777} 
  • profile.lastvisitors/files/lib/system/event/listener/ProfilelastVisitorsRenameListener.class.php

    r496 r505  
    33 
    44class ProfilelastVisitorsRenameListener implements EventListener { 
    5         public $username = 0;     
     5        public $username = 0; 
    66 
    77    /** 
     
    99    */ 
    1010    public function execute($eventObj, $className, $eventName){ 
    11          
     11 
    1212 
    1313        if (isset($_POST['username'])) $this->username = StringUtil::trim($_POST['username']); 
    1414 
    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. 
    1618        $sql = "UPDATE wcf".WCF_N."_profile_lastvisitors 
    17                         SET username = '".escapeString($this->username)."' 
     19                        SET username = '".$this->username."' 
    1820                        WHERE userID = '".WCF::getUser()->userID."'"; 
    1921        WCF::getDB()->sendQuery($sql); 
     22        } 
    2023    } 
    21          
     24 
    2225} 
    2326?> 
  • profile.lastvisitors/package.xml

    r495 r505  
    88                <packagedescription>Shows the last profile visitors in the user profile.</packagedescription> 
    99                <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> 
    1212                <plugin>com.woltlab.wcf</plugin> 
    1313                <isunique>1</isunique> 
     
    3838                <userprofilemenu>userprofilemenu.xml</userprofilemenu> 
    3939        </instructions> 
    40          
     40 
    4141        <instructions type="update" fromversion="1.1.0"> 
    4242                <files>files.tar</files> 
     
    5151                <eventlistener>eventlistener.xml</eventlistener> 
    5252        </instructions> 
    53          
     53 
    5454        <instructions type="update" fromversion="1.1.1"> 
    5555                <files>files.tar</files> 
     
    6464                <eventlistener>eventlistener.xml</eventlistener> 
    6565        </instructions> 
    66          
     66 
    6767        <instructions type="update" fromversion="1.1.1 pl 1"> 
    6868                <files>files.tar</files> 
     
    7777                <eventlistener>eventlistener.xml</eventlistener> 
    7878        </instructions> 
    79          
     79 
    8080        <instructions type="update" fromversion="1.1.2"> 
    8181                <files>files.tar</files> 
     
    8989                <eventlistener>eventlistener.xml</eventlistener> 
    9090        </instructions> 
    91          
     91 
    9292        <instructions type="update" fromversion="1.1.3"> 
    9393                <files>files.tar</files> 
     
    101101                <eventlistener>eventlistener.xml</eventlistener> 
    102102        </instructions> 
    103          
     103 
    104104        <instructions type="update" fromversion="1.1.4"> 
    105105                <files>files.tar</files> 
     
    113113                <options>options.xml</options> 
    114114        </instructions> 
    115          
     115 
    116116        <instructions type="update" fromversion="1.1.5"> 
    117117                <files>files.tar</files> 
     
    125125                <options>options.xml</options> 
    126126        </instructions> 
    127          
     127 
    128128        <instructions type="update" fromversion="1.1.5 pl 1"> 
    129129                <files>files.tar</files> 
     
    132132                <languages languagecode="en">en.xml</languages> 
    133133                <languages languagecode="fr">fr.xml</languages> 
    134                 <languages languagecode="hr">hr.xml</languages>          
     134                <languages languagecode="hr">hr.xml</languages> 
    135135                <templates>templates.tar</templates> 
    136                 <eventlistener>eventlistener.xml</eventlistener>                 
     136                <eventlistener>eventlistener.xml</eventlistener> 
    137137        </instructions> 
    138          
     138 
    139139        <instructions type="update" fromversion="1.1.6"> 
    140140                <files>files.tar</files> 
     141                <templates>templates.tar</templates> 
    141142                <languages languagecode="hr">hr.xml</languages> 
    142143                <eventlistener>eventlistener.xml</eventlistener> 
    143144        </instructions> 
    144          
     145 
    145146        <instructions type="update" fromversion="1.1.6 pl 1"> 
    146147                <files>files.tar</files> 
     148                <templates>templates.tar</templates> 
    147149                <eventlistener>eventlistener.xml</eventlistener> 
    148150        </instructions> 
     151 
     152        <instructions type="update" fromversion="1.1.7"> 
     153                <files>files.tar</files> 
     154                <templates>templates.tar</templates> 
     155        </instructions> 
    149156</package> 
  • profile.lastvisitors/templates/profilelastVisitor.tpl

    r436 r505  
    1515                                        <div class="{cycle}"> 
    1616                                                <div class="fieldTitle"><a href="index.php?page=User&amp;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} 
    1818                                                        <img src="{@RELATIVE_WCF_DIR}icon/onlineS.png" alt="" title="{lang}wcf.user.option.profile.lastvisitor.online{/lang}" /> 
    1919                                                {elseif SHOW_LASTVISITOR_ONLINE == 1} 
    2020                                                        <img src="{@RELATIVE_WCF_DIR}icon/offlineS.png" alt="" title="{lang}wcf.user.option.profile.lastvisitor.offline{/lang}" /> 
    2121                                                {/if} 
    22                                                 </div>   
    23                                                 <div class="fieldValue">{@$besucher["time"]|time}</div>  
     22                                                </div> 
     23                                                <div class="fieldValue">{@$besucher["time"]|time}</div> 
    2424                                        </div> 
    2525                                {/foreach} 
     
    2727                                {if SHOW_LASTVISITOR_MOREVISITORS == 1 && $visitorCount >= SHOW_LASTVISITOR_AMOUNT} 
    2828                                        <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}&amp;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}&amp;userID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 
    3030                                        </div> 
    3131                                {/if} 
     
    4747                                        {if SHOW_LASTVISITOR_MOREVISITORS == 1 && $visitorCount >= SHOW_LASTVISITOR_AMOUNT} 
    4848                                                <div class="cycle"> 
    49                                                         <div class="fieldTitle"><a href="index.php?page=MoreVisitors&amp;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&amp;profileID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 
    5050                                                </div> 
    5151                                        {/if} 
  • profile.lastvisitors/templates/profilelastVisitorSmall.tpl

    r436 r505  
    88                        <div class="pageMenu"> 
    99                                <ul> 
    10                                         {foreach from=$visitors item=$besucher}                                          
     10                                        {foreach from=$visitors item=$besucher} 
    1111                                                <li><a href="index.php?page=User&amp;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} 
    1313                                                        <img src="{@RELATIVE_WCF_DIR}icon/onlineS.png" alt="" title="{lang}wcf.user.option.profile.lastvisitor.online{/lang}" /> 
    1414                                                {elseif SHOW_LASTVISITOR_ONLINE == 1} 
     
    1919                                        {if SHOW_LASTVISITOR_MOREVISITORS == 1 && $visitorCount >= SHOW_LASTVISITOR_AMOUNT} 
    2020                                                <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}&amp;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}&amp;userID={$profileID}{@SID_ARG_2ND}">{lang}wcf.user.option.profile.lastvisitor.allusers{/lang}</a></div> 
    2222                                                </div> 
    2323                                        {/if}