Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 most recent to html file or javascript
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

jarod
Starting Member

30 Posts

Posted - 24 September 2002 :  10:57:39  Show Profile
Is there a way to get the most recent topics to a separate html file or javascript i can put on a .htm page?

CarKnee
Junior Member

USA
297 Posts

Posted - 24 September 2002 :  11:26:58  Show Profile  Visit CarKnee's Homepage
Sure,
Use FSO to pull the records out of the table and write them out to a file.

CarKnee

Go to Top of Page

CarKnee
Junior Member

USA
297 Posts

Posted - 24 September 2002 :  11:30:39  Show Profile  Visit CarKnee's Homepage
Here is a little sub routine I use from my homepage to display recent topics. Just change the code inside the While Loop to write the info out to a file, rather than out to the screen.

CarKnee


<!-- #INCLUDE Virtual="/forums/inc_func_common.asp" -->
<%
Sub showRecent(intTop)
	if intTop = "" Then intTop = 5
	
	strConnString = 'copy your conn string here
	set my_Conn = Server.CreateObject("ADODB.Connection")
	my_Conn.Open strConnString

	strSQL = "SELECT TOP 5 "   _
	             &  "MEMBERS.M_NAME, "       _
	             &  "FORUM.FORUM_ID, "       _
	             &  "FORUM.F_SUBJECT, "      _
	             &  "TOPICS.TOPIC_ID, "      _
	             &  "TOPICS.T_SUBJECT, "     _
	             &  "TOPICS.T_AUTHOR, "      _
	             &  "TOPICS.T_REPLIES, "     _
	             &  "TOPICS.T_DATE, "        _
	             &  "TOPICS.T_MESSAGE "      _
	             & "FROM FORUM_TOPICS TOPICS, FORUM_FORUM FORUM, FORUM_MEMBERS MEMBERS "  _
	             & "WHERE FORUM.F_PRIVATEFORUMS = 0 AND " _
	             & "TOPICS.FORUM_ID = FORUM.FORUM_ID AND "    _
	             & "TOPICS.T_AUTHOR = MEMBERS.MEMBER_ID " 
strSQL = strSQL  & "ORDER BY TOPICS.T_LAST_POST DESC"
' "ORDER BY TOPICS.t_date desc"
	set rsInfo = my_Conn.Execute (StrSql)


	While NOT rsInfo.EOF
		response.write "<b>" & rsInfo("t_subject") & "</b><BR>" & VbCrLf _
			& "<font size=1>Posted by <B><a href='/forums/pop_profile.asp?mode=display&id=" & rsInfo("t_author") & "'>" _
			&   rsInfo("M_name") & "</a></b> on <b>" & chkDate(rsInfo("T_Date"), , False) &  "</b> @ " & chkTime(rsInfo("T_Date"))& "<BR>" & VbCrLf _
			&   Left(rsInfo("t_message"), 150) & "...<br>" & VbCrLf _
			&  "[ <a href='/forums/link.asp?topic_id=" & rsInfo("TOPIC_ID") & "'>Read more</a> | <b>" & rsInfo("T_REPLIES") & "</b> reply(s) | <a href='/forums/link.asp?forum_id=" & rsInfo("FORUM_ID") & "'>" & rsInfo("F_SUBJECT") & "</a> ] <br></font><br>"
		rsInfo.MoveNext
	Wend

	my_Conn.Close
	Set my_Conn = Nothing
	Set rsInfo = NOthing
End Sub


Go to Top of Page

jarod
Starting Member

30 Posts

Posted - 24 September 2002 :  11:33:05  Show Profile
thanks
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 24 September 2002 :  11:54:57  Show Profile
The only MOD I know of that is capable of that requires an ASP page (you could simply rename your .HTM file to .ASP and use that MOD). The problem is that I can't find any indication on whether or not it has been updated for version 3.4.xx of the forums.

I'll be moving this topic to the MOD W/O Code forum unless someone else has done that while I was reading the topics I had on active.asp.

Looks like I won't need to move this anymore

Edited by - Roland on 24 September 2002 11:55:37
Go to Top of Page

jarod
Starting Member

30 Posts

Posted - 24 September 2002 :  12:05:12  Show Profile
I cant rname the .htm to asp. I can to the write to file but will automaticcaly refresh to whats current?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.41 seconds. Powered By: Snitz Forums 2000 Version 3.4.07