archtype
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Apr 30, 2005
Posts: 9
|
Posted:
Mon Jul 18, 2005 12:21 pm |
|
I am going the long way around to accomplish something. I wanted to try to create a prayer request module that would have a scrolling block for the main page but don't know PHP and am teaching myself. Having said that, in the meantime, I decided to create a forum to enter names in the title for prayer requests and scroll them using a scrolling forum block but my problem is this: I only want the forum block to scroll from this forum only. How could I modify the code to accomplish this. It, for this purpose, would be much easier to specify which forums to show rather than which ones to hide.
Any help is much appreciated!
Thanks! |
|
|
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Mon Jul 18, 2005 12:49 pm |
|
You will need to add a WHERE clause to your SQL statement, limiting the forum id. It will be something like
Of course the '99' will need to be the forum_id of the forum you actually want. |
Last edited by Raven on Sat Aug 06, 2005 6:03 am; edited 1 time in total |
|
archtype
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jul 18, 2005 6:55 pm |
|
OK, that worked! Thank you very much! Next question/problem. I am using a different scrolling block for the Main forums scroll. Can someone take a look at it and help me out with it? I am trying to make it not display one forum, just the opposite of my first request. I have tried the NOT IN statement and can't seem to get it right. I would be very appreciative if anyone could take a look and point me in the right direction. Thanks very much and here's a snippet of the query code:
Code:$result1 = $db->sql_query("SELECT
t.topic_id, t.topic_last_post_id, t.topic_title,
f.forum_name, f.forum_id,
u.username, u.user_id,
p.poster_id, FROM_UNIXTIME(p.post_time,'%b %d, %Y at %T') as post_time
FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f
LEFT JOIN ".$prefix."_bbposts p ON (p.post_id = t.topic_last_post_id)
LEFT JOIN ".$prefix."_users u ON (u.user_id = p.poster_id)
WHERE t.forum_id=f.forum_id AND f.auth_view=0
ORDER BY t.topic_last_post_id DESC
LIMIT 20");
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id, $username, $user_id, $poster_id, $post_time) = $db->sql_fetchrow($result1)) {
|
EDIT:
Nevermind. I figured it out. Here is the query I used to fix it. If anyone sees anything wrong with it, please let me know.
Thanks and here's the query:
Code:$result = $db->sql_query("SELECT t.topic_id, t.topic_last_post_id,
t.topic_title, f.forum_name, f.forum_id, u.username, u.user_id,
p.poster_id, FROM_UNIXTIME(p.post_time,'%b %d, %Y at %T') as post_time FROM
".$prefix."_bbtopics t, ".$prefix."_bbforums f LEFT JOIN
".$prefix."_bbposts p ON (p.post_id = t.topic_last_post_id) LEFT JOIN
".$prefix."_users u ON (u.user_id = p.poster_id) WHERE
t.forum_id=f.forum_id AND f.auth_view=0 AND f.forum_id !='14' ORDER BY
t.topic_last_post_id DESC LIMIT 20");
|
|
|
|