当前位置: 首页>>代码示例>>PHP>>正文


PHP common_exact_date函数代码示例

本文整理汇总了PHP中common_exact_date函数的典型用法代码示例。如果您正苦于以下问题:PHP common_exact_date函数的具体用法?PHP common_exact_date怎么用?PHP common_exact_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了common_exact_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 /**
  * Show the widget
  *
  * @return void
  */
 function show()
 {
     $this->out->elementStart('li', array('class' => 'h-entry notice', 'id' => 'message-' . $this->message->id));
     $profile = $this->getMessageProfile();
     $this->out->elementStart('a', array('href' => $profile->profileurl, 'class' => 'p-author'));
     $avatarUrl = $profile->avatarUrl(AVATAR_STREAM_SIZE);
     $this->out->element('img', array('src' => $avatarUrl, 'class' => 'avatar u-photo', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => $profile->getBestName()));
     $this->out->element('span', array('class' => 'nickname fn'), $profile->getNickname());
     $this->out->elementEnd('a');
     // FIXME: URL, image, video, audio
     $this->out->elementStart('div', array('class' => 'e-content'));
     $this->out->raw($this->message->rendered);
     $this->out->elementEnd('div');
     $messageurl = common_local_url('showmessage', array('message' => $this->message->id));
     // XXX: we need to figure this out better. Is this right?
     if (strcmp($this->message->uri, $messageurl) != 0 && preg_match('/^http/', $this->message->uri)) {
         $messageurl = $this->message->uri;
     }
     $this->out->elementStart('div', 'entry-metadata');
     $this->out->elementStart('a', array('rel' => 'bookmark', 'class' => 'timestamp', 'href' => $messageurl));
     $dt = common_date_iso8601($this->message->created);
     $this->out->element('time', array('class' => 'dt-published', 'datetime' => common_date_iso8601($this->message->created), 'title' => common_exact_date($this->message->created)), common_date_string($this->message->created));
     $this->out->elementEnd('a');
     if ($this->message->source) {
         $this->out->elementStart('span', 'source');
         // FIXME: bad i18n. Device should be a parameter (from %s).
         // TRANS: Followed by notice source (usually the client used to send the notice).
         $this->out->text(_('from'));
         $this->showSource($this->message->source);
         $this->out->elementEnd('span');
     }
     $this->out->elementEnd('div');
     $this->out->elementEnd('li');
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:39,代码来源:messagelistitem.php

示例2: run

 function run()
 {
     if (!$this->start()) {
         return false;
     }
     $this->log(LOG_INFO, 'checking for queued notices');
     $transport = $this->transport();
     do {
         $qi = Queue_item::top($transport);
         if ($qi) {
             $this->log(LOG_INFO, 'Got item enqueued ' . common_exact_date($qi->created));
             $notice = Notice::staticGet($qi->notice_id);
             if ($notice) {
                 $this->log(LOG_INFO, 'broadcasting notice ID = ' . $notice->id);
                 # XXX: what to do if broadcast fails?
                 $result = $this->handle_notice($notice);
                 if (!$result) {
                     $this->log(LOG_WARNING, 'Failed broadcast for notice ID = ' . $notice->id);
                     $orig = $qi;
                     $qi->claimed = null;
                     $qi->update($orig);
                     $this->log(LOG_WARNING, 'Abandoned claim for notice ID = ' . $notice->id);
                     continue;
                 }
                 $this->log(LOG_INFO, 'finished broadcasting notice ID = ' . $notice->id);
                 $notice->free();
                 unset($notice);
                 $notice = null;
             } else {
                 $this->log(LOG_WARNING, 'queue item for notice that does not exist');
             }
             $qi->delete();
             $qi->free();
             unset($qi);
             $this->idle(0);
         } else {
             $this->clear_old_claims();
             $this->idle(5);
         }
     } while (true);
     if (!$this->finish()) {
         return false;
     }
     return true;
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:45,代码来源:queuehandler.php

示例3: show

 /**
  * Show the item
  *
  * @return void
  */
 function show()
 {
     $group = $this->gm->getGroup();
     $sender = $this->gm->getSender();
     $this->out->elementStart('li', array('class' => 'h-entry notice message group-message', 'id' => 'message-' . $this->gm->id));
     $this->out->elementStart('div', 'entry-title');
     $this->out->elementStart('span', 'vcard author');
     $this->out->elementStart('a', array('href' => $sender->profileurl, 'class' => 'url'));
     $avatarUrl = $sender->avatarUrl(AVATAR_STREAM_SIZE);
     $this->out->element('img', array('src' => $avatarUrl, 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'class' => 'photo avatar', 'alt' => $sender->getBestName()));
     $this->out->element('span', array('class' => 'nickname fn'), $sender->nickname);
     $this->out->elementEnd('a');
     $this->out->elementEnd('span');
     $this->out->elementStart('p', array('class' => 'e-content message-content'));
     $this->out->raw($this->gm->rendered);
     $this->out->elementEnd('p');
     $this->out->elementEnd('div');
     $this->out->elementStart('div', 'e-content');
     $this->out->elementStart('a', array('rel' => 'bookmark', 'class' => 'timestamp', 'href' => $this->gm->url));
     $this->out->element('time', array('class' => 'dt-published', 'datetime' => common_date_iso8601($this->gm->created), 'title' => common_exact_date($this->gm->created)), common_date_string($this->gm->created));
     $this->out->elementEnd('a');
     $this->out->elementEnd('div');
     $this->out->elementEnd('li');
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:29,代码来源:groupmessagelistitem.php

示例4: getTitle

 public function getTitle()
 {
     $title = null;
     if (Event::handle('GetNoticeTitle', array($this, &$title))) {
         // TRANS: Title of a notice posted without a title value.
         // TRANS: %1$s is a user name, %2$s is the notice creation date/time.
         $title = sprintf(_('%1$s\'s status on %2$s'), $this->getProfile()->getFancyName(), common_exact_date($this->created));
     }
     return $title;
 }
开发者ID:a780201,项目名称:gnu-social,代码行数:10,代码来源:Notice.php

示例5: title

 /**
  * Title of the page
  *
  * @return string title of the page
  */
 function title()
 {
     if (!empty($this->profile->fullname)) {
         $base = $this->profile->fullname . ' (' . $this->profile->nickname . ')';
     } else {
         $base = $this->profile->nickname;
     }
     return sprintf(_('%1$s\'s status on %2$s'), $base, common_exact_date($this->notice->created));
 }
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:14,代码来源:shownotice.php

示例6: title

 /**
  * Title of the page
  */
 function title()
 {
     // TRANS: Title for private group message.
     // TRANS: %1$s is the sender name, %2$s is the group name, %3$s is a timestamp.
     return sprintf(_m('Message from %1$s to group %2$s on %3$s'), $this->sender->nickname, $this->group->nickname, common_exact_date($this->gm->created));
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:9,代码来源:showgroupmessage.php

示例7: mail_notify_fave

/**
 * notify a user that one of their notices has been chosen as a 'fave'
 *
 * Doesn't check that the user has an email address nor if they
 * want to receive notification of faves. Maybe this happens higher
 * up the stack...?
 *
 * @param User   $other  The user whose notice was faved
 * @param User   $user   The user who faved the notice
 * @param Notice $notice The notice that was faved
 *
 * @return void
 */
function mail_notify_fave($other, $user, $notice)
{
    $profile = $user->getProfile();
    $bestname = $profile->getBestName();
    common_init_locale($other->language);
    $subject = sprintf(_('%s added your notice as a favorite'), $bestname);
    $body = sprintf(_("%1\$s just added your notice from %2\$s" . " as one of their favorites.\n\n" . "In case you forgot, you can see the text" . " of your notice here:\n\n" . "%3\$s\n\n" . "You can see the list of %1\$s's favorites here:\n\n" . "%4\$s\n\n" . "Faithfully yours,\n" . "%5\$s\n"), $bestname, common_exact_date($notice->created), common_local_url('shownotice', array('notice' => $notice->id)), common_local_url('showfavorites', array('nickname' => $user->nickname)), common_config('site', 'name'));
    common_init_locale();
    mail_to_user($other, $subject, $body);
}
开发者ID:Br3nda,项目名称:laconica,代码行数:23,代码来源:mail.php

示例8: mail_notify_fave

/**
 * Notify a user that one of their notices has been chosen as a 'fave'
 *
 * @param User    $rcpt   The user whose notice was faved
 * @param Profile $sender The user who faved the notice
 * @param Notice  $notice The notice that was faved
 *
 * @return void
 */
function mail_notify_fave(User $rcpt, Profile $sender, Notice $notice)
{
    if (!$rcpt->receivesEmailNotifications() || !$rcpt->getConfigPref('email', 'notify_fave')) {
        return;
    }
    // This test is actually "if the sender is sandboxed"
    if (!$sender->hasRight(Right::EMAILONFAVE)) {
        return;
    }
    if ($rcpt->hasBlocked($sender)) {
        // If the author has blocked us, don't spam them with a notification.
        return;
    }
    // We need the global mail.php for various mail related functions below.
    require_once INSTALLDIR . '/lib/mail.php';
    $bestname = $sender->getBestName();
    common_switch_locale($rcpt->language);
    // TRANS: Subject for favorite notification e-mail.
    // TRANS: %1$s is the adding user's long name, %2$s is the adding user's nickname.
    $subject = sprintf(_('%1$s (@%2$s) added your notice as a favorite'), $bestname, $sender->getNickname());
    // TRANS: Body for favorite notification e-mail.
    // TRANS: %1$s is the adding user's long name, $2$s is the date the notice was created,
    // TRANS: %3$s is a URL to the faved notice, %4$s is the faved notice text,
    // TRANS: %5$s is a URL to all faves of the adding user, %6$s is the StatusNet sitename,
    // TRANS: %7$s is the adding user's nickname.
    $body = sprintf(_("%1\$s (@%7\$s) just added your notice from %2\$s" . " as one of their favorites.\n\n" . "The URL of your notice is:\n\n" . "%3\$s\n\n" . "The text of your notice is:\n\n" . "%4\$s\n\n" . "You can see the list of %1\$s's favorites here:\n\n" . "%5\$s"), $bestname, common_exact_date($notice->created), common_local_url('shownotice', array('notice' => $notice->id)), $notice->content, common_local_url('showfavorites', array('nickname' => $sender->getNickname())), common_config('site', 'name'), $sender->getNickname()) . mail_footer_block();
    $headers = _mail_prepare_headers('fave', $rcpt->getNickname(), $sender->getNickname());
    common_switch_locale();
    mail_to_user($rcpt, $subject, $body, $headers);
}
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:39,代码来源:FavoritePlugin.php

示例9: trackback

 function trackback($url, $endpoint)
 {
     $profile = $this->notice->getProfile();
     $args = array('title' => sprintf(_('%1$s\'s status on %2$s'), $profile->nickname, common_exact_date($this->notice->created)), 'excerpt' => $this->notice->content, 'url' => $this->notice->uri, 'blog_name' => $profile->nickname);
     $fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
     $result = $fetcher->post($endpoint, http_build_query($args), array('User-Agent: ' . $this->userAgent()));
     if ($result->status != '200') {
         common_log(LOG_WARNING, "Trackback error for '{$url}' ({$endpoint}): " . "{$result->body}");
     } else {
         common_log(LOG_INFO, "Trackback success for '{$url}' ({$endpoint}): " . "'{$result->body}'");
     }
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:12,代码来源:LinkbackPlugin.php

示例10: showItem

 function showItem($notice)
 {
     $profile = Profile::staticGet($notice->profile_id);
     $nurl = common_local_url('shownotice', array('notice' => $notice->id));
     $creator_uri = common_profile_uri($profile);
     $this->elementStart('item', array('rdf:about' => $notice->uri));
     $title = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content));
     $this->element('title', null, $title);
     $this->element('link', null, $nurl);
     $this->element('description', null, $profile->nickname . "'s status on " . common_exact_date($notice->created));
     $this->element('dc:date', null, common_date_w3dtf($notice->created));
     $this->element('dc:creator', null, $profile->fullname ? $profile->fullname : $profile->nickname);
     $this->element('sioc:has_creator', array('rdf:resource' => $creator_uri));
     $this->element('laconica:postIcon', array('rdf:resource' => $profile->avatarUrl()));
     $this->element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
     $this->elementEnd('item');
     $this->creators[$creator_uri] = $profile;
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:18,代码来源:rssaction.php

示例11: title

 /**
  * Title of the page
  *
  * @return string title of the page
  */
 function title()
 {
     $base = $this->profile->getFancyName();
     return sprintf(_('%1$s\'s status on %2$s'), $base, common_exact_date($this->notice->created));
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:10,代码来源:shownotice.php

示例12: title

 /**
  * Title of the page
  */
 function title()
 {
     return sprintf(_('Message from %1$s to group %2$s on %3$s'), $this->sender->nickname, $this->group->nickname, common_exact_date($this->gm->created));
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:7,代码来源:showgroupmessage.php

示例13: showNoticeLink

 /**
  * show the link to the main page for the notice
  *
  * Displays a local link to the rendered notice, with "relative" time.
  *
  * @return void
  */
 function showNoticeLink()
 {
     $this->out->elementStart('a', array('rel' => 'bookmark', 'class' => 'timestamp', 'href' => Conversation::getUrlFromNotice($this->notice)));
     $this->out->element('time', array('class' => 'dt-published', 'datetime' => common_date_iso8601($this->notice->created), 'title' => common_exact_date($this->notice->created)), common_date_string($this->notice->created));
     $this->out->elementEnd('a');
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:13,代码来源:noticelistitem.php

示例14: title

 /**
  * Title of the page
  *
  * @return string title of the page
  */
 function title()
 {
     return sprintf(_('%1$s\'s status on %2$s'), $this->profile->nickname, common_exact_date($this->notice->created));
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:9,代码来源:shownotice.php

示例15: title

 function title()
 {
     if ($this->user->id == $this->message->from_profile) {
         $to = $this->message->getTo();
         return sprintf(_("Message to %1\$s on %2\$s"), $to->nickname, common_exact_date($this->message->created));
     } else {
         if ($this->user->id == $this->message->to_profile) {
             $from = $this->message->getFrom();
             return sprintf(_("Message from %1\$s on %2\$s"), $from->nickname, common_exact_date($this->message->created));
         }
     }
 }
开发者ID:himmelex,项目名称:NTW,代码行数:12,代码来源:showmessage.php


注:本文中的common_exact_date函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。