本文整理汇总了PHP中sql_timestamp_to_unix_timestamp函数的典型用法代码示例。如果您正苦于以下问题:PHP sql_timestamp_to_unix_timestamp函数的具体用法?PHP sql_timestamp_to_unix_timestamp怎么用?PHP sql_timestamp_to_unix_timestamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sql_timestamp_to_unix_timestamp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: maketable
function maketable($res)
{
global $tracker_lang, $use_ttl, $ttl_days;
$ret = "<table class=main border=1 cellspacing=0 cellpadding=5>" . "<tr><td class=colhead align=left>" . $tracker_lang['type'] . "</td><td class=colhead>" . $tracker_lang['name'] . "</td>" . ($use_ttl ? "<td class=colhead align=center>" . $tracker_lang['ttl'] . "</td>" : "") . "<td class=colhead align=center>" . $tracker_lang['size'] . "</td><td class=colhead align=right>" . $tracker_lang['details_seeding'] . "</td><td class=colhead align=right>" . $tracker_lang['details_leeching'] . "</td><td class=colhead align=center>" . $tracker_lang['uploaded'] . "</td>\n" . "<td class=colhead align=center>" . $tracker_lang['downloaded'] . "</td><td class=colhead align=center>" . $tracker_lang['ratio'] . "</td></tr>\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 = "---";
}
}
$catid = $arr["catid"];
$catimage = htmlspecialchars_uni($arr["image"]);
$catname = htmlspecialchars_uni($arr["catname"]);
$ttl = $ttl_days * 24 - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr["added"])) / 3600);
if ($ttl == 1) {
$ttl .= " час";
} else {
$ttl .= " часов";
}
$size = str_replace(" ", "<br />", mksize($arr["size"]));
$uploaded = str_replace(" ", "<br />", mksize($arr["uploaded"]));
$downloaded = str_replace(" ", "<br />", mksize($arr["downloaded"]));
$seeders = number_format($arr["seeders"]);
$leechers = number_format($arr["leechers"]);
$ret .= "<tr><td style='padding: 0px'><a href=\"browse.php?cat={$catid}\"><img src=\"pic/cats/{$catimage}\" alt=\"{$catname}\" border=\"0\" /></a></td>\n" . "<td><a href=details.php?id={$arr['torrent']}&hit=1><b>" . $arr["torrentname"] . "</b></a></td>" . ($use_ttl ? "<td align=center>{$ttl}</td>" : "") . "<td align=center>{$size}</td><td align=right>{$seeders}</td><td align=right>{$leechers}</td><td align=center>{$uploaded}</td>\n" . "<td align=center>{$downloaded}</td><td align=center>{$ratio}</td></tr>\n";
}
$ret .= "</table>\n";
return $ret;
}
示例2: maketable
function maketable($res)
{
global $cats;
if (!isset($cats))
{
$res2 = mysql_query("SELECT id, image, name FROM categories") or sqlerr(__FILE__, __LINE__);
while ($arr = mysql_fetch_assoc($res2))
{
$catimages[$arr["id"]] = $arr["image"];
$catnames[$arr["id"]] = $arr["name"];
}
}
$ret = '<table class=main border=1 cellspacing=0 cellpadding=5>' .
'<tr><td class="colhead" align="center">Tegund</td><td class="colhead">Nafn</td><td class="colhead" align="center">TTL</td><td class="colhead" align="center">Stærð</td><td class="colhead" align="center">Uppl.</td>'."\n" .
'<td class="colhead" align="center">Downl.</td><td class="colhead" align="center">Hlutfall</td><td class="colhead" align="center">IP-tala</td></tr>'."\n";
while ($arr = mysql_fetch_assoc($res))
{
$res2 = mysql_query("SELECT name,size,category,added FROM torrents WHERE id=$arr[torrent]");
$arr2 = mysql_fetch_assoc($res2);
if ($arr["downloaded"] > 0)
{
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2);
$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
}
else
if ($arr["uploaded"] > 0)
$ratio = "Inf.";
else
$ratio = "---";
$catimage = htmlspecialchars($catimages[$arr2["category"]]);
$catname = htmlspecialchars($catnames[$arr2["category"]]);
$ttl = (28*24) - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr2["added"])) / 3600);
if ($ttl == 1) $ttl .= "<br>klst";
$size = str_replace(" ", "<br>", mksize($arr2["size"]));
$uploaded = str_replace(" ", "<br>", mksize($arr["uploaded"]));
$downloaded = str_replace(" ", "<br>", mksize($arr["downloaded"]));
$ip = $arr['ip'];
$ret .= '<tr><td style="padding: 0px"><img src="pic/'.$catimage.'" alt="'.$catname.'" width="42" height="42"></td>'."\n" .
'<td><a href=details.php?id='.$arr[torrent].'&hit=1><b>';
if(!empty($arr2['name']))
$ret .= htmlspecialchars($arr2[name]);
else
$ret .= '[Ekkert nafn]';
$ret .= '</b></a></td><td align="center">'.$ttl.'</td><td align="center">'.$size.'</td><td align="center">'.$uploaded.'</td>'."\n" .
'<td align="center">'.$downloaded.'</td><td align="center">'.$ratio.'</td><td
align="center">'.$ip.'</td></tr>'."\n";
}
$ret .= "</table>\n";
return $ret;
}
示例3: 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();
}
示例4: safeChar
}
// End -->
</script>
<?php
print "<h2>" . safeChar($count) . " accounts inactive for longer than " . safeChar($days) . " days.</h2>";
print "<form action=\"inactive.php\" method=\"post\">";
print "<table class=main border=1 cellspacing=0 cellpadding=5><tr>\n";
print "<td class=colhead>Username</td>";
print "<td class=colhead>Class</td>";
print "<td class=colhead>Mail</td>";
print "<td class=colhead>Ratio</td>";
print "<td class=colhead>Last Seen</td>";
print "<td class=colhead align=\"center\">x</td>";
while ($arr = mysql_fetch_assoc($res)) {
$ratio = $arr["downloaded"] > 0 ? number_format($arr["uploaded"] / $arr["downloaded"], 3) : ($arr["uploaded"] > 0 ? "Inf." : "---");
$last_seen = $arr["last_access"] == "0000-00-00 00:00:00" ? "never" : "" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["last_access"])) . " ago";
$class = get_user_class_name($arr["class"]);
print "<tr>";
print "<td><a href=\"userdetails.php?id=" . $arr["id"] . "\">" . $arr["username"] . "</a></td>";
print "<td>" . $class . "</td>";
print "<td><a href=\"mailto:" . $arr["email"] . "\">" . safeChar($arr["email"]) . "</a></td>";
print "<td>" . $ratio . "</td>";
print "<td>" . $last_seen . "</td>";
print "<td align=\"center\" bgcolor=\"#FF0000\"><input type=\"checkbox\" name=\"userid[]\" value=\"" . $arr["id"] . "\" /></td>";
print "</tr>";
}
print "<tr><td colspan=\"6\" class=\"colhead\" align=\"center\">\n<select name=\"action\">\n<option value=\"mail\">Send mail</option>\n<option value=\"deluser\" " . ($CURUSER["class"] < UC_ADMINISTRATOR ? "disabled" : "") . ">Delete users</option>\n<option value=\"disable\">Disable Accounts</option>\n</select> <input type=\"submit\" name=\"submit\" value=\"Apply Changes\"/> <input type=\"button\" value=\"Check all\" onClick=\"this.value=check(form)\"></td></tr>";
if ($record_mail) {
$ress = sql_query("SELECT avps.value_s AS userid, avps.value_i AS last_mail, avps.value_u AS mails, users.username FROM avps LEFT JOIN users ON avps.value_s=users.id WHERE avps.arg='inactivemail' LIMIT 1");
$date = mysql_fetch_assoc($ress);
if ($date["last_mail"] > 0) {
示例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>
示例6: while
<td class="colhead"><nobr>Last access</td>
<td class="colhead"><nobr>Class</td>
<td class="colhead">Downloaded</td>
<td class="colhead">UpLoaded</td>
<td class="colhead">Ratio</td>
<td class="colhead">Status</td>
<td class="colhead"><nobr>Enabled</td>
</tr><?php
while ($arr = mysql_fetch_assoc($res)) {
if ($arr["downloaded"] > 0) {
$ratio = "<font color=" . get_ratio_color(number_format($arr["uploaded"] / $arr["downloaded"], 3)) . ">{$ratio}</font>";
} elseif ($arr["uploaded"] > 0) {
$ratio = 'Inf.';
} else {
$ratio = "---";
}
$uploaded = prefixed($arr["uploaded"]);
$downloaded = prefixed($arr["downloaded"]);
$added = $arr['added'] != '0000-00-00 00:00:00' ? substr($arr['added'], 0, 10) : '-';
$last_access = $arr['last_access'] != '0000-00-00 00:00:00' ? substr($arr['last_access'], 0, 10) : '-';
$class = get_user_class_name($arr["class"]);
echo "<tr align='center'><td><input type=\"checkbox\" name=\"ids[]\" value=\"{$arr['id']}\"></td><td><a href=/userdetails.php?id={$arr['id']}><b>{$arr['username']}</b></a>" . ($arr["donor"] == "yes" ? "<img src=pic/star.gif border=0 alt='Donor'>" : "") . ($arr["warned"] == "yes" ? "<img src=pic/warned.gif border=0 alt='Warned'>" : "") . "</td>\n\t\t<td><nobr>{$added}<br />(<font class='small'>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"])) . " ago</font>)</td>\n\t\t<td><nobr>{$last_access}<br />(<font class='small'>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["last_access"])) . " ago</font>)</td>\n\t\t<td>{$class}</td>\n\t\t<td>{$downloaded}</td>\n\t\t<td>{$uploaded}</td>\n\t\t<td>{$ratio}</td>\n\t\t<td>" . $arr['status'] . "</td>\n\t\t<td>" . $arr['enabled'] . "</td>\n\t\t</tr>\n";
}
echo "<tr><td colspan=10 align='center'><select name='do'><option value='enabled' disabled selected>What to do?</option><option value='enabled'>Enable selected</option><option value='confirm'>Confirm selected</option><option value='delete'>Delete selected</option></select><input type='submit' value='Submit'></td></tr></form>";
end_table();
echo $pagerbottom;
} else {
stdmsg('Sorry', 'Nothing found!');
}
end_main_frame();
stdfoot();
示例7: 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");
}
示例8: 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();
?>
示例9: ip2long
$ipcount = $arrip[0];
$nip = ip2long($ip);
$banres = mysql_query("SELECT COUNT(*) FROM bans WHERE $nip >= first AND $nip <= last") or
sqlerr(__FILE__, __LINE__);
$banarr = mysql_fetch_row($banres);
if ($banarr[0] == 0)
if ($ipcount > 1)
$ipshow = "<b><a href=ipsearch.php?ip=". $arr['ip'] .">" . $arr['ip'] ."</a></b>";
else
$ipshow = "<a href=ipsearch.php?ip=". $arr['ip'] .">" . $arr['ip'] ."</a>";
else
$ipshow = "<a href='/testip.php?ip=" . $arr['ip'] . "'><font color='#FF0000'><b>" . $arr['ip'] .
"</b></font></a>";
}
$date = display_date_time(sql_timestamp_to_unix_timestamp($arr["access"]) , $CURUSER[tzoffset] );
print("<tr><td>$date</td>\n");
print("<td>$ipshow</td>\n");
print("<td>$addr</td>\n");
}
end_table();
if ($countrows > $perpage)
echo $pagerbottom;
end_frame();
end_main_frame();
stdfoot();
示例10: end_frame
$peers = $torr['seeders'] . " seeder" . ($torr['seeders'] > 1 ? "s" : "") . ", " . $torr['leechers'] . " leecher" . ($torr['leechers'] > 1 ? "s" : "");
print "<tr><td><a href=\"userdetails.php?id=" . $arr['userid'] . "\">" . $arr['username'] . "</a> (" . $uratio . ")</td><td><a href=\"details.php?id=" . $arr['torrent'] . "\" alt=\"" . $torr['name'] . "\" title=\"" . $torr['name'] . "\">" . $torrname . "</td><td>" . $peers . "</td></tr>\n";
}
print "</table>\n";
end_frame();
end_main_frame();
stdfoot();
} else {
stdhead("Torrents Needing Seeds");
begin_main_frame();
begin_frame("[<a href=\"?needed=leechers\" class=\"altlink\">Seeders In Need</a>] - Torrents Needing Seeds");
$res = sql_query("SELECT id, name, seeders, leechers, added FROM torrents WHERE leechers >= 0 AND seeders = 0 ORDER BY leechers DESC LIMIT 40");
if (mysql_num_rows($res) > 0) {
print "<table class=main border=1 cellspacing=0 cellpadding=5>\n";
print "<tr><td class=\"colhead\">Torrent</td><td class=\"colhead\">Seeders</a></td><td class=\"colhead\">Leechers</td></tr>\n";
while ($arr = mysql_fetch_assoc($res)) {
$torrname = htmlspecialchars($arr['name']);
if (strlen($torrname) > 55) {
$torrname = substr($torrname, 0, 55) . "...";
}
$ttl = 28 * 24 - floor((gmtime() - sql_timestamp_to_unix_timestamp($arr["added"])) / 3600);
print "<tr><td><a href=\"details.php?id=" . $arr['id'] . "&hit=1\" alt=\"" . $arr['name'] . "\" title=\"" . $arr['name'] . "\">" . $torrname . "</td><td><font color=\"red\">" . $arr['seeders'] . "</a></td><td>" . number_format($arr['leechers']) . "</td></tr>\n";
}
print "</table>\n";
} else {
print "-- There are no torrents needing seeds right now --\n";
}
end_frame();
end_main_frame();
stdfoot();
}
示例11: T_
echo "<th class='table_head'>" . T_("DOWNLOADED") . "</th>";
echo "<th class='table_head'>" . T_("RATIO") . "</th>";
echo "<th class='table_head'>" . T_("TORRENTS_POSTED") . "</th>";
echo "<th class='table_head'>AVG Daily Upload</th>";
echo "<th class='table_head'>" . T_("ACCOUNT_SEND_MSG") . "</th>";
echo "<th class='table_head'>Joined</th>";
echo "</tr>";
for ($i = 0; $i <= $zerofix; $i++) {
$id = mysql_result($result, $i, "id");
$username = mysql_result($result, $i, "username");
$added = mysql_result($result, $i, "added");
$uploaded = mysql_result($result, $i, "uploaded");
$downloaded = mysql_result($result, $i, "downloaded");
$donated = mysql_result($result, $i, "donated");
$warned = mysql_result($result, $i, "warned");
$joindate = "" . get_elapsed_time(sql_timestamp_to_unix_timestamp($added)) . " ago";
$upperquery = "SELECT added FROM torrents WHERE owner = {$id}";
$upperresult = SQL_Query_exec($upperquery);
$seconds = mkprettytime(utc_to_tz_time() - utc_to_tz_time($added));
$days = explode("d ", $seconds);
if (sizeof($days) > 1) {
$dayUpload = $uploaded / $days[0];
$dayDownload = $downloaded / $days[0];
}
$torrentinfo = mysql_fetch_array($upperresult);
$numtorrents = mysql_num_rows($upperresult);
if ($downloaded > 0) {
$ratio = $uploaded / $downloaded;
$ratio = number_format($ratio, 3);
$color = get_ratio_color($ratio);
if ($color) {
示例12: gethostbyaddr_timeout
// ///////////////
if ($user['ip'] && (get_user_class() >= UC_MODERATOR || $user['id'] == $CURUSER['id'])) {
$ip = $user['ip'];
$dom = gethostbyaddr_timeout($ip);
if ($dom == $ip) {
$addr = '<a href="whois.php?query=' . $ip . '">' . $ip . '</a>';
} else {
$dom = htmlentities($dom, ENT_QUOTES);
$addr = '<a href="whois.php?query=' . $ip . '">' . $ip . '</a> (' . $dom . ')';
}
}
// /////////////////////////////
$joindate = $user['added'] == '0000-00-00 00:00:00' ? 'N/A' : $user['added'] . ' (' . get_elapsed_time(sql_timestamp_to_unix_timestamp($user['added'])) . ' ago)';
$lastseen = $user['last_access'] == '0000-00-00 00:00:00' ? 'Never' : $user['last_access'] . ' (' . get_elapsed_time(sql_timestamp_to_unix_timestamp($user['last_access'])) . ' ago)';
$lapsetime = ($lapsetime = time() - sql_timestamp_to_unix_timestamp($user["last_login"])) / 3600 % 24 . ' Hours ' . $lapsetime / 60 % 60 . ' minutes ' . $lapsetime % 60 . ' seconds ';
$onlinetime = "{$user['last_login']} (" . get_date_time(sql_timestamp_to_unix_timestamp($user["last_access"])) . ")";
$res = sql_query("SELECT COUNT(*) FROM comments WHERE user=" . unsafeChar($user["id"])) or sqlerr();
$arr3 = mysql_fetch_row($res);
$torrentcomments = $arr3[0];
$res = sql_query("SELECT COUNT(*) FROM posts WHERE userid=" . unsafeChar($user["id"])) or sqlerr();
$arr3 = mysql_fetch_row($res);
$forumposts = $arr3[0];
$country = '';
include 'include/cache/countries.php';
foreach ($countries as $country) {
if ($country["id"] == $user["country"]) {
$country = "<td class=embedded><img src=\"{$pic_base_url}flag/{$country['flagpic']}\" alt=\"" . $country['name'] . "\" style='margin-left: 8pt'></td>";
break;
}
}
$ipto = sql_query("SELECT COUNT(id) FROM `users` AS iplist WHERE `ip` = '" . unsafeChar($user["ip"]) . "'") or sqlerr(__FILE__, __LINE__);
示例13: stdhead
stdhead("Personal lists for " . $user['username']);
begin_frame("Personal lists for " . class_user($user[username]) . "");
print "<div style='margin-top:10px; margin-bottom:20px' align='center'><font size=2><font color=#0080FF><b>List of Personal watched users</b></font></div>";
?>
<table class="table_table" border="0" width="100%">
<tr>
<th class="table_head"><b>User Name</b></td></th>
<th class="table_head"><b>Account enabled?</b></td></th>
<th class="table_head"><b>Contact user</td></th>
<th class="table_head"><b>Last Seen</b></td></th>
<th class="table_head"><b>REMOVE</b></td></th>
</tr>
<?php
$res = SQL_Query_exec("SELECT b.bkid as id, u.username AS name, u.class, u.avatar, u.title, u.enabled, u.last_access FROM bookmarkuser AS b LEFT JOIN users as u ON b.bkid = u.id WHERE userid={$userid} ORDER BY name");
if (mysql_num_rows($res) == 0) {
$bookmarkuser = "Your watch list is empty!";
} else {
while ($bookmarkuser = mysql_fetch_array($res)) {
$title = $bookmarkuser["title"];
if (!$title) {
$title = get_user_class_name($bookmarkuser["class"]);
}
$banned = $bookmarkuser["enabled"];
echo "<tr>\n <td class='table_col1' align='center'><a href='../user/?id=" . $bookmarkuser['id'] . "'><b>" . class_user($bookmarkuser['name']) . "</b></a></td>\n <td class='table_col2' align='center'>{$banned}</td>\n <td class='table_col1' align='center'><a href='../message/?compose&id=" . $bookmarkuser['id'] . "'><img src='../images/button_pm.gif' title='Send PM'></a></td>\n <td class='table_col2' align='center'><div style='margin-top:10px; margin-bottom:2px'>Last seen: " . date("<\\b>d.M.Y<\\/\\b> H:i", utc_to_tz_time($bookmarkuser['last_access'])) . "</div>[<b>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($bookmarkuser[last_access])) . " ago</b>]</td>\n <td class='table_col1' align='center'><b><a href='../watch/?id={$userid}&action=delete&type=bookmarkuser&targetid=" . $bookmarkuser['id'] . "'><font style='margin-left:7px'><input type='submit' value='Remove' class='btn btn-success'/></font></a></b></td>\n </tr>";
}
}
?>
</table>
<?php
end_frame();
stdfoot();
示例14: sql_query
$res_who2 = sql_query("SELECT name FROM torrents WHERE id = {$arr_info['reporting_what']}");
$arr_who2 = mysql_fetch_assoc($res_who2);
$link_to_thing = "<a class=altlink href=details.php?id={$arr_info['reporting_what']}><b>" . safechar($arr_who2['name']) . "</b></a>";
break;
case "Hit_And_Run":
$res_who2 = sql_query("SELECT users.username, torrents.name, r.2nd_value FROM users, torrents LEFT JOIN reports AS r ON r.2nd_value = torrents.id WHERE users.id={$arr_info['reporting_what']}");
$arr_who2 = mysql_fetch_assoc($res_who2);
$link_to_thing = "<b>user:</b> <a class=altlink href=userdetails.php?id=" . $arr_info['reporting_what'] . "&completed=1><b>" . $arr_who2['username'] . "</b></a><br>hit and run on:<br> <a class=altlink href=details.php?id=" . $arr_info['2nd_value'] . "&page2=0#snatched><b>" . safechar($arr_who2['name']) . "</b></a>";
break;
case "Post":
$res_who2 = sql_query("SELECT subject FROM topics WHERE id = " . $arr_info['2nd_value']);
$arr_who2 = mysql_fetch_assoc($res_who2);
$link_to_thing = "<b>post:</b> <a class=altlink href=forums.php?action=viewtopic&topicid=" . $arr_info['2nd_value'] . "&page=last#" . $arr_info['reporting_what'] . "><b>" . safechar($arr_who2['subject']) . "</b></a>";
break;
}
}
echo "<tr><td align=left valign=top class={$class}>" . $arr_info['added'] . "</td><td align=left valign=top class={$class}><a class=altlink href=userdetails.php?id=" . $arr_info['reported_by'] . ">" . "<b>" . $arr_info['username'] . "</b></a></td><td align=left valign=top class={$class}>{$link_to_thing}</td><td align=left valign=top class={$class}><b>" . str_replace("_", " ", $arr_info["reporting_type"]) . "</b>" . "</td><td align=left valign=top class={$class}>" . safechar($arr_info['reason']) . "</td><td align=center valign=top class={$class}>{$dealtwith} {$delt_link}</td><td align=center valign=middle class={$class}>{$checkbox}</td>" . (get_user_class() == UC_SYSOP ? "<td align=center valign=middle class={$class}><a class=altlink href=reports.php?id=" . $arr_info['id'] . "&delete=1><font color=red>Delete</font></a></td>" : "") . "</tr>\n";
// ===how was it delt with?
if ($arr_info['how_delt_with']) {
echo "<tr><td colspan=" . (get_user_class() == UC_SYSOP ? "8" : "7") . " class={$class} align=left><b>Delt with by " . $arr_who['username'] . ":</b> on: " . $arr_info['when_delt_with'] . " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr_info['when_delt_with'])) . " ago)</td></tr><tr><td colspan=" . (get_user_class() == UC_SYSOP ? "8" : "7") . " class={$class} align=left>" . safechar($arr_info['how_delt_with']) . "<br><br></td></tr>";
}
}
}
echo "</table>";
if ($count > '0') {
// === deal with it
echo "<br><br><p align=center><b>How {$CURUSER['username']} Delt with this report:</b> [ required ] </p><textarea name=how_delt_with cols=70 rows=5 ></textarea><br><br>" . "<input type=submit class=button value=Confirm><br><br></form></td></tr></table>";
}
//=== end if count
stdfoot();
die;
示例15: while
while ($row = mysql_fetch_assoc($res_search)) {
// =======change colors
$count = ++$count % 2;
$class = 'clearalt' . ($count == 0 ? 6 : 7);
$class2 = 'clearalt' . ($count == 0 ? 7 : 6);
// === if not searching one member...
if (!$member) {
$res_username = sql_query('SELECT username,id FROM users WHERE id=' . sqlesc($row[$sender_reciever]) . ' LIMIT 1') or sqlerr(__FILE__, __LINE__);
$arr_username = mysql_fetch_array($res_username);
$the_username = '<a class=altlink href=userdetails.php?id=' . $arr_username['id'] . '>' . htmlspecialchars($arr_username['username']) . '</a>';
}
// === if searching all boxes...
$arr_box = $row['location'] == 1 ? 'Inbox' : ($row['location'] < 1 ? 'Sentbox' : '');
if ($all_boxes && $arr_box === '') {
$res_box_name = sql_query('SELECT name FROM pmboxes WHERE userid=' . $CURUSER['id'] . ' AND boxnumber=' . sqlesc($row['location'])) or sqlerr(__FILE__, __LINE__);
$arr_box_name = mysql_fetch_assoc($res_box_name);
$arr_box = $arr_box_name['name'];
}
// ==== highlight search terms... from Jaits search forums mod
$body = str_ireplace($keywords, '<font style=\'background-color:yellow;font-weight:bold;color:black;\'>' . $keywords . '</font>', format_comment($row['msg']));
$subject = str_ireplace($keywords, '<font style=\'background-color:yellow;font-weight:bold;color:black;\'>' . $keywords . '</font>', htmlspecialchars($row['subject']));
// === print the damn thing :P
// === if it's as a list or as posts...
echo 0 + $_POST['as_list_post'] == 2 ? '<tr><td class=colhead colspan=4>message from: ' . ($row[$sender_reciever] == 0 ? 'System' : '<b>' . $the_username . '</b>') . '</td></tr><tr><td class=' . $class2 . ' colspan=4><b>subject:</b> <a class=altlink href=?action=viewmessage&id=' . $row['id'] . '>' . ($row['subject'] !== '' ? $subject : 'No Subject') . '</a> ' . ($all_boxes ? '[ found in ' . $arr_box . ' ]' : '') . ' at: ' . $row['added'] . ' GMT (' . get_elapsed_time(sql_timestamp_to_unix_timestamp($row['added'])) . ' ago)</td></tr><tr><td class=' . $class . ' colspan=4>' . $body . '</td></tr>' : '<tr><td class=' . $class . '><img src=pic/outbox.gif alt=Read></td><td class=' . $class . '><a class=altlink href=?action=viewmessage&id=' . $row['id'] . '>' . ($row['subject'] !== '' ? $subject : 'No Subject') . '</a> ' . ($all_boxes ? '[ found in ' . $arr_box . ' ]' : '') . '</td>' . '<td class=' . $class . '>' . ($row[$sender_reciever] == 0 ? 'System' : '<b>' . $the_username . '</b>') . '</td><td nowrap class=' . $class . '>' . $row['added'] . ' GMT (' . get_elapsed_time(sql_timestamp_to_unix_timestamp($row['added'])) . ' ago) </td></tr>';
}
}
// === the bottom
echo ($num_resault > 0 ? '</table>' : '') . '<br><a class=altlink href=?action=search>Search Messages</a> || <a class=altlink href=?action=editmailboxes>Mailbox Manager / PM settings</a> || <a class=altlink href=/sendmessage.php?receiver=' . $CURUSER['id'] . '&draft=1>write new Draft</a></div>';
stdfoot();
}
die;