コード例 #1
0
ファイル: userdetails.php プロジェクト: klldll/tbdev
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 .= "&nbsp;час";
        } else {
            $ttl .= "&nbsp;часов";
        }
        $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']}&amp;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
0
ファイル: userdetails.php プロジェクト: herrag33k/TomTorrent
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].'&amp;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
0
ファイル: topten.php プロジェクト: klldll/tbdev
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
0
ファイル: inactive.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
}
// 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"])) . "&nbsp;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>&nbsp;&nbsp;<input type=\"submit\" name=\"submit\" value=\"Apply Changes\"/>&nbsp;&nbsp;<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
0
    $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
0
	<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
0
ファイル: votesview.php プロジェクト: r4kib/cyberfun-xbtit
//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
0
</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
0
ファイル: iphistory.php プロジェクト: herrag33k/TomTorrent
         $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
0
ファイル: needseed.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
        $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>] &nbsp;-&nbsp; 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
0
ファイル: admincp.php プロジェクト: lavanoid/TorrentTrader3
 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
0
// ///////////////
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="******"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
0
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 = "******";
} 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&amp;id=" . $bookmarkuser['id'] . "'><img src='../images/button_pm.gif' title='Send&nbsp;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
0
ファイル: reports.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
                    $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
0
ファイル: messages.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
        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 = '******' . $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;
