Author |
Topic |
deki
Starting Member
Brazil
34 Posts |
Posted - 19 June 2003 : 20:57:51
|
I would like to place in my page, one script that it shows the last posts of mine fórum. Please help-me |
My Forum: http://www.losdakilla.com.br/forum |
Edited by - ruirib on 01 July 2003 00:15:39 |
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
deki
Starting Member
Brazil
34 Posts |
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
Francodepaw
Junior Member
USA
111 Posts |
Posted - 23 June 2003 : 10:49:46
|
Are you looking to show on your front page, or everypage of your forum? I have an include that creates a small box with the last x Posts real simple but effective. It is more for the portal page. |
|
|
deki
Starting Member
Brazil
34 Posts |
|
deki
Starting Member
Brazil
34 Posts |
|
Francodepaw
Junior Member
USA
111 Posts |
Posted - 01 July 2003 : 00:25:35
|
quote: Originally posted by deki
Somebody can help me? The page that the Francodepaw passed is offline.
Something weird went on with email cause the email I got back from you said the rest of the email was offline???
Are you using a Portal Mod Like Server Hackers, HuwR's or Crashs? The file I have is an include that you would use on one of the main pages for these packages. It might work with content dispaly mod if you have that installed.
|
|
|
deki
Starting Member
Brazil
34 Posts |
|
deki
Starting Member
Brazil
34 Posts |
|
Francodepaw
Junior Member
USA
111 Posts |
Posted - 01 July 2003 : 11:21:28
|
I'm on an Intranet so can't cut a link to my file. This is a modified block that John over at www.Airwarriors.com did. He offers several includes over there.
I use the icon from the MSGICON mod so if you don't use that one will want to edit this line.
<td><% =getCurrentIcon(getCurrentMsgIcon(rs.fields("T_MSGICON")),"",hspace="3") %> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strForumFontColor %>"> By: <a href="pop_profile.asp?mode=display&id=<% =rs("T_AUTHOR")%>"><% =getMemberName(rs.Fields("T_AUTHOR"))%>
This will not show any new posts in private forums. I made some changes to make it work with MySql as well.
Cut and paste and save as inc_last_topics.asp or whatever you want the include to be.
<%
'########################################################################################
'# Last x Topics Block
'#
'# REQUIRES: Sitenews.asp or other Portal frontend
'#
'# Used code from John's inc_top_posters.asp as a default framework for the block.
'#
'# Place the inc_last_topics.asp in your includes folder under the forum directory.
'#
'# Edit your sitenews.asp file with the spacers and the inc_last_topics.asp reference
'# where you want it to show up, example:
'#
'# <!-- #include file="inc_spacer.asp" -->
'# <!-- #include file="inc_spacer.asp" -->
'# <!--#include file="include/inc_top_read.asp"-->
'#
'# See John's includes over www.Airwarriors.com
'#
'# JohnWickham@Airwarriors.com
'#
'########################################################################################
<!-- #include file="inc_func_common.asp" -->
dim intLastTopics
'########################################################################################
'# You can use change this variable to how many top read topics you wish to display
'########################################################################################
intLastTopics = 5 ' number of topics to display
Response.Write "<table width=""100%"" border=""0"" bordercolor=""" & strTableBorderColor & """ cellspacing=""1"" cellpadding=""0"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
"<tr>" & vbNewLine & _
"<td bgcolor=""" & StrHeadCellColor & """>" & vbNewLine & _
"<font size=""4"" color=""" & StrHeadFontColor & """> Recent Topics</font>" & vbNewLine & _
"</td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"<tr bgcolor=""" & StrCategoryCellColor & """>" & vbNewLine & _
"<td>" & vbNewLine & _
"<table widht=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
"<tr bgcolor=""" & StrCategoryCellColor & """>" & vbNewLine & _
"<td>" & vbNewLine & _
"<font size=""1"" color=""" & StrDeForumFontColor & """> Forum/Topic/Author</font>" & vbNewLine & _
"</td>" & vbNewLine & _
"<td align=""right"" width=""1%"" nowrap>" & vbNewLine & _
"<font size=""1"" color=""" & StrDeForumFontColor & """></font>" & vbNewLine & _
"</td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"</table>" & vbNewLine & _
"</td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"<tr>" & vbNewLine & _
"<td align=""left"">" & vbNewLine & _
"<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
"<tr>" & vbNewLine & _
"<td align=""center"">" & vbNewLine & _
"<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""4"" bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
"<tr>" & vbNewLine & _
"<td align=""center"">" & vbNewLine
function displaylastTopics()
dim rs
set rs = server.CreateObject("adodb.recordset")
if strDBType = "mysql" then
strSql = "SELECT " & strTablePrefix & "TOPICS.FORUM_ID, "& strTablePrefix & "TOPICS.TOPIC_ID, "& strTablePrefix & "TOPICS.T_SUBJECT, "& strTablePrefix & "TOPICS.T_AUTHOR, " & strTablePrefix & "TOPICS.T_REPLIES, " & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.T_DATE, "& strTablePrefix & "TOPICS.T_MSGICON FROM " & strTablePrefix & "TOPICS INNER JOIN FORUM_FORUM ON FORUM_TOPICS.FORUM_ID = FORUM_FORUM.FORUM_ID WHERE (((FORUM_FORUM.F_PRIVATEFORUMS)<5)) ORDER BY T_DATE DESC LIMIT " & intLastTopics
else
strSql = "SELECT TOP " & intLastTopics & " " & strTablePrefix & "TOPICS.FORUM_ID, "& strTablePrefix & "TOPICS.TOPIC_ID, "& strTablePrefix & "TOPICS.T_SUBJECT, "& strTablePrefix & "TOPICS.T_AUTHOR, " & strTablePrefix & "TOPICS.T_REPLIES, " & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.T_DATE FROM " & strTablePrefix & "TOPICS INNER JOIN FORUM_FORUM ON FORUM_TOPICS.FORUM_ID = FORUM_FORUM.FORUM_ID WHERE (((FORUM_FORUM.F_PRIVATEFORUMS)<5)) ORDER BY T_DATE DESC"
end if
rs.Open strSql, my_Conn
%>
<table border="0" cellpadding="0" cellspacing="5" width="100%">
<%
dim intCounter
intCounter = 1
do while not rs.EOF
%>
<tr bgcolor=<% =StrCategoryCellColor %>>
<td><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strForumFontColor %>"><b>Forum:</b> <% =getForumSubject(rs.Fields("FORUM_ID"))%></font></a>
</td>
<tr>
<td><% =getCurrentIcon(getCurrentMsgIcon(rs.fields("T_MSGICON")),"",hspace="3") %>
<font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strForumFontColor %>">
By: <a href="pop_profile.asp?mode=display&id=<% =rs("T_AUTHOR")%>"><% =getMemberName(rs.Fields("T_AUTHOR"))%>
</font></a>
</td>
</tr>
<tr>
<td><b><a href="link.asp?TOPIC_ID=<%=rs("TOPIC_ID")%>"><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strForumFontColor %>"><%= rs("T_SUBJECT")%></font></b></a></td>
</tr>
<tr>
<td align="center"><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strForumFontColor %>">
<br>[Viewed <% =rs("T_VIEW_COUNT")%> times with <% =rs("T_REPLIES")%> replies]
</font></a></td>
</tr>
<%
intCounter = intCounter + 1
rs.movenext
loop%>
</table>
<%
rs.Close
set rs = nothing
end function
displayLastTopics
Response.Write "</td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"</table>" & vbNewLine & _
"</td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"</table>" & vbNewLine & _
"</td>" & vbNewLine & _
"</tr>" & vbNewLine & _
"</table>" & vbNewLine
function getForumSubject(fForum_Number)
dim strSql
dim rsGetForumSubject
'## Forum_SQL
if isNull(fForum_Number) then exit function
strSql = "SELECT F_SUBJECT "
strSql = strSql & " FROM " & strMemberTablePrefix & "FORUM "
strSql = strSql & " WHERE FORUM_ID = " & cLng(fForum_Number)
set rsGetForumSubject = Server.CreateObject("ADODB.Recordset")
rsGetForumSubject.open strSql, my_Conn
if rsGetForumSubject.EOF or rsGetForumSubject.BOF then
getForumSubject = ""
else
getForumSubject = chkString(rsGetForumSubject("F_SUBJECT"),"display")
end if
rsGetForumSubject.close
set rsGetForumSubject = nothing
end function
function getMemberName(fUser_Number)
dim strSql
dim rsGetmemberName
'## Forum_SQL
if isNull(fUser_Number) then exit function
strSql = "SELECT M_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE MEMBER_ID = " & cLng(fUser_Number)
set rsGetMemberName = Server.CreateObject("ADODB.Recordset")
rsGetMemberName.open strSql, my_Conn
if rsGetMemberName.EOF or rsGetMemberName.BOF then
getMemberName = ""
else
getMemberName = chkString(rsGetMemberName("M_NAME"),"display")
end if
rsGetMemberName.close
set rsGetMemberName = nothing
end function
%>
|
Edited by - Francodepaw on 01 July 2003 11:25:49 |
|
|
deki
Starting Member
Brazil
34 Posts |
Posted - 01 July 2003 : 14:42:07
|
The following error occurred: ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/ldk/forum/inc_last_topics.asp, line 72
|
My Forum: http://www.losdakilla.com.br/forum |
|
|
deki
Starting Member
Brazil
34 Posts |
|
Francodepaw
Junior Member
USA
111 Posts |
Posted - 07 July 2003 : 12:06:44
|
Sorry, been out for a holiday. Do you have a link to your site, so I look to see how you are trying to tie it in? What database are you using? |
|
|
deki
Starting Member
Brazil
34 Posts |
|
deki
Starting Member
Brazil
34 Posts |
|
Topic |
|