Print Page | Close Window

lastest topics (creator of topics)

Printed From: S2H.co.uk
Category: Web Wiz Forums
Forum Name: Modifications Support
Forum Description: Support for modifications and add-ons for Web Wiz Forums from S2H.
URL: http://www.s2h.co.uk/forum/forum_posts.asp?TID=160
Printed Date: 29 Mar 2024 at 7:25am


Topic: lastest topics (creator of topics)
Posted By: macpack
Subject: lastest topics (creator of topics)
Date Posted: 30 Aug 2009 at 7:39am
Hey Scotty,
 
The Latest Topics modification shows the last person to post in that topic.
 
But i want to change it to the creator of the topic how and where do i change it to that in the script.?



Replies:
Posted By: Matt
Date Posted: 31 Aug 2009 at 2:47pm
I'll look into it and get back to you.


Posted By: macpack
Date Posted: 03 Sep 2009 at 1:15pm
found the solution mate.?


Posted By: Matt
Date Posted: 03 Sep 2009 at 2:38pm
Add the following to line 117 of "includes/s2h_latest-topics.asp"

                    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



Posted By: macpack
Date Posted: 04 Sep 2009 at 4:18am
Hey again scotty, if ill add it into line 117, it gives me a error then entering the site..
 
Is is possible, you can add it into the s2h_latest-topics.asp, and then post the full edited s2h_latest-topics.asp code here in this forum thread.?


Posted By: Matt
Date Posted: 04 Sep 2009 at 7:41am
You want it to be between the following lines:

strS2HLTAuthorName    = saryS2HLTRecords(7, iS2HLTLoop)


*insert here*

%><tr class="tableRow">



Posted By: macpack
Date Posted: 04 Sep 2009 at 3:14pm
Originally posted by Scotty32 Scotty32 wrote:

You want it to be between the following lines:

strS2HLTAuthorName    = saryS2HLTRecords(7, iS2HLTLoop)


*insert here*

%><tr class="tableRow">

 
Then i put it there, it gives me this fault:
 
 

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/includes/s2h_latest-topics.asp, line 117

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
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^


Posted By: Matt
Date Posted: 04 Sep 2009 at 3:56pm
You need to make sure that each line is formated exactly as I have it above.

Eg, make sure that there are returns where I have them.


Posted By: macpack
Date Posted: 04 Sep 2009 at 5:47pm
Originally posted by Scotty32 Scotty32 wrote:

You need to make sure that each line is formated exactly as I have it above.

Eg, make sure that there are returns where I have them.
 
Ahh perfect scotty, it know works..
 
Its a really good tip mod fore this script..Wink


Posted By: macpack
Date Posted: 29 Oct 2009 at 9:45am
Hey again Scotty,
Is it possible, you can show me how to add an extra colum after <%=strTxtS2HLTTitleDate%> with the the first author of the topic.
 
so it will have 5 colums.
<%=strTxtS2HLTTitleTopic%>
<%=strTxtS2HLTTitleAuthor%> (The first author of the topic.)
<%=strTxtS2HLTTitleForum%>
<%=strTxtS2HLTTitleDate%>
<%=strTxtS2HLTTitleAuthor%> (The lasted person who has writed in the topic.)


Posted By: Matt
Date 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.


Posted By: macpack
Date 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/" rel="nofollow - 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/" rel="nofollow - http://www.s2h.co.uk/wwf/latest-topics/
'** Support:  http://www.s2h.co.uk/forum/" rel="nofollow - 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" rel="nofollow - 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 - http://www.s2h.co.uk/wwf/" rel="nofollow - www.s2h.co.uk/wwf/ -->
 
Can you show me what i need to change and with what code here mate.?


Posted By: macpack
Date Posted: 07 Nov 2009 at 5:14pm
?


Posted By: Matt
Date 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, http://www.s2h.co.uk/wwf/mods/latest-topics/link-removal.asp" rel="nofollow - you can purchase a licence here .


Posted By: macpack
Date 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, http://www.s2h.co.uk/wwf/mods/latest-topics/link-removal.asp - 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.
 
 


Posted By: Matt
Date 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



Posted By: macpack
Date Posted: 10 Nov 2009 at 6:35pm
yeaH it now works.. thanks bigtime mate.
and then do i get the serial lincense.?


Posted By: macpack
Date 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


Posted By: Matt
Date 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.


Posted By: macpack
Date 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.?


Posted By: Matt
Date Posted: 27 Aug 2010 at 12:33pm
take out the ' strSQL = strSQL & ' part of the red section, it shouldnt be there


Posted By: macpack
Date Posted: 27 Aug 2010 at 3:35pm
Perfect now it works mate... Thanks you very very much for the big help you always give me, and thanks for the time..


Posted By: macpack
Date Posted: 13 Sep 2010 at 10:39pm

Hey again scotty,

How can i show exempel 4 cats in this script.?


Now it only shows 1 forum cat if i change it to:
  "AND " & strDbTable & "Forum.Cat_ID = 3 " & _


But how can i change it, so i can show 4 different Forum Cats.?

Regards
André



Posted By: Matt
Date Posted: 13 Sep 2010 at 11:15pm
If you want to show from more than one category it would be:

"AND (" & strDbTable & "Forum.Cat_ID = 1 OR " & strDbTable & "Forum.Cat_ID = 2 OR " & strDbTable & "Forum.Cat_ID = 3 OR " & strDbTable & "Forum.Cat_ID = 3) " & _


Obviously changing the ID numbers to the ones you want.


Posted By: macpack
Date Posted: 13 Sep 2010 at 11:21pm
thank you very very much my friend.



Print Page | Close Window