示例#1
0
 function test_distance_of_time_in_words()
 {
     // seconds
     $this->assertEqual('less than 5 seconds', distance_of_time_in_words(0, 0, true));
     $this->assertEqual('less than 5 seconds', distance_of_time_in_words(3, 0, true));
     $this->assertEqual('less than 10 seconds', distance_of_time_in_words(5, 0, true));
     $this->assertEqual('less than 10 seconds', distance_of_time_in_words(7, 0, true));
     $this->assertEqual('less than 20 seconds', distance_of_time_in_words(10, 0, true));
     $this->assertEqual('less than 20 seconds', distance_of_time_in_words(15, 0, true));
     $this->assertEqual('half a minute', distance_of_time_in_words(20, 0, true));
     $this->assertEqual('half a minute', distance_of_time_in_words(30, 0, true));
     $this->assertEqual('less than a minute', distance_of_time_in_words(40, 0, true));
     $this->assertEqual('less than a minute', distance_of_time_in_words(50, 0, true));
     // minutes
     $this->assertEqual('less than a minute', distance_of_time_in_words(0, 0));
     $this->assertEqual('less than a minute', distance_of_time_in_words(40, 0));
     $this->assertEqual('less than a minute', distance_of_time_in_words(0, 40));
     $this->assertEqual('less than a minute', distance_of_time_in_words(-40, 0));
     $this->assertEqual('less than a minute', distance_of_time_in_words(0, -40));
     $this->assertEqual('1 minute', distance_of_time_in_words(60, 0));
     $this->assertEqual('1 minute', distance_of_time_in_words(90, 0));
     $this->assertEqual('2 minutes', distance_of_time_in_words(120, 0));
     $this->assertEqual('20 minutes', distance_of_time_in_words(20 * 60, 0));
     $this->assertEqual('about 1 hour', distance_of_time_in_words(50 * 60, 0));
     $this->assertEqual('about 2 hours', distance_of_time_in_words(100 * 60, 0));
     $this->assertEqual('about 20 hours', distance_of_time_in_words(20 * 60 * 60, 0));
     $this->assertEqual('about 21 hours', distance_of_time_in_words(20 * 60 * 60 + 30 * 60, 0));
     $this->assertEqual('1 day', distance_of_time_in_words(24 * 60 * 60, 0));
     $this->assertEqual('1 day', distance_of_time_in_words(40 * 60 * 60, 0));
     $this->assertEqual('2 days', distance_of_time_in_words(48 * 60 * 60, 0));
     $this->assertEqual('about 1 month', distance_of_time_in_words(30 * 24 * 60 * 60, 0));
     $this->assertEqual('2 months', distance_of_time_in_words(60 * 24 * 60 * 60, 0));
     $this->assertEqual('about 1 year', distance_of_time_in_words(365 * 24 * 60 * 60, 0));
     $this->assertEqual('over 3 years', distance_of_time_in_words(3 * 365 * 24 * 60 * 60, 0));
 }
示例#2
0
 /**
  * This method returns the minuts/hours/day since publishing of this social object
  *
  * @author Christian Schätzle
  */
 public function getPublishingTime()
 {
     $lSocialObjectDate = $this->getC();
     sfProjectConfiguration::getActive()->loadHelpers(array('Date'));
     $lDate = distance_of_time_in_words($lSocialObjectDate);
     return $lDate;
 }
function twitterBadge($userEmail, $userPassword, $count = 4)
{
    $json = new Services_JSON();
    // Create the twitter Cacher object to pull feed
    // Password is needed in case feed is protected
    // HTTP Basic Auth hasn't been deprecated...yet...so...lazy wins for now
    $tc = new TwitterCacher($userEmail, $userPassword);
    $tc->setUserAgent("Mozilla/5.0 (compatible; TwitterCacher/1.0; +http://www.kolich.com)");
    //echo '<!-- ' . $tc->getUserTimeline(4) . ' -->';
    //Create a timeline object of the feed (pull from live if old)
    $timeline = $json->decode($tc->getUserTimeline($count));
    if (!$timeline) {
        return '<p>Error locating tweets.</p>';
    }
    // Create unorderer list of tweets (see gagawa module)
    $ul = new Ol();
    foreach ($timeline as $tweet) {
        $text = $tweet->text;
        //Format date as 5 min ago, 2 hours ago, etc.
        $date = distance_of_time_in_words(strtotime($tweet->created_at)) . ' ago';
        // Tweet source, i.e. twhril, tweetie, tweetdeck, etc.
        // $source = $tweet->source;
        // Generate direct link to tweet
        $tweetid = $tweet->id;
        $screenname = $tweet->user->screen_name;
        $tweetlink = 'http://twitter.com/' . $screenname . '/status/' . $tweetid;
        // Turn links into links
        $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)', '<a href="\\1" target="_blank">\\1</a>', $text);
        // Turn twitter @username into links to the users Twitter page
        $text = preg_replace('/(^|\\s)@(\\w+)/', '\\1<a href="http://www.twitter.com/\\2">@\\2</a>', $text);
        // Turn #hashtags into searches
        $text = preg_replace('/(^|\\s)#(\\w+)/', '\\1<a href="http://search.twitter.com/search?q=%23\\2">#\\2</a>', $text);
        // Personal Formatting, see Gagawa for documentaiton.
        // <li>Tweet Text <span>(<a href="linktotweet">some time ago</a>)<span></li>
        $li = new Li();
        $ul->appendChild($li);
        $li->appendChild(new Text($text . ' ('));
        $span = new Span();
        $link = new A();
        $link->setHref($tweetlink);
        $link->appendChild(new Text($date));
        $span->appendChild($link);
        $li->appendChild($span);
        $li->appendChild(new Text(')'));
    }
    //end foreach( $timeline as $tweet )
    // Returns the stack of li's enclosed by ul
    return $ul->write();
}
示例#4
0
function wrapTweets($timeline)
{
    if (!$timeline) {
        return '<p>Unable to connect to twitter.</p>';
    }
    // Create unorderer list of tweets (see gagawa module)
    $ul = new Ol();
    foreach ($timeline as $tweet) {
        $text = $tweet->text;
        //Format date as 5 min ago, 2 hours ago, etc.
        $date = distance_of_time_in_words(strtotime($tweet->created_at)) . ' ago';
        // Tweet source, i.e. twhril, tweetie, tweetdeck, etc.
        // $source = $tweet->source;
        // Generate direct link to tweet
        $tweetid = $tweet->id;
        $screenname = $tweet->user->screen_name;
        $tweetlink = 'http://twitter.com/' . $screenname . '/status/' . $tweetid;
        // Turn links into links
        $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)', '<a href="\\1" target="_blank">\\1</a>', $text);
        // Turn twitter @username into links to the users Twitter page
        $text = preg_replace('/(^|\\s)@(\\w+)/', '\\1<a href="http://www.twitter.com/\\2" target="_blank">@\\2</a>', $text);
        // Turn #hashtags into searches
        $text = preg_replace('/(^|\\s)#(\\w+)/', '\\1<a href="http://search.twitter.com/search?q=%23\\2" target="_blank">#\\2</a>', $text);
        // Personal Formatting, see Gagawa for documentaiton.
        // <li>Tweet Text <span>(<a href="linktotweet">some time ago</a>)<span></li>
        $li = new Li();
        $ul->appendChild($li);
        $span = new Span();
        $link = new A();
        $link->setHref($tweetlink);
        $link->appendChild(new Text($date));
        $span->appendChild($link);
        //$li->appendChild($span);
        $li->appendChild(new Text($text));
    }
    //end foreach( $timeline as $tweet )
    // Returns the stack of li's enclosed by ul
    return $ul->write();
}
            ?>
" title="<?php 
            echo $d->getTitle();
            ?>
">
                          <i class=" icone-rede <?php 
            echo strtolower($d->getDescription());
            ?>
 pull-right"></i>
                        </a>
                        <div class="">
                          <h5><?php 
            echo $d->getTitle();
            ?>
 <small><br/><?php 
            echo distance_of_time_in_words(strtotime($d->AssetContent->getHeadlineShort()), NULL, TRUE);
            ?>
