%@ Language=VBScript %>
<%option explicit%>
<%
function getsortfield(byval sortbyfield,byval sortfieldtest, byval linktext, byval page, byval qstring)
dim sortlink
if sortbyfield = sortfieldtest then
if sortbydirection = "desc" then
sortlink = getlink(linktext & " /\" , page & "?sortbyfield=" & sortfieldtest & "&sortbydirection=asc&" & qstring )
else
sortlink = getlink(linktext & " \/" , page & "?sortbyfield=" & sortfieldtest & "&sortbydirection=desc" & "&" & qstring )
end if
else
sortlink = getlink(linktext , page & "?sortbyfield=" & sortfieldtest & "&" & qstring )
end if
getsortfield = sortlink
end function
sub displayHeader_FMSG(byval mQString)
dim page
page = "forum_messages.asp"
response.write "
" & vbcrlf
response.write "" & vbcrlf
response.write "| " & _
getsortfield(sortbyfield,"subject", "Tema", page, mQString) &_
" | " & vbcrlf
response.write "#Msgs | " & vbcrlf
response.write "" & _
getsortfield(sortbyfield,"dateofpost", "Data", page, mQString) & _
" | " & vbcrlf
response.write "" & _
getsortfield(sortbyfield,"postmaxdate", "Últ. Inserção", page, mQString) & _
" | " & vbcrlf
response.write "
" & vbcrlf & vbcrlf
end sub
sub displayRecords_FMSG(rs)
dim nRecord
dim nPageSize
nPageSize = rs.pagesize
For nRecord = 0 To nPageSize -1
'custumize
call displayIten_FMSG(1,request.querystring,1,nRecord,rs)
rs.MoveNext
If rs.EOF Then Exit For
Next 'nRecord
end sub
sub displayFooter_FMSG()
response.write "
" & vbcrlf
end sub
sub displayIten_FMSG(idForum,QString,ParentMsg,level,rst)
dim idMsg
dim QstringContract
dim Treelink
dim tdclass
idMsg = rst("IdMsg")
if isnull(rst("idadmin"))then
tdclass = TDStyle(level mod 2)
else
tdclass = "realce"
end if
'expand link
Response.Write "" & getlink(ShowEmotIcons(safehtml(rst("Subject"))),"message.asp?IdMsg=" & IdMsg & "&idForum=" & idForum & "#m" & IdMsg) & _
" por: " & showIconRegister(rst("idregister")) & " " & safehtml(rst("AuthorName")) & "" & _
" | " & vbcrlf
if isnull(rst("sons")) = true then
Treelink = "0"
Response.Write "" & Treelink & " | " & vbcrlf
Response.Write "" & FormatDateTime(rst("DateOfPost"),2) & " " & FormatDateTime(FormatDataHora(rst("DateOfPost")),4) & " | " & vbcrlf
Response.Write " | " & vbcrlf
else
Treelink = rst("sons")
Response.Write "" & Treelink & " | " & vbcrlf
Response.Write "" & FormatDateTime(rst("DateOfPost"),2) & " " & FormatDateTime(FormatDataHora(rst("DateOfPost")),4) & " | " & vbcrlf
Response.Write "" & FormatDateTime(rst("postmaxdate"),2) & " " & FormatDateTime(FormatDataHora(rst("postmaxdate")),4) & " | " & vbcrlf
end if
Response.Write "
" & vbcrlf
end sub
dim idForum
dim cMessagesToSpand
dim QString
dim TDStyle
dim sModel
dim IdEdicao
dim sSeccoes
dim ForumDescription
dim dadosEdicao
dim rst
dim page
dim PagToolbox
dim sortbyfield
dim sortbydirection
dim sPes
TDStyle = array("IMPAR","PAR")
'Parametros
idForum = Request.QueryString("idForum")
'sort
sortbyfield = Request.QueryString("sortbyfield")
sortbydirection = Request.QueryString("sortbydirection")
'nav
page = Request.QueryString("page")
'DefaultValues
if idForum="" then idForum =1
if sortbyfield="" then sortbyfield ="dateofpost"
if sortbydirection="" then sortbydirection ="desc"
if page="" then page =1
'qString
qString = "idForum=" & idForum
'modelo
sModel = getModel(c_RootPath & "\modelos\modelo_int.htm")
'Edicão
idEdicao = getEdicaoActual()
sModel= replace (sModel,c_FichJavaScript_Marca, "")
sPes = ""
sModel= replace (sModel,c_colunadireita, sPes)
'Dados existentes em todas as paginas
call ShowDadosPagina(sModel, " Fórum ", IdEdicao, "../index.asp", "../", c_RootPath & "\pub\", 0)
'begin of model
Response.Write left(sModel,instr(1,sModel,c_Noticias_Marca)-1)
ForumDescription = showForumDescription(idForum)
Response.Write ForumDescription
Response.Write "[" & getlink("Inserir Tema","msg_edit.asp?idForum=" & idForum) & "]
" & vbcrlf
set rst = gettemas(1, sortbyfield,sortbydirection)
if not rst.eof then
if cint(page) > cint(rst.PageCount) then
page = 1
end if
rst.PageSize = 20
rst.AbsolutePage = page
PagToolbox = displayPagToolbox("", rst.PageSize, _
rst.recordcount, page, _
rst.PageCount, "forum_messages.asp" , _
qString & "&sortbyfield=" & sortbyfield & "&sortbydirection=" & sortbydirection)
Response.write PagToolbox
call displayHeader_FMSG(qString)
call displayRecords_FMSG(rst)
set rst = nothing
call displayFooter_FMSG()
end if
Response.write PagToolbox
Response.Write mid(sModel,instr(1, sModel, c_Noticias_Marca)+16)
%>