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 :  20:12:04  Show Profile  Visit bobby131313's Homepage  Reply with Quote
Here's what comes up...

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;

http://www.coincommunity.com/forum/test_topMessages.asp<

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

balexandre
Junior Member

Denmark
418 Posts

Posted - 02 March 2008 :  21:05:24  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
you don't have the right version (last version is 1.3, check you file, refresh the code page - maybe you are getting a cached version), but still LIMIT / TOP is only used to get the the first xx messages, without it, you will get every message.

but you still have an error, without having access to the DB I can not help you more, I testing under MS SQL, MS Access and mySQL with a clean Snitz Forum, and all work fine, maybe someone else can help you on this, if I got the same error... but I get no errors whatsoever.<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"


Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 02 March 2008 :  21:33:44  Show Profile  Visit bobby131313's Homepage  Reply with Quote
quote:
' 1.3 02.03.08 Updated with TopSQL() so it runs in mySQL as well (>4.x)


Is right out of the file on the server.

It's OK, like I said, I appreciate you trying.<

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

kolucoms6
Average Member

845 Posts

Posted - 12 March 2008 :  20:46:05  Show Profile  Reply with Quote
Suppose I have One message and 3 ppl replied to same message in last 5 mins.

So, it shows 3 different entries... which is an ODD way...

Cant we get it group by message ?<
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 13 March 2008 :  02:40:07  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
The MOD is done to include topic messages and replies to those messages!

that is the real "Last XX Messages", if you want only the messages in topics with no replies showing, all you need is to edit the SQL Query to suit your needs.

in your example, the MOD NEEDS to show 4 messages, the 1st message from the topic and the other 3 messages, unless it's a private forum, and that will not appear in the mod <

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 13 March 2008 02:42:15
Go to Top of Page

kolucoms6
Average Member

845 Posts

Posted - 13 March 2008 :  11:27:29  Show Profile  Reply with Quote
Can u plz post the SQL for the same ?<
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 13 March 2008 :  14:03:02  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
to work with only TOPICS and not REPLIES:

search for:
sqlstr = "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;"


and replace that for this:
sqlstr = "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 " & _
") a " & _
"INNER JOIN FORUM_FORUM f ON f.FORUM_ID = a.FORUM_ID " & _
"WHERE f.F_PRIVATEFORUMS = 0 " & _
"ORDER BY MSG_DATE DESC;"


have in mind that this query if for: Last XX Topics and not Last XX Messages.

hope it helps.<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"



Edited by - balexandre on 13 March 2008 14:05:59
Go to Top of Page

kolucoms6
Average Member

845 Posts

Posted - 13 March 2008 :  16:50:16  Show Profile  Reply with Quote
Worked.

Cool

Thanks for the Support.<
Go to Top of Page

balexandre
Junior Member

Denmark
418 Posts

Posted - 14 March 2008 :  11:29:17  Show Profile  Visit balexandre's Homepage  Send balexandre an ICQ Message  Reply with Quote
always glad to help the community<

Bruno Alexandre
(Strøby, DANMARK)

"a Portuguese in Danmark"


Go to Top of Page

puzo
Junior Member

Israel
417 Posts

Posted - 19 March 2008 :  17:02:57  Show Profile  Visit puzo's Homepage  Reply with Quote
Thank you, very useful.<


Go to Top of Page

championc
Starting Member

10 Posts

Posted - 06 April 2008 :  18:36:18  Show Profile  Reply with Quote
Hi Bruno,

Super job. I have installed this against my mySQL installation and it worked perfectly first time.

I wonder if you have ever done a further mod to show the Forum Name - if not, what extra code would I need to do this. I know I would need to use the t.FORUM_ID to read the forum name (F_SUBJECT) from the forum_forum table


C
<
Go to Top of Page

championc
Starting Member

10 Posts

Posted - 08 April 2008 :  16:27:52  Show Profile  Reply with Quote
I worked it out - dead easy when it came down to it. I simply replaced the top line of the strsql from
sqlstr = "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 " & _

to
sqlstr = "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, f.FORUM_ID, f.F_SUBJECT " & _

You can then use objRec.fields("F_SUBJECT") to retrieve the category description


C
<
Go to Top of Page

gjs
Starting Member

5 Posts

Posted - 03 June 2009 :  15:47:38  Show Profile  Reply with Quote
Hello.

I am using this cool mod on my forum, but now also want to integrate the events calendar mod.

However, the posts that go in the events calendar also come up in the most recent messages.

Can you give some modified SQL to exclude the posts added to the events calendar from coming up in the top x messages?

Many Thanks,



Greg.
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 04 June 2009 :  20:56:17  Show Profile  Visit Etymon's Homepage  Reply with Quote
You may want to contact the author of this via e-mail through his profile. He may not see your question as quickly as you are perhaps needing the help.
Go to Top of Page

gjs
Starting Member

5 Posts

Posted - 05 June 2009 :  16:36:47  Show Profile  Reply with Quote
Thanks for the suggestion - I'll try that now.

Regards,



Greg
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.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07