コード例 #16
0
function latestforumposts()
{
    global $pic_base_url, $CURUSER, $config, $php_file, $page_find, $lang_off, $language;
    // / FIRST WE MAKE THE HEADER (NON-LOOPED) ///
    ?>
<table align="center" width="760" cellspacing=0 cellpadding=8><tr><td align="left" class=colhead><b><?php 
    echo $language['topic'];
    ?>
</b></td><!--<td align="center" class=colhead><b>Author</b></td><td align="center" class=colhead><b>Replies</b></td>--><td align="center" class=colhead><b><?php 
    echo $language['view'];
    ?>
</b></td><td align="center" class=colhead><b><?php 
    echo $language['post'];
    ?>
</b></td><!--<td align="center" class=colhead><b>Posted At</b></td>-->
</tr>
<?php 
    $page = 1;
    $num = 0;
    // / HERE GOES THE QUERY TO RETRIEVE DATA FROM THE DATABASE AND WE START LOOPING ///
    $topicres = sql_query("SELECT t.id, t.userid, t.subject, t.locked, t.forumid, t.pollid, t.lastpost, t.sticky, t.views, t.forumid, f.minclassread, f.name " . ", (SELECT COUNT(id) FROM posts WHERE topicid=t.id) AS p_count " . ", p.userid AS puserid, p.added " . ", u.id AS uid, u.username " . ", u2.username AS u2_username " . "FROM topics AS t " . "LEFT JOIN forums AS f ON f.id = t.forumid " . "LEFT JOIN posts AS p ON p.id=(SELECT MAX(id) FROM posts WHERE topicid = t.id) " . "LEFT JOIN users AS u ON u.id=p.userid " . "LEFT JOIN users AS u2 ON u2.id=t.userid " . "WHERE t.locked = 'no' AND f.minclassread <= " . $CURUSER['class'] . " " . "ORDER BY t.lastpost DESC LIMIT 11") or sqlerr(__FILE__, __LINE__);
    while ($topicarr = mysql_fetch_assoc($topicres)) {
        $topicid = $topicarr["id"];
        $topic_userid = $topicarr["userid"];
        $perpage = $CURUSER["postsperpage"];
        if (!$perpage) {
            $perpage = 24;
        }
        $posts = $topicarr["p_count"];
        $replies = max(0, $posts - 1);
        $first = $page * $perpage - $perpage + 1;
        $last = $first + $perpage - 1;
        if ($last > $num) {
            $last = $num;
        }
        $pages = ceil($posts / $perpage);
        // $menu = "\n";
        $menu = "";
        for ($i = 1; $i <= $pages; $i++) {
            if ($i == 1 && $i != $pages) {
                $menu .= "[ ";
            }
            if ($pages > 1) {
                $menu .= "<a href=/forums.php?action=viewtopic&amp;topicid={$topicid}&amp;page={$i}>{$i}</a>\n";
            }
            if ($i < $pages) {
                $menu .= "|\n";
            }
            if ($i == $pages && $i > 1) {
                $menu .= "]";
            }
        }
        $added = $topicarr["added"] . '<br /><font class=small>(' . get_elapsed_time(sql_timestamp_to_unix_timestamp($topicarr["added"])) . ' ago)</font>';
        $username = is_valid_id($topicarr['uid']) ? "<a href=/userdetails.php?id=" . $topicarr["puserid"] . "><b>" . $topicarr['username'] . "</b></a>" : "<i>Unknown[{$topic_userid}]</i>";
        $author = !empty($topicarr['u2_username']) ? "<a href=/userdetails.php?id={$topic_userid}><b>" . $topicarr['u2_username'] . "</b></a>" : "<i>Unknown[{$topic_userid}]</i>";
        $staffimg = $topicarr["minclassread"] > 0 ? "<img src=" . $pic_base_url . "staff.png border=0 />" : "";
        $lockimg = $topicarr["locked"] == 'yes' ? "<img src=" . $pic_base_url . "lockednew.gif border=0 />" : "";
        $pollimg = is_valid_id($topicarr["pollid"]) ? "<img src=\"" . $pic_base_url . "poll.gif\" alt=\"Poll:\" width=\"12\" height=\"14\" />&nbsp;&nbsp;&nbsp;" : "";
        $stickyimg = $topicarr["sticky"] == 'yes' ? "<img src=\"" . $pic_base_url . "sticky.gif\" alt=\"Sticky:\" width=\"12px\" height=\"14px\" />&nbsp;&nbsp;&nbsp;" : "";
        $subject = $pollimg . $stickyimg . "<a href=\"forums.php?action=viewtopic&amp;topicid={$topicid}&amp;page=last#" . $topicarr["lastpost"] . "\"><b>" . encodehtml($topicarr["subject"]) . "</b></a>{$lockimg}&nbsp;&nbsp;&nbsp;{$staffimg}&nbsp;&nbsp;&nbsp;{$menu}<br /><font class=small> in <i><a href=\"/forums.php?action=viewforum&amp;forumid=" . $topicarr['forumid'] . "\">" . $topicarr['name'] . "</a></i> by " . $author . "&nbsp;&nbsp;" . get_elapsed_time(sql_timestamp_to_unix_timestamp($topicarr["added"])) . " ago </font>";
        ?>
<tr><td><?php 
        echo $subject;
        ?>
</td><td align="center"><?php 
        echo number_format($topicarr["views"]);
        ?>
</td><td align="center"><?php 
        echo $username;
        ?>
</td></tr><?php 
    }
    ?>
</table>
<?php 
}
コード例 #17
0
ファイル: invite.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
            } else {
                echo '<td align=center>---</td>';
            }
        }
    }
    echo '</table><br>';
    $select = sql_query("SELECT * FROM invite_codes WHERE sender = " . sqlesc($CURUSER['id']) . " AND status = 'Pending'") or sqlerr();
    $num_row = mysql_num_rows($select);
    print "<table border=1 width=750 cellspacing=0 cellpadding=5>" . "<tr class=tabletitle><td colspan=6 class=colhead><b>Created Invite Codes</b></td></tr>";
    if (!$num_row) {
        echo '<tr class=tableb><td colspan=6>You have not created invite codes at the moment!</tr>';
    } else {
        echo '<tr class=tableb><td><b>Invite Code</b></td><td><b>Created Date</b></td><td><b>Delete</b></td><td><b>Status</b></tr>';
        for ($i = 0; $i < $num_row; ++$i) {
            $fetch_assoc = mysql_fetch_assoc($select);
            echo '<tr class=tableb><td>' . $fetch_assoc['code'] . ' <a href="?do=send_email&id=' . (int) $fetch_assoc['id'] . '"><img src="pic/email.gif" border="0" / ></td><td>' . "" . get_elapsed_time(sql_timestamp_to_unix_timestamp($fetch_assoc['invite_added'])) . " ago" . '</td>';
            echo '<td><a href="?do=delete_invite&id=' . (int) $fetch_assoc['id'] . '"><img src=pic/del.png border=0 /></a></td><td>' . $fetch_assoc['status'] . '</td></tr>';
        }
    }
    echo '<tr class=tableb><td colspan=7 align=center><form action="?do=create_invite" method="post"><input type=submit value="Create Invite Code" style=height: 20px></form></td></tr>';
    echo '</table>';
    stdfoot();
} elseif ($do == 'create_invite') {
    if ($CURUSER['invites'] <= 0) {
        stderr('Error', 'No invites!');
    }
    if ($CURUSER["invite_on"] == 'no') {
        stderr("Denied", "Your invite sending privileges has been disabled by the Staff!");
    }
    $res = sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE__, __LINE__);
    $arr = mysql_fetch_row($res);
