Author |
Topic  |
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 21 August 2002 : 13:55:38
|
I had a go at implementing Gor's Topic Review Mod (see Completed Mods forum) but didn't really like the way it's been designed to work. Gor's mod shows the first post in the topic, then lists the last x number of posts, in reverse order.
I want the modification to the code to just display the posts just as it does normally, but only the last x amount of posts. x being determined by the number of posts displayed on a page as set in Admin Options.
Any ideas? |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
Hamlin
Advanced Member
    
United Kingdom
2386 Posts |
Posted - 23 August 2002 : 03:26:34
|
Mark is it this mod? If so maybe try changing the DESC to ASC...
|
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 24 August 2002 : 11:03:23
|
I'm not keen on the way that mod works. All I want is to display the last 25 posts in the Topic Review and in exactly the same way as it works standard in v3.3.03 but obviously not displaying all the posts in the topic. |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 26 August 2002 : 20:20:55
|
Okay, i've changed DESC to ASC as you suggested, Hamlin.
There's a lot wrong with this mod for v3.3.03:
In this mod, Gor stated that "Because we're using 3.3.02 here at the site, strPageSize now is a string. The RED code is needed to convert it to an integer for it to work." There doesn't appear to be any RED code anywhere on the page! The current code still displays all the posts rather than the latest x amount.
Rather than saying "L A T E S T R E P L I E S", how could I change it to make it say "LATEST x NO. OF REPLIES"?
TIA. |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
Hamlin
Advanced Member
    
United Kingdom
2386 Posts |
Posted - 28 August 2002 : 13:42:24
|
Mark to convert strPage size to a int I think on this line
(rs.EOF or (intRecordCount > strPageSize))
you need to add Cint(strPageSize)
So it would be
(rs.EOF or (intRecordCount > Cint(strPageSize)))
And if you made this line
sResponse.Write("L A T E S T R E P L I E S (Newest First)</font></b></td></tr>")
to
Response.Write("L A T E S T " & strPageSize & " R E P L I E S (Newest First)</font></b></td></tr>")
It would get the X number you want
That was all wrong  |
Edited by - Hamlin on 28 August 2002 13:49:35 |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 28 August 2002 : 14:03:06
|
quote: Mark to convert strPage size to a int I think on this line
(rs.EOF or (intRecordCount > strPageSize))
you need to add Cint(strPageSize)
So it would be
(rs.EOF or (intRecordCount > Cint(strPageSize)))
Kinda working... except it's listing the first 25 replies! 
|
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
Hamlin
Advanced Member
    
