<!-- IF IS_ADMIN -->
<script type="text/javascript">
// edit_user_profile
ajax.init.edit_user_profile = function(params){
	if (params.submit) {
		ajax.exec({
			action  : params.action,
			edit_id : params.id,
			user_id : params.user_id || {PROFILE_USER_ID},
			field   : params.field || params.id,
			value   : params.value
		});
	}
	else {
		editableType = params.editableType || "input";
		ajax.makeEditable(params.id, editableType);
	}
};
ajax.callback.edit_user_profile = function(data){
	ajax.restoreEditable(data.edit_id, data.new_value);
};

// avatar
ajax.avatar = function (mode, uid) {
	ajax.exec({
		action  : 'avatar',
		mode    : mode,
		user_id : uid
	});
};
ajax.callback.avatar = function (data) {
	$('#avatar-img').html(data.avatar_html);
	$('#avatar-adm').hide();
};

// change_user_rank
ajax.change_user_rank = function (uid, rank_id) {
	$('#rank-msg').html('<i class="loading-1">{L_LOADING}</i>');
	ajax.exec({
		action  : 'change_user_rank',
		user_id : uid,
		rank_id : rank_id
	});
};
ajax.callback.change_user_rank = function (data) {
	$('#rank-msg').html(data.html);
	$('#rank-name').html(data.rank_name);
};

ajax.user_opt = {AJAX_USER_OPT};

// change_user_opt
ajax.change_user_opt = function() {
	ajax.exec({
		action   : 'change_user_opt',
		user_id  : {PROFILE_USER_ID},
		user_opt : $.toJSON(ajax.user_opt)
	});
};
ajax.callback.change_user_opt = function (data) {
	$('#user-opt-resp').html(data.resp_html);
	$('#user-opt-save-btn').removeAttr('disabled');
};

$(document).ready(function(){
	$('#user-opt').find('input[type=checkbox]').click(function(){
		var $chbox = $(this);
		var opt_name = $chbox.attr('name');
		var opt_val  = $chbox.attr('checked') ? 1 : 0;
		ajax.user_opt[opt_name] = opt_val;
		$chbox.parents('label').toggleClass('bold');
		$('#user-opt-save').show();
	});
	$('#user-opt').find('input[type=checkbox]').each(function(){
		if (ajax.user_opt[ $(this).attr('name') ]) {
			$(this).attr({checked: 'checked'});
			$(this).parents('label').addClass('bold');
		}
	});
	$('#user-opt-save-btn').click(function(){
		this.disabled = 1;
		$('#user-opt-resp').html('&nbsp;');
		ajax.change_user_opt();
	});
});
</script>

<var class="ajax-params">{action: "edit_user_profile", id: "username"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_email"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_regdate"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_lastvisit"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_from"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_website"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_occ"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_interests"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_icq"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_skype",    editableType: "yesno-skype"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_twitter",  editableType: "yesno-twitter"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_gender",   editableType: "yesno-gender"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_birthday", editableType: "yesno-birthday"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "u_up_total"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "u_down_total"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "u_up_release"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "u_up_bonus"}</var>
<var class="ajax-params">{action: "edit_user_profile", id: "user_points"}</var>

<script type="text/javascript">
ajax.callback.manage_user = function(data) {
	if(data.info) alert(data.info);
	if(data.url) document.location.href = data.url;
};
</script>
<!-- ENDIF / IS_ADMIN -->

<!-- IF IS_AM -->
<script type="text/javascript">
ajax.ip_load = false;
ajax.mod_action = function(mode) {
if (!ajax.ip_load) {
	ajax.exec({
		action  : 'mod_action',
		mode    : mode,
		user_id : {PROFILE_USER_ID}
	});
}
else
{
	$('#ip_list').toggle();
}};
ajax.callback.mod_action = function(data) {
	$('#ip_list').html(data.ip_list_html);
	ajax.ip_load = true;
}
</script>

<script type="text/javascript">
ajax.group_membership = function(mode) {
	$('#gr-mem-list').html('<i class="loading-1">{L_LOADING}</i>');
	ajax.exec({
		action  : 'group_membership',
		mode    : mode,
		user_id : {PROFILE_USER_ID}
	});
};
ajax.callback.group_membership = function(data) {
	$('#gr-mem-list').html(data.group_list_html);
};
</script>
<!-- ENDIF / IS_AM -->

