vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Forum Display Enhancements - Users can see own moderated threads prior to approval (https://vborg.vbsupport.ru/showthread.php?t=277604)

MoMan 01-25-2012 11:00 PM

Users can see own moderated threads prior to approval
 
1 Attachment(s)
On my forum, to prevent spam, threads from new users are checked for common spam keywords, including links. If any such keywords are found, the thread gets auto-moderated.

In order to prevent double-posting, I decided it was necessary for users to be able to see their own moderated threads in the forum listings before they get approved. Nobody reads the redirection message shown, so I hope that this will be more effective in preventing duplicates.

Moderated threads from unregistered users will not be shown to those users.

Open forumdisplay.php,

Find:
PHP Code:

        if (!($forumperms $vbulletin->bf_ugp_forumpermissions['canseedelnotice']))
        {
            
$visiblethreads " AND visible = 1 ";
        }
        else
        {
            
$visiblethreads " AND visible IN (1,2)";
        } 

Replace with:
PHP Code:

        if ($vbulletin->userinfo['userid'])
        {
            if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canseedelnotice']))
            {
                
$visiblethreads " AND (visible = 1 OR (visible = 0 AND postuserid = " intval($vbulletin->userinfo['userid']) . "))";
            }
            else
            {
                
$visiblethreads " AND (visible IN (1,2) OR (visible = 0 AND postuserid = " intval($vbulletin->userinfo['userid']) . "))";
            }
        }
        else
        {
            if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canseedelnotice']))
            {
                
$visiblethreads " AND visible = 1 ";
            }
            else
            {
                
$visiblethreads " AND visible IN (1,2)";
            }
        } 

Note: if you want to allow users to see their own moderated posts as well, see post #2.

PhilG 01-27-2012 01:03 PM

I just installed this and works great until you click on the link to view the thread. Then is shows the default no thread page because of permissions.. If you edit showthread.php the follow will solve that:

Find:
Code:

if ((!$thread['visible'] AND !can_moderate($thread['forumid'], 'canmoderateposts'))
Replace with:
Code:

if ((!$thread['visible'] AND !can_moderate($thread['forumid'], 'canmoderateposts') AND ($thread['postuserid'] != $vbulletin->userinfo['userid'] OR !$vbulletin->userinfo['userid']))
Find:
Code:

                                AND post.visible = 1
Replace with:
Code:

                                AND (post.visible = 1 OR (post.visible = 0 AND post.userid = " . intval($vbulletin->userinfo['userid']) . "))

inciarco 01-27-2012 06:31 PM

Interesting Code, and the Detail for the Thread View. :up:

Is it Possible to Apply it Also to the Posts (Postbit) so that the User can See His/Her Own Posts Prior to Approval? (Not only New Threads but Also New Posts?) :confused:

Something Like: Users can see own moderated posts prior to approval. ;)

My Best Regards and Thank You For Sharing this Code and the Additional Code Edit. :up:

:)

MoMan 01-28-2012 03:34 AM

See post #2, I guess. I didn't originally intend to extend this feature to posts, but now that I think about it, there's really no reason not to.

MoMan 01-28-2012 03:42 AM

I'd like to add one thing to the code for the posts: if you want guests to never be able to see moderated content, change

PHP Code:

$thread['postuserid'] != $vbulletin->userinfo['userid'

to

PHP Code:

($thread['postuserid'] != $vbulletin->userinfo['userid'] OR !$vbulletin->userinfo['userid']) 

In the first part of the code in post #2.

PhilG 01-28-2012 04:21 AM

Quote:

Originally Posted by MoMan (Post 2293317)
I'd like to add one thing to the code for the posts: if you want guests to never be able to see moderated content, change

I updated the code for post #2 ;)

inciarco 01-28-2012 05:00 PM

Quote:

Originally Posted by MoMan (Post 2293317)
I'd like to add one thing to the code for the posts: if you want guests to never be able to see moderated content, change
... to ...
In the first part of the code in post #2.

Quote:

Originally Posted by PhilG (Post 2293325)
I updated the code for post #2 ;)

Thank You Very Much, I'll Try It and I'll Tell You How It Works. :up:

My Best Regards To Both Of You MoMan and PhilG . ;)

:)

inciarco 01-28-2012 06:55 PM

