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


PHP member_ratio函数代码示例

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


在下文中一共展示了member_ratio函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dltable

function dltable($name, $arr, $torrent)
{
    global $CURUSER, $lang, $INSTALLER09;
    $htmlout = '';
    if (!count($arr)) {
        return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n";
    }
    $htmlout = "\n";
    $htmlout .= "<table width='100%' class='main' border='1' cellspacing='0' cellpadding='5'>\n";
    $htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='center'>{$lang['peerslist_connectable']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>") . "" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>") . "" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_connected']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
    $now = TIME_NOW;
    $mod = $CURUSER['class'] >= UC_STAFF;
    foreach ($arr as $e) {
        $htmlout .= "<tr>\n";
        if ($e['username']) {
            if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['userid'] || $e['anonymous'] == 'yes' or $e['paranoia'] >= 2) && $CURUSER['id'] != $e['userid'] && $CURUSER['class'] < UC_STAFF) {
                $htmlout .= "<td><b>Kezer Soze</b></td>\n";
            } else {
                $htmlout .= "<td><a href='userdetails.php?id=" . (int) $e['userid'] . "'><b>" . htmlsafechars($e['username']) . "</b></a></td>\n";
            }
        } else {
            $htmlout .= "<td>" . ($mod ? $e["ip"] : preg_replace('/\\.\\d+$/', ".xxx", $e["ip"])) . "</td>\n";
        }
        $secs = max(1, $now - $e["st"] - ($now - $e["la"]));
        $htmlout .= "<td align='center'>" . ($e['connectable'] == "yes" ? "{$lang['peerslist_yes']}" : "<font color='red'>{$lang['peerslist_no']}</font>") . "</td>\n";
        $htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
        $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</span></td>\n";
        $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'>" . mksize($e["downloaded"]) . "</td>") . "\n";
        if ($e["seeder"] == "no") {
            $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</span></td>") . "\n";
        } else {
            $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e['st'])) . "/s</span></td>") . "\n";
        }
        $htmlout .= "<td align=\"right\">" . member_ratio($e['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $e['downloaded']) . "</td>\n";
        $htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["to_go"] / $torrent["size"])) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["st"]) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
        $htmlout .= "<td align='left'>" . htmlsafechars(getagent($e["agent"], $e['peer_id'])) . "</td>\n";
        $htmlout .= "</tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:43,代码来源:peerlist.php

示例2: dltable

function dltable($name, $arr, $torrent)
{
    global $CURUSER, $lang, $INSTALLER09;
    $htmlout = '';
    if (!count($arr)) {
        return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n";
    }
    $htmlout = "\n";
    $htmlout .= "<table class='table table-bordered'>\n";
    $htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>") . "" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>") . "" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
    $now = TIME_NOW;
    $mod = $CURUSER['class'] >= UC_STAFF;
    foreach ($arr as $e) {
        $htmlout .= "<tr>\n";
        $upspeed = $e["upspeed"] > 0 ? mksize($e["upspeed"]) : ($e["seedtime"] > 0 ? mksize($e["uploaded"] / ($e["seedtime"] + $e["leechtime"])) : mksize(0));
        $downspeed = $e["downspeed"] > 0 ? mksize($e["downspeed"]) : ($e["leechtime"] > 0 ? mksize($e["downloaded"] / $e["leechtime"]) : mksize(0));
        if ($e['username']) {
            if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['uid'] || $e['anonymous'] == 'yes' or $e['paranoia'] >= 2 && $CURUSER['id'] != $e['uid']) && $CURUSER['class'] < UC_STAFF) {
                $htmlout .= "<td><b>Kezer Soze</b></td>\n";
            } else {
                $htmlout .= "<td><a href='userdetails.php?id=" . (int) $e['uid'] . "'><b>" . htmlsafechars($e['username']) . "</b></a></td>\n";
            }
        } else {
            $htmlout .= "<td>" . ($mod ? XBT_IP_CONVERT($e["ipa"]) : preg_replace('/\\.\\d+$/', ".xxx", XBT_IP_CONVERT($e["ipa"]))) . "</td>\n";
        }
        $htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
        $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . htmlsafechars($upspeed) . "/s</span></td>\n";
        $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'>" . mksize($e["downloaded"]) . "</td>") . "\n";
        $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . htmlsafechars($downspeed) . "/s</span></td>") . "\n";
        $htmlout .= "<td align=\"right\">" . member_ratio($e['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $e['downloaded']) . "</td>\n";
        $htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["left"] / $torrent["size"])) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
        $htmlout .= "<td align='left'>" . htmlsafechars(getagent($e["peer_id"], $e['peer_id'])) . "</td>\n";
        $htmlout .= "</tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:38,代码来源:peerlist_xbt.php

示例3: htmlsafechars

            if ($array[0] == 0) {
                $ipstr = $user['last_ip'];
            } else {
                $ipstr = "<a href='{$INSTALLER09['baseurl']}/staffpanel.php?tool=testip&amp;action=testip&amp;ip=" . htmlsafechars($user['last_ip']) . "'><font color='#FF0000'><b>" . htmlsafechars($user["last_ip"]) . "</b></font></a>";
            }
        } else {
            $ipstr = "---";
        }
        $resip = sql_query("SELECT ip FROM ips WHERE userid=" . sqlesc($user["id"]) . " GROUP BY ips.ip") or sqlerr(__FILE__, __LINE__);
        $iphistory = mysqli_num_rows($resip);
        if ($user["invitedby"] > 0) {
            $res2 = sql_query("SELECT username FROM users WHERE id=" . sqlesc($user["invitedby"]) . "");
            $array = mysqli_fetch_assoc($res2);
            $invitedby = $array["username"];
            if ($invitedby == "") {
                $invitedby = "<i>[{$lang['ipsearch_deleted']}]</i>";
            } else {
                $invitedby = "<a href='{$INSTALLER09['baseurl']}/userdetails.php?id={$user['invitedby']}'>" . htmlsafechars($invitedby) . "</a>";
            }
        } else {
            $invitedby = "--";
        }
        $HTMLOUT .= "<tr>\r\n\t   \t<td><b><a href='{$INSTALLER09['baseurl']}/userdetails.php?id=" . (int) $user['id'] . "'></a></b>" . format_username($user) . "</td>" . "<td>" . member_ratio($user['uploaded'], $user['downloaded']) . "</td>\r\n\t\t  <td style='max-width:130px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;'>" . $user['email'] . "</td><td>" . $ipstr . "</td>\r\n\t\t  <td><div class='text-center'>" . get_date($user['last_access'], 'DATE', 1, 0) . "</div></td>\r\n\t\t  <td><div class='text-center'><b><a href='{$INSTALLER09['baseurl']}/staffpanel.php?tool=iphistory&amp;action=iphistory&amp;id=" . (int) $user['id'] . "'>" . htmlsafechars($iphistory) . "</a></b></div></td>\r\n\t\t  <td><div class='text-center'>" . get_date($user['access'], 'DATE', 1, 0) . "</div></td>\r\n\t\t  <td><div class='text-center'>" . get_date($user['added'], 'DATE', 1, 0) . "</div></td>\r\n\t\t  <td><div class='text-center'>" . $invitedby . "</div></td>\r\n\t\t  </tr>\n";
    }
    $HTMLOUT .= "</table>";
    if ($count > $perpage) {
        $pager['pagerbottom'];
    }
}
echo stdhead($lang['ipsearch_stdhead']) . $HTMLOUT . stdfoot();
die;
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:31,代码来源:ipsearch.php

