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: MOD Implementation
 Active Topics on Davids Portal Mod
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

StephenD
Senior Member

Australia
1044 Posts

Posted - 20 June 2005 :  09:58:59  Show Profile  Send StephenD a Yahoo! Message
I've been playing around with David's Portal Mod again (I know I'll go blind one day) and have been trying to get the DisplayActiveTopics sub to display a bit more information. At the moment my code looks like this:
sub DisplayActiveTopics(byval Width, byval Count)

	dim strSql
	dim rsActive

	Call StartTable(Width, "Active Topics")

	strSql = "SELECT"
	strSql = strSql & " T.TOPIC_ID,"
	strSql = strSql & " T.T_SUBJECT,"
	strSql = strSql & " T.T_LAST_POST,"
	strSql = strSql & " M.M_NAME,"
	strSql = strSql & " T.T_LAST_POST_AUTHOR,"
	strSql = strSql & " MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME"
	strSql = strSql & " FROM " & strTablePrefix & "TOPICS T," & strTablePrefix & "FORUM F," & strTablePrefix & "MEMBERS M," & strMemberTablePrefix & "MEMBERS MEMBERS_1" 
	strSql = strSql & " WHERE T.FORUM_ID = F.FORUM_ID"
        strSql = strSql & " AND T.T_LAST_POST_AUTHOR = MEMBERS_1.MEMBER_ID"
       'strSql = strSql & " AND F.F_PRIVATEFORUMS = 0"                        
	strSql = strSql & " AND T.T_STATUS = 1"
	strSql = strSql & " ORDER BY T_LAST_POST DESC"
    
	Set rsActive = my_conn.Execute(TopSQL(strSql, Count))
	If NOT rsActive.EOF Then
		Do While NOT rsActive.EOF		

			Response.Write("<DIV class=""listitem2"">" & getCurrentIcon(strIconArrows,"Jump to Topic","") & " " & "<a href=""topic.asp?TOPIC_ID="& rsActive.fields("TOPIC_ID").value &""">"& rsActive.fields("T_SUBJECT").value & "</a>")
			Response.Write("<br />" & "by " & rsActive.fields("LAST_POST_AUTHOR_NAME").value & " on " & RemoveYear(ChkDate(rsActive.Fields("T_LAST_POST").Value,"",true)) & "</DIV>")
			rsActive.MoveNext
		Loop
	End If
	rsActive.Close
	Set rsActive = Nothing	
		
	 Response.Write "<br />"
	Response.Write  "			 <a href=""xyzrssfeed.asp"" tabindex=""-1"" target=""_blank"">" & getCurrentIcon(strIconXML,"Active Topics RSS Feed","align=""right""")& "</a>" &vbCrLf
	Call EndTable()
end sub

Which outputs this:

Not really sure what it is doing but I think it is displaying the Topic, then the Topic again when a reply is posted but putting the same datestamp to it.

What I would like it to do is simply display the topic once if it was a new topic or a new reply to the same topic. Actually I'd like it to do a lot more like differentiate between a new topic and a reply .. and tooltip the topic message but first things first.

StephenD
Senior Member

Australia
1044 Posts

Posted - 20 June 2005 :  10:50:44  Show Profile  Send StephenD a Yahoo! Message
Do you think I need to include the DoLastPostLink function on the same page:
Function DoLastPostLink()
	if Topic_Replies < 1 or Topic_Last_Post_Reply_ID = 0 then
		DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>" & getCurrentIcon(strIconLastpost,"Jump to Last Post","align=""absmiddle""") & "</a>"
	elseif Topic_Last_Post_Reply_ID <> 0 then
		PageLink = "whichpage=-1&"
		AnchorLink = "&REPLY_ID="
		DoLastPostLink = "<a href=""topic.asp?" & ArchiveLink & PageLink & "TOPIC_ID=" & Topic_ID & AnchorLink & Topic_Last_Post_Reply_ID & """>" & getCurrentIcon(strIconLastpost,"Jump to Last Post","align=""absmiddle""") & "</a>"
	else
		DoLastPostLink = ""
	end if
end function

and tie that in somehow.
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 20 June 2005 :  20:41:32  Show Profile  Send StephenD a Yahoo! Message
OK, I cracked it. This is my sub now:
sub DisplayActiveTopics(byval Width, byval Count)

	dim strSql
	dim rsActive
        dim Topic_ID,strSubject,Topic_Replies,Topic_Last_Post_Reply_ID
        
	Call StartTable(Width, "Active Topics")

	strSql = "SELECT"
	strSql = strSql & " T.TOPIC_ID,"
	strSql = strSql & " T.T_REPLIES,"
	strSql = strSql & " T.T_SUBJECT,"
	strSql = strSql & " T.T_LAST_POST,"
	strSql = strSql & " T.T_LAST_POST_AUTHOR,"
	strSql = strSql & " T.T_LAST_POST_REPLY_ID"
	strSql = strSql & " FROM " & strTablePrefix & "TOPICS T," & strTablePrefix & "FORUM F"  
	strSql = strSql & " WHERE T.FORUM_ID = F.FORUM_ID"
        'strSql = strSql & " AND F.F_PRIVATEFORUMS = 0"                        
	strSql = strSql & " AND T.T_STATUS = 1"
	strSql = strSql & " ORDER BY T_LAST_POST DESC"
   
	Set rsActive = my_conn.Execute(TopSQL(strSql, Count))
	If NOT rsActive.EOF Then
		Do While NOT rsActive.EOF		

			Response.Write("<DIV class=""listitem2"">" & getCurrentIcon(strIconArrows,"Jump to Topic","") & " " & "<a href=""topic.asp?TOPIC_ID="& rsActive.fields("TOPIC_ID").value &""">"& rsActive.fields("T_SUBJECT").value & "</a>")
			Response.Write("<br /><i>" & "Last Post by " & getMemberName(rsActive.fields("T_LAST_POST_AUTHOR").value) & " on " & RemoveYear(ChkDate(rsActive.Fields("T_LAST_POST").Value,"",true)) & " " & DoLastPostLink & "</i></DIV><br />")
			rsActive.MoveNext
		Loop
	End If
	rsActive.Close
	Set rsActive = Nothing	
		
	Response.Write  "<a href=""xyzrssfeed.asp"" tabindex=""-1"" target=""_blank"">" & getCurrentIcon(strIconXML,"Active Topics RSS Feed","align=""right""")& "</a>" &vbCrLf
	Call EndTable()
end sub


I had to include the DoLastPostLink function at the end of portal.asp.
This is what it outputs now:


For those that are interested I've got a function that strips the year out of the long date format:
Function RemoveYear(pString)
		fString = trim(pString)	
	        fString = Replace(fString, "2004", "")
	        fString = Replace(fString, "2005", "")
	        fString = Replace(fString, "2006", "")
	        RemoveYear = fString
end Function


Many hours trial and error guys...
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.37 seconds. Powered By: Snitz Forums 2000 Version 3.4.07