Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Simple Slash Mod
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 5

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 03 December 2003 :  04:01:04  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
I got another error than that I stated above, and after downloading the new zip I still get this error:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/forum/simple_slash.asp, line 79

Dim nPos2 Dim nPos3
-----------^

When I put the "Dim nPos3" on it's own line I get the error I stated above.

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

RebelTech
Average Member

USA
613 Posts

Posted - 03 December 2003 :  04:28:01  Show Profile  Visit RebelTech's Homepage  Send RebelTech an ICQ Message
Try this...
Create a new empty text file and name it simple_slash.asp. Paste the code below into it, save it and upload it to your forum directory. I think this should work. Let me know if there are any errors.


<!--#include file="config.asp"-->
<!--#include file="inc_func_common.asp" -->
<%
'---------------------------------------------------
' Simple Slash MOD
' Simply displays the last intTopicCount topics
' From ForumID (Use ForumID = "ANY" for all Forums)
'---------------------------------------------------

Const intTopicCount = 5
Const ForumID = "ANY"
Const CharsToDisplay = 200

'------------
' Get Topics
'------------
strSql = "SELECT "
strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, "
strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, "
strSql = strSql & strTablePrefix & "TOPICS.T_MESSAGE, "
strSql = strSql & strTablePrefix & "TOPICS.T_DATE, " 
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID, "
strSql = strSql & strTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM " 
strSql = strSql & "INNER JOIN " & strTablePrefix & "TOPICS ON " 
strSql = strSql & strTablePrefix & "FORUM.FORUM_ID = " 
strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID) " 
strSql = strSql & "INNER JOIN " & strTablePrefix & "MEMBERS ON "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR = " 
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID) "
If ForumID <> "ANY" Then strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.FORUM_ID = " & ForumID
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC "
strSql = strSql & "LIMIT " & intTopicCount
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnString
Set objRS = objConn.Execute(strSQL)

