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


PHP SugarFeed::getTimeLapse方法代码示例

本文整理汇总了PHP中SugarFeed::getTimeLapse方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarFeed::getTimeLapse方法的具体用法?PHP SugarFeed::getTimeLapse怎么用?PHP SugarFeed::getTimeLapse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SugarFeed的用法示例。


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

示例1: getLatestUpdates

 /**
  * @deprecated This is a depreciated method and will be removed in version 7.3.
  */
 public function getLatestUpdates($maxTime, $maxEntries)
 {
     $td = $GLOBALS['timedate'];
     try {
         if (!$this->setupFacebookLib()) {
             // FIXME: Translate
             return array('success' => FALSE, 'errorMessage' => 'Facebook does not have the required libraries.');
         }
         $fbMessages = $this->fb->api('/me/home?limit=' . $maxEntries);
     } catch (FacebookApiException $e) {
         // We should ask user about second login to facebook because our access_token is dead.
         if ($e->getType() == 'OAuthException' && !empty($this->eapmBean->id)) {
             return array('success' => true, 'messages' => array(array('ID' => create_guid(), 'sort_key' => time(), 'NAME' => translate('LBL_ERR_OAUTH_FACEBOOK_1', 'EAPM') . ' <a href="#" onclick="window.open(\'index.php?module=EAPM&amp;refreshParentWindow=1&amp;closeWhenDone=1&amp;action=QuickSave&amp;application=Facebook\',\'EAPM\');">' . translate('LBL_ERR_OAUTH_FACEBOOK_2', 'EAPM') . '</a>.')));
         }
         $GLOBALS['log']->error('Facebook Error: ' . $e->getMessage());
         return array('success' => FALSE, 'errorMessage' => translate('LBL_ERR_FACEBOOK', 'EAPM'));
     }
     if (!isset($fbMessages['data'][0])) {
         return array('success' => TRUE, 'messages' => array());
     }
     $messages = array();
     foreach ($fbMessages['data'] as $message) {
         if (empty($message['message'])) {
             continue;
         }
         $unix_time = strtotime($message['created_time']);
         $fake_record = array();
         $fake_record['sort_key'] = $unix_time;
         $fake_record['ID'] = create_guid();
         $fake_record['DATE_ENTERED'] = $td->to_display_date_time(gmdate('Y-m-d H:i:s', $unix_time));
         $fake_record['NAME'] = $message['from']['name'] . '</b>';
         if (!empty($message['message'])) {
             $fake_record['NAME'] .= ' ' . $message['message'];
         }
         if (!empty($message['picture'])) {
             $fake_record['NAME'] .= '<br><!--not_in_theme!--><img src="' . $message['picture'] . '" height=50>';
         }
         $fake_record['NAME'] .= '<br><div class="byLineBox"><span class="byLineLeft">' . SugarFeed::getTimeLapse($fake_record['DATE_ENTERED']) . '&nbsp;</span><div class="byLineRight">&nbsp;</div></div>';
         $fake_record['IMAGE_URL'] = "https://graph.facebook.com/" . $message['from']['id'] . '/picture';
         $messages[] = $fake_record;
     }
     return array('success' => TRUE, 'messages' => $messages);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:46,代码来源:ExtAPIFacebook.php

示例2: testgetTimeLapse

 public function testgetTimeLapse()
 {
     $result = SugarFeed::getTimeLapse('2016-01-15 11:16:02');
     $this->assertTrue(isset($result));
     $this->assertGreaterThan(0, strlen($result));
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:6,代码来源:SugarFeedTest.php


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