<!-- IF TRAF_STATS -->
<script type="text/javascript">
ajax.index_data = function(mode) {
	ajax.exec({
		action  : 'index_data',
		mode    : mode,
		user_id : {PROFILE_USER_ID}
	});
};
ajax.callback.index_data = function(data) {
	$('#traf-stats-tbl').html(data.html);
	$('#bt_user_ratio').html(data.user_ratio);
	$('#traf-stats-span').hide();
	$('#traf-stats-tbl').show();
	$('#bt_user_ratio').show();
};
</script>
<!-- ENDIF -->

<!-- IF SHOW_PASSKEY -->
<script type="text/javascript">
ajax.callback.gen_passkey = function(data){
	$('#passkey').text(data.passkey);
};
</script>
<!-- ENDIF / SHOW_PASSKEY -->

<style type="text/css">
#traf-stats-tbl th, #traf-stats-tbl td { padding: 2px; text-align: center; white-space: nowrap; font-size: 11px; }
#traf-stats-tbl th { padding: 2px; }
<!-- IF TRAF_STATS -->
#traf-stats-tbl th { padding: 2px; }
<!-- ENDIF -->
.pagetitle a { font-size: 16px; }
</style>
<style>
.page-profile-v1-avatar img {
    max-width: 160px;
    border: 4px solid #fff;
	border-radius: 50px;
}
.form-group {
    margin-bottom: 0;
}
.form-horizontal .control-label {
   padding-top: 0;
}
</style>

<!-- IF IS_ADMIN -->
<div class="modal fade" id="admin" tabindex="-1">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">×</button>
                <h4 class="modal-title">Small modal</h4>
            </div>
            <div class="modal-body p-a-1">
                <fieldset>
					<div class="tLeft" style="font-size: 13px;">
						<a href="#" onclick="ajax.exec({action : 'manage_user', mode: '<!-- IF USER_ACTIVE -->user_deactivate<!-- ELSE -->user_activate<!-- ENDIF -->', user_id : {PROFILE_USER_ID}}); return false;" class="<!-- IF USER_ACTIVE -->adm<!-- ELSE -->seed bold<!-- ENDIF -->"><!-- IF USER_ACTIVE -->{L_USER_DEACTIVATE}<!-- ELSE -->{L_USER_ACTIVATE}<!-- ENDIF --></a> <br />
						<a href="#" onclick="ajax.exec({action : 'manage_user', mode: 'delete_profile', user_id : '{PROFILE_USER_ID}'}); return false;" class="adm">{L_USER_DELETE_EXPLAIN}</a> <br />
						<a href="#" onclick="ajax.exec({action : 'manage_user', mode: 'delete_topics', user_id : '{PROFILE_USER_ID}'}); return false;" class="adm">{L_DELETE_USER_ALL_POSTS}</a> <br />
						<a href="#" onclick="ajax.exec({action : 'manage_user', mode: 'delete_message', user_id : '{PROFILE_USER_ID}'}); return false;" class="adm">{L_DELETE_USER_POSTS}</a> <br />
					</div>
				</fieldset>
				<hr class="m-y-1">
				<fieldset>
					<label>{L_BAN_USER}</label>
					<div class="tLeft" id="user-opt">
						<label class="custom-control custom-checkbox">
							<input class="custom-control-input" type="checkbox" name="dis_avatar"/>
							<span class="custom-control-indicator"></span>
							{L_HIDE_AVATARS}
						</label>
						<label class="custom-control custom-checkbox">
							<input class="custom-control-input" type="checkbox" name="dis_sig"/>
							<span class="custom-control-indicator"></span>
							{L_SHOW_CAPTION}
						</label>
						<label class="custom-control custom-checkbox">
							<input class="custom-control-input" type="checkbox" name="dis_passkey"/>
							<span class="custom-control-indicator"></span>
							{L_DOWNLOAD_TORRENT}
						</label>
						<label class="custom-control custom-checkbox">
							<input class="custom-control-input" type="checkbox" name="dis_pm"/>
							<span class="custom-control-indicator"></span>
							{L_SEND_PM}
						</label>
						<label class="custom-control custom-checkbox">
							<input class="custom-control-input" type="checkbox" name="dis_post"/>
							<span class="custom-control-indicator"></span>
							{L_SEND_MESSAGE}
						</label>
						<label class="custom-control custom-checkbox">
							<input class="custom-control-input" type="checkbox" name="dis_post_edit"/>
							<span class="custom-control-indicator"></span>
							{L_EDIT_POST}
						</label>
						<label class="custom-control custom-checkbox">
							<input class="custom-control-input" type="checkbox" name="dis_topic"/>
							<span class="custom-control-indicator"></span>
							{L_NEW_THREADS}
						</label>
					</div>
				</fieldset>
				<div id="user-opt-save" class="tCenter">
					<p><input id="user-opt-save-btn" class="bold long" type="button" value="{L_SUBMIT}" /></p>
					<p id="user-opt-resp" class="mrg_6"></p>
				</div>
            </div>
        </div>
    </div>
