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


PHP language::timeAgo方法代码示例

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


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

示例1: getAll

 public function getAll($notifyId = 0)
 {
     if ($notifyId == 0) {
         $notifyId = $this->getMaxId();
         $notifyId++;
     }
     $notifications = array("error" => false, "error_code" => ERROR_SUCCESS, "notifyId" => $notifyId, "notifications" => array());
     $stmt = $this->db->prepare("SELECT * FROM notifications WHERE notifyToId = (:notifyToId) AND id < (:notifyId) ORDER BY id DESC LIMIT 20");
     $stmt->bindParam(':notifyToId', $this->requestFrom, PDO::PARAM_INT);
     $stmt->bindParam(':notifyId', $notifyId, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             while ($row = $stmt->fetch()) {
                 $time = new language($this->db, $this->language);
                 if ($row['notifyFromId'] == 0) {
                     $profileInfo = array("id" => 0, "state" => 0, "username" => "", "fullname" => "", "lowPhotoUrl" => "/img/profile_default_photo.png");
                 } else {
                     $profile = new profile($this->db, $row['notifyFromId']);
                     $profileInfo = $profile->get();
                     unset($profile);
                 }
                 $data = array("id" => $row['id'], "type" => $row['notifyType'], "itemId" => $row['itemId'], "fromUserId" => $profileInfo['id'], "fromUserState" => $profileInfo['state'], "fromUserUsername" => $profileInfo['username'], "fromUserFullname" => $profileInfo['fullname'], "fromUserPhotoUrl" => $profileInfo['lowPhotoUrl'], "createAt" => $row['createAt'], "timeAgo" => $time->timeAgo($row['createAt']));
                 array_push($notifications['notifications'], $data);
                 $notifications['notifyId'] = $row['id'];
                 unset($data);
             }
         }
     }
     return $notifications;
 }
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:30,代码来源:class.notify.inc.php

示例2: info

 public function info($giftId)
 {
     $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
     $stmt = $this->db->prepare("SELECT * FROM gifts WHERE id = (:giftId) LIMIT 1");
     $stmt->bindParam(":giftId", $giftId, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             $row = $stmt->fetch();
             $time = new language($this->db, $this->language);
             $profile = new profile($this->db, $row['giftFrom']);
             $profileInfo = $profile->get();
             unset($profile);
             $result = array("error" => false, "error_code" => ERROR_SUCCESS, "id" => $row['id'], "giftId" => $row['giftId'], "giftTo" => $row['giftTo'], "giftFrom" => $row['giftFrom'], "giftFromUserVip" => $profileInfo['vip'], "giftFromUserVerify" => $profileInfo['verify'], "giftFromUserUsername" => $profileInfo['username'], "giftFromUserFullname" => $profileInfo['fullname'], "giftFromUserPhoto" => $profileInfo['lowPhotoUrl'], "giftAnonymous" => $row['giftAnonymous'], "message" => htmlspecialchars_decode(stripslashes($row['message'])), "imgUrl" => $row['imgUrl'], "createAt" => $row['createAt'], "date" => date("Y-m-d H:i:s", $row['createAt']), "timeAgo" => $time->timeAgo($row['createAt']), "removeAt" => $row['removeAt']);
         }
     }
     return $result;
 }
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:17,代码来源:class.gift.inc.php

