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/Code)
 MOD: Latest Top 10 Messages
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

bobby131313
Senior Member

USA
1163 Posts

Posted - 02 March 2008 :  13:47:26  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Bruno, I don't have MSN. I'm getting the same message on both my forums...

http://www.coincommunity.com/forum/inc_topMessages.asp

http://www.stampcommunity.org/inc_topMessages.asp

I uncommented the sql line and this is what I get...

SELECT TOP 15 a.CAT_ID, a.FORUM_ID, a.TOPIC_ID, a.T_SUBJECT, a.MSG_ID, a.MSG, a.MSG_DATE, a.MEMBER_ID, a.M_NAME FROM ( SELECT t.CAT_ID, t.FORUM_ID, t.TOPIC_ID, t.T_SUBJECT, '' AS MSG_ID, t.T_MESSAGE AS MSG, t.T_DATE AS MSG_DATE, m.MEMBER_ID, m.M_NAME FROM FORUM_MEMBERS m INNER JOIN FORUM_TOPICS t ON m.MEMBER_ID = t.T_AUTHOR UNION ALL SELECT t.CAT_ID, t.FORUM_ID, t.TOPIC_ID, t.T_SUBJECT, r.REPLY_ID AS MSG_ID, r.R_MESSAGE as MSG, r.R_DATE as MSG_DATE, m.MEMBER_ID, m.M_NAME FROM (FORUM_TOPICS t INNER JOIN FORUM_REPLY r ON t.TOPIC_ID = r.TOPIC_ID) INNER JOIN FORUM_MEMBERS m ON r.R_AUTHOR = m.MEMBER_ID ) a INNER JOIN FORUM_FORUM f ON f.FORUM_ID = a.FORUM_ID WHERE f.F_PRIVATEFORUMS = 0 ORDER BY MSG_DATE DESC;

Hopefully that helps.<

Switch the order of your title tags
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 02 March 2008 :  15:08:26  Show Profile  Visit richfed's Homepage  Reply with Quote
Thanks, Bruno ... got it now. Thank you for your quick assistance on this!<
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 02 March 2008 :  15:19:48  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
bobby131313

using mySQL, MS SQL or MS Access ?

cause using MS Access and MS SQL it's working fine that SQL query on my Database as you can see it here:





Edited: Added mySQL query image using a fresh install of Snitz Forum (so, only 1 message)<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 02 March 2008 17:55:20
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 02 March 2008 :  15:38:23  Show Profile  Visit bobby131313's Homepage  Reply with Quote
I'm using MySQL of course. <

Switch the order of your title tags
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 02 March 2008 :  15:55:38  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
damm...

let me trying to find a conversion for that code (no mySQL here) ... if any mySQL expert around, fell free to post this code converted. I will them update the version.

SQL Code can be found here

Done...

v.1.3 working with mySQL <

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 02 March 2008 16:07:50
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 02 March 2008 :  16:02:03  Show Profile  Visit bobby131313's Homepage  Reply with Quote
I'm almost sure I ran into this with some other mods. I think "Select top" needs to use "topsql" for MySQL. I've been playing with it no luck yet.<

Switch the order of your title tags
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 02 March 2008 :  16:08:53  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
can you try the new code bobby131313 ?

and tell me if it works?<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"


Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 02 March 2008 :  16:24:18  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Not yet...

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'TopSQL'

/forum/test_topMessages.asp, line 103
<

Switch the order of your title tags
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 02 March 2008 :  16:36:03  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
you need to include the function

for testing proposes or using outside the Snitz environment you need this:


<!--#include file="inc_func_common.asp"-->


when you add the include of inc_topMessages.asp in your default.asp file, this inc_func_common.asp is already included in the header, so you don't need to add it ... but to use as standalone only... you need it

in the 1st message in this topic there is a test page that works as standalone MOD, the test_topMessages.asp file has this code:


<!--#INCLUDE FILE="config.asp"-->

<!--#include file="inc_func_common.asp"-->
<%
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Errors.Clear
Err.Clear
my_Conn.Open strConnString


TABLE_TYPE_ROWS = 2 ' Number of rows ( Can't be <= 0 ) >> please read note
TABLE_TYPE_COLS = 5 ' Number of columns ( Can't be <= 0 ) >> please read note

if len(request.QueryString("rows")) > 0 then
if isNumeric(request.QueryString("rows")) then
TABLE_TYPE_ROWS = cInt(request.QueryString("rows"))
end if
end if