示例4: round

    $HTMLOUT .= "<tr><td class='rowhead'>IP History</td><td align='left'>This user has earlier used <b><a href='{$INSTALLER09['baseurl']}/staffpanel.php?tool=iphistory&amp;action=iphistory&amp;id=" . $user['id'] . "'>{$iphistory['ips']} different IP addresses</a></b></td></tr>\n";
}
//==Uploaded/downloaded
if ($user['paranoia'] < 2 || $CURUSER['id'] == $id || $CURUSER['class'] >= UC_STAFF) {
    $days = round((time() - $user['added']) / 86400);
    $HTMLOUT .= "<tr><td class='rowhead'>{$lang['userdetails_downloaded']}</td><td align='left'>" . mksize($user['downloaded']) . " {$lang['userdetails_daily']}" . ($days > 1 ? mksize($user['downloaded'] / $days) : mksize($user['downloaded'])) . "</td></tr>\r\n    <tr><td class='rowhead'>{$lang['userdetails_uploaded']}</td><td align='left'>" . mksize($user['uploaded']) . " {$lang['userdetails_daily']}" . ($days > 1 ? mksize($user['uploaded'] / $days) : mksize($user['uploaded'])) . "</td></tr>\n";
}
//=== paranoia settings
if ($user['paranoia'] < 2 || $CURUSER['id'] == $id || $CURUSER['class'] >= UC_STAFF) {
    if ($user['downloaded'] > 0) {
        $HTMLOUT .= '<tr>
			<td class="rowhead" style="vertical-align: middle">Share ratio</td>
			<td align="left" valign="middle" style="padding-top: 1px; padding-bottom: 0px">
	<table border="0"cellspacing="0" cellpadding="0">
		<tr>
			<td class="embedded">' . member_ratio($user['uploaded'], $user['downloaded']) . '</td>
			<td class="embedded">&nbsp;&nbsp;' . get_user_ratio_image($user['uploaded'] / $user['downloaded']) . '</td>
		</tr>
	</table>
			</td>
		</tr>';
    }
}
//=== testing concept of "share ratio"
$cache_share_ratio = $mc1->get_value('share_ratio_' . $id);
if ($cache_share_ratio === false) {
    $cache_share_ratio = mysql_fetch_assoc(sql_query("SELECT SUM(seedtime) AS seed_time_total, COUNT(id) AS total_number FROM snatched WHERE seedtime > '0' AND userid =" . $user['id'] . ""));
    $cache_share_ratio['total_number'] = (int) $cache_share_ratio['total_number'];
    $cache_share_ratio['seed_time_total'] = (int) $cache_share_ratio['seed_time_total'];
    $mc1->cache_value('share_ratio_' . $id, $cache_share_ratio, $INSTALLER09['expires']['share_ratio']);
}
开发者ID:CharlieHD,项目名称:U-232-V2,代码行数:31,代码来源:userdetails.php

示例5: mysql_fetch_assoc

$row = mysql_fetch_assoc($res2);
$count = (int) $row['c'];
if ($count > 0) {
    $pager = pager(25, $count, 'viewrequests.php?');
    $res = sql_query('select users.id as userid,users.username, users.downloaded, users.title, users.class, users.donor, users.warned, users.leechwarn, users.chatpost, users.pirate, users.king, users.enabled, users.uploaded, requests.id as requestid, requests.request, requests.added from voted_requests inner join users on voted_requests.userid = users.id inner join requests on voted_requests.requestid = requests.id WHERE voted_requests.requestid =' . $id . ' ' . $pager['limit']) or sqlerr(__FILE__, __LINE__);
    $res2 = sql_query("select request from requests where id={$id}");
    $arr2 = mysql_fetch_assoc($res2);
    $HTMLOUT .= "<h1>{$lang['view_voters']}<a class='altlink' href='viewrequests.php?id={$id}&amp;req_details'><b>" . htmlspecialchars($arr2['request']) . "</b></a></h1>";
    $HTMLOUT .= "<p>{$lang['view_vote_this']}<a class='altlink' href='viewrequests.php?id={$id}&amp;req_vote'><b>{$lang['view_req']}</b></a></p>";
    $HTMLOUT .= $pager['pagertop'];
    if (mysql_num_rows($res) == 0) {
        $HTMLOUT .= "<p align='center'><b>{$lang['view_nothing']}</b></p>\n";
    } else {
        $HTMLOUT .= "<table border='1' cellspacing='0' cellpadding='5'>\r\n<tr><td class='colhead'>{$lang['view_name']}</td><td class='colhead' align='left'>{$lang['view_upl']}</td><td class='colhead' align='left'>{$lang['view_dl']}</td>\r\n<td class='colhead' align='left'>{$lang['view_ratio']}</td></tr>\n";
        while ($arr = mysql_fetch_assoc($res)) {
            $ratio = member_ratio($arr['uploaded'], $arr['downloaded']);
            $uploaded = mksize($arr['uploaded']);
            $joindate = get_date($arr['added'], '');
            $downloaded = mksize($arr["downloaded"]);
            $enabled = $arr['enabled'] == 'no' ? '<span style="color:red;">No</span>' : '<span style="color:green;">Yes</span>';
            $arr['id'] = $arr['userid'];
            $username = format_username($arr);
            $HTMLOUT .= "<tr><td><b>{$username}</b></td>\r\n             <td align='left'>{$uploaded}</td>\r\n             <td align='left'>{$downloaded}</td>\r\n             <td align='left'>{$ratio}</td></tr>\n";
        }
        $HTMLOUT .= "</table>\n";
    }
    $HTMLOUT .= $pager['pagerbottom'];
} else {
    $HTMLOUT .= "{$lang['req_nothing']}";
}
/////////////////////// HTML OUTPUT //////////////////////////////
开发者ID:CharlieHD,项目名称:U-232-V2,代码行数:31,代码来源:votes_view.php

示例6: elseif

