-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…3259) * Converted modcp finduser * Removed redundant condition
- Loading branch information
1 parent
f85439c
commit 329ba53
Showing
2 changed files
with
132 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{% extends 'layouts/master.twig' %} | ||
|
||
{% block head %} | ||
<title>{{ mybb.settings.bbname }} - {{ lang.find_users }}</title> | ||
{% endblock head %} | ||
|
||
{% block body %} | ||
<table width="100%" border="0" align="center"> | ||
<tr> | ||
{# Modcp nav #} | ||
<td valign="top"> | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<tr> | ||
<td class="thead" colspan="5"><strong>{{ lang.users }}</strong></td> | ||
</tr> | ||
<tr> | ||
<td class="tcat" width="30%"><span class="smalltext"><strong>{{ lang.username }}</strong></span></td> | ||
<td class="tcat" align="center" width="15%"><span class="smalltext"><strong>{{ lang.usergroup }}</strong></span></td> | ||
<td class="tcat" align="center" width="15%"><span class="smalltext"><strong>{{ lang.regdate }}</strong></span></td> | ||
<td class="tcat" align="center" width="15%"><span class="smalltext"><strong>{{ lang.lastvisit }}</strong></span></td> | ||
<td class="tcat" align="center" width="10%"><span class="smalltext"><strong>{{ lang.postnum }}</strong></span></td> | ||
</tr> | ||
{% for user in users %} | ||
{% set bgcolor = alt_trow() %} | ||
<tr> | ||
<td class="{{ bgcolor }}"> | ||
<a href="modcp.php?action=editprofile&uid={{ user.uid }}">{{ user.username|raw }}</a> | ||
</td> | ||
<td class="{{ bgcolor }}" align="center">{{ user.ugroup }}</td> | ||
<td class="{{ bgcolor }}" align="center">{{ user.regdate }}</td> | ||
<td class="{{ bgcolor }}" align="center"> | ||
{% if user.invisible == 1 and mybb.usergroup.canviewwolinvis != 1 and user.uid != mybb.user.uid %} | ||
{% if user.lastvisit %} | ||
{{ lang.lastvisit_hidden }} | ||
{% else %} | ||
{{ lang.lastvisit_never }} | ||
{% endif %} | ||
{% else %} | ||
{{ user.lastvisit }}{# TODO: my_date('relative') #} | ||
{% endif %} | ||
</td> | ||
<td class="{{ bgcolor }}" align="center">{{ user.postnum }}</td> | ||
</tr> | ||
{% else %} | ||
<tr> | ||
<td class="trow1" align="center" colspan="5">{{ lang.no_user_results }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{{ multipage|raw }} | ||
<br /> | ||
<form action="modcp.php?action=finduser" method="post"> | ||
<table border="0" cellspacing="{{ theme.borderwidth }}" cellpadding="{{ theme.tablespace }}" class="tborder"> | ||
<tr> | ||
<td class="thead" colspan="2"><strong>{{ lang.find_users }}</strong></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1" width="25%"><strong>{{ lang.username_contains }}</strong></td> | ||
<td class="trow1" width="75%"><input type="text" name="username" id="username" value="{{ mybb.input.username }}" class="textbox" /></td> | ||
</tr> | ||
<tr> | ||
<td class="trow1" width="25%"><strong>{{ lang.sort_by }}</strong></td> | ||
<td class="trow1" width="75%"> | ||
{{ mybb.input.sortby }} | ||
<select name="sortby"> | ||
<option value="username"{% if mybb.input.sortby == 'username' %} selected{% endif %}>{{ lang.username }}</option> | ||
<option value="regdate"{% if mybb.input.sortby == 'regdate' %} selected{% endif %}>{{ lang.regdate }}</option> | ||
<option value="lastvisit"{% if mybb.input.sortby == 'lastvisit' %} selected{% endif %}>{{ lang.lastvisit }}</option> | ||
<option value="postnum"{% if mybb.input.sortby == 'postnum' %} selected{% endif %}>{{ lang.postnum }}</option> | ||
</select> | ||
{{ lang.in }} | ||
<select name="order"> | ||
<option value="asc"{% if mybb.input.order == 'asc' %} selected{% endif %}>{{ lang.asc }}</option> | ||
<option value="desc"{% if mybb.input.order != 'asc' %} selected{% endif %}>{{ lang.desc }}</option> | ||
</select> | ||
{{ lang.order }} | ||
</td> | ||
</tr> | ||
</table> | ||
<br /> | ||
<div align="center"> | ||
<input type="submit" class="button" value="{{ lang.find_users }}" /> | ||
</div> | ||
</form> | ||
</td> | ||
</tr> | ||
</table> | ||
<link rel="stylesheet" href="{{ mybb.asset_url }}/jscripts/select2/select2.css?ver=1807" /> | ||
<script type="text/javascript" src="{{ mybb.asset_url }}/jscripts/select2/select2.min.js?ver=1806"></script> | ||
<script type="text/javascript"> | ||
<!-- | ||
if(use_xmlhttprequest == "1") | ||
{ | ||
MyBB.select2(); | ||
$("#username").select2({ | ||
placeholder: "{{ lang.find_users }}", | ||
minimumInputLength: 2, | ||
multiple: false, | ||
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper | ||
url: "xmlhttp.php?action=get_users", | ||
dataType: 'json', | ||
data: function (term, page) { | ||
return { | ||
query: term, // search term | ||
}; | ||
}, | ||
results: function (data, page) { // parse the results into the format expected by Select2. | ||
// since we are using custom formatting functions we do not need to alter remote JSON data | ||
return {results: data}; | ||
} | ||
}, | ||
initSelection: function(element, callback) { | ||
var value = $(element).val(); | ||
if (value !== "") { | ||
callback({ | ||
id: value, | ||
text: value | ||
}); | ||
} | ||
} | ||
}); | ||
} | ||
// --> | ||
</script> | ||
{% endblock body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters