Version: 1.00, by MoMan
Developer Last Online: Oct 2022
Category: Forum Display Enhancements -
Version: 3.8.7
Rating:
Released: 01-25-2012
Last Update: Never
Installs: 20
Re-useable Code Code Changes
No support by the author.
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.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
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']) . "))
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?)
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:
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
I updated the code for post #2
Thank You Very Much, I'll Try It and I'll Tell You How It Works. :up:
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.
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)?
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?
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?