$ratio = $CURUSER['downloaded'] > 0 ? $CURUSER['uploaded'] / $CURUSER['downloaded'] : 0;
if ($CURUSER['class'] < UC_VIP) {
    $gigsdowned = $CURUSER['downloaded'];
    if ($gigsdowned >= $gigsneeded) {
        $gigs = $CURUSER['uploaded'] / (1024 * 1024 * 1024);
    }
}
$HTMLOUT .= "<h3>{$lang['add_rules']}</h3>";
$HTMLOUT .= "{$lang['add_rules1']}<b> " . $TBDEV['req_min_ratio'] . "</b>{$lang['add_rules2']}<b>" . $TBDEV['req_gigs_upped'] . " GB</b>.<br />" . ($TBDEV['karma'] ? "{$lang['add_rules3']}<b><a class='altlink' href='mybonus.php'>" . $TBDEV['req_cost_bonus'] . " Karma Points</a></b>....<br /><br />" : '') . " \r\n{$lang['add_rules4']}<a class='altlink' href='userdetails.php?id=" . $CURUSER['id'] . "'>" . $CURUSER['username'] . "</a>, ";
if ($TBDEV['karma'] && isset($CURUSER['seedbonus']) && $CURUSER['seedbonus'] < $TBDEV['req_cost_bonus']) {
    $HTMLOUT .= "{$lang['add_rules7']}<a class='altlink' href='mybonus.php'>Karma Points</a> ...\r\n        {$lang['add_rules8']}<p>{$lang['add_rules9']}\r\n        <a class='altlink' href='viewrequests.php'><b>{$lang['add_rules6']}</b></a></p>\n<br /><br />";
} elseif ($gigsupped < $gigsneeded && $CURUSER['class'] < UC_VIP) {
    $HTMLOUT .= "{$lang['add_rules10']}<b>" . $TBDEV['req_gigs_upped'] . " GB</b>{$lang['add_rules11']}<p>\r\n    {$lang['add_rules9']}<a class='altlink' href='viewrequests.php'><b>{$lang['add_rules6']}</b></a></p>\n\r\n    <br /><br />";
} elseif ($ratio < $TBDEV['req_min_ratio'] && $CURUSER['class'] < UC_VIP) {
    $sss = $gigsupped < $gigsneeded ? 's' : '';
    $HTMLOUT .= "{$lang['add_rules15']}<b>" . member_ratio($CURUSER['uploaded'], $CURUSER['downloaded']) . "</b>" . ($gigsupped < $gigsneeded ? "{$lang['add_rules12']}<b> " . round($gigs, 2) . ' GB</b>' : '') . " {$lang['add_rules13']}{$sss}{$lang['add_rules14']}<br /><br />\r\n         <p>{$lang['add_rules9']}<a href='viewrequests.php'><b>{$lang['add_rules6']}</b></a></p>\n<br /><br />";
} else {
    $HTMLOUT .= "{$lang['add_rules5']} \r\n    <a class='altlink' href='viewrequests.php'>{$lang['add_rules6']}</a></p>\n";
    /** search first **/
    $HTMLOUT .= "<form method='get' action='browse.php'><table width='750px' border='1' cellspacing='0' cellpadding='5'><tr><td class='colhead' align='left'>\r\n{$lang['add_search_before']}</td></tr><tr><td align='left'>\r\n<input type='text' name='search' size='40' value='' class='btn' />{$lang['add_in']}<select name='cat'> <option value='0'>{$lang['add_all_types']}</option>\r\n";
    $catdropdown = '';
    foreach ($cats as $cat) {
        $catdropdown .= "<option value='" . $cat['id'] . "'";
        if ($cat['id'] == (isset($_GET['cat']) ? $_GET['cat'] : '')) {
            $catdropdown .= " selected='selected'";
        }
        $catdropdown .= ">" . htmlspecialchars($cat['name']) . "</option>\n";
    }
    $deadchkbox = "<input type='checkbox' name='incldead' value='1'";
    if (isset($_GET['incldead'])) {
        $deadchkbox .= " checked='checked'";
开发者ID:thefkboss,项目名称:U-232,代码行数:31,代码来源:add_request.php

示例7: while

		<td class="colhead"><b>' . $lang['hitnrun_torrent'] . '</b></td>
		<td class="colhead"><b>' . $lang['hitnrun_times'] . '</b></td>
		<td class="colhead"><b>' . $lang['hitnrun_stats'] . '</b></td>
		<td class="colhead">' . $lang['hitnrun_actions'] . '</td>' : '<tr><td>' . $lang['hitnrun_none'] . '</td>') . '</tr>';
while ($hit_and_run_arr = mysqli_fetch_assoc($hit_and_run_rez)) {
    //=== Xbt Tracker or Default Announce
    $Xbt_Seed = XBT_TRACKER === true ? $hit_and_run_arr['active'] !== 1 : $hit_and_run_arr['seeder'] !== 'yes';
    $Uid_ID = XBT_TRACKER === true ? $hit_and_run_arr['uid'] : $hit_and_run_arr['userid'];
    $S_date = XBT_TRACKER === true ? $hit_and_run_arr['started'] : $hit_and_run_arr['start_date'];
    $T_ID = XBT_TRACKER === true ? $hit_and_run_arr['fid'] : $hit_and_run_arr['torrentid'];
    $C_Date = XBT_TRACKER === true ? $hit_and_run_arr['completedtime'] : $hit_and_run_arr['complete_date'];
    //=== if really seeding list them
    if ($Xbt_Seed) {
        if ($Uid_ID !== $hit_and_run_arr['owner']) {
            $ratio_site = member_ratio($hit_and_run_arr['up'], $INSTALLER09['ratio_free'] ? '0' : $hit_and_run_arr['down']);
            $ratio_torrent = member_ratio($hit_and_run_arr['uload'], $INSTALLER09['ratio_free'] ? '0' : $hit_and_run_arr['dload']);
            $avatar = $CURUSER['avatars'] == 'yes' ? $hit_and_run_arr['avatar'] == '' ? '<img src="pic/default_avatar.gif"  width="40" alt="default avatar" />' : '<img src="' . htmlsafechars($hit_and_run_arr['avatar']) . '" alt="avatar"  width="40" />' : '';
            $torrent_needed_seed_time = $hit_and_run_arr['seedtime'];
            //=== get times per class
            switch (true) {
                case $hit_and_run_arr['class'] < UC_POWER_USER:
                    $days_3 = 3 * 86400;
                    //== 3 days
                    $days_14 = 2 * 86400;
                    //== 2 days
                    $days_over_14 = 86400;
                    //== 1 day
                    break;
                case $hit_and_run_arr['class'] < UC_STAFF:
                    $days_3 = 2 * 86400;
                    //== 2 days
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:31,代码来源:hit_and_run.php

示例8: htmlsafechars

            $HTMLOUT .= "<tr>\n            <td>{$elapsed}</td>\n            <td><a href='staffpanel.php?tool=uploadapps&amp;action=viewapp&amp;id=" . (int) $arr['id'] . "'>{$lang['uploadapps_viewapp']}</a></td>\n            <td><a href='{$INSTALLER09['baseurl']}/userdetails.php?id=" . (int) $arr['uid'] . "'>" . htmlsafechars($arr['username']) . "</a></td>\n            <td>{$membertime}</td>\n            <td>" . get_user_class_name($arr["class"]) . "</td>\n            <td>" . mksize($arr["uploaded"]) . "</td>\n            <td>" . member_ratio($arr['uploaded'], $INSTALLER09['ratio_free'] ? '0' : $arr['downloaded']) . "</td>\n            <td>{$status}</td>\n            <td><input type=\"checkbox\" name=\"deleteapp[]\" value=\"" . (int) $arr['id'] . "\" /></td>\n            </tr>\n";
        }
        $HTMLOUT .= "</table>\n        <div align='right'><input type='submit' value='Delete' /></div>\n        </td></tr></table></form>\n";
        if ($count > $perpage) {
            $HTMLOUT .= $pager['pagerbottom'];
        }
    }
}
//== View application
if ($action == "viewapp") {
    $id = (int) $_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=" . sqlesc($id)) or sqlerr(__FILE__, __LINE__);
    $arr = mysqli_fetch_assoc($res);
    $membertime = get_date($arr['added'], '', 0, 1);
    $elapsed = get_date($arr['applied'], '', 0, 1);
    $HTMLOUT .= "<h1 align='center'>Uploader application</h1>\n    <table width='750' border='1' cellspacing='0' cellpadding='5'>\n    <tr>\n    <td class='rowhead' width='25%'>{$lang['uploadapps_username1']} </td><td><a href='{$INSTALLER09['baseurl']}/userdetails.php?id=" . (int) $arr['uid'] . "'>" . htmlsafechars($arr['username']) . "</a></td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_joined']} </td><td>" . htmlsafechars($membertime) . "</td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_upped1']} </td><td>" . htmlsafechars(mksize($arr["uploaded"])) . "</td>\n    </tr>\n    " . ($INSTALLER09['ratio_free'] ? "" : "<tr>\n    <td class='rowhead'>{$lang['uploadapps_downed']} </td><td>" . htmlsafechars(mksize($arr["downloaded"])) . "</td>\n    </tr>") . "\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_ratio1']} </td><td>" . member_ratio($arr['uploaded'], $INSTALLER09['ratio_free'] ? '0' : $arr['downloaded']) . "</td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_connectable']} </td><td>" . htmlsafechars($arr["connectable"]) . "</td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_class1']} </td><td>" . get_user_class_name($arr["class"]) . "</td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_applied1']} </td><td>" . htmlsafechars($elapsed) . "</td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_upspeed']} </td><td>" . htmlsafechars($arr["speed"]) . "</td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_offer']} </td><td>" . htmlsafechars($arr["offer"]) . "</td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_why']} </td><td>" . htmlsafechars($arr["reason"]) . "</td>\n    </tr>\n    <tr>\n    <td class='rowhead'>{$lang['uploadapps_uploader']} </td><td>" . htmlsafechars($arr["sites"]) . "</td>\n    </tr>";
    if ($arr["sitenames"] != "") {
        $HTMLOUT .= "<tr><td class='rowhead'>{$lang['uploadapps_sites']} </td><td>" . htmlsafechars($arr["sitenames"]) . "</td></tr>\n    <tr><td class='rowhead'>{$lang['uploadapps_axx']} </td><td>" . htmlsafechars($arr["scene"]) . "</td></tr>\n    <tr><td colspan='2'>{$lang['uploadapps_create']} <b>" . htmlsafechars($arr["creating"]) . "</b><br />{$lang['uploadapps_seeding']} <b>" . htmlsafechars($arr["seeding"]) . "</b></td></tr>";
    }
    if ($arr["status"] == "pending") {
        $HTMLOUT .= "<tr><td align='center' colspan='2'><form method='post' action='staffpanel.php?tool=uploadapps&amp;action=acceptapp'><input name='id' type='hidden' value='" . (int) $arr["id"] . "' /><b>{$lang['uploadapps_note']}</b><br /><input type='text' name='note' size='40' /> <input type='submit' value='{$lang['uploadapps_accept']}' style='height: 20px' /></form><br /><form method='post' action='staffpanel.php?tool=uploadapps&amp;action=rejectapp'><input name='id' type='hidden' value='" . (int) $arr["id"] . "' /><b>{$lang['uploadapps_reason']}</b><br /><input type='text' name='reason' size='40' /> <input type='submit' value='{$lang['uploadapps_reject']}' style='height: 20px' /></form></td></tr></table>";
    } else {
        $HTMLOUT .= "<tr><td colspan='2' align='center'>{$lang['uploadapps_application']} " . ($arr["status"] == "accepted" ? "accepted" : "rejected") . " by <b>" . htmlsafechars($arr["moderator"]) . "</b><br />{$lang['uploadapps_comm']}" . htmlsafechars($arr["comment"]) . "</td></tr></table>\n    <div align='center'><a href='{$INSTALLER09['baseurl']}/staffpanel.php?tool=uploadapps&amp;action=app'>{$lang['uploadapps_return']}</a></div>";
    }
}
//== Accept application
if ($action == "acceptapp") {
    $id = 0 + $_POST["id"];
    if (!is_valid_id($id)) {
        stderr($lang['uploadapps_error'], $lang['uploadapps_noid']);
    }
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:31,代码来源:uploadapps.php

示例9: StatusBar

function StatusBar()
{
    global $CURUSER, $INSTALLER09, $lang, $rep_is_on, $mc1, $msgalert;
    if (!$CURUSER) {
        return "";
    }
    $upped = mksize($CURUSER['uploaded']);
    $downed = mksize($CURUSER['downloaded']);
    //==Memcache unread pms
    $PMCount = 0;
    $unread1 = $mc1->get_value('inbox_new_sb_' . $CURUSER['id']);
    if ($unread1 === false) {
        $res1 = sql_query("SELECT COUNT(id) FROM messages WHERE receiver='" . $CURUSER['id'] . "' AND unread = 'yes' AND location='1'") or sqlerr(__LINE__, __FILE__);
        list($PMCount) = mysql_fetch_row($res1);
        $PMCount = (int) $PMCount;
        $unread1 = $mc1->cache_value('inbox_new_sb_' . $CURUSER['id'], $PMCount, $INSTALLER09['expires']['unread']);
    }
    $inbox = $unread1 == 1 ? "{$unread1}&nbsp;{$lang['gl_msg_singular']}" : "{$unread1}&nbsp;{$lang['gl_msg_plural']}";
    //==Memcache peers
    $MyPeersCache = $mc1->get_value('MyPeers_' . $CURUSER['id']);
    if ($MyPeersCache == false) {
        $seed['yes'] = $seed['no'] = 0;
        $seed['conn'] = 3;
        $r = sql_query("select count(id) as count, seeder, connectable FROM peers WHERE userid=" . $CURUSER['id'] . " group by seeder");
        while ($a = mysql_fetch_assoc($r)) {
            $key = $a['seeder'] == 'yes' ? 'yes' : 'no';
            $seed[$key] = number_format(0 + $a['count']);
            $seed['conn'] = $a['connectable'] == 'no' ? 1 : 2;
        }
        $mc1->cache_value('MyPeers_' . $CURUSER['id'], $seed, $INSTALLER09['expires']['MyPeers_']);
        unset($r, $a);
    } else {
        $seed = $MyPeersCache;
    }
    // for display connectable  1 / 2 / 3
    if (!empty($seed['conn'])) {
        switch ($seed['conn']) {
            case 1:
                $connectable = "<img src='{$INSTALLER09['pic_base_url']}notcon.png' alt='Not Connectable' title='Not Connectable' />";
                break;
            case 2:
                $connectable = "<img src='{$INSTALLER09['pic_base_url']}yescon.png' alt='Connectable' title='Connectable' />";
                break;
            default:
                $connectable = "N/A";
        }
    } else {
        $connectable = 'N/A';
    }
    //////////// REP SYSTEM /////////////
    $member_reputation = get_reputation($CURUSER);
    ////////////// REP SYSTEM END //////////
    $usrclass = "";
    if ($CURUSER['override_class'] != 255) {
        $usrclass = "&nbsp;<b>(" . get_user_class_name($CURUSER['class']) . ")</b>&nbsp;";
    } else {
        if ($CURUSER['class'] >= UC_STAFF) {
            $usrclass = "&nbsp;<a href='./setclass.php'><b>(" . get_user_class_name($CURUSER['class']) . ")</b></a>&nbsp;";
        }
    }
    $StatusBar = '';
    $StatusBar = "\r\n       <!-- Installer09 Source - Print Statusbar/User Menu -->\r\n       <script type='text/javascript'>\r\n       //<![CDATA[\r\n       function showSlidingDiv(){\r\n       \$('#slidingDiv').animate({'height': 'toggle'}, { duration: 1000 });\r\n       }\r\n       //]]>\r\n       </script>\r\n      <div id='base_header_fly'>\r\n       <div id='base_usermenu'>{$lang['gl_msg_welcome']},&nbsp;" . format_username($CURUSER) . "<span class='base_usermenu_arrow'><a href='#' onclick='showSlidingDiv(); return false;'><img src='templates/1/images/usermenu_arrow.png' alt='' /></a></span></div>\r\n        <div id='slidingDiv'>\r\n         <div class='slide_head'>:: Personal Stats</div>\r\n         <div class='slide_a'>User Class</div><div class='slide_b'>{$usrclass}</div>\r\n         <div class='slide_c'>Reputation</div><div class='slide_d'>{$member_reputation}</div>\r\n         <div class='slide_a'>Invites</div><div class='slide_b'><a href='./invite.php'>{$CURUSER['invites']}</a></div>\r\n         <div class='slide_c'>Bonus Points</div><div class='slide_d'><a href='./mybonus.php'>{$CURUSER['seedbonus']}</a></div>\r\n         <div class='slide_head'>:: Torrent Stats</div>\r\n         <div class='slide_a'>Share Ratio</div><div class='slide_b'>" . member_ratio($CURUSER['uploaded'], $CURUSER['downloaded']) . "</div>\r\n         <div class='slide_c'>Uploaded</div><div class='slide_d'>{$upped}</div>\r\n         <div class='slide_a'>Downloaded</div><div class='slide_b'>{$downed}</div>\r\n         <div class='slide_c'>Uploading Files</div><div class='slide_d'>{$seed['yes']}</div>\r\n         <div class='slide_a'>Downloading Files</div><div class='slide_b'>{$seed['no']}</div>\r\n         <div class='slide_c'>Connectable</div><div class='slide_d'>{$connectable}</div>\r\n         <div class='slide_head'>:: Games &amp; Playhouse</div>\r\n         <div class='slide_a'>Play Blackjack</div><div class='slide_b'><a href='./blackjack.php'>Play here</a></div>\r\n         <div class='slide_c'>Play Casino</div><div class='slide_d'><a href='./casino.php'>Play here</a></div>\r\n         <div class='slide_head'>:: Information</div>\r\n         <div class='slide_a'>Contact Staff</div><div class='slide_b'><a href='./contactstaff.php'>Send Message</a></div>\r\n         <div class='slide_c'>Change Theme</div><div class='slide_d'><a href='#' onclick='themes();'>Click here</a></div>\r\n         <div class='slide_a'>Radio</div><div class='slide_b'><a href='#' onclick='radio();'>Click here</a></div>\r\n         <div class='slide_c'>Donate us</div><div class='slide_d'><a href='./donate.php'>Click here</a></div>\r\n         <div class='slide_a'>Torrent Freak News</div><div class='slide_b'><a href='./rsstfreak.php'>Click here</a></div>\r\n         " . (isset($CURUSER) && $CURUSER['class'] <= UC_VIP ? "\r\n         <div class='slide_c'>Uploader App</div><div class='slide_d'><a href='uploadapp.php'>Send Application</a></div>" : "") . "\r\n        " . (isset($CURUSER) && $CURUSER['got_blocks'] == 'yes' ? "\r\n         <div class='slide_head'>:: Site Config</div>\r\n         <div class='slide_a'>My Blocks</div><div class='slide_b'><a href='./user_blocks.php'>Click here</a></div>" : "") . "\r\n         </div>\r\n         <div id='base_icons'>\r\n         <ul class='um_menu'>\r\n         <li><a href='messages.php'><img src='templates/1/images/main.jpg' alt='' title='Your Private Messages' /></a></li>\r\n         <li><a href='usercp.php'><img src='templates/1/images/settings.jpg' alt='Settings' title='Personal Settings' /></a></li>\r\n         " . (isset($CURUSER) && $CURUSER['class'] >= UC_STAFF ? "<li><a href='staffpanel.php'><img src='templates/1/images/staff.png' alt='Staff' title='Staffpanel' /></a></li>" : "") . "\r\n        <li><a href='logout.php'><img src='templates/1/images/signout.jpg' alt='Logout' title='SignOut' /></a></li>\r\n        </ul>\r\n       </div>\r\n      </div>";
    return $StatusBar;
}
开发者ID:CharlieHD,项目名称:U-232-V2,代码行数:64,代码来源:template.php

示例10: htmlspecialchars

            } else {
                $ipstr = "<a href='{$INSTALLER09['baseurl']}/staffpanel.php?tool=testip&amp;action=testip&amp;ip=" . $user['last_ip'] . "'><font color='#FF0000'><b>" . htmlspecialchars($user["last_ip"]) . "</b></font></a>";
            }
        } else {
            $ipstr = "---";
        }
        $resip = sql_query("SELECT ip FROM ips WHERE userid=" . sqlesc($user["id"]) . " GROUP BY ips.ip") or sqlerr(__FILE__, __LINE__);
        $iphistory = mysql_num_rows($resip);
        if ($user["invitedby"] > 0) {
            $res2 = sql_query("SELECT username FROM users WHERE id=" . sqlesc($user["invitedby"]) . "");
            $array = mysql_fetch_assoc($res2);
            $invitedby = $array["username"];
            if ($invitedby == "") {
                $invitedby = "<i>[Deleted]</i>";
            } else {
                $invitedby = "<a href='{$INSTALLER09['baseurl']}/userdetails.php?id={$user['invitedby']}'>" . htmlspecialchars($invitedby) . "</a>";
            }
        } else {
            $invitedby = "--";
        }
        $HTMLOUT .= "<tr>\r\n\t   \t<td><b><a href='{$INSTALLER09['baseurl']}/userdetails.php?id=" . $user['id'] . "'></a></b>" . format_username($user) . "</td>" . "<td>" . member_ratio($user['uploaded'], $user['downloaded']) . "</td>\r\n\t\t  <td>" . $user['email'] . "</td><td>" . $ipstr . "</td>\r\n\t\t  <td><div align='center'>" . get_date($user['last_access'], 'DATE', 1, 0) . "</div></td>\r\n\t\t  <td><div align='center'><b><a href='{$INSTALLER09['baseurl']}/staffpanel.php?tool=iphistory&amp;action=iphistory&amp;id=" . $user['id'] . "'>" . htmlspecialchars($iphistory) . "</a></b></div></td>\r\n\t\t  <td><div align='center'>" . get_date($user['access'], 'DATE', 1, 0) . "</div></td>\r\n\t\t  <td><div align='center'>" . get_date($user['added'], 'DATE', 1, 0) . "</div></td>\r\n\t\t  <td><div align='center'>" . $invitedby . "</div></td>\r\n\t\t  </tr>\n";
    }
    $HTMLOUT .= "</table>";
    if ($count > $perpage) {
        $pager['pagerbottom'];
    }
    $HTMLOUT .= end_frame();
}
$HTMLOUT .= end_main_frame();
echo stdhead("Ip Search") . $HTMLOUT . stdfoot();
die;
开发者ID:CharlieHD,项目名称:U-232-V2,代码行数:31,代码来源:ipsearch.php

