vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Help filtering moderated posts? (https://vborg.vbsupport.ru/showthread.php?t=143883)

upnorth 04-02-2007 07:25 PM

Help filtering moderated posts?
 
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/showthrea...02#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 07:37 PM

You'll need to add
Code:

AND(post.visible==1)
to the query, or something similar. It's hard to say without the query.

upnorth 04-12-2007 07:48 PM

Quote:

Originally Posted by WetWired (Post 1218629)
You'll need to add
Code:

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

Code:

$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
Code:

$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
Code:

$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 04:51 AM

it should be p.visible=1

upnorth 04-13-2007 01:39 PM

Quote:

Originally Posted by WetWired (Post 1226473)
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 02: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 03: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 04:05 PM

Oh, I didn't realize that threads had a separate visibility. Try
Code:

AND f.visible AND p.visible

upnorth 04-13-2007 04:15 PM

Quote:

Originally Posted by WetWired (Post 1226883)
Oh, I didn't realize that threads had a separate visibility. Try
Code:

AND f.visible AND p.visible

sweet. you were close! I added
Code:

AND t.visible=1 AND p.visible=1
and it looked like it was successful!

THANKS! for the help WetWired


All times are GMT. The time now is 09:26 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01878 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete