Exemple #1
0
    static function reportsDisplay($linkIDType, $linkID = 0)
    {
        global $User, $DB;
        if ($linkIDType != 'User' && $linkIDType != 'Game' && $linkIDType != 'All') {
            throw new Exception("Invalid note link-ID-type given: '" . $linkIDType . "', only User/Game allowed");
        }
        $linkID = (int) $linkID;
        $sql = "SELECT m.linkIDType, m.linkID, m.fromUserID, u.username, m.type, m.note, m.timeSent FROM wD_ModeratorNotes m INNER JOIN wD_Users u ON ( u.id = m.fromUserID ) WHERE 1=1 ";
        if (!$User->type['Moderator']) {
            $sql .= "AND ( m.type='Report' OR m.type='PublicNote' )";
        }
        if ($linkIDType != 'All' || !$User->type['Moderator']) {
            $sql .= "AND m.linkIDType='" . $linkIDType . "' AND m.linkID=" . $linkID;
        }
        $sql .= " ORDER BY m.timeSent DESC LIMIT " . ($linkIDType == 'All' ? '50' : '5');
        $tabl = $DB->sql_tabl($sql);
        $html = '';
        while ($note = $DB->tabl_hash($tabl)) {
            $html .= '<tr>
				' . ($linkIDType == 'All' ? '<td><a href="' . ($note['linkIDType'] == 'User' ? 'profile.php?userID=' . $note['linkID'] . '">Go to user</a>' : 'board.php?gameID=' . $note['linkID'] . '">Go to game</a>') . '</td>' : '') . '
				' . ($User->type['Moderator'] ? '<td><a href="?modNoteDelete=' . $note['linkIDType'] . '_' . $note['linkID'] . '_' . $note['timeSent'] . '">Delete</a></td>' : '') . '
				<td><a href="profile.php?userID=' . $note['fromUserID'] . '">' . $note['username'] . '</a></td>
				<td>' . libTime::text($note['timeSent']) . '</td>
				<td>' . $note['type'] . '</td>
				<td>' . $note['note'] . '</td>
				</tr>';
        }
        if ($html) {
            return '<table><tr>' . ($linkIDType == 'All' ? '<th>Link</th>' : '') . ($User->type['Moderator'] ? '<th>Control</th>' : '') . '<th>From</th><th>Sent</th><th>Type</th><th>Text</th></tr>' . $html . '</table>';
        } else {
            switch ($linkIDType) {
                case 'User':
                    return 'No reports/notes exist for this user.';
                case 'Game':
                    return 'No reports/notes exist for this game.';
                case 'All':
                    return 'No reports/notes exist';
                default:
                    return 'Unknown type "' . $linkIDType . '"';
            }
        }
    }
