Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Admin Email List - Sorting Option
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 09 June 2008 :  03:38:19  Show Profile  Reply with Quote
Using the admin_emaillist.asp I notice that the listing is centered around the user name and sorted by their MEMBER_ID. Initially I have changed the sort option from the Member_ID to sort the list by the Members Name alphabetically. (M_NAME) You will see the four options I have added, three which have been commented for reference.


admin_emaillist.asp lines 59-64
'## Forum_SQL - Find all records with the search criteria in them
strSql = "SELECT M_NAME, M_EMAIL, M_POSTS "
strSql2 = " FROM " & strMemberTablePrefix & "MEMBERS "
strSql3 = " WHERE M_STATUS = " & 1
strSql4 = " ORDER BY M_NAME ASC " '##sort by member name
'strSql4 = " ORDER BY MEMBER_ID ASC " '##sort by member id
'strSql4 = " ORDER BY M_POSTS ASC " '##sort by number of posts
'strSql4 = " ORDER BY M_EMAIL ASC " '##sort by email address



To make the admail_emaillist.asp more flexible to the user, I am looking to add a pull down option where we can select the sort choice based on a value from strSql4. I have grabbed this piece of code and adjusted the names in option colours. I wonder if someone could assist is showing us how to tie the option box so that we utilise the different strSql4's. I am stumped here how to tie the two together maybe an 'if' statement is required..

Secondly I will be looking to add this new option box on the same line as the NOTE: The following table will show you a list of all users of this forum, and their e-mail addresses.

Any further help will be appreciated.

" <select style=""width:140;"" name=""emailsort"">" & VBNewLine & _
" <option value=""0""" & checkSelect(stremailsort,"0") & ">" Sort by User name "</option>" & VBNewLine & _
" <option value=""1""" & checkSelect(stremailsort,"1") & ">" Sort by Member ID "</option>" & VBNewLine & _
" <option value=""2""" & checkSelect(stremailsort,"2") & ">" Sort by Posts "</option>" & VBNewLine & _
" <option value=""3""" & checkSelect(stremailsort,"3") & ">" Sort by Posts "</option>" & VBNewLine & _
" </select>" & VBNewLine & _


Thank you andy

<

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 09 June 2008 :  04:12:02  Show Profile  Reply with Quote
Let's start with the easy one. See this line?
" <option value=""3""" & checkSelect(stremailsort,"3") & ">" Sort by Posts "</option>" & VBNewLine & _


I'm fairly sure you mean "Sort by Email Address ".

Back to the initial query. Using an if/then series; you could do something like this:
Option Explicit
strSort = Request.Form("emailsort")
if strSort > "" then
	if strSort = "0" then strSql4 = " ORDER BY M_NAME ASC "
	else if strSort = "1" then strSql4 = " ORDER BY MEMBER_ID ASC "
	else if strSort = "2" then strSql4 = " ORDER BY M_POSTS ASC "
	else strSql4 = " ORDER BY M_EMAIL ASC "
	end if
strSql = "SELECT M_NAME, M_EMAIL, M_POSTS "
strSql2 = " FROM " & strMemberTablePrefix & "MEMBERS "
strSql3 = " WHERE M_STATUS = " & 1
	

	
		
All the stuff you want to do with the results in here...	
	
	
else	
" <select style=""width:140;"" name=""emailsort"">" & VBNewLine & _
	" <option value=""0""" & checkSelect(stremailsort,"0") & ">" Sort by User Name "</option>" & VBNewLine & _
	" <option value=""1""" & checkSelect(stremailsort,"1") & ">" Sort by Member ID "</option>" & VBNewLine & _
	" <option value=""2""" & checkSelect(stremailsort,"2") & ">" Sort by Posts "</option>" & VBNewLine & _
	" <option value=""3""" & checkSelect(stremailsort,"3") & ">" Sort by EMail "</option>" & VBNewLine & _
" </select>" & VBNewLine & _
end if


However, I believe that if you get this mod, it'll save you a lot of work: EMail Search
<

Edited by - Carefree on 09 June 2008 04:13:47
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 09 June 2008 :  04:26:35  Show Profile  Reply with Quote
Carefree absolutely quick on the response and I thank you.. Yes the 'easy one' you were right in my intenstions, missed it on the cut and paste.. Just the hard bit now getting this routine incorporated in the page. Ideally I would like to add the option pull down into the page on the same line as the NOTE: The following table will show you a list of all users of this forum, and their e-mail addresses.
thank you so far
BTW here is my admin_emaillist.asp text link for reference
<