</small></h5>
                        </div>
                        <img src="<?php 
            echo $d->AssetContent->getHeadline();
            ?>
" alt="<?php 
            echo $d->getTitle();
            ?>
" class="avatar pull-left">
                        <p><?php 
            echo html_entity_decode($d->AssetContent->render());
            ?>
</p>
                        <!--<a href="<?php 
' alt='avatar'/></td>
            		<td><?php 
    echo link_to(h($package->user->username . '/' . $package->name), url_for("PackageController", 'show', $package->user->username, $package->name));
    ?>
</td>
							</tr>
						</table>
        </td>
        <td><span class='small'><?php 
    echo $version->summary;
    ?>
</span></td>
        <td><?php 
    echo $version->min_php;
    ?>
</td>
        <td><span class='small'><?php 
    echo distance_of_time_in_words(DateHelper::from_db($package->updated_at), time(), true);
    ?>
 ago</span></td>
      </tr>
    <?php 
}
?>
  </tbody>
</table>
<div id='pagination'>
	<?php 
echo paginate($packages);
?>
</div>
示例#7
0
    <?php 
echo simple_format_text($forum->getDescription(), array('class' => 'forum_description'));
?>
  </td>
  <td class="forum_threads"><?php 
echo $forum->getNbTopics();
?>
</td>
  <td class="forum_posts"><?php 
echo $forum->getNbPosts();
?>
</td>
  <td class="forum_recent">
    <?php 
if ($forum->getLatestPostId()) {
    ?>
      <?php 
    $latest_post = $forum->getsfSimpleForumPost();
    ?>
      <?php 
    echo link_to($latest_post->getTitle(), '@show_forum_post?id=' . $latest_post->getId() . '&project=' . $project->getSlug() . '&forum_name=' . $latest_post->getsfSimpleforumForum()->getStrippedName());
    ?>
<br />
      <?php 
    echo __('%date% ago by %author%', array('%date%' => distance_of_time_in_words($latest_post->getCreatedAt('U')), '%author%' => get_partial('forums/author_name', array('author' => $latest_post->getAuthorName(), 'sf_cache_key' => $latest_post->getAuthorName()))));
    ?>
    <?php 
}
?>
  </td>
</tr>
示例#8
0
function print_preRegistration()
{
    global $player;
    $events = Event::getNextPreRegister();
    echo "<table><tr><td colspan=\"3\"><b>PREREGISTER FOR EVENTS</b></td></tr>";
    if (count($events) == 0) {
        echo "<tr><td colspan=\"3\"> No Upcoming Events! </td> </tr>";
    }
    foreach ($events as $event) {
        echo "<tr><td>{$event->name}</td>";
        echo "<td>" . distance_of_time_in_words(time(), strtotime($event->start)) . "</td>";
        if ($event->hasRegistrant($player->name)) {
            echo "<td>Registered <a href=\"prereg.php?action=unreg&event=" . urlencode($event->name) . "\">(Unreg)</a></td>";
        } else {
            echo "<td><a href=\"prereg.php?action=reg&event=" . urlencode($event->name) . "\">Register</a></td>";
        }
        echo "</tr>";
    }
    echo "</table>";
}
    <?php 
echo simple_format_text($forum->getDescription(), array('class' => 'forum_description'));
?>
  </td>
  <td class="forum_threads"><?php 
echo $forum->getNbTopics();
?>
</td>
  <td class="forum_posts"><?php 
echo $forum->getNbPosts();
?>
</td>
  <td class="forum_recent">
    <?php 
