Posting 5 last posts on my homepage - Posted (2179 Views)
Starting Member
fluor
Posts: 2
2
Hi and thanks for the best software! I just wondered if somebody can code me a simple ASP code so i can post a little table on my homepage, announcing the last 5 posts.
E.g. WELCOME TO MY HOMEPAGE!
Blah blah blah
blah.. Check the forum (link)
5 last posts:
23.03 "Oh yeah" by Zyko
23.03 "Stop discussing this!" by Zyko
22.03 "Yeah right!" by Zyko
21.03 - "I like rock and if you hate it then..." by Zyko

Would be cool if the all those posts were links where <a href="URL" title="23-MARCH-2001 - Full text of post goes here (max 250chars)"> "Yeah right!" </a>

This would be real cool. I am tired of login in and see no new topics every day (I run a small board).


Edited by - fluor on 23 March 2001 09:47:18<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Average Member
Kerry
Posts: 553
553
Look in Mods w/Code for the the Slash addon - it sounds exactly like what you're looking for.
-Kerry

<
Posted
Starting Member
fluor
Posts: 2
2
I tried installing it, but it failed. How about just giving me a little ASP code to post on the web. Must be simple to program if it's only the last five topics sorted by newest date.
<
Posted
Snitz Forums Admin
RichardKinser
Posts: 16655
16655
try here: http://forum.snitz.com/forum/link.asp?TOPIC_ID=7032<
Posted
Junior Member
acoustika
Posts: 311
311
Hey there

I have used and modified a bit the code from Richard's link

try here: http://forum.snitz.com/forum/link.asp?TOPIC_ID=7032

Now I have a little request, Could someone please help me make so it also shows WHO posted the topic.
My code is as follows, the little script can be seen in use here
www.uniquedk.dk/forum/f_news.asp

CODE:

Code:
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE file="inc_func_secure.asp" -->
<!--#INCLUDE file="inc_sha256.asp"-->
<%
connString = strConnstring
function getlast_topics(numdays)
set tConn= Server.CreateObject("ADODB.Connection")
tConn.Open ConnString

'''''''''''''''''''''''''''''''''''''
''Don't display if from private forum
'''''''''''''''''''''''''''''''''''''
set PrivateForum = tConn.Execute("select FORUM_ID from FORUM_FORUM where F_PRIVATEFORUMS = 6")
SQL = "SELECT TOP " & numdays & " * from FORUM_TOPICS WHERE "
do until PrivateForum.eof
SQL = SQL & "FORUM_ID <> " & PrivateForum("FORUM_ID") & " and "
PrivateForum.movenext
Loop
'''''''''''''''''

strSql = "SELECT TOP " & numdays & " T_AUTHOR,T_LAST_POST,T_LAST_POSTER,T_DATE,T_SUBJECT,TOPIC_ID,FORUM_ID,CAT_ID from FORUM_TOPICS order by T_LAST_POST DESC"
CColor = strForumCellColor
set rss = tConn.Execute (strSql)

response.write "<tr><td bgcolor=""" & strCategoryCellColor & """ height=""24"" align=""center"">Nyeste Forum Indlæg</td></tr>" & vbnewline

do until rss.eof
tID = rss("TOPIC_ID")
tPOSTER = rss("T_LAST_POSTER")
tDATE = rss("T_DATE")
tSUBJECT = rss("T_SUBJECT")
strlast = strlast & "<tr><td onMouseOver=""this.style.background='" & strForumFirstcellcolor & "';"" onMouseOut=""this.style.background='"& CColor &"';"" style=""cursor: hand"" bgcolor=" & CColor & " onClick=""window.location.href='/forum/link.asp?TOPIC_ID=" & tID & "'"" height=""18"" class=""button"">" & vbcrlf
strlast = strlast & "<div align=""left"" class=""button (unavailable)""><font face=""Veranda, Arial, Helvetica, san-serif"" size=""1"">Emne: <a href=""link.asp?TOPIC_ID=" & tID & """ class=""button (unavailable)"" target=""_blank""><small>" & tSUBJECT & "</small></a></font></div>" & vbcrlf
strlast = strlast & "</td></tr>" & vbcrlf

rss.movenext
loop

rss.close
set rss=nothing
tConn.close
set tConn=nothing
getlast_topics=strlast
end function
%>
<table width="100%" cellspacing="1" cellpadding="0" border="0" bgcolor="#333333">
<%=getlast_topics(5)%>
</table>
<
May The Code Be With You
www.UniqueDk.dk *** The Open Forums of Denmark ***
Posted
Starting Member
Sparks
Posts: 6
6
How about just giving me a little ASP code to post on the web. Must be simple to program if it's only the last five topics sorted by newest date.

I wrote a simple plug-in for my website, http://www.iscifistory.com . In the left nave bar, the last 5 topics are listed. It is indeed just a few lines of code; email me at sparks@iscifistory.com and I will share the code. <
--
Ron Sparks
http://www.iscifistory.com
 
You Must enter a message