Exemple #2
0
 private static function footerStats()
 {
     global $DB, $Misc, $User;
     $buf = '';
     // Run time, select queries, insert queries
     $buf .= l_t('Rendered in: <strong>%ssec</strong> - ' . 'Data retrievals: <strong>%s</strong> - ' . 'Data insertions: <strong>%s</strong>', round(microtime(true) - $GLOBALS['scriptStartTime'], 2), $DB->getqueries, $DB->putqueries) . ' ';
     if (function_exists('memory_get_usage')) {
         $buf .= ' - ' . l_t('Memory used: <strong>%sMB</strong>', round(memory_get_usage() / 1024 / 1024, 3)) . ' ';
     }
     $buf .= '<br /><br />';
     $stats = array('Logged on' => $Misc->OnlinePlayers, 'Playing' => $Misc->ActivePlayers, 'Registered' => $Misc->TotalPlayers);
     $first = true;
     foreach ($stats as $name => $stat) {
         if ($first) {
             $first = false;
         } else {
             $buf .= ' - ';
         }
         $buf .= l_t($name) . ': <strong>' . $stat . '</strong> ';
     }
     $buf .= ' - ' . l_t('Pages served: <strong>%s</strong>', $Misc->Hits);
     $buf .= '<br />';
     $stats = array('Starting games' => $Misc->GamesNew, 'Joinable games' => $Misc->GamesOpen, 'Active games' => $Misc->GamesActive, 'Finished games' => $Misc->GamesFinished);
     $first = true;
     foreach ($stats as $name => $stat) {
         if ($first) {
             $first = false;
         } else {
             $buf .= ' - ';
         }
         $buf .= l_t($name) . ': <strong>' . $stat . '</strong> ';
     }
     if (!isset($User) || !$User->type['Moderator']) {
         return $buf;
     }
     $buf .= '<br /><br />';
     $stats = array('<a href="gamemaster.php" class="light">' . l_t('Last process') . '</a>' => $Misc->LastProcessTime ? libTime::text($Misc->LastProcessTime) : l_t('Never'), '<a href="admincp.php?tab=Control%20Panel%20Logs" class="light">' . l_t('Last mod action') . '</a>' => $Misc->LastModAction ? libTime::text($Misc->LastModAction) : l_t('Never'), '<a href="admincp.php?tab=Status%20lists" class="light">' . l_t('Error logs') . '</a>' => $Misc->ErrorLogs, l_t('Paused games') => $Misc->GamesPaused, '<a href="admincp.php?tab=Status%20lists" class="light">' . l_t('Crashed games') . '</a>' => $Misc->GamesCrashed);
     $first = true;
     foreach ($stats as $name => $stat) {
         if ($first) {
             $first = false;
         } else {
             $buf .= ' - ';
         }
         $buf .= $name . ': <strong>' . $stat . '</strong> ';
     }
     return $buf;
 }
Exemple #3
0
 /**
  * A textual display of this user's last log-in time
  * @return string Last log-in time
  */
 function lastLoggedInTxt()
 {
     return libTime::timeLengthText(time() - $this->timeLoggedIn) . ' (' . libTime::text($this->timeLoggedIn) . ')';
 }
 private function printTimeDataRow($row, $lastRow = false)
 {
     static $alternate;
     if (!isset($alternate)) {
         $alternate = false;
     }
     $alternate = !$alternate;
     print '<tr class="replyalternate' . (2 - $alternate) . ' replyborder' . (2 - $alternate) . '">';
     foreach ($row as $name => $part) {
         print '<td>';
         if ($name == 'userID') {
             if ($part == $this->aUserID) {
                 print '<strong>' . $part . '</strong>';
             } else {
                 print $part;
             }
             continue;
         }
         if ($lastRow) {
             if ($name == 'lastRequest') {
                 $timeComparison = l_t('(%s earlier)', libTime::remainingText($lastRow['lastRequest'], $part));
                 if ($lastRow['lastRequest'] - $part < 15 * 60) {
                     print '<span class="Austria">' . $timeComparison . '</span>';
                 } elseif ($lastRow['lastRequest'] - $part < 30 * 60) {
                     print '<span class="Turkey">' . $timeComparison . '</span>';
                 } elseif ($lastRow['lastRequest'] - $part < 45 * 60) {
                     print '<span class="Italy">' . $timeComparison . '</span>';
                 } else {
                     print $timeComparison;
                 }
             } else {
                 if ($part == $lastRow[$name]) {
                     print '<span class="Austria">' . $part . '</span>';
                 } else {
                     print $part;
                 }
             }
         } else {
             if ($name == 'lastRequest') {
                 print libTime::text($part);
             } else {
                 print $part;
             }
         }
         print '</td>';
     }
     print '</tr>';
 }
