latest 10 topics on main page
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=24488
Printed Date: 29 March 2026 at 9:19am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: latest 10 topics on main page
Posted By: unitrakya
Subject: latest 10 topics on main page
Date Posted: 23 September 2007 at 9:11am
|
how can i integrate the latest 10 topics to default.asp? i tried that but it give error;
<% If strDatabaseType = "Access" Then %> <tr class="tableLedger"> <td colspan="5" width="668">En son yazılan 10 konu</td> </tr> <tr class="tableSubLedger"> <td width="225" align="center">Konu</td> <td width="127" align="center">Bölüm</td> <td width="98" align="center">Gönderen</td> <td width="130" align="center">Zaman</td> <td width="60" align="center">Okunma</td> </tr> <tr class="tableSubLedger"> <td width="640" align="center" colspan="5"><p align="center"></P></td> </tr> <% Dim rsLatestPosts Dim intSay Dim rsLatestPosts2 Dim sql2 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
For intSay = 1 to 10 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)
If intGroupID <> 2 Then Response.Write "<tr class=""tableRow""><td><a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & """><img border=""0"" src=""" & strImagePath & "right_arrow.gif"" /></a> <a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & "&get=last#" & rsLatestPosts("Last_Thread_ID") & """>" & rsLatestPosts("Subject") & "</a></td><td><a href=""forum_topics.asp?FID=" & rsLatestPosts("Forum_ID") & """>" & rsLatestPosts("Forum_name") & "</a></td><td align=""center"">"&rsLatestPosts2("Username") &"</td><td align=""center"">" & LastLatestPostsDate & "-" & LastLatestPostsTime & "</td><td align=""center"">" & rsLatestPosts("No_of_views") & "</td></tr>"
rsLatestPosts.MoveNext Next end if
Call closeDatabase()
%>
|
Replies:
Posted By: unitrakya
Date Posted: 23 September 2007 at 12:46pm
nobita wrote:
No Thanks
|
what? 
|
Posted By: WebWiz-Bruce
Date Posted: 23 September 2007 at 2:27pm
There is a last 10 posts file in the extras folder.
You need to simply update this file in notepad to look at your own forum, then use the code in any website or page you like.
It uses the RSS Feed to get the posts, so doesn't even have to be used on the same web site.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: unitrakya
Date Posted: 23 September 2007 at 3:24pm
| Recent Forum Posts |
| Error: An invalid character was found in text content. |
i got this eror but i read from another topic that you will solve the problem in several weeks.
i will wait for you thanks borg ;)
|
Posted By: WebWiz-Bruce
Date Posted: 24 September 2007 at 9:09am
You need to be running version 9.05, but if you are using a non-western character set then these often do not work well with RSS Feeds.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: lovelymanmk
Date Posted: 24 September 2007 at 8:11pm
|
I did this for last 10 posts...
I'd aslo like to know if there is any error this might cause. I tested it and it's working well... but forum experts' opinion is very appreciated
<%
' Last 10 posts
strSQL = "SELECT TOP 10 " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Forum_ID " &_ "FROM " & strDbTable & "Author, (" & strDbTable & "Thread INNER JOIN " & strDbTable & "Topic ON " & strDbTable & "Thread.Topic_ID = " & strDbTable & "Topic.Topic_ID) INNER JOIN " & strDbTable & "Forum ON " & strDbTable & "Topic.Forum_ID = " & strDbTable & "Forum.Forum_ID " &_ "WHERE " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID " &_ "AND " & strDbTable & "Topic.Forum_ID IN (SELECT " & strDbTable & "Forum.Forum_ID FROM " & strDbTable & "Forum WHERE " & strDbTable & "Forum.[Hide] = 0 " &_ "UNION " &_ "select " & strDbTable & "Permissions.Forum_ID from " & strDbTable & "Permissions WHERE (" & strDbTable & "Permissions.Group_ID = " & intGroupID & " OR " & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & ")) " &_ "AND " & strDbTable & "Thread.Topic_ID IN (SELECT TOP 24 " & strDbTable & "Topic.Topic_ID FROM " & strDbTable & "Topic ORDER BY " & strDbTable & "Topic.Last_Thread_ID DESC) " &_ "AND " & strDbTable & "Forum.Password is NULL " &_ "ORDER BY " & strDbTable & "Thread.Message_date DESC" rsCommon.Open strSQL, adoCon
Dim sarryLFPost, nTotalRecs, intCurRecx Dim x_Author_ID, x_Username, x_Topic_ID, x_Thread_ID, x_Subject, x_MsgDate, x_Forum_ID
if not rsCommon.eof then sarryLFPost = rsCommon.GetRows() nTotalRecs = Ubound(sarryLFPost,2) + 1 end if
rsCommon.Close
Do While (intCurRecx < nTotalRecs)
x_Author_ID = CInt(sarryLFPost(1,intCurRecx)) x_Username = sarryLFPost(0,intCurRecx) x_Topic_ID = sarryLFPost(2,intCurRecx) x_Thread_ID = sarryLFPost(3,intCurRecx) x_Subject = sarryLFPost(5,intCurRecx) x_MsgDate = sarryLFPost(4,intCurRecx) x_Forum_ID = sarryLFPost(6,intCurRecx) Response.Write("<div width=150 style=""float: right;"">" & "<a href=""member_profile.asp?PF=" & x_Author_ID & strQsSID2 & """ class=""smLink"" rel=""nofollow"">" & x_Username & "</a> <a href=""forum_posts.asp?TID=" & x_Topic_ID & "&PID=" & x_Thread_ID & "#" & x_Thread_ID & """><img src=""" & strImagePath & "view_last_post.png"" alt=""" & strTxtViewLastPost & """ title=""" & strTxtViewLastPost & """ /></a></div>" & "<div width=150 style=""float: left;"">" & " " & (DateFormat(x_MsgDate) & " " & strTxtAt & " " & TimeFormat(x_MsgDate)) & "</div>" & "<div width=300 style=""float:center;"" align=""center"">" & " <a href=""forum_posts.asp?TID=" & x_Topic_ID & strQsSID2 & """ title=""" & x_Subject & """>" & TrimString(x_Subject, 35) & "</a></div><br>") intCurRecx = intCurRecx + 1 Loop
%>
|
------------- Mohamad Al-Karbi
|
Posted By: lovelymanmk
Date Posted: 30 September 2007 at 4:24pm
|
you should add this for not showing not approved post:
"AND " & strDbTable & "Thread.Hide = 0 " &_
so it's gonna be like this:
strSQL = "SELECT TOP 10 " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Forum_ID " &_ "FROM " & strDbTable & "Author, (" & strDbTable & "Thread INNER JOIN " & strDbTable & "Topic ON " & strDbTable & "Thread.Topic_ID = " & strDbTable & "Topic.Topic_ID) INNER JOIN " & strDbTable & "Forum ON " & strDbTable & "Topic.Forum_ID = " & strDbTable & "Forum.Forum_ID " &_ "WHERE " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID " &_ "AND " & strDbTable & "Thread.Hide = 0 " &_ "AND " & strDbTable & "Topic.Forum_ID IN (SELECT " & strDbTable & "Forum.Forum_ID FROM " & strDbTable & "Forum WHERE " & strDbTable & "Forum.[Hide] = 0 " &_ "UNION " &_ "select " & strDbTable & "Permissions.Forum_ID from " & strDbTable & "Permissions WHERE (" & strDbTable & "Permissions.Group_ID = " & intGroupID & " OR " & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & ")) " &_ "AND " & strDbTable & "Thread.Topic_ID IN (SELECT TOP 24 " & strDbTable & "Topic.Topic_ID FROM " & strDbTable & "Topic ORDER BY " & strDbTable & "Topic.Last_Thread_ID DESC) " &_ "AND " & strDbTable & "Forum.Password is NULL " &_ "ORDER BY " & strDbTable & "Thread.Message_date DESC"
However, I'm still not sure from getting the last post. It goes to the post of the topic not the one you specifiy by pressing on the arrow. That's because of get_last_post.asp I guess...
------------- Mohamad Al-Karbi
|
Posted By: bims
Date Posted: 08 October 2007 at 1:06pm
Is there a way to show only the last 10 topics? rather than posts? The things is i don't want all 10 links to be of the same topic if it's a heated one.
|
Posted By: dimoss
Date Posted: 30 December 2007 at 4:36pm
-boRg- wrote:
You need to be running version 9.05, but if you are using a non-western character set then these often do not work well with RSS Feeds.
|
I use iso-8859-1 and I have the same error Error: An invalid character was found in text content.
I use 9.06 MS-SQL
|
Posted By: namtoday
Date Posted: 06 January 2008 at 2:07pm
I didn't check the above post so i'm sorry if it's a double post, but since there's a request for last 10 topics, here's the mod:
<%
Set rsLatestPosts = Server.CreateObject("ADODB.Recordset") strSql = "Select top 5 " & 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 And " & strDbTable & "Topic.Forum_ID = 8 Order By " & strDbTable & "Topic.Last_Thread_ID desc" rsLatestPosts.Open strSQL, adoCon
If rsLatestPosts.EOF Then %> <p style="text-align: center">There's no topic to display. </p> <% Else
Do while not rsLatestPosts.Eof
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
%> <img alt="" src="images/icon-arrow.png" align="absmiddle"> <a class="smLink" href="forum_posts.asp?TID=<%= rsLatestPosts("Topic_ID")%>&get=last=<%= rsLatestPosts("Last_Thread_ID")%>" title=""><%= rsLatestPosts("Subject") %></a><br> <% rsLatestPosts.MoveNext loop end if %>
|
|
Posted By: namtoday
Date Posted: 06 January 2008 at 2:08pm
I'm sorry the above mod I took directly from my forum, so there's a line you will need to delete
find
<img alt="" src="images/icon-arrow.png" align="absmiddle">
|
Delete it. Regards
|
Posted By: kushty
Date Posted: 17 January 2008 at 2:48pm
namtoday wrote:
I didn't check the above post so i'm sorry if it's a double post, but since there's a request for last 10 topics, here's the mod:
<%
Set rsLatestPosts = Server.CreateObject("ADODB.Recordset") strSql = "Select top 5 " & 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 And " & strDbTable & "Topic.Forum_ID = 8 Order By " & strDbTable & "Topic.Last_Thread_ID desc" rsLatestPosts.Open strSQL, adoCon
If rsLatestPosts.EOF Then %> <p style="text-align: center">There's no topic to display. </p> <% Else
Do while not rsLatestPosts.Eof
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
%> <img alt="" src="images/icon-arrow.png" align="absmiddle"> <a class="smLink" href="forum_posts.asp?TID=<%= rsLatestPosts("Topic_ID")%>&get=last=<%= rsLatestPosts("Last_Thread_ID")%>" title=""><%= rsLatestPosts("Subject") %></a><br> <% rsLatestPosts.MoveNext loop end if %>
|
|
namtoday,
where would this code be put?
------------- Steve
http://www.perfectfloridavillas.com/forum/ - http://www.perfectfloridavillas.com/forum/
|
Posted By: namtoday
Date Posted: 20 January 2008 at 5:46am
|
It should work in default file, or even you can save it as stand-alone file (asp extension), then include it @ ur own website, you will need to include common.asp and fucntion_format_date.asp file in order to get it work @ ur own site.
|
Posted By: mattysdad
Date Posted: 15 March 2008 at 5:07pm
|
Hello all,
I tried inserting that code in to my default.asp file and it just crashed the site.
Could anybody explain to this idiot how I should do it?
Am running wwf 9.07
Thanks!
|
Posted By: avsa.gen.tr
Date Posted: 28 March 2008 at 3:48pm
|
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center"> <tr class="tableLedger"> <td colspan="5">En Son Mesaj Yazılan Konular</td> </tr> <tr class="tableSubLedger"> <td width="38%" align="center">Konu</td> <td width="19%" align="center">Forum</td> <td width="15%" align="center">Yazan</td> <td width="21%" align="center">Tarih</td> <td width="7%" align="center">Okunma</td> </tr>
<% Dim rsLatestPosts Dim intSay Dim rsLatestPosts2 Dim sql2 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
For intSay = 1 to 30 if rsLatestPosts.Eof Then Exit For
Set rsLatestPosts2 = Server.CreateObject("ADODB.Recordset") sql2 = "SELECT " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID FROM (" & strDbTable & "Author INNER JOIN " & strDbTable & "Thread ON " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID) WHERE " & strDbTable & "Thread.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)
Response.Write "<tr class=""tableRow""><td><a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & strQsSID2 & """><img border=""0"" src=""" & strImagePath & "right_arrow.gif"" alt="""" /></a> <a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & "&get=last#" & rsLatestPosts("Last_Thread_ID") & strQsSID2 &""" title=""Son Mesajı Görüntülemek İçin Tıklayın"">" & rsLatestPosts("Subject") & "</a></td><td><a href=""forum_topics.asp?FID=" & rsLatestPosts("Forum_ID") & strQsSID2 & """ title=""Forum Ana Sayfasını Görüntülemek İçin Tıklayın"">" & rsLatestPosts("Forum_name") & "</a></td><td align=""center"">"&rsLatestPosts2("Username") &"</td><td align=""center"">" & LastLatestPostsDate & "-" & LastLatestPostsTime & "</td><td align=""center"">" & rsLatestPosts("No_of_views") & "</td></tr>"
rsLatestPosts2.Close
rsLatestPosts.MoveNext Next
rsLatestPosts.Close
%> </table>
|
Posted By: mattysdad
Date Posted: 28 March 2008 at 4:37pm
|
Thanks, but it still does not work.
|
Posted By: hotice08
Date Posted: 03 April 2008 at 2:05pm
|
It works on my forum..I mean it is currently only in testing url. Once I make some other changes I will move it to live one.
here is the url where I made it to work . Check it out.
I have here 20 latest topics.
http://www.creative-castle.net/forum/newdefault.asp - http://www.creative-castle.net/forum/newdefault.asp
|
Posted By: mattysdad
Date Posted: 05 April 2008 at 6:34pm
I just cant get it to work!    
I dont know where to put the code or anything,  
I'd love to be able to get it to appear on the right of the screen like you have!
But I just dont know how!
|
Posted By: hotice08
Date Posted: 07 April 2008 at 2:00pm
|
This is the Code that I have added and please Note I am using MySql. Here the limit on Number of Topics are 25. If you want to change it Please find "LIMIT 25" and change the number of Topics you want to . Hope this helps
Dim rsLatestPosts
Dim rsLatestPosts2
Dim strSql2 Dim LastLatestPostsDateTime Dim LastLatestPostsDate Dim LastLatestPostsTime
<tr> <td bgcolor="#FFFFFF" > <% 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 And " & strDbTable & "Topic.Forum_ID > 0 Order By " & strDbTable &"Topic.Last_Thread_ID desc " & "LIMIT 25"
rsLatestPosts.Open strSQL, adoCon If rsLatestPosts.EOF Then %> <p style="text-align: center">There are no topics to display. </p> <% Else %> <p style="text-align: center" class="Main"><strong> Latest Topics !!! </strong> </p> <% Do while not rsLatestPosts.Eof
Set rsLatestPosts2 = Server.CreateObject("ADODB.Recordset") strSql2 = "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 strSql2, adoCon LastLatestPostsDateTime = rsLatestPosts2("Message_date") LastLatestPostsDate = DateFormat(LastLatestPostsDateTime) LastLatestPostsTime = TimeFormat(LastLatestPostsDateTime) intForumColourNumber = intForumColourNumber + 1 %> <a class="Main" href="forum_posts.asp?TID=<%= rsLatestPosts("Topic_ID")%>&get=last=<%= rsLatestPosts("Last_Thread_ID")%>" title=""><%= rsLatestPosts("Subject") %></a> <br> <% rsLatestPosts.MoveNext loop End If %> </td> </tr>
|
Posted By: mattysdad
Date Posted: 07 April 2008 at 6:31pm
Nope
It still does not work.
Where should I insert this code, in to which file?
Im putting it in the default.asp but it just keeps returning an internal server error.
Which line should I be adding this code, and where?
Im also using mysql.
Kindest thanks for your help. 
|
Posted By: hotice08
Date Posted: 07 April 2008 at 6:39pm
|
Modified File has been sent via PM. Check it and let me know if that works
|
Posted By: mattysdad
Date Posted: 08 April 2008 at 4:09pm
|
sadly it still did not work.
I really am not very good at this, though I wish I was.
I need to know what to add, and where to add it!!
|
Posted By: hotice08
Date Posted: 08 April 2008 at 4:12pm
mattysdad wrote:
sadly it still did not work.
I really am not very good at this, though I wish I was.
I need to know what to add, and where to add it!! |
If it is ok send me your Default.asp via email at mailto:charades08@yahoo.com - charades08@yahoo.com
|
Posted By: jonnyboy
Date Posted: 09 April 2008 at 4:10pm
|
Is there a way to get the last 10 posts to come up in the forum stats bar as it used to do back in version 6 (I think)? It used to split the who's online bar in two with the latest posts showing in a separate table on the right of the box.
|
Posted By: markomeara
Date Posted: 10 May 2008 at 3:50am
|
I got the following code to work on my default page to display 35 posts. It comes from my old 8.5 forum running MSSQL - and was originally posted in the mods forums for 8.5.
You can see it working at http://www.canadastudentdebt.ca - http://www.canadastudentdebt.ca
The code for posts goes right before the display of birthdays.
To get it to work you must comment out the call closedatabase() command earlier in the code and and then include it in the code section below...
I'm not an SQL programmer, so hopefully someone can advise as to whether this is efficient or not, and if not write some better code.
In default.asp I put this code here
*****************************************
'Calculate the number of members online and total people online intActiveUsers = UBound(saryActiveUsers, 2) 'Calculate the members online by using the total - Guests - Annoymouse Members intActiveMembers = intActiveUsers - intActiveGuests - intAnonymousMembers
Response.Write(strTxtInTotalThereAre & " " & intActiveUsers & " <a href=""active_users.asp" & strQsSID1 & """>" & strTxtActiveUsers & "</a> " & strTxtOnLine & ", " & intActiveGuests & " " & strTxtGuests & ", " & intActiveMembers & " " & strTxtMembers & ", " & intAnonymousMembers & " " & strTxtAnonymousMembers) If strMembersOnline <> "" Then Response.Write(vbCrLf & " <br />" & strTxtMembers & " " & strTxtOnLine & ": " & strMembersOnline) End If
%> </td> </tr>
CODE GOES HERE
<% 'If birthdays is enabled show who has a birthday today If strBirthdays <> "" Then
*************************************************
This is the code I used:
<tr class="tableSubLedger"> <td colspan="2"><%="Latest Forum Posts"%></td> </tr> <tr class="tableRow"> <td> </td> <td> <table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<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 = 0 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 35 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 = 0 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
'Clean up Call closeDatabase()
%> </table></td>
|
Posted By: markomeara
Date Posted: 11 May 2008 at 2:47am
|
as a followup, I have moderated forums, but the above code stopped working after I approved some hidden posts... so if anyone has some better code?
Thanks
|
Posted By: exper
Date Posted: 17 May 2008 at 8:54pm
|
mysql version ? for 9.03 pls help me
|
Posted By: markomeara
Date Posted: 17 May 2008 at 9:33pm
|
This code works for me on MSSQL - it goes right before the 'clean up and call closedatabase() lines...
Not sure if it will work for mysql - For MSSQL you have to use a value of 0 instead of the word false
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center"> <tr class="tableLedger"> <td colspan="5">Recent Topics</td> </tr> <tr class="tableSubLedger"> <td width="38%" align="center">Topic</td> <td width="19%" align="center">Forum</td> <td width="15%" align="center">Member</td> <td width="21%" align="center">Date</td> <td width="7%" align="center">Views</td> </tr>
<% Dim rsLatestPosts Dim intSay Dim rsLatestPosts2 Dim sql2 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 = 0 And " & strDbTable & "Topic.Forum_ID = " & strDbTable & "Forum.Forum_ID Order By " & strDbTable & "Topic.Last_Thread_ID desc" rsLatestPosts.Open strSQL, adoCon
For intSay = 1 to 20 if rsLatestPosts.Eof Then Exit For
Set rsLatestPosts2 = Server.CreateObject("ADODB.Recordset") sql2 = "SELECT " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID FROM (" & strDbTable & "Author INNER JOIN " & strDbTable & "Thread ON " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID) WHERE " & strDbTable & "Thread.Hide = 0 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)
Response.Write "<tr class=""tableRow""><td><a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & strQsSID2 & """><img border=""0"" src=""" & strImagePath & "right_arrow.gif"" alt="""" /></a> <a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & "&get=last#" & rsLatestPosts("Last_Thread_ID") & strQsSID2 &""" title=""Son Mesaji Görüntülemek Için Tiklayin"">" & rsLatestPosts("Subject") & "</a></td><td><a href=""forum_topics.asp?FID=" & rsLatestPosts("Forum_ID") & strQsSID2 & """ title=""Forum Ana Sayfasini Görüntülemek Için Tiklayin"">" & rsLatestPosts("Forum_name") & "</a></td><td align=""center"">"&rsLatestPosts2("Username") &"</td><td align=""center"">" & LastLatestPostsDate & "-" & LastLatestPostsTime & "</td><td align=""center"">" & rsLatestPosts("No_of_views") & "</td></tr>"
rsLatestPosts2.Close
rsLatestPosts.MoveNext Next
rsLatestPosts.Close
%> </table> <%
|
Posted By: mattysdad
Date Posted: 31 May 2008 at 5:22pm
|
Whhhhhhhyyyyyyy wont itwork for me?????
All I want to it to do is have an area on my forum that shows the last 10 posts or so, placed above the "whats going on" area
It's so frustrating!!! I'm using mysql, I just dont understand and feel like crying!!!
I dont know where to put the code in my default.asp, and when i follow the instructions it just kills my site!
Cant anybody help???
http://www.room327.biz - www.room327.biz is the site.
|
Posted By: Ragnar Karlsson
Date Posted: 10 July 2008 at 3:20pm
namtoday wrote:
I didn't check the above post so i'm sorry if it's a double post, but since there's a request for last 10 topics, here's the mod:
|
/EDIT : Solved my own problem. 
Hi Namotoday, I'd appreciate if you could help me out.
I wanted to output the last 5 topics from this forum - http://forum.blpublishing.com/forum_topics.asp?FID=22 - by order of creation.
Now looking at your code I managed to get it to produce the topics list to display happily. Modifying the SQL from Order By " & strDbTable & "Topic.Last_Thread_ID desc" to Order By " & strDbTable & "Topic.Topic_ID desc" produced the order I wanted.
To output the first post in the first thread I did the following changes
<% Else i = 0 Do while i < 5
Set rsLatestPosts2 = Server.CreateObject("ADODB.Recordset") sql2 = "SELECT " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Message, " & strDbTable & "Thread.Message_date, " & strDbTable & "Author.Username, " &_ strDbTable & "Author.Author_ID FROM ( " & strDbTable & "Author INNER JOIN " & strDbTable & "Thread ON " & strDbTable &_ "Author.Author_ID = " & strDbTable & "Thread.Author_ID) WHERE " & strDbTable & "Thread.Hide = 0 And " & strDbTable & "Thread.Topic_ID= " & rsLatestPosts("Topic_ID") & " order by Message_date asc" rsLatestPosts2.Open sql2, adoCon if i = 0 then response.write(rsLatestPosts2("Message")) response.write("<br/><br/>") end if %>
|
Cheers
Ragnar
|
Posted By: i2Paq
Date Posted: 11 July 2008 at 6:22pm
|
Using the code from I get:
ADODB.Recordset error '800a0e7d'
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/forums/default.asp, line 914
On line 914 it says: rsLatestPosts.Open strSQL, adoCon
I'm using an Access database.
Any help would be appriciated 
|
Posted By: caravelle
Date Posted: 24 November 2008 at 2:22am
hotice08 wrote:
mattysdad wrote:
sadly it still did not work.
I really am not very good at this, though I wish I was.
I need to know what to add, and where to add it!! |
If it is ok send me your Default.asp via email at mailto:charades08@yahoo.com - charades08@yahoo.com
|
hey hotice do you think you can help me with it too ?
|
Posted By: hotice08
Date Posted: 24 November 2008 at 6:16am
caravelle wrote:
hotice08 wrote:
mattysdad wrote:
sadly it still did not work.
I really am not very good at this, though I wish I was.
I need to know what to add, and where to add it!! |
If it is ok send me your Default.asp via email at mailto:charades08@yahoo.com - charades08@yahoo.com
|
hey hotice do you think you can help me with it too ? |
Sure not a problem. Contact me at mailto:charades08@yahoo.com - charades08@yahoo.com
|
Posted By: Scotty32
Date Posted: 24 November 2008 at 6:00pm
If you want recent posts on your homepage you can do it with my http://www.s2h.co.uk/wwf/mods/latest-topics/ - Latest Topics mod.
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
Posted By: caravelle
Date Posted: 01 December 2008 at 1:34am
i have tryed and hotice have send me 5 or 6 files but i just wont any other that wanna try it ?
|
Posted By: Vapresto
Date Posted: 27 December 2008 at 1:53pm
WebWiz-Bruce wrote:
There is a last 10 posts file in the extras folder.
You need to simply update this file in notepad to look at your own forum, then use the code in any website or page you like.
It uses the RSS Feed to get the posts, so doesn't even have to be used on the same web site.
|
I know I am a complete numpty with all this, and probably shouldn't be allowed to have a website at all, but I cannot get this to work at all...
I changed the URL to point to the correct file (there is only one that I have to change, right?) and then copied and pasted the lot as html into my home page.
I then saved the page as an .asp and this is the result!
http://www.vapresto.com/index2.asp - http://www.vapresto.com/index2.asp
What am I doing wrong? (Apart from not employing someone who knows what they are doing - which I can't afford for my 'hobby' site)
|
Posted By: Scotty32
Date Posted: 27 December 2008 at 7:34pm
it looks like you have pasted it as text in a WYSIWYG editor rather than pasted it in code view
you need to put it in as code not as text.
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
Posted By: Vapresto
Date Posted: 27 December 2008 at 8:10pm
|
Well I pasted it into the 'Source Code' part of Nvu, but I notice that it automatically changes all the < to < and all the > to > for some reason?
This is doing my head in!
|
Posted By: markomeara
Date Posted: 27 December 2008 at 10:53pm
|
You need a text editor. All windows computers come with Notepad... Paste it into Notepad.... and then save it with your file name and the correct extension.
|
Posted By: 123Simples
Date Posted: 28 December 2008 at 10:40am
If you are having problems then http://www.ornj.net/araneae/ - download the FREE Araneae Text Editor Software which in my opinion is really useful. Then open up your index or homepage using that, and as scotty and markomeara says, then paste in as text. Save the document then using Araneae and hopefully NVU should not overwrite or change anything
------------- http://www.123simples.com/" rel="nofollow - Visit 123 Simples Web Design
|
Posted By: avsa.-avsa.com
Date Posted: 28 March 2010 at 2:31pm
|