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


PHP processTime函数代码示例

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


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

示例1: bodyBottom

function bodyBottom()
{
    global $TimerStart, $prog_name_full, $prog_ver;
    $today = today();
    $genTime = processTime();
    echo "\n</td>\n        </tr>\n      </table></td>\n  </tr>\n  <tr>\n    <td height=\"32\"><table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n        <tr>\n          <td height=\"1\" bgcolor=\"#7D7D7D\"></td>\n        </tr>\n        <tr>\n          <td><table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#EAEAEA\" class=\"bottomBar\">\n              <tr>\n                <td width=\"30%\" class=\"bottomInfo\">" . _GENERATION_TIME . " {$genTime} " . _SECONDS . "</td>\n                <td class=\"bottomInfo\">\n                <div align=\"center\">Powered by <a href  >{$prog_name_full}</a> {$prog_ver} &copy; 2007</div></td>\n                <td width=\"30%\" class=\"bottomInfo\">\n                <div align=\"right\">" . _NOW . ": {$today}</div></td>\n              </tr>\n            </table></td>\n        </tr>\n        <tr>\n          <td height=\"1\" bgcolor=\"#7D7D7D\"></td>\n        </tr>\n      </table></td>\n  </tr>\n</table>\n\n\n</body>\n</html>";
}
开发者ID:Raxman,项目名称:stis,代码行数:7,代码来源:theme.php

示例2: getBuddyList