if len(request.QueryString("cols")) > 0 then
if isNumeric(request.QueryString("cols")) then
TABLE_TYPE_COLS = cInt(request.QueryString("cols"))
end if
end if
%>
<!--#include file="inc_topmessages2.asp"-->
<%
my_Conn.close()
set my_Conn = nothing
%>


the inc_topmessages2.asp file only differes from the original code on lines 22 and 23 where they are commented like:

'TABLE_TYPE_ROWS = 10 ' Number of rows ( Can't be <= 0 ) >> please read note
'TABLE_TYPE_COLS = 1 ' Number of columns ( Can't be <= 0 ) >> please read note
<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 02 March 2008 16:42:49
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 02 March 2008 :  16:42:15  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Unfortunately I was trying that as you posted...

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/forum/test_topMessages.asp, line 106
<

Switch the order of your title tags
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 02 March 2008 :  16:45:55  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
Are you getting any ROWs???

please run the SQL against you database using PHPAdmin for the mySQL database, just run the query and see what is it returning, the SQL code for mySQL is:


SELECT
a.CAT_ID, a.FORUM_ID, a.TOPIC_ID, a.T_SUBJECT, a.MSG_ID, a.MSG, a.MSG_DATE, a.MEMBER_ID, a.M_NAME

FROM (
SELECT t.CAT_ID, t.FORUM_ID, t.TOPIC_ID, t.T_SUBJECT, '' AS MSG_ID, t.T_MESSAGE AS MSG, t.T_DATE AS MSG_DATE, m.MEMBER_ID, m.M_NAME
FROM FORUM_MEMBERS m INNER JOIN FORUM_TOPICS t ON m.MEMBER_ID = t.T_AUTHOR

UNION ALL

SELECT t.CAT_ID, t.FORUM_ID, t.TOPIC_ID, t.T_SUBJECT, r.REPLY_ID AS MSG_ID, r.R_MESSAGE as MSG, r.R_DATE as MSG_DATE, m.MEMBER_ID, m.M_NAME
FROM (FORUM_TOPICS t INNER JOIN FORUM_REPLY r ON t.TOPIC_ID = r.TOPIC_ID) INNER JOIN FORUM_MEMBERS m ON r.R_AUTHOR = m.MEMBER_ID
) a

INNER JOIN FORUM_FORUM f ON f.FORUM_ID = a.FORUM_ID

WHERE f.F_PRIVATEFORUMS = 0
ORDER BY MSG_DATE DESC
LIMIT 20
<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 02 March 2008 17:42:28
Go to Top of Page

leesh695
Junior Member

101 Posts

Posted - 02 March 2008 :  17:13:48  Show Profile  Reply with Quote
This is my error

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

[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-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 '1 CAT_ID, FORUM_ID, TOPIC_ID, T_SUBJECT, MSG_ID, MSG, MSG_DATE, MEMBER_ID, M_NAM' at line 1

/oriphan/forum/inc_topMessages.asp, line 99
<
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 02 March 2008 :  17:49:23  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
leesh695

the code does not have any errors ... as I changed SELECT LIMIT 20 a.... TO SELECT a... LIMIT 20

cause I found that mySQL uses the LIMIT at the end of the code not in front of the SELECT keyword

I installed mySQL and run it into a fresh installation of the SNITZ forum ...

no errors what so ever

testing FORUM
http://www.ga-paneuropean.com/mysql/

testing MOD under mySQL
http://www.ga-paneuropean.com/mysql/test_topMessages.asp

query window:
<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 02 March 2008 17:53:31
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 02 March 2008 :  18:11:01  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Don't know. It won't work.

The file you link to doesn't have the word LIMIT in it anywhere by the way.

No big deal, I appreciate you trying. Maybe there's something I've done before conflicting with it.<

Switch the order of your title tags
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 02 March 2008 :  19:51:16  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
the code does not have the word LIMIT eighter TOP, this is made by the line 103

objRec.Open TopSQL(sqlstr, cStr(TABLE_TYPE_TOP)), My_Conn

you can check the SQL Query uncomment lines 99 and 100

and change them to:


response.Write("<hr/>" & TopSQL(sqlstr, cStr(TABLE_TYPE_TOP)) & "<hr/>")
response.flush()
<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 02 March 2008 19:54:22
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07