Exemple #5
0
 private function writeLog()
 {
     if (!isset(Config::$pointsLogFile) || !Config::$pointsLogFile) {
         return;
     }
     assert('is_array($this->logBefore);');
     $before = $this->logBefore;
     $after = $this->pointsInfoLog();
     $log = array('gameID' => $this->Game->id);
     foreach ($before as $name => $value) {
         $log[$name] = array('before' => $value, 'after' => $after[$name]);
     }
     if (!file_put_contents(Config::$pointsLogFile, libTime::text() . ":\n" . print_r($log, true) . "\n-----\n\n", FILE_APPEND)) {
         trigger_error("Couldn't write points log to log file");
     }
 }
 public function changePhaseLength(array $params)
 {
     global $DB;
     require_once l_r('objects/game.php');
     $newPhaseMinutes = (int) $params['phaseMinutes'];
     if ($newPhaseMinutes < 5 || $newPhaseMinutes > 10 * 24 * 60) {
         throw new Exception(l_t("Given phase minutes out of bounds (5 minutes to 10 days)"));
     }
     $Variant = libVariant::loadFromGameID($params['gameID']);
     $Game = $Variant->Game($params['gameID']);
     if ($Game->processStatus != 'Not-processing' || $Game->phase == 'Finished') {
         throw new Exception(l_t("Game is either crashed/paused/finished/processing, and so the next-process time cannot be altered."));
     }
     $oldPhaseMinutes = $Game->phaseMinutes;
     $Game->phaseMinutes = $newPhaseMinutes;
     $Game->processTime = time() + $newPhaseMinutes * 60;
     $DB->sql_put("UPDATE wD_Games SET\r\n\t\t\tphaseMinutes = " . $Game->phaseMinutes . ",\r\n\t\t\tprocessTime = " . $Game->processTime . "\r\n\t\t\tWHERE id = " . $Game->id);
     return l_t('Process time changed from %s to %s. Next process time is %s.', libTime::timeLengthText($oldPhaseMinutes * 60), libTime::timeLengthText($Game->phaseMinutes * 60), libTime::text($Game->processTime));
 }
Exemple #7
0
 public function timeSent()
 {
     return libTime::text($this->timeSent);
 }
Exemple #8
0
 public static function stats()
 {
     global $Misc;
     $errorTimes = self::errorTimes();
     $count = count($errorTimes);
     $Misc->ErrorLogs = $count;
     return $count . ' error log files' . ($count > 0 ? ', last error log at ' . libTime::text($errorTimes[0]) : '');
 }
Exemple #9
0
print '<div class="leftHalf" style="width:50%">';
if ($UserProfile->type['Banned']) {
    print '<p><strong>' . l_t('Banned') . '</strong></p>';
}
if ($UserProfile->comment) {
    print '<p class="profileComment">"' . $UserProfile->comment . '"</p>';
}
print '<p><ul class="formlist">';
if ($UserProfile->type['Moderator'] || $UserProfile->type['ForumModerator'] || $UserProfile->type['Admin']) {
    print '<li><strong>' . l_t('Mod/Admin team') . '</strong></li>';
    print '<li>&nbsp;</li>';
}
if ($UserProfile->online) {
    print '<li><strong>' . l_t('Currently logged in.') . '</strong> (' . libHTML::loggedOn($UserProfile->id) . ')</li>';
} else {
    print '<li><strong>' . l_t('Last visited:') . '</strong> ' . libTime::text($UserProfile->timeLastSessionEnded) . '</li>';
}
list($posts) = $DB->sql_row("SELECT (\r\n\t\tSELECT COUNT(fromUserID) FROM `wD_ForumMessages` WHERE type='ThreadStart' AND fromUserID = " . $UserProfile->id . "\r\n\t\t) + (\r\n\t\tSELECT COUNT(fromUserID) FROM `wD_ForumMessages` WHERE type='ThreadReply' AND fromUserID = " . $UserProfile->id . "\r\n\t\t)");
// Doing the query this way makes MySQL use the type, fromUserID index
if (is_null($posts)) {
    $posts = 0;
}
list($likes) = $DB->sql_row("SELECT COUNT(*) FROM wD_LikePost WHERE userID=" . $UserProfile->id);
list($liked) = $DB->sql_row("SELECT COUNT(*) FROM wD_ForumMessages fm \r\n\tINNER JOIN wD_LikePost lp ON lp.likeMessageID = fm.id \r\n\tWHERE fm.fromUserID=" . $UserProfile->id);
$likes = $likes ? '<strong>' . l_t('Likes:') . '</strong> ' . $likes : '';
$liked = $liked ? '<strong>' . l_t('Liked:') . '</strong> ' . $liked : '';
print '<li><strong>' . l_t('Forum posts:') . '</strong> ' . $posts . '<br />';
//<strong>'.l_t('View:').'</strong> <a class="light" href="profile.php?detail=threads&userID='.$UserProfile->id.'">'.l_t('Threads').'</a>,
//	<a class="light" href="profile.php?detail=replies&userID='.$UserProfile->id.'">'.l_t('replies').'</a>';
print '<br/>' . implode(' / ', array($likes, $liked)) . '
	</li>';
/**
 * Display the error logs and other lists useful for admins
 *
 * @package Admin
 */
if ($User->type['Admin']) {
    //There may be sensitive info that would allow privilege escalation in these error logs
    print '<p><strong>' . l_t('Error logs:') . '</strong> ' . libError::stats() . ' (' . libHTML::admincp('clearErrorLogs', null, 'Clear') . ')</p>';
    $dir = libError::directory();
    $errorlogs = libError::errorTimes();
    $alternate = false;
    print '<TABLE class="credits">';
    foreach ($errorlogs as $errorlog) {
        $alternate = !$alternate;
        print '<tr class="replyalternate' . ($alternate ? '1' : '2') . '">';
        print '<td class="left time">' . libTime::text($errorlog) . '</td>';
        print '<td class="right message"><a class="light" href="admincp.php?viewErrorLog=' . $errorlog . '">Open</a></td>';
        print '</tr>';
    }
    print '</TABLE>';
}
/**
 * Fill a named table from a single column query
 *
 * @param string $name The table's name
 * @param string $query The single columned query which will return the data to display
 */
function adminStatusTable($name, $query)
{
    global $DB;
    print '<p><strong>' . $name . '</strong></p>';
Exemple #11
0
    public function renderMessages($msgCountryID, $messages)
    {
        global $DB, $User, $Member, $Game;
        $messagestxt = "";
        $alternate = false;
        for ($i = count($messages); $i >= 1; --$i) {
            $message = $messages[$i - 1];
            $alternate = !$alternate;
            // If member info is hidden and the message isn't from me
            if ($Game->isMemberInfoHidden() && (!is_object($Member) || $message['fromCountryID'] != $Member->countryID)) {
                /*
                 * Take the last 2^12 bits off the timestamp (~70 mins), to fudge
                 * it so players can't use it to compare to who was online/offline
                 * at the time.
                 */
                // 1010-1010-1010-1010-1010-xxxx-xxxx-xxxx -> 1010-1010-1010-1010-1010-0000-0000-0000
                $message['timeSent'] &= 0xfffff000;
                $approxIndicator = '~';
            } else {
                $approxIndicator = '';
            }
            $messagestxt .= '<TR class="replyalternate' . ($alternate ? '1' : '2') . ' gameID' . $Game->id . 'countryID' . $message['fromCountryID'] . '">' . '<TD class="left time">' . $approxIndicator . libTime::text($message['timeSent']);
            $messagestxt .= '</TD>
					<TD class="right ';
            if ($message['fromCountryID'] != 0) {
                // If the message isn't from the GameMaster color it in the countryID's color
                $messagestxt .= 'country' . $message['fromCountryID'];
            }
            $messagestxt .= '">';
            if ($msgCountryID == -1 && isset($Member)) {
                if ($Member->countryID == $message['fromCountryID']) {
                    $fromtxt = l_t(', from <strong>you</strong>');
                } elseif (0 == $message['fromCountryID']) {
                    $fromtxt = l_t(', from <strong>Gamemaster</strong>');
                } else {
                    $fromtxt = l_t(', from <strong>%s</strong>', l_t($this->countryName($message['fromCountryID'])));
                }
                if ($Member->countryID == $message['toCountryID']) {
                    $messagestxt .= '(' . l_t('To: <strong>You</strong>') . $fromtxt . ') - ';
                } else {
                    $messagestxt .= '(' . l_t('To: <strong>%s</strong>', l_t($this->countryName($message['toCountryID']))) . $fromtxt . ') - ';
                }
            }
            if ($message['turn'] < $Game->turn) {
                $messagestxt .= '<strong>' . $Game->datetxt($message['turn']) . '</strong>: ';
            }
            if (is_object($Member) && $message['fromCountryID'] == $Member->countryID) {
                $message['message'] = '<span class="messageFromMe">' . $message['message'] . '</span>';
            }
            // Display the country name in front of the text (for colorblind people)
            if ($User->options->value['colourblind'] != 'No') {
                if (isset($Member) && $Member->countryID == $message['fromCountryID']) {
                    $messagestxt .= '<strong>You:</strong> ';
                } elseif ($message['fromCountryID'] != 0) {
                    $messagestxt .= '<strong>' . $this->countryName($message['fromCountryID']) . ':</strong> ';
                }
            }
            $messagestxt .= $message['message'] . '</TD>
				</TR>';
        }
        return $messagestxt;
    }
Exemple #12
0
   along with webDiplomacy.  If not, see <http://www.gnu.org/licenses/>.
*/
defined('IN_CODE') or die('This script can not be run by itself.');
/**
 * This script displays the 20 most recent admin/moderator actions made with the adminActionsForms class.
 *
 * @package Admin
 */
if (!isset($_REQUEST['full'])) {
    print '<a href="admincp.php?tab=Control Panel Logs&full=on">' . l_t('View all logs') . '</a>';
}
print '<table class="credits">';
$alternate = 1;
$tabl = $DB->sql_tabl("SELECT a.name, u.username, a.time, a.details, a.params\r\n\t\tFROM wD_AdminLog a INNER JOIN wD_Users u ON ( a.userID = u.id )\r\n\t\tORDER BY a.time DESC " . (isset($_REQUEST['full']) ? '' : "LIMIT 20"));
while ($row = $DB->tabl_hash($tabl)) {
    $row['time'] = libTime::text($row['time']);
    $params = $row['params'];
    /*
    $params = @unserialize($row['params']);
    if( count($params) )
    {
    	$p=array();
    	foreach($params as $name=>$value) {
    		if( $name=='userID' )
    			$value = '<a href="profile.php?userID='.$value.'" class="light">'.$value.'</a>';
    		elseif( $name=='gameID' )
    			$value = '<a href="board.php?gameID='.$value.'" class="light">'.$value.'</a>';
    
    		$p[]=$name.'='.$value;
    	}
    	$params='<br />Params: '.implode(', ',$p);
Exemple #13
0
    static function forumNew()
    {
        // Select by id, prints replies and new threads
        global $DB, $Misc;
        $tabl = $DB->sql_tabl("\r\n\t\t\tSELECT m.id as postID, t.id as threadID, m.type, m.timeSent, IF(t.replies IS NULL,m.replies,t.replies) as replies,\r\n\t\t\t\tIF(t.subject IS NULL,m.subject,t.subject) as subject,\r\n\t\t\t\tu.id as userID, u.username, u.points, IF(s.userID IS NULL,0,1) as online, u.type as userType,\r\n\t\t\t\tSUBSTRING(m.message,1,100) as message, m.latestReplySent, t.fromUserID as threadStarterUserID\r\n\t\t\tFROM wD_ForumMessages m\r\n\t\t\tINNER JOIN wD_Users u ON ( m.fromUserID = u.id )\r\n\t\t\tLEFT JOIN wD_Sessions s ON ( m.fromUserID = s.userID )\r\n\t\t\tLEFT JOIN wD_ForumMessages t ON ( m.toID = t.id AND t.type = 'ThreadStart' AND m.type = 'ThreadReply' )\r\n\t\t\tORDER BY m.timeSent DESC\r\n\t\t\tLIMIT 50");
        $oldThreads = 0;
        $threadCount = 0;
        $threadIDs = array();
        $threads = array();
        while (list($postID, $threadID, $type, $timeSent, $replies, $subject, $userID, $username, $points, $online, $userType, $message, $latestReplySent, $threadStarterUserID) = $DB->tabl_row($tabl)) {
            $threadCount++;
            if ($threadID) {
                $iconMessage = libHTML::forumMessage($threadID, $postID);
            } else {
                $iconMessage = libHTML::forumMessage($postID, $postID);
            }
            if ($type == 'ThreadStart') {
                $threadID = $postID;
            }
            if (!isset($threads[$threadID])) {
                if (strlen($subject) > 30) {
                    $subject = substr($subject, 0, 40) . '...';
                }
                $threadIDs[] = $threadID;
                $threads[$threadID] = array('subject' => $subject, 'replies' => $replies, 'posts' => array(), 'threadStarterUserID' => $threadStarterUserID);
            }
            $message = Message::refilterHTML($message);
            if (strlen($message) >= 50) {
                $message = substr($message, 0, 50) . '...';
            }
            $message = '<div class="message-contents threadID' . $threadID . '" fromUserID="' . $userID . '">' . $message . '</div>';
            $threads[$threadID]['posts'][] = array('iconMessage' => $iconMessage, 'userID' => $userID, 'username' => $username, 'message' => $message, 'points' => $points, 'online' => $online, 'userType' => $userType, 'timeSent' => $timeSent);
        }
        $buf = '';
        $threadCount = 0;
        foreach ($threadIDs as $threadID) {
            $data = $threads[$threadID];
            $buf .= '<div class="hr userID' . $threads[$threadID]['threadStarterUserID'] . ' threadID' . $threadID . '"></div>';
            $buf .= '<div class="homeForumGroup homeForumAlt' . ($threadCount % 2 + 1) . ' userID' . $threads[$threadID]['threadStarterUserID'] . ' threadID' . $threadID . '">
				<div class="homeForumSubject homeForumTopBorder">' . libHTML::forumParticipated($threadID) . ' ' . $data['subject'] . '</div> ';
            if (count($data['posts']) < $data['replies']) {
                $buf .= '<div class="homeForumPost homeForumMessage homeForumPostAlt' . libHTML::alternate() . ' ">

				...</div>';
            }
            $data['posts'] = array_reverse($data['posts']);
            foreach ($data['posts'] as $post) {
                $buf .= '<div class="homeForumPost homeForumPostAlt' . libHTML::alternate() . ' userID' . $post['userID'] . '">


					<div class="homeForumPostTime">' . libTime::text($post['timeSent']) . ' ' . $post['iconMessage'] . '</div>
					<a href="profile.php?userID=' . $post['userID'] . '" class="light">' . $post['username'] . '</a>
						' . libHTML::loggedOn($post['userID']) . ' (' . $post['points'] . libHTML::points() . User::typeIcon($post['userType']) . ')

					<div style="clear:both"></div>
					<div class="homeForumMessage">' . $post['message'] . '</div>
					</div>';
            }
            $buf .= '<div class="homeForumLink">
					<div class="homeForumReplies">' . l_t('%s replies', '<strong>' . $data['replies'] . '</strong>') . '</div>
					<a href="forum.php?threadID=' . $threadID . '#' . $threadID . '">' . l_t('Open') . '</a>
					</div>
					</div>';
        }
        if ($buf) {
            return $buf;
        } else {
            return '<div class="homeNoActivity">' . l_t('No forum posts found, why not ' . '<a href="forum.php?postboxopen=1#postbox" class="light">start one</a>?');
        }
    }
Exemple #14
0
 $replyNumber++;
 print '<a name="' . $reply['id'] . '"></a>';
 if ($new['id'] == $reply['id']) {
     print '<a name="postbox"></a>';
     $messageAnchor = '';
 } elseif ($User->timeLastSessionEnded < $reply['timeSent']) {
     print $messageAnchor;
     $messageAnchor = '';
 } elseif ($reply['id'] == $maxReplyID) {
     print $messageAnchor;
     $messageAnchor = '';
 }
 print '<div class="message-head replyalternate' . $replyswitch . ' leftRule">';
 print '<strong><a href="profile.php?userID=' . $reply['fromUserID'] . '">' . $reply['fromusername'] . ' ' . libHTML::loggedOn($reply['fromUserID']) . ' (' . $reply['points'] . ' ' . libHTML::points() . User::typeIcon($reply['userType']) . ')</a>' . '</strong><br />';
 print libHTML::forumMessage($message['id'], $reply['id']);
 print '<em>' . libTime::text($reply['timeSent']) . '</em>';
 print '<br />' . $User->likeMessageToggleLink($reply['id'], $reply['fromUserID']) . libHTML::likeCount($reply['likeCount']);
 if ($User->type['Admin'] || $User->type['ForumModerator']) {
     if (Silence::isSilenced($reply)) {
         $silence = new Silence($reply);
     } else {
         unset($silence);
     }
     print '<br />';
     if (isset($silence) && $silence->isEnabled()) {
         print '<a class="light likeMessageToggleLink" href="admincp.php?tab=Control%20Panel&amp;silenceID=' . $silence->id . '#disableSilence">' . l_t('Disable silence') . '</a>';
     } else {
         print '<a class="light likeMessageToggleLink" href="admincp.php?tab=Control%20Panel&amp;postID=' . $reply['id'] . '&amp;userID=' . $reply['fromUserID'] . '#createUserThreadSilence">' . l_t('Silence user') . '</a>';
     }
 }
 print '</div>';
Exemple #15
0
 /**
  * The next-process data, depending on whether paused/crashed/finished/etc
  *
  * @return string
  */
 function gameTimeRemaining()
 {
     if ($this->phase == 'Finished') {
         return '<span class="gameTimeRemainingNextPhase">' . l_t('Finished:') . '</span> ' . libTime::text($this->processTime);
     }
     if ($this->processStatus == 'Paused') {
         return $this->pausedInfo();
     } elseif ($this->processStatus == 'Crashed') {
         return l_t('Crashed');
     }
     if (!isset($timerCount)) {
         static $timerCount = 0;
     }
     $timerCount++;
     if ($this->phase == 'Pre-game') {
         $buf = '<span class="gameTimeRemainingNextPhase">' . l_t('Start:') . '</span> ' . $this->processTimetxt() . ' (' . libTime::text($this->processTime) . ')';
     } else {
         $buf = '<span class="gameTimeRemainingNextPhase">' . l_t('Next:') . '</span> ' . $this->processTimetxt() . ' (' . libTime::text($this->processTime) . ')';
         //if ( $this->Members->isJoined() )
         //$buf .= ' <span class="gameTimeRemainingFixed">('.libTime::text($this->processTime).')</span>';
     }
     return $buf;
 }
Exemple #16
0
 /**
  * The time this user joined
  * @return string Date joined
  */
 function timeJoinedtxt()
 {
     return libTime::text($this->timeJoined);
 }
Exemple #17
0
 public function toString()
 {
     $Moderator = new User($this->moderatorUserID);
     $startTime = libTime::text($this->startTime);
     $endTime = $this->length == 0 ? l_t("Indefinite") : libTime::text($this->startTime + $this->length * 60 * 60 * 24);
     $silenceData = array('Status' => '<b>' . ($this->enabled ? $this->isExpired() ? l_t('Ended') : l_t('Active') : l_t('Disabled')) . '</b>', 'Mod' => $Moderator->profile_link(), 'Started' => $startTime, 'Ends' => $endTime, 'Reason' => $this->reason);
     if ($this->userID) {
         $SilencedUser = new User($this->userID);
         $silenceData['User'] = $SilencedUser->profile_link();
     }
     if ($this->postID) {
         $silenceData['Thread'] = libHTML::threadLink($this->postID);
     }
     $strArr = array('<ul class="formlist"><li>');
     foreach ($silenceData as $k => $v) {
         $strArr[] = l_t($k) . ": <i>" . $v . "</i>";
     }
     $strArr[] = '</li></ul>';
     return implode("</li><li>", $strArr);
 }