Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 05-26-2014, 03:50 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [Solved] How to allow some users to put threads without waiting moderation

Hello ,
i have Some forums require waiting moderation for threads and posts , I want to allow for some users to put threads without "waiting moderation" if them posts more than 5 .
and Does not show them this message "Thank you for posting! Your post will not be visible until a moderator has approved it for posting."


that's my try but not work,

Hook : newthread_form_complete

code :

PHP Code:
$moderator_advanced_forums $vbulletin->options['moderator_advanced_forums']; 
$moderator_advanced_forums1 explode(","$moderator_advanced_forums); 

if(
$vbulletin->options['moderator_advanced_onoff'
AND 
$vbulletin->userinfo['posts'] >= $vbulletin->options['moderator_advanced_posts'
AND 
in_array($threadinfo[forumid], $moderator_advanced_forums1) )
{
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX " thread SET visible = '1' where forumid in (".$moderator_advanced_forums.") 
AND postuserid = "
.$vbulletin->userinfo['userid']."
"
);
$vbulletin->db->query_write("DELETE FROM  " TABLE_PREFIX " moderation WHERE primaryid = ".$vbulletin->threadinfo['threadid']." AND type = 'thread' ");


Any suggestions or ideas ?!
Reply With Quote
  #2  
Old 05-26-2014, 04:34 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try using hook newpost_process and replace your 2 sql queries with this code:
Code:
$post['visible'] = 1;
Reply With Quote
  #3  
Old 05-26-2014, 04:42 PM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by omardealo View Post
i have Some forums require waiting moderation for threads and posts , I want to allow for some users to put threads without "waiting moderation" if them posts more than 5 .
If I understand you correctly...

You have forums that put new posts int moderation. You want members who have already made more than 5 posts to not be put into moderation.

If that is what you want to do, you can do that with user groups permissions and automatic promotions?you don't need a plugin.
Reply With Quote
  #4  
Old 05-26-2014, 05:00 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by darnoldy View Post
If I understand you correctly...

You have forums that put new posts int moderation. You want members who have already made more than 5 posts to not be put into moderation.

If that is what you want to do, you can do that with user groups permissions and automatic promotions—you don't need a plugin.
okay , but i don't want put all them in one group ... They are in more than 1 UserGroup

--------------- Added [DATE]1401127681[/DATE] at [TIME]1401127681[/TIME] ---------------

Quote:
Originally Posted by kh99 View Post
Try using hook newpost_process and replace your 2 sql queries with this code:
Code:
$post['visible'] = 1;
okay i change the hook and code , but still not work
note : the thread must be delete from table moderation , Even Do not be a list of wating moderation
PHP Code:
$moderator_advanced_forums explode(","$vbulletin->options['moderator_advanced_forums']); 
if(
$vbulletin->options['moderator_advanced_onoff'
AND 
$vbulletin->userinfo['posts'] >= $vbulletin->options['moderator_advanced_posts'
AND 
in_array($threadinfo[forumid], $moderator_advanced_forums) )
{
$post['visible'] = 1;

Reply With Quote
  #5  
Old 05-26-2014, 05:37 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by omardealo View Post
okay i change the hook and code , but still not work
note : the thread must be delete from table moderation , Even Do not be a list of wating moderation
If we can get that to work it should never be moderated, so you shouldn't have to remove it from the list.

Try adding this line in addition to what you have:
Code:
$dataman->set('visible', 1);
Reply With Quote
  #6  
Old 05-26-2014, 05:49 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
If we can get that to work it should never be moderated, so you shouldn't have to remove it from the list.

Try adding this line in addition to what you have:
Code:
$dataman->set('visible', 1);
yeah , you are right .. You made me think of it in the same way
and i try it already , but not worked ... i used more of hook
[ newpost_process,newpost_form_complete,newpost_comp lete, elc]

PHP Code:
if ($type == 'thread'

$dataman->setr('visible'1);
$dataman->save();

--------------- Added [DATE]1401130437[/DATE] at [TIME]1401130437[/TIME] ---------------

wait ... your code maybe working , I'm going to try it well
Reply With Quote
  #7  
Old 05-26-2014, 06:12 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code that sets visible=1 for no moderation is just before hook newpost_process, so I think that is the hook you want to use. The code looks like this:
PHP Code:
$dataman->set('visible'1);
$post['visible'] = 1
so you probably should set both. Also you should not call $dataman->save() because this is called later, and some error checking is done first.
Reply With Quote
Благодарность от:
omardealo
  #8  
Old 05-26-2014, 06:39 PM
omardealo's Avatar
omardealo omardealo is offline
 
Join Date: Nov 2008
Location: egypt
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
The code that sets visible=1 for no moderation is just before hook newpost_process, so I think that is the hook you want to use. The code looks like this:
PHP Code:
$dataman->set('visible'1);
$post['visible'] = 1
so you probably should set both. Also you should not call $dataman->save() because this is called later, and some error checking is done first.
thnx so much , you are my Hero :up:
your first code i think it working very good
and Thank you for clarifying it .

PHP Code:
if($vbulletin->options['moderator_advanced_onoff']  
AND 
$vbulletin->userinfo['posts'] >= $vbulletin->options['moderator_advanced_posts']  
AND 
in_array($foruminfo[forumid], $moderator_advanced_forums1) ) 

$dataman->set('visible'1); 

Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:08 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05384 seconds
  • Memory Usage 2,263KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (6)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete