Author |
Topic |
|
bax
Junior Member
141 Posts |
Posted - 20 August 2002 : 05:51:25
|
OK, I haven't had a chance to get into the whole groups thing yet. Our forum is going to be a section off the main page of the site. As a teaser to get people to the forums, we want to list the three most recent topics in a box on the main page. Now before, I could simply have done something like
select top 3 * from forum_topics order by t_date desc
However, that won't necessarily work anymore, because of the whole permissions implementations. If I were to do this, I might be displaying something that really is a topic in a protected forum. How can I get the three most recent posts from ALL public forums? Does this SQL already exist in one of the scripts?
|
|
Hamlin
Advanced Member
United Kingdom
2386 Posts |
Posted - 20 August 2002 : 05:55:18
|
I cant remember off the top of my head but there ws a database field that states what type the forum is. i.e. private etc, its was a number, I use to check that number, if it was over 0 then it was private or whatever.
That may be wrong as I'm not at my own computer and cant check what I did
It still seems to work on my web site after the upgrade as well, so I assume its the same setup |
Edited by - Hamlin on 20 August 2002 05:57:23 |
|
|
bax
Junior Member
141 Posts |
Posted - 20 August 2002 : 06:03:23
|
In Forum_forum I see that there is f_privateForum and f_type. What is f_type here? I assume f_privateForum is 0 if public, 1 if private. However, if I just filter on this, will that work? What is f_type? |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
bax
Junior Member
141 Posts |
Posted - 20 August 2002 : 06:05:51
|
OK, looking at db for 3.305, f_privateForums possible values are:
0 = Normal, 1 = Userlist Protection, 2 = Password Protection, 3 = Both, 4 = Members Only
Now, does that mean NO group forums will have p_privateforum = 0? |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 20 August 2002 : 06:06:47
|
quote: Originally posted by bax
In Forum_forum I see that there is f_privateForum and f_type. What is f_type here? I assume f_privateForum is 0 if public, 1 if private. However, if I just filter on this, will that work? What is f_type?
F_TYPE: 0 = Normal, 1 = URL |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
bax
Junior Member
141 Posts |
Posted - 20 August 2002 : 06:13:22
|
So, something like this should do the trick then..Does this code already exist somewhere in a function that I can just call?
select top 3 ft.cat_id, ft.forum_id, ft.topic_id, ft.t_subject from forum_topics ft inner join forum_forum ff on ft.forum_id = ff.forum_id where ff.f_privateForums = 0 order by ft.t_date desc |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
|
Topic |
|