示例3: get

 public function get()
 {
     $result = array("error" => true, "error_code" => ERROR_ACCOUNT_ID);
     $stmt = $this->db->prepare("SELECT * FROM users WHERE id = (:id) LIMIT 1");
     $stmt->bindParam(":id", $this->id, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             $row = $stmt->fetch();
             $notifications_count = 0;
             $messages_count = 0;
             $guests_count = 0;
             $friends_count = 0;
             // Get new messages count
             $msg = new messages($this->db);
             $msg->setRequestFrom($this->id);
             $messages_count = $msg->getNewMessagesCount();
             unset($msg);
             // Get new notifications count
             $notifications = new notify($this->db);
             $notifications->setRequestFrom($this->id);
             $notifications_count = $notifications->getNewCount($row['last_notify_view']);
             unset($notifications);
             // Get new guests count
             $guests = new guests($this->db, $this->id);
             $guests->setRequestFrom($this->id);
             $guests_count = $guests->getNewCount($row['last_guests_view']);
             unset($guests);
             // Get new friends count
             $friends = new friends($this->db, $this->id);
             $friends->setRequestFrom($this->id);
             $friends_count = $friends->getNewCount($row['last_friends_view']);
             unset($friends);
             $profile = new profile($this->db, $row['id']);
             $online = false;
             $current_time = time();
             if ($row['last_authorize'] != 0 && $row['last_authorize'] > $current_time - 15 * 60) {
                 $online = true;
             }
             $time = new language($this->db);
             $result = array("error" => false, "error_code" => ERROR_SUCCESS, "id" => $row['id'], "gcm_regid" => $row['gcm_regid'], "admob" => $row['admob'], "ghost" => $row['ghost'], "vip" => $row['vip'], "gcm" => $row['gcm'], "balance" => $row['balance'], "fb_id" => $row['fb_id'], "rating" => $row['rating'], "state" => $row['state'], "regtime" => $row['regtime'], "ip_addr" => $row['ip_addr'], "username" => $row['login'], "fullname" => stripcslashes($row['fullname']), "location" => stripcslashes($row['country']), "status" => stripcslashes($row['status']), "fb_page" => stripcslashes($row['fb_page']), "instagram_page" => stripcslashes($row['my_page']), "verify" => $row['verify'], "email" => $row['email'], "emailVerify" => $row['emailVerify'], "sex" => $row['sex'], "year" => $row['bYear'], "month" => $row['bMonth'], "day" => $row['bDay'], "lat" => $row['lat'], "lng" => $row['lng'], "language" => $row['language'], "lowPhotoUrl" => $row['lowPhotoUrl'], "normalPhotoUrl" => $row['normalPhotoUrl'], "bigPhotoUrl" => $row['normalPhotoUrl'], "coverUrl" => $row['normalCoverUrl'], "originCoverUrl" => $row['originCoverUrl'], "iStatus" => $row['iStatus'], "iPoliticalViews" => $row['iPoliticalViews'], "iWorldView" => $row['iWorldView'], "iPersonalPriority" => $row['iPersonalPriority'], "iImportantInOthers" => $row['iImportantInOthers'], "iSmokingViews" => $row['iSmokingViews'], "iAlcoholViews" => $row['iAlcoholViews'], "iLooking" => $row['iLooking'], "iInterested" => $row['iInterested'], "allowComments" => $row['allowComments'], "allowMessages" => $row['allowMessages'], "allowLikesGCM" => $row['allowLikesGCM'], "allowGiftsGCM" => $row['allowGiftsGCM'], "allowCommentsGCM" => $row['allowCommentsGCM'], "allowFollowersGCM" => $row['allowFollowersGCM'], "allowMessagesGCM" => $row['allowMessagesGCM'], "allowCommentReplyGCM" => $row['allowCommentReplyGCM'], "lastAuthorize" => $row['last_authorize'], "lastAuthorizeDate" => date("Y-m-d H:i:s", $row['last_authorize']), "lastAuthorizeTimeAgo" => $time->timeAgo($row['last_authorize']), "online" => $online, "friendsCount" => $row['friends_count'], "photosCount" => $row['photos_count'], "likesCount" => $row['likes_count'], "giftsCount" => $row['gifts_count'], "notificationsCount" => $notifications_count, "guestsCount" => $guests_count, "newFriendsCount" => $friends_count, "messagesCount" => $messages_count);
             unset($profile);
             unset($time);
         }
     }
     return $result;
 }
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:46,代码来源:class.account.inc.php