Both Codes Work Fine, but there is a Bug with the Pagenavs. The Pagenav generator isn't taking in Consideration the New Displayed Threads and Posts and the Threads and Posts on the Last Page are Lost, the Link to the Last Page isn't Displayed and there is Not Access to It Not Even by Writing the Number of the Page, it Goes to the Last One Showed but the Last Threads and Posts on that Last Page are Not Accesible. :confused:

What Additional Code Should be Edited for the Pagenavs on forumdisplay and on showthread to Consider the Moderated Threads and Posts of the User and to Access the Last Page (or Pages if there are Many Threads of Posts Moderated)? :confused:

I Also Noticed on the forumdisplay that for Moderated Posts the threadbit Don't Display the Last Message if is a Moderated One. What Additional Code Should be Edited for them to Display? :confused:

I Also Noticed that on the search Page the Moderated Threads and Posts are Not Displayed. What Additional Code Should be Edited for them to Display? :confused:

My Best Regards. ;)

:)

bestone96 02-29-2012 10:30 AM

thanks a lot

Meestor_X 04-22-2012 05:15 PM

Will this work on 4.x?

xorex 04-25-2012 09:10 AM

<a href="https://vborg.vbsupport.ru/member.php?u=115402" target="_blank">MoMan</a> thank you, may be posible also make it editable for own moderated posts and threads prior to approval ?

wangyu1314 06-28-2012 09:32 AM

thank you ,it's great

zardos 02-11-2013 08:20 AM

Anyone know how to make this running on VB 3.8.4?
Need to make the posts and threads visible to moderated users.

Code:

        if (!can_moderate($forumid, 'canmoderateposts'))
        {
                if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canseedelnotice']))
                {
                        $visiblethreads = " AND visible = 1 ";
                }
                else
                {
                        $visiblethreads = " AND visible IN (1,2)";
                }
        }
        else
        {
                $visiblethreads = " AND visible IN (0,1,2)";
        }

I only have that part there. Nothing found about post #2 in the forumdisplay.php in 3.8.4 which is why I asked:
Code:

if ((!$thread['visible'] AND !can_moderate($thread['forumid'], 'canmoderateposts'))

Skyrider 03-04-2014 08:46 AM

There a way this code can be converted to vBulletin 4? I tried it myself, but I keep getting a blank page. The code:

Code:

if (!can_moderate($forumid, 'canmoderateposts'))
        {

is I believe new in vBulletin 4 just above:

Code:

if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canseedelnotice']))
                {

as I don't think its in vBulletin 3.

Calystos 03-07-2014 01:51 PM

O/P and S/P codes both work perfectly as-is in vb4.2.2. I edited the forumdisplay.php and showthread.php files accordingly, and all 3 changes were found and made and tested as-is and works, :-)

Meestor_X 10-18-2014 05:16 PM

Works great on 4.2.2! Thank you.

Ig@r 06-13-2016 04:29 PM

Is there any way to make this mod a product?

MarkFL 06-13-2016 05:17 PM

1 Attachment(s)
Quote:

Originally Posted by Ig@r (Post 2572010)
Is there any way to make this mod a product?

Yes, I have attached a product that does the same thing (including post #2)...I haven't tested it, so please let me know if it works for you, and if you would like any added features. :)

You will have to enable the product in its settings.

Ig@r 06-13-2016 05:25 PM

Quote:

Originally Posted by MarkFL (Post 2572012)
Yes, I have attached a product that does the same thing (including post #2)...I haven't tested it, so please let me know if it works for you, and if you would like any added features. :)

Thanks Mark, I will give this a try! :up:

Ig@r 06-13-2016 08:24 PM

OK, installed the product and tested, the users now able to see their moderated threads, unfortunately the second part is't working and they can not see their moderated posts yet.
Another thing I've discovered, that users are not able to post a reply in their own moderated thread if they decide to add something to it.

MarkFL 06-13-2016 09:06 PM

Quote:

Originally Posted by Ig@r (Post 2572014)
OK, installed the product and tested, the users now able to see their moderated threads, unfortunately the second part is't working and they can not see their moderated posts yet.
Another thing I've discovered, that users are not able to post a reply in their own moderated thread if they decide to add something to it.

Okay, I will do some testing then and see if I can get everything to function correctly. :)

MarkFL 06-14-2016 12:43 AM

1 Attachment(s)
I fixed the error preventing the db query from working, and have attached the updated product.

Allowing users to reply to their own moderated threads isn't something this was ever intended to do, and so I will have to figure out how to make that happen. Once I have, I will post. :)

MarkFL 06-14-2016 03:41 AM

1 Attachment(s)
Okay, this updated version will allow users to reply to their own moderated threads, and to edit their own moderated posts. :)

Ig@r 06-14-2016 04:16 PM

Quote:

Originally Posted by MarkFL (Post 2572029)
Okay, this updated version will allow users to reply to their own moderated threads, and to edit their own moderated posts. :)

Thank you very much, Mark :up:
It is working on 4.2.3
Because I have AJAX function turned on the new post appers only after full page refresh, before that user still sees "Your post will not be visible until a moderator has approved it for posting" message. Other then that the hack works great. Thanks again.

MarkFL 06-14-2016 04:23 PM

On my dev site, I also have the "Quick Reply" enabled, and the new post shows up immediately. This is when a thread has been put into the moderation queue by a mod/admin. How are threads/posts being put into the moderation queue on your site?

Perhaps if I know this, I can duplicate the conditions you have and fix this remaining issue. :)

