Jump to content

[Solved] Member List: Adding ONE extra field to sort by?


Recommended Posts

I don't want a fancy schmancy member list, as I'm using mine as a quick face claim list. I have everything as I want it at the moment, except one thing. I'd like to be able to sort by Face Claim in the dropdown that says "by member name, total post, etc." That is it. I tried looking over Kit's amazing tutorial but it gave me a lot more than I needed and I wasn't sure how to parse it down to the singular thing I need for this. Any help? Please? 

 

EDIT: here is the list right now: https://mayday.jcink.net/index.php?&act=Members&photoonly=&name=&name_box=all&max_results=50&filter=ALL&sort_order=asc&sort_key=name&st=0  (using kit's cheat for 50 per page)

Reality is an illusion. 


 
 

Link to comment
Share on other sites

I don't think the code will work with a table because it needs to rearrange blocks, which a table doesn't allow. If you want to use a table, I recommend this tablesorter instead!

 

EDIT to add... I'll do a guide on this in a couple of days 🙂

Edited by Kit the Human
  • Thank you 1

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

Thanks, Kit! I appreciate it. 

Reality is an illusion. 


 
 

Link to comment
Share on other sites

Proof of concept for you https://kit89.jcink.net/index.php?act=Members

 

Probably telling you how to suck eggs, but create a copy of your templates to make sure you can revert if you're not happy.

 

Add the following to the top of the member list header template

<script type="text/javascript" src="https://files.jcink.net/uploads/kit89/jquery_tablesorter_min.js"></script>
<script>
$(function() {
  $("#memberlist").tablesorter();
});
</script>

Obviously rehost the script.

 

Find

<table width="100%" border="0" cellspacing="1" cellpadding="4">

 

And give it an id of member-list and a class of tablesorter. So:

<table id="memberlist" class="tablesorter" width="100%" border="0" cellspacing="1" cellpadding="4">

 

Find

<tr class="member-list-header">

 

And turn it into a thead. So:

 

<thead>
  <tr>
    <th class="pformstrip" width="30%">Name</th>
    <th class="pformstrip" align="center" width="20%">Face Claim</th>
    <th class="pformstrip" align="center" width="10%">Group</th>
    <th class="pformstrip" align="center" width="10%">Posts</th>
  </tr>
</thead>

 

Now wrap <% MEMBERLIST_ROWS %> into a tbody:

 

<tbody>
  <% MEMBERLIST_ROWS %>
</tbody>

 

Save and it should be working.

 

This is my member list header

 

<script type="text/javascript" src="https://files.jcink.net/uploads/kit89/jquery_tablesorter_min.js"></script>
<script>
$(function() {
  $("#memberlist").tablesorter();
});
</script>

<form action='index.php' method='post'>
<input type='hidden' name='act' value='Members' />
<div align="left"><!-- |pages| --></div>
<br />

<div style="background: #ebeafa; padding: 20px; margin: 5px 0; border: 3px solid #f6f6fb; outline: 1px solid #acaaba; text-align: center">
	Click on the headings to change the sort order!
</div>

<div class='tableborder' id='member-list'>
 <div class="maintitle">Member List</div>
<table id="memberlist" class="tablesorter" width="100%" border="0" cellspacing="1" cellpadding="4">
	<thead>
		<tr>
			<th class="pformstrip" width="30%">Name</th>
			<th class="pformstrip" align="center" width="20%">Face Claim</th>
			<th class="pformstrip" align="center" width="10%">Group</th>
			<th class="pformstrip" align="center" width="10%">Posts</th>
		</tr>
	</thead>
	<tbody>
		<% MEMBERLIST_ROWS %>

	</tbody>
</table></div>

<div style="margin: 2px 0; padding: 2px; text-align: center">
	<div class="row3"><strong>Show matches with photo only?&nbsp; <!-- |photoonly_checkbox| --></strong></div>
    	<div class='pformstrip'>
    		<select class="forminput" name="name_box">
	 		<option value="begins">Name begins with</option>
	 		<option value="contains" selected="selected">Name contains</option>
	 	</select>&nbsp;&nbsp;<!-- |search_input| -->
	</div>
   	<div class='darkrow1'>
		Showing <!-- |group_dropdown| --> 
		by <!-- |sortby_dropdown| --> 
		in <!-- |order_dropdown| --> 
		with <!-- |max_dropdown| --> 
		results per page 
		&nbsp;<input type="submit" value="Go" class="forminput" />
	</div>
 </div>

And my row

<tr>
	<td class="row4"><!-- |member_name| --></td>
	<td class="row4" align="center"><!-- |field_17| --></td>
	<td class="row4" align="center"><!-- |group| --></td>
	<td class="row4" align="center"><a href='index.php?act=Search&CODE=getalluser&mid=<!-- |id| -->&type=posts' title='<!-- |last_post| -->'><!-- |posts| --></a></td>
</tr>

 

Hope that helps!

  • Love 1

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

I can't seem to get this working...

Reality is an illusion. 


 
 

Link to comment
Share on other sites

This bit is really important. Your table headers need to be outside the tbody and inside a thead. Reread my table code to see how it ought to look.

<thead>
  <tr>
    <th class="pformstrip" width="30%">Name</th>
    <th class="pformstrip" align="center" width="20%">Face Claim</th>
    <th class="pformstrip" align="center" width="10%">Group</th>
    <th class="pformstrip" align="center" width="10%">Posts</th>
  </tr>
</thead>

 

  • Thank you 1

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

YAY! I got it working! The problem was how I was saving the JS file. >.> So it was a dumb on my end. A real dumb dumb. But thank you, thank you so much for helping me out! 

  • Love 1

Reality is an illusion. 


 
 

Link to comment
Share on other sites

You're most welcome! Glad you got it working!

  • Thank you 1

 

sig.png.30b42565d04d922988370bf14e1447bc.png

PSI: an Occult Investigations RP

Roleplay Architects: Grab a friend (or many friends!) and just write.

You can also find me at:

static-historicalrp.jpg  B8CB4x.png rpabutton.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.