示例4: get

 public function get()
 {
     $result = array("error" => true, "error_code" => ERROR_ACCOUNT_ID);
     $stmt = $this->db->prepare("SELECT * FROM users WHERE id = (:id) LIMIT 1");
     $stmt->bindParam(":id", $this->id, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             $row = $stmt->fetch();
             // test to my like
             $myLike = false;
             if ($this->requestFrom != 0) {
                 if ($this->is_like_exists($this->requestFrom)) {
                     $myLike = true;
                 }
             }
             // test to blocked
             $blocked = false;
             if ($this->requestFrom != 0) {
                 $blacklist = new blacklist($this->db);
                 $blacklist->setRequestFrom($this->requestFrom);
                 if ($blacklist->isExists($this->id)) {
                     $blocked = true;
                 }
                 unset($blacklist);
             }
             // test to follow
             $follow = false;
             if ($this->requestFrom != 0) {
                 if ($this->is_follower_exists($this->requestFrom)) {
                     $follow = true;
                 }
             }
             // test to friend
             $friend = false;
             if ($this->requestFrom != 0) {
                 if ($this->is_friend_exists($this->requestFrom)) {
                     $friend = true;
                 }
             }
             // test to my follower
             $follower = false;
             if ($this->requestFrom != 0) {
                 $myProfile = new profile($this->db, $this->requestFrom);
                 if ($myProfile->is_follower_exists($this->getId())) {
                     $follower = true;
                 }
                 unset($myProfile);
             }
             // is my profile exists in blacklist
             $inBlackList = false;
             if ($this->requestFrom != 0) {
                 $blacklist = new blacklist($this->db);
                 $blacklist->setRequestFrom($this->getId());
                 if ($blacklist->isExists($this->getRequestFrom())) {
                     $inBlackList = true;
                 }
                 unset($blacklist);
             }
             $online = false;
             $current_time = time();
             if ($row['last_authorize'] != 0 && $row['last_authorize'] > $current_time - 15 * 60) {
                 $online = true;
             }
             $time = new language($this->db);
             $result = array("error" => false, "error_code" => ERROR_SUCCESS, "id" => $row['id'], "ghost" => $row['ghost'], "vip" => $row['vip'], "rating" => $row['rating'], "state" => $row['state'], "sex" => $row['sex'], "year" => $row['bYear'], "month" => $row['bMonth'], "day" => $row['bDay'], "lat" => $row['lat'], "lng" => $row['lng'], "username" => $row['login'], "fullname" => htmlspecialchars_decode(stripslashes($row['fullname'])), "location" => stripcslashes($row['country']), "status" => stripcslashes($row['status']), "fb_page" => stripcslashes($row['fb_page']), "instagram_page" => stripcslashes($row['my_page']), "verify" => $row['verify'], "lowPhotoUrl" => $row['lowPhotoUrl'], "bigPhotoUrl" => $row['bigPhotoUrl'], "normalPhotoUrl" => $row['normalPhotoUrl'], "normalCoverUrl" => $row['normalCoverUrl'], "originCoverUrl" => $row['originCoverUrl'], "coverPosition" => $row['coverPosition'], "iStatus" => $row['iStatus'], "iPoliticalViews" => $row['iPoliticalViews'], "iWorldView" => $row['iWorldView'], "iPersonalPriority" => $row['iPersonalPriority'], "iImportantInOthers" => $row['iImportantInOthers'], "iSmokingViews" => $row['iSmokingViews'], "iAlcoholViews" => $row['iAlcoholViews'], "iLooking" => $row['iLooking'], "iInterested" => $row['iInterested'], "allowPhotosComments" => $row['allowPhotosComments'], "allowMessages" => $row['allowMessages'], "friendsCount" => $row['friends_count'], "photosCount" => $row['photos_count'], "likesCount" => $row['likes_count'], "giftsCount" => $row['gifts_count'], "follower" => $follower, "friend" => $friend, "inBlackList" => $inBlackList, "follow" => $follow, "blocked" => $blocked, "myLike" => $myLike, "createAt" => $row['regtime'], "createDate" => date("Y-m-d", $row['regtime']), "lastAuthorize" => $row['last_authorize'], "lastAuthorizeDate" => date("Y-m-d H:i:s", $row['last_authorize']), "lastAuthorizeTimeAgo" => $time->timeAgo($row['last_authorize']), "online" => $online);
         }
     }
     return $result;
 }
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:69,代码来源:class.profile.inc.php

示例5: draw

function draw($msg, $helper = null)
{
    $msg['message'] = helper::processMsgText($msg['message']);
    $fromUserPhoto = "/img/profile_default_photo.png";
    if (strlen($msg['fromUserPhotoUrl']) != 0) {
        $fromUserPhoto = $msg['fromUserPhotoUrl'];
    }
    ?>

        <div class="post post_item" data-id="<?php 
    echo $msg['id'];
    ?>
">

            <a class="profile_cont" href="/admin/profile.php/?id<?php 
    echo $msg['fromUserId'];
    ?>
">
                <img src="<?php 
    echo $fromUserPhoto;
    ?>
">
            </a>

            <div class="post_content">

                <div class="action_remove" onclick="Message.remove('<?php 
    echo $msg['id'];
    ?>
', '<?php 
    echo admin::getAccessToken();
    ?>
'); return false;"></div>

                <div class="post_title">
                    <a href="/admin/profile.php/?id=<?php 
    echo $msg['fromUserId'];
    ?>
">
                        <span class="post_fullname"><?php 
    echo $msg['fromUserFullname'];
    ?>
</span>
                        <s>@</s><b class="post_username"><?php 
    echo $msg['fromUserUsername'];
    ?>
</b>
                    </a>
                </div>
                <div class="post_data">
                    <?php 
    echo $msg['message'];
    ?>
                </div>

                <?php 
    if (strlen($msg['imgUrl'])) {
        ?>

                    <div class="post_img">
                        <img src="<?php 
        echo $msg['imgUrl'];
        ?>
"/>
                    </div>
                    <?php 
    }
    ?>

                <div class="post_footer">
                    <?php 
    $time = new language(NULL, "en");
    ?>
                    <a class="time" href="javascript:void(0);"><?php 
    echo $time->timeAgo($msg['createAt']);
    ?>
</a>
                </div>
            </div>

        </div>

    <?php 
}
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:84,代码来源:chat.php

