예제 #1
0
파일: User.php 프로젝트: r4mp/Foodle
 public static function getUsernameHTMLstatic($userid, $username, $hasprofile = FALSE, $includeToken = TRUE, $nolink = FALSE)
 {
     $userpage = '/user/' . $userid;
     if ($includeToken) {
         $userpage .= '?token=' . Data_User::getUserToken($userid, 'profile');
     }
     $str = '';
     if ($hasprofile && !$nolink) {
         $str .= '<a href="' . htmlspecialchars($userpage) . '"><img src="/res/user_grey.png" alt="User profile" />';
     }
     $str .= htmlspecialchars($username);
     if ($hasprofile && !$nolink) {
         $str .= '</a>';
     }
     if (isset($userid)) {
         $str = '<abbr title="' . htmlspecialchars($userid) . '">' . $str . '</abbr>';
     }
     if (preg_match('|^@(.*)$|', $userid, $matches)) {
         $str .= ' (<a href="http://twitter.com/' . $matches[1] . '">' . $userid . '</a>)';
     }
     return $str;
 }