Changeset 89

Show
Ignore:
Timestamp:
2007-12-08 12:54:21 (4 years ago)
Author:
hannes
Message:

adding 'posts per day' to profile page

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/classes/misc/Member.php

    r81 r89  
    381381            $table->addRow(Array($LANG['Homepage'] . ':', '-')); 
    382382        } 
    383         $table->addRow(Array($LANG['Posts'] . ':', $this->posts)); 
     383        // number of days since registration 
     384        $today = new DateTime('now', new DateTimeZone('UTC')); 
     385        $diff = strtotime($today->format('Y-m-d')) - strtotime($this->registration); 
     386        $days = max(1, $diff) / (60 * 60 * 24); 
     387        $table->addRow(Array($LANG['Posts'] . ':', $this->posts . ' (' . round($this->posts / $days , 1) . ' ' . $LANG['per_day'] . ')')); 
    384388        $table->addRow(Array($LANG['Stage'] . ':', $this->stage)); 
    385389        $table->addRow(Array($LANG['Registration'] . ':', $F->datetime($this->registration, TRUE, FALSE))); 
  • trunk/includes/lang/de.php

    r86 r89  
    309309$LANG['Last_x_Posts'] = 'Die letzten %n% Beiträge'; 
    310310$LANG['View_All'] = 'Alle ansehen'; 
     311$LANG['per_day'] = 'pro Tag'; 
    311312 
    312313/* actual sentences */ 
  • trunk/includes/lang/en.php

    r84 r89  
    310310$LANG['Last_x_Posts'] = 'Last %n% Posts'; 
    311311$LANG['View_All'] = 'View All'; 
     312$LANG['per_day'] = 'per day'; 
    312313 
    313314/* actual sentences */