New Posts New Posts RSS Feed - lastest topics (creator of topics)
  FAQ FAQ  Forum Search   Register Register  Login Login

lastest topics (creator of topics)

 Post Reply Post Reply Page  <123>
Author
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 2009 at 11:08am
All you need to do is simply add extra cells for the field.

Add one to the header where the above values are, and add one after the date like so:

                <td><%=DateFormat(dtmS2HLTMessageDate) & " " & strTxtAt & " " & TimeFormat(dtmS2HLTMessageDate)%></td>
                <td><%=strS2HLTAuthorName%></td>


Though, if you want the original poser and the last poster together, you will need to rename the variable to a unique ID in the code I previously posted in this thread.
Back to Top
macpack View Drop Down
Newbie
Newbie


Joined: 19 Jun 2009
Status: Offline
Points: 38
Post Options Post Options   Quote macpack Quote  Post ReplyReply Direct Link To This Post Posted: 01 Nov 2009 at 2:32pm
I have now added the cells, but i dont understand the second part with the unique id you are explaying for me..
 
My code looks like this now with the extra cell:
Quote <%
'****************************************************************************************
'**  Copyright Notice   
'**
'**  Scotty32
'**  http://www.s2h.co.uk/
'**                           
'**  Copyright (C) 2008-2009 S2H.co.uk. All Rights Reserved.
'**
'****************************************************************************************
'**
'**  Latest Topics
'** ---------------
'**
'** Version: 1.2.0
'** Author:  Scotty32
'** Website: http://www.s2h.co.uk/wwf/latest-topics/
'** Support: http://www.s2h.co.uk/forum/
'**
'****************************************************************************************
'**
'** Latest Topics Options
'**
 intS2HLTLimit  = 10 ' Change the value to incease the limit
 ' Powered By Link
 '=====================
 ' To remove the powered by link you must first purchese a license:
 ' http://www.s2h.co.uk/wwf/latest-topics/link-removal.asp
 strS2HLTSerialNumber = "" ' Enter your Link Removal Serial Number here
'****************************************************************************************
 Dim saryS2HLTRecords
 Dim blnS2HLTNoPosts
 Dim iS2HLTLoop
 Dim intS2HLTFirst
 Dim intS2HLTLast
 Dim intS2HLTForumID
 Dim strS2HLTForumName
 Dim lngS2HLTTopicID
 Dim strS2HLTTopicTitle
 Dim lngS2HLTMessageID
 Dim dtmS2HLTMessageDate
 Dim intS2HLTAuthorID
 Dim strS2HLTAuthorName
 Dim intS2HLTLimit
 Dim strS2HLTForumPath
 Dim strS2HLTSerialNumber
 
 strSQL = "SELECT "
    if strDatabaseType = "Access" or strDatabaseType = "SQLServer" then
 strSQL = strSQL & "TOP " & intS2HLTLimit
    end if
 strSQL = strSQL & " " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Thread.Message  " & _
 "FROM " & strDbTable & "Forum, " & strDbTable & "Topic, " & strDbTable & "Author, " & strDbTable & "Thread " & _
 "WHERE " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID " & _
  "AND " & strDbTable & "Topic.Last_Thread_ID = " & strDbTable & "Thread.Thread_ID " & _
  "AND " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID " & _
  "AND (" & strDbTable & "Topic.Forum_ID " & _
   "IN (" & _
    "SELECT " & strDbTable & "Permissions.Forum_ID " & _
    "FROM " & strDbTable & "Permissions" & strDBNoLock & " " & _
    "WHERE (" & strDbTable & "Permissions.Group_ID = " & intGroupID & " OR " & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & ") " & _
     "AND " & strDbTable & "Permissions.View_Forum = " & strDBTrue & _
   ")" & _
  ")"
 strSQL = strSQL & "AND (" & strDbTable & "Forum.Password = '' OR " & strDbTable & "Forum.Password Is Null) "
 strSQL = strSQL & "AND (" & strDbTable & "Topic.Hide = " & strDBFalse & " AND " & strDbTable & "Thread.Hide = " & strDBFalse & ") " & _
 "ORDER BY " & strDbTable & "Thread.Thread_ID DESC"
    if strDatabaseType = "mySQL" then
 strSQL = strSQL & " LIMIT " & intS2HLTLimit
    end if
 rsCommon.Open strSQL, adoCon
 if NOT rsCommon.EOF or NOT rsCommon.BOF then
  saryS2HLTRecords = rsCommon.GetRows()
  intS2HLTFirst = LBound(saryS2HLTRecords, 2)
  intS2HLTLast = UBound(saryS2HLTRecords, 2)
 end if
 rsCommon.Close