コード例 #18
0
            $arg = $autoslowclean_interval;
            break;
        case 's2slowcleantime':
            $arg = $s2autoslowclean_interval;
            break;
        case 'lastoptimizedbtime':
            $arg = $optimizedb_interval;
            break;
        case 'lastbackupdbtime':
            $arg = $backupdb_interval;
            break;
        case 'lastautohitruntime':
            $arg = $autohitrun_interval;
            break;
    }
    echo '<tr>' . '<td>' . $arr['arg'] . '</td>' . '<td>' . get_date_time($arr['value_u']) . ' (' . get_elapsed_time(sql_timestamp_to_unix_timestamp(get_date_time($arr['value_u']))) . ' ago)</td>' . '<td>' . calctime($arg) . '</td>' . '<td>' . calctime($arr['value_u'] - (gmtime() - $arg)) . '</td>' . '</tr>';
}
end_table();
?>
<br><form action="<?php 
echo $_SERVER["SCRIPT_NAME"];
?>
" method="post">
<table align="center"><tr><td class="chs">
<input type="checkbox" name="docleanup">Do Cleanup
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="doslowcleanup">Do Slow Cleanup
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="dos2slowcleanup">Do Slow Cleanup2
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="dooptimization">Do Optimization
コード例 #19
0
        }
        echo "</table>\n";
        echo "<p align=right><input type=submit value=Delete></p>";
        echo "</form>";
        echo $pagerbottom;
        echo "</td></tr></table>\n";
    }
    stdfoot();
}
// View application
if ($action == "viewapp") {
    $id = $_GET["id"];
    $res = sql_query("SELECT uploadapp.*, users.id AS uid, users.username, users.class, users.added, users.uploaded, users.downloaded FROM uploadapp INNER JOIN users on uploadapp.userid = users.id WHERE uploadapp.id={$id}") or sqlerr(__FILE__, __LINE__);
    $arr = mysql_fetch_assoc($res);
    $membertime = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"]));
    $elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["applied"]));
    stdhead("Uploader applications");
    echo "<h1 align=center>Uploader application</h1>";
    echo "<table width=750 border=1 cellspacing=0 cellpadding=5>";
    echo "<tr><td class=rowhead width=25%>My username is</td><td><a href=userdetails.php?id={$arr['uid']}>{$arr['username']}</a></td></tr>";
    echo "<tr><td class=rowhead>I have joined at</td><td>{$arr['added']} ({$membertime} ago)</td></tr>";
    echo "<tr><td class=rowhead>My upload amount is</td><td>" . prefixed($arr["uploaded"]) . "</td></tr>";
    echo "<tr><td class=rowhead>My download amount is</td><td>" . prefixed($arr["downloaded"]) . "</td></tr>";
    echo "<tr><td class=rowhead>My ratio is </td><td>" . number_format($arr["uploaded"] / $arr["downloaded"], 3) . "</td></tr>";
    echo "<tr><td class=rowhead>I am connectable</td><td>{$arr['connectable']}</td></tr>";
    echo "<tr><td class=rowhead>My current userclass is</td><td>" . get_user_class_name($arr["class"]) . "</td></tr>";
    echo "<tr><td class=rowhead>I have applied at</td><td>{$arr['applied']} ({$elapsed} ago)</td></tr>";
    echo "<tr><td class=rowhead>My upload speed is</td><td>" . htmlspecialchars($arr["speed"]) . "</td></tr>";
    echo "<tr><td class=rowhead>What I have to offer</td><td>" . htmlspecialchars($arr["offer"]) . "</td></tr>";
    echo "<tr><td class=rowhead>Why I should be promoted</td><td>" . htmlspecialchars($arr["reason"]) . "</td></tr>";
    echo "<tr><td class=rowhead>I am uploader at other sites</td><td>{$arr['sites']}</td></tr>";