Response.Write	"      <table border=""0"" cellspacing=""1"" cellpadding=""0"" bgcolor=""" & strTableBorderColor & """ width=""100%""><tr><td>" & vbNewline
Response.Write	"      <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""2"" align=""center"" bgcolor=""" & strForumCellColor & """>" & vbNewline
Response.Write	"      <tr><td align=""center"" background=""imgs/headbg.gif"" bgcolor=""" & strHeadCellColor & """ colspan=""3""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Latest Topics</font></TD></tr>" & vbNewline

While Not objRS.EOF
  strSQL = "SELECT COUNT(*) FROM FORUM_REPLY WHERE TOPIC_ID = " & objRS("TOPIC_ID")
  Set objRS2 = objConn.Execute(strSQL)
  Response.Write "<tr><td background=""imgs/catbg.gif"" bgcolor=""" & strCategoryCellColor & """ colspan=""3"" align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <B>" & ChkString(objRS("T_SUBJECT"),"title") & "</B></font></td></tr>"
  Response.Write "<tr><td background=""imgs/catbg.gif"" bgcolor=""" & strCategoryCellColor & """ align=""center"" rowspan=""3"" valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """> Posted by: <br><b>" & objRS("M_NAME") & "</b><br> on <br>" & strToDate(objRS("T_DATE")) & "</font></td>"
  Response.Write "<td bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """><br>  " & Left(RemoveHTML(FormatStr(objRS("T_MESSAGE"))),CharsToDisplay) & "...</font></td></tr>"
  Response.Write "<tr><td bgcolor=""" & strForumCellColor & """ colspan=""3""> <a href='topic.asp?TOPIC_ID=" & objRS("TOPIC_ID") & "'><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>More >></a>  Replies(" & objRS2(0) & ")</font></td></tr>"
  Response.Write "<tr><td bgcolor=""" & strForumCellColor & """ colspan=""3"" height=""5""></td></tr>"
  objRS.MoveNext()
Wend

response.write  "</table></td></tr></table>" & vbNewLine
objRS2.Close()
Set objRS2 = Nothing
objRS.Close()
Set objRS = Nothing
objConn.Close()
Set objConn = Nothing


Response.End

Function RemoveHTML( strText )
  Dim TAGLIST
  TAGLIST=";A;B;IMG;CENTER;FONT;PRE;BLOCKQUOTE;"
    
  Dim nPos1
  Dim nPos2
  Dim nPos3
  Dim strResult
  Dim strTagName
  Dim bRemove
  Dim bSearchForBlock
  
  nPos1 = InStr(strText, "<")
  Do While nPos1 > 0
    nPos2 = InStr(nPos1 + 1, strText, ">")
    If nPos2 > 0 Then
      strTagName = Mid(strText, nPos1 + 1, nPos2 - nPos1 - 1)
      strTagName = Replace(Replace(strTagName, vbCr, " "), vbLf, " ")
      nPos3 = InStr(strTagName, " ")
      If nPos3 > 0 Then
        strTagName = Left(strTagName, nPos3 - 1)
      End If
         
      If Left(strTagName, 1) = "/" Then
        strTagName = Mid(strTagName, 2)
        bSearchForBlock = False
      Else
        bSearchForBlock = True
      End If
           
      If InStr(1, TAGLIST, ";" & strTagName & ";", vbTextCompare) > 0 Then
        bRemove = True
        
        If bSearchForBlock Then
        
          If InStr(1, BLOCKTAGLIST, ";" & strTagName & ";", vbTextCompare) > 0 Then
            nPos2 = Len(strText)
            nPos3 = InStr(nPos1 + 1, strText, "</" & strTagName, vbTextCompare)
        
            If nPos3 > 0 Then
              nPos3 = InStr(nPos3 + 1, strText, ">")
            End If
                      
            If nPos3 > 0 Then
              nPos2 = nPos3
            End If
            
          End If
          
        End If
        
      Else
        bRemove = False
      End If
          
      If bRemove Then
        strResult = strResult & Left(strText, nPos1 - 1)
        strText = Mid(strText, nPos2 + 1)
      Else
        strResult = strResult & Left(strText, nPos1)
        strText = Mid(strText, nPos1 + 1)
      End If
    Else
      strResult = strResult & strText
      strText = ""
    End If
      
    nPos1 = InStr(strText, "<")
  Loop
  strResult = strResult & strText    
  RemoveHTML = strResult
End Function  
%>
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 03 December 2003 :  04:51:16  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message
That did it! =) Downloaded the file the wrong way or what?
thanks!

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

RebelTech
Average Member

USA
613 Posts

Posted - 03 December 2003 :  05:00:03  Show Profile  Visit RebelTech's Homepage  Send RebelTech an ICQ Message
I am glad you got it working. I never got to look at the code you had so I wouldn't even try to guess what had gone wrong. Just chalk it up to web gnomes
Go to Top of Page

acoustika
Junior Member

Denmark
311 Posts

Posted - 26 December 2003 :  20:59:11  Show Profile  Visit acoustika's Homepage  Send acoustika an ICQ Message
I can't get this to work with MySql

I get this error

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

[MySQL][ODBC 3.51 Driver][mysqld-4.0.12-nt]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 'WHERE FORUM_TOPICS.FORUM_ID = 5 ORDER BY FORUM_TOPICS.T_DATE DE

/forum/inc_simple_slash.asp, line 47


It work's with the code from the above post RebelTech but that doesn't exclude the posts from Private forums I think.

The lines it's concerning are these

If strDBType = "mysql" then
strSql = "SELECT "
Else
strSql = "SELECT TOP " & intTopicCount & " "
End If
strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, "
strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, "
strSql = strSql & strTablePrefix & "TOPICS.T_MESSAGE, "
strSql = strSql & strTablePrefix & "TOPICS.T_DATE, "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID, "
strSql = strSql & strTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM "
strSql = strSql & "INNER JOIN " & strTablePrefix & "TOPICS ON "
strSql = strSql & strTablePrefix & "FORUM.FORUM_ID = "
strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID) "
strSql = strSql & "INNER JOIN " & strTablePrefix & "MEMBERS ON "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR = "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID) "
strSqL = strSql & "WHERE (" & strTablePrefix & "FORUM.F_PRIVATEFORUMS = 0)"
If ForumID <> "ANY" Then strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.FORUM_ID = " & ForumID
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC"
If strDBType = "mysql" then
strSql = strSql & "LIMIT " & intTopicCount


Anyone??

May The Code Be With You
www.UniqueDk.dk *** The Open Forums of Denmark ***

Edited by - acoustika on 26 December 2003 21:00:48
Go to Top of Page

acoustika
Junior Member

Denmark
311 Posts

Posted - 26 December 2003 :  21:18:30  Show Profile  Visit acoustika's Homepage  Send acoustika an ICQ Message
Well I Got it working, it works when the forums are set to "ANY", but not If it's a specific forum number,
but ofcourse then the private statement won't be nedded, stupid mee *LOL. So it seems that it's working as it should ;-)

May The Code Be With You
www.UniqueDk.dk *** The Open Forums of Denmark ***

Edited by - acoustika on 26 December 2003 21:19:18
Go to Top of Page

acoustika
Junior Member

Denmark
311 Posts

Posted - 27 December 2003 :  03:01:01  Show Profile  Visit acoustika's Homepage  Send acoustika an ICQ Message
Could it be made so when a Topic is a Poll it would show that it was a poll??

May The Code Be With You
www.UniqueDk.dk *** The Open Forums of Denmark ***
Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Previous Page
 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.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07