</div>

<div class="col-md-12">
<div class="page-header m-b-0">
	<h1 class="floatR">
		<a href="{U_MANAGE}">{L_PROFILE}</a> &middot;
		<a href="{U_PERMISSIONS}">{L_PERMISSIONS}</a>
	</h1>
</div>
</div>
<!-- ENDIF -->
<script>
    // -------------------------------------------------------------------------
    // Initialize page components

    $(function() {
      $('#profile-tabs').pxTabResize();
    });
  </script>
<div class="col-md-4 col-lg-3">
    <div id="avatar-img" class="text-xs-center page-profile-v1-avatar border-round">
		{AVATAR_IMG}
		<!-- IF IS_ADMIN || PROFILE_USER -->
		<p id="avatar-adm" class="med mrg_4">[ <a href="#" onclick="if (window.confirm('{L_AVATAR_DELETE}?')){ ajax.avatar('delete', {PROFILE_USER_ID}); } return false;" class="adm">{L_AVATAR_DELETE}</a> ]</p>
		<!-- ENDIF -->
	</div>
    <div class="m-y-3 text-xs-center">
	<!-- IF IS_ADMIN -->
		{RANK_SELECT}
		<script type="text/javascript">
		$('#rank-sel').bind('change', function(){ ajax.change_user_rank( {PROFILE_USER_ID}, $(this).val() ); });
		</script>
		<div id="rank-msg" class="mrg_6"></div>
	<!-- ELSE IF POSTER_RANK -->
		{RANK_IMAGE}
	<!-- ENDIF -->
    <!-- IF BIRTHDAY_ICON --><div class="mrg_8">{BIRTHDAY_ICON}</div><!-- ENDIF -->
    </div>
	<div class="panel panel-transparent">
        <div class="panel-heading p-x-1">
            <span class="panel-title" id="username">{L_CONTACT} <span class="editable bold">{USERNAME}</span></span>
        </div>
        <div class="list-group m-t-1">
            <table class="nowrap borderless user_contacts w100">
				<!-- IF EMAIL -->
				<tr>
					<th>{L_EMAIL_ADDRESS}:</th>
					<td class="tLeft med" id="user_email">{EMAIL}</td>
				</tr>
				<!-- ENDIF -->
				<!-- IF PM -->
				<tr>
					<th>{L_PRIVATE_MESSAGE}:</th>
					<td class="tLeft med">{PM}</td>
				</tr>
				<!-- ENDIF -->
				<!-- IF ICQ -->
				<tr>
					<th>{L_ICQ}:</th>
					<td class="tLeft med" id="user_icq">
						<span class="editable">{ICQ}
							<a href="http://www.icq.com/people/{ICQ}"><img align="middle" src="http://web.icq.com/whitepages/online?icq={ICQ}&img=5"></a>
						</span>
					</td>
				</tr>
				<!-- ENDIF -->
				<!-- IF SKYPE -->
                <a style="display: none;" data-config="commands=*;size=14;status=off;theme=logo;language=en;bgcolor=#2a92f3;" id="skaip-buttons" href="http://www.skaip.org/"></a>
                <script src="//apps.skaip.org/buttons/widget/core.min.js" defer="defer"></script>
                <tr>
                    <th>{L_SKYPE}:</th>
                    <td class="tLeft med" id="user_skype">
				        <span class="editable">
					        <a href="skype:{SKYPE}">{SKYPE}</a>
				        </span>
                    </td>
                </tr>
				<!-- ENDIF -->
				<!-- IF TWITTER -->
				<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
				<tr>
					<th>{L_TWITTER}:</th>
					<td class="tLeft med" id="user_twitter">
						<span class="editable">
							<a href="https://twitter.com/{TWITTER}" class="twitter-follow-button" data-show-count="false" data-lang="{USER_LANG}">{TWITTER}</a>
						</span>
					</td>
				</tr>
				<!-- ENDIF -->
			</table>
			<!--/user_contacts-->
        </div>
    </div>
	<!-- IF USER_RESTRICTIONS -->
	<fieldset class="mrg_6">
	<legend>{L_USER_NOT_ALLOWED}:</legend>
		<div class="tLeft" style="padding: 4px 6px 8px 2px;">
		<ul><li>{USER_RESTRICTIONS}</li></ul>
		</div>
	</fieldset>
	<!-- ENDIF -->
