Development

/plugins/sfPropelActAsCommentableBehaviorPlugin/tags/0.5/modules/sfComment/templates/_commentView.php

You must first sign up to be able to contribute.

root/plugins/sfPropelActAsCommentableBehaviorPlugin/tags/0.5/modules/sfComment/templates/_commentView.php

Revision 10775, 2.1 kB (checked in by xavier, 5 years ago)

sfPropelActAsCommentableBehaviorPlugin: tagging 0.5

Line 
1 <?php use_helper('I18N'); ?>
2 <?php use_helper('Date'); ?>
3 <div class="sf_comment" id="sf_comment_<?php echo $comment['Id'] ?>">
4   <?php if (sfConfig::get('app_sfPropelActAsCommentableBehaviorPlugin_use_gravatar', true)): ?>
5     <?php if (!is_null($comment['AuthorId'])): ?>
6       <?php
7       include_component('sfComment',
8                         'gravatar',
9                         array('author_id'    => $comment['AuthorId'],
10                               'sf_cache_key' => $comment['AuthorId']));
11       ?>
12     <?php else: ?>
13       <?php
14       include_component('sfComment',
15                         'gravatar',
16                         array('author_name'    => $comment['AuthorName'],
17                               'author_email' => $comment['AuthorEmail'],
18                               'sf_cache_key'   => $comment['AuthorEmail']));
19       ?>
20     <?php endif; ?>
21   <?php endif; ?>
22   <p class="sf_comment_info">
23     <?php
24     if (!is_null($comment['AuthorId']))
25     {
26       $author = get_component('sfComment',
27                               'author',
28                               array('author_id'    => $comment['AuthorId'],
29                                     'sf_cache_key' => $comment['AuthorId']));
30     }
31     else
32     {
33       $author = get_component('sfComment',
34                               'author',
35                               array('author_name'    => $comment['AuthorName'],
36                                     'author_website' => $comment['AuthorWebsite']));
37     }
38
39     $date_format = sfConfig::get('app_sfPropelActAsCommentableBehaviorPlugin_date_format', 'words');
40     if ('words' == $date_format)
41     {
42       $date = __('%1% ago', array('%1%' => distance_of_time_in_words(strtotime($comment['CreatedAt']))));
43     }
44     else
45     {
46       $date = format_date(strtotime($comment['CreatedAt']), $date_format);
47     }
48     ?>
49     <?php
50     echo __('<span class="sf_comment_author">%1%</span>, <a href="#sf_comment_%2%">%3%</a>',
51             array('%1%' => $author,
52                   '%2%' => $comment['Id'],
53                   '%3%' => $date))
54     ?>
55   </p>
56   <div class="sf_comment_text">
57     <?php echo $comment['Text']; ?>
58   </div>
59 </div>
Note: See TracBrowser for help on using the browser.