MarkFL 06-15-2016 01:31 AM

Quote:

Originally Posted by Ig@r (Post 2572056)
Thank you very much, Mark :up:
It is working on 4.2.3
Because I have AJAX function turned on the new post appers only after full page refresh, before that user still sees "Your post will not be visible until a moderator has approved it for posting" message. Other then that the hack works great. Thanks again.

Are you by chance using my automated post reporter product, that puts posts/threads into the moderation queue automatically, if a user posts certain flagged words, or necro-posts?

The reason I ask is that I do get the behavior you describe with that product (which is by design), and what I can do is incorporate this feature (allowing users to see/edit their own moderated posts) into the automated post reporter, and then if you elect to allow users to see/edit their own moderated posts, I can turn off the error message.

The automated post reporter product is in need of an overhaul as it was the first product I wrote, and so look for an upgrade including this feature at some point (I don't want to give any kind of timeline at this point). :)

Ig@r 06-15-2016 07:41 PM

I have special user group with settings "Follow Forum Moderation Rules If no, posts are always placed into moderation queue" set to no. For my testing I used an account of this type.

blah100 07-01-2016 03:12 PM

Quote:

Originally Posted by MarkFL (Post 2572070)
Are you by chance using my automated post reporter product, that puts posts/threads into the moderation queue automatically, if a user posts certain flagged words, or necro-posts?

The reason I ask is that I do get the behavior you describe with that product (which is by design), and what I can do is incorporate this feature (allowing users to see/edit their own moderated posts) into the automated post reporter, and then if you elect to allow users to see/edit their own moderated posts, I can turn off the error message.

The automated post reporter product is in need of an overhaul as it was the first product I wrote, and so look for an upgrade including this feature at some point (I don't want to give any kind of timeline at this point). :)

I can confirm that it's due to another modification which moderates based upon keywords (in my case it's Glowhost's Spam-o-matic). Sounds like your product does the same thing. I always found it better to moderate based upon keywords rather than having an entire board's threads/posts go into moderation via vbulletin's settings. I mean who has time to do all that approving? So I used glowhost's spam-o-matic to only look for spam keywords in order to put posts/threads into moderation and when I tested your updated product by entering a bad keyword and it still gave me that annoying "Your post will not be visible until a moderator has approved it for posting" popup, and even further it wouldn't let me edit the post after I did a manual refresh.

I'd gladly switch to your post reporter product when you update it to work with allowing users to see and edit their own moderated posts/threads without getting that annoying popup about needing a moderator approval first. To me it just seems better for members not to see that popup since it only annoys them. It's better that when they post something that is moderated that the post/thread appears and is editable as if nothing is wrong. While in the background moderators efficiently approve the post/threads without the user being none the wiser that it was moderated to begin with. It'll also cut down on members making duplicate posts/threads to bypass the moderation.

Stratis 02-25-2017 03:22 PM

Quote:

Originally Posted by MarkFL (Post 2572029)
Okay, this updated version will allow users to reply to their own moderated threads, and to edit their own moderated posts. :)


Is there possible Mark, that they can see attached images they upload?
Now attached images dos not show up. I do not have in settings moderate attachments. I realized this because 4-5 members try to upload image again and again as they do not see the image, it shows with the X. After approve is ok.
As admins - Mods we can see the image.


Thank you very much

Meestor_X 07-26-2017 01:48 PM

I used this hack in the past by modifying the files as per the O/P and 2nd Post. On my new forum (4.2.5) I tried doing it using the XML product, and that's doesn't seem to work.
I'll uninstall the product and try the manual modification again.

Meestor_X 08-04-2017 04:04 PM

Ok, in testing the product further, it seems moderated users can see their own posts, but not threads they started.
So it works for posts, but not for threads.
Any suggestions on how to fix this in the product? It would be nice to keep it as a product rather than having to edit the source files directly as before...

MarkFL 08-04-2017 05:22 PM

Quote:

Originally Posted by Meestor_X (Post 2589165)
Ok, in testing the product further, it seems moderated users can see their own posts, but not threads they started.
So it works for posts, but not for threads.
Any suggestions on how to fix this in the product? It would be nice to keep it as a product rather than having to edit the source files directly as before...

Are you talking about the product I uploaded?

Meestor_X 08-04-2017 05:27 PM

Quote:

Originally Posted by MarkFL (Post 2589169)
Are you talking about the product I uploaded?

I assume it's yours? This one here.

MarkFL 08-04-2017 05:33 PM

Quote:

Originally Posted by Meestor_X (Post 2589170)
I assume it's yours? This one here.

Yes, I wasn't sure if that's what you are using. What version of vB are you running? I can test this on either vB 3.8.11 or vB 4.2.5...it's been so long since I did this I would have to get familiar with it again. I seem to recall it working correctly for me though.

Meestor_X 08-04-2017 05:44 PM

Quote:

Originally Posted by MarkFL (Post 2589171)
Yes, I wasn't sure if that's what you are using. What version of vB are you running? I can test this on either vB 3.8.11 or vB 4.2.5...it's been so long since I did this I would have to get familiar with it again. I seem to recall it working correctly for me though.

Thanks! I'm using 4.2.5. I had tried the direct modifications to the files in 4.2.3 and that had worked. Just trying the product version and as I say, it seems to work for posts, but not threads. Not sure if I'm doing something wrong, but it would be great if you could check it out as I love this hack. Saves me getting all sorts of double-posts because people don't realize their moderated posts won't show up until approved (and of course they never read the message they get that tells them the same)... ;-)