</div>
<hr class="page-wide-block visible-xs visible-sm">
<div class="col-md-8 col-lg-9">
    <h1 class="font-size-16 m-y-3">
		<!-- IF PROFILE_USER -->{L_MY_PROFILE}<!-- ELSE -->{L_VIEWING_PROFILE}<!-- ENDIF -->
	</h1>
	<div class="panel">
        <div class="panel-body p-t-1 p-b-0 p-x-1">
			<form class="form-horizontal">
				<!-- IF not USER_ACTIVE -->
				<h4 class="mrg_4 tCenter warnColor1">{L_DISABLED_USER}</h4>
				<!-- ENDIF -->

				<!-- IF SHOW_ROLE -->
				<div class="form-group">
					<label class="col-md-3 control-label">{L_ROLE}</label>
					<div class="col-md-9" id="role">
						<b class="form-control-static" id="rank-name">{POSTER_RANK}</b>
						<!-- IF GROUP_MEMBERSHIP and IS_MOD -->
						<span id="gr-mod-a">[ <a href="#" class="med" onclick="ajax.group_membership('get_group_list'); $('#gr-mem-tr').show(); $('#gr-mod-a').hide(); return false;">{L_MEMBERSHIP_IN}</a> ]</span>
						<!-- ENDIF -->
					</div>
				</div>
				<hr class="m-y-0">
				<!-- ENDIF -->

				<!-- IF GROUP_MEMBERSHIP -->
				<div class="form-group" id="gr-mem-tr"<!-- IF IS_MOD --> style="display: none;"<!-- ENDIF -->>
					<label class="col-md-3 control-label">{L_MEMBERSHIP_IN}</label>
					<div class="col-md-9" id="gr-mem-list">
						<b class="form-control-static" id="gr-mem-list"><!-- IF IS_ADMIN --><a href="#" class="med" onclick="ajax.group_membership('get_group_list'); return false;">{GROUP_MEMBERSHIP_TXT}</a><!-- ENDIF --></b>
					</div>
				</div>
				<hr class="m-y-0">
				<!-- ENDIF -->

				<div class="form-group">
					<label class="col-md-3 control-label">{L_JOINED}</label>
					<div class="col-md-9" id="user_regdate">
						<b class="form-control-static">
						<span class="editable bold">{USER_REGDATE}</span>
						<!-- IF IS_ADMIN --><a href="#" class="btn btn-xs" data-toggle="modal" data-target="#admin">{L_MANAGE_USER}</a><!-- ENDIF -->
						<!-- IF IS_AM --><a href="#" class="btn btn-xs" onclick="ajax.mod_action('profile_ip'); return false;">{L_IP_ADDRESS}</a><!-- ENDIF -->
						</b>
					</div>
				</div>
				<hr class="m-y-0">
				<div class="form-group">
					<label class="col-md-3 control-label">{L_LAST_VISITED}</label>
					<div class="col-md-9" id="user_lastvisit">
						<b class="form-control-static"><span class="editable bold">{LAST_VISIT_TIME}</span></b>
					</div>
				</div>
				<hr class="m-y-0">
				<div class="form-group">
					<label class="col-md-3 control-label">{L_LAST_ACTIVITY}</label>
					<div class="col-md-9" id="role">
						<b class="form-control-static">
							{LAST_ACTIVITY_TIME}
							<!-- IF TRAF_STATS --><span id="traf-stats-span">[ <a href="#" id="traf-stats-btn" class="med" onclick="ajax.index_data('get_traf_stats'); return false;">{L_VIEWING_USER_BT_PROFILE}</a> ]</span><!-- ENDIF -->
						</b>
					</div>
				</div>
				<hr class="m-y-0">
				<div class="form-group">
					<label class="col-md-3 control-label">{L_TOTAL_POSTS}</label>
					<div class="col-md-9">
						<b class="form-control-static">

							{POSTS}
							[ <a href="{U_SEARCH_USER}" class="med">{L_SEARCH_USER_POSTS}</a> ]
							[ <a href="{U_SEARCH_TOPICS}" class="med">{L_SEARCH_USER_TOPICS}</a> ]
							[ <a href="{U_SEARCH_RELEASES}" class="med">{L_SEARCH_RELEASES}</a> ]
                            <!-- IF $bb_cfg['topic_notify_enabled'] --><!-- IF PROFILE_USER || IS_ADMIN -->[ <a href="{U_WATCHED_TOPICS}&u={PROFILE_USER_ID}" class="med">{L_WATCHED_TOPICS}</a> ]<!-- ENDIF --><!-- ENDIF -->
							[ <a title="{L_ATOM_SUBSCRIBE}" href="#" onclick="return post2url('feed.php', {mode: 'get_feed_url', type: 'u', id: {PROFILE_USER_ID}})">{FEED_IMG}</a> ]

						</b>
					</div>
				</div>
				<hr class="m-y-0">
				<div class="form-group" id="bt_user_ratio" <!-- IF TRAF_STATS -->style="display: none;"<!-- ENDIF -->>
					<label class="col-md-3 control-label">{L_USER_RATIO}</label>
					<div class="col-md-9" id="user_lastvisit">
						<b class="form-control-static">
						<!-- IF DOWN_TOTAL_BYTES gt MIN_DL_BYTES -->
						<b id="u_ratio" class="gen">{USER_RATIO}</b>
						[<a class="gen" href="#" onclick="toggle_block('ratio-expl'); return false;">?</a>]
						<!-- ELSE -->
						<span class="med" title="{L_IT_WILL_BE_DOWN} {MIN_DL_FOR_RATIO}"><b>{L_NONE}</b> (DL < {MIN_DL_FOR_RATIO})</span>
						<!-- ENDIF -->

						<!-- IF SHOW_PASSKEY -->
						[ {L_BT_PASSKEY}:  <span id="passkey-btn"><a class="med" href="#" onclick="$('#passkey-gen').show(); $('#passkey-btn').hide(); return false;">{L_BT_PASSKEY_VIEW}</a></span>
						<span id="passkey-gen" class="med" style="display: none;">
							<b id="passkey" class="med bold"><!-- IF AUTH_KEY -->{AUTH_KEY}<!-- ELSE -->{L_NOSELECT}<!-- ENDIF --></b>&nbsp;|
							<a href="#" onclick="ajax.exec({ action: 'gen_passkey', user_id  : {PROFILE_USER_ID} }); return false;">{L_BT_GEN_PASSKEY}</a>
						</span> ]
						<!-- ENDIF -->
						</b>
					</div>
				</div>
				<div class="form-group" id="ratio-expl" style="display: none;">
					<label class="col-md-3 control-label"></label>
					<div class="col-md-9">
					( {L_UPLOADED} <b class="seedmed">{UP_TOTAL}</b> + {L_RELEASED} <b class="seedmed">{RELEASED}</b> + {L_BONUS} <b class="seedmed">{UP_BONUS}</b> ) / {L_DOWNLOADED} <b class="leechmed">{DOWN_TOTAL}</b>
					</div>
				</div>
				<hr class="m-y-0">
				<!-- IF LOCATION -->
				<div class="form-group">
					<label class="col-md-3 control-label">{L_LOCATION}</label>
					<div class="col-md-9">
						<span class="form-control-static" id="user_from"><b class="editable">{LOCATION}</b></span>
					</div>
				</div>
				<hr class="m-y-0">
				<!-- ENDIF -->
				<!-- IF WWW -->
				<div class="form-group">
					<label class="col-md-3 control-label">{L_WEBSITE}:</label>
					<div class="col-md-9">
						<span class="form-control-static" id="user_website"><a href="{WWW}" class="editable" target="_blank">{WWW}</a></span>
					</div>
				</div>
				<hr class="m-y-0">
				<!-- ENDIF -->
				<!-- IF OCCUPATION -->
				<div class="form-group">
					<label class="col-md-3 control-label">{L_OCCUPATION}:</label>
					<div class="col-md-9">
						<span class="form-control-static" id="user_occ"><b class="editable">{OCCUPATION}</b></span>
					</div>
				</div>
				<hr class="m-y-0">
				<!-- ENDIF -->
				<!-- IF INTERESTS -->
				<div class="form-group">
					<label class="col-md-3 control-label">{L_INTERESTS}:</label>
					<div class="col-md-9">
						<span class="form-control-static" id="user_interests"><b class="editable">{INTERESTS}</b></span>
					</div>
				</div>
				<hr class="m-y-0">
				<!-- ENDIF -->
				<!-- IF GENDER -->
				<div class="form-group">
					<label class="col-md-3 control-label">{L_GENDER}:</label>
					<div class="col-md-9">
						<span class="form-control-static" id="user_gender"><b class="editable">{GENDER}</b></span>
					</div>
				</div>
				<hr class="m-y-0">
				<!-- ENDIF -->
				<!-- IF BIRTHDAY -->
				<div class="form-group">
					<label class="col-md-3 control-label">{L_BIRTHDAY}:</label>
					<div class="col-md-9">
						<span class="form-control-static" id="user_birthday"><b class="editable">{BIRTHDAY}</b></span>
					</div>
				</div>
				<hr class="m-y-0">
				<div class="form-group">
					<label class="col-md-3 control-label">{L_AGE}:</label>
					<div class="col-md-9">
						<span class="form-control-static"><b>{AGE}</b></span>
					</div>
				</div>
				<hr class="m-y-0">
				<!-- ENDIF -->

				<table id="traf-stats-tbl" <!-- IF TRAF_STATS -->style="display: none;"<!-- ENDIF --> class="table table-striped m-b-0 m-t-1">
					<tr>
						<th></th>
						<th>{L_DOWNLOADED}</th>
						<th>{L_UPLOADED}</th>
						<th>{L_RELEASED}</th>
						<th>{L_BONUS}</th>
						<!-- IF $bb_cfg['seed_bonus_enabled'] --><th>{L_SEED_BONUS}</th><!-- ENDIF -->
					</tr>
					<tr>
						<td>{L_TD_TRAF}</td>
						<td class="leech">{TD_DL}</td>
						<td class="seed">{TD_UL}</td>
						<td class="seed">{TD_REL}</td>
						<td class="seed">{TD_BONUS}</td>
						<!-- IF $bb_cfg['seed_bonus_enabled'] --><td class="points">{TD_POINTS}</td><!-- ENDIF -->
					</tr>
						<tr>
							<td>{L_YS_TRAF}</td>
							<td class="leech">{YS_DL}</td>
							<td class="seed">{YS_UL}</td>
							<td class="seed">{YS_REL}</td>
							<td class="seed">{YS_BONUS}</td>
							<!-- IF $bb_cfg['seed_bonus_enabled'] --><td class="points">{YS_POINTS}</td><!-- ENDIF -->
						</tr>
						<tr>
							<td>{L_TOTAL_TRAF}</td>
							<td id="u_down_total"><span class="editable bold leechmed">{DOWN_TOTAL}</span></td>
							<td id="u_up_total"><span class="editable bold seedmed">{UP_TOTAL}</span></td>
							<td id="u_up_release"><span class="editable bold seedmed">{RELEASED}</span></td>
							<td id="u_up_bonus"><span class="editable bold seedmed">{UP_BONUS}</span></td>
							<!-- IF $bb_cfg['seed_bonus_enabled'] --><td id="user_points"><span class="editable bold points">{USER_POINTS}</span></td><!-- ENDIF -->
						</tr>
						<tr>
							<td colspan="1">{L_MAX_SPEED}</td>
							<td colspan="2">{L_DL_DL_SPEED}: {SPEED_DOWN}</td>
							<td colspan="2">{L_DL_UL_SPEED}: {SPEED_UP}</td>
							<!-- IF $bb_cfg['seed_bonus_enabled'] --><td colspan="1"><!-- IF PROFILE_USER --><a href="{#BONUS_URL}">{L_EXCHANGE}</a><!-- ENDIF --></td><!-- ENDIF -->
						</tr>
					</table>
				<!-- IF IS_AM --><span id="ip_list"></span><!-- ENDIF -->
			</form>
		</div>
    </div>