%>
   <table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
   <tr class="tableLedger">
    <td colspan="5"><span style="float: left;"><%=strTxtS2HLTHeader%></span> </td>
   </tr><tr class="tableSubLedger">
    <td><%=strTxtS2HLTTitleTopic%></td>
    <td><%=strTxtS2HLTTitleAuthor%></td>
    <td><%=strTxtS2HLTTitleForum%></td>
    <td><%=strTxtS2HLTTitleDate%></td>
        <td><%=DateFormat(dtmS2HLTMessageDate) & " " & strTxtAt & " " & TimeFormat(dtmS2HLTMessageDate)%></td>
   </tr><%
       If isArray(saryS2HLTRecords) Then
    for iS2HLTLoop = intS2HLTFirst to intS2HLTLast
     'RS array lookup table
     '0 = tblForum.Forum_name
     '1 = tblTopic.Topic_ID
     '2 = tblTopic.Subject
     '3 = tblThread.Thread_ID
     '4 = tblThread.Message_date
     '5 = tblAuthor.Author_ID
     '6 = tblAuthor.Username
     '7 = tblThread.Message
     'Read in db details for RSS feed
     intS2HLTForumID  = saryS2HLTRecords(0, iS2HLTLoop)
     strS2HLTForumName = saryS2HLTRecords(1, iS2HLTLoop)
     lngS2HLTTopicID  = CLng(saryS2HLTRecords(2, iS2HLTLoop))
     strS2HLTTopicTitle = saryS2HLTRecords(3, iS2HLTLoop)
     lngS2HLTMessageID = CLng(saryS2HLTRecords(4, iS2HLTLoop))
     dtmS2HLTMessageDate = CDate(saryS2HLTRecords(5, iS2HLTLoop))
     intS2HLTAuthorID = CLng(saryS2HLTRecords(6, iS2HLTLoop))
     strS2HLTAuthorName = saryS2HLTRecords(7, iS2HLTLoop)

strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username FROM " & strDbTable & "Thread, " & strDbTable & "Author WHERE " & strDbTable & "Thread.Topic_ID = " & lngS2HLTTopicID & " AND " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID ORDER BY " & strDbTable & "Thread.Thread_ID ASC"                  
rsCommon.Open strSQL, adoCon
if NOT rsCommon.EOF or NOT rsCommon.BOF then
intS2HLTAuthorID    = rsCommon("Author_ID")
strS2HLTAuthorName    = rsCommon("Username")   
End if   
rsCommon.Close
      

   %><tr class="tableRow">
    <td><a href="<%=strS2HLTForumPath & "forum_posts.asp?TID=" & lngS2HLTTopicID & "&amp;PID=" & lngS2HLTMessageID & strQsSID2 & SeoUrlTitle(strS2HLTTopicTitle, "&amp;title=") & "#" & lngS2HLTMessageID %>"><%=strS2HLTTopicTitle%></a></td>
    <td><a rel="nofollow" href="<%=strS2HLTForumPath & "member_profile.asp?PF=" & intS2HLTAuthorID & strQsSID2%>"><%=strS2HLTAuthorName%></a></td>
    <td><a href="<%=strS2HLTForumPath & "forum_topics.asp?FID=" & intS2HLTForumID & strQsSID2 & SeoUrlTitle(strS2HLTForumName, "&amp;title=") %>"><%=strS2HLTForumName%></a></td>
    <td><%=DateFormat(dtmS2HLTMessageDate) & " " & strTxtAt & " " & TimeFormat(dtmS2HLTMessageDate)%></td>
   <td><%=strS2HLTAuthorName%></td>
   </tr><%
    next
       else
   %><tr class="tableRow">
    <td colspan="5"><%=strTxtS2HLTNoPosts%></td>
   </tr><%
       end if
   %><tr class="tableBottomRow">
    <td colspan="5" align="right"><a href="<%=strS2HLTForumPath & "active_topics.asp" & strQsSID1%>"><%=strTxtS2HLTViewNewPosts%></a></td>
   </tr>
   </table>
<!-- S2H: "Latest Topics V1.2.0" Modification - www.s2h.co.uk/wwf/ -->
 
Can you show me what i need to change and with what code here mate.?


Edited by macpack - 01 Nov 2009 at 2:33pm
Back to Top
macpack View Drop Down
Newbie
Newbie


Joined: 19 Jun 2009
Status: Offline
Points: 38
Post Options Post Options   Quote macpack Quote  Post ReplyReply Direct Link To This Post Posted: 07 Nov 2009 at 5:14pm
?
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 08 Nov 2009 at 10:54am
I am afraid that you will need to replace the Powered By link.

