/**
  * Returns html string representing the beginning block of a timeline entry
  * @return string
  */
 public function html_start()
 {
     $t_avatar = Avatar::get($this->user_id, 32);
     if ($t_avatar === null) {
         return sprintf('<div class="entry"><div class="timestamp">%s</div>', $this->format_timestamp($this->timestamp));
     }
     return sprintf('<div class="entry"><div class="avatar"><a href="%s"><img class="avatar" src="%s" alt="%s" width="32" height="32" /></a></div><div class="timestamp">%s</div>', $t_avatar->link, $t_avatar->image, $t_avatar->text, $this->format_timestamp($this->timestamp));
 }
Beispiel #2
0
/**
 * Print avatar image for the given user ID
 *
 * @param integer $p_user_id A user identifier.
 * @param integer $p_size    Image pixel size.
 * @return void
 */
function print_avatar($p_user_id, $p_size = 80)
{
    $t_avatar = Avatar::get($p_user_id, $p_size);
    if ($t_avatar === null) {
        return;
    }
    $t_image = htmlspecialchars($t_avatar->image);
    $t_link = htmlspecialchars($t_avatar->link);
    $t_text = htmlspecialchars($t_avatar->text);
    echo '<a rel="nofollow" href="' . $t_link . '">' . '<img class="avatar" src="' . $t_image . '" alt="' . $t_text . '" width="' . $p_size . '" height="' . $p_size . '" /></a>';
}