</div>

<a name="torrent"></a>
<!-- IF USER_DLS -->
<style type="text/css">
#dls-tbl u { display: none; }
.dls-type, .dls-f { padding: 4px; text-align: center; }
.dls-cnt { font-size: 16px; font-weight: normal; }
</style>
<script type="text/javascript">
$(function(){
	$('#dls-tbl').tablesorter();
});
</script>

<h1 class="pagetitle tCenter"><span class="dls-cnt">({L_RELEASINGS}, {L_SEEDINGS}, {L_LEECHINGS})</span></h1>

<div class="table-primary">
    <table class="table table-striped table-bordered" id="datatables">
        <thead>
            <tr>
				<th>{L_TYPE}</th>
				<th>{L_FORUM}</th>
				<th>{L_TOPICS}</th>
				<th>{L_TORRENT}</th>
			</tr>
        </thead>
        <tbody>
            <!-- BEGIN released -->
			<tr class="odd gradeX">
				<td class="dls-type"><b class="seedmed">{L_RELEASING}</b></td>
				<td class="dls-f"><a class="gen" href="{released.U_VIEW_FORUM}">{released.FORUM_NAME}</a></td>
				<td class="pad_4"><a class="med tLink" href="{released.U_VIEW_TOPIC}">{released.TOR_TYPE}<b>{released.TOPIC_TITLE}</a></td>
				<td class="tCenter med nowrap pad_2">
					<p><b class="seedmed">{released.TOPIC_SEEDERS}</b> | <b class="leechmed">{released.TOPIC_LEECHERS}</b></p>
					<p style="padding-top: 2px" class="seedsmall">{released.SPEED_UP}</p>
				</td>
			</tr>
			<!-- END released -->

			<!-- BEGIN seed -->
			<tr class="odd gradeX">
				<td class="dls-type"><u>1</u><span class="seedmed">{L_SEEDING}</span></td>
				<td class="dls-f"><a class="gen" href="{seed.U_VIEW_FORUM}">{seed.FORUM_NAME}</a></td>
				<td class="pad_4"><a class="med tLink" href="{seed.U_VIEW_TOPIC}">{seed.TOR_TYPE}<b>{seed.TOPIC_TITLE}</b></a></td>
				<td class="tCenter med nowrap pad_2">
					<p><b class="seedmed">{seed.TOPIC_SEEDERS}</b> | <b class="leechmed">{seed.TOPIC_LEECHERS}</b></p>
					<p style="padding-top: 2px" class="seedsmall">{seed.SPEED_UP}</p>
				</td>
			</tr>
			<!-- END seed -->

			<!-- BEGIN leech -->
			<tr class="odd gradeX">
				<td class="dls-type"><u>2</u><span class="leechmed">{L_LEECHING}</span></td>
				<td class="dls-f"><a class="gen" href="{leech.U_VIEW_FORUM}">{leech.FORUM_NAME}</a></td>
				<td class="pad_4"><a class="med tLink" href="{leech.U_VIEW_TOPIC}">{leech.TOR_TYPE}<b>{leech.TOPIC_TITLE}</b></a></td>
				<td class="tCenter med nowrap pad_2">
					<p><b class="seedmed">{leech.TOPIC_SEEDERS}</b> | <b class="leechmed">{leech.TOPIC_LEECHERS}</b></p>
					<p style="padding-top: 2px" class="seedsmall">{leech.SPEED_DOWN}</p>
				</td>
			</tr>
			<!-- END leech -->
        </tbody>
    </table>
</div>
<br />
<!-- ELSE -->
	<h1 class="pagetitle tCenter">{L_CUR_ACTIVE_DLS}: <span class="normal">{L_NO}</span></h1>
<!-- ENDIF -->

<!-- IF SHOW_SEARCH_DL -->
<div class="tCenter">
	<a class="gen" href="{U_SEARCH}?dlu={PROFILE_USER_ID}&dlw=1">{L_SEARCH_DL_WILL_DOWNLOADS}</a> ::
	<a class="gen" href="{U_SEARCH}?dlu={PROFILE_USER_ID}&dlc=1">{L_SEARCH_DL_COMPLETE_DOWNLOADS}</a>
</div>
<!-- ENDIF -->

<script>
$(function() {
    $('#datatables').dataTable();
    $('#datatables_wrapper .table-caption').text('{L_CUR_ACTIVE_DLS}');
    $('#datatables_wrapper .dataTables_filter input').attr('placeholder', 'Search...');
});
</script>
