T O P I C R E V I E W |
elmo |
Posted - 19 July 2006 : 12:58:08 www.vex-clan.co.uk this is site i want to do it. basiclly never used asp before. but what i want to do i grab the lastest post from a part of the forum i want and have it display on front page of my site.
involuing asp going to database and the database getting the post i want.
Can anyone help me code this or direct me to something that can help. thanks< |
15 L A T E S T R E P L I E S (Newest First) |
SnapperL |
Posted - 12 August 2006 : 15:17:39 that did the trick, can't believe I didn't see that Thanks guys....< |
modifichicci |
Posted - 12 August 2006 : 12:46:47 Set objRS = objConn.Execute(TopSql(strSQL,SlashCount)) change SlashCount with intTopicCount< |
SnapperL |
Posted - 12 August 2006 : 12:34:16 here is the top of my file....
<!--#include file="config.asp"--> <!--#include file="inc_func_common.asp" --> <% '--------------------------------------------------- ' Gremlins Simple Slash MOD ' Simply displays the last intTopicCount topics ' From ForumID (Use ForumID = "ANY" for all Forums) '---------------------------------------------------
Const intTopicCount = 5 Const ForumID = 19 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 " Dim objConn, objRS Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open strConnString Set objRS = objConn.Execute(TopSql(strSQL,SlashCount)) < |
modifichicci |
Posted - 12 August 2006 : 12:22:48 Where have you set SlashForumID and SlashCount? Because file use these variables: Const intTopicCount = 1 Const ForumID = 13 Const CharsToDisplay = 220 and I don't see yours...< |
SnapperL |
Posted - 12 August 2006 : 11:34:05 ok now I'm getting this error.....
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-4.0.27-max-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 '' at line 1
/forum/simple_slash.asp, line 38 < |
cripto9t |
Posted - 10 August 2006 : 17:53:17 strSql = "SELECT "
strSql = strSql & "T.TOPIC_ID, "
strSql = strSql & "T.T_SUBJECT, "
strSql = strSql & "T.T_MESSAGE, "
strSql = strSql & "T.T_DATE, "
strSql = strSql & "T.T_AUTHOR, "
strSql = strSql & "M.MEMBER_ID, "
strSql = strSql & "M.M_NAME "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM F "
strSql = strSql & "INNER JOIN " & strTablePrefix & "TOPICS T ON "
strSql = strSql & "F.FORUM_ID = T.FORUM_ID) "
strSql = strSql & "INNER JOIN " & strTablePrefix & "MEMBERS M ON "
strSql = strSql & "T.T_AUTHOR = M.MEMBER_ID) "
'I added the "F.F_PRIVATEFORUMS = 0" so that private forums wouldn't be displaid
If SlashForumID <> "ANY" Then
strSql = strSql & " WHERE T.FORUM_ID = " & SlashForumID & " AND F.F_PRIVATEFORUMS = 0"
Else
strSql = strSql & " WHERE F.F_PRIVATEFORUMS = 0"
End If
strSql = strSql & " AND T.FORUM_ID <> " & intFPTestForum
strSql = strSql & " AND T.FORUM_ID <> " & intFPNewsForum
strSql = strSql & " ORDER BY T.T_DATE DESC"
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnString
Set objRS = objConn.Execute(TopSql(strSQL,SlashCount)) Use the TopSql() function. The red code above shows how to use it. The function is in forum file "inc_func_common"
I used AnonJrs' code here so dont copy and paste. Just use the first and last lines. < |
AnonJr |
Posted - 10 August 2006 : 14:31:17 Because as it is "out of the box" it uses the MS SQL Server/Access syntax. MySQL uses LIMIT instead of TOP (and the limit goes at the end.)
Take a look at the copy I posted earlier and you'll see one of the ways to fix it.< |
SnapperL |
Posted - 10 August 2006 : 14:09:31 Anyone have any idea why I might be getting this error on slash mod?
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-4.0.27-max-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 '5 FORUM_TOPICS.TOPIC_ID, FORUM_TOPICS.T_SUBJECT, FORUM_TOPICS.T
/forum/inc_simple_slash.asp, line 38
< |
alanh |
Posted - 20 July 2006 : 10:08:55 Here is a link to the error code you are getting, that may help.
It looks like you are not looking at or getting to the correct database, i.e. the DSN is not set correctly.< |
elmo |
Posted - 20 July 2006 : 08:35:59 http://www.vex-clan.co.uk/forum/inc_simple_slash.txt
line 45 is objConn.Open strConnString< |
AnonJr |
Posted - 20 July 2006 : 06:20:11 Hmmm... what's on line 45? could you put a link to a txt version of your copy of inc_simple_slash.asp?< |
elmo |
Posted - 19 July 2006 : 21:09:49 ok so i though i would test the files in the forum folder as thats where the inc_func_common is.
http://www.vex-clan.co.uk/forum/index.asp this error i get< |
AnonJr |
Posted - 19 July 2006 : 20:35:39 inc_func_common.asp is a forum file and would be with the rest of the files for your forum. When the Simple Slash MOD was first put together I suspect that it was originally intended that all the files would be in the same directory.
As to the database, if you make changes to the SQL statement like I did, it will check which you are using. I know there is also a TopSQL function in inc_func_common.asp that will do the same thing with less work but the syntax escapes me at the moment. (I learned about it after I'd modified the MOD. =/ )< |
elmo |
Posted - 19 July 2006 : 19:21:48 It didnt have a "inc_func_common.asp" with the mod download. so where would it be?
its Mysql i believe ... i have to go check. thanks for help though< |
AnonJr |
Posted - 19 July 2006 : 19:11:21 Are you using MS SQL Server or MySQL? I've uploaded a txt version of my inc_simple_slash.asp here - bear in mind that I've made a few other changes so you won't be able to just drop it in... but I did comment the pertinent points.
Also, when I clicked on the http://www.vex-clan.co.uk/index.asp link I got an error... looks like inc_func_common.asp isn't where inc_simple_slash.asp is looking for it.
As to finding the forum's ID, if you hold your mouse over the link to the forum you'll see the ID in the query string.< |