Author |
Topic |
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 11 October 2002 : 17:54:54
|
Mod Top Posters Author: Rakesh Jain(GauravBhabu) Date : Oct 09, 2002
This will display Top Posters on main forum page
DEMO username: snitz password: snitz
Modifications required to be made in default.asp
Step 1: Add the following code at the end of sub WriteStatistics() Note: Modify the value for iTopPosterNum to show less/more Top Posters. Default setting is 5. see statement in red below.
strSql = "SELECT M_NAME, MEMBER_ID, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS " &_
" ORDER BY M_POSTS desc;"
Dim iTopPosterNum, rsTopPosters, TopPostersFound, arrTopPosters
Dim iPoster, TopPoster_Name, TopPoster_ID, TopPoster_Posts
set rsTopPosters = Server.CreateObject("ADODB.Recordset")
iTopPosterNum = 5
rsTopPosters.open TopSQL(strSql, iTopPosterNum ), my_Conn
if not rsTopPosters.EOF then
arrTopPosters = rsTopPosters.GetRows()
TopPostersFound = true
else
TopPostersFound = false
end if
rsTopPosters.close
set rsTopPosters = nothing
if TopPostersFound then
Response.Write (vbNewLine & _
" <tr>" & vbNewline & _
" <td bgcolor=""" & strForumCellColor & """ colspan=""" & sGetColspan(6,5) & """>" & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>Top Posters: " & _
" <span class=""spnMessageText"">")
for iPoster = 0 to ubound(arrTopPosters, 2)
TopPoster_Name = chkString(arrTopPosters(0, iPoster), "display")
TopPoster_ID = arrTopPosters(1, iPoster)
TopPoster_Posts = arrTopPosters(2, iPoster)
if iPoster > 0 then Response.write (", ")
Response.write (profileLink(TopPoster_Name,TopPoster_Id) & "(" & TopPoster_Posts & " posts)")
next
Response.Write (vbNewLine & _
" </span>.</font>" & vbNewline & _
" </td>" & vbNewline & _
" </tr>")
end if
Erase arrTopPosters
TopPoster_Name = Empty
TopPoster_ID = Empty
TopPoster_Posts = Empty
Step 2: Find the following statements on Lines 906-910
if ShowLastHere then
Response.Write "5"
else
Response.Write "4"
end if
Modify as below
if ShowLastHere then
Response.Write "6"
else
Response.Write "5"
end if
Note: Make backup of your files before modifying/adding the code. Post bugs and or help questions in the Mod Implementation Forum.
|
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) |
Edited by - GauravBhabu on 13 October 2002 02:16:54 |
|
Airborne
Starting Member
38 Posts |
Posted - 11 October 2002 : 19:04:40
|
That one works perfectly thanks |
|
|
user_99
Starting Member
Austria
10 Posts |
Posted - 12 October 2002 : 13:40:24
|
Perfect work-looks great...
:-)
THX, Armin |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 12 October 2002 : 23:54:54
|
any screenshots or demos I can get a look at? |
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 13 October 2002 : 02:17:36
|
quote: Originally posted by dayve
any screenshots or demos I can get a look at?
DEMO username: snitz password: snitz |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 13 October 2002 : 03:33:10
|
ahhh, now I see... thanks G. |
|
|
|
PingSpike
Starting Member
21 Posts |
Posted - 13 October 2002 : 14:28:40
|
Hi, excellent mod (thanks very much!)
I editied one line so it doesn't show deleted members, nor does it show myself on my own forum.
Change:
if iPoster > 0 then Response.write (", ")
Response.write (profileLink(TopPoster_Name,TopPoster_Id) & " (" & TopPoster_Posts & "), ")
To:
If TopPoster_Name <> "n/a" And TopPoster_Name <> "PingSpike" Then
Response.write (profileLink(TopPoster_Name,TopPoster_Id) & " (" & TopPoster_Posts & "), ")
End If
Thanks again, excellent mod !
|
|
|
Ez4arab
Junior Member
479 Posts |
Posted - 22 October 2002 : 22:58:15
|
if you want to reomve the admin and moderator form the top poster
strSql = "SELECT M_NAME, MEMBER_ID, M_POSTS, M_LEVEL " &_ "FROM " & strMemberTablePrefix & "MEMBERS " &_ "WHERE M_LEVEL =1" &_ " ORDER BY M_POSTS desc;"
|
Ez4arab web site Ez4arab | |
Edited by - Ez4arab on 22 October 2002 23:23:43 |
|
|
user_99
Starting Member
Austria
10 Posts |
Posted - 23 October 2002 : 06:29:34
|
... works great!
thx armin |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 23 October 2002 : 17:51:32
|
quote: Originally posted by Ez4arab
if you want to reomve the admin and moderator form the top poster
strSql = "SELECT M_NAME, MEMBER_ID, M_POSTS, M_LEVEL " &_ "FROM " & strMemberTablePrefix & "MEMBERS " &_ "WHERE M_LEVEL =1" &_ " ORDER BY M_POSTS desc;"
NEVER, NEVER, NEVER...!!! I worked too hard in order to not be shown!!! |
|
|
|
kwhipp
Junior Member
USA
407 Posts |
Posted - 23 October 2002 : 18:42:38
|
This is excellent!
I agree with dayve, this is one more chance to show my username. |
- Kevin |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 23 October 2002 : 18:57:23
|
Admins are also humans |
|
|
Ez4arab
Junior Member
479 Posts |
Posted - 23 October 2002 : 20:47:59
|
quote:
NEVER, NEVER, NEVER...!!! I worked too hard in order to not be shown!!!
Dayve, This will let member work hard to remove his name form the list of top poster |
Ez4arab web site Ez4arab | |
|
|
|
Topic |
|