コード例 #1
0
ファイル: details.php プロジェクト: vincenta/achievements
<?php 
$creator = $this->achievement->creator->target();
?>

<h1><?php 
echo __('Achievement details');
?>
</h1>

<?php 
echo $this->render_partial('share/achievement', array('achievement' => $this->achievement, 'nolinks' => true));
?>

<div class="achievementDetails">
    <div class="gravatar"><?php 
echo gravatar_tag($creator);
?>
</div>
    <div class="details">
        <?php 
echo '<span class="author">' . _f('Created by %s, %s.', array($creator, displayable_date($this->achievement->created_on))) . '</span>';
if ($this->achievement->updated_on > $this->achievement->created_on) {
    echo "<br/>\n" . _f('Updated %s.', displayable_date($this->achievement->updated_on));
}
echo "<br/>\n" . _f('Reward : %s.', $this->achievement->reward);
if ($this->achievement->is_expired()) {
    echo "<br/>\n" . __('Expired');
}
if ($this->achievement->is_unlocked()) {
    echo "<br/>\n" . _f('Won by %s', $this->achievement->winner->target()->__toString());
}
コード例 #2
0
ファイル: _comment.php プロジェクト: vincenta/achievements
<?php 
$author = $comment->author->target();
$body = nl2br(htmlspecialchars($comment->body));
$body = preg_replace('/http(s){0,1}:\\/\\/([^\\s\\(\\)\\{\\}\\|\\\\^~\\[\\]<`]*)/e', '\'<a href="http\\1://\'.str_replace(\'"\',\'%22\',\'\\2\').\'">\\2</a>\'', $body);
$attachment = $comment->attachment;
?>

<div class="comment">
    <div class="gravatar"><?php 
echo gravatar_tag($author);
?>
</div>
    <div class="details">
        <span class="author"><?php 
echo _f('Commented by %s, %s :', array($author, displayable_date($comment->created_on)));
?>
</span>
        <?php 
if (!empty($attachment)) {
    ?>
            <br/><span class="attachment"><?php 
    echo link_to(__('See attachment'), array('controller' => $attachment), array('title' => __('View the attachment')));
    ?>
        <?php 
}
?>
        <blockquote><?php 
echo $body;
?>
</blockquote>