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


PHP get_elapsed_time函数代码示例

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


在下文中一共展示了get_elapsed_time函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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}&amp;catorder=category\" class=colheadlink>Category</a></td>\r\n\t<td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&amp;catorder=lastul\" class=colheadlink>Last Upload</a></td>\r\n\t<td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&amp;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}&amp;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 = "&infin;";
    }
    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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;do=pm&amp;action=edit&amp;what=quote&amp;uid=" . $uid . "&amp;id=" . $id . "'";
                    $pmreadtpl["answer_link"] = "location.href='index.php?page=usercp&amp;do=pm&amp;action=edit&amp;uid=" . $uid . "&amp;id=" . $id . "'";
                    $pmreadtpl["delete_link"] = "location.href='index.php?page=usercp&amp;do=pm&amp;action=delete&amp;uid=" . $uid . "&amp;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


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