示例11: format_comment

 <tr>
 <td class="two" align="right">description:</td>
 <td class="two" align="left">' . format_comment($body) . '</td>
 </tr>
 <tr>
 <td class="two" align="right">category:</td>
 <td class="two" align="left"><img border="0" src="pic/caticons/' . $CURUSER['categorie_icon'] . '/' . htmlsafechars($cat_image, ENT_QUOTES) . '" alt="' . htmlsafechars($cat_name, ENT_QUOTES) . '" /></td>
  </tr>
  <tr>
  <td class="two" align="right">link:</td>
  <td class="two" align="left"><a class="altlink" href="' . htmlsafechars($link, ENT_QUOTES) . '" target="_blank">' . htmlsafechars($link, ENT_QUOTES) . '</a></td>
  </tr>
  <tr>
  <td class="two" align="right">requested by:</td>
  <td class="two" align="left">' . print_user_stuff($CURUSER) . ' [ ' . get_user_class_name($CURUSER['class']) . ' ]   
  ratio: ' . member_ratio($CURUSER['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $CURUSER['downloaded']) . get_user_ratio_image($CURUSER['uploaded'], $INSTALLER09['ratio_free'] ? "1" : $CURUSER['downloaded']) . '</td>
  </tr>
  </table>
  <br />' : '') . '
  <table class="table table-hover table-bordered">
  <tr>
  <td class="colhead" align="center" colspan="2"><h1>Making a Request</h1></td>
  </tr>
  <tr>
  <td align="center" colspan="2" class="two">Before you make an request, <a class="altlink" href="search.php">Search</a> 
  to be sure it has not yet been requested, offered, or uploaded!<br /><br />Be sure to fill in all fields!</td>
  </tr>
  <tr>
  <td class="two" align="right">name:</td>
  <td class="two" align="left"><input type="text" size="80"  name="request_name" value="' . htmlsafechars($request_name, ENT_QUOTES) . '" class="required" /></td>
  </tr>
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:31,代码来源:requests.php

