static function html($obj) { $from = new \mixi\profile\obj($obj->from); try { $from->load(); $url = $from->url(); return <<<ENDLINE <p><img src='{$from->profile_picture1}' alt='{$from->nickname}'s picture'><br><a href="{$url}">{$from->nickname}</a><br>{$obj->message_order} ({$obj->datetime})<br><a href='mailto:{$obj->from}@dsmob.com'>Contact Writer</a></p> <div>{$obj->contents}</div> ENDLINE; } catch (\Exception $e) { return "<p>Someone posted a message here but their profile is not yet available. They were probably deleted. You can check here: show_friend.pl?id={$obj->from}&from=navi</p> <div>{$obj->contents}</div>"; } }
function send_ashiato($from, $ashiato) { $mail_message = ""; foreach ($ashiato as $aa) { $u = new \mixi\profile\obj($aa->from); $u->load(); $message = "<p><a href='http://www.mixi.jp/show_friend.pl?id=%d&from=navi'>%s</a> visited your page at %s<br><img src='%s' alt='%s'></p>"; $message = sprintf($message, $u->id(), $u->nickname, $aa->datetime, $u->profile_picture1, $u->nickname . "'s picture"); $mail_message .= $message . "\n<hr>"; } POP3::send_mail($from, 'Ashiato List', $mail_message); }