Esempio n. 1
0
    /**
     * Генерирует информацию про юзера, по его данным, в HTML-код для страницы отзывов (сдвоенный вывод)
     *
     * @global $session Сессия пользователя
     *
     * @param array   $user				Информация о юзере
     * @return string HTML-код
     */
    public static function printUserInfoMy($user, $direction = 'from')
    {
        global $session;
        $u_obj = $user;
        if (is_object($user)) {
            $user = get_object_vars($user);
        }
        $is_emp = is_emp($user['role']);
        $login = $user['login'];
        $uname = ucfirst($user['uname']);
        $usurname = ucfirst($user['usurname']);
        $photo = $user['photo'];
        $dir = $user['login'];
        $on_site = "";
        if (hasPermissions('users')) {
            $on_site = "На сайте " . ElapsedMnths(strtotime($user['reg_date']));
            $on_site = "<i>{$on_site}</i>";
        }
        if (!in_array($direction, array('from', 'to'))) {
            $direction = 'from';
        }
        $template = '<div class="ops-$direction">
		<a href="$href" class="$role-name">
                   <img src="$img" alt="" width="25" height="25" class="sav" />
		</a>$user_name ' . $on_site . '
	</div>';
        $role = $is_emp ? 'employer' : 'freelancer';
        $img = view_avatar($user['login'], $photo, 0, 0);
        if (!preg_match("/src\\=(\\'|\")([^\\'\"]+)(\\'|\")/i", $img, $res)) {
            $img = '/images/icons/f-pro.png';
        } else {
            $img = $res[2];
        }
        $href = "/users/{$login}/";
        $user_name = __prntUsrInfo($u_obj);
        // "{$uname} {$usurname} [{$login}]";
        $html = strtr($template, array('$direction' => $direction, '$role' => $role, '$img' => $img, '$href' => $href, '$user_name' => $user_name));
        return $html;
    }
Esempio n. 2
0
?>
</li>
            <li><a onclick="hlAnchor('s',<?php 
echo $theme['id'];
?>
)" href="#s_<?php 
echo $theme['id'];
?>
" class="ops-anchor">#</a></li>
        </ul>
        <?php 
echo strtr(view_avatar($theme['login'], $theme['photo']), array('<img' => '<img style="user-avatar"'));
?>
        <div class="user-info">
            <div class="username" style="font-size: 12px"><?php 
echo __prntUsrInfo($user);
?>
                <?php 
if (hasPermissions('users')) {
    ?>
                <i>На сайте <?php 
    echo ElapsedMnths(strtotime($user->reg_date));
    ?>
</i>
                <?php 
}
?>
            </div>
            <?php 
$curr_sbr_id = $theme['sbr_id'];
?>
Esempio n. 3
0
  <?php 
foreach ($pss as $ps) {
    ?>
    <tr valign="top">
      <td>
        <a name="mass_<?php 
    echo $ps['id'];
    ?>
"></a>
        <?php 
    echo view_avatar($ps['user_login'], $ps['user_photo']);
    ?>
      </td>
      <td style="padding:0 0 0 10px">
        <?php 
    echo __prntUsrInfo($ps, 'user_') . '&nbsp;&nbsp;' . dateFormat('[d.m.Y | H:i]', $ps['posted_time']);
    ?>
        <div id="mass_txt_<?php 
    echo $ps['id'];
    ?>
" style="padding-top:5px">
          <?php 
    $msg_text = !$om && $ps['user_is_pro'] != 't' ? $stop_words->replace($ps['msgtext']) : $ps['msgtext'];
    ?>
          <?php 
    echo reformat($msg_text, 30, 0, 0, 1);
    ?>
        </div>
		<div style="margin-top: 10px">
		<?php 
    if (!empty($ps['files'])) {