View Full Version : Help filtering moderated posts?
upnorth
04-02-2007, 08:25 PM
Not sure this is the place to ask this but I'm at a loss and really need a hand. I'm running this mod and posted my question
https://vborg.vbsupport.ru/showthread.php?p=1218602#post1218602
and it works great accept that it displays posts that have not yet been moderated? Need someone to look at the SQL and see what needs to be added so that posts currently under moderation do not get queried.
Anyone up for the challange and or able to provide help? :D
WetWired
04-02-2007, 08:37 PM
You'll need to add
AND(post.visible==1)
to the query, or something similar. It's hard to say without the query.
upnorth
04-12-2007, 08:48 PM
You'll need to add
AND(post.visible==1)
to the query, or something similar. It's hard to say without the query.
I think the query part of the code is as follows
$NewestNews = $db->query("
select t.*,p.pagetext, f.title as ft
from ".TABLE_PREFIX."thread t
left join ".TABLE_PREFIX."post p on(p.postid=t.firstpostid)
join ".TABLE_PREFIX."forum f on(f.forumid=t.forumid)
where f.forumid != 48 AND f.forumid != 42
order by dateline desc
limit 0,$Amount");
I tried both
$NewestNews = $db->query("
select t.*,p.pagetext, f.title as ft
from ".TABLE_PREFIX."thread t
left join ".TABLE_PREFIX."post p on(p.postid=t.firstpostid)
join ".TABLE_PREFIX."forum f on(f.forumid=t.forumid)
where f.forumid != 48 AND f.forumid != 42 AND p.visible==1
order by dateline desc
limit 0,$Amount");
and
$NewestNews = $db->query("
select t.*,p.pagetext, f.title as ft
from ".TABLE_PREFIX."thread t
left join ".TABLE_PREFIX."post p on(p.postid=t.firstpostid)
join ".TABLE_PREFIX."forum f on(f.forumid=t.forumid)
where f.forumid != 48 AND f.forumid != 42 AND post.visible==1
order by dateline desc
limit 0,$Amount");
and neither worked? Have I provided enough of the code?
WetWired
04-13-2007, 05:51 AM
it should be p.visible=1
upnorth
04-13-2007, 02:39 PM
it should be p.visible=1
well we are making a little progress. I made the changes and it didn't error out this time but it didn't filter it either? If I change p.visible=0 then none of the posts show whether they need to be moderated or not. If I enter it as p.visible=1 then all show whether they need to be moderated or not?
WetWired
04-13-2007, 03:54 PM
Hmm, to the extent of my experiance, it should work, but I haven't dealt with moderated stuff in a long time. You'd probably be better helped by someone else.
upnorth
04-13-2007, 04:31 PM
I checked the db thread table and visibility for my test thread that needs to be moderated is set to 0 so it must be something with the query string?
Anyone else out there have any ideas?
WetWired
04-13-2007, 05:05 PM
Oh, I didn't realize that threads had a separate visibility. Try AND f.visible AND p.visible
upnorth
04-13-2007, 05:15 PM
Oh, I didn't realize that threads had a separate visibility. Try AND f.visible AND p.visible
sweet. you were close! I added
AND t.visible=1 AND p.visible=1
and it looked like it was successful!
THANKS! for the help WetWired
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.