コード例 #20
0
ファイル: stats.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
}
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;
コード例 #21
0
ファイル: helpdesk.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
 while ($i <= 200) {
     $per_page_drop_down .= '<option value="?action=problems&per_page=' . $i . '" ' . ($perpage == $i ? ' selected' : '') . '>' . $i . ' items per page</option>';
     $i = $i + 10;
 }
 $per_page_drop_down .= '</select></form>';
 list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, '?action=problems' . ($_GET['per_page'] && 0 + $_GET['per_page'] > 0 ? '&per_page=' . (0 + $_GET['per_page']) : '') . '&');
 echo '<p align=center>' . $pagertop . '</p><p align=center>' . $per_page_drop_down . '</p>';
 echo '<table align=center border=1 cellpadding=5 cellspacing=0><td class=colhead align=center>Added</td><td class=colhead align=center>Added by</td><td class=colhead align=center>Problem</td><td class=colhead align=center>Solved - by</td><td class=colhead align=center>Solved in*</td>' . (get_user_class() == UC_SYSOP ? '<td class=colhead align=center>Delete</td>' : '') . '</tr>' . '<form method=post name=helpdesk action=?staff_delete=1 onSubmit="return ValidateForm(this,\'delhd\')">';
 $res = sql_query("SELECT added, solved_date, added_by, id, title, solved, solved_by FROM helpdesk ORDER BY added DESC {$limit}") or sqlerr(__FILE__, __LINE__);
 while ($arr = mysql_fetch_array($res)) {
     $biatch_rez = sql_query("SELECT username FROM users WHERE id =" . $arr['added_by']) or sqlerr(__FILE__, __LINE__);
     $biatch_arr = mysql_fetch_assoc($biatch_rez);
     $solved_by_rez = sql_query("SELECT username FROM users WHERE id =" . $arr['solved_by']) or sqlerr(__FILE__, __LINE__);
     $solved_by_arr = mysql_fetch_assoc($solved_by_rez);
     // === if problem solved print info, if not hell, print that too :-O
     $solved_in_wtf = sql_timestamp_to_unix_timestamp($arr['solved_date']) - sql_timestamp_to_unix_timestamp($arr['added']);
     $solved_in = $arr['solved_date'] == '0000-00-00 00:00:00' ? ' [ N/A ]' : ' [ ' . round_time($solved_in_wtf) . ' ]';
     switch (true) {
         case $arr['solved_date'] == '0000-00-00 00:00:00':
             $solved_color = 'pink';
             break;
         case $solved_in_wtf > 2 * 3600:
             $solved_color = 'red';
             break;
         case $solved_in_wtf > 3600:
             $solved_color = 'orange';
             break;
         case $solved_in_wtf <= 1800:
             $solved_color = 'green';
             break;
     }
コード例 #22
0
ファイル: last_block.php プロジェクト: Karpec/gizd
 while ($i < $num2) {
     $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);
     }
コード例 #23
0
ファイル: makepoll.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
    } elseif ($pollid) {
        header("Location: {$BASEURL}/polls.php#{$pollid}");
    } else {
        header("Location: {$BASEURL}");
    }
    die;
}
stdhead();
if ($pollid) {
    print "<h1>Edit poll</h1>";
} else {
    // Warn if current poll is less than 3 days old
    $res = sql_query("SELECT question,added FROM polls ORDER BY added DESC LIMIT 1") or sqlerr();
    $arr = mysql_fetch_assoc($res);
    if ($arr) {
        $hours = floor((gmtime() - sql_timestamp_to_unix_timestamp($arr["added"])) / 3600);
        $days = floor($hours / 24);
        if ($days < 3) {
            $hours -= $days * 24;
            if ($days) {
                $t = "{$days} day" . ($days > 1 ? "s" : "");
            } else {
                $t = "{$hours} hour" . ($hours > 1 ? "s" : "");
            }
            print "<p><font color=red><b>Note: The current poll (<i>" . $arr["question"] . "</i>) is only {$t} old.</b></font></p>";
        }
    }
    print "<h1>Make poll</h1>";
}
?>
コード例 #24
0
ファイル: forums.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
                                                            } else {
                                                                ?>
<html><head><link rel="stylesheet" href="<?php 
                                                                echo $DEFAULTBASEURL;
                                                                ?>
/default.css" type="text/css" media="screen" /></head><body>
		<table width='100%' cellpadding='5' border="1">
		<tr align="center">
			<td>File Name</td>
			<td nowrap="nowrap" >Downloaded by</td>
			<td>Downloads</td>
			<td>Date</td>
		</tr><?php 
                                                                $dls = 0;
                                                                while ($arr = mysql_fetch_assoc($res)) {
                                                                    echo "<tr align='center'>" . "<td>" . safeChar($arr['filename']) . "</td>" . "<td><a class='pointer' onclick=\"opener.location=('/userdetails.php?id=" . (int) $arr['userid'] . "'); self.close();\">" . safeChar($arr['username']) . "</a></td>" . "<td>" . (int) $arr['downloads'] . "</td>" . "<td>" . $arr['date'] . " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr['date'])) . ")</td>" . "</tr>";
                                                                    $dls += (int) $arr['downloads'];
                                                                }
                                                                ?>