Edited by - Andy Humm on 09 June 2008 04:31:10
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 09 June 2008 :  05:37:06  Show Profile  Reply with Quote
Further to above, I have created a new cell where I would like the option box placed on image where the 'ss' is (top left corner)



The code around the table head is:
		"        </tr>" & vbNewLine & _
		"        <tr>" & vbNewLine & _
		"        <td width=""20%"" ><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>ss</td>" & vbNewLine & _
		"          <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>The following table shows a list of all users of this forum, and their e-mail addresses.</font></td>" & vbNewLine
if maxpages > 1 then
	Response.Write	"          <td width=""15%"" align=""right"">" & vbNewLine & _
			"            <table border=""0"" align=""right"">" & vbNewLine & _
			"              <tr>" & vbNewLine
	Call DropDownPaging(1)
	Response.Write	"              </tr>" & vbNewLine & _
			"            </table>" & vbNewLine & _
			"          </td>" & vbNewLine
end if
<

Edited by - Andy Humm on 09 June 2008 09:34:49
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 09 June 2008 :  15:34:40  Show Profile  Reply with Quote
Here you go - I have everything done except the selection isn't being sent to the form for action.

EMail List<

Edited by - Carefree on 09 June 2008 15:54:12
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 09 June 2008 :  16:50:31  Show Profile  Reply with Quote
So far we are getting a little further, thank you carefree..
The page link you provided has a few table formating differences, which I have revamped to the latest. As carefree has said we have a pull down option box but it is not functioning to do the sort. Can anyone assist in our pursuit..
This is what we have:


And the admin_emaillist.asp latest code is here

The lines associated with the changes so far:
59-81 sql
153-159 Option Box

Thank you andy
<

Edited by - Andy Humm on 10 June 2008 01:18:59
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 11 June 2008 :  13:03:52  Show Profile  Reply with Quote
Carefree
Initially when I tried your suggested code, I did have a few display errors, ie fonts and layout was peculiar.
Looking at the code again, I noticed the following:
" </table" & vbNewLine & _
"<form method=""post"" ID=""EMSR"" action

Apologies I have no line numbers as I do not have access to my main computer with editing software..

If table tag is wrong ie </table> and this sorts the layout, could we remove the Member_ID column and stay with the original three coloumns (Member Name, Email Address and Posts)
I wonder if we can get the pulldown option to work.
Thank you
Andy<

Edited by - Andy Humm on 11 June 2008 13:04:38
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 11 June 2008 :  14:23:54  Show Profile  Reply with Quote
I'll have the pull-down working today. I'll send you the new code in the next couple of hours.<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 11 June 2008 :  15:35:44  Show Profile  Reply with Quote
cheers<
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 11 June 2008 :  16:09:09  Show Profile  Reply with Quote
Well, I have the page number pull-down fixed. The sorter is missing something important.

Email List<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 12 June 2008 :  07:29:29  Show Profile  Reply with Quote
We had problems getting onto snitz since yesterday and hey presto were back online. At the moment I am not at worksation with access to my forum software.

Carefree: Can yoy confirm the latest txt version is working with the sorter pulldown working for the sorts as you state "I have the page number pull-down fixed. The sorter is missing something important".
Secondly, has this new code remove the Member_ID column?
Thank you so much
Andy<
Go to Top of Page

philsbbs
Junior Member

United Kingdom
397 Posts

Posted - 13 June 2008 :  14:58:59  Show Profile  Reply with Quote
Just tired this and when changing the page numbers nothing happened.<

Phil
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 13 June 2008 :  17:44:33  Show Profile  Reply with Quote
philsbbs, initially it was not the page numbers that was the problem. I requested to see if we could add a new pulldown option box that provides sorting for the Members Name, Email Address and Number of Posts. (top left hand corner)

From my text file I have the pulldown box there but we can not get it to operate. There is the right sql code for the sorting but we need to tie this into the option box. admin_emaillist.asp text link. This code the pages pulldown option box works okay..

It would be great to get the other pulldown to work..<
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 14 June 2008 :  09:29:57  Show Profile  Reply with Quote
It'd probably be easier to just convert the column headings into sorting links, that would also let you reverse sort (which the pulldown box won't do).<
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 15 June 2008 :  14:33:45  Show Profile  Reply with Quote
Hey Andy, try this for a starting point. You can sort ascending or descending, any column (including Email), filter by member level or first letter of user name, etc.

EM Search

For those who may be interested, I also rewrote the IP Search page to give it the same functionality.

IP Search

<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 15 June 2008 :  17:07:22  Show Profile  Reply with Quote
Carefree, thanks for the great work, I'll download and amend tomorrow..<
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.12 seconds. Powered By: Snitz Forums 2000 Version 3.4.07