示例12: sql_query

    }
    if ($ip != $ras['ip']) {
        $ros = sql_query("SELECT id, username, class, email, chatpost, pirate, king, leechwarn, added, last_access, downloaded, uploaded, ip, warned, donor, enabled FROM users WHERE ip=" . sqlesc($ras['ip']) . " ORDER BY id") or sqlerr(__FILE__, __LINE__);
        $num2 = mysqli_num_rows($ros);
        if ($num2 > 1) {
            $uc++;
            while ($arr = mysqli_fetch_assoc($ros)) {
                if ($arr['added'] == '0') {
                    $arr['added'] = '-';
                }
                if ($arr['last_access'] == '0') {
                    $arr['last_access'] = '-';
                }
                $uploaded = mksize($arr["uploaded"]);
                $downloaded = mksize($arr["downloaded"]);
                $added = get_date($arr['added'], 'DATE', 1, 0);
                $last_access = get_date($arr['last_access'], '', 1, 0);
                if ($uc % 2 == 0) {
                    $utc = "";
                } else {
                    $utc = " bgcolor=\"333333\"";
                }
                $HTMLOUT .= "<tr{$utc}><td align='left'><a href='userdetails.php?id=" . (int) $arr['id'] . "'>" . format_username($arr, true) . "</a></td>\n                                  <td align='center'>" . htmlsafechars($arr['email']) . "</td>\n                                  <td align='center'>{$added}</td>\n                                  <td align='center'>{$last_access}</td>\n                                  " . ($INSTALLER09['ratio_free'] ? "" : "<td align='center'>{$downloaded}</td>") . "\n                                  <td align='center'>{$uploaded}</td>\n                                  <td align='center'>" . member_ratio($arr['uploaded'], $INSTALLER09['ratio_free'] ? '0' : $arr['downloaded']) . "</td>\n                                  <td align='center'><span style=\"font-weight: bold;\">" . htmlsafechars($arr['ip']) . "</span></td>\n</tr>\n";
                $ip = htmlsafechars($arr["ip"]);
            }
        }
    }
}
$HTMLOUT .= end_table();
$HTMLOUT .= end_frame();
echo stdhead($lang['ipcheck_stdhead']) . $HTMLOUT . stdfoot();
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:31,代码来源:ipcheck.php

示例13: sql_query

} else {
    $HTMLOUT .= '<tr><td class="rowhead">Invited&nbsp;By</td><td align="left"><b>Open Signups</b></td></tr>';
}
//=== members invites by snuggles
$rez_invited = sql_query('SELECT id, class, username, email, uploaded, downloaded, status, warned, suspended, enabled, donor, email, ip, chatpost, leechwarn, pirate, king FROM users WHERE invitedby = ' . sqlesc($user['id']) . ' ORDER BY added');
$inviteted_by_this_member = '';
if (mysqli_num_rows($rez_invited) < 1) {
    $inviteted_by_this_member .= 'No invitees yet.';
} else {
    $inviteted_by_this_member .= '<table width="100%" border="1" cellspacing="0" cellpadding="5">
		<tr><td class="colhead"><b>Username / IP</b></td>
		<td class="colhead"><b>Email</b></td>
		<td class="colhead"><b>Uploaded</b></td>
		' . ($INSTALLER09['ratio_free'] ? '' : '<td class="colhead"><b>Downloaded</b></td>') . '
		<td class="colhead"><b>Ratio</b></td>
		<td class="colhead"><b>Status</b></td></tr>';
    while ($arr_invited = mysqli_fetch_assoc($rez_invited)) {
        $inviteted_by_this_member .= '<tr><td>' . ($arr_invited['status'] == 'pending' ? htmlsafechars($arr_invited['username']) : format_username($arr_invited) . '<br /> ' . ($CURUSER['class'] < UC_STAFF ? '' : $arr_invited['ip'])) . '</td>
		<td>' . htmlsafechars($arr_invited['email']) . '</td>
		<td>' . mksize($arr_invited['uploaded']) . '</td>
		' . ($INSTALLER09['ratio_free'] ? '' : '<td>' . mksize($arr_invited['downloaded']) . '</td>') . '
		<td>' . member_ratio($arr_invited['uploaded'], $INSTALLER09['ratio_free'] ? '0' : $arr_invited['downloaded']) . '</td>
		<td>' . ($arr_invited['status'] == 'confirmed' ? '<span style="color: green;">Confirmed</span></td></tr>' : '<td><span style="color: red;">Pending</span></td></tr>');
    }
    $inviteted_by_this_member .= '</table>';
}
$the_flip_box_5 = '[ <a name="invites"></a><a class="altlink" href="#invites" onclick="javascript:flipBox(\'5\')" name="b_5" title="Open / Close Members Invites">view <img onclick="javascript:flipBox(\'5\')" src="pic/panel_on.gif" name="b_5" style="vertical-align:middle;"  width="8" height="8" alt="Open / Close Members Invitees" title="Open / Close Members Invitees" /></a> ] [ <a class="altlink" href="staffpanel.php?tool=invite_tree&amp;action=invite_tree&amp;id=' . (int) $user['id'] . '" title="Click to view members invite tree">view invite tree</a> ]';
$HTMLOUT .= '<tr><td class="rowhead">Invitees</td><td align="left">' . (mysqli_num_rows($rez_invited) > 0 ? $the_flip_box_5 . '<div align="left" id="box_5" style="display:none">
    <br />' . $inviteted_by_this_member . '</div>' : 'No invitees yet.') . '</td></tr>';
// End Class
// End File
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:31,代码来源:invitedby.php

示例14: loggedinorreturn

loggedinorreturn();
$lang = array_merge(load_language('global'), load_language('uploadapp'));
$HTMLOUT = '';
// Fill in application
if (isset($_POST["form"]) != "1") {
    $res = sql_query("SELECT status FROM uploadapp WHERE userid = " . sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
    $arr = mysqli_fetch_assoc($res);
    if ($CURUSER['class'] >= UC_UPLOADER) {
        stderr($lang['uploadapp_user_error'], $lang['uploadapp_alreadyup']);
    } elseif ($arr['status'] == 'pending') {
        stderr($lang['uploadapp_user_error'], $lang['uploadapp_pending']);
    } elseif ($arr['status'] == 'rejected') {
        stderr($lang['uploadapp_user_error'], $lang['uploadapp_rejected']);
    } else {
        $HTMLOUT .= "<h1 align='center'>{$lang['uploadapp_application']}</h1>\r\n        <table width='750' border='1' cellspacing='0' cellpadding='10'><tr><td>\r\n        <form action='./uploadapp.php' method='post' enctype='multipart/form-data'>\r\n        <table border='1' cellspacing='0' cellpadding='5' align='center'>";
        $ratio = member_ratio($CURUSER['uploaded'], $CURUSER['downloaded']);
        $res = sql_query("SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
        if ($row = mysqli_fetch_row($res)) {
            $connect = $row[0];
            if ($connect == 'yes') {
                $connectable = 'Yes';
            } else {
                $connectable = 'No';
            }
        } else {
            $connectable = 'Pending';
        }
        $HTMLOUT .= "<tr>\r\n        <td class='rowhead'>{$lang['uploadapp_username']}</td>\r\n        <td><input name='userid' type='hidden' value='" . (int) $CURUSER['id'] . "' />" . $CURUSER['username'] . "</td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_joined']}</td><td>" . get_date($CURUSER['added'], '', 0, 1) . "</td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_ratio']}</td><td>" . ($ratio >= 1 ? 'No' : 'Yes') . "</td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_connectable']}</td><td><input name='connectable' type='hidden' value='{$connectable}' />{$connectable}</td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_upspeed']}</td><td><input type='text' name='speed' size='19' /></td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_offer']}</td><td><textarea name='offer' cols='80' rows='1'></textarea></td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_why']}</td><td><textarea name='reason' cols='80' rows='2'></textarea></td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_uploader']}</td><td><input type='radio' name='sites' value='yes' />{$lang['uploadapp_yes']}\r\n        <input name='sites' type='radio' value='no' checked='checked' />{$lang['uploadapp_no']}</td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_sites']}</td><td><textarea name='sitenames' cols='80' rows='1'></textarea></td>\r\n        </tr>\r\n        <tr>\r\n        <td class='rowhead'>{$lang['uploadapp_scene']}</td><td><input type='radio' name='scene' value='yes' />{$lang['uploadapp_yes']}\r\n\t     <input name='scene' type='radio' value='no' checked='checked' />{$lang['uploadapp_no']}</td>\r\n        </tr>\r\n        <tr>\r\n        <td colspan='2'>\r\n        <br />\r\n        &nbsp;&nbsp;{$lang['uploadapp_create']}\r\n        <br />\r\n        <input type='radio' name='creating' value='yes' />{$lang['uploadapp_yes']}\r\n    \t  <input name='creating' type='radio' value='no' checked='checked' />{$lang['uploadapp_no']}\r\n        <br /><br />\r\n        &nbsp;&nbsp;{$lang['uploadapp_seeding']}\r\n        <br />\r\n        <input type='radio' name='seeding' value='yes' />{$lang['uploadapp_yes']}\r\n     \t  <input name='seeding' type='radio' value='no' checked='checked' />{$lang['uploadapp_no']}\r\n        <br /><br />\r\n        <input name='form' type='hidden' value='1' />\r\n        <div align='center'><input type='submit' name='Submit' value='{$lang['uploadapp_send']}' /></div></td>\r\n        </tr>\r\n        </table></form>\r\n        </td></tr></table>";
    }
    // Process application
} else {
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:31,代码来源:uploadapp.php

示例15: StatusBar

function StatusBar()
{
    global $CURUSER, $INSTALLER09, $lang, $rep_is_on, $mc1, $msgalert;
    if (!$CURUSER) {
        return "";
    }
    $upped = mksize($CURUSER['uploaded']);
    $downed = mksize($CURUSER['downloaded']);
    //==Memcache unread pms
    $PMCount = 0;
    if (($unread1 = $mc1->get_value('inbox_new_sb_' . $CURUSER['id'])) === false) {
        $res1 = sql_query("SELECT COUNT(id) FROM messages WHERE receiver=" . sqlesc($CURUSER['id']) . " AND unread = 'yes' AND location = '1'") or sqlerr(__LINE__, __FILE__);
        list($PMCount) = mysqli_fetch_row($res1);
        $PMCount = (int) $PMCount;
        $unread1 = $mc1->cache_value('inbox_new_sb_' . $CURUSER['id'], $PMCount, $INSTALLER09['expires']['unread']);
    }
    $inbox = $unread1 == 1 ? "{$unread1}&nbsp;{$lang['gl_msg_singular']}" : "{$unread1}&nbsp;{$lang['gl_msg_plural']}";
    //==Memcache peers
    if (XBT_TRACKER == true) {
        if (($MyPeersXbtCache = $mc1->get_value('MyPeers_XBT_' . $CURUSER['id'])) === false) {
            $seed['yes'] = $seed['no'] = 0;
            $seed['conn'] = 3;
            $r = sql_query("SELECT COUNT(uid) AS `count`, `left`, `active`, `connectable` FROM `xbt_files_users` WHERE uid= " . sqlesc($CURUSER['id']) . " GROUP BY `left`") or sqlerr(__LINE__, __FILE__);
            while ($a = mysqli_fetch_assoc($r)) {
                $key = $a['left'] == 0 ? 'yes' : 'no';
                $seed[$key] = number_format(0 + $a['count']);
                $seed['conn'] = $a['connectable'] == 0 ? 1 : 2;
            }
            $mc1->cache_value('MyPeers_XBT_' . $CURUSER['id'], $seed, $INSTALLER09['expires']['MyPeers_xbt_']);
            unset($r, $a);
        } else {
            $seed = $MyPeersXbtCache;
        }
        // for display connectable  1 / 2 / 3
        if (!empty($seed['conn'])) {
            switch ($seed['conn']) {
                case 1:
                    $connectable = "<img src='{$INSTALLER09['pic_base_url']}notcon.png' alt='{$lang['gl_not_connectable']}' title='{$lang['gl_not_connectable']}' />";
                    break;
                case 2:
                    $connectable = "<img src='{$INSTALLER09['pic_base_url']}yescon.png' alt='{$lang['gl_connectable']}' title='{$lang['gl_connectable']}' />";
                    break;
                default:
                    $connectable = "{$lang['gl_na_connectable']}";
            }
        } else {
            $connectable = $lang['gl_na_connectable'];
        }
    } else {
        if (($MyPeersCache = $mc1->get_value('MyPeers_' . $CURUSER['id'])) === false) {
            $seed['yes'] = $seed['no'] = 0;
            $seed['conn'] = 3;
            $r = sql_query("SELECT COUNT(id) AS count, seeder, connectable FROM peers WHERE userid=" . sqlesc($CURUSER['id']) . " GROUP BY seeder");
            while ($a = mysqli_fetch_assoc($r)) {
                $key = $a['seeder'] == 'yes' ? 'yes' : 'no';
                $seed[$key] = number_format(0 + $a['count']);
                $seed['conn'] = $a['connectable'] == 'no' ? 1 : 2;
            }
            $mc1->cache_value('MyPeers_' . $CURUSER['id'], $seed, $INSTALLER09['expires']['MyPeers_']);
            unset($r, $a);
        } else {
            $seed = $MyPeersCache;
        }
        // for display connectable  1 / 2 / 3
        if (!empty($seed['conn'])) {
            switch ($seed['conn']) {
                case 1:
                    $connectable = "<img src='{$INSTALLER09['pic_base_url']}notcon.png' alt='{$lang['gl_not_connectable']}' title='{$lang['gl_not_connectable']}' />";
                    break;
                case 2:
                    $connectable = "<img src='{$INSTALLER09['pic_base_url']}yescon.png' alt='{$lang['gl_connectable']}' title='{$lang['gl_connectable']}' />";
                    break;
                default:
                    $connectable = "{$lang['gl_na_connectable']}";
            }
        } else {
            $connectable = $lang['gl_na_connectable'];
        }
    }
    if (($Achievement_Points = $mc1->get_value('user_achievement_points_' . $CURUSER['id'])) === false) {
        $Sql = sql_query("SELECT users.id, users.username, usersachiev.achpoints, usersachiev.spentpoints FROM users LEFT JOIN usersachiev ON users.id = usersachiev.id WHERE users.id = " . sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
        $Achievement_Points = mysqli_fetch_assoc($Sql);
        $Achievement_Points['id'] = (int) $Achievement_Points['id'];
        $Achievement_Points['achpoints'] = (int) $Achievement_Points['achpoints'];
        $Achievement_Points['spentpoints'] = (int) $Achievement_Points['spentpoints'];
        $mc1->cache_value('user_achievement_points_' . $CURUSER['id'], $Achievement_Points, 0);
    }
    $member_reputation = get_reputation($CURUSER);
    $usrclass = "";
    if ($CURUSER['override_class'] != 255) {
        $usrclass = "&nbsp;<b>(" . get_user_class_name($CURUSER['class']) . ")</b>&nbsp;";
    } else {
        if ($CURUSER['class'] >= UC_STAFF) {
            $usrclass = "&nbsp;<a href='./setclass.php'><b>(" . get_user_class_name($CURUSER['class']) . ")</b></a>&nbsp;";
        }
    }
    $StatusBar = $clock = '';
    $StatusBar .= "\n       <!-- U-232 Source - Print Statusbar/User Menu -->\n       <script type='text/javascript'>\n       //<![CDATA[\n       function showSlidingDiv(){\n       \$('#slidingDiv').animate({'height': 'toggle'}, { duration: 1000 });\n       }\n       //]]>\n       </script>\n       <div id='base_usermenu'>" . format_username($CURUSER) . " &nbsp;&nbsp;&nbsp;<span id='clock'>{$clock}</span>&nbsp;<span class='base_usermenu_arrow'><a href='#' onclick='showSlidingDiv(); return false;'><i class='icon-chevron-down'></i></a></span></div>\n       <div id='slidingDiv'>\n       <div class='slide_head'>{$lang['gl_pstats']}</div>\n       " . (isset($CURUSER) && $CURUSER['class'] < UC_STAFF ? "<div class='slide_a'>{$lang['gl_uclass']}</div><div class='slide_b'><b>(" . get_user_class_name($CURUSER['class']) . ")</b></div>" : "<div class='slide_a'>{$lang['gl_uclass']}</div><div class='slide_b'>{$usrclass}</div>") . "\n       <div class='slide_c'>{$lang['gl_rep']}</div><div class='slide_d'>{$member_reputation}</div>\n       <div class='slide_a'>{$lang['gl_invites']}</div><div class='slide_b'><a href='./invite.php'>{$CURUSER['invites']}</a></div>\n       <div class='slide_c'>{$lang['gl_karma']}</div><div class='slide_d'><a href='./mybonus.php'>{$CURUSER['seedbonus']}</a></div>\n       <div class='slide_a'>{$lang['gl_achpoints']}</div><div class='slide_b'><a href='./achievementhistory.php?id={$CURUSER['id']}'>" . (int) $Achievement_Points['achpoints'] . "</a></div>\n       <div class='slide_head'>{$lang['gl_tstats']}</div>\n       <div class='slide_a'>{$lang['gl_shareratio']}</div><div class='slide_b'>" . member_ratio($CURUSER['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $CURUSER['downloaded']) . "</div>";
    if ($INSTALLER09['ratio_free']) {
        $StatusBar .= "<div class='slide_c'>{$lang['gl_uploaded']}</div><div class='slide_d'>{$upped}</div>";
//.........这里部分代码省略.........
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:101,代码来源:template.php


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