Author |
Topic  |
|
PuppyF500
New Member

Netherlands
68 Posts |
Posted - 12 May 2004 : 11:29:32
|
How can i add a collapse function to for example the table the birthday mod creates? i would like to make everything, also the statistics, collapsable. What lines do i have to add? i tried some stuff, but the collapse icon displayed at top of the whole list of forums instead of in front of statistics, and it didn't collapse the statistics as well. |
|
OneWayMule
Dev. Team Member & Support Moderator
    
Austria
4969 Posts |
|
PuppyF500
New Member

Netherlands
68 Posts |
Posted - 12 May 2004 : 12:32:09
|
you're the greatest owm maybe i now can understand how to add it to other stuff as well |
 |
|
OneWayMule
Dev. Team Member & Support Moderator
    
Austria
4969 Posts |
|
PuppyF500
New Member

Netherlands
68 Posts |
Posted - 12 May 2004 : 12:48:21
|
owm could you add the collapse functionality to a file i have? or instruct me how to? |
 |
|
OneWayMule
Dev. Team Member & Support Moderator
    
Austria
4969 Posts |
|
PuppyF500
New Member

Netherlands
68 Posts |
|
OneWayMule
Dev. Team Member & Support Moderator
    
Austria
4969 Posts |
|
PuppyF500
New Member

Netherlands
68 Posts |
Posted - 12 May 2004 : 13:46:04
|
tnx very much m8 appreciate your help |
 |
|
PuppyF500
New Member

Netherlands
68 Posts |
Posted - 12 May 2004 : 13:59:43
|
and one last question, how do i make the statistics collapsable? if needed: http://theprofoundone.com/default.asp |
Edited by - PuppyF500 on 12 May 2004 14:00:08 |
 |
|
OneWayMule
Dev. Team Member & Support Moderator
    
Austria
4969 Posts |
|
PuppyF500
New Member

Netherlands
68 Posts |
Posted - 13 May 2004 : 03:03:27
|
thank you again OneWayMule  |
 |
|
OneWayMule
Dev. Team Member & Support Moderator
    
Austria
4969 Posts |
|
PeeWee.Inc
Senior Member
   
United Kingdom
1893 Posts |
Posted - 13 May 2004 : 10:18:43
|
'm looking to add this to some code i'm making now, and other bits around my website.
OneWayMule, do you have a quick run down of how you do it?  |
De Priofundus Calmo Ad Te Damine |
 |
|
OneWayMule
Dev. Team Member & Support Moderator
    
Austria
4969 Posts |
Posted - 13 May 2004 : 11:10:07
|
OK, let's take the Private Messages include code for default.asp (it's shorter than the Statistics code). I've marked the new code blue and the modified code green and added some comments in black.
if strDBNTUserName <> "" then
'### Read/write the cookies (take a look at the DoHideCategory sub on default.asp
Call DoHideCategory("PMs")
'### Define the variable for the cookies and querystring
HideForumCat = strUniqueID & "HideCat" & "PMs"
'### The following code gets the info to be displayed in the PM table, so we only need it if the PMs are not hidden
If Request.Cookies(HideForumCat) <> "Y" Then
' Get Private Message count for display on Default.asp
if strDBType = "access" then
strSqL = "SELECT count(M_TO) as [pmcount] "
else
strSqL = "SELECT count(M_TO) as pmcount "
end if
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS , " & strTablePrefix & "PM "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & strDBNTUserName & "'"
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_TO "
strSql = strSql & " AND " & strTablePrefix & "PM.M_READ = 0 "
Set rsPM = my_Conn.Execute(strSql)
pmcount = rsPM("pmcount")
rsPM.close
set rsPM = nothing
End If
Response.Write " <tr>" & vbNewLine
'### Now we have to add the collapse/expand icons and links to the category cell
If Request.Cookies(HideForumCat) = "Y" Then
Response.Write " <td bgcolor=""" & strCategoryCellColor & """ colspan=""" & sGetColspan(7,6) & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """ size=""+1""><a href=""" & ScriptName & "?" & HideForumCat & "=N"">" & getCurrentIcon(strIconPlus,"Expand This Category","") & "</a> <b>Private Messages</b></font></td>" & vbNewLine
Else
Response.Write " <td bgcolor=""" & strCategoryCellColor & """ colspan=""" & sGetColspan(7,6) & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """ size=""+1""><a href=""" & ScriptName & "?" & HideForumCat & "=Y"">" & getCurrentIcon(strIconMinus,"Collapse This Category","") & "</a> <b>Private Messages</b></font></td>" & vbNewLine
End If
Response.Write " </tr>" & vbNewLine
'### The following code is the one we want to hide if the collapse icon was clicked:
If Request.Cookies(HideForumCat) <> "Y" Then
Response.Write " <tr>" & vbNewLine & _
" <td align=""center"" bgcolor=""" & strForumCellColor & """ valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>"
if strDBNTUserName = "" then
Response.Write " "
else
if pmcount = 0 then
Response.Write " "
end if
if pmcount >= 1 then
Response.Write getCurrentIcon(strIconpmnewsm,"","align=""absmiddle""")
end if
end if
Response.Write "</font></td>" & vbNewLine & _
" <td valign=""top"" bgcolor=""" & strForumCellColor & """ colspan=""" & sGetColspan(6,5) & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><span class=""spnMessageText""><a href=""pm_view.asp"">Inbox</a></span></font>" & vbNewLine
if strDBNTUserName = "" then
Response.Write "<font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """><br> - Log in to check your private messages.</font>" & vbNewLine
else
Response.Write "<font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """><br><b>"
if strAuthType="nt" then
Response.Write strDBNTUserName & " (" & strDBNTUserName & ")</b>"
else
if strAuthType = "db" then
Response.Write strDBNTUserName & "</b>"
end if
end if
Response.Write " - You have "
if pmcount >=1 then
Response.Write "<font color=""" & strActiveLinkColor & """><b>" & pmcount & "</b></font>"
else
Response.Write pmcount
end if
Response.Write " new private message"
if pmcount >1 then
Response.Write "s"
end if
Response.Write ".</font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
End If
end if
The only thing you'll have to change for adding the collapse feature to other "categories" such as statistics, birthdays, etc. is a unique string (PMs in the code above) for each cat, for example, "stats", "birthdays", etc.
I'm not very good at commenting stuff, so if anything is unclear (or you need help adding it to your code), feel free to ask.  |
My MODs: Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch
Useful stuff: Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
|
Edited by - OneWayMule on 13 May 2004 11:11:17 |
 |
|
|
Topic  |
|