if ($forum->getLatestPostId()) {
    ?>
      <?php 
    $latest_post = $forum->getsfSimpleForumPost();
    ?>
      <?php 
    echo link_to($latest_post->getTitle(), 'sfSimpleForum/post?id=' . $latest_post->getId());
    ?>
<br />
      <?php 
    echo __('%date% ago by %author%', array('%date%' => distance_of_time_in_words($latest_post->getCreatedAt('U')), '%author%' => link_to(get_partial('sfSimpleForum/author_name', array('author' => $latest_post->getAuthorName(), 'sf_cache_key' => $latest_post->getAuthorName())), 'sfSimpleForum/userLatestPosts?username='******'sfSimpleForum');
    ?>
    <?php 
}
?>
  </td>
</tr>
示例#10
0
?>
"></a>
  
  <div id="comment_content">
    <div id="author_and_date">
		<?php 
$poster = $comment->getCommenterName();
?>
		<?php 
$posted_by = $comment->getCommenterLink() ? link_to($poster, $comment->getCommenterLink()) : $poster;
?>
      posted by <?php 
echo $posted_by;
?>
 <?php 
echo distance_of_time_in_words(strtotime($comment->getCreatedAt()));
?>
 ago.
    </div>
  
    <div id="body">
      <?php 
echo nl2br($comment->getBody());
?>
    </div>
  
    <?php 
if (sfConfig::get('app_comments_nesting')) {
    ?>
      <div id="links">
        <?php 
示例#11
0
  <div style="float:left;max-width:80%;">
    <h3><?php 
    echo link_to($feature->getId() . '. ' . $feature->getTitle(), 'features/show?feature=' . $feature->getUuid(), array('id' => $feature->getId()));
    ?>
 (<?php 
    echo format_number_choice('[' . sfConfig::get('app_feature_status_closed') . ']Closed|[' . sfConfig::get('app_feature_status_open') . ']Open|[' . sfConfig::get('app_feature_status_implemented') . ']Implemented|[' . sfConfig::get('app_feature_status_fixed') . ']Fixed', array('%1%' => $feature->getStatus()), $feature->getStatus());
    ?>
)<span id="indicator_<?php 
    echo $feature->getUuid();
    ?>
" style="display:none;"><?php 
    echo image_tag('indicator.gif');
    ?>
 Casting Vote...</span></h3>
    <h4><?php 
    echo __('A %type% Suggested by %1% %2% ago, regarding %category%', array('%1%' => link_to($feature->getsfGuardUser()->getProfile(), '@show_user?user='******'%2%' => distance_of_time_in_words($feature->getCreatedAt('U')), '%type%' => format_number_choice('[' . sfConfig::get('app_feature_type_bug') . ']Bug Report|[' . sfConfig::get('app_feature_type_feature') . ']Feature Request', array(), $feature->getType()), '%category%' => $feature->getCategoryInWords()));
    ?>
</h4>
    <p><?php 
    echo $feature->getDescription();
    ?>
</p>
  </div>
  <hr class="clear" />
</div>
<?php 
}
?>
<hr class="clear" />

示例#12
0
	</div>
	<div>
		<?php 
echo ucwords($profile->getTitle());
?>
<br />
		<?php 
echo $profile->getDepartment();
?>
<br />
		<?php 
echo $profile->getCampus();
?>
<br />
		<?php 
echo distance_of_time_in_words($profile->getsfGuardUser()->getLastLogin('U')) . ' ago';
$sf_context->getLogger()->info('checking sfguarduser');
$profile->getsfGuardUser();
$sf_context->getLogger()->info('finished checking...');
//format_date($profile->getSfGuardUser()->getLastLogin())
?>
<br />
	</div>
        <div style="float: right; right:10px; bottom: 10px;display:inline;">
    <?php 
if ($sf_user->isAuthenticated()) {
    ?>
      <?php 
    if ($sf_user->getId() == $profile->getUserId()) {
        ?>
          What...you want to add yourself as a friend?
示例#13
0
    Campus:<br />
    Department:<br />
    Updated:<br />
  </div>
  <div>
    <?php 
echo $project->getCampus();
?>
<br />
    <?php 
echo $project->getDepartment();
?>
<br />
    <?php 
$event = $project->getLastUpdated();
echo ucfirst(distance_of_time_in_words($event->getCreatedAt('U')) . ' ago'), ' (' . $event->getCategory() . ')';
?>
<br />
  </div>
  <div style="float: right; right:10px; bottom: 10px;display:inline;">
    <?php 
if ($sf_user->isAuthenticated()) {
    ?>
      <span>Favorite <?php 
    echo link_to_favorite($project, array());
    ?>
</span> |
      <?php 
    if ($sf_user->getProfile()->isSubscribedToHistoryGroup($project->getHistoryGroup()) == false) {
        ?>
        <span>Subscribe <?php 
示例#14
0
$t->is(distance_of_time_in_words($now - 49, $now, true), 'less than a minute', $msg);
$t->is(distance_of_time_in_words($now - 60, $now, true), '1 minute', $msg);

$t->is(distance_of_time_in_words($now - 10 * 60, $now), '10 minutes', $msg);
$t->is(distance_of_time_in_words($now - 50 * 60, $now), 'about 1 hour', $msg);

$t->is(distance_of_time_in_words($now - 3 * 3600, $now), 'about 3 hours', $msg);
$t->is(distance_of_time_in_words($now - 25 * 3600, $now), '1 day', $msg);

$t->is(distance_of_time_in_words($now - 4 * 86400, $now), '4 days', $msg);
$t->is(distance_of_time_in_words($now - 35 * 86400, $now), 'about 1 month', $msg);
$t->is(distance_of_time_in_words($now - 75 * 86400, $now), '3 months', $msg);

$t->is(distance_of_time_in_words($now - 370 * 86400, $now), 'about 1 year', $msg);
$t->is(distance_of_time_in_words($now - 4 * 370 * 86400, $now), 'over 4 years', $msg);
$t->is(distance_of_time_in_words($now - 1000 * 86400, $now), 'over 2 years', $msg);

// format_date()
$t->diag('format_date()');
$context->user->culture = 'fr';
$t->is(format_date(time()), date('d/m/y'), 'format_date() format a numerical date according to the user culture');
$t->is(format_date(date('Y-m-d')), date('d/m/y'), 'format_date() format a string date according to the user culture');
$t->is(format_date(date('y-m-d')), date('d/m/y'), 'format_date() format a string date with two digit year according to the user culture');
$t->is(format_date('1789-07-14'), '14/07/89', 'format_date() formats pre-epoch dates');

$context->user->culture = 'en';
$t->is(format_date($now, 'F'), date('F j, Y g:i:s A', $now).' '.date('T', $now), 'format_date() takes a format string as its second argument');

$context->user->culture = 'fr';
$t->is(format_date($now, 'F', 'en'), date('F j, Y g:i:s A', $now).' '.date('T', $now), 'format_date() takes a culture as its third argument');
    ?>
</div></td>
				<td><?php 
    echo link_to($version->version, url_for("VersionController", 'show', $package->user->username, $package->name, $version->version));
    ?>
</td>
        <td width='25%'><div class='small summary-right'><?php 
    echo $version->summary;
    ?>
</div></td>
        <td><?php 
    echo $version->min_php;
    ?>
</td>
        <td><span class='small'><?php 
    echo distance_of_time_in_words(DateHelper::from_db($version->created_at), time(), true);
    ?>
 ago</span></td>
				<td><?php 
    echo isset($package->rating) ? PackageRating::convert_to_human($package->rating) : 0;
    ?>
%</td>
      </tr>
    <?php 
}
?>
  </tbody>
</table>
<div id='pagination'>
	<?php 
echo paginate($packages);
示例#16
0
if ($website = $comment->getWebsite()) {
    ?>
    <a href="
            <?php 
    echo strstr($website, 'http://') ? $website : 'http://' . $website;
    ?>
       "><?php 
    echo $comment->getName();
    ?>
</a>
    <?php 
} else {
    ?>
      <?php 
    echo $comment->getName();
    ?>
    <?php 
}
?>
    -
    <?php 
echo distance_of_time_in_words($comment->getDateTimeObject('created_at')->format('U'), $article->getDateTimeObject('published_at')->format('U'));
?>
 later
  </dt>
  <dd>
    <?php 
echo simple_format_text($comment->getMessage());
?>
  </dd>
</dl>
示例#17
0
<?php

$options = array('title' => __('メンバー検索'), 'url' => url_for('member/search'), 'button' => __('Search'), 'method' => 'get');
op_include_form('searchMember', $filters, $options);
?>

<?php 
use_helper('Date');
?>

<?php 
if ($pager->getNbResults()) {
    $list = array();
    foreach ($pager->getResults() as $key => $member) {
        $list[$key] = array();
        $list[$key][__('%nickname%', array('%nickname%' => $op_term['nickname']->titleize()))] = $member->getName();
        if ($member->getProfile('op_preset_self_introduction')) {
            $list[$key][__('Self Introduction')] = $member->getProfile('op_preset_self_introduction');
        }
        $list[$key][__('Last Login')] = distance_of_time_in_words($member->getLastLoginTime());
    }
    $options = array('title' => __('Search Results'), 'pager' => $pager, 'link_to_page' => 'member/search?page=%d', 'link_to_detail' => 'member/profile?id=%d', 'list' => $list);
    op_include_parts('searchResultList', 'searchCommunityResult', $options);
} else {
    op_include_box('searchMemberResult', __('Your search queries did not match any members.'), array('title' => __('Search Results')));
}
示例#18
0
<?php

use_helper('Date');
?>
<strong>
  <a href="http://www.twitter.com/donateNashville" title="@donateNashville">twitter.com/donateNashville</a>
</strong>
<?php 
echo $tweet;
?>
&nbsp;(<?php 
echo distance_of_time_in_words(strtotime($time));
?>
 ago) 
示例#19
0
<?php

use_helper('Global');
?>
<h1>Recent Activity</h1>
<?php 
foreach ($project->getHistory() as $event) {
    ?>
  <div class="news-item-header">
    <?php 
    echo image_tag($event->getsfGuardUser()->getProfile()->getThumbnail());
    ?>
    <h3><?php 
    echo short_string($event->getTitle(), 50);
    ?>
</h3>
    <h4><?php 
    echo __('By %1% %2% ago', array('%1%' => $event->getsfGuardUser()->getProfile()->getFullName(), '%2%' => distance_of_time_in_words($event->getCreatedAt('U'))));
    ?>
</h4>
  </div>

  <p><?php 
    echo $event->getText();
    ?>
</p>
<?php 
}
示例#20
0
<?php

echo use_helper('I18N', 'Date');
?>
<div class="forum_sidebar_block">
  <h2><?php 
echo __('Recent posts');
?>
</h2>
  <ol>
  <?php 
foreach ($posts as $post) {
    ?>
    <li>
      <?php 
    echo link_to($post->getTitle(), 'forums/post?id=' . $post->getId());
    ?>
 <br />
    <?php 
    echo __('%date% ago by %author%', array('%date%' => distance_of_time_in_words($post->getCreatedAt('U')), '%author%' => link_to($post->getAuthorName(), 'forums/latestUserPosts?username=' . $post->getAuthorName())));
    ?>
    </li>
  <?php 
}
?>
  </ol>
</div>
示例#21
0
function time_ago_in_words($from)
{
    return distance_of_time_in_words($from, time());
}
示例#22
0
function time_ago_in_words($from_time, $include_seconds = false)
{
    return distance_of_time_in_words($from_time, time(), $include_seconds);
}
 $result = $invitationmanager->who_used_invite($invite);
 if (!empty($result)) {
     $row[2] .= get_string('used_by', 'enrol_invitation', $result);
 }
 // If user's enrollment expired or will expire, let viewer know.
 $result = $invitationmanager->get_access_expiration($invite);
 if (!empty($result)) {
     $row[2] .= ' ' . $result;
 }
 // When was the invite sent?
 $row[3] = date('M j, Y g:ia', $invite->timesent);
 // When does the invite expire?
 $row[4] = date('M j, Y g:ia', $invite->timeexpiration);
 // If status is active, then state how many days/minutes left.
 if ($status == get_string('status_invite_active', 'enrol_invitation')) {
     $expires_text = sprintf('%s %s', get_string('historyexpires_in', 'enrol_invitation'), distance_of_time_in_words(time(), $invite->timeexpiration, true));
     $row[4] .= ' ' . html_writer::tag('span', '(' . $expires_text . ')', array('expires-text'));
 }
 // Are there any actions user can do?
 $row[5] = '';
 $url = new moodle_url('/enrol/invitation/history.php', array('courseid' => $courseid, 'inviteid' => $invite->id));
 // Same if statement as above, seperated for clarity.
 if ($status == get_string('status_invite_active', 'enrol_invitation')) {
     // Create link to revoke an invite.
     $url->param('actionid', invitation_manager::INVITE_REVOKE);
     $row[5] .= html_writer::link($url, get_string('action_revoke_invite', 'enrol_invitation'));
     $row[5] .= html_writer::start_tag('br');
     // Create link to extend an invite.
     $url->param('actionid', invitation_manager::INVITE_EXTEND);
     $row[5] .= html_writer::link($url, get_string('action_extend_invite', 'enrol_invitation'));
 } else {
示例#24
0
    ?>
"><?php 
    echo $event;
    ?>
</h2>
<?php 
}
?>

<h2 class="event-fire-at"><?php 
echo human_date($event->getFireAt(), true);
?>
</h2>

<p class="estimate-time"><?php 
echo distance_of_time_in_words(time(), strtotime($event->getFireAt()));
?>
 до начала</p>

<?php 
if ($description = $event->getDescription()) {
    ?>
    <p class="point-desc"><?php 
    echo nl2br($description);
    ?>
</p>
<?php 
}
?>

<?php 
示例#25
0
?>
">
  <p class="sf_comment_info">
      <?php 
echo icon_tag('comment') . ' ';
?>
      <?php 
if (!is_null($comment['AuthorId'])) {
    ?>
        <?php 
    $user_config = sfConfig::get('app_sfPropelActAsCommentableBehaviorPlugin_user');
    $class = $user_config['class'];
    $toString = $user_config['toString'];
    $peer = sprintf('%sPeer', $class);
    $author = call_user_func(array($peer, 'retrieveByPk'), $comment['AuthorId']);
    echo __('Posted by %1%', array('%1%' => '<span class="sf_comment_author">' . link_to($author->getProfile()->getFullName(), 'user/show?user='******'</span>'));
} else {
    echo $comment['AuthorName'];
}
?>
,
    <?php 
echo __('%1% ago', array('%1%' => distance_of_time_in_words(strtotime($comment['CreatedAt']))));
?>
  </p>
  <p class="sf_comment_text">
    <?php 
echo $comment['Text'];
?>
  </p>
</div>
示例#26
0
文件: _fortune.php 项目: n1k0/sftunes
    </a>
  </h2>
  <blockquote>
    <?php 
echo fortunize($fortune->getRawValue());
?>
    <br style="clear:both"/>
  </blockquote>
  <aside class="fortune-infos">
    <p>
      Posted by <strong><?php 
echo $fortune['author'];
?>
</strong> 
      <?php 
echo distance_of_time_in_words(strtotime($fortune['created_at']));
?>
 ago. 
      <span class="fortune-actions">
        <strong><?php 
echo $fortune['votes'];
?>
 votes</strong> 
        <?php 
echo link_to('-', 'fortune_down', $fortune, array('method' => 'put', 'title' => 'Vote down this fortune'));
?>
 /
        <?php 
echo link_to('+', 'fortune_up', $fortune, array('method' => 'put', 'title' => 'Vote up this fortune'));
?>
      </span>
示例#27
0
    <h2><a name="comments"><?php 
    echo __('h2_comments', null, 'swBlogPosts');
    ?>
</a></h2>

    <?php 
    foreach ($sw_blog_post_comments->getResults() as $sw_blog_comment) {
        ?>
      <div class="sw_blog_comment">
        <div class="sw_blog_comment_name"><?php 
        echo $sw_blog_comment->getName();
        ?>
</div>
        <div class="sw_blog_comment_date">
          <?php 
        echo __('text_time_comment', array('__time__' => distance_of_time_in_words(strtotime($sw_blog_comment->getCreatedAt()), strtotime($sw_blog_post->getCreatedAt()), false)), 'swBlogPosts');
        ?>
        </div>

        <div class="sw_blog_comment_message">
          <?php 
        echo nl2br($sw_blog_comment->getMessage());
        ?>
        </div>
      </div>
    <?php 
    }
    ?>
  </div>
<?php 
}