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/Code)
 MOD: Topic Sorting & Alternate Paging Style
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 6

Gandalf il Bianco
Starting Member

Italy
18 Posts

Posted - 23 May 2001 :  08:32:19  Show Profile  Visit Gandalf il Bianco's Homepage  Send Gandalf il Bianco an ICQ Message
I like it !!!
I really like it!! Great Work Mule!

Go to Top of Page

lcs78816
Junior Member

195 Posts

Posted - 24 May 2001 :  03:21:14  Show Profile
does this also work on TopicPaging() on forum.asp?

Go to Top of Page

aston
New Member

Andorra
51 Posts

Posted - 24 May 2001 :  06:17:21  Show Profile
i can`t work!

______________________

Fly me to the Moon
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 25 May 2001 :  02:27:04  Show Profile
I updated this mod to now include topic sorting and also improved the paging code. Please refer to the first post for demo(s) and download.

For the demo, I used the original 3.1sr4 files and inserted the modifications. Everything appears to be working pretty well. I also included notes for people using the Message Icons and one of the poll mods.

I'm not confident about mySQL due to the recordset count that's needed for the topic sorting. If it does support this, then it's a small tweak in the mySQL specific coding for the recordset.

One suggestion that I can make for people who still prefer to use the old paging sub is that it probably could be tweaked. The querystring is being built within the for loop.

Here's part of the original paging code:

for counter = 1 to maxpages
if counter <> cint(pge) then
ref = "<td align=right bgcolor=" & strPageBGColor & "><font face=" &_
strDefaultFontFace & " size=" & strDefaultFontSize & ">" & " " &_
widenum(counter) & "<a href='" & scriptname
ref = ref & "?whichpage=" & counter
'ref = ref & "&pagesize=" & mypagesize
ref = ref & "&Forum_Title=" & ChkString(Request.QueryString("FORUM_Title"),"urlpath")
ref = ref & "&Topic_Title=" & ChkString(Request.QueryString("Topic_Title"),"urlpath")
ref = ref & "&CAT_ID=" & Request.QueryString("CAT_ID")
ref = ref & "&FORUM_ID=" & Request.QueryString("FORUM_ID")
ref = ref & "&TOPIC_ID=" & Request.QueryString("TOPIC_ID") & "'"


Looking at this, you should recognize that the last five lines above don't change. One modification that I made was to set that to a variable before entering the loop and then refer to the variable when I needed to get that information. For things like the members pages, I figured it should be worth something to eliminate calling the ChkString function twice per the number of times through the loop (however many recordset pages there are).


strQS = "&TOPIC_ID=" & Request("TOPIC_ID") &_
"&FORUM_ID=" & Request("FORUM_ID") &_
"&CAT_ID=" & Request("CAT_ID") &_
"&Forum_Title=" & ChkString(Request("FORUM_Title"),"urlpath") &_
"&Topic_Title=" & ChkString(Request("Topic_Title"),"urlpath")


for counter = 1 to maxpages
if counter <> cint(pge) then
ref = "<td align=right bgcolor=" & strPageBGColor & "><font face=" &_
strDefaultFontFace & " size=" & strDefaultFontSize & ">" & " " &_
widenum(counter) & "<a href='" & scriptname
ref = ref & "?whichpage=" & counter
'ref = ref & "&pagesize=" & mypagesize
ref = ref & strQS & "'"



Hope this helps.


"Do not go where the path may lead, go instead where there is no path and leave a trail."

-Ralph Waldo Emerson

Edited by - work mule on 25 May 2001 02:56:50
Go to Top of Page

lcs78816
Junior Member

195 Posts

Posted - 25 May 2001 :  02:33:03  Show Profile
wow
thanx for the hard work!
Snitz is becoming better and better
great job! work_mule!

Go to Top of Page

lcs78816
Junior Member

195 Posts

Posted - 25 May 2001 :  16:56:42  Show Profile
one question about this mod is that for the function of "show topic from last xx days", I think its neccessary to took the one on top and replace it to the one on the bottom, or please correct me if I am wrong that it has special function? The other bug (or maybe not a bug) is that when I try to use the bottom "show topic from last xx days" and press "go", it won't change the setting.

Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 25 May 2001 :  17:47:30  Show Profile
DOH!! Sorry bout that.

Took me a bit to figure out why it wasn't working. But here's what it was.

I was missing the hidden input field in that form. Without it, selecting the number of days wouldn't work.

To fix, look at the code for forum.asp where the code for that form exists. If you add the following line right after the closing select tag, it'll work. I also updated the zip file.

Response.Write("<input type=""hidden"" name=""Cookie"" value=""1"">")


"Do not go where the path may lead, go instead where there is no path and leave a trail."

-Ralph Waldo Emerson
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 25 May 2001 :  18:06:39  Show Profile
I just made another modification to the topic sorting code for forum.asp.

For the section where it reads:
Showing topics x to x of x, sorted by 


When there was 0 topics, it read:
Showing topics 1 to -1 of 0, sorted by 


I added a check so that if there's 0 topics, it just reads:
Showing 0 topics, sorted by




"Do not go where the path may lead, go instead where there is no path and leave a trail."

-Ralph Waldo Emerson
Go to Top of Page

lcs78816
Junior Member

195 Posts

Posted - 25 May 2001 :  18:22:14  Show Profile
ya! now its working fine now
great job!

Go to Top of Page

lcs78816
Junior Member

195 Posts

Posted - 25 May 2001 :  18:43:54  Show Profile
hmm....just got another problem...but not with your mod, but with huwr's addinplace mod. in forum.asp
where this line
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS." & strSortCol & " "

is conflicting with addinplace's line
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_INPLACE DESC "
strSql = strSql & " , " & strTablePrefix & "TOPICS.T_LAST_POST DESC "



Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 25 May 2001 :  18:56:10  Show Profile
I'm not at all familiar with what huwr's addinplace mod was/does.

I think all you have to do is figure out which one you want to sort on first or have priority. Oh wait...do it like this, replace Huwr's addinplace line with this:

strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_INPLACE DESC "
strSql = strSql & " , " & strTablePrefix & "TOPICS." & strSortCol


The reason is because instead of the default of sorting by this field: "T_LAST_POST", this mod is changing the field name and sort order to whatever the user selects.

Hope that helps!


"Do not go where the path may lead, go instead where there is no path and leave a trail."

-Ralph Waldo Emerson
Go to Top of Page

lcs78816
Junior Member

195 Posts

Posted - 25 May 2001 :  19:04:45  Show Profile
Basically addinplace is a mod that lock a topic that you want and display it first then other topics. Its good for display Annoucement for a specific forum.

strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_INPLACE DESC "
strSql = strSql & " , " & strTablePrefix & "TOPICS." & strSortCol

Hmm, that's just what I tried and failed. I'll come back later tonight and try to sort my brain out. Cause I think addinplace is kinda useful for different topic forum.

This also reminds me that does your mod sort locked forum as well?

Edited by - lcs78816 on 25 May 2001 19:07:19
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 25 May 2001 :  19:21:36  Show Profile
Hmm...

I'm not sure what it could be right now. The only modification to the SQL string is the order by part of the SQL statement. From what you described about huwr's mod, it would be best to have that appear first in the order by, followed by the order by field from this mod. I'll have to look into huwr's mod, it sounds like something I'd be interested in anyways.

Something else to check - are all the field names (that are at the top within the variables section) available in your SQL string? Probably.


Select Case strtopicsortord
Case "asc"
strSortOrd = " ASC"
Case Else
strSortOrd = " DESC"
End Select

Select Case strtopicsortfld
Case "topic"
strSortCol = "T_SUBJECT" & strSortOrd
Case "author"
strSortCol = "T_AUTHOR" & strSortOrd
Case "replies"
strSortCol = "T_REPLIES" & strSortOrd
Case "views"
strSortCol = "T_VIEW_COUNT" & strSortOrd
Case "lastpost"
strSortCol = "T_LAST_POST" & strSortOrd
Case Else
strSortCol = "T_LAST_POST" & strSortOrd
End Select


What was the error message? Could you post a copy here?


"Do not go where the path may lead, go instead where there is no path and leave a trail."

-Ralph Waldo Emerson
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 25 May 2001 :  19:23:38  Show Profile
Could it be something as simple as adding in a space at the end? (Probably not.)


strSql = strSql & " , " & strTablePrefix & "TOPICS." & strSortCol & " "



"Do not go where the path may lead, go instead where there is no path and leave a trail."

-Ralph Waldo Emerson
Go to Top of Page

lcs78816
Junior Member

195 Posts

Posted - 25 May 2001 :  22:39:29  Show Profile
okay, I have set up 2 temp forums to test out the addinplace
nothing change for administration, so you can test it out.
If you encounter "Network is busy", sorry about that, since
the server end (ReadyHosting) is having problem with Snitz, and
nothing I can do about that except to wait a bit for posting.
click here forum1
this one use only addinplace mod

click here forum2
this one use both addinplace mod and sorting mod
note: I use the code:
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_INPLACE DESC "
strSql = strSql & " , " & strTablePrefix & "TOPICS." & strSortCol

for this forum
forum2 appears okay from first look, but once you start using sorting function below, it messed up.


Edited by - lcs78816 on 25 May 2001 23:01:58

Edited by - lcs78816 on 25 May 2001 23:02:18

Edited by - lcs78816 on 25 May 2001 23:03:37
Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07