Esempio n. 1
0
 protected static function func(&$a)
 {
     if (!empty($a['avatar'])) {
         $a['avatar'] = '{_AVATAR_IMG_SITE_}{_DIR_}/w/img/avatar/sqr/' . $a['avatar'];
     } elseif (!empty($a['avatar_external'])) {
         $a['avatar'] = $a['avatar_external'];
     } elseif (!empty($a['gravatar']) && !empty($a['email'])) {
         $a['avatar'] = $a['gravatar']['url'] . hash('md5', $a['email']) . '?s=36' . '&d=' . $a['gravatar']['fallback'] . '&r=' . $a['gravatar']['rating'];
     } else {
         $a['avatar'] = '{_IMAGE_SITE_}{_DIR_}/images/avatar.png';
     }
     $fn = !empty($a['fn']) ? $a['fn'] : '';
     $ln = !empty($a['ln']) ? $a['ln'] : '';
     $mn = !empty($a['mn']) ? $a['mn'] : '';
     $displayName = $fn . ' ' . $mn . ' ' . $ln;
     $a['displayName'] = strlen($displayName) > 2 ? $displayName : (array_key_exists('username', $a) ? $a['username'] : '');
     $lastActive = !empty($a['i_lm_ts']) ? $a['i_lm_ts'] : $a['i_reg_ts'];
     $registered = $a['i_reg_ts'];
     if (!isset($_SESSION['locale']) || 0 === strncmp('en', $_SESSION['locale'], 2)) {
         $a['since'] = \Lampcms\TimeAgo::format(new \DateTime(date('r', $registered)));
         $a['last_seen'] = \Lampcms\TimeAgo::format(new \DateTime(date('r', $lastActive)));
     } else {
         $a['since'] = \Lampcms\TimeFormatter::formatTime($_SESSION['locale'], $registered);
         $a['last_seen'] = \Lampcms\TimeFormatter::formatTime($_SESSION['locale'], $lastActive);
     }
     if ('deleted' == $a['role']) {
         $a['deleted'] = 'deleted';
     }
 }
Esempio n. 2
0
 protected static function func(&$a)
 {
     if (!empty($a['hts'])) {
         $reltime = \Lampcms\TimeAgo::format(new \DateTime($a['hts']));
         $a['time_ago'] = '<div class="cb fl timeago">' . $a['latest_label'] . ' ' . $reltime . '</div>';
     }
     if (!empty($a['i_qcount'])) {
         $a['counters'] = '<div class="counts cb1 fl">[' . $a['i_qcount'] . ' / ' . $a['i_acount'] . ']</div>';
     }
 }
    protected static function func(&$a)
    {
        if (!empty($a['a_closed'])) {
            $a['closed'] = ' closed';
        }
        if (!empty($a['a_latest'])) {
            $reltime = \Lampcms\TimeAgo::format(new \DateTime($a['a_latest'][0]['t']));
            $a['last_poster'] = '<div class="lastposter fl cb">' . $a['latest_by'] . ': ' . $a['a_latest'][0]['u'] . '<br>
			<span title="' . $a['a_latest'][0]['t'] . '" class="ts">' . $reltime . '</span></div>';
        }
    }
Esempio n. 4
0
    protected static function func(&$a)
    {
        if (!empty($a['a_closed'])) {
            $a['closed'] = ' closed';
        }
        if (!empty($a['a_latest'])) {
            $reltime = \Lampcms\TimeAgo::format(new \DateTime($a['a_latest'][0]['t']));
            $a['last_poster'] = '<div class="lastposter fl cb">@@Latest answer by@@: ' . $a['a_latest'][0]['u'] . '<br>
			<span title="' . $a['a_latest'][0]['t'] . '" class="ts">' . $reltime . '</span></div>';
        }
        $a['hts'] = date('Y-m-d H:i:s', $a['i_ts']);
    }
 protected static function func(&$a)
 {
     //if(!empty($a['a_latest'])){
     //	$a['latest'] = '';
     //}
     if (!empty($a['hts'])) {
         $reltime = \Lampcms\TimeAgo::format(new \DateTime($a['hts']));
         $a['time_ago'] = '<div class="fl timeago">' . $a['latest_label'] . ' ' . $reltime . '</div>';
     }
     if ($a['b_catonly']) {
         $a['title'] = $a['title'];
     } else {
         $a['title'] = '<a href="/category/' . $a['slug'] . '">' . $a['title'] . '</a>';
     }
 }