Author |
Topic  |
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 09 June 2008 : 03:38:19
|
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
|
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:
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 |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 09 June 2008 : 04:26:35
|
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 |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 09 June 2008 : 05:37:06
|
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: < |
Edited by - Andy Humm on 09 June 2008 09:34:49 |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 09 June 2008 : 15:34:40
|
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 |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 09 June 2008 : 16:50:31
|
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 |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 11 June 2008 : 13:03:52
|
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 |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 11 June 2008 : 14:23:54
|
I'll have the pull-down working today. I'll send you the new code in the next couple of hours.< |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 11 June 2008 : 15:35:44
|
cheers< |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 11 June 2008 : 16:09:09
|
Well, I have the page number pull-down fixed. The sorter is missing something important.
Email List< |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 12 June 2008 : 07:29:29
|
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< |
 |
|
philsbbs
Junior Member
 
United Kingdom
397 Posts |
Posted - 13 June 2008 : 14:58:59
|
Just tired this and when changing the page numbers nothing happened.< |
Phil |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 13 June 2008 : 17:44:33
|
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..< |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 14 June 2008 : 09:29:57
|
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).< |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 15 June 2008 : 14:33:45
|
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
< |
 |
|
Andy Humm
Average Member
  
United Kingdom
908 Posts |
Posted - 15 June 2008 : 17:07:22
|
Carefree, thanks for the great work, I'll download and amend tomorrow..< |
 |
|
Topic  |
|