United Kingdom
2386 Posts |
Posted - 28 August 2002 : 14:41:48
|
lol you know where I suggested make it ASC well that was wrong er I was sleepy....doing DESC will give the newest reply...I think |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 29 August 2002 : 13:15:38
|
Okay, this is the problem.
When I use DESC, it does list the last 25 replies but in opposite order i.e. the latest reply is at the top whilst the 25th latest is at the bottom.
If I use ASC, it lists the first 25 replies to the topic, but in the correct order (top to bottom).
I need a combination of both! lol |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 29 August 2002 : 13:16:41
|
This is what i've got so far:
'## Forum_SQL - Get all replies to Topic from the DB strSql ="SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strActivePrefix & "REPLY.R_MESSAGE " strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strActivePrefix & "REPLY " strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strActivePrefix & "REPLY.R_AUTHOR " strSql = strSql & " AND TOPIC_ID = " & Request.QueryString("TOPIC_ID") & " " ' DEM --> Added check for moderation so that only admins and moderators can see the unapproved posts. if Moderation = "Y" then strSql = strSql & " AND R_STATUS < 2 " ' Ignore unapproved and rejected posts... else strSql = strSql & " AND R_STATUS < 3 " ' Ignore all rejected posts.... end if strSql = strSql & " ORDER BY " & strActivePrefix & "REPLY.R_DATE ASC"
set rs = Server.CreateObject("ADODB.Recordset")
' rs.cachesize=15 rs.open strSql, my_Conn, 3
strI = 0 intRecordcount = 1 if rs.EOF or rs.BOF then Response.Write "" else Response.Write("<tr>") Response.Write("<td bgcolor=""" & strHeadCellColor & """ colspan=""2"" align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>") Response.Write("L A T E S T R E P L I E S</font></b></td></tr>") rs.movefirst do until (rs.EOF or (intRecordCount > Cint(strPageSize))) if strI = 0 then CColor = strAltForumCellColor else CColor = strForumCellColor end if Response.Write " <TR>" & vbNewline & _ " <TD bgcolor='" & CColor & "' valign='top'" & vbNewline if lcase(strTopicNoWrapLeft) = "1" then Response.Write " nowrap" end if Response.Write "><b><font color='" & strForumFontColor & "' face='" & strDefaultFontFace & "' size='2'>" & ChkString(rs("M_NAME"),"display") & "</font></b></td>" & vbNewline & _ " <TD bgcolor='" & CColor & "' valign='top'" if lcase(strTopicNoWrapRight) = "1" then Response.Write " nowrap" end if Response.Write "><font color='" & strForumFontColor & "' face='" & strDefaultFontFace & "' size='2'>" & formatStr(rs("R_MESSAGE")) & "</font></td>" & vbNewline & _ " </tr>" & vbNewline rs.MoveNext intRecordcount = intRecordcount + 1 strI = strI + 1 if strI = 2 then strI = 0 end if loop end if |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 30 August 2002 : 13:23:01
|
Hmm, I know that v3.4 is most peoples primary focus right now but surely somebody could help me with this please? I'm not wanting to rant and rave but i'm really needing some help here. I've had to bump this three times already.
Hamlin, thanks for all your help so far!  |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
DoraMoon
Average Member
  
Taiwan
661 Posts |
Posted - 30 August 2002 : 16:01:07
|
hi~ Mark it really a "creative" topic review method... i never thought it~ 
not sure this doing right or wrong, but maybe you can try it...
'## Forum_SQL - Get all replies to Topic from the DB strSql ="SELECT TOP " & Cint(strPageSize) & " " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strActivePrefix & "REPLY.R_MESSAGE " strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strActivePrefix & "REPLY " strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strActivePrefix & "REPLY.R_AUTHOR " strSql = strSql & " AND TOPIC_ID = " & Request.QueryString("TOPIC_ID") & " " ' DEM --> Added check for moderation so that only admins and moderators can see the unapproved posts. if Moderation = "Y" then strSql = strSql & " AND R_STATUS < 2 " ' Ignore unapproved and rejected posts... else strSql = strSql & " AND R_STATUS < 3 " ' Ignore all rejected posts.... end if strSql = strSql & " ORDER BY " & strActivePrefix & "REPLY.R_DATE DESC"
set rs = Server.CreateObject("ADODB.Recordset")
' rs.cachesize=15 rs.open strSql, my_Conn, 3
strI = 0 intRecordcount = 1 if rs.EOF or rs.BOF then Response.Write "" else Response.Write("<tr>") Response.Write("<td bgcolor=""" & strHeadCellColor & """ colspan=""2"" align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>") Response.Write("L A T E S T R E P L I E S</font></b></td></tr>") rs.MoveLast do until (rs.BOF or (intRecordCount > Cint(strPageSize))) if strI = 0 then CColor = strAltForumCellColor else CColor = strForumCellColor end if Response.Write " <TR>" & vbNewline & _ " <TD bgcolor='" & CColor & "' valign='top'" & vbNewline if lcase(strTopicNoWrapLeft) = "1" then Response.Write " nowrap" end if Response.Write "><b><font color='" & strForumFontColor & "' face='" & strDefaultFontFace & "' size='2'>" & ChkString(rs("M_NAME"),"display") & "</font></b></td>" & vbNewline & _ " <TD bgcolor='" & CColor & "' valign='top'" if lcase(strTopicNoWrapRight) = "1" then Response.Write " nowrap" end if Response.Write "><font color='" & strForumFontColor & "' face='" & strDefaultFontFace & "' size='2'>" & formatStr(rs("R_MESSAGE")) & "</font></td>" & vbNewline & _ " </tr>" & vbNewline rs.MovePrevious intRecordcount = intRecordcount + 1 strI = strI + 1 if strI = 2 then strI = 0 end if loop end if
i think this can show the last "strPageSize"(u can chage this..) replies and in normal order...
hope this have some help~~  |
~ . .. . . .~ .~~ |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 31 August 2002 : 06:11:21
|
Dora, you are a legend! 
That works perfectly! This'll take a lot of strain off of my server and it'll mean my moderators won't have to keep locking threads after 10 pages. Awesome stuff, no forum should be without it!
Thanks again!  |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 31 August 2002 : 06:22:53
|
Erm, one more thing. 
How would I go about changing the "Latest Replies" to something like "x latest replies (oldest first)" where x is the number of replies up to the largest amount of replies set by me in the admin section? i.e x could be anywhere between 1 and - in the case of my forums - 25? |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
Topic  |
|