Filtering out Private Forums

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: Filtering out Private Forums

Re: Filtering out Private Forums

by Murdock » Mon Jul 11, 2022 3:59 am

I just added the line to the sql...and that did work...So I went to post a note in a special forum I have for just my site customization notes...and after posting it, I noticed the new post didn't appear on the front page. That told me, I must have set that up as a not visible forum when I set up w3all...

and I saw where you said...
axew3 wrote:but there is an option into plugin admin page, to exclude directly forums on widgets
I looked and looked before, but I couldn't find the option. I thought there was one, but I went for the code as the quick fix.

So I went back clicking in WP, and found the WP w3all settings page, and the setting I was looking for was right there!

(I added the 18 before the screenshot.)
Screenshot 2022-07-10 234707.PNG.jpg
Screenshot 2022-07-10 234707.PNG.jpg (52.96 KiB) Viewed 2151 times
Thanks for pointing me in the right direction!
Murdock

Re: Filtering out Private Forums

by Murdock » Mon Jul 11, 2022 3:25 am

Excellent!

It worked perfectly!!!

Thanks! / Grazie!

Murdock

Re: Filtering out Private Forums

by axew3 » Thu Jul 07, 2022 6:01 pm

for widgets:
/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php

Code: Select all

private static function last_forums_topics($ntopics = 10){

Code: Select all

   $topics = $w3all_phpbb_connection->get_results("SELECT T.*, P.*, U.*
    FROM ".$w3all_config["table_prefix"]."topics AS T
    JOIN ".$w3all_config["table_prefix"]."posts AS P on (T.topic_last_post_id = P.post_id and T.forum_id = P.forum_id)
    JOIN ".$w3all_config["table_prefix"]."users AS U on U.user_id = T.topic_last_poster_id
    WHERE T.topic_visibility = 1
    ".$topics_x_ugroup."
    AND P.post_visibility = 1
    ORDER BY T.topic_last_post_time DESC
    LIMIT 0,$ntopics");
may change this into:

Code: Select all

   $topics = $w3all_phpbb_connection->get_results("SELECT T.*, P.*, U.*
    FROM ".$w3all_config["table_prefix"]."topics AS T
    JOIN ".$w3all_config["table_prefix"]."posts AS P on (T.topic_last_post_id = P.post_id and T.forum_id = P.forum_id)
    JOIN ".$w3all_config["table_prefix"]."users AS U on U.user_id = T.topic_last_poster_id
    WHERE T.topic_visibility = 1
    ".$topics_x_ugroup."
    
    AND T.forum_id != 18
    
    AND P.post_visibility = 1
    ORDER BY T.topic_last_post_time DESC
    LIMIT 0,$ntopics");
but there is an option into plugin admin page, to exclude directly forums on widgets
while if you want to edit by groups the query, may the query to edit is this (same function):

Code: Select all

// this need to be adjusted if 'phpBB default schema' isn't the used one
$gaf = $w3all_phpbb_connection->get_results("SELECT DISTINCT ".$w3all_config["table_prefix"]."acl_groups.forum_id FROM ".$w3all_config["table_prefix"]."acl_groups
 WHERE ".$w3all_config["table_prefix"]."acl_groups.auth_role_id != 16
  AND ".$w3all_config["table_prefix"]."acl_groups.group_id = ".$ug."");

Filtering out Private Forums

by Murdock » Mon Jul 04, 2022 4:49 pm

Hi,

I tried searching, but probably because of the common words, I couldn't find this specific topic...

Does anyone know how to filter out specific private forums from being displayed in the widget? I have a private 'Admins Only' forum (and others), and I just noticed that the WP W3all phpBB integration widget is displaying the posts in that forum. In other pbpBB plugins (prior to wordpress), I have been able to select forms, and indicate that I don't want them to appear, unless the user is logged in and has that security. At this point, I don't mind if the security is not applied, I would just like to exclude those forums. If I had to, I could go in and add "ForumID not in ('18')", but I am not sure where to look. Any suggestions?

Thanks,
Murdock

Top