示例#1
0
            <p>Hi, <strong><?php 
echo $username;
?>
</strong>! Welcome to your personal profile page.</p>
            <p>Check the right sidebar for your account information.</p>
            <h2>My Feed</h2>
            <ul>
              <li>10/24/2011 - Account Created</li>
              <li>10/25/2011 - First Post</li>
            </ul>
          </div>
          <div class="span2">
            <h3>My Account</h3>
            <ul>
              <li><strong>Gravatar: </strong></li><li style="list-style:none;"><?php 
echo gravatar_image($email);
?>
</li>
              <li><strong>Username: </strong><?php 
echo $username;
?>
</li>
              <li><strong>User Id: </strong><?php 
echo $user_id;
?>
</li>
              <li><strong>Account Type: </strong><?php 
echo $role;
?>
</li>
              <li><strong>Email: </strong><?php 
示例#2
0
 static function write_comments_wb($page)
 {
     $comments = Comments::get_all($page->url);
     echo "<div id='comments'>\n";
     echo " <div id='comments-body'><a name='comments'></a>\n";
     if (empty($comments)) {
         echo "  <h2>Comment</h2>\n";
     } else {
         echo "  <h2>Comments</h2>\n";
         foreach ($comments as $c) {
             echo "<div class='post-comment' id='comment-" . htmlspecialchars($c->id) . "'>\n";
             echo "<a name='comment-" . htmlspecialchars($c->id) . "'></a>\n";
             echo "<div class='poster'>";
             echo "<img src='" . htmlspecialchars(gravatar_image($c->author_email)) . "' alt='' class='avatar'>";
             if ($c->author_url) {
                 $url = htmlspecialchars($c->author_url);
                 if (preg_match('@^[a-z0-9]+[.]@', $url)) {
                     $url = 'http://' . $url;
                 }
                 echo '<a href="' . $url . '">' . htmlspecialchars($c->author_name) . '</a>';
             } else {
                 echo htmlspecialchars($c->author_name);
             }
             if ($c->date) {
                 $date = strtotime($c->date);
                 //$date = strftime('%Y-%m-%d %H:%M:%S',$date);
                 $date = gmstrftime('%Y-%m-%d<span class="Z">T</span>%H:%M<span class="Z" title="UTC">Z</span>', $date);
                 echo "<span class='date'>Date: {$date}</span>";
             }
             echo "<a href='delete-comment/{$page->url}?comment=" . urlencode($c->id) . "' class='delete'>x</a>";
             echo "</div>";
             echo $c->body_html();
             echo "</div>";
         }
         echo "  <h2>Reply</h2>\n";
     }
     echo "  <form method='post' action='add-comment/{$page->url}#new-comment'><a name='new-comment'></a>\n";
     echo "   <input type='hidden' name='url' value='", htmlspecialchars($page->url), "'>\n";
     echo "   <table>";
     global $invalid_fields;
     echo "    <tr><td><label for='author_name' >Name</label    ><td><input type='text'  name='author_name'  id='author_name'  " . (isset($invalid_fields['author_name']) ? 'class="invalid" ' : '') . "value='", request_var('author_name'), "'>\n";
     echo "    <tr><td><label for='author_url'  >Homepage</label><td><input type='text'  name='author_url'   id='author_url'   " . (isset($invalid_fields['author_url']) ? 'class="invalid" ' : '') . "value='", request_var('author_url'), "'> <span class='help'>(optional)</span>\n";
     echo "    <tr><td><label for='author_email'>Email</label   ><td><input type='email' name='author_email' id='author_email' " . (isset($invalid_fields['author_email']) ? 'class="invalid" ' : '') . "value='", request_var('author_email'), "'> <span class='help'>(optional, will not be revealed)</span>\n";
     echo "    <tr><td><td><label><input type='checkbox' name='author_subscribe' ", request_var_check('author_subscribe'), "> Subscribe to comments on this article</label>\n";
     // generate captcha
     $captcha = new Captcha();
     echo "    <tr><td><label for='captcha'>Human?</label><td>";
     echo "<input type='hidden' name='captcha_answer' value='" . htmlspecialchars($captcha->answer) . "'>";
     echo "<input type='hidden' name='captcha_question' value='" . htmlspecialchars($captcha->question) . "'>";
     echo "{$captcha->question} <input type='text' name='captcha' id='captcha' " . (isset($invalid_fields['captcha']) ? 'class="invalid" ' : '') . "value='", request_var('captcha'), "'>\n";
     echo "   </table>";
     echo "   <textarea rows='6' name='body'" . (isset($invalid_fields['body']) ? 'class="invalid" ' : '') . ">", htmlspecialchars(@$_REQUEST['body']), "</textarea>\n";
     echo "   <div class='edit-help'>";
     echo "    Use <tt>&gt; code</tt> for code blocks, <tt>@code@</tt> for inline code. Some html is also allowed.";
     echo "   </div>";
     echo "   <input type='submit' value='Submit'>\n";
     if (isset($invalid_fields[''])) {
         echo $invalid_fields[''];
     }
     echo "  </form>\n";
     echo " </div>\n";
     echo "</div>";
 }