示例6: info

 public function info($itemId)
 {
     $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
     $stmt = $this->db->prepare("SELECT * FROM friends WHERE id = (:itemId) LIMIT 1");
     $stmt->bindParam(":itemId", $itemId, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             $row = $stmt->fetch();
             $time = new language($this->db, $this->language);
             $profile = new profile($this->db, $row['friend']);
             $profileInfo = $profile->get();
             unset($profile);
             $result = array("error" => false, "error_code" => ERROR_SUCCESS, "id" => $row['id'], "friendUserId" => $row['friend'], "friendUserVip" => $profileInfo['vip'], "friendUserVerify" => $profileInfo['verify'], "friendUserUsername" => $profileInfo['username'], "friendUserFullname" => $profileInfo['fullname'], "friendUserPhoto" => $profileInfo['lowPhotoUrl'], "friendUserOnline" => $profileInfo['online'], "friendLocation" => $profileInfo['location'], "friendTo" => $row['friendTo'], "friend" => $row['friend'], "createAt" => $row['createAt'], "date" => date("Y-m-d H:i:s", $row['createAt']), "timeAgo" => $time->timeAgo($row['createAt']), "removeAt" => $row['removeAt']);
         }
     }
     return $result;
 }
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:17,代码来源:class.friends.inc.php

示例7: itemInfo

 private function itemInfo($itemId)
 {
     $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
     $stmt = $this->db->prepare("SELECT * FROM profile_blacklist WHERE id = (:itemId) LIMIT 1");
     $stmt->bindParam(":itemId", $itemId, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             $row = $stmt->fetch();
             $time = new language($this->db, $this->language);
             $profile = new profile($this->db, $row['blockedUserId']);
             $blockedUserId = $profile->get();
             unset($profile);
             $lowPhotoUrl = "/img/profile_default_photo.png";
             if (strlen($blockedUserId['lowPhotoUrl']) != 0) {
                 $lowPhotoUrl = $blockedUserId['lowPhotoUrl'];
             }
             $result = array("error" => false, "error_code" => ERROR_SUCCESS, "id" => $row['id'], "blockedUserId" => $row['blockedUserId'], "blockedUserState" => $blockedUserId['state'], "blockedUserVerify" => $blockedUserId['verify'], "blockedUserUsername" => $blockedUserId['username'], "blockedUserFullname" => $blockedUserId['fullname'], "blockedUserPhotoUrl" => $lowPhotoUrl, "reason" => htmlspecialchars_decode(stripslashes($row['reason'])), "createAt" => $row['createAt'], "removeAt" => $row['removeAt'], "timeAgo" => $time->timeAgo($row['createAt']));
         }
     }
     return $result;
 }
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:21,代码来源:class.blacklist.inc.php

示例8: info

 public function info($photoId)
 {
     $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
     $stmt = $this->db->prepare("SELECT * FROM photos WHERE id = (:photoId) LIMIT 1");
     $stmt->bindParam(":photoId", $photoId, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             $row = $stmt->fetch();
             $time = new language($this->db, $this->language);
             $profile = new profile($this->db, $row['fromUserId']);
             $profileInfo = $profile->get();
             unset($profile);
             $result = array("error" => false, "error_code" => ERROR_SUCCESS, "id" => $row['id'], "accessMode" => $row['accessMode'], "fromUserId" => $row['fromUserId'], "fromUserVerify" => $profileInfo['verify'], "fromUserUsername" => $profileInfo['username'], "fromUserFullname" => $profileInfo['fullname'], "fromUserPhoto" => $profileInfo['lowPhotoUrl'], "comment" => htmlspecialchars_decode(stripslashes($row['comment'])), "area" => htmlspecialchars_decode(stripslashes($row['area'])), "country" => htmlspecialchars_decode(stripslashes($row['country'])), "city" => htmlspecialchars_decode(stripslashes($row['city'])), "lat" => $row['lat'], "lng" => $row['lng'], "imgUrl" => $row['imgUrl'], "previewImgUrl" => $row['previewImgUrl'], "originImgUrl" => $row['originImgUrl'], "rating" => $row['rating'], "commentsCount" => $row['commentsCount'], "likesCount" => $row['likesCount'], "createAt" => $row['createAt'], "date" => date("Y-m-d H:i:s", $row['createAt']), "timeAgo" => $time->timeAgo($row['createAt']), "removeAt" => $row['removeAt']);
         }
     }
     return $result;
 }
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:17,代码来源:class.photos.inc.php


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