If you do not wish to display the Powered By link, you can purchase a licence here.
Back to Top
macpack View Drop Down
Newbie
Newbie


Joined: 19 Jun 2009
Status: Offline
Points: 38
Post Options Post Options   Quote macpack Quote  Post ReplyReply Direct Link To This Post Posted: 08 Nov 2009 at 12:35pm
Originally posted by Scotty32 Scotty32 wrote:

I am afraid that you will need to replace the Powered By link.

If you do not wish to display the Powered By link, you can purchase a licence here.
 
Hey again scotty, ahh sorry i have now paided:
Transaktions-ID: *removed*
Betalningsgodkännandet för ditt köp från *removed* har skickats.
 
 


Edited by Scotty32 - 13 Aug 2010 at 12:28pm
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 09 Nov 2009 at 2:01pm
Alter this part:


strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username FROM " & strDbTable & "Thread, " & strDbTable & "Author WHERE " & strDbTable & "Thread.Topic_ID = " & lngS2HLTTopicID & " AND " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID ORDER BY " & strDbTable & "Thread.Thread_ID ASC"                 
rsCommon.Open strSQL, adoCon
if NOT rsCommon.EOF or NOT rsCommon.BOF then
intS2HLTOrgAuthorID    = rsCommon("Author_ID")
strS2HLTOrgAuthorName    = rsCommon("Username")  
End if  
rsCommon.Close


You then use these two new variables to display the Original Poster

You will need to define these variables like so:

....
 Dim intS2HLTLimit
 Dim strS2HLTForumPath
 Dim strS2HLTSerialNumber

 Dim intS2HLTOrgAuthorID
 Dim strS2HLT
OrgAuthorName

Back to Top
macpack View Drop Down
Newbie
Newbie


Joined: 19 Jun 2009
Status: Offline
Points: 38
Post Options Post Options   Quote macpack Quote  Post ReplyReply Direct Link To This Post Posted: 10 Nov 2009 at 6:35pm
yeaH it now works.. thanks bigtime mate.
and then do i get the serial lincense.?
Back to Top
macpack View Drop Down
Newbie
Newbie


Joined: 19 Jun 2009
Status: Offline
Points: 38
Post Options Post Options   Quote macpack Quote  Post ReplyReply Direct Link To This Post Posted: 13 Aug 2010 at 12:02pm
Hey Again Scotty, is is possible you can change the script so it only shows the lasted 10 post in a specific category.? TongueTongue
Back to Top
Matt View Drop Down
Admin Group
Admin Group


Joined: 07 Feb 2003
Location: Manchester, UK
Status: Offline
Points: 195
Post Options Post Options   Quote Matt Quote  Post ReplyReply Direct Link To This Post Posted: 14 Aug 2010 at 11:35am
If you want one specific forum simply add the following just before the "ORDER BY" line in the "includes/s2h_latest-topics.asp" file's SQL statement:

    strSQL = strSQL & "AND " & strDbTable & "Forum.Forum_ID = 1 " & _


Change the number one to the forums ID number.

if you mean a forum category (group of forums) just do the same as above but with the following code:

    strSQL = strSQL & "AND " & strDbTable & "Forum.Cat_ID = 1 " & _


One being the Categorys ID
though I dont know off the top of my head what the actual field is called, so if that doesnt work check the tblForum table for the category IDs field name.
Back to Top
macpack View Drop Down
Newbie
Newbie


Joined: 19 Jun 2009
Status: Offline
Points: 38
Post Options Post Options   Quote macpack Quote  Post ReplyReply Direct Link To This Post Posted: 27 Aug 2010 at 6:01am
Hey Scotty, i have tryed to do what you say, but i´ll think am doing something wrong..
 
I have changed it, so it looks like this now:
 
 strSQL = strSQL & "AND (" & strDbTable & "Forum.Password = '' OR " & strDbTable & "Forum.Password Is Null) "
 strSQL = strSQL & "AND (" & strDbTable & "Topic.Hide = " & strDBFalse & " AND " & strDbTable & "Thread.Hide = " & strDBFalse & ") " & _
 strSQL = strSQL & "AND " & strDbTable & "Forum.Cat_ID = 2 " & _ 
 "ORDER BY " & strDbTable & "Thread.Thread_ID DESC"
 

The red one is the new changed part..
It comes out the a fault..
 
It Says this:
 

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-5.1.30-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'False LIMIT 10' at line

 
You know what i can do mate.?


Edited by macpack - 27 Aug 2010 at 6:12am
Back to Top
 Post Reply Post Reply Page  <123>
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.047 seconds.