MarkFL 08-04-2017 09:09 PM

Yes, I know exactly what you mean...they post over and over and finally give up and usually don't return.

I'll check this out ASAP and post back. :)

MarkFL 08-05-2017 02:40 PM

Quote:

Originally Posted by Meestor_X (Post 2589173)
Thanks! I'm using 4.2.5. I had tried the direct modifications to the files in 4.2.3 and that had worked. Just trying the product version and as I say, it seems to work for posts, but not threads. Not sure if I'm doing something wrong, but it would be great if you could check it out as I love this hack. Saves me getting all sorts of double-posts because people don't realize their moderated posts won't show up until approved (and of course they never read the message they get that tells them the same)... ;-)

Okay, I just retested this on my dev site, and I found moderated users can see both their new threads and posts. :)

Meestor_X 08-11-2017 11:48 PM

Quote:

Originally Posted by MarkFL (Post 2589200)
Okay, I just retested this on my dev site, and I found moderated users can see both their new threads and posts. :)

I had mistakenly thought that it was partially working. I realize now that it doesn't work at all on my forum.
I'll try the direct file modification again and see if that works.

MarkFL 08-12-2017 12:01 AM

Quote:

Originally Posted by Meestor_X (Post 2589291)
I had mistakenly thought that it was partially working. I realize now that it doesn't work at all on my forum.
I'll try the direct file modification again and see if that works.

I would guess some other add-on is interfering.

Meestor_X 08-12-2017 12:31 AM

Quote:

Originally Posted by Skyrider (Post 2484950)
There a way this code can be converted to vBulletin 4? I tried it myself, but I keep getting a blank page.

I got blank pages as well until I did the change in post #2 differently.
I changed:
Code:

if ((!$thread['visible'] AND !can_moderate($thread['forumid'], 'canmoderateposts'))
    OR ($thread['isdeleted'] AND !can_moderate($thread['forumid'])))

TO:
Code:

if (($thread['isdeleted'] AND !can_moderate($thread['forumid'])))
Instead of what is shown in post #2.

I have no idea if I've broken something else by doing it this way, but at least it works now...


All times are GMT. The time now is 07:53 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.01418 seconds
  • Memory Usage 1,867KB
  • 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
  • (10)bbcode_code_printable
  • (4)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete