本文整理汇总了PHP中get_elapsed_time函数的典型用法代码示例。如果您正苦于以下问题:PHP get_elapsed_time函数的具体用法?PHP get_elapsed_time怎么用?PHP get_elapsed_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_elapsed_time函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: usertable
function usertable($res, $frame_caption)
{
global $CURUSER;
begin_frame($frame_caption, true);
begin_table();
?>
<tr>
<td class=colhead>Место</td>
<td class=colhead align=left>Пользователь</td>
<td class=colhead>Раздач</td>
<td class=colhead align=left>Скорость раздачи</td>
<td class=colhead>Закачал</td>
<td class=colhead align=left>Скорость закачки</td>
<td class=colhead align=right>Рейтинг</td>
<td class=colhead align=left>Зарегистрирован</td>
</tr>
<?php
$num = 0;
while ($a = mysql_fetch_assoc($res)) {
++$num;
$highlight = $CURUSER["id"] == $a["userid"] ? " bgcolor=#BBAF9B" : "";
if ($a["downloaded"]) {
$ratio = $a["uploaded"] / $a["downloaded"];
$color = get_ratio_color($ratio);
$ratio = number_format($ratio, 2);
if ($color) {
$ratio = "<font color={$color}>{$ratio}</font>";
}
} else {
$ratio = "Inf.";
}
print "<tr{$highlight}><td align=center>{$num}</td><td align=left{$highlight}><a href=userdetails.php?id=" . $a["userid"] . "><b>" . $a["username"] . "</b>" . "</td><td align=right{$highlight}>" . mksize($a["uploaded"]) . "</td><td align=right{$highlight}>" . mksize($a["upspeed"]) . "/s" . "</td><td align=right{$highlight}>" . mksize($a["downloaded"]) . "</td><td align=right{$highlight}>" . mksize($a["downspeed"]) . "/s" . "</td><td align=right{$highlight}>" . $ratio . "</td><td align=left>" . date("Y-m-d", strtotime($a["added"])) . " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($a["added"])) . " назад)</td></tr>";
}
end_table();
end_frame();
}
开发者ID:klldll,项目名称:tbdev,代码行数:37,代码来源:topten.php
示例2: stdmsg
}
if ($n_tor == 0) {
stdmsg("Sorry...", "No categories defined!");
} else {
if ($catorder == "lastul") {
$orderby = "last DESC, c.name";
} elseif ($catorder == "torrents") {
$orderby = "n_t DESC, c.name";
} elseif ($catorder == "peers") {
$orderby = "n_p DESC, name";
} else {
$orderby = "c.name";
}
$res = mysql_query("SELECT c.name, MAX(t.added) AS last, COUNT(DISTINCT t.id) AS n_t, COUNT(p.id) AS n_p\r\n\tFROM categories as c LEFT JOIN torrents as t ON t.category = c.id LEFT JOIN peers as p\r\n\tON t.id = p.torrent GROUP BY c.id ORDER BY {$orderby}") or sqlerr(__FILE__, __LINE__);
begin_frame("Category Activity", true);
begin_table();
print "<tr><td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&catorder=category\" class=colheadlink>Category</a></td>\r\n\t<td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&catorder=lastul\" class=colheadlink>Last Upload</a></td>\r\n\t<td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&catorder=torrents\" class=colheadlink>Torrents</a></td>\r\n\t<td class=colhead>Perc.</td>\r\n\t<td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&catorder=peers\" class=colheadlink>Peers</a></td>\r\n\t<td class=colhead>Perc.</td></tr>\n";
while ($cat = mysql_fetch_assoc($res)) {
print "<tr><td class=rowhead>" . $cat['name'] . "</b></a></td>";
print "<td " . ($cat['last'] ? ">" . $cat['last'] . " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($cat['last'])) . " ago)" : "align = center>---") . "</td>";
print "<td align=right>" . $cat['n_t'] . "</td>";
print "<td align=right>" . number_format(100 * $cat['n_t'] / $n_tor, 1) . "%</td>";
print "<td align=right>" . $cat['n_p'] . "</td>";
print "<td align=right>" . ($n_peers > 0 ? number_format(100 * $cat['n_p'] / $n_peers, 1) . "%" : "---") . "</td>\n";
}
end_table();
end_frame();
}
end_main_frame();
stdfoot();
die;
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:stats.php
示例3: while
print "<td align='center' class='header'>" . UPLOADED . "</td>\n";
print "<td align='center' class='header'>" . RATIO . "</td>\n";
print "<td align='center' class='header'>" . FINISHED . "</td></tr>\n";
while ($row = $res->fetch_array(MYSQLI_BOTH)) {
print "<tr><td align='center' class='lista'>" . "<a href='userdetails.php?id=" . (int) $row["uid"] . "'>" . security::html_safe(unesc($row["username"])) . "</a></td>" . "<td align='center' class='lista'><a href='usercp.php?do=pm&action=edit&uid=" . user::$current['uid'] . "&what=new&to=" . urlencode(unesc($row["username"])) . "'>" . image_or_link($STYLEPATH . "/pm.png", "", "PM") . "</a></td>";
if ($row["flagpic"] != "") {
print "<td align='center' class='lista'><img src='images/flag/" . $row["flagpic"] . "' alt='" . security::html_safe($row["country"]) . "' /></td>";
} else {
print "<td align='center' class='lista'><img src='images/flag/unknown.gif' alt='" . UNKNOWN . "' /></td>";
}
print "<td align='center' class='lista'>" . $row["active"] . "</td>";
print "<td align='center' class='lista'>" . security::html_safe($row["agent"]) . "</td>";
$dled = misc::makesize((int) $row["downloaded"]);
$upld = misc::makesize((int) $row["uploaded"]);
print "<td align='center' class='lista'>" . $dled . "</td>";
print "<td align='center' class='lista'>" . $upld . "</td>";
if (intval($row["downloaded"]) > 0) {
$ratio = number_format((int) $row["uploaded"] / (int) $row["downloaded"], 2);
} else {
$ratio = "∞";
}
print "<td align='center' class='lista'>" . $ratio . "</td>";
print "<td align='center' class='lista'>" . get_elapsed_time($row["date"]) . " ago</td></tr>";
}
if ($res->num_rows == 0) {
print "<tr><td align='center' colspan='9' class='lista'>No history to display</td></tr>";
}
print "</table>";
print "</div><br /><br /><center><a href='javascript: history.go(-1);'>" . BACK . "</a>";
block_end();
stdfoot();
开发者ID:Q8HMA,项目名称:BtiTracker-1.5.1,代码行数:31,代码来源:torrent_history.php
示例4: floor
// $res2 = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}files WHERE info_hash='".$data["hash"]."'");
// $added = mysql_fetch_array($res2);
$vz = $data['added'];
//sql_timestamp_to_unix_timestamp($data["data"]);
$timer = floor((time() - $vz) / 3600);
if ($ratio < 1.0 && $CURUSER['uid'] != $data["uploader"]) {
$wait = $CURUSER["WT"];
}
$wait -= $timer;
if ($wait <= 0) {
$wait = 0;
}
echo "\n\t<td align=\"center\" width=\"20\" class=\"lista\" style=\"text-align: center;\">" . $wait . " h</td>";
}
//end waitingtime
echo "\n\t<td nowrap=\"nowrap\" class=\"lista\" align=\"center\" width=\"85\" style=\"text-align: center;\">" . get_elapsed_time($data["added"]) . " ago</td>";
echo "\n\t<td nowrap=\"nowrap\" class=\"lista\" align=\"center\" width=\"60\" style=\"text-align: center;\">" . makesize($data["size"]) . "</td>";
if ($data["external"] == "no") {
if ($GLOBALS["usepopup"]) {
echo "\n\t<td align=\"center\" class=\"lista\"" . linkcolor($data["seeds"]) . "\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"javascript:poppeer('index.php?page=peers&id=" . $data["hash"] . "');\" title=\"" . $language["PEERS_DETAILS"] . "\">" . $data["seeds"] . "</a></td>\n";
echo "\n\t<td align=\"center\" class=\"lista\"" . linkcolor($data["leechers"]) . "\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"javascript:poppeer('index.php?page=peers&id=" . $data["hash"] . "');\" title=\"" . $language["PEERS_DETAILS"] . "\">" . $data["leechers"] . "</a></td>\n";
if ($data["finished"] > 0) {
echo "\n\t<td align=\"center\" class=\"lista\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"javascript:poppeer('index.php?page=torrent_history&id=" . $data["hash"] . "');\" title=\"History - " . $data["filename"] . "\">" . $data["finished"] . "</a></td>";
} else {
echo "\n\t<td align=\"center\" class=\"lista\" style=\"text-align: center;\">---</td>";
}
} else {
echo "\n\t<td align=\"center\" class=\"lista\"" . linkcolor($data["seeds"]) . "\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"index.php?page=peers&id=" . $data["hash"] . "\" title=\"" . $language["PEERS_DETAILS"] . "\">" . $data["seeds"] . "</a></td>\n";
echo "\n\t<td align=\"center\" class=\"lista\"" . linkcolor($data["leechers"]) . "\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"index.php?page=peers&id=" . $data["hash"] . "\" title=\"" . $language["PEERS_DETAILS"] . "\">" . $data["leechers"] . "</a></td>\n";
if ($data["finished"] > 0) {
echo "\n\t<td align=\"center\" class=\"lista\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"index.php?page=torrent_history&id=" . $data["hash"] . "\" title=\"History - " . $data["filename"] . "\">" . $data["finished"] . "</a></td>";
开发者ID:fchypzero,项目名称:cybyd,代码行数:31,代码来源:lasttorrents_block.php
示例5: sql_query
$topicname = $arr["subject"];
$forumid = $arr["f_id"];
$forumname = $arr["name"];
$newposts = $arr["lastpostread"] < $arr["lastpost"] && $CURUSER["id"] == $userid;
$order_is = "p.id DESC";
$from_is = "posts AS p LEFT JOIN topics as t ON p.topicid = t.id LEFT JOIN forums AS f ON t.forumid = f.id";
$select_is = "t.id, p.*";
$where_is = "t.id = {$topicid} AND f.minclassread <= " . $CURUSER['class'];
$queryposts = "SELECT {$select_is} FROM {$from_is} WHERE {$where_is} ORDER BY {$order_is} {$limit}";
$res2 = sql_query($queryposts) or sqlerr(__FILE__, __LINE__);
$arr2 = mysql_fetch_assoc($res2);
$postid = $arr2["id"];
$posterid = $arr2["userid"];
$queryuser = sql_query("SELECT username FROM users WHERE id={$arr2['userid']}");
$res3 = mysql_fetch_assoc($queryuser);
$added = $arr2["added"] . " GMT (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr2["added"])) . " ago)";
?>
<STYLE TYPE="text/css" MEDIA=screen>
td.clearalt6 {
background: #777777;
padding: 5px;
border: 0px;
border: hidden;
}
td.clearalt7 {
padding: 5px;
background: #555555;
border: 0px;
border: hidden;
}
</STYLE>
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:subscriptions.php
示例6: mysql_result
} else {
$star = "";
}
// get warned
if ($warned == "yes") {
$klicaj = "<img src=pic/warned8.gif>";
} else {
$klicaj = "";
}
$counter = $i + 1;
echo "<tr>";
echo "<td align=center>{$counter}.</td>";
echo "<td><a href=/userdetails.php?id={$id}>{$username}</a> {$star} {$klicaj}</td>";
echo "<td>{$uploaded} / {$downloaded}</td>";
echo "<td>{$ratio}</td>";
echo "<td>{$numtorrents} torrents</td>";
if ($numtorrents > 0) {
$lastadded = mysql_result($upperresult, $numtorrents - 1, "added");
echo "<td>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($lastadded)) . " ago (" . gmdate("d. M Y", strtotime($lastadded)) . ")</td>";
} else {
echo "<td>---</td>";
}
echo "<td align=center><a href=sendmessage.php?receiver={$id}><img src=pic/pm.gif></a></td>";
echo "</tr>";
}
echo "</table>";
}
} else {
echo "Not permitted.";
}
stdfoot();
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:uploaders.php
示例7: intval
$id = intval($_GET["id"]);
if ($what == "inbox") {
$res = do_sqlquery("select m.*, IF(m.sender=0,'System',u.username) as sendername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.sender WHERE receiver={$uid} AND m.id={$id}", true);
} elseif ($what == "outbox") {
$res = do_sqlquery("select m.*, IF(m.receiver=0,'System',u.username) as sendername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.receiver WHERE sender={$uid} AND m.id={$id}", true);
}
if (mysql_num_rows($res) == "0") {
err_msg($language["ERROR"], $language["BAD_ID"]);
stdfoot();
exit;
} else {
$result = mysql_fetch_array($res);
$pmreadtpl = array();
$pmreadtpl["sender_link"] = "index.php?page=userdetails&id=" . $result["sender"] . "";
$pmreadtpl["sender_name"] = unesc($result["sendername"]);
$pmreadtpl["added"] = get_date_time($result["added"]);
$pmreadtpl["elapsed"] = get_elapsed_time($result["added"]);
$pmreadtpl["comment"] = format_comment(unesc($result["subject"]));
$pmreadtpl["body"] = format_comment(unesc($result["msg"]));
if ($what == "inbox") {
$usercptpl->set("MSG_MENU", true, true);
$pmreadtpl["quote_link"] = "location.href='index.php?page=usercp&do=pm&action=edit&what=quote&uid=" . $uid . "&id=" . $id . "'";
$pmreadtpl["answer_link"] = "location.href='index.php?page=usercp&do=pm&action=edit&uid=" . $uid . "&id=" . $id . "'";
$pmreadtpl["delete_link"] = "location.href='index.php?page=usercp&do=pm&action=delete&uid=" . $uid . "&id=" . $id . "'";
do_sqlquery("UPDATE {$TABLE_PREFIX}messages SET readed='yes' WHERE id={$id}", true);
}
$usercptpl->set("pmread", $pmreadtpl);
}
}
break;
}
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:31,代码来源:usercp.pmbox.php
示例8: while
//echo $pagertop;
if (mysql_num_rows($res) == 0) {
$votesviewtpl->set("vv2", "<p align=center><b>Nothing Found</b></p>\n");
} else {
$votesviewtpl->set("vv3", "<center><table width=99% class=lista align=center cellpadding=3>\n");
$votesviewtpl->set("vv4", "<tr><td class=header>Username</td><td class=header>Uploaded</td><td class=header>Downloaded</td>" . "<td class=header>Ratio</td>\n");
while ($arr = mysql_fetch_assoc($res)) {
if ($arr["downloaded"] > 0) {
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
//$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
} else {
if ($arr["uploaded"] > 0) {
$ratio = "Inf.";
} else {
$ratio = "---";
}
}
$uploaded = makesize($arr["uploaded"]);
$joindate = "{$arr['added']} (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"])) . " ago)";
$downloaded = makesize($arr["downloaded"]);
if ($arr["enabled"] == 'no') {
$enabled = "<font color = red>No</font>";
} else {
$enabled = "<font color = green>Yes</font>";
}
$req[$i]["vv5"] = "<tr><td class=lista><center><a href=index.php?page=userdetails&id={$arr['userid']}><b>{$arr['username']}</b></a></td><td align=left class=lista><center>{$uploaded}</td><td align=left class=lista><center>{$downloaded}</td><td align=left class=lista><center>{$ratio}</td></tr>\n";
$i++;
}
$votesviewtpl->set("req", $req);
$votesviewtpl->set("vv6", "</table></center><BR><BR>\n");
}
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:31,代码来源:votesview.php
示例9: trigger_notify
$template->set_filenames(array('tail' => 'footer.tpl'));
trigger_notify('loc_begin_page_tail');
$template->assign(array('VERSION' => $conf['show_version'] ? PHPWG_VERSION : '', 'PHPWG_URL' => defined('PHPWG_URL') ? PHPWG_URL : ''));
//--------------------------------------------------------------------- contact
if (!is_a_guest()) {
$template->assign('CONTACT_MAIL', get_webmaster_mail_address());
}
//------------------------------------------------------------- generation time
$debug_vars = array();
if ($conf['show_queries']) {
$debug_vars = array_merge($debug_vars, array('QUERIES_LIST' => $debug));
}
if ($conf['show_gt']) {
if (!isset($page['count_queries'])) {
$page['count_queries'] = 0;
$page['queries_time'] = 0;
}
$time = get_elapsed_time($t2, get_moment());
$debug_vars = array_merge($debug_vars, array('TIME' => $time, 'NB_QUERIES' => $page['count_queries'], 'SQL_TIME' => number_format($page['queries_time'], 3, '.', ' ') . ' s'));
}
$template->assign('debug', $debug_vars);
//------------------------------------------------------------- mobile version
if (!empty($conf['mobile_theme']) && (get_device() != 'desktop' || mobile_theme())) {
$template->assign('TOGGLE_MOBILE_THEME_URL', add_url_params(htmlspecialchars($_SERVER['REQUEST_URI']), array('mobile' => mobile_theme() ? 'false' : 'true')));
}
trigger_notify('loc_end_page_tail');
//
// Generate the page
//
$template->parse('tail');
$template->p();
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:page_tail.php
示例10: get_elapsed_time
</a><?php
} else {
?>
<b>unknown[<?php
echo $posterid;
?>
]</b><?php
}
?>
</td><?php
?>
<td nowrap="nowrap"><?php
echo $getdaily['added'];
?>
<br /><?php
echo get_elapsed_time(strtotime($getdaily['added']));
?>
</td><?php
?>
</tr><?php
}
mysql_free_result($res);
end_table();
echo "<p>{$pagerbottom}</p>";
end_main_frame();
stdfoot();
} else {
if ($action == "search") {
$maxresults = 50;
$cats = genreforumlist();
stdhead("Forum Search");
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:forums.php
示例11: mkprettytime
print "<td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_until'] . $warneduntil;
print "<br />(" . mkprettytime(strtotime($warneduntil) - strtotime(date("Y-m-d H:i:s"))) . $lang_userdetails['text_to_go'] . ")</td>\n";
}
print "</tr>";
} else {
print "<td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_warn_for'] . "<select name=\"warnlength\">\n";
print "<option value=\"0\">------</option>\n";
print "<option value=\"1\">1 " . $lang_userdetails['text_week'] . "</option>\n";
print "<option value=\"2\">2 " . $lang_userdetails['text_weeks'] . "</option>\n";
print "<option value=\"4\">4 " . $lang_userdetails['text_weeks'] . "</option>\n";
print "<option value=\"8\">8 " . $lang_userdetails['text_weeks'] . "</option>\n";
print "<option value=\"255\">" . $lang_userdetails['text_unlimited'] . "</option>\n";
print "</select></td></tr>\n";
print "<tr><td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_reason_of_warning'] . "</td><td align=\"left\" class=\"rowfollow\"><input type=\"text\" size=\"60\" name=\"warnpm\" /></td></tr>";
}
$elapsedlw = get_elapsed_time(strtotime($user["lastwarned"]));
print "<tr><td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_times_warned'] . "</td><td align=\"left\" class=\"rowfollow\">" . $user[timeswarned] . "</td></tr>\n";
if ($user["timeswarned"] == 0) {
print "<tr><td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_last_warning'] . "</td><td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_not_warned_note'] . "</td></tr>\n";
} else {
if ($user["warnedby"] != "System") {
$res = sql_query("SELECT id, username, warnedby FROM users WHERE id = " . $user['warnedby'] . "") or sqlerr(__FILE__, __LINE__);
$arr = mysql_fetch_assoc($res);
$warnedby = "<br />[" . $lang_userdetails['text_by'] . "<u>" . get_username($arr['id']) . "</u></a>]";
} else {
$warnedby = "<br />[" . $lang_userdetails['text_by_system'] . "]";
print "<tr><td class=\"rowfollow\">" . $lang_userdetails['text_last_warning'] . "</td><td align=\"left\" class=\"rowfollow\"> {$user['lastwarned']} .(" . $lang_userdetails['text_until'] . "{$elapsedlw}) {$warnedby}</td></tr>\n";
}
print "<tr><td class=\"rowfollow\">" . $lang_userdetails['text_last_warning'] . "</td><td align=\"left\" class=\"rowfollow\"> {$user['lastwarned']} ({$elapsedlw}" . $lang_userdetails['text_ago'] . ") " . $warnedby . "</td></tr>\n";
}
$leechwarn = $user["leechwarn"] == "yes";
开发者ID:CptTZ,项目名称:NexusPHP,代码行数:31,代码来源:userdetails.php
示例12: begin_frame
print "<a name='top' />\n";
//------ Print table
begin_frame();
$pc = $res->num_rows;
$pn = 0;
$r = $db->query("SELECT lastpostread FROM readposts WHERE userid = " . user::$current["uid"] . " AND topicid = " . $topicid) or sqlerr(__FILE__, __LINE__);
$a = $r->fetch_row();
$lpr = (int) $a[0];
if (!$lpr) {
$db->query("INSERT INTO readposts (userid, topicid) VALUES(" . $userid . ", " . $topicid . ")") or sqlerr(__FILE__, __LINE__);
}
while ($arr = $res->fetch_assoc()) {
++$pn;
$postid = (int) $arr["id"];
$posterid = (int) $arr["userid"];
$added = get_date_time($arr["added"]) . "<br />(" . get_elapsed_time($arr["added"]) . " ago)";
//---- Get poster details
$arr2 = MCached::get('forum::poster::details::' . $posterid);
if ($arr2 === MCached::NO_RESULT) {
$res2 = $db->query("SELECT username, level, avatar, uploaded, downloaded, name, flagpic FROM users INNER JOIN users_level ON users.id_level = users_level.id LEFT JOIN countries ON users.flag = countries.id WHERE users.id = " . $posterid) or sqlerr(__FILE__, __LINE__);
$arr2 = $res2->fetch_assoc();
MCached::add('forum::poster::details::' . $posterid, $arr2, 1800);
}
$postername = security::html_safe($arr2["username"]);
if ($postername == "") {
$by = "Guest";
$avatar = "";
} else {
$avatar = $arr2["avatar"] && $arr2["avatar"] != "" ? security::html_safe($arr2["avatar"]) : "";
$title = security::html_safe($arr2["level"]);
$flag = security::html_safe($arr2['name']);
开发者ID:Q8HMA,项目名称:BtiTracker-1.5.1,代码行数:31,代码来源:forum.php
示例13: p
/**
* Same as flush() but with optional debugging.
* @see Template::flush()
*/
function p()
{
$this->flush();
if ($this->smarty->debugging) {
global $t2;
$this->smarty->assign(array('AAAA_DEBUG_TOTAL_TIME__' => get_elapsed_time($t2, get_moment())));
Smarty_Internal_Debug::display_debug($this->smarty);
}
}
开发者ID:squidjam,项目名称:Piwigo,代码行数:13,代码来源:template.class.php
示例14: unset
echo '<pre>';
for ($upgrade_id = 140; $upgrade_id <= 144; $upgrade_id++) {
if (!file_exists(UPGRADES_PATH . '/' . $upgrade_id . '-database.php')) {
continue;
}
// maybe the upgrade task has already been applied in a previous and
// incomplete upgrade
if (in_array($upgrade_id, $applied)) {
continue;
}
unset($upgrade_description);
echo "\n\n";
echo '=== upgrade ' . $upgrade_id . "\n";
// include & execute upgrade script. Each upgrade script must contain
// $upgrade_description variable which describe briefly what the upgrade
// script does.
$up_start = get_moment();
include UPGRADES_PATH . '/' . $upgrade_id . '-database.php';
// notify upgrade (TODO change on each release)
$query = '
INSERT INTO `' . PREFIX_TABLE . 'upgrade`
(id, applied, description)
VALUES
(\'' . $upgrade_id . '\', NOW(), \'[migration from 2.6.0 to ' . PHPWG_VERSION . ', ' . get_elapsed_time($up_start, get_moment()) . '] ' . $upgrade_description . '\')
;';
pwg_query($query);
}
echo '</pre>';
ob_end_clean();
// now we upgrade from 2.7.0
// include_once(PHPWG_ROOT_PATH.'install/upgrade_2.7.0.php');
开发者ID:squidjam,项目名称:Piwigo,代码行数:31,代码来源:upgrade_2.6.0.php
示例15: mysqli_result
$uid = mysqli_result($result, $i, "uid");
$res2 = do_sqlquery("SELECT username,id_level from {$TABLE_PREFIX}users WHERE id={$uid}");
$result2 = mysqli_fetch_array($res2);
$reputt = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}users_level WHERE id_level =" . $result2['id_level']);
$setrept = mysqli_fetch_array($reputt);
$name = stripslashes($setrept[prefixcolor]) . $result2[username] . stripslashes($setrept[suffixcolor]);
$date = mysqli_result($result, $i, "date");
$hash_info = mysqli_result($result, $i, "info_hash");
$res3 = do_sqlquery("SELECT filename,external from {$TABLE_PREFIX}files WHERE info_hash='" . $hash_info . "'");
$result3 = mysqli_fetch_array($res3);
$fname = $result3["filename"];
if ($result3["external"] == 'yes') {
$fname = "{$fname} <font color =red>(EXT)</font>";
}
$damn = sql_timestamp_to_unix_timestamp($date);
$pretty1 = get_elapsed_time($damn);
$pos = strpos($pretty1, ",");
$pretty = substr($pretty1, 0, $pos);
$pretty = $pretty1;
$weeks = "week";
$rep = "w";
if (strpos($pretty, "week") == true) {
$prettynew = str_replace($weeks, $rep, $pretty);
}
if (strpos($pretty, "day") == true) {
$prettynew = str_replace("day", "d", $pretty);
}
if (strpos($pretty, "hour") == true) {
$prettynew = str_replace("hour", "h", $pretty);
}
if (strpos($pretty, "min") == true) {
开发者ID:Karpec,项目名称:gizd,代码行数:31,代码来源:last_block.php
示例16: stdhead
</form>
</div></td></tr></table>
<br>
NOTE: No HTML Code Allowed. (NO HTML)
<?
}
if ($_GET['action'] == ""){
stdhead("Unconnectable Peers Mass PM Log");
$getlog = mysql_query("SELECT * FROM `notconnectablepmlog` LIMIT 10");
print("<h1>Unconnectable Peers Mass PM Log</h1>");
print("<a href=findnotconnectable.php?action=sendpm><h3>Send All not connectable Users A PM</h3></a>");
print("<a href=findnotconnectable.php?action=list><h3>List Unconnectable Users</h3></a>");
print("<br>Please dont use the mass PM too often. we dont want to spam the users, just let them know they are unconnectable.<p>");
print("<br>Every week would be ok.<p>");
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<tr><td class=colhead>By User</td><td class=colhead>Date</td><td class=colhead>elapsed</td></tr>");
while($arr2 = mysql_fetch_assoc($getlog)){
$r2 = mysql_query("SELECT username FROM users WHERE id=$arr2[user]") or sqlerr();
$a2 = mysql_fetch_assoc($r2);
$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr2[date]));
print("<tr><td class=colhead><a href=userdetails.php?id=$arr2[user]>$a2[username]</a></td><td class=colhead>$arr2[date]</td><td>$elapsed ago</td></tr>");
}
print("</table>");
}
stdfoot();
?>
开发者ID:herrag33k,项目名称:TomTorrent,代码行数:30,代码来源:findnotconnectable.php
示例17: get_username
}
if ($arr["userid"]) {
$username = get_username($arr["userid"],false,true,true,true,false,false,"",true);
$arr2 = get_user_row($arr["userid"]);
if ($_GET["type"] != 'helpbox' && $arr["type"] == 'hb')
$username .= $lang_shoutbox['text_to_guest'];
}
else{
$school = strpos($arr["ip"],':')?school_ip_location($arr["ip"],false):'';
$userip = str_replace(':','',$arr['ip']);
$guestid = substr($userip,strlen($userip) - 8);
$username = "<b title='".$school."'>游客".$guestid."</b>";
$arr2["username"] = "游客".$guestid;
}
if ($CURUSER['timetype'] != 'timealive')
$time = strftime("%m.%d %H:%M",$arr["date"]);
else $time = get_elapsed_time($arr["date"]).$lang_shoutbox['text_ago'];
$messtext = $arr["text"];
$messtext = str_replace("[@".$CURUSER['username']."]","[color=Red][b]@".$CURUSER['username']."[/b][/color]",$messtext); //将回复给自己的名字染红
print("<tr><td class=\"shoutrow\"><span class='date'>[".$time."]</span> ".
$del ." <span onclick=\"retuser('".$arr2["username"]."');\" style=\"cursor:pointer;\">[@]</span> ". $username." " . format_comment($messtext,1,true,true,600,true,false)."
</td></tr>\n");
$i++;
}
print("</table>");
}
?>
</body>
</html>
开发者ID:NullYing,项目名称:mtpt,代码行数:30,代码来源:shoutbox.php
示例18: srt
print "<h1>Previous polls</h1>";
function srt($a, $b)
{
if ($a[0] > $b[0]) {
return -1;
}
if ($a[0] < $b[0]) {
return 1;
}
return 0;
}
while ($poll = mysql_fetch_assoc($polls)) {
$o = array($poll["option0"], $poll["option1"], $poll["option2"], $poll["option3"], $poll["option4"], $poll["option5"], $poll["option6"], $poll["option7"], $poll["option8"], $poll["option9"], $poll["option10"], $poll["option11"], $poll["option12"], $poll["option13"], $poll["option14"], $poll["option15"], $poll["option16"], $poll["option17"], $poll["option18"], $poll["option19"]);
print "<p><table width=750 border=1 cellspacing=0 cellpadding=10><tr><td align=center>\n";
print "<p class=sub>";
$added = gmdate("Y-m-d", strtotime($poll['added'])) . " GMT (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($poll["added"])) . " ago)";
print "{$added}";
if (get_user_class() >= UC_ADMINISTRATOR) {
print " - [<a href=makepoll.php?action=edit&pollid={$poll['id']}><b>Edit</b></a>]\n";
print " - [<a href=?action=delete&pollid={$poll['id']}><b>Delete</b></a>]\n";
}
print "<a name={$poll['id']}>";
print "</p>\n";
print "<table class=main border=1 cellspacing=0 cellpadding=5><tr><td class=text>\n";
print "<p align=center><b>" . $poll["question"] . "</b></p>";
$pollanswers = mysql_query("SELECT selection FROM pollanswers WHERE pollid=" . $poll["id"] . " AND selection < 20") or sqlerr();
$tvotes = mysql_num_rows($pollanswers);
$vs = array();
// count for each option ([0]..[19])
$os = array();
// votes and options: array(array(123, "Option 1"), array(45, "Option 2"))
开发者ID:herrag33k,项目名称:TomTorrent,代码行数:31,代码来源:polls.php
示例19: print_time
/**
*/
function print_time($message)
{
global $last_time;
$new_time = get_moment();
echo '<pre>[' . get_elapsed_time($last_time, $new_time) . ']';
echo ' ' . $message;
echo '</pre>';
flush();
$last_time = $new_time;
}
开发者ID:RioP |
请发表评论