<tr><td colspan='4'><b>Total Downloads:</b> <b><?php 
                                                                echo number_format($dls);
                                                                ?>
</b></td></tr></table></body></html><?php 
                                                            }
                                                        } else {
                                                            if ($action == "viewforum") {
                                                                // -------- Action: View forum
                                                                $forumid = (int) $_GET['forumid'];
                                                                if (!is_valid_id($forumid)) {
                                                                    stderr('Error', 'Invalid ID!');
                                                                }
コード例 #25
0
            } 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();
コード例 #26
0
ファイル: polls.php プロジェクト: herrag33k/TomTorrent
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"))
コード例 #27
0
print "<h2 align=left><a name=\"friends\">" . $user['username'] . " has " . $fcount . " Friend " . ($fcount > 1 ? "s" : "") . "</a></h2>\n";
print "<table width=737 border=1 cellspacing=0 cellpadding=5><tr><td>";
$i = 0;
$res = mysql_query("SELECT f.friendid as id, u.username AS name, u.class, u.avatar, u.title, u.donor, u.warned, u.enabled, u.last_access FROM friends AS f LEFT JOIN users as u ON f.friendid = u.id WHERE userid={$userid} AND f.confirmed='yes' ORDER BY name") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0) {
    $friends = "<em>" . $user['username'] . " has no friends.</em>";
} else {
    while ($friend = mysql_fetch_array($res)) {
        $pm_pic = "<img src=" . $pic_base_url . "button_pm.gif alt='Send PM' border=0>";
        $dt = gmtime() - 180;
        $online = $friend["last_access"] >= '' . get_date_time($dt) . '' ? '&nbsp;<img src=' . $pic_base_url . 'user_online.gif border=0 alt=Online>' : '<img src=' . $pic_base_url . 'user_offline.gif border=0 alt=Offline>';
        $title = htmlspecialchars($friend["title"]);
        if (!$title) {
            $title = get_user_class_name($friend["class"]);
        }
        $body1 = "<a href=userdetails.php?id=" . $friend['id'] . "><b>" . $friend['name'] . "</b></a>" . get_user_icons($friend) . " ({$title}) {$online}<br /><br />last seen on " . $friend['last_access'] . "<br />(" . get_elapsed_time(sql_timestamp_to_unix_timestamp($friend['last_access'])) . " ago)";
        $body2 = $id == $CURUSER['id'] ? "" : "<br /><a href=friends.php?id={$CURUSER['id']}&action=add&type=friend&targetid=" . $friend['id'] . ">Add Friend</a>" . "<br /><br /><a href=sendmessage.php?receiver=" . $friend['id'] . ">" . $pm_pic . "</a>";
        $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars($friend["avatar"]) : "";
        // if (!$avatar)
        // $avatar = "".$pic_base_url."default_avatar.gif";
        if ($i % 2 == 0) {
            print "<table width=737 style='padding: 0px'><tr><td class=bottom style='padding: 5px' width=50% align=center>";
        } else {
            print "<td class=bottom style='padding: 5px' width=50% align=center>";
        }
        print "<table class=main width=737 height=75px>";
        print "<tr valign=top><td width=75 align=center style='padding: 0px'>" . ($avatar ? "<div style='width:75px;height:75px;overflow: hidden'><img width=75px src=\"{$avatar}\"></div>" : "") . "</td><td>\n";
        print "<table class=main>";
        print "<tr><td class=embedded style='padding: 5px' width=737>{$body1}</td>\n";
        print "<td class=embedded style='padding: 5px' width=20%>{$body2}</td></tr>\n";
        print "</table>";
コード例 #28
0
ファイル: friends.php プロジェクト: herrag33k/TomTorrent
print("<table width=750 border=1 cellspacing=0 cellpadding=5><tr class=tablea><td>");

$i = 0;

$friendadd = mysql_query("SELECT f.userid AS fuid, u.username AS name, u.id AS uid, u.class, u.avatar, u.title, u.donor, u.warned, u.enabled, u.last_access FROM friends AS f LEFT JOIN users AS u ON f.userid = u.id WHERE friendid = $CURUSER[id] ORDER BY name") or sqlerr(__FILE__, __LINE__);
if(mysql_num_rows($friendadd) == 0)
	$friendsno = "<em>Engir vinir enn þá</em>";
else
	while ($friend = mysql_fetch_array($friendadd))
	{
    $title = $friend["title"];
		if (!$title)
	    $title = get_user_class_name($friend["class"]);
    $body1 = "<a href=userdetails.php?id=" . $friend['fuid'] . "><b>" . $friend['name'] . "</b></a>" .
    	get_user_icons($friend) . " ($title)<br><br>Sást síðast " . $friend['last_access'] .
    	"<br>(" . get_elapsed_time(sql_timestamp_to_unix_timestamp($friend[last_access])) . " síðan)";
		$body2 = "<br><a href=sendmessage.php?receiver=" . $friend['fuid'] . ">Senda einkaskilaboð</a>";
    $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($friend["avatar"]) : "");
		if (!$avatar)
			$avatar = "/pic/default_avatar.gif";
    if ($i % 2 == 0)
    	print("<table width=100% style='padding: 0px'><tr><td class=bottom style='padding: 5px' width=50% align=center>");
    else
    	print("<td class=bottom style='padding: 5px' width=50% align=center class=tablea>");
    print("<table class=main width=100% height=75px class=tablea>");
    print("<tr valign=top class=tableb><td width=75 align=center style='padding: 0px'>" .
			($avatar ? "<div style='width:75px;height:75px;overflow: hidden'><img width=75px src=\"$avatar\"></div>" : ""). "</td><td>\n");
    print("<table class=main>");
    print("<tr bgcolor=#BECDD8><td class=embedded style='padding: 5px' width=80%>$body1</td>\n");
    print("<td class=embedded style='padding: 5px' width=20%>$body2</td></tr>\n");
    print("</table>");
コード例 #29
0
ファイル: functions_global.php プロジェクト: klldll/tbdev
function sql_ts_to_ut($s)
{
    return sql_timestamp_to_unix_timestamp($s);
}
コード例 #30
0
ファイル: seedbox.php プロジェクト: Karpec/gizd
 $seedbox[$i]["sw12"] = "<tr>";
 if (strlen($data["hash"]) > 0) {
     $seedbox[$i]["sw13"] = "<td NOWRAP align=center class=lista>";
     $seedbox[$i]["sw14"] = "<a href=download.php?id=" . $data["hash"] . "><center><img src='images/download.gif' border='0' alt='" . $language["DOWNLOAD_TORRENT"] . "' title='" . $language["DOWNLOAD_TORRENT"] . "' /></center></a>";
     //waitingtime
     if (max(0, $CURUSER["WT"]) > 0) {
         $resuser = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}users WHERE id=" . $CURUSER["uid"]);
         $rowuser = mysqli_fetch_array($resuser);
         if (max(0, $rowuser['downloaded']) > 0) {
             $ratio = number_format($rowuser['uploaded'] / $rowuser['downloaded'], 2);
         } else {
             $ratio = 0.0;
         }
         $res2 = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}files WHERE info_hash='" . $data["hash"] . "'");
         $added = mysqli_fetch_array($res2);
         $vz = sql_timestamp_to_unix_timestamp($added["data"]);
         $timer = floor((time() - $vz) / 3600);
         if ($ratio < 1.0 && $rowuser['id'] != $added["uploader"]) {
             $wait = $CURUSER["WT"];
         }
         $wait -= $timer;
         if ($wait <= 0) {
             $wait = 0;
         }
     }
     //end waitingtime
     $id = mysqli_query($GLOBALS["___mysqli_ston"], "select username,id_level FROM {$TABLE_PREFIX}users WHERE id =" . $data["uploader"]);
     $rowt = mysqli_fetch_array($id);
     $idi = mysqli_query($GLOBALS["___mysqli_ston"], "select prefixcolor, suffixcolor FROM {$TABLE_PREFIX}users_level WHERE id =" . $rowt["id_level"]);
     $rowti = mysqli_fetch_array($idi);
     $seedbox[$i]["sw15"] = "</td>";