Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - MOD: Latest Forum Posts in Default.asp
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MOD: Latest Forum Posts in Default.asp

 Post Reply Post Reply Page  123 6>
Author
Praveen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 December 2005
Location: India
Status: Offline
Points: 218
Post Options Post Options   Thanks (0) Thanks(0)   Quote Praveen Quote  Post ReplyReply Direct Link To This Post Topic: MOD: Latest Forum Posts in Default.asp
    Posted: 13 November 2006 at 6:57pm
Hi
 
I have mixed many mods for creating this simple mod of Latest forum posts which you can customise. I have just typed the code which you may insert where ever you need in the default.asp file. Please post comments and bugs here. It will surely be helpful for me.
 
<table width=100% cellspacing=1 cellpadding=1 border=0>
 <tr class="tableSubLedger">
    <td colspan="2"><%="Latest Forum Posts"%></td>
  </tr>
  <tr class="tableRow">
    <td>&nbsp;</td>
    <td><table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
        <% If strDatabaseType = "Access" Then %>
        <tr class="tableSubLedger">
          <td width="38%" align="center" style="color:#FFA1C1">Topic</td>
          <td width="19%" align="center" style="color:#FFA1C1">Forum</td>
          <td width="15%" align="center" style="color:#FFA1C1">Author</td>
          <td width="21%" align="center" style="color:#FFA1C1">Date</td>
          <td width="7%" align="center" style="color:#FFA1C1">Views</td>
        </tr>
        <%
Dim intSay
Dim rsLatestPosts2
Dim sql2
Dim rsLatestPosts
Dim strTopicSubject
Dim strTopicSubjectOrj
Dim NumberOfPosts
Dim strFirstPostMsg
Dim LastLatestPostsDateTime
Dim LastLatestPostsDate
Dim LastLatestPostsTime
Set rsLatestPosts = Server.CreateObject("ADODB.Recordset")
strSql = "Select " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Topic.Last_Thread_ID, " & strDbTable & "Topic.No_of_views "
strSql = strSql & "From " & strDbTable & "Topic, " & strDbTable & "Forum Where " & strDbTable & "Topic.Hide = False And " & strDbTable & "Topic.Forum_ID = " & strDbTable & "Forum.Forum_ID Order By " & strDbTable & "Topic.Last_Thread_ID desc"
rsLatestPosts.Open strSQL, adoCon
If rsLatestPosts.EOF Then
 Response.Write "<tr class=""tableRow""><td colspan=5>No recent posts. Please check back later.</td></tr>"
Else
For intSay = 1 to 100
if rsLatestPosts.Eof Then Exit For
Set rsLatestPosts2 = Server.CreateObject("ADODB.Recordset")
sql2 = "SELECT tblThread.Thread_ID, tblThread.Topic_ID, tblThread.Message_date, tblAuthor.Username, tblAuthor.Author_ID FROM (tblAuthor INNER JOIN tblThread ON tblAuthor.Author_ID = tblThread.Author_ID) WHERE tblThread.Hide = False And Topic_ID= " & rsLatestPosts("Topic_ID") & " order by Message_date desc"
rsLatestPosts2.Open sql2, adoCon
LastLatestPostsDateTime = rsLatestPosts2("Message_date")
LastLatestPostsDate = DateFormat(LastLatestPostsDateTime)
LastLatestPostsTime = TimeFormat(LastLatestPostsDateTime)
   intForumColourNumber = intForumColourNumber + 1
   Response.Write(vbCrLf & " <tr ")
   If (intForumColourNumber MOD 2 = 0 ) Then Response.Write("class=""evenTableRow"">") Else Response.Write("class=""oddTableRow"">")
   Response.Write("<td>")
Response.Write "<a class=""smLink"" href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & "&get=last#" & rsLatestPosts("Last_Thread_ID") & """ title="""">" & rsLatestPosts("Subject") & "</a></td><td><a class=""smLink"" href=""forum_topics.asp?FID=" & rsLatestPosts("Forum_ID") & """>" & rsLatestPosts("Forum_name") & "</a></td><td align=""center""><span class=""smText"">"&rsLatestPosts2("Username") &"</span></td><td align=""center""><span class=""smText"">" & LastLatestPostsDate & "-" & LastLatestPostsTime & "</span></td><td align=""center""><span class=""smText"">" & rsLatestPosts("No_of_views") & "</span></td></tr>"
rsLatestPosts.MoveNext
Next
end if
end if
'Clean up
Call closeDatabase()
%>
      </table></td>
  </tr>
</table>
 
Thank You
Regards
Praveen Kumar
Back to Top
justme View Drop Down
Groupie
Groupie


Joined: 06 January 2006
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote justme Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2006 at 3:17am

Using MS Access, I get the following:

 
ADODB.Recordset error '800a0e7d'

The connection cannot be used to perform this operation. It is either closed or invalid in this context.

/forum/default.asp, line 894

 
line 894 is: rsLatestPosts.Open strSQL, adoCon
 
Back to Top
Praveen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 December 2005
Location: India
Status: Offline
Points: 218
Post Options Post Options   Thanks (0) Thanks(0)   Quote Praveen Quote  Post ReplyReply Direct Link To This Post Posted: 14 November 2006 at 11:54am
You have to find this:
Call closeDataBase()
and comment it like this
'Call closeDataBase()
 
Reply What happened
 
Regards
Praveen


Edited by Praveen - 14 November 2006 at 12:04pm
Back to Top
coolguy View Drop Down
Newbie
Newbie
Avatar

Joined: 14 November 2006
Location: United States
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote coolguy Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2006 at 5:27am
Works great, thank you.
Back to Top
Praveen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 December 2005
Location: India
Status: Offline
Points: 218
Post Options Post Options   Thanks (0) Thanks(0)   Quote Praveen Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2006 at 12:43pm
Welcome. Be sure to look at this topic for more info..
Back to Top
javi712 View Drop Down
Senior Member
Senior Member


Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
Post Options Post Options   Thanks (0) Thanks(0)   Quote javi712 Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2006 at 3:55pm
Hi Praveen,

Any chance of you creating something similar for a page sitting outside of the forum?

There have been a couple thrown around in other MODs, but none functioning correctly last time I checked.

Thanks!
Back to Top
Praveen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 December 2005
Location: India
Status: Offline
Points: 218
Post Options Post Options   Thanks (0) Thanks(0)   Quote Praveen Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2006 at 4:28pm
Ya why not?? Let me do it. But you have to wait for a while. Any problem with this mod??
Back to Top
javi712 View Drop Down
Senior Member
Senior Member


Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
Post Options Post Options   Thanks (0) Thanks(0)   Quote javi712 Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2006 at 4:56pm
Thank you so much Praveen, I do not mind waiting at all!

As for this mod, no problems at all!

Thanks so much again!
Back to Top
 Post Reply Post Reply Page  123 6>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.