function getBuddyList()
{
    global $response;
    global $userid;
    global $db;
    global $status;
    global $hideOffline;
    global $plugins;
    global $guestsMode;
    global $cookiePrefix;
    global $chromeReorderFix;
    $time = getTimeStamp();
    $buddyList = array();
    if (empty($_SESSION['cometchat']['cometchat_buddytime']) || $_REQUEST['initialize'] == 1 || $_REQUEST['f'] == 1 || !empty($_SESSION['cometchat']['cometchat_buddytime']) && ($time - $_SESSION['cometchat']['cometchat_buddytime'] >= REFRESH_BUDDYLIST || MEMCACHE != 0)) {
        if ($_REQUEST['initialize'] == 1 && !empty($_SESSION['cometchat']['cometchat_buddyblh']) && $time - $_SESSION['cometchat']['cometchat_buddytime'] < REFRESH_BUDDYLIST) {
            $response['buddylist'] = $_SESSION['cometchat']['cometchat_buddyresult'];
            $response['blh'] = $_SESSION['cometchat']['cometchat_buddyblh'];
        } else {
            $onlineCacheKey = 'all_online';
            if ($userid > 10000000) {
                $onlineCacheKey .= 'guest';
            }
            if ($onlineUsers = getCache($cookiePrefix . $onlineCacheKey, 30)) {
                $buddyList = unserialize($onlineUsers);
            } else {
                $sql = getFriendsList($userid, $time);
                if ($guestsMode) {
                    $sql = getGuestsList($userid, $time, $sql);
                }
                $query = mysqli_query($GLOBALS['dbh'], $sql);
                if (defined('DEV_MODE') && DEV_MODE == '1') {
                    echo mysqli_error($GLOBALS['dbh']);
                }
                while ($chat = mysqli_fetch_assoc($query)) {
                    if (($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT || $chat['isdevice'] == 1) && $chat['status'] != 'invisible' && $chat['status'] != 'offline') {
                        if ($chat['status'] != 'busy' && $chat['status'] != 'away' || $chat['isdevice'] == 1) {
                            $chat['status'] = 'available';
                        }
                    } else {
                        $chat['status'] = 'offline';
                    }
                    if ($chat['message'] == null) {
                        $chat['message'] = $status[$chat['status']];
                    }
                    $link = fetchLink($chat['link']);
                    $avatar = getAvatar($chat['userid']);
                    if (function_exists('processName')) {
                        $chat['username'] = processName($chat['username']);
                    }
                    if (empty($chat['grp'])) {
                        $chat['grp'] = '';
                    }
                    if (!empty($chat['username']) && ($hideOffline == 0 || $hideOffline == 1 && $chat['status'] != 'offline')) {
                        $buddyList[$chromeReorderFix . $chat['userid']] = array('id' => $chat['userid'], 'n' => $chat['username'], 'l' => $link, 'a' => $avatar, 'd' => $chat['isdevice'], 's' => $chat['status'], 'm' => $chat['message'], 'g' => $chat['grp']);
                    }
                }
                setCache($cookiePrefix . $onlineCacheKey, serialize($buddyList), 30);
            }
            if (DISPLAY_ALL_USERS == 0 && MEMCACHE != 0) {
                $tempBuddyList = array();
                $friendIds = array();
                if ($onlineFrnds = getCache($cookiePrefix . 'friend_ids_of_' . $userid, 30)) {
                    $friendIds = unserialize($onlineFrnds);
                } else {
                    $sql = getFriendsIds($userid);
                    $res = mysqli_query($GLOBALS['dbh'], $sql);
                    $result = mysqli_fetch_assoc($res);
                    if (!empty($result['myfrndids'])) {
                        $friendIds = explode(',', $result['myfrndids']);
                    }
                    setCache($cookiePrefix . 'friend_ids_of_' . $userid, serialize($friendIds), 30);
                }
                foreach ($friendIds as $friendId) {
                    $friendId = $chromeReorderFix . $friendId;
                    if (isset($buddyList[$friendId])) {
                        $tempBuddyList[$friendId] = $buddyList[$friendId];
                    }
                }
                $buddyList = $tempBuddyList;
            }
            $blockList = array();
            if (in_array('block', $plugins)) {
                $blockId = array();
                if ($blockedUsers = getCache($cookiePrefix . 'blocked_id_of_' . $userid, 30)) {
                    $blockId = unserialize($blockedUsers);
                } else {
                    $sql = "select group_concat(blockedid) blockedids from (select fromid as blockedid from cometchat_block where toid = '" . mysqli_real_escape_string($GLOBALS['dbh'], $userid) . "' UNION select toid as blockedid from cometchat_block where fromid = '" . mysqli_real_escape_string($GLOBALS['dbh'], $userid) . "') as blocked";
                    $query = mysqli_query($GLOBALS['dbh'], $sql);
                    $blockIds = mysqli_fetch_assoc($query);
                    if (!empty($blockIds['blockedids'])) {
                        $blockId = explode(',', $blockIds['blockedids']);
                    }
                    setCache($cookiePrefix . 'blocked_id_of_' . $userid, serialize($blockId), 3600);
                }
                foreach ($blockId as $bid) {
                    array_push($blockList, $bid);
                    if (isset($buddyList[$chromeReorderFix . $bid])) {
                        unset($buddyList[$chromeReorderFix . $bid]);
                    }
                }
//.........这里部分代码省略.........
开发者ID:rodino25,项目名称:tsv2,代码行数:101,代码来源:cometchat_receive.php

示例3: getTimeStamp

if (!empty($_REQUEST['userid'])) {
    $fetchid = $_REQUEST['userid'];
} else {
    $fetchid = $userid;
}
$time = getTimeStamp();
$sql = getUserDetails($fetchid);
if ($guestsMode && $fetchid >= 10000000) {
    $sql = getGuestDetails($fetchid);
}
$query = mysql_query($sql);
if (defined('DEV_MODE') && DEV_MODE == '1') {
    echo mysql_error();
}
$chat = mysql_fetch_array($query);
if ($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT && $chat['status'] != 'invisible' && $chat['status'] != 'offline') {
    if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
        $chat['status'] = 'available';
    }
} else {
    $chat['status'] = 'offline';
}
if ($chat['message'] == null) {
    $chat['message'] = $status[$chat['status']];
}
$link = getLink($chat['link']);
$avatar = getAvatar($chat['avatar']);
if (function_exists('processName')) {
    $chat['username'] = processName($chat['username']);
}
$response = array('id' => $chat['userid'], 'n' => $chat['username'], 's' => $chat['status'], 'm' => $chat['message'], 'a' => $avatar, 'l' => $link);
开发者ID:rezarahimi4861,项目名称:icmf,代码行数:31,代码来源:cometchat_getid.php

示例4: getBuddyList

function getBuddyList()
{
    global $response;
    global $userid;
    global $db;
    global $status;
    global $hideOffline;
    global $plugins;
    global $guestsMode;
    $time = getTimeStamp();
    $buddyList = array();
    if (empty($_SESSION['cometchat']['cometchat_buddytime']) || $_REQUEST['initialize'] == 1 || $_REQUEST['f'] == 1 || !empty($_SESSION['cometchat']['cometchat_buddytime']) && $time - $_SESSION['cometchat']['cometchat_buddytime'] >= REFRESH_BUDDYLIST) {
        if ($_REQUEST['initialize'] == 1 && !empty($_SESSION['cometchat']['cometchat_buddyblh']) && $time - $_SESSION['cometchat']['cometchat_buddytime'] < REFRESH_BUDDYLIST) {
            $response['buddylist'] = $_SESSION['cometchat']['cometchat_buddyresult'];
            $response['blh'] = $_SESSION['cometchat']['cometchat_buddyblh'];
        } else {
            $blockList = array();
            if (in_array('block', $plugins)) {
                $sql = "(select toid as id from cometchat_block where fromid = '" . mysql_real_escape_string($userid) . "') union (select fromid as id from cometchat_block where toid = '" . mysql_real_escape_string($userid) . "') ";
                $query = mysql_query($sql);
                while ($user = mysql_fetch_array($query)) {
                    array_push($blockList, $user['id']);
                }
            }
            $sql = getFriendsList($userid, $time);
            if ($guestsMode) {
                $sql = getGuestsList($userid, $time, $sql);
            }
            $query = mysql_query($sql);
            if (defined('DEV_MODE') && DEV_MODE == '1') {
                echo mysql_error();
            }
            while ($chat = mysql_fetch_array($query)) {
                if (!in_array($chat['userid'], $blockList)) {
                    if ($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT && $chat['status'] != 'invisible' && $chat['status'] != 'offline') {
                        if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
                            $chat['status'] = 'available';
                        }
                    } else {
                        $chat['status'] = 'offline';
                    }
                    if ($chat['message'] == null) {
                        $chat['message'] = $status[$chat['status']];
                    }
                    $link = getLink($chat['link']);
                    $avatar = getAvatar($chat['avatar']);
                    if (function_exists('processName')) {
                        $chat['username'] = processName($chat['username']);
                    }
                    if (empty($chat['grp'])) {
                        $chat['grp'] = '';
                    }
                    if (!empty($chat['username']) && ($hideOffline == 0 || $hideOffline == 1 && $chat['status'] != 'offline')) {
                        $buddyList[] = array('id' => $chat['userid'], 'n' => $chat['username'], 's' => $chat['status'], 'm' => $chat['message'], 'g' => $chat['grp'], 'a' => $avatar, 'l' => $link);
                    }
                }
            }
            if (function_exists('hooks_forcefriends') && is_array(hooks_forcefriends())) {
                $buddyList = array_merge(hooks_forcefriends(), $buddyList);
            }
            $buddyOrder = array();
            $buddyGroup = array();
            $buddyStatus = array();
            $buddyName = array();
            $buddyGuest = array();
            foreach ($buddyList as $key => $row) {
                if (empty($row['g'])) {
                    $row['g'] = '';
                }
                $buddyGroup[$key] = strtolower($row['g']);
                $buddyStatus[$key] = strtolower($row['s']);
                $buddyName[$key] = strtolower($row['n']);
                if ($row['g'] == '') {
                    $buddyOrder[$key] = 1;
                } else {
                    $buddyOrder[$key] = 0;
                }
                $buddyGuest[$key] = 0;
                if ($row['id'] > 10000000) {
                    $buddyGuest[$key] = 1;
                }
            }
            array_multisort($buddyOrder, SORT_ASC, $buddyGroup, SORT_STRING, $buddyStatus, SORT_STRING, $buddyGuest, SORT_ASC, $buddyName, SORT_STRING, $buddyList);
            $_SESSION['cometchat']['cometchat_buddytime'] = $time;
            $blh = md5(serialize($buddyList));
            if (empty($_REQUEST['blh']) || !empty($_REQUEST['blh']) && $blh != $_REQUEST['blh']) {
                $response['buddylist'] = $buddyList;
                $response['blh'] = $blh;
            }
            $_SESSION['cometchat']['cometchat_buddyresult'] = $buddyList;
            $_SESSION['cometchat']['cometchat_buddyblh'] = $blh;
        }
    }
}
开发者ID:Nkelliny,项目名称:MobileDatingApp,代码行数:94,代码来源:cometchat_receive.php

示例5: invite

function invite()
{
    global $userid;
    global $avchat_language;
    global $language;
    global $embed;
    global $embedcss;
    global $lightboxWindows;
    global $guestsMode;
    global $cookiePrefix;
    global $chromeReorderFix;
    if ($lightboxWindows == '1') {
        $embed = 'web';
        $embedcss = 'embed';
    }
    $status['available'] = $language[30];
    $status['busy'] = $language[31];
    $status['offline'] = $language[32];
    $status['invisible'] = $language[33];
    $status['away'] = $language[34];
    $id = $_GET['roomid'];
    if (empty($id)) {
        exit;
    }
    $time = getTimeStamp();
    $buddyList = array();
    $onlineCacheKey = 'all_online';
    if ($userid > 10000000) {
        $onlineCacheKey .= 'guest';
    }
    if ($onlineUsers = getCache($cookiePrefix . $onlineCacheKey, 30)) {
        $buddyList = unserialize($onlineUsers);
    } else {
        $sql = getFriendsList($userid, $time);
        if ($guestsMode) {
            $sql = getGuestsList($userid, $time, $sql);
        }
        $query = mysqli_query($GLOBALS['dbh'], $sql);
        if (defined('DEV_MODE') && DEV_MODE == '1') {
            echo mysqli_error($GLOBALS['dbh']);
        }
        while ($chat = mysqli_fetch_assoc($query)) {
            if ($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT && $chat['status'] != 'invisible' && $chat['status'] != 'offline' || $chat['isdevice'] == 1) {
                if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
                    $chat['status'] = 'available';
                }
            } else {
                $chat['status'] = 'offline';
            }
            $avatar = getAvatar($chat['avatar']);
            if (!empty($chat['username'])) {
                if (function_exists('processName')) {
                    $chat['username'] = processName($chat['username']);
                }
                if ($chat['userid'] != $userid) {
                    $buddyList[$chromeReorderFix . $chat['userid']] = array('id' => $chat['userid'], 'n' => $chat['username'], 'a' => $avatar, 's' => $chat['status']);
                }
            }
        }
    }
    if (DISPLAY_ALL_USERS == 0 && MEMCACHE != 0) {
        $tempBuddyList = array();
        if ($onlineFrnds = getCache($cookiePrefix . 'friend_ids_of_' . $userid, 30)) {
            $friendIds = unserialize($onlineFrnds);
        } else {
            $sql = getFriendsIds($userid);
            $res = mysqli_query($GLOBALS['dbh'], $sql);
            $result = mysqli_fetch_assoc($res);
            if (!empty($result['friends'])) {
                $friendIds = explode(',', $result['friends']);
            }
            setCache($cookiePrefix . 'friend_ids_of_' . $userid, serialize($friendIds), 30);
        }
        foreach ($friendIds as $friendId) {
            $friendId = $chromeReorderFix . $friendId;
            if (isset($buddyList[$friendId])) {
                $tempBuddyList[$friendId] = $buddyList[$friendId];
            }
        }
        $buddyList = $tempBuddyList;
    }
    if (function_exists('hooks_forcefriends') && is_array(hooks_forcefriends())) {
        $buddyList = array_merge(hooks_forcefriends(), $buddyList);
    }
    $s['available'] = '';
    $s['away'] = '';
    $s['busy'] = '';
    $s['offline'] = '';
    foreach ($buddyList as $buddy) {
        $s[$buddy['s']] .= '<div class="invite_1"><div class="invite_2" onclick="javascript:document.getElementById(\'check_' . $buddy['id'] . '\').checked = document.getElementById(\'check_' . $buddy['id'] . '\').checked?false:true;"><img height=30 width=30 src="' . $buddy['a'] . '"></div><div class="invite_3" onclick="javascript:document.getElementById(\'check_' . $buddy['id'] . '\').checked = document.getElementById(\'check_' . $buddy['id'] . '\').checked?false:true;"><span class="invite_name">' . $buddy['n'] . '</span><br/><span class="invite_5">' . $status[$buddy['s']] . '</span></div><input type="checkbox" name="invite[]" value="' . $buddy['id'] . '" id="check_' . $buddy['id'] . '" class="invite_4"></div>';
    }
    $inviteContent = '';
    $invitehide = '';
    $inviteContent = $s['available'] . "" . $s['away'] . "" . $s['offline'];
    if (empty($inviteContent)) {
        $inviteContent = $avchat_language[25];
        $invitehide = 'style="display:none;"';
    }
    echo <<<EOD
<!DOCTYPE html>
//.........这里部分代码省略.........
开发者ID:rodino25,项目名称:tsv2,代码行数:101,代码来源:invite.php

示例6: invite

function invite()
{
    global $userid;
    global $chatrooms_language;
    global $language;
    global $embed;
    global $embedcss;
    global $guestsMode;
    global $basedata;
    global $cookiePrefix;
    global $chromeReorderFix;
    global $hideOffline;
    global $plugins;
    $status['available'] = $language[30];
    $status['busy'] = $language[31];
    $status['offline'] = $language[32];
    $status['invisible'] = $language[33];
    $status['away'] = $language[34];
    $id = $_GET['roomid'];
    $inviteid = $_GET['inviteid'];
    $roomname = $_GET['roomname'];
    $popoutmode = $_GET['popoutmode'];
    $time = getTimeStamp();
    $sql = "select GROUP_CONCAT(userid) bannedusers from cometchat_chatrooms_users where ( isbanned=1 or ('" . mysqli_real_escape_string($GLOBALS['dbh'], $time) . "' - cometchat_chatrooms_users.lastactivity < " . ONLINE_TIMEOUT . ") ) and chatroomid='" . mysqli_real_escape_string($GLOBALS['dbh'], $id) . "' ";
    $query = mysqli_query($GLOBALS['dbh'], $sql);
    if (defined('DEV_MODE') && DEV_MODE == '1') {
        echo mysqli_error($GLOBALS['dbh']);
    }
    $result = mysqli_fetch_assoc($query);
    $bannedUsers = explode(',', $result['bannedusers']);
    $onlineCacheKey = 'all_online';
    if ($userid > 10000000) {
        $onlineCacheKey .= 'guest';
    }
    if (!is_array($buddyList = getCache($onlineCacheKey))) {
        $buddyList = array();
        $sql = getFriendsList($userid, $time);
        if ($guestsMode) {
            $sql = getGuestsList($userid, $time, $sql);
        }
        $query = mysqli_query($GLOBALS['dbh'], $sql);
        if (defined('DEV_MODE') && DEV_MODE == '1') {
            echo mysqli_error($GLOBALS['dbh']);
        }
        while ($chat = mysqli_fetch_assoc($query)) {
            if ($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT && $chat['status'] != 'invisible' && $chat['status'] != 'offline' || $chat['isdevice'] == 1) {
                if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
                    $chat['status'] = 'available';
                }
            } else {
                $chat['status'] = 'offline';
            }
            $avatar = getAvatar($chat['avatar']);
            if (!empty($chat['username'])) {
                if (function_exists('processName')) {
                    $chat['username'] = processName($chat['username']);
                }
                if (!in_array($chat['userid'], $bannedUsers) && $chat['userid'] != $userid && ($hideOffline == 0 || $hideOffline == 1 && $chat['status'] != 'offline')) {
                    $buddyList[$chromeReorderFix . $chat['userid']] = array('id' => $chat['userid'], 'n' => $chat['username'], 'a' => $avatar, 's' => $chat['status']);
                }
            }
        }
    }
    if (DISPLAY_ALL_USERS == 0 && MEMCACHE != 0 && USE_CCAUTH == 0) {
        $tempBuddyList = array();
        if (!is_array($friendIds = getCache('friend_ids_of_' . $userid))) {
            $friendIds = array();
            $sql = getFriendsIds($userid);
            $query = mysqli_query($GLOBALS['dbh'], $sql);
            if (mysqli_num_rows($query) == 1) {
                $buddy = mysqli_fetch_assoc($query);
                $friendIds = explode(',', $buddy['friendid']);
            } else {
                while ($buddy = mysqli_fetch_assoc($query)) {
                    $friendIds[] = $buddy['friendid'];
                }
            }
            setCache('friend_ids_of_' . $userid, $friendIds, 30);
        }
        foreach ($friendIds as $friendId) {
            $friendId = $chromeReorderFix . $friendId;
            if (!empty($buddyList[$friendId])) {
                $tempBuddyList[$friendId] = $buddyList[$friendId];
            }
        }
        $buddyList = $tempBuddyList;
    }
    if (function_exists('hooks_forcefriends') && is_array(hooks_forcefriends())) {
        $buddyList = array_merge(hooks_forcefriends(), $buddyList);
    }
    $blockList = array();
    if (in_array('block', $plugins)) {
        $blockedIds = getBlockedUserIDs();
        foreach ($blockedIds as $bid) {
            array_push($blockList, $bid);
            if (isset($buddyList[$chromeReorderFix . $bid])) {
                unset($buddyList[$chromeReorderFix . $bid]);
            }
        }
    }
//.........这里部分代码省略.........
开发者ID:kostastzo,项目名称:Cometchat,代码行数:101,代码来源:chatrooms.php

示例7: startTime

<?php

//Page Title
echo "<h1>Alchemy Extract for TRUTH Version 2</h1>";
$startTime = startTime();
//-----------------------------------------------------------------------Grab csv with raw data
$filename = getFile();
//-----------------------------------------------------------------------Grab line of data from file as array and Priocess
$data = grabData($filename);
$finishTime = finishTime();
processTime($startTime, $finishTime);
开发者ID:vortexcoaching,项目名称:MQP_Alchemy__Truth,代码行数:11,代码来源:testmain.blade.php

示例8: userSelection

function userSelection($silent = 0)
{
    $baseUrl = BASE_URL;
    global $userid;
    global $broadcastmessage_language;
    global $language;
    global $embed;
    global $embedcss;
    global $guestsMode;
    global $basedata;
    global $sleekScroller;
    global $inviteContent;
    global $chromeReorderFix;
    global $hideOffline;
    global $plugins;
    $status['available'] = $language[30];
    $status['busy'] = $language[31];
    $status['offline'] = $language[32];
    $status['invisible'] = $language[33];
    $status['away'] = $language[34];
    $time = getTimeStamp();
    $onlineCacheKey = 'all_online';
    if ($userid > 10000000) {
        $onlineCacheKey .= 'guest';
    }
    if (!is_array($buddyList = getCache($onlineCacheKey))) {
        $buddyList = array();
        $sql = getFriendsList($userid, $time);
        if ($guestsMode) {
            $sql = getGuestsList($userid, $time, $sql);
        }
        $query = mysqli_query($GLOBALS['dbh'], $sql);
        if (defined('DEV_MODE') && DEV_MODE == '1') {
            echo mysqli_error($GLOBALS['dbh']);
        }
        while ($chat = mysqli_fetch_assoc($query)) {
            if ($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT && $chat['status'] != 'invisible' && $chat['status'] != 'offline' || $chat['isdevice'] == 1) {
                if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
                    $chat['status'] = 'available';
                }
            } else {
                $chat['status'] = 'offline';
            }
            $avatar = getAvatar($chat['avatar']);
            if (!empty($chat['username'])) {
                if (function_exists('processName')) {
                    $chat['username'] = processName($chat['username']);
                }
                if ($chat['userid'] != $userid && ($hideOffline == 0 || $hideOffline == 1 && $chat['status'] != 'offline')) {
                    $buddyList[$chromeReorderFix . $chat['userid']] = array('id' => $chat['userid'], 'n' => $chat['username'], 'a' => $avatar, 's' => $chat['status']);
                }
            }
        }
    }
    if (DISPLAY_ALL_USERS == 0 && MEMCACHE != 0 && USE_CCAUTH == 0) {
        $tempBuddyList = array();
        if (!is_array($friendIds = getCache('friend_ids_of_' . $userid))) {
            $friendIds = array();
            $sql = getFriendsIds($userid);
            $query = mysqli_query($GLOBALS['dbh'], $sql);
            if (mysqli_num_rows($query) == 1) {
                $buddy = mysqli_fetch_assoc($query);
                $friendIds = explode(',', $buddy['friendid']);
            } else {
                while ($buddy = mysqli_fetch_assoc($query)) {
                    $friendIds[] = $buddy['friendid'];
                }
            }
            setCache('friend_ids_of_' . $userid, $friendIds, 30);
        }
        foreach ($friendIds as $friendId) {
            $friendId = $chromeReorderFix . $friendId;
            if (isset($buddyList[$friendId])) {
                $tempBuddyList[$friendId] = $buddyList[$friendId];
            }
        }
        $buddyList = $tempBuddyList;
    }
    if (function_exists('hooks_forcefriends') && is_array(hooks_forcefriends())) {
        $buddyList = array_merge(hooks_forcefriends(), $buddyList);
    }
    $blockList = array();
    if (in_array('block', $plugins)) {
        $blockedIds = getBlockedUserIDs();
        foreach ($blockedIds as $bid) {
            array_push($blockList, $bid);
            if (isset($buddyList[$chromeReorderFix . $bid])) {
                unset($buddyList[$chromeReorderFix . $bid]);
            }
        }
    }
    if (isset($buddyList[$chromeReorderFix . $userid])) {
        unset($buddyList[$chromeReorderFix . $userid]);
    }
    if (empty($silent)) {
        $buddyOrder = array();
        $buddyGroup = array();
        $buddyStatus = array();
        $buddyName = array();
        $buddyGuest = array();
//.........这里部分代码省略.........
开发者ID:kostastzo,项目名称:Cometchat,代码行数:101,代码来源:index.php

示例9: processCheckDate

    <head>
        <meta charset="utf-8" />
        <title>Lab 6</title>
        <style>
            label {
                display: block;
            }
            ul {
                list-style-type: none;
            }
        </style>
    </head>
    <body id="home-page" class="">
        <h1>Lab 6</h1>

        <h3>Excercise 1-Date Validation</h3>
        <?php 
echo processCheckDate($monthDayYearArray) . '<br />';
?>

        <h3>Excercise 2-Time Validation</h3>
        <?php 
echo processTime($timeArray) . '<br />';
?>

        <h3>Excercise 3-DateTime Validation</h3>
        <?php 
echo processDateTime($timeArray) . '<br />';
?>
    </body>
</html>
开发者ID:hoiwanjohnlouis,项目名称:eclipsePrototyping,代码行数:31,代码来源:class6-ex01.php

示例10: getBuddyList

function getBuddyList()
{
    global $response;
    global $userid;
    global $db;
    global $status;
    global $hideOffline;
    global $plugins;
    global $guestsMode;
    global $cookiePrefix;
    global $chromeReorderFix;
    global $blockpluginmode;
    global $bannedUserIDs;
    $time = getTimeStamp();
    if (empty($_SESSION['cometchat']['cometchat_buddytime']) || $_REQUEST['initialize'] == 1 || $_REQUEST['f'] == 1 || !empty($_SESSION['cometchat']['cometchat_buddytime']) && ($time - $_SESSION['cometchat']['cometchat_buddytime'] >= REFRESH_BUDDYLIST || MEMCACHE != 0)) {
        if ($_REQUEST['initialize'] == 1 && !empty($_SESSION['cometchat']['cometchat_buddyblh']) && $time - $_SESSION['cometchat']['cometchat_buddytime'] < REFRESH_BUDDYLIST && !defined('TAPATALK')) {
            $response['buddylist'] = $_SESSION['cometchat']['cometchat_buddyresult'];
            $response['blh'] = $_SESSION['cometchat']['cometchat_buddyblh'];
        } else {
            $onlineCacheKey = 'all_online';
            if ($userid > 10000000) {
                $onlineCacheKey .= 'guest';
            }
            if (!is_array($buddyList = getCache($onlineCacheKey)) || $_REQUEST['f'] == 1 || defined('TAPATALK')) {
                $buddyList = array();
                $sql = getFriendsList($userid, $time);
                if ($guestsMode) {
                    $sql = getGuestsList($userid, $time, $sql);
                }
                if (!empty($_REQUEST['activeChatboxIds'])) {
                    $activeChatboxIds = "'" . str_replace(",", "','", $_REQUEST['activeChatboxIds']) . "'";
                    $sql = getActivechatboxdetails($activeChatboxIds) . " UNION " . $sql;
                }
                $query = mysqli_query($GLOBALS['dbh'], $sql);
                if (defined('DEV_MODE') && DEV_MODE == '1') {
                    echo mysqli_error($GLOBALS['dbh']);
                }
                while ($chat = mysqli_fetch_assoc($query)) {
                    if (in_array($chat['userid'], $bannedUserIDs)) {
                        continue;
                    }
                    if (($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT || $chat['isdevice'] == 1) && $chat['status'] != 'invisible' && $chat['status'] != 'offline') {
                        if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
                            $chat['status'] = 'available';
                        }
                    } else {
                        $chat['status'] = 'offline';
                    }
                    if ($chat['message'] == null) {
                        $chat['message'] = $status[$chat['status']];
                    }
                    $link = fetchLink($chat['link']);
                    $avatar = getAvatar($chat['avatar']);
                    if (function_exists('processName')) {
                        $chat['username'] = processName($chat['username']);
                    }
                    if (empty($chat['isdevice'])) {
                        $chat['isdevice'] = "0";
                    }
                    if (empty($chat['grp'])) {
                        $chat['grp'] = '';
                    }
                    if (empty($chat['ch'])) {
                        if (defined('KEY_A') && defined('KEY_B') && defined('KEY_C')) {
                            $key = KEY_A . KEY_B . KEY_C;
                        }
                        $chat['ch'] = md5($chat['userid'] . $key);
                    }
                    if (defined('TAPATALK')) {
                        global $integration;
                        $chat['message'] = $integration->hooks_processMessageBuddylist($chat['message']);
                    }
                    if (!empty($chat['username']) && ($hideOffline == 0 || $hideOffline == 1 && $chat['status'] != 'offline') || in_array($chat['userid'], explode(",", $_REQUEST['activeChatboxIds']))) {
                        $buddyList[$chromeReorderFix . $chat['userid']] = array('id' => $chat['userid'], 'n' => $chat['username'], 'l' => $link, 'a' => $avatar, 'd' => $chat['isdevice'], 's' => $chat['status'], 'm' => $chat['message'], 'g' => $chat['grp'], 'ls' => $chat['lastseen'], 'lstn' => $chat['lastseensetting'], 'ch' => $chat['ch']);
                    }
                }
                setCache($onlineCacheKey, $buddyList, 30);
            }
            if (DISPLAY_ALL_USERS == 0 && MEMCACHE != 0 && USE_CCAUTH == 0) {
                $tempBuddyList = array();
                if (!is_array($friendIds = getCache('friend_ids_of_' . $userid) || $_REQUEST['f'] == 1)) {
                    $friendIds = array();
                    $sql = getFriendsIds($userid);
                    $query = mysqli_query($GLOBALS['dbh'], $sql);
                    if (mysqli_num_rows($query) == 1) {
                        $buddy = mysqli_fetch_assoc($query);
                        $friendIds = explode(',', $buddy['friendid']);
                    } else {
                        while ($buddy = mysqli_fetch_assoc($query)) {
                            $friendIds[] = $buddy['friendid'];
                        }
                    }
                    setCache('friend_ids_of_' . $userid, $friendIds, 30);
                }
                foreach ($friendIds as $friendId) {
                    $friendId = $chromeReorderFix . $friendId;
                    if (!empty($buddyList[$friendId])) {
                        $tempBuddyList[$friendId] = $buddyList[$friendId];
                    }
                }
//.........这里部分代码省略.........
开发者ID:albertoneto,项目名称:localhost,代码行数:101,代码来源:cometchat_receive.php

示例11: strtotime

        // If you do 1 day / 24 hours it doubles up the current timestamp with the timestamp 24 hours ago.  Not good!
        $yesterday = strtotime('-23 hours');
        // Enumerate through the list of hosts from config.php
        foreach ($checkHosts as $host) {
            curl_setopt($ch, CURLOPT_URL, 'https://api.pingdom.com/api/2.0/summary.performance/' . $host['id'] . '?from=' . $yesterday . '&to=' . $now . '&resolution=hour');
            // Decode the response from Pingdom to an associative array
            $response = json_decode(curl_exec($ch), true);
            // Before we look through the response, was there an error?
            if (isset($response['error'])) {
                // Crap, there was an error!
                // Send the error to Status Board
                $finalArray['graph']['error'] = ['message' => $response['error']['statusdesc'] . ' (' . $response['error']['statuscode'] . '): ' . $response['error']['errormessage'], 'detail' => $response['error']['errormessage']];
                // Abort this loop!
                break;
            }
            foreach ($response['summary']['hours'] as $hour) {
                $check[] = ['title' => processTime($hour['starttime'], $timeFormat), 'value' => $hour['avgresponse']];
            }
            $responseTime[] = ['title' => $host['name'], 'datapoints' => $check];
            // Unset the $check variable so it doesn't insert values into the next hosts array
            unset($check);
        }
        // End last-day / default case
        break;
}
// ... and it's closed.
curl_close($ch);
$finalArray['graph']['datasequences'] = $responseTime;
header('content-type: application/json');
echo json_encode($finalArray);
// And we're done!
开发者ID:aphexenizer,项目名称:Pingdom-for-Status-Board,代码行数:31,代码来源:pingdom.php

示例12: loadChatroomPro

function loadChatroomPro()
{
    global $chatrooms_language;
    global $language;
    global $embed;
    global $embedcss;
    global $userid;
    global $moderatorUserIDs;
    global $lightboxWindows;
    global $showchatbutton;
    global $chromeReorderFix;
    $close = 'setTimeout("window.close()",2000);';
    $callbackfn = '';
    if (!empty($_REQUEST['callbackfn'])) {
        $callbackfn = $_REQUEST['callbackfn'];
    }
    if (!empty($_GET['embed']) && $_GET['embed'] == 'web') {
        $embed = 'web';
        $embedcss = 'embed';
        $close = 'parent.closeCCPopup("loadChatroomPro");';
    }
    $callerWindow = '';
    if (!empty($_REQUEST['caller'])) {
        $callerWindow = $_REQUEST['caller'];
    }
    $id = mysqli_real_escape_string($GLOBALS['dbh'], $_GET['roomid']);
    $cc_theme = '';
    if (!empty($_GET['cc_theme'])) {
        $cc_theme = '&cc_theme=' . $_GET['cc_theme'];
    }
    $uid = mysqli_real_escape_string($GLOBALS['dbh'], $_GET['inviteid']);
    $owner = $_GET['owner'];
    $apiAccess = 0;
    if (!empty($_GET['apiAccess']) && $_GET['apiAccess'] != 'undefined') {
        $apiAccess = $_GET['apiAccess'];
    }
    $options = "";
    $status_area = "";
    $popoutmode = $_GET['popoutmode'];
    $onlineCacheKey = 'all_online';
    if ($userid > 10000000) {
        $onlineCacheKey .= 'guest';
    }
    if (!is_array($buddyList = getCache($onlineCacheKey))) {
        $buddyList = array();
        $sql = getFriendsList($userid, $time);
        if ($guestsMode) {
            $sql = getGuestsList($userid, $time, $sql);
        }
        $query = mysqli_query($GLOBALS['dbh'], $sql);
        if (defined('DEV_MODE') && DEV_MODE == '1') {
            echo mysqli_error($GLOBALS['dbh']);
        }
        while ($chat = mysqli_fetch_assoc($query)) {
            if ($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT && $chat['status'] != 'invisible' && $chat['status'] != 'offline' || $chat['isdevice'] == 1) {
                if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
                    $chat['status'] = 'available';
                }
            } else {
                $chat['status'] = 'offline';
            }
            $avatar = getAvatar($chat['avatar']);
            if (!empty($chat['username'])) {
                if (function_exists('processName')) {
                    $chat['username'] = processName($chat['username']);
                }
                if (!in_array($chat['userid'], $bannedUsers) && $chat['userid'] != $userid && ($hideOffline == 0 || $hideOffline == 1 && $chat['status'] != 'offline')) {
                    $buddyList[$chromeReorderFix . $chat['userid']] = array('id' => $chat['userid'], 'n' => $chat['username'], 'a' => $avatar, 's' => $chat['status']);
                }
            }
        }
    }
    if (DISPLAY_ALL_USERS == 0 && MEMCACHE != 0 && USE_CCAUTH == 0) {
        $tempBuddyList = array();
        if (!is_array($friendIds = getCache('friend_ids_of_' . $userid)) || $force == 1) {
            $friendIds = array();
            $sql = getFriendsIds($userid);
            $query = mysqli_query($GLOBALS['dbh'], $sql);
            if (mysqli_num_rows($query) == 1) {
                $buddy = mysqli_fetch_assoc($query);
                $friendIds = explode(',', $buddy['friendid']);
            } else {
                while ($buddy = mysqli_fetch_assoc($query)) {
                    $friendIds[] = $buddy['friendid'];
                }
            }
            setCache('friend_ids_of_' . $userid, $friendIds, 30);
        }
        foreach ($friendIds as $friendId) {
            $friendId = $chromeReorderFix . $friendId;
            if (!empty($buddyList[$friendId])) {
                $tempBuddyList[$friendId] = $buddyList[$friendId];
            }
        }
        $buddyList = $tempBuddyList;
    }
    if (function_exists('hooks_forcefriends') && is_array(hooks_forcefriends())) {
        $buddyList = array_merge(hooks_forcefriends(), $buddyList);
    }
    if ($apiAccess && ($showchatbutton == '0' || $showchatbutton == '1' && array_key_exists($chromeReorderFix . $uid, $buddyList))) {
//.........这里部分代码省略.........
开发者ID:albertoneto,项目名称:localhost,代码行数:101,代码来源:chatrooms.php

示例13: intval

    $fetchid = $_REQUEST['userid'];
} else {
    $fetchid = $userid;
}
$fetchid = intval($fetchid);
$time = getTimeStamp();
$sql = getUserDetails($fetchid);
if ($guestsMode && $fetchid >= 10000000) {
    $sql = getGuestDetails($fetchid);
}
$query = mysqli_query($GLOBALS['dbh'], $sql);
if (defined('DEV_MODE') && DEV_MODE == '1') {
    echo mysqli_error($GLOBALS['dbh']);
}
$chat = mysqli_fetch_assoc($query);
if (($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT || $chat['isdevice'] == 1) && $chat['status'] != 'invisible' && $chat['status'] != 'offline') {
    if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
        $chat['status'] = 'available';
    }
} else {
    $chat['status'] = 'offline';
}
if ($chat['message'] == null) {
    $chat['message'] = $status[$chat['status']];
}
$link = fetchLink($chat['link']);
$avatar = getAvatar($chat['avatar']);
if (empty($chat['ch'])) {
    if (defined('KEY_A') && defined('KEY_B') && defined('KEY_C')) {
        $key = KEY_A . KEY_B . KEY_C;
    }
开发者ID:albertoneto,项目名称:localhost,代码行数:31,代码来源:cometchat_getid.php

示例14: sizeof

} else {
    //echo "0 results";
}
//for each shortLink, process dates
//2 cases: start time < end time (easy case)
//start time > end time (hard case)
$noOfParticipant = sizeof($shortLinkArray);
foreach ($shortLinkArray as $sl) {
    $selectSql1 = "SELECT * FROM user_data\n\t\t\tWHERE shortlink = '" . $sl . "'";
    $result = $conn->query($selectSql1);
    $row = mysqli_fetch_assoc($result);
    $startTime = intval($row["starttime"]);
    $endTime = intval($row["endtime"]);
    $gmt = intval($row["gmt"]);
    $startTime = processTime($startTime, $gmt);
    $endTime = processTime($endTime, $gmt);
    // echo "StartTime: ";
    // echo $startTime;
    // echo "<br>";
    // echo "End Time:";
    // echo $endTime;
    // echo "<br>";
    // echo "GMT: ";
    // echo $gmt;
    // echo "<br>";
    if ($startTime < $endTime) {
        while ($startTime != $endTime) {
            $timeArray[$startTime] = $timeArray[$startTime] + 1;
            $startTime++;
        }
    } elseif ($startTime == $endTime) {
开发者ID:ngzikai,项目名称:later-we-think-of-name-k,代码行数:31,代码来源:addNewParticipant.php

示例15: unban

function unban()
{
    global $userid;
    global $chatrooms_language;
    global $language;
    global $embed;
    global $embedcss;
    $status['available'] = $language[30];
    $status['busy'] = $language[31];
    $status['offline'] = $language[32];
    $status['invisible'] = $language[33];
    $status['away'] = $language[34];
    $id = $_GET['roomid'];
    $inviteid = $_GET['inviteid'];
    $roomname = $_GET['roomname'];
    $time = getTimeStamp();
    $buddyList = array();
    $sql = "select DISTINCT " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " userid, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_NAME . " username, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_LASTACTIVITY . " lastactivity, " . DB_AVATARFIELD . " avatar, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_NAME . " link,  cometchat_status.message, cometchat_status.status from " . TABLE_PREFIX . DB_USERTABLE . " left join cometchat_status on " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " = cometchat_status.userid right join cometchat_chatrooms_users on " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " =cometchat_chatrooms_users.userid " . DB_AVATARTABLE . " where " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " <> '" . mysql_real_escape_string($userid) . "' and cometchat_chatrooms_users.chatroomid = '" . mysql_real_escape_string($id) . "' and cometchat_chatrooms_users.isbanned ='1' order by username asc";
    $query = mysql_query($sql);
    if (defined('DEV_MODE') && DEV_MODE == '1') {
        echo mysql_error();
    }
    while ($chat = mysql_fetch_array($query)) {
        if ($time - processTime($chat['lastactivity']) < ONLINE_TIMEOUT && $chat['status'] != 'invisible' && $chat['status'] != 'offline') {
            if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
                $chat['status'] = 'available';
            }
        } else {
            $chat['status'] = 'offline';
        }
        $avatar = getAvatar($chat['avatar']);
        if (!empty($chat['username'])) {
            if (function_exists('processName')) {
                $chat['username'] = processName($chat['username']);
            }
            $buddyList[] = array('id' => $chat['userid'], 'n' => $chat['username'], 's' => $chat['status'], 'a' => $avatar);
        }
    }
    if (function_exists('hooks_forcefriends') && is_array(hooks_forcefriends())) {
        $buddyList = array_merge(hooks_forcefriends(), $buddyList);
    }
    $s['available'] = '';
    $s['away'] = '';
    $s['busy'] = '';
    $s['offline'] = '';
    foreach ($buddyList as $buddy) {
        $s[$buddy['s']] .= '<div class="invite_1"><div class="invite_2" onclick="javascript:document.getElementById(\'check_' . $buddy['id'] . '\').checked = document.getElementById(\'check_' . $buddy['id'] . '\').checked?false:true;"><img height=30 width=30 src="' . $buddy['a'] . '" /></div><div class="invite_3" onclick="javascript:document.getElementById(\'check_' . $buddy['id'] . '\').checked = document.getElementById(\'check_' . $buddy['id'] . '\').checked?false:true;"><span class="invite_name">' . $buddy['n'] . '</span><br/><span class="invite_5">' . $status[$buddy['s']] . '</span></div><input type="checkbox" name="unban[]" value="' . $buddy['id'] . '" id="check_' . $buddy['id'] . '" class="invite_4" /></div>';
    }
    if ($s['available'] == '' && $s['busy'] == '' && $s['away'] == '' && $s['offline'] == '') {
        $s['available'] = $chatrooms_language[44];
    }
    echo <<<EOD
<!DOCTYPE html>
<html>
\t<head>
\t\t<title>{$chatrooms_language[21]}</title> 
\t\t<meta http-equiv="content-type" content="text/html; charset=utf-8"/> 
\t\t<link type="text/css" rel="stylesheet" media="all" href="../../css.php?type=module&name=chatrooms" /> 
\t</head>
\t<body>
\t\t<form method="post" action="chatrooms.php?action=unbanusers&embed={$embed}">
\t\t\t<div class="container">
\t\t\t\t<div class="container_title {$embedcss}">{$chatrooms_language[21]}</div>
\t\t\t\t<div class="container_body {$embedcss}">
\t\t\t\t\t{$s['available']}{$s['busy']}{$s['away']}{$s['offline']}
\t\t\t\t\t<div style="clear:both"></div>
\t\t\t\t</div>
\t\t\t\t<div class="container_sub {$embedcss}">
\t\t\t\t\t<input type=submit value="Unban Users" class="invitebutton" />
\t\t\t\t</div>
\t\t\t</div>\t
\t\t\t<input type="hidden" name="roomid" value="{$id}" />
\t\t\t<input type="hidden" name="inviteid" value="{$inviteid}" />
\t\t\t<input type="hidden" name="roomname" value="{$roomname}" />
\t\t</form>
\t</body>
</html>
EOD;
}
开发者ID:quachvancam,项目名称:sugardating,代码行数:79,代码来源:chatrooms.php


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