Author |
Topic  |
DoraMoon
Average Member
  
Taiwan
661 Posts |
Posted - 31 August 2002 : 09:42:32
|
hi~ Mark
the strPageSize is a constant value that you can define it in Admin Option - Feature Configuration. but i think it will influence many pages..(forum.asp,active.asp...any pages that have paging function in forum.)
so if you do'nt want it display so much -25- replies in topic review, it's better define another value for it... for example:
'## Forum_SQL - Get all replies to Topic from the DB strSql ="SELECT TOP 10 " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strActivePrefix & "REPLY.R_MESSAGE " : : do until rs.BOF or (intRecordCount > Cint(strPageSize))) '(i think this line could be simplified like this..)
then it will display last 10 replies only...
or if you want to define it as a variable.. '## Forum_SQL - Get all replies to Topic from the DB Dim DisplayReplies DisplayReplies = 10 strSql ="SELECT TOP " & DisplayReplies & " " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strActivePrefix & "REPLY.R_MESSAGE " : : it's the same doing... (change 10 to the value you like..)
then in this line Response.Write("L A T E S T ??R E P L I E S</font></b></td></tr>") change to Response.Write DisplayReplies & " lastest replies (oldest first)</font></b></td></tr>"
but this way, you still need to edit post.asp file to set the "DisplayReplies" value... and if you want to set it from Admin Option or another setup interface.... well~~ i think it'll become more complex.. we need to add a new variable to CONFIG_NEW table.. then add one or two line in config.asp
so if it not so trouble for you to edit the post.asp file, i think just set the value as above code will be o.k.
or if you really want to add this setup option in Feature Configuraton, just let me know, i think it'll not too difficult, i can try to do this for you...  |
~ . .. . . .~ .~~ |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 31 August 2002 : 09:59:33
|
Yes, I know that strPageSize is set in Admin Options (mine is set to 25) but let's say that there had only been 9 replies made in the topic, I wanted it to say "9 latest replies (oldest first)". Obviously, it would never say more than "25 latest replies (oldest first)".
Looking at the v3.4 code, I see that something similar (though it uses 'newest first') has been implemented there (some kind of counter?), so it can be done!  |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
DoraMoon
Average Member
  
Taiwan
661 Posts |
Posted - 31 August 2002 : 10:53:16
|
Mark, sorry for make a big mistake what you meaning...
i know if this message can be display at "bottom".. then it could be more easy. just as your code at the bottom add these lines.. loop Response.Write("<tr>") Response.Write("<td bgcolor=""" & strHeadCellColor & """ colspan=""2"" align=""center""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>") Response.Write intRecordcount & " lastest replies...</font></b></td></tr>" end if
but if you want it display at "top" just like the v3.4 mmh.... i have no good idea how to do this....
as my stupid method, maybe i will make a new SQL query to get the total replies count in this topic... (it's a bad way !!) i take a look the post.asp in 3.4. now it use GetRows in all sql statement, so it can get the total record count first before we output it... and i really not very understand what "GetRows" work...
so maybe the best method is take the code from 3.4, and try to change something to fit your need.... (i do'nt know how to "reverse" this line: for iReply = 0 to recReplyCount...)
sorry can't help you about this....
|
 |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 31 August 2002 : 11:13:07
|
For version 3.3, all you need to do is get the records in Asc order and use the rs.move
if rs.RecordCount > strPageSize then
rs.move (rs.RecordCount - (strPageSize - 1))
end if
|
CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain
It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Prayer Of Forgiveness "I forgive all living beings. May all living beings forgive me! I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated) |
 |
|
DoraMoon
Average Member
  
Taiwan
661 Posts |
Posted - 31 August 2002 : 14:47:09
|
Wow~~ Thanks for this guidance!! G.B. you give me one precious lesson... thx!
hi~ Mark, sorry for misleading... i think it'll be more clear now as GB's suggest.
please forgot all my stupid code, and return to your original code !! if rs.EOF or rs.BOF then Response.Write "" else if rs.RecordCount > Cint(strPageSize) then rs.move (rs.RecordCount - Cint(strPageSize)) displayitems = Cint(strPageSize) else displayitems = rs.RecordCount end if Response.Write("<tr>") :: ::: Response.Write("L A T E S T " & displayitems & " R E P L I E S</font></b></td></tr>") :: :::
i think the code should be so simply just like this..... |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 01 September 2002 : 10:42:36
|
rs.move (rs.RecordCount - Cint(strPageSize))
should be
rs.move (rs.RecordCount - Cint(strPageSize - 1)) |
CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain
It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Prayer Of Forgiveness "I forgive all living beings. May all living beings forgive me! I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated) |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 01 September 2002 : 11:56:00
|
It will show one extra reply as is |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
|
DoraMoon
Average Member
  
Taiwan
661 Posts |
Posted - 01 September 2002 : 12:24:57
|
i think it's ok, just depend on Mark's need..
we did'nt including the "topic" count here.. so as GB's suggest, we can display Max (one topic + 24 replies) = 25, then it can keep the strPageSize in admin setting.
coz i think Mark want to Max 25 replies, so i did'nt add the -1 in the code...
anyway, thank GB again~ i really learn more from this.. |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 01 September 2002 : 12:53:48
|
Okay, I get the point now. Apologies, GauravBhabu.
Topic + 25 replies is what I wanted, so all's good!  |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
Edited by - MarkJH on 01 September 2002 12:57:26 |
 |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 01 September 2002 : 16:12:39
|
DaraMoon, MarkJH the purpose of -1 is to get the last 25 replies to the topic(if strPageSize is set to 25).
Let me explain how it works. if the recordcount for replies is 100, we want replies starting at # 76 to 100.
so 100 - 25 = 75 if we move to record # 75 it will show 26 replies
and 100 - (25 -1)= 76 if we move to record # 76 it will show 25 replies. |
 |
|
MarkJH
Senior Member
   
United Kingdom
1722 Posts |
Posted - 01 September 2002 : 16:58:50
|
Okay, am I totally missing something here? strPageSize is set to 25 and i'm getting 25 replies. Not 24 or 26. So surely putting '-1' in the equation will give me 24 replies? 
Anyway, it works.  |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
 |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 01 September 2002 : 17:22:33
|
Are you counting the the original Post also |
 |
|
Topic  |
|