Have the most recent 10 posts show at login? - Posted (1455 Views)
Starting Member
cbsarge
Posts: 20
20
When we log into our forum it just shows the .....well.... forum. I've had a request to possible have the most recent 10 posts show. Is it possible to have a section show at the top or side of the page with the most recent 10 posts? Is there already a mod for this? We use Access for our database and are running the current version of Snitz.
Thanks for any help! bigsmile
<moved from="Help: General / Current Version (v3.4.xx)" by="Shaggy" /><
"if we don't measure it, we can't lie about it"
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Advanced Member
Etymon
Posts: 2396
2396
Have a look at this and see if it is what you want: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=65954
<
Posted
Posted
Starting Member
cbsarge
Posts: 20
20
Isn't that only for a forum using SQL as it's database? I'm using Access as my database.<
"if we don't measure it, we can't lie about it"
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
I could be wrong, but I don't see anything that is database-specific in the code. It looks like it should run fine reguardless of your database type.<
Posted
Starting Member
cbsarge
Posts: 20
20
Isn't this:
Code:

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;"

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

Set objRec = Server.CreateObject ("ADODB.Recordset")
objRec.Open TopSQL(sqlstr, cStr(TABLE_TYPE_TOP)), My_Conn
a SQL query of some kind?<
"if we don't measure it, we can't lie about it"
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
All database use SQL the language to communicate. Microsoft has a database server technology called "Microsoft SQL Server", and is commonly abbreviated either "MS SQL Server" or even more simply "SQL Server". To add to the confusion, a number of other database servers have the acronym "SQL" in their name - i.e. MySQL.
More information:

http://www.w3schools.com/sql/default.asp

http://en.wikipedia.org/wiki/Sql<
Posted
Starting Member
cbsarge
Posts: 20
20
So should I just be able to post the inc_topMessages.asp file on my forum and then try to browse to it to see if it works? When I try this it times out and says:
Code:

Active Server Pages error 'ASP 0113' 
Script timed out

/inc_topMessages.asp

The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.
<
"if we don't measure it, we can't lie about it"
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
Yes, you should be able to use it as per the directions. It looks like it was intended to be included on a page, not browsed to on its own.<
Posted
Junior Member
balexandre
Posts: 418
418
just follow the instructions on the MOD, that's all

SQL = Strutured Query Language, if you google it you would know, so, it is a way to query databases, no matter what they are, mySQL, Access, Oracle, Postgree, etc etc etc

Microsoft SQL is one type of database as well Microsoft Access or other, and they all use SQL to query the databases, there is however, instructions that are only available to each database, but they are share the same root, and for that, simple queries are almost the same to all.
The functoin TopSQL makes sure that you can use this query in Access, MS SQL and mySQL.<
Posted
Advanced Member
Etymon
Posts: 2396
2396
The variations of SQL are similar to the variations in English. The basic language structure (English, SQL) is there that most people can understand to converse with each other, but depending on the location (who makes the dialect, who makes the database) then the language varies a little depending on who is using it, for what, and where.<
 
You Must enter a message