|
From: <ha...@us...> - 2007-09-23 07:41:03
|
Revision: 92
http://jgbbs.svn.sourceforge.net/jgbbs/?rev=92&view=rev
Author: hanru
Date: 2007-09-23 00:40:58 -0700 (Sun, 23 Sep 2007)
Log Message:
-----------
By default, sort by last-modified date, and user may choose to sort by name as well.
Modified Paths:
--------------
jgbbs3/trunk/contact.asp
Modified: jgbbs3/trunk/contact.asp
===================================================================
--- jgbbs3/trunk/contact.asp 2007-04-28 08:46:15 UTC (rev 91)
+++ jgbbs3/trunk/contact.asp 2007-09-23 07:40:58 UTC (rev 92)
@@ -75,12 +75,25 @@
'**************************
Function InShowContact()
+ Dim orderBy, isDesc
+ orderBy = "contact_lastupdate"
+ isDesc = 1
+ If Request.QueryString("sort") = "name" Then
+ orderBy = "contact_name"
+ End If
+ If Request.QueryString("desc") = "0" Then
+ isDesc = 0
+ End If
+
Dim rsContact, sql, entries, entryCount
entries = Split(GetCfgItem("ADDON_CONTACT_ENTRY"), ",")
' Total: 1..n
' UBound: 0..n-1, return n-1
entryCount = UBound(entries)
- sql = "SELECT * FROM contacts ORDER BY contact_name"
+ sql = "SELECT * FROM contacts ORDER BY " & orderBy
+ If isDesc Then
+ sql = sql & " DESC"
+ End If
sql = ParseSql(sql)
Set rsContact = dbConn.Execute(sql)
%>
@@ -89,9 +102,9 @@
<br /><br />
<table width="100%" border="0" cellspacing="1" cellpadding="5" class="color_dark">
<tr>
- <td class="color_medium" nowrap><%=langContactName%></td><% For Each x In entries %>
+ <td class="color_medium" nowrap><a href="./contact.asp?sort=name&desc=<%=(isDesc+1) Mod 2%>"><%=langContactName%></a></td><% For Each x In entries %>
<td class="color_medium" nowrap><%=x%></td><% Next %>
- <td class="color_medium" nowrap><%=langLastUpdate%></td>
+ <td class="color_medium" nowrap><a href="./contact.asp?sort=date&desc=<%=(isDesc+1) Mod 2%>"><%=langLastUpdate%></a></td>
</tr><% While Not rsContact.EOF %>
<tr>
<td class="color_light" nowrap><a href="./contact.asp?name=<%=Server.URLEncode(rsContact("user_name"))%>"><%=rsContact("contact_name")%></